From 680e59b1ae98040e756362b97a7150140eb9e5b5 Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Mon, 30 Jan 2017 19:40:00 +0100 Subject: [PATCH 1/2] [fix] Return reference to static. Fix bug introduced in 3b62b6afb52189eab3a25f39cbc049b582fad862 --- dumux/material/fluidsystems/h2on2.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dumux/material/fluidsystems/h2on2.hh b/dumux/material/fluidsystems/h2on2.hh index 2a939a938a..f7f0fa9652 100644 --- a/dumux/material/fluidsystems/h2on2.hh +++ b/dumux/material/fluidsystems/h2on2.hh @@ -98,8 +98,9 @@ public: */ static const std::string& phaseName(int phaseIdx) { + static const std::string name[] = { std::string("w"), std::string("n") }; assert(0 <= phaseIdx && phaseIdx < numPhases); - return phaseIdx == wPhaseIdx ? "w" : "n"; + return name[phaseIdx]; } /*! -- GitLab From 5626cca8f2c9454876361d1c85441a65315e62fa Mon Sep 17 00:00:00 2001 From: Timo Koch Date: Mon, 30 Jan 2017 19:40:24 +0100 Subject: [PATCH 2/2] [cleanpu] Fix unsigned int compare warning --- dumux/material/components/iapws/common.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dumux/material/components/iapws/common.hh b/dumux/material/components/iapws/common.hh index 78b42ddcd8..0af598635e 100644 --- a/dumux/material/components/iapws/common.hh +++ b/dumux/material/components/iapws/common.hh @@ -201,7 +201,7 @@ public: Scalar Tpow = Troot; Scalar lam = 0; - for(int k = 0; k < thcond_a_count; ++k) { + for(unsigned int k = 0; k < thcond_a_count; ++k) { lam += thcond_a[k] * Tpow; Tpow *= Tbar; } -- GitLab