From c96a5a86684785e1ba67838e5da325018a6d1f08 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 9 Dec 2022 11:49:57 +0100 Subject: [PATCH 1/2] fixed: zero initialize to avoid compiler warnings --- tests/test_blackoilfluidstate.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_blackoilfluidstate.cpp b/tests/test_blackoilfluidstate.cpp index 81e1e615c..9c9a7110f 100644 --- a/tests/test_blackoilfluidstate.cpp +++ b/tests/test_blackoilfluidstate.cpp @@ -44,7 +44,7 @@ int main() typedef typename Opm::BlackOilFluidSystem FluidSystem; typedef Opm::BlackOilFluidState FluidState; - FluidState fs; + FluidState fs{}; checkFluidState(fs); } @@ -54,7 +54,7 @@ int main() typedef typename Opm::BlackOilFluidSystem FluidSystem; typedef Opm::BlackOilFluidState FluidState; - FluidState fs; + FluidState fs{}; checkFluidState(fs); } @@ -64,7 +64,7 @@ int main() typedef typename Opm::BlackOilFluidSystem FluidSystem; typedef Opm::BlackOilFluidState FluidState; - FluidState fs; + FluidState fs{}; checkFluidState(fs); } From 13dcaf828153dbcd086dcd338e6429f1ee8c89ef Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 9 Dec 2022 11:51:22 +0100 Subject: [PATCH 2/2] fixed: use std::array to avoid compiler warnings --- opm/material/eos/PengRobinson.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/material/eos/PengRobinson.hpp b/opm/material/eos/PengRobinson.hpp index 098a3e281..bf737503f 100644 --- a/opm/material/eos/PengRobinson.hpp +++ b/opm/material/eos/PengRobinson.hpp @@ -460,12 +460,12 @@ protected: Evaluation b4 = a4 + V*b3; // invert resulting cubic polynomial analytically - Evaluation allV[4]; + std::array allV; allV[0] = V; - int numSol = 1 + invertCubicPolynomial(allV + 1, b1, b2, b3, b4); + int numSol = 1 + invertCubicPolynomial(allV.data() + 1, b1, b2, b3, b4); // sort all roots of the derivative - std::sort(allV + 0, allV + numSol); + std::sort(allV.begin(), allV.begin() + numSol); // check whether the result is physical if (numSol != 4 || allV[numSol - 2] < b) {