From dfc542be76adff1d8eddfa4047c2f555be3c52ec Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Thu, 9 Jan 2014 23:12:11 +0000 Subject: [PATCH] Fix some issues identified by compiler warnings --- include/cantera/base/ct_thread.h | 1 - src/apps/tok_input_util.cpp | 2 +- src/equil/ChemEquil.cpp | 1 - src/equil/MultiPhaseEquil.cpp | 1 - src/equil/vcs_MultiPhaseEquil.cpp | 2 +- src/equil/vcs_VolPhase.cpp | 2 +- src/equil/vcs_equilibrate.cpp | 2 +- src/thermo/VPSSMgr.cpp | 5 ++--- 8 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/cantera/base/ct_thread.h b/include/cantera/base/ct_thread.h index d97000368..e288b6630 100644 --- a/include/cantera/base/ct_thread.h +++ b/include/cantera/base/ct_thread.h @@ -47,7 +47,6 @@ class ScopedLock { public: explicit ScopedLock(const int m) : m_(m) {} -private: int m_; }; diff --git a/src/apps/tok_input_util.cpp b/src/apps/tok_input_util.cpp index e4a39fe05..bd7b53447 100644 --- a/src/apps/tok_input_util.cpp +++ b/src/apps/tok_input_util.cpp @@ -1217,7 +1217,7 @@ static bool interpret_double(const char* token, double* retn_value, } else if (strmatch(token,"dbl_epsilon")) { *retn_value = DBL_EPSILON; } else { - if ((retn = sscanf(token, "%el", &retn_float)) != 1) { + if ((retn = sscanf(token, "%le", &retn_float)) != 1) { *retn_value = (double) retn; return false; } else { diff --git a/src/equil/ChemEquil.cpp b/src/equil/ChemEquil.cpp index 0a162f07f..40e160a60 100644 --- a/src/equil/ChemEquil.cpp +++ b/src/equil/ChemEquil.cpp @@ -809,7 +809,6 @@ converge: yy = m_p2->value(s); deltax = (xx - xval)/xval; deltay = (yy - yval)/yval; - doublereal rmax = 0.0; bool passThis = true; for (m = 0; m < nvar; m++) { double tval = options.relTolerance; diff --git a/src/equil/MultiPhaseEquil.cpp b/src/equil/MultiPhaseEquil.cpp index 4f0d2c039..4854d6beb 100644 --- a/src/equil/MultiPhaseEquil.cpp +++ b/src/equil/MultiPhaseEquil.cpp @@ -280,7 +280,6 @@ int MultiPhaseEquil::setInitialMoles(int loglevel) // set the moles of the phase objects to match updateMixMoles(); } - for (ik = 0; ik < m_nsp; ik++) return 0; } diff --git a/src/equil/vcs_MultiPhaseEquil.cpp b/src/equil/vcs_MultiPhaseEquil.cpp index 8bc4c51dd..9cfa2763c 100644 --- a/src/equil/vcs_MultiPhaseEquil.cpp +++ b/src/equil/vcs_MultiPhaseEquil.cpp @@ -195,7 +195,7 @@ int vcs_MultiPhaseEquil::equilibrate_HP(doublereal Htarget, int iSuccess; if (XY != HP && XY != UP) { throw CanteraError("vcs_MultiPhaseEquil::equilibrate_HP", - "Wrong XP" + XY); + "Wrong XP" + int2str(XY)); } int strt = estimateEquil; diff --git a/src/equil/vcs_VolPhase.cpp b/src/equil/vcs_VolPhase.cpp index 07af4de99..d1391940c 100644 --- a/src/equil/vcs_VolPhase.cpp +++ b/src/equil/vcs_VolPhase.cpp @@ -270,7 +270,7 @@ void vcs_VolPhase::resize(const size_t phaseNum, const size_t nspecies, for (size_t i = 0; i < nspecies; i++) { Xmol_[i] = 1.0/nspecies; creationMoleNumbers_[i] = 1.0/nspecies; - if (IndSpecies[i] - m_numElemConstraints >= 0) { + if (IndSpecies[i] >= m_numElemConstraints) { creationGlobalRxnNumbers_[i] = IndSpecies[i] - m_numElemConstraints; } else { creationGlobalRxnNumbers_[i] = npos; diff --git a/src/equil/vcs_equilibrate.cpp b/src/equil/vcs_equilibrate.cpp index 8b78f9067..44a980dc5 100644 --- a/src/equil/vcs_equilibrate.cpp +++ b/src/equil/vcs_equilibrate.cpp @@ -151,7 +151,7 @@ int vcs_equilibrate_1(MultiPhase& s, int ixy, } else if (solver == 1) { if (ixy == TP || ixy == HP || ixy == SP || ixy == TV) { try { - double err = s.equilibrate(ixy, tol, maxsteps, maxiter, loglevel); + s.equilibrate(ixy, tol, maxsteps, maxiter, loglevel); return 0; } catch (CanteraError& e) { e.save(); diff --git a/src/thermo/VPSSMgr.cpp b/src/thermo/VPSSMgr.cpp index d15824a90..8434a11c5 100644 --- a/src/thermo/VPSSMgr.cpp +++ b/src/thermo/VPSSMgr.cpp @@ -225,11 +225,10 @@ VPSSMgr::getStandardVolumes(doublereal* vol) const const vector_fp& VPSSMgr::getStandardVolumes() const { - if (m_useTmpStandardStateStorage) { - return m_Vss; - } else { + if (!m_useTmpStandardStateStorage) { err("getStandardVolumes"); } + return m_Vss; } /*****************************************************************/