Skip to content

Commit

Permalink
CppCheck shadow and const
Browse files Browse the repository at this point in the history
  • Loading branch information
rraustad committed Sep 16, 2024
1 parent 7e48f54 commit 8d8de9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/EnergyPlus/Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ constexpr std::array<Material::Gas, 10> gases = {

constexpr std::array<std::string_view, (int)EcoRoofCalcMethod::Num> ecoRoofCalcMethodNamesUC = {"SIMPLE", "ADVANCED"};

int GetMaterialNum(EnergyPlusData &state, std::string const &matName)
int GetMaterialNum(EnergyPlusData const &state, std::string const &matName)
{
auto const &s_mat = state.dataMaterial;
auto found = s_mat->materialMap.find(Util::makeUPPER(matName));
Expand Down Expand Up @@ -2496,14 +2496,14 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if
continue;
}

auto const &instances = itInstances.value();
auto itObj = instances.begin();
auto const &instances2 = itInstances.value();
auto itObj = instances2.begin();
// Can't use find here because epJSON keys are not upper-cased
for (; itObj != instances.end(); ++itObj) {
for (; itObj != instances2.end(); ++itObj) {
if (Util::makeUPPER(itObj.key()) == s_ipsc->cAlphaArgs(3)) break;
}

if (itObj == instances.end()) {
if (itObj == instances2.end()) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(3), s_ipsc->cAlphaArgs(3));
ErrorsFound = true;
continue;
Expand All @@ -2523,15 +2523,15 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if
continue;
}

auto const &instances = itInstances.value();
auto const &instances3 = itInstances.value();

auto itObj = instances.begin();
auto itObj = instances3.begin();
// Can't use find here because epJSON keys are not upper-cased
for (; itObj != instances.end(); ++itObj) {
for (; itObj != instances3.end(); ++itObj) {
if (Util::makeUPPER(itObj.key()) == s_ipsc->cAlphaArgs(4)) break;
}

if (itObj == instances.end()) {
if (itObj == instances3.end()) {
ShowSevereItemNotFound(state, eoh, s_ipsc->cAlphaFieldNames(4), s_ipsc->cAlphaArgs(4));
ErrorsFound = true;
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Material.hh
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ namespace Material {
~MaterialGlassTC() = default;
};

int GetMaterialNum(EnergyPlusData &state, std::string const &matName);
int GetMaterialNum(EnergyPlusData const &state, std::string const &matName);
MaterialBase *GetMaterial(EnergyPlusData &state, std::string const &matName);

void GetMaterialData(EnergyPlusData &state, bool &errorsFound); // set to true if errors found in input
Expand Down

0 comments on commit 8d8de9f

Please sign in to comment.