From 82e4d3b6f372a7a87b7f6e60271d0fece460dd42 Mon Sep 17 00:00:00 2001 From: Phil Ahrenkiel Date: Mon, 22 Jan 2024 14:53:00 -0700 Subject: [PATCH] Use static_cast. --- src/HPWHHeatSources.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/HPWHHeatSources.cc b/src/HPWHHeatSources.cc index 91fd0b0c..bfb0bd05 100644 --- a/src/HPWHHeatSources.cc +++ b/src/HPWHHeatSources.cc @@ -1029,11 +1029,11 @@ double HPWH::HeatSource::addHeatExternal(double externalT_C, // mix with node above from outlet to inlet // mix inlet water at target temperature with inlet node - for (std::size_t nodeIndex = externalOutletHeight; nodeIndex <= externalInletHeight; + for (std::size_t nodeIndex = externalOutletHeight; static_cast(nodeIndex) <= externalInletHeight; ++nodeIndex) { double& mixT_C = - (nodeIndex == externalInletHeight) ? targetT_C : hpwh->tankTemps_C[nodeIndex + 1]; + (static_cast(nodeIndex) == externalInletHeight) ? targetT_C : hpwh->tankTemps_C[nodeIndex + 1]; hpwh->tankTemps_C[nodeIndex] = (1. - nodeFrac) * hpwh->tankTemps_C[nodeIndex] + nodeFrac * mixT_C; } @@ -1153,11 +1153,11 @@ double HPWH::HeatSource::addHeatExternalMP(double externalT_C, // mix with node above from outlet to inlet // mix inlet water at target temperature with inlet node - for (std::size_t nodeIndex = externalOutletHeight; nodeIndex <= externalInletHeight; + for (std::size_t nodeIndex = externalOutletHeight; static_cast(nodeIndex) <= externalInletHeight; ++nodeIndex) { double& mixT_C = - (nodeIndex == externalInletHeight) ? targetT_C : hpwh->tankTemps_C[nodeIndex + 1]; + (static_cast(nodeIndex) == externalInletHeight) ? targetT_C : hpwh->tankTemps_C[nodeIndex + 1]; hpwh->tankTemps_C[nodeIndex] = (1. - nodeFrac) * hpwh->tankTemps_C[nodeIndex] + nodeFrac * mixT_C; }