Skip to content

Commit

Permalink
Silence some compiler warnings (since when did double const become an…
Browse files Browse the repository at this point in the history
… error?)
  • Loading branch information
amirroth committed Aug 20, 2024
1 parent 0e009d2 commit 3eba56a
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 75 deletions.
3 changes: 1 addition & 2 deletions src/EnergyPlus/DaylightingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7658,8 +7658,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state,
auto const *matBlind = dynamic_cast<Material::MaterialBlind const *>(s_mat->materials(surfShade.blind.matNum));
assert(matBlind != nullptr);

Real64 ProfAng = ProfileAngle(state, IWin, s_surf->SurfSunCosHourly(IHR), matBlind->SlatOrientation);
// Are these really cached?
// These are "cached" in the surfShade struct
auto &btar = surfShade.blind.TAR;
int idxLo = surfShade.blind.profAngIdxLo;
int idxHi = surfShade.blind.profAngIdxHi;
Expand Down
2 changes: 0 additions & 2 deletions src/EnergyPlus/Fans.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ namespace EnergyPlus::Fans {
// To encapsulate the data and algorithms required to
// manage the Fan System Component

constexpr std::array<std::string_view, (int)MinFlowFracMethod::Num> minFlowFracMethodNames = {"Fraction", "FixedFlowRate"};

constexpr std::array<std::string_view, (int)MinFlowFracMethod::Num> minFlowFracMethodNamesUC = {"FRACTION", "FIXEDFLOWRATE"};

void FanBase::simulate(EnergyPlusData &state,
Expand Down
8 changes: 2 additions & 6 deletions src/EnergyPlus/HeatBalanceHAMTManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ namespace HeatBalanceHAMTManager {

Array1D<Real64> NumArray;

Real64 dumrh;
Real64 dumdata;
Real64 avdata;

int MaxNums;
Expand All @@ -189,8 +187,6 @@ namespace HeatBalanceHAMTManager {
int HAMTitems;
int vtcsid;

bool avflag;
bool isoerrrise;
bool ErrorsFound;

auto &s_ip = state.dataInputProcessing->inputProcessor;
Expand Down Expand Up @@ -714,14 +710,14 @@ namespace HeatBalanceHAMTManager {
++errorCount;
}
if (matHAMT->nsuc < 0) {
ShowSevereError(state, format("{}Construction={}", RoutineName, state.dataConstruction->Construct(conid).Name));
ShowSevereError(state, format("{}Construction={}", RoutineName, constr.Name));
ShowContinueError(
state,
format("Reference Material=\"{}\" does not have required liquid transport coefficient (suction) data.", mat->Name));
++errorCount;
}
if (matHAMT->nred < 0) {
ShowSevereError(state, format("{}Construction={}", RoutineName, state.dataConstruction->Construct(conid).Name));
ShowSevereError(state, format("{}Construction={}", RoutineName, constr.Name));
ShowContinueError(state,
format("Reference Material=\"{}\" does not have required liquid transport coefficient (redistribution) data.",
mat->Name));
Expand Down
2 changes: 0 additions & 2 deletions src/EnergyPlus/HeatBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,6 @@ namespace HeatBalanceManager {
// Window5 data file
bool EOFonW5File; // True if EOF encountered reading Window5 data file

int iMatGlass; // number of glass layers
Array1D_string WConstructNames;

auto &s_ipsc = state.dataIPShortCut;
Expand Down Expand Up @@ -1493,7 +1492,6 @@ namespace HeatBalanceManager {
assert(matGlassTC != nullptr);

thisConstruct.LayerPoint(Layer) = matGlassTC->matRefs(1).matNum;
if (s_mat->materials(thisConstruct.LayerPoint(Layer))->group == Material::Group::Glass) ++iMatGlass;
thisConstruct.isTCWindow = true;
thisConstruct.isTCMaster = true;
thisConstruct.TCMasterConstrNum = ConstrNum;
Expand Down
17 changes: 11 additions & 6 deletions src/EnergyPlus/HeatRecovery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ namespace HeatRecovery {

// call the correct heat exchanger calculation routine
switch (state.dataHeatRecovery->ExchCond(HeatExchNum).type) {
case HVAC::HXType::AirToAir_FlatPlate:
case HVAC::HXType::AirToAir_FlatPlate: {
thisExch.CalcAirToAirPlateHeatExch(state, HXUnitOn, EconomizerFlag, HighHumCtrlFlag);
break;
} break;

case HVAC::HXType::AirToAir_Generic:
case HVAC::HXType::AirToAir_Generic: {
thisExch.CalcAirToAirGenericHeatExch(state, HXUnitOn, FirstHVACIteration, fanOp, EconomizerFlag, HighHumCtrlFlag, HXPartLoadRatio);
break;
} break;

case HVAC::HXType::Desiccant_Balanced:
case HVAC::HXType::Desiccant_Balanced: {
Real64 PartLoadRatio = present(HXPartLoadRatio) ? Real64(HXPartLoadRatio) : 1.0; // Part load ratio requested of DX compressor
bool RegInIsOANode = present(RegenInletIsOANode) && bool(RegenInletIsOANode);
thisExch.CalcDesiccantBalancedHeatExch(state,
Expand All @@ -215,7 +215,12 @@ namespace HeatRecovery {
RegInIsOANode,
EconomizerFlag,
HighHumCtrlFlag);
break;
} break;

default: {
assert(false);
} break;

}

thisExch.UpdateHeatRecovery(state);
Expand Down
2 changes: 0 additions & 2 deletions src/EnergyPlus/IntegratedHeatPump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1612,8 +1612,6 @@ void ClearCoils(EnergyPlusData &state, int const DXCoilNum)
{
using VariableSpeedCoils::SimVariableSpeedCoils;

HVAC::FanOp fanOp = HVAC::FanOp::Cycling; // fan cycl manner place holder

// Obtains and Allocates WatertoAirHP related parameters from input file
if (state.dataIntegratedHP->GetCoilsInputFlag) { // First time subroutine has been entered
GetIHPInput(state);
Expand Down
6 changes: 0 additions & 6 deletions src/EnergyPlus/Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if
int NumAlphas; // Number of material alpha names being passed
int NumNums; // Number of material properties being passed

int EcoRoofMat; // Materials for ecoRoof
int NumGas; // Index for loop over gap gases in a mixture
int NumGases; // Number of gasses in a mixture
GasType gasType = GasType::Invalid; // Gas type index: 1=air, 2=argon, 3=krypton, 4=xenon
int Loop;
int ICoeff; // Gas property coefficient index
Real64 MinSlatAngGeom; // Minimum and maximum slat angle allowed by slat geometry (deg)
Real64 MaxSlatAngGeom;
Expand All @@ -155,8 +153,6 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if
Real64 maxLamValue; // maximum value of wavelength

// Added TH 1/9/2009 to read the thermochromic glazings
int iTC(0);
int iMat(0);

// Added TH 7/27/2009 for constructions defined with F or C factor method
int TotFfactorConstructs; // Number of slabs-on-grade or underground floor constructions defined with F factors
Expand Down Expand Up @@ -2876,8 +2872,6 @@ void GetWindowGlassSpectralData(EnergyPlusData &state, bool &ErrorsFound) // set
int IOStat; // IO Status when calling get input subroutine
int NumAlphas; // Number of spectral data alpha names being passed
int NumNums; // Number of spectral data properties being passed
int Loop;
int LamNum; // Wavelength number
Real64 Lam; // Wavelength (microns)
Real64 Tau; // Transmittance, front reflectance, back reflectance
Real64 RhoF;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Material.hh
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ namespace Material {
~MaterialShade() = default;
bool can_instantiate() override { return true; } // Allows this class to be instantiated
};

// This may seem like an overly complicated way to handle a set of
// multi-dimensional variables, but I think that it is actually
// cleaner than either a multi-dimensional array (and certaily
Expand Down
10 changes: 1 addition & 9 deletions src/EnergyPlus/MoistureBalanceEMPDManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,12 @@ void GetMoistureBalanceEMPDInput(EnergyPlusData &state)
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int IOStat; // IO Status when calling get input subroutine
Array1D_string MaterialNames(3); // Number of Material Alpha names defined
int MaterNum; // Counter to keep track of the material number
int MaterialNumAlpha; // Number of material alpha names being passed
int MaterialNumProp; // Number of material properties being passed
Array1D<Real64> MaterialProps(9); // Temporary array to transfer material properties
bool ErrorsFound(false); // If errors detected in input

int EMPDMat; // EMPD Moisture Material additional properties for each base material
int Loop;
int Layer;
int SurfNum; // Surface number
int MatNum; // Material number at interior layer
int ConstrNum; // Construction number
Array1D_bool EMPDzone; // EMPD property check for each zone

auto &s_ip = state.dataInputProcessing->inputProcessor;
Expand Down Expand Up @@ -475,8 +469,6 @@ void CalcMoistureBalanceEMPD(EnergyPlusData &state,

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
int NOFITR; // Number of iterations
int MatNum; // Material number at interior layer
int ConstrNum; // Construction number
Real64 hm_deep_layer; // Overall deep-layer transfer coefficient
Real64 RSurfaceLayer; // Mass transfer resistance between actual surface and surface layer node
Real64 Taver; // Average zone temperature between current time and previous time
Expand Down Expand Up @@ -758,7 +750,7 @@ void ReportMoistureBalanceEMPD(EnergyPlusData &state)
auto const *mat = s_mat->materials(constr.LayerPoint(constr.TotLayers));
if (!mat->hasEMPD) continue;

auto const *matEMPD = dynamic_cast<const MaterialEMPD const *>(mat);
auto const *matEMPD = dynamic_cast<MaterialEMPD const *>(mat);
assert(matEMPD != nullptr);

static constexpr std::string_view Format_700(
Expand Down
2 changes: 0 additions & 2 deletions src/EnergyPlus/ReportCoilSelection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,6 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state)
}
// fill out some fan information
HVAC::FanType locFanType = HVAC::FanType::Invalid;
bool errorsFound(false);
if (c->supFanNum == 0) {
c->supFanNum = Fans::GetFanIndex(state, c->fanAssociatedWithCoilName);
}
Expand Down Expand Up @@ -919,7 +918,6 @@ void ReportCoilSelection::associateZoneCoilWithParent(EnergyPlusData &state, std
auto &thisSubEq = zoneEquipList.EquipData(equipLoop).SubEquipData;

// search for coil and fan SubEquipData and return parent type/name and fan type/name for coil reports.
auto const &coilIterator = std::find_if(thisSubEq.begin(), thisSubEq.end(), thisSubCoilLambda);
if (std::find_if(thisSubEq.begin(), thisSubEq.end(), thisSubCoilLambda) != thisSubEq.end()) {
c->typeHVACname = zoneEquipList.EquipTypeName(equipLoop);
c->userNameforHVACsystem = zoneEquipList.EquipName(equipLoop);
Expand Down
3 changes: 0 additions & 3 deletions src/EnergyPlus/RoomAirModelManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2707,12 +2707,9 @@ namespace RoomAir {
// number.If incorrect name is given, errorsfound is returned as true and value is returned
// as zero.

static constexpr std::string_view routineName = "CheckEquipName";

// Return value
bool EquipFind = false; // if true, equip is found

bool errorfound;
int SupplyNodeNum = 0;
int ReturnNodeNum = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/SQLiteProcedures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void CreateSQLiteZoneExtendedOutput(EnergyPlusData &state)
auto const &surface = state.dataSurface->Surface(surfaceNumber);
state.dataSQLiteProcedures->sqlite->addSurfaceData(surfaceNumber, surface, DataSurfaces::cSurfaceClass(surface.Class));
}
for (int materialNum = 1; materialNum <= state.dataMaterial->materials.size(); ++materialNum) {
for (int materialNum = 1; materialNum <= state.dataMaterial->materials.isize(); ++materialNum) {
state.dataSQLiteProcedures->sqlite->addMaterialData(materialNum, state.dataMaterial->materials(materialNum));
}
for (int constructNum = 1; constructNum <= state.dataHeatBal->TotConstructs; ++constructNum) {
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/SingleDuct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5279,7 +5279,7 @@ void SingleDuctAirTerminal::CalcVAVVS(EnergyPlusData &state,
int const ZoneNode, // zone node number
Real64 const HWFlow, // hot water flow (kg/s)
Real64 const HCoilReq, // gas or elec coil demand requested
HVAC::FanType fanType, // type of fan
[[maybe_unused]] HVAC::FanType fanType, // type of fan
Real64 const AirFlow, // air flow rate (kg/s)
int const FanOn, // 1 means fan is on
Real64 &LoadMet // load met by unit (watts)
Expand Down
8 changes: 2 additions & 6 deletions src/EnergyPlus/StandardRatings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,6 @@ namespace StandardRatings {
Real64 EER2(0.0); // Energy Efficiency Ratio using AHRI 210/140 - 2023
Real64 EER_2022(0.0); // Energy Efficiency Ratio in SI [W/W]
Real64 IEER_2022(0.0); // Integerated Energy Efficiency Ratio in SI [W/W]
Real64 NetCoolingCapRated2022(0.0);
Real64 NetCoolingCapRatedMaxSpeed2023(0.0);

Real64 HSPF(0.0); // Heating Seasonal Performance Factor in SI [W/W]
Real64 NetHeatingCapRatedHighTemp(0.0); // Net Rated heating capacity at high temp [W]
Expand Down Expand Up @@ -1538,8 +1536,6 @@ namespace StandardRatings {
Real64 EER(0.0);
Real64 NetCoolingCapRated(0.0);

int ns = 2;

StandardRatingsResult = TwoSpeedDXCoilStandardRatings(state,
DXCoilName,
DXCoilType,
Expand Down Expand Up @@ -2448,7 +2444,7 @@ namespace StandardRatings {
}

std::tuple<Real64, Real64, Real64, Real64>
SEER2CalulcationCurveFit(EnergyPlusData &state, std::string const &CoilType, EnergyPlus::CoilCoolingDXCurveFitOperatingMode operatingMode)
SEER2CalulcationCurveFit(EnergyPlusData &state, [[maybe_unused]] std::string const &CoilType, EnergyPlus::CoilCoolingDXCurveFitOperatingMode operatingMode)
{
Real64 EEER2(0.0);
Real64 SEER2_User(0.0);
Expand Down Expand Up @@ -4117,7 +4113,7 @@ namespace StandardRatings {
std::pair<Real64, int> GetMatchingSpeedFromBuildingLoad(Real64 buildingLoad, const Array1A<Real64> &speedList)
{
std::pair<int, Real64> result = {-1, -1}; // Initialize result to indicate no suitable number found
for (int i = 0; i < speedList.size(); ++i) {
for (int i = 0; i < speedList.isize(); ++i) {
Real64 scaledSpeed = speedList[i];
if (scaledSpeed >= buildingLoad) {
result = {speedList[i], i};
Expand Down
12 changes: 3 additions & 9 deletions src/EnergyPlus/SystemAvailabilityManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,6 @@ namespace Avail {
cAlphaFieldNames,
cNumericFieldNames);

ErrorObjectHeader eoh{routineName, cCurrentModuleObject, cAlphaArgs(1)};
auto &diffThermoMgr = state.dataAvail->DiffThermoData(SysAvailNum);
diffThermoMgr.Name = cAlphaArgs(1);
diffThermoMgr.type = ManagerType::DiffThermo;
Expand Down Expand Up @@ -922,7 +921,6 @@ namespace Avail {
cAlphaFieldNames,
cNumericFieldNames);

ErrorObjectHeader eoh{routineName, cCurrentModuleObject, cAlphaArgs(1)};
auto &hiTurnOffMgr = state.dataAvail->HiTurnOffData(SysAvailNum);
hiTurnOffMgr.Name = cAlphaArgs(1);
hiTurnOffMgr.type = ManagerType::HiTempTOff;
Expand Down Expand Up @@ -976,7 +974,6 @@ namespace Avail {
lAlphaFieldBlanks,
cAlphaFieldNames,
cNumericFieldNames);
ErrorObjectHeader eoh{routineName, cCurrentModuleObject, cAlphaArgs(1)};
auto &hiTurnOnMgr = state.dataAvail->HiTurnOnData(SysAvailNum);
hiTurnOnMgr.Name = cAlphaArgs(1);
hiTurnOnMgr.type = ManagerType::HiTempTOn;
Expand Down Expand Up @@ -1095,7 +1092,6 @@ namespace Avail {
cAlphaFieldNames,
cNumericFieldNames);

ErrorObjectHeader eoh{routineName, cCurrentModuleObject, cAlphaArgs(1)};
auto &loTurnOnMgr = state.dataAvail->LoTurnOnData(SysAvailNum);
loTurnOnMgr.Name = cAlphaArgs(1);
loTurnOnMgr.type = ManagerType::LoTempTOn;
Expand Down Expand Up @@ -1358,7 +1354,7 @@ namespace Avail {
std::string const &AvailabilityListName, // name that should be an Availability Manager List Name
int const Loop, // which loop this is
int const NumAirLoops, // Total number of air loops
bool &ErrorsFound // true if certain errors are detected here
[[maybe_unused]] bool &ErrorsFound // true if certain errors are detected here
)
{

Expand Down Expand Up @@ -1426,7 +1422,7 @@ namespace Avail {
void GetZoneEqAvailabilityManager(EnergyPlusData &state,
int const ZoneEquipType, // Type of ZoneHVAC:* component
int const CompNum, // Index of a particular ZoneHVAC:* component
bool &ErrorsFound // true if certain errors are detected here
[[maybe_unused]] bool &ErrorsFound // true if certain errors are detected here
)
{

Expand All @@ -1444,8 +1440,6 @@ namespace Avail {

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
std::string AvailabilityListName; // name that should be an Availability Manager List Name
int Found;
int Num;
int CompNumAvailManagers; // Number of availability managers associated with a ZoneHVAC:* component

if (state.dataAvail->GetAvailListsInput) {
Expand Down Expand Up @@ -1506,7 +1500,6 @@ namespace Avail {

using DataZoneEquipment::NumValidSysAvailZoneComponents;

int ZoneEquipType;
int ZoneListNum;
int ScanZoneListNum;
int ZoneNum;
Expand Down Expand Up @@ -1725,6 +1718,7 @@ namespace Avail {
}

} break;

default: {
ShowSevereError(state, format("AvailabilityManager Type not found: {}", type));
ShowContinueError(state, format("Occurs in Manager={}", SysAvailName));
Expand Down
6 changes: 0 additions & 6 deletions src/EnergyPlus/UtilityRoutines.cc
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,6 @@ int AbortEnergyPlus(EnergyPlusData &state)
std::string NumSevereDuringWarmup;
std::string NumWarningsDuringSizing;
std::string NumSevereDuringSizing;
int Hours; // Elapsed Time Hour Reporting
int Minutes; // Elapsed Time Minute Reporting
Real64 Seconds; // Elapsed Time Second Reporting
bool ErrFound;
bool TerminalError;

Expand Down Expand Up @@ -660,9 +657,6 @@ int EndEnergyPlus(EnergyPlusData &state)
std::string NumSevereDuringWarmup;
std::string NumWarningsDuringSizing;
std::string NumSevereDuringSizing;
int Hours; // Elapsed Time Hour Reporting
int Minutes; // Elapsed Time Minute Reporting
Real64 Seconds; // Elapsed Time Second Reporting

if (state.dataSQLiteProcedures->sqlite) {
state.dataSQLiteProcedures->sqlite->updateSQLiteSimulationRecord(true, true);
Expand Down
Loading

5 comments on commit 3eba56a

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blind (amirroth) - Win64-Windows-10-VisualStudio-16: OK (2871 of 2871 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blind (amirroth) - x86_64-MacOS-10.18-clang-15.0.0: OK (3445 of 3665 tests passed, 12 test warnings)

Messages:\n

  • 170 tests had: EIO diffs.
  • 22 tests had: EDD diffs.
  • 212 tests had: Table string diffs.
  • 13 tests had: ESO big diffs.
  • 11 tests had: Table big diffs.
  • 3 tests had: Table small diffs.
  • 6 tests had: ERR diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: MTR small diffs.
  • 2 tests had: SSZ small diffs.
  • 2 tests had: ZSZ small diffs.

Failures:\n

integration Test Summary

  • Passed: 795
  • Failed: 1

regression Test Summary

  • Passed: 574
  • Failed: 219

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blind (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3483 of 3706 tests passed, 12 test warnings)

Messages:\n

  • 173 tests had: EIO diffs.
  • 22 tests had: EDD diffs.
  • 215 tests had: Table string diffs.
  • 16 tests had: ESO big diffs.
  • 13 tests had: Table big diffs.
  • 3 tests had: Table small diffs.
  • 6 tests had: ERR diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: MTR small diffs.
  • 2 tests had: SSZ small diffs.
  • 2 tests had: ZSZ small diffs.

Failures:\n

regression Test Summary

  • Passed: 590
  • Failed: 223

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blind (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2077 of 2077 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blind (amirroth) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (796 of 797 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 796
  • Failed: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.