-
Notifications
You must be signed in to change notification settings - Fork 461
CppCheck Cleanup Shadow Variables #11396
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
Conversation
| SetupWeekDaysByMonth(state, runPerInput1.startMonth, runPerInput1.startDay, runPerInput1.dayOfWeek, runPerInput1.monWeekDay); | ||
| } | ||
| } else if (nRunPeriods > 1 && state.dataSysVars->FullAnnualRun) { | ||
| nRunPeriods = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I"m not saying this change is wrong but this comment says nRunPeriods was intended to be a reference argument.
if (state.dataSysVars->FullAnnualRun) {
// GetRunPeriodData may have reset the value of TotRunPers
state.dataWeather->NumOfEnvrn = state.dataEnvrn->TotDesDays + state.dataWeather->TotRunPers + RPD1 + RPD2;
}
Wondering when/if nRunPeriods should ever be changed back to 1 I see the FullAnnualSimulation environment variable which makes me wonder how that environment variable should affect the simulation.
cEnvValue = std::getenv(FullAnnualSimulation);
state.dataSysVars->FullAnnualRun = env_var_on(cEnvValue ? cEnvValue : ""); // Yes or True
if (state.dataGlobal->AnnualSimulation) state.dataSysVars->FullAnnualRun = true;
if (state.dataWeather->TotRunPers >= 1 || state.dataSysVars->FullAnnualRun) {
GetRunPeriodData(state, state.dataWeather->TotRunPers, ErrorsFound);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rraustad. I'm putting this back for now. I did a quick test where I put it back and made nRunPeriods a reference, but things broke pretty quickly, and it would need more effort to untangle.
|
All done here. Thanks @dareumnam and @rraustad. |
Pull request overview
Description of the purpose of this PR
Pull Request Author
Reviewer