-
Notifications
You must be signed in to change notification settings - Fork 475
Fix cppcheck errors: final follow-up
#11584
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
Changes from all commits
2b6e7b0
1b6e669
a5a0485
9a2af19
f86defa
bb24caf
f062ca0
bb49211
5f4fe7b
b06afe3
492a893
72c2979
122a56c
7b4b020
a7cdb4e
162db20
59229e4
c8e3c21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5041,12 +5041,12 @@ namespace AirflowNetwork { | |
| if (simulation_control.DuctLoss) { | ||
| // Assign node num based on Distribution node | ||
| for (int i = 1; i <= AirflowNetworkNumOfLinks; ++i) { | ||
| for (int k = 1; k <= DisSysNumOfNodes; ++k) { | ||
| if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[0], DisSysNodeData(k).Name)) { | ||
| AirflowNetworkLinkageData(i).NodeNums[0] = k; | ||
| for (int l = 1; l <= DisSysNumOfNodes; ++l) { | ||
| if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[0], DisSysNodeData(l).Name)) { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This local |
||
| AirflowNetworkLinkageData(i).NodeNums[0] = l; | ||
| } | ||
| if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[1], DisSysNodeData(k).Name)) { | ||
| AirflowNetworkLinkageData(i).NodeNums[1] = k; | ||
| if (Util::SameString(AirflowNetworkLinkageData(i).NodeNames[1], DisSysNodeData(l).Name)) { | ||
| AirflowNetworkLinkageData(i).NodeNums[1] = l; | ||
| } | ||
| } | ||
| if (AirflowNetworkLinkageData(i).NodeNums[0] == 0) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -248,8 +248,8 @@ namespace BaseboardRadiator { | |
| static constexpr std::string_view availabilityScheduleFieldName = "Availability Schedule Name"; | ||
| static constexpr std::string_view heatingDesignCapacityMethodFieldName = "Heating Design Capacity Method"; | ||
|
|
||
| int ConvHWBaseboardNum = 0; | ||
| if (baseboardObjects != inputProcessor->epJSON.end()) { | ||
| int ConvHWBaseboardNum = 0; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| for (auto const &baseboardInstance : baseboardObjects.value().items()) { | ||
| auto const &baseboardFields = baseboardInstance.value(); | ||
| auto const baseboardName = Util::makeUPPER(baseboardInstance.key()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,8 +171,8 @@ namespace BoilerSteam { | |
| auto const &boilerSchemaProps = inputProcessor->getObjectSchemaProps(state, state.dataIPShortCut->cCurrentModuleObject); | ||
| auto const boilerObjects = inputProcessor->epJSON.find(state.dataIPShortCut->cCurrentModuleObject); | ||
|
|
||
| int BoilerNum = 1; | ||
| if (boilerObjects != inputProcessor->epJSON.end()) { | ||
| int BoilerNum = 1; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue as the |
||
| for (auto const &boilerInstance : boilerObjects.value().items()) { | ||
| auto const &boilerFields = boilerInstance.value(); | ||
| auto const boilerName = Util::makeUPPER(boilerInstance.key()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -325,7 +325,7 @@ namespace EMSManager { | |
| state.dataRuntimeLang->NumExternalInterfaceFunctionalMockupUnitImportActuatorsUsed + | ||
| state.dataRuntimeLang->NumExternalInterfaceFunctionalMockupUnitExportActuatorsUsed; | ||
| ++ActuatorUsedLoop) { | ||
| auto &thisActuatorUsed = state.dataRuntimeLang->EMSActuatorUsed(ActuatorUsedLoop); | ||
| auto const &thisActuatorUsed = state.dataRuntimeLang->EMSActuatorUsed(ActuatorUsedLoop); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| int ErlVariableNum = thisActuatorUsed.ErlVariableNum; | ||
| if (ErlVariableNum <= 0) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -212,8 +212,8 @@ namespace ElectricBaseboardRadiator { | |
| static constexpr std::string_view radiantSurfaceFractionFieldName = "Fraction of Radiant Energy to Surface"; | ||
| auto const &surfaceFractionSchemaProps = elecBaseboardSchemaProps.at("surface_fractions").at("items").at("properties"); | ||
|
|
||
| int BaseboardNum = 0; | ||
| if (elecBaseboardObjects != inputProcessor->epJSON.end()) { | ||
| int BaseboardNum = 0; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. |
||
| for (auto const &elecBaseboardInstance : elecBaseboardObjects.value().items()) { | ||
| auto const &elecBaseboardFields = elecBaseboardInstance.value(); | ||
| auto const elecBaseboardName = Util::makeUPPER(elecBaseboardInstance.key()); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,7 +207,7 @@ namespace FileSystem { | |
| // * | ||
| // * To resolve symlinks, wrap this call in getAbsolutePath(). | ||
| // */ | ||
| char executableRelativePath[1024]; | ||
| char executableRelativePath[1024] = {'\0'}; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| #ifdef __APPLE__ | ||
| uint32_t pathSize = sizeof(executableRelativePath); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -706,7 +706,6 @@ namespace Furnaces { | |
| if (errorFound) { | ||
| ShowSevereError(state, EnergyPlus::format("The index of \"{}\" is not found", thisFurnace.SuppHeatCoilName)); | ||
| ShowContinueError(state, EnergyPlus::format("...occurs for {}", thisFurnace.Name)); | ||
| errorFound = false; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The last |
||
| } | ||
| state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = | ||
| max(refAFNLoopHeatingCoilMaxRTF, heatingCoilRTF, suppHeatingCoilRTF); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1116,7 +1116,7 @@ namespace HVACDXHeatPumpSystem { | |
| if (state.dataHVACDXHeatPumpSys->NumDXHeatPumpSystems > 0) { | ||
| int DXHeatSysNum = Util::FindItemInList(DXHeatCoilSysName, state.dataHVACDXHeatPumpSys->DXHeatPumpSystem); | ||
| if (DXHeatSysNum > 0 && DXHeatSysNum <= state.dataHVACDXHeatPumpSys->NumDXHeatPumpSystems) { | ||
| auto &dxhpSystem = state.dataHVACDXHeatPumpSys->DXHeatPumpSystem(DXHeatSysNum); | ||
| auto const &dxhpSystem = state.dataHVACDXHeatPumpSys->DXHeatPumpSystem(DXHeatSysNum); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used to read. |
||
| NodeNum = dxhpSystem.DXHeatPumpCoilInletNodeNum; | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7326,7 +7326,7 @@ void SetCompFlowRate(EnergyPlusData &state, int const VRFTUNum, int const VRFCon | |
| int IndexToTUInTUList; // - index to TU in specific list for this VRF system | ||
| int TUListIndex; // index to TU list for this VRF system | ||
|
|
||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used to read. |
||
| IndexToTUInTUList = vrfTU.IndexToTUInTUList; | ||
| TUListIndex = vrfTU.TUListIndex; | ||
|
|
||
|
|
@@ -8272,18 +8272,18 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) | |
| auto &vrfTUList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum); | ||
| for (int NumTU = 1; NumTU <= vrfTUList.NumTUInList; ++NumTU) { | ||
| int TUIndex = vrfTUList.ZoneTUPtr(NumTU); | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
| if (vrfTU.CoolCoilIndex > 0) { | ||
| DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, vrfTU.CoolCoilIndex, vrfTU.coolCoilType, errFlag); | ||
| auto &vrfTUobj = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| if (vrfTUobj.CoolCoilIndex > 0) { | ||
| DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, vrfTUobj.CoolCoilIndex, vrfTUobj.coolCoilType, errFlag); | ||
| TUCoolingCapacity += DXCoilCap; | ||
| if (DXCoilCap == AutoSize) { | ||
| FoundAll = false; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| if (vrfTU.HeatCoilIndex > 0) { | ||
| DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, vrfTU.HeatCoilIndex, vrfTU.heatCoilType, errFlag); | ||
| if (vrfTUobj.HeatCoilIndex > 0) { | ||
| DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, vrfTUobj.HeatCoilIndex, vrfTUobj.heatCoilType, errFlag); | ||
| TUHeatingCapacity += DXCoilCap; | ||
| if (DXCoilCap == AutoSize) { | ||
| FoundAll = false; | ||
|
|
@@ -10455,7 +10455,7 @@ int GetVRFTUOutAirNode(EnergyPlusData &state, int const VRFTUNum) | |
| } | ||
|
|
||
| if (VRFTUNum > 0 && VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU) { | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used to read. |
||
| return vrfTU.VRFTUOAMixerOANodeNum; | ||
| } | ||
| return 0; | ||
|
|
@@ -10479,7 +10479,7 @@ int GetVRFTUZoneInletAirNode(EnergyPlusData &state, int const VRFTUNum) | |
| } | ||
|
|
||
| if (VRFTUNum > 0 && VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU) { | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used to read. |
||
| return vrfTU.VRFTUOutletNodeNum; | ||
| } | ||
| return 0; | ||
|
|
@@ -10547,7 +10547,7 @@ int GetVRFTUMixedAirNode(EnergyPlusData &state, int const VRFTUNum) | |
| } | ||
|
|
||
| if (VRFTUNum > 0 && VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU) { | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used to read. |
||
| return vrfTU.VRFTUOAMixerOANodeNum; | ||
| } | ||
| return 0; | ||
|
|
@@ -10571,7 +10571,7 @@ int GetVRFTUReturnAirNode(EnergyPlusData &state, int const VRFTUNum) | |
| } | ||
|
|
||
| if (VRFTUNum > 0 && VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU) { | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used to read. |
||
| return vrfTU.VRFTUOAMixerRetNodeNum; | ||
| } | ||
| return 0; | ||
|
|
@@ -14936,7 +14936,7 @@ void VRFCondenserEquipment::VRFOU_PipeLossC( | |
| NumIUActivated = 0; | ||
| for (int NumTU = 1; NumTU <= NumTUInList; ++NumTU) { | ||
| int TUIndex = vrfTUList.ZoneTUPtr(NumTU); | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used to read. |
||
| int CoilIndex = vrfTU.CoolCoilIndex; | ||
|
|
||
| if (state.dataDXCoils->DXCoil(CoilIndex).TotalCoolingEnergyRate > 0.0) { | ||
|
|
@@ -15096,7 +15096,7 @@ void VRFCondenserEquipment::VRFOU_PipeLossH( | |
| NumIUActivated = 0; | ||
| for (int NumTU = 1; NumTU <= NumTUInList; ++NumTU) { | ||
| int TUIndex = vrfTUList.ZoneTUPtr(NumTU); | ||
| auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
| auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(TUIndex); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used to read. |
||
| int CoilIndex = vrfTU.HeatCoilIndex; | ||
|
|
||
| if (state.dataDXCoils->DXCoil(CoilIndex).TotalHeatingEnergyRate > 0.0) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ | |
|
|
||
| namespace EnergyPlus::HeatBalanceKivaManager { | ||
|
|
||
| // cppcheck-suppress passedByValueCallback | ||
| void kivaErrorCallback(const int messageType, const std::string message, void *contextPtr) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| { | ||
| if (contextPtr == nullptr) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5310,10 +5310,8 @@ void UpdateThermalHistories(EnergyPlusData &state) | |
| SurfOutsideTempCurr * construct.CTFTUserOut[0] + state.dataHeatBalSurf->SurfTempIn(SurfNum) * construct.CTFTUserIn[0] + | ||
| state.dataHeatBalSurf->SurfQsrcHist(SurfNum, 1) * construct.CTFTUserSource[0] + | ||
| state.dataHeatBalFanSys->CTFTuserConstPart(SurfNum); | ||
| } | ||
|
|
||
| // Set current outside flux: | ||
| if (construct.SourceSinkPresent) { | ||
| // Set current outside flux: | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The second and third |
||
| state.dataHeatBalSurf->SurfOutsideFluxHist(1)(SurfNum) = | ||
| SurfOutsideTempCurr * construct.CTFOutside[0] - state.dataHeatBalSurf->SurfTempIn(SurfNum) * construct.CTFCross[0] + | ||
| state.dataHeatBalSurf->SurfQsrcHist(SurfNum, 1) * construct.CTFSourceOut[0] + | ||
|
|
@@ -9936,7 +9934,7 @@ void InitSurfacePropertyViewFactors(EnergyPlusData &state) | |
| } | ||
| if (Surface.IsSurfPropertyGndSurfacesDefined) { | ||
| GndSurfsNum = Surface.SurfPropertyGndSurfIndex; | ||
| auto &GrndSurfsProperty = state.dataSurface->GroundSurfsProperty(GndSurfsNum); | ||
| auto const &GrndSurfsProperty = state.dataSurface->GroundSurfsProperty(GndSurfsNum); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only used to read. |
||
| GroundSurfsViewFactor = GrndSurfsProperty.SurfsViewFactorSum; | ||
| IsGroundViewFactorSet = GrndSurfsProperty.IsGroundViewFactorSet; | ||
| SrdSurfsViewFactor += GroundSurfsViewFactor; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13879,7 +13879,7 @@ void WriteHeatEmissionTable(EnergyPlusData &state) | |
|
|
||
| if (state.dataOutRptTab->displayHeatEmissionsSummary) { | ||
|
|
||
| for (auto ¤tStyle : ort->tabularReportPasses) { | ||
| for (auto const ¤tStyle : ort->tabularReportPasses) { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are read-only here. |
||
|
|
||
| if (currentStyle.produceTabular) { | ||
| WriteReportHeaders(state, "Annual Heat Emissions Report", "Entire Facility", OutputProcessor::StoreType::Average); | ||
|
|
@@ -14964,7 +14964,7 @@ void ComputeLoadComponentDecayCurve(EnergyPlusData &state) | |
| int coolDesSelected = state.dataSize->CalcFinalZoneSizing(zoneNum).CoolDDNum; | ||
| // loop over timesteps after pulse occurred | ||
| if (coolDesSelected != 0) { | ||
| auto &surfCLClDay = ort->surfCompLoads[coolDesSelected - 1]; | ||
| auto const &surfCLClDay = ort->surfCompLoads[coolDesSelected - 1]; | ||
| int timeOfPulse = ort->radiantPulseTimestep(coolDesSelected, zoneNum); | ||
| // if the CoolDesSelected time is on a different day than | ||
| // when the pulse occurred, need to scan back and find when | ||
|
|
@@ -14992,7 +14992,7 @@ void ComputeLoadComponentDecayCurve(EnergyPlusData &state) | |
| } | ||
| int const heatDesSelected = state.dataSize->CalcFinalZoneSizing(zoneNum).HeatDDNum; | ||
| if (heatDesSelected != 0) { | ||
| auto &surfCLHtDay = ort->surfCompLoads[heatDesSelected - 1]; | ||
| auto const &surfCLHtDay = ort->surfCompLoads[heatDesSelected - 1]; | ||
| int timeOfPulse = ort->radiantPulseTimestep(heatDesSelected, zoneNum); | ||
| // scan back to the day that the heating pulse occurs, if necessary | ||
| if (timeOfPulse == 0) { | ||
|
|
||
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.
In the
non-OpenMPpath,number_of_threads = 1is assigned inside the if block but never read afterward. Removed the dead assignment.