Minor changes to beat down spurious warning messages about

uninitialized variables, that were in fact properly initialized.
This commit is contained in:
Harry Moffat 2008-03-31 21:34:04 +00:00
parent 60b66f18af
commit bb188d1fee
7 changed files with 25 additions and 13 deletions

View file

@ -104,7 +104,7 @@ namespace VCSnonideal {
"Wrong XY flag:" + int2str(XY));
}
int maxiter = 100;
int iSuccess;
int iSuccess = 0;
int innerXY;
double Pnow;
if (XY == TV) {
@ -112,7 +112,10 @@ namespace VCSnonideal {
}
double Pnew;
bool strt = estimateEquil;
double P1, V1, V2, P2;
double P1 = 0.0;
double V1 = 0.0;
double V2 = 0.0;
double P2 = 0.0;
doublereal Tlow = 0.5 * m_mix->minTemp();;
doublereal Thigh = 2.0 * m_mix->maxTemp();
doublereal Vnow, Verr;

View file

@ -44,7 +44,9 @@ namespace VCSnonideal {
***************************************************************************/
{
int conv, k, lt, ikl, kspec, iph, irxn;
double s, s1, xl, par;
double s;
double s1 = 0.0;
double xl, par;
int finished;
int nspecies = m_numSpeciesTot;
int nrxn = m_numRxnTot;

View file

@ -29,7 +29,8 @@ int VCS_SOLVE::vcs_rearrange(void)
* the data based on reaction ordering.
**************************************************************************/
{
int i, l, j, k1;
int i, l, j;
int k1 = 0;
/* ********************************************************* */
/* **** RE-ARRANGE INPUT DATA ****************************** */
/* ********************************************************* */

View file

@ -128,14 +128,17 @@ static void print_funcEval(FILE *fp, double xval, double fval, int its)
int converged = FALSE, err = FALSE;
#ifdef DEBUG_MODE
char fileName[80];
FILE *fp;
FILE *fp = 0;
#endif
double x1, x2, xnew, f1, f2, fnew, slope;
int its = 0, posStraddle, retn = VCS_SUCCESS;
int its = 0;
int posStraddle = 0;
int retn = VCS_SUCCESS;
int foundPosF = FALSE;
int foundNegF = FALSE;
int foundStraddle = FALSE;
double xPosF, xNegF;
double xPosF = 0.0;
double xNegF = 0.0;
double fnorm; /* A valid norm for the making the function value
* dimensionless */
double c[9], f[3], xn1, xn2, x0 = 0.0, f0 = 0.0, root, theta, xquad;

View file

@ -52,7 +52,9 @@ int VCS_SOLVE::vcs_rxn_adj_cg(void)
* attribute of the regular vcs algorithm. We don't want to violate this
***************************************************************************/
{
int irxn, j, k, kspec, soldel = 0;
int irxn, j;
int k = 0;
int kspec, soldel = 0;
double s, xx, dss;
double *dnPhase_irxn;
#ifdef DEBUG_MODE

View file

@ -897,8 +897,8 @@ namespace VCSnonideal {
* equilibrium calculation transfered to it.
*/
int VCS_SOLVE::vcs_prob_update(VCS_PROB *pub) {
int i, j, k1, l;
int i, j, l;
int k1 = 0;
vcs_tmoles();
Vol = vcs_VolTotal(T, Pres, VCS_DATA_PTR(soln), VCS_DATA_PTR(VolPM));
@ -917,12 +917,12 @@ namespace VCSnonideal {
* - Switch the species data back from K1 into I
*/
if (pub->SpeciesUnknownType[i] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) {
pub->w[i] = soln[k1];
pub->w[i] = soln[k1];
} else {
pub->w[i] = 0.0;
plogf("voltage species = %g\n", soln[k1]);
}
pub->mf[i] = wt[k1];
pub->mf[i] = wt[k1];
pub->m_gibbsSpecies[i] = m_gibbsSpecies[k1];
pub->VolPM[i] = VolPM[k1];
}

View file

@ -2746,8 +2746,9 @@ namespace VCSnonideal {
* 2 : Same as one but, the zeroed species is a component.
*/
int VCS_SOLVE::vcs_RxnStepSizes() {
int j, k, irxn, kspec, soldel = 0, iph;
int j, irxn, kspec, soldel = 0, iph;
double s, xx, dss;
int k = 0;
vcs_VolPhase *Vphase = 0;
double *dnPhase_irxn;
#ifdef DEBUG_MODE