-
Notifications
You must be signed in to change notification settings - Fork 418
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
CppCheck InternalHeatGains #10736
Conversation
@@ -367,8 +365,6 @@ namespace InternalHeatGains { | |||
format("Schedule=\"{}\". Minimum is [{:.1R}]. Values must be >= 0.0.", IHGAlphas(3), SchMin)); | |||
ErrorsFound = true; | |||
} | |||
} | |||
if (Item1 == 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.
[src/EnergyPlus/InternalHeatGains.cc:371]:(style),[duplicateCondition],The if condition is the same as the previous if condition
@@ -1096,35 +1090,35 @@ namespace InternalHeatGains { | |||
} | |||
} | |||
|
|||
for (int peopleNum = 1; peopleNum <= state.dataHeatBal->TotPeople; ++peopleNum) { | |||
for (int peopleNum2 = 1; peopleNum2 <= state.dataHeatBal->TotPeople; ++peopleNum2) { |
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.
Lots of these:
[src/EnergyPlus/InternalHeatGains.cc:1099]:(style),[shadowVariable],Local variable 'peopleNum' shadows outer variable
liteName, | ||
GetScheduleName(state, state.dataHeatBal->Lights(lightsNum2).SchedPtr)); | ||
PreDefTableEntry( | ||
state, state.dataOutRptPredefined->pdchInLtRetAir, liteName, state.dataHeatBal->Lights(lightsNum2).FractionReturnAir, 4); |
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.
This does look strange but it's a result of changing lightNum to lightNum2. Diffs should show if this is good.
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.
The lack of diffs shows this is good then.
@@ -1216,7 +1216,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if | |||
matGas->ROnly = true; | |||
|
|||
for (NumGas = 0; NumGas < NumGases; ++NumGas) { | |||
GasType gasType = matGas->gases[NumGas].type; | |||
gasType = matGas->gases[NumGas].type; |
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.
[src/EnergyPlus/Material.cc:1219]:(style),[shadowVariable],Local variable 'gasType' shadows outer variable
[
All clean, and runs fine locally. I'm a little nervous about dropping anything else in, but this is clean and simple. Thanks @rraustad |
Pull request overview
NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.