Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CppCheck InternalHeatGains #10736

Merged
merged 8 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/EnergyPlus/InputProcessing/IdfParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -659,14 +659,13 @@ std::string IdfParser::parse_string(std::string_view idf, size_t &index)
eat_whitespace(idf, index);

std::string str;
char c;

while (true) {
if (index == idf_size) {
break;
}

c = idf[index];
char c = idf[index];
increment_both_index(index, index_into_cur_line);
if (c == ',' || c == ';' || c == '!') {
decrement_both_index(index, index_into_cur_line);
Expand Down
23 changes: 10 additions & 13 deletions src/EnergyPlus/InputProcessing/InputProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,9 @@ void InputProcessor::getObjectItem(EnergyPlusData &state,
NumericFieldNames);
}

size_t extensible_count = 0;
auto const legacy_idd_extensibles_iter = legacy_idd.find("extensibles");
if (legacy_idd_extensibles_iter != legacy_idd.end()) {
size_t extensible_count = 0;
auto const epJSON_extensions_array_itr = obj_val.find(extension_key);
if (epJSON_extensions_array_itr != obj_val.end()) {
auto const &legacy_idd_extensibles = legacy_idd_extensibles_iter.value();
Expand Down Expand Up @@ -1738,21 +1738,18 @@ void InputProcessor::preProcessorCheck(EnergyPlusData &state, bool &PreP_Fatal)
// A11, \field message line 9
// A12; \field message line 10

int NumAlphas; // Used to retrieve names from IDF
int NumNumbers; // Used to retrieve rNumericArgs from IDF
int IOStat; // Could be used in the Get Routines, not currently checked
int NumParams; // Total Number of Parameters in 'Output:PreprocessorMessage' Object
int NumPrePM; // Number of Preprocessor Message objects in IDF
int CountP;
int CountM;
std::string Multiples;

state.dataIPShortCut->cCurrentModuleObject = "Output:PreprocessorMessage";
NumPrePM = getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject);
int NumPrePM = getNumObjectsFound(state, state.dataIPShortCut->cCurrentModuleObject);
if (NumPrePM > 0) {
int NumAlphas; // Used to retrieve names from IDF
int NumNumbers; // Used to retrieve rNumericArgs from IDF
int IOStat; // Could be used in the Get Routines, not currently checked
int NumParams; // Total Number of Parameters in 'Output:PreprocessorMessage' Object
std::string Multiples;

getObjectDefMaxArgs(state, state.dataIPShortCut->cCurrentModuleObject, NumParams, NumAlphas, NumNumbers);
state.dataIPShortCut->cAlphaArgs({1, NumAlphas}) = BlankString;
for (CountP = 1; CountP <= NumPrePM; ++CountP) {
for (int CountP = 1; CountP <= NumPrePM; ++CountP) {
getObjectItem(state,
state.dataIPShortCut->cCurrentModuleObject,
CountP,
Expand Down Expand Up @@ -1797,7 +1794,7 @@ void InputProcessor::preProcessorCheck(EnergyPlusData &state, bool &PreP_Fatal)
"\" has the following " + state.dataIPShortCut->cAlphaArgs(2) + " condition" + Multiples + ':');
}
}
CountM = 3;
int CountM = 3;
if (CountM > NumAlphas) {
ShowContinueError(state,
state.dataIPShortCut->cCurrentModuleObject + " was blank. Check " + state.dataIPShortCut->cAlphaArgs(1) +
Expand Down
Loading