Fixed compiler warnings revealed by MinGW

This commit is contained in:
Ray Speth 2012-02-27 18:14:43 +00:00
parent 7f12656925
commit 8bce9d7332
13 changed files with 16 additions and 42 deletions

View file

@ -18,10 +18,6 @@
#ifndef MDP_ALLO_H
#define MDP_ALLO_H
#ifdef WIN32
#pragma warning(disable:4290)
#endif
#include <stdexcept>
/*

View file

@ -11,11 +11,6 @@
#ifndef CT_RESIDEVAL_H
#define CT_RESIDEVAL_H
#ifdef WIN32
#pragma warning(disable:4786)
#pragma warning(disable:4503)
#endif
#include "cantera/base/ct_defs.h"
#include "cantera/base/ctexceptions.h"

View file

@ -23,10 +23,6 @@
using namespace std;
#ifdef WIN32
#pragma warning(disable:4996)
#endif
namespace mdp
{
/*

View file

@ -1203,6 +1203,9 @@ long int Application::readStringRegistryKey(const std::string& keyName, const st
HKEY key;
long open_error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName.c_str(), 0, KEY_READ, &key);
if (open_error != ERROR_SUCCESS) {
return open_error;
}
value = defaultValue;
CHAR buffer[1024];
DWORD bufferSize = sizeof(buffer);

View file

@ -863,7 +863,7 @@ void MultiPhaseEquil::computeN()
bool ok;
for (size_t m = 0; m < m_nel; m++) {
size_t k;
size_t k = 0;
for (size_t ik = 0; ik < m_nsp; ik++) {
k = m_sortindex[ik];
if (m_mix->nAtoms(m_species[k],m_element[m]) != 0) {

View file

@ -4335,7 +4335,7 @@ void VCS_SOLVE::vcs_dfe(const int stateCalc,
tPhMoles_ptr = VCS_DATA_PTR(m_tPhaseMoles_old);
actCoeff_ptr = VCS_DATA_PTR(m_actCoeffSpecies_old);
molNum = VCS_DATA_PTR(m_molNumSpecies_old);
} else if (stateCalc == VCS_STATECALC_NEW) {
} else { // stateCalc == VCS_STATECALC_NEW
feSpecies = VCS_DATA_PTR(m_feSpecies_new);
tPhMoles_ptr = VCS_DATA_PTR(m_tPhaseMoles_new);
actCoeff_ptr = VCS_DATA_PTR(m_actCoeffSpecies_new);
@ -5399,8 +5399,7 @@ void VCS_SOLVE::vcs_deltag_Phase(const size_t iphase, const bool doDeleted,
feSpecies = VCS_DATA_PTR(m_feSpecies_new);
deltaGRxn = VCS_DATA_PTR(m_deltaGRxn_new);
actCoeffSpecies = VCS_DATA_PTR(m_actCoeffSpecies_new);
} else if (stateCalc == VCS_STATECALC_OLD) {
} else { // stateCalc == VCS_STATECALC_OLD
feSpecies = VCS_DATA_PTR(m_feSpecies_old);
deltaGRxn = VCS_DATA_PTR(m_deltaGRxn_old);
actCoeffSpecies = VCS_DATA_PTR(m_actCoeffSpecies_old);

View file

@ -24,10 +24,6 @@
#include "cantera/base/clockWC.h"
#ifdef WIN32
#pragma warning(disable:4996)
#endif
using namespace std;
namespace VCSnonideal

View file

@ -212,7 +212,7 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin,
}
int info = 0;
int label_t=-1; /* Species IDs for time control */
int label_d; /* Species IDs for damping control */
int label_d = -1; /* Species IDs for damping control */
int label_t_old=-1;
doublereal label_factor = 1.0;
int iter=0; // iteration number on numlinear solver

View file

