Fix some issues identified by compiler warnings

This commit is contained in:
Ray Speth 2014-01-09 23:12:11 +00:00
parent f3b1555a6b
commit dfc542be76
8 changed files with 6 additions and 10 deletions

View file

@ -47,7 +47,6 @@ class ScopedLock
{
public:
explicit ScopedLock(const int m) : m_(m) {}
private:
int m_;
};

View file

@ -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 {

View file

@ -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;

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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();

View file

@ -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;
}
/*****************************************************************/