Fixing Linux compiler warnings, checking in new regression test files.

This commit is contained in:
David Parkhurst 2019-11-19 09:31:10 -07:00
parent 77e36a2394
commit fbde6338ec
3 changed files with 98 additions and 89 deletions

View File

@ -3590,7 +3590,8 @@ CVsldet(CVodeMem cv_mem)
realtype smink, smaxk, sumrat, sumrsq, vmin, vmax, drrmax, adrr;
realtype /*small_cvode,*/ tem, sqmax, saqk, qp, s, sqmaxk, saqj, sqmin;
realtype rsa, rsb, rsc, rsd, rse, rd1a, rd1b, rd1c, rd1d;
realtype rd2a, rd2b, rd2c, rd3a, rd3b, cest1, corr1;
//realtype rd2a, rd2b, rd2c, rd3a, rd3b, cest1, corr1;
realtype rd2a, rd2b, rd2c, rd3a, cest1, corr1;
realtype ratp, ratm, qfac1, qfac2, bb, rrb;
/* The following are cutoffs and tolerances used by this routine */
@ -3854,7 +3855,7 @@ CVsldet(CVodeMem cv_mem)
rd2b = rd1b - rd1c;
rd2c = rd1c - rd1d;
rd3a = rd2a - rd2b;
rd3b = rd2b - rd2c;
//rd3b = rd2b - rd2c;
/* rd3b = rd3b; */
if (ABS(rd1b) < TINY * smax[k])

View File

@ -687,7 +687,8 @@ gammas(LDBLE mu)
*/
if (calculating_deriv)
continue;
LDBLE coef, z;
{
LDBLE coef = 0, z = 0;
for (j = 1; s_x[i]->rxn_x->token[j].s != NULL; j++)
{
if (s_x[i]->rxn_x->token[j].s->type == EX)
@ -778,7 +779,7 @@ gammas(LDBLE mu)
}
if (s_x[i]->a_f && s_x[i]->primary == NULL && s_x[i]->moles)
gammas_a_f(i); // appt
}
break;
case 5: /* Always 1.0 */
s_x[i]->lg = 0.0;
@ -879,7 +880,8 @@ int Phreeqc::gammas_a_f(int i1)
/* ------------------------------------------------------------------------------- */
{
int i, j;
LDBLE d2, d3, coef = 0, sum = 0;
//LDBLE d2, d3, coef = 0, sum = 0;
LDBLE d2, d3, sum = 0;
char name[MAX_LENGTH];
//struct master *m_ptr;
@ -2219,7 +2221,7 @@ mb_ss(void)
{
cxxSS *ss_ptr = ss_ptrs[i];
total_moles = 0;
bool ss_in = true;
//bool ss_in = true;
for (size_t j = 0; j < ss_ptr->Get_ss_comps().size(); j++)
{
int l;
@ -3020,7 +3022,8 @@ ss_binary(cxxSS *ss_ptr)
/* ---------------------------------------------------------------------- */
{
LDBLE nb, nc, n_tot, xb, xc, dnb, dnc, l_a0, l_a1;
LDBLE xb2, xb3, xb4, xc2, xc3;
//LDBLE xb2, xb3, xb4, xc2, xc3;
LDBLE xb2, xb3, xc2;
LDBLE xb1, xc1;
/*
* component 0 is major component
@ -3107,10 +3110,10 @@ ss_binary(cxxSS *ss_ptr)
comp1_ptr->Get_log10_lambda();
xc2 = xc * xc;
xc3 = xc2 * xc;
//xc3 = xc2 * xc;
xb2 = xb * xb;
xb3 = xb2 * xb;
xb4 = xb3 * xb;
//xb4 = xb3 * xb;
/* xb4 = xb4; */
/* xc3 = xc3; */

View File

@ -2025,7 +2025,7 @@ fill_spec(int l_cell_no, int ref_cell)
malloc_error();
sol_D[l_cell_no].spec_size = i3 + count_spec + 1 + size_xt;
}
for (i1; i1 < i2; i1++)
for (; i1 < i2; i1++) // i1 is loop variable
{
memmove(&sol_D[l_cell_no].spec[i1], &sol_D[ref_cell].spec[i1], sizeof(struct spec));
sol_D[l_cell_no].spec[i1].c = 0.0;
@ -2098,7 +2098,7 @@ fill_spec(int l_cell_no, int ref_cell)
sol_D[i1].spec_size = i2 + size_xt;
}
i2--;
for (i2; i2 > i3; i2--)
for (; i2 > i3; i2--) // i2 is loop variable
sol_D[i1].spec[i2] = sol_D[i1].spec[i2 - 1];
memmove(&sol_D[i1].spec[i2], &sol_D[l_cell_no].spec[i2], sizeof(struct spec));
@ -2189,9 +2189,9 @@ diffuse_implicit(LDBLE DDt, int stagnant)
int i, icell, cp, comp;
// ifirst = (bcon_first == 2 ? 1 : 0); ilast = (bcon_last == 2 ? count_cells - 1 : count_cells);
int ifirst, ilast;
int i_1, i0, i1, i2;
int i_1, i0, i1, i2 = 0;
double mfr, mfr1, max_b = 0, b, grad, dVc, j_0e, min_dif_M = pow(10, min_dif_LM);
LDBLE dum1, dum2, dum_stag, min_mol;
LDBLE dum1, dum2, dum_stag = 0.0, min_mol;
LDBLE dum = 0;
cxxSurfaceCharge * charge_ptr = NULL;
@ -2789,10 +2789,15 @@ diffuse_implicit(LDBLE DDt, int stagnant)
for (i = ifirst + 1; i < ilast; i++)
{
dVc = current_cells[i].R * (current_x - current_cells[i].dif);
if ((dV_dcell && dVc * j_0e > 0 ||
(dV_dcell > 0 && (cell_data[i].potV + dVc) > (cell_data[count_cells + 1].potV)) ||
(dV_dcell < 0 && (cell_data[i].potV + dVc) < (cell_data[count_cells + 1].potV))))
//if (((dV_dcell && (dVc * j_0e > 0)) ||
// (dV_dcell > 0 && (cell_data[i].potV + dVc) > (cell_data[count_cells + 1].potV)) ||
// (dV_dcell < 0 && (cell_data[i].potV + dVc) < (cell_data[count_cells + 1].potV))))
if ((dV_dcell && (dVc * j_0e > 0)) ||
((dV_dcell > 0) && ((cell_data[i].potV + dVc) > cell_data[count_cells + 1].potV)) ||
((dV_dcell < 0) && ((cell_data[i].potV + dVc) < cell_data[count_cells + 1].potV)))
{
dVc = (cell_data[count_cells + 1].potV - cell_data[i].potV) / (count_cells + 1 - i);
}
cell_data[i + 1].potV = cell_data[i].potV + dVc;
}
if (!dV_dcell || fix_current)