@ -386,7 +386,7 @@ doublereal BandMatrix::rcond(doublereal a1norm)
// doublereal anorm = oneNorm();
size_t ldab = (2 *m_kl + m_ku + 1);
int rinfo;
int rinfo = 0;
rcond = ct_dgbcon('1', m_n, m_kl, m_ku, DATA_PTR(ludata), ldab, DATA_PTR(m_ipiv), a1norm, DATA_PTR(work_),
DATA_PTR(iwork_), rinfo);
if (rinfo != 0) {

View file

@ -1256,7 +1256,7 @@ int NonlinearSolver::doAffineNewtonSolve(const doublereal* const y_curr, const
/*
* Factor the Hessian
*/
int info;
int info = 0;
ct_dpotrf(ctlapack::UpperTriangular, neq_, &(*(HessianPtr_->begin())), neq_, info);
if (info) {
if (m_print_flag >= 2) {
@ -1826,7 +1826,7 @@ void NonlinearSolver::residualComparisonLeg(const doublereal time_curr, const do
doublereal* y1 = DATA_PTR(m_wksp);
doublereal* ydot1 = DATA_PTR(m_wksp_2);
doublereal sLen;
doublereal alpha;
doublereal alpha = 0;
doublereal residSteepBest = 1.0E300;
doublereal residSteepLinBest = 0.0;
@ -3453,7 +3453,7 @@ int NonlinearSolver::solve_nonlinear_problem(int SolnType, doublereal* const y_c
printf(" N ");
}
if (doDogLeg_) {
printf("%5.1F |", log10(m_conditionNumber));
printf("%5.1f |", log10(m_conditionNumber));
// printf("\t Iter Resid NewJac | DS_Cauchy DS_Newton DS_Trust | legID legAlpha Fbound | | DS_F ResidFinal \n");
printf("%10.3E %10.3E %10.3E %10.3E|", ResidDecreaseSDExp_, ResidDecreaseSD_,
ResidDecreaseNewtExp_, ResidDecreaseNewt_);

View file

@ -218,7 +218,7 @@ int SquareMatrix::factorQR()
work.resize(8 * m_nrows, 0.0);
}
a1norm_ = ct_dlange('1', m_nrows, m_nrows, &(*(begin())), m_nrows, DATA_PTR(work));
int info;
int info = 0;
m_factored = 2;
size_t lwork = work.size();
ct_dgeqrf(m_nrows, m_nrows, &(*(begin())), m_nrows, DATA_PTR(tau), DATA_PTR(work), lwork, info);
@ -312,7 +312,7 @@ doublereal SquareMatrix::rcond(doublereal anorm)
// doublereal anorm = ct_dlange('1', m_nrows, m_nrows, &(*(begin())), m_nrows, DATA_PTR(work));
int rinfo;
int rinfo = 0;
rcond = ct_dgecon('1', m_nrows, &(*(begin())), m_nrows, anorm, DATA_PTR(work),
DATA_PTR(iwork_), rinfo);
if (rinfo != 0) {
@ -345,7 +345,7 @@ doublereal SquareMatrix::rcondQR()
throw CELapackError("SquareMatrix::rcondQR()", "matrix isn't factored correctly");
}
int rinfo;
int rinfo = 0;
rcond = ct_dtrcon(0, ctlapack::UpperTriangular, 0, m_nrows, &(*(begin())), m_nrows, DATA_PTR(work),
DATA_PTR(iwork_), rinfo);
if (rinfo != 0) {

View file

@ -16,12 +16,6 @@
* $Revision: 388 $
*/
// turn off warnings under Windows
#ifdef WIN32
#pragma warning(disable:4786)
#pragma warning(disable:4503)
#endif
#include "cantera/thermo/MixtureFugacityTP.h"
#include "cantera/thermo/VPSSMgr.h"
#include "cantera/thermo/PDSS.h"
@ -1169,7 +1163,8 @@ doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& mola
doublereal volLiquid = liquidVolEst(TKelvin, pres);
RhoLiquidGood = mw / volLiquid;
RhoGasGood = pres * mw / (GasConstant * TKelvin);
doublereal delGRT, liqGRT, gasGRT;
doublereal delGRT = 1.0E6;
doublereal liqGRT, gasGRT;
int stab;
doublereal presLast = pres;

View file

@ -17,12 +17,6 @@
* $Revision: 255 $
*/
// turn off warnings under Windows
#ifdef WIN32
#pragma warning(disable:4786)
#pragma warning(disable:4503)
#endif
#include "cantera/thermo/RedlichKwongMFTP.h"