Skip to content

Commit

Permalink
Fix cppcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
macumber committed Dec 27, 2020
1 parent f6217f0 commit c9beade
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/model_editor/InspectorDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ openstudio::model::Model InspectorDialog::model() const {
return m_model;
}

void InspectorDialog::setModel(openstudio::model::Model& model, bool force) {
void InspectorDialog::setModel(const openstudio::model::Model& model, bool force) {
if ((model == m_model) && !force) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/model_editor/InspectorDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class MODELEDITOR_API InspectorDialog : public QMainWindow, public Nano::Observe
openstudio::model::Model model() const;

// point the dialog at a new model
void setModel(openstudio::model::Model& model, bool force = false);
void setModel(const openstudio::model::Model& model, bool force = false);

// void rebuild inspector gadget
void rebuildInspectorGadget(bool recursive);
Expand Down
4 changes: 2 additions & 2 deletions src/model_editor/InspectorGadget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@ void InspectorGadget::layoutComboBox(QVBoxLayout* layout, QWidget* parent, opens
combo->addItem("");
}

for (const std::string& name : names) {
combo->addItem(name.c_str());
for (const std::string& thisName : names) {
combo->addItem(thisName.c_str());
}
} else {
if (!prop.required) {
Expand Down
4 changes: 2 additions & 2 deletions src/model_editor/InspectorGadget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class MODELEDITOR_API InspectorGadget : public QWidget, public Nano::Observer
* parameter to true
*
*/
void layoutModelObj(openstudio::WorkspaceObject& workObj, bool force = false, bool recursive = true, bool locked = false,
void layoutModelObj(openstudio::WorkspaceObject& workspaceObj, bool force = false, bool recursive = true, bool locked = false,
bool hideChildren = false);

/*! \brief sets the display precision for number fields
Expand Down Expand Up @@ -302,7 +302,7 @@ class MODELEDITOR_API InspectorGadget : public QWidget, public Nano::Observer
const std::string& name, const std::string& curVal, int index, const std::string& comment, bool exists, bool number,
bool real = false);

void layoutComboBox(QVBoxLayout* layout, QWidget* parent, openstudio::IddField& field, openstudio::IddFieldProperties& properties,
void layoutComboBox(QVBoxLayout* layout, QWidget* parent, openstudio::IddField& field, openstudio::IddFieldProperties& prop,
const std::string& name, const std::string& curVal, int index, const std::string& comment, bool exists);

void createExtensibleToolBar(QVBoxLayout* layout, QWidget* parent, const openstudio::IddObjectProperties& props);
Expand Down
52 changes: 26 additions & 26 deletions src/shared_gui_components/OSConcepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,12 @@ class CheckBoxConceptBoolReturnImpl : public CheckBoxConceptBoolReturn

virtual ~CheckBoxConceptBoolReturnImpl() {}

virtual bool get(const ConceptProxy& t_obj) {
virtual bool get(const ConceptProxy& t_obj) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_getter(&obj);
}

virtual bool set(const ConceptProxy& t_obj, bool value) {
virtual bool set(const ConceptProxy& t_obj, bool value) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_setter(&obj, value);
}
Expand Down Expand Up @@ -769,24 +769,24 @@ class ValueEditConceptImpl : public ValueEditConcept<ValueType>

virtual ~ValueEditConceptImpl() {}

virtual ValueType get(const ConceptProxy& t_obj) {
virtual ValueType get(const ConceptProxy& t_obj) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_getter(&obj);
}

virtual bool set(const ConceptProxy& t_obj, ValueType value) {
virtual bool set(const ConceptProxy& t_obj, ValueType value) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_setter(&obj, value);
}

virtual void reset(const ConceptProxy& t_obj) {
virtual void reset(const ConceptProxy& t_obj) override {
if (m_reset) {
DataSourceType obj = t_obj.cast<DataSourceType>();
(*m_reset)(&obj);
}
}

virtual bool isDefaulted(const ConceptProxy& t_obj) {
virtual bool isDefaulted(const ConceptProxy& t_obj) override {
if (m_isDefaulted) {
DataSourceType obj = t_obj.cast<DataSourceType>();
return (*m_isDefaulted)(&obj);
Expand Down Expand Up @@ -826,12 +826,12 @@ class OptionalValueEditConceptImpl : public OptionalValueEditConcept<ValueType>

virtual ~OptionalValueEditConceptImpl() {}

virtual boost::optional<ValueType> get(const ConceptProxy& t_obj) {
virtual boost::optional<ValueType> get(const ConceptProxy& t_obj) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_getter(&obj);
}

virtual bool set(const ConceptProxy& t_obj, ValueType value) {
virtual bool set(const ConceptProxy& t_obj, ValueType value) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_setter(&obj, value);
}
Expand Down Expand Up @@ -869,24 +869,24 @@ class ValueEditVoidReturnConceptImpl : public ValueEditVoidReturnConcept<ValueTy

virtual ~ValueEditVoidReturnConceptImpl() {}

virtual ValueType get(const ConceptProxy& t_obj) {
virtual ValueType get(const ConceptProxy& t_obj) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_getter(&obj);
}

virtual void set(const ConceptProxy& t_obj, ValueType value) {
virtual void set(const ConceptProxy& t_obj, ValueType value) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_setter(&obj, value);
}

virtual void reset(const ConceptProxy& t_obj) {
virtual void reset(const ConceptProxy& t_obj) override {
if (m_reset) {
DataSourceType obj = t_obj.cast<DataSourceType>();
(*m_reset)(&obj);
}
}

virtual bool isDefaulted(const ConceptProxy& t_obj) {
virtual bool isDefaulted(const ConceptProxy& t_obj) override {
if (m_isDefaulted) {
DataSourceType obj = t_obj.cast<DataSourceType>();
return (*m_isDefaulted)(&obj);
Expand Down Expand Up @@ -926,12 +926,12 @@ class OptionalValueEditVoidReturnConceptImpl : public OptionalValueEditVoidRetur

virtual ~OptionalValueEditVoidReturnConceptImpl() {}

virtual boost::optional<ValueType> get(const ConceptProxy& t_obj) {
virtual boost::optional<ValueType> get(const ConceptProxy& t_obj) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_getter(&obj);
}

virtual void set(const ConceptProxy& t_obj, ValueType value) {
virtual void set(const ConceptProxy& t_obj, ValueType value) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_setter(&obj, value);
}
Expand Down Expand Up @@ -1132,24 +1132,24 @@ class QuantityEditConceptImpl : public QuantityEditConcept<ValueType>

virtual ~QuantityEditConceptImpl() {}

virtual ValueType get(const ConceptProxy& t_obj) {
virtual ValueType get(const ConceptProxy& t_obj) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_getter(&obj);
}

virtual bool set(const ConceptProxy& t_obj, ValueType value) {
virtual bool set(const ConceptProxy& t_obj, ValueType value) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_setter(&obj, value);
}

virtual void reset(const ConceptProxy& t_obj) {
virtual void reset(const ConceptProxy& t_obj) override {
if (m_reset) {
DataSourceType obj = t_obj.cast<DataSourceType>();
(*m_reset)(&obj);
}
}

virtual bool isDefaulted(const ConceptProxy& t_obj) {
virtual bool isDefaulted(const ConceptProxy& t_obj) override {
if (m_isDefaulted) {
DataSourceType obj = t_obj.cast<DataSourceType>();
return (*m_isDefaulted)(&obj);
Expand Down Expand Up @@ -1211,12 +1211,12 @@ class OptionalQuantityEditConceptImpl : public OptionalQuantityEditConcept<Value

virtual ~OptionalQuantityEditConceptImpl() {}

virtual boost::optional<ValueType> get(const ConceptProxy& t_obj) {
virtual boost::optional<ValueType> get(const ConceptProxy& t_obj) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_getter(&obj);
}

virtual bool set(const ConceptProxy& t_obj, ValueType value) {
virtual bool set(const ConceptProxy& t_obj, ValueType value) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_setter(&obj, value);
}
Expand Down Expand Up @@ -1280,24 +1280,24 @@ class QuantityEditVoidReturnConceptImpl : public QuantityEditVoidReturnConcept<V

virtual ~QuantityEditVoidReturnConceptImpl() {}

virtual ValueType get(const ConceptProxy& t_obj) {
virtual ValueType get(const ConceptProxy& t_obj) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_getter(&obj);
}

virtual void set(const ConceptProxy& t_obj, ValueType value) {
virtual void set(const ConceptProxy& t_obj, ValueType value) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_setter(&obj, value);
}

virtual void reset(const ConceptProxy& t_obj) {
virtual void reset(const ConceptProxy& t_obj) override {
if (m_reset) {
DataSourceType obj = t_obj.cast<DataSourceType>();
(*m_reset)(&obj);
}
}

virtual bool isDefaulted(const ConceptProxy& t_obj) {
virtual bool isDefaulted(const ConceptProxy& t_obj) override {
if (m_isDefaulted) {
DataSourceType obj = t_obj.cast<DataSourceType>();
return (*m_isDefaulted)(&obj);
Expand Down Expand Up @@ -1361,12 +1361,12 @@ class OptionalQuantityEditVoidReturnConceptImpl : public OptionalQuantityEditVoi

virtual ~OptionalQuantityEditVoidReturnConceptImpl() {}

virtual boost::optional<ValueType> get(const ConceptProxy& t_obj) {
virtual boost::optional<ValueType> get(const ConceptProxy& t_obj) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_getter(&obj);
}

virtual void set(const ConceptProxy& t_obj, ValueType value) {
virtual void set(const ConceptProxy& t_obj, ValueType value) override {
DataSourceType obj = t_obj.cast<DataSourceType>();
return m_setter(&obj, value);
}
Expand Down

0 comments on commit c9beade

Please sign in to comment.