fixed compiler warnings except NAN

This commit is contained in:
David Parkhurst 2023-04-03 03:27:21 -06:00
parent 3f24bf1780
commit 25f2472130
6 changed files with 13 additions and 32 deletions

View File

@ -624,7 +624,6 @@ int Phreeqc::
calc_fixed_volume_gas_pressures(void)
/* ---------------------------------------------------------------------- */
{
int n_g = 0;
LDBLE lp;
class rxn_token *rxn_ptr;
class phase *phase_ptr;
@ -645,7 +644,6 @@ calc_fixed_volume_gas_pressures(void)
{
if (!PR && phase_ptr->t_c > 0 && phase_ptr->p_c > 0)
PR = true;
n_g++;
}
gas_phase_ptr->Set_total_moles(gas_phase_ptr->Get_total_moles() + gas_unknowns[i]->moles);
}

View File

@ -2543,7 +2543,6 @@ int Phreeqc::
calc_gas_pressures(void)
/* ---------------------------------------------------------------------- */
{
int n_g = 0;
LDBLE lp, V_m = 0;
class rxn_token *rxn_ptr;
std::vector<class phase *> phase_ptrs;
@ -2576,7 +2575,6 @@ calc_gas_pressures(void)
phase_ptrs.push_back(phase_ptr);
if (!PR && phase_ptr->t_c > 0 && phase_ptr->p_c > 0)
PR = true;
n_g++;
}
if (iterations > 2 && gas_phase_ptr->Get_type() == cxxGasPhase::GP_VOLUME)
{
@ -3778,7 +3776,6 @@ residuals(void)
int converge;
LDBLE l_toler;
LDBLE sum_residual;
LDBLE sinh_constant;
LDBLE sum, sum1;
class master *master_ptr, *master_ptr1, *master_ptr2;
@ -3786,7 +3783,6 @@ residuals(void)
int print_fail;
std::vector<LDBLE> cd_psi;
print_fail = FALSE;
sum_residual = 0.0;
sigmaddl = 0;
sum = 0;
/*
@ -4530,7 +4526,6 @@ residuals(void)
* Store residuals in array
*/
my_array[((size_t)i + 1) * (count_unknowns + 1) - 1] = residual[i];
sum_residual += fabs(residual[i]);
}
/*
* Return

View File

@ -52,7 +52,7 @@ pitzer_tidy(void)
const char *string1, *string2;
int i, j, order;
int i0, i1, i2;
int count_pos, count_neg, count_neut, count[3], jj;
int count_neut, count[3], jj;
LDBLE z0, z1;
class pitz_param *pzp_ptr;
class theta_param *theta_param_ptr;
@ -339,21 +339,21 @@ pitzer_tidy(void)
i0 = pitz_params[i]->ispec[0];
i1 = pitz_params[i]->ispec[1];
i2 = pitz_params[i]->ispec[2];
count_pos = count_neg = count_neut = 0;
count_neut = 0;
for (j = 0; j <= 2; j++)
{
if (spec[pitz_params[i]->ispec[j]]->z > 0)
{
count_pos++;
}
//if (spec[pitz_params[i]->ispec[j]]->z > 0)
//{
// count_pos++;
//}
if (spec[pitz_params[i]->ispec[j]]->z == 0)
{
count_neut++;
}
if (spec[pitz_params[i]->ispec[j]]->z < 0)
{
count_neg++;
}
//if (spec[pitz_params[i]->ispec[j]]->z < 0)
//{
// count_neg++;
//}
}
/* All neutral */
if (count_neut == 3)

View File

@ -1980,14 +1980,13 @@ get_list_master_ptrs(const char* cptr, class master *master_ptr)
* Output: space is allocated and a list of master species pointers is
* returned.
*/
int j, l, count_list;
int j, l;
char token[MAX_LENGTH];
std::vector<class master*> master_ptr_list;
class master *master_ptr0;
/*
* Make list of master species pointers
*/
count_list = 0;
//master_ptr_list = unknown_alloc_master();
master_ptr0 = master_ptr;
if (master_ptr0 == master_ptr->s->primary)
@ -2147,7 +2146,7 @@ mb_for_species_aq(int n)
* by coef, usually moles.
* mb_unknowns.coef - coefficient of s[n] in equation or relation
*/
int i, j;
int i;
class master *master_ptr;
class unknown *unknown_ptr;
@ -2223,7 +2222,6 @@ mb_for_species_aq(int n)
*/
if (use.Get_surface_ptr() != NULL && s[n]->type < H2O && dl_type_x != cxxSurface::NO_DL)
{
j = 0;
for (i = 0; i < count_unknowns; i++)
{
if (x[i]->type == SURFACE_CB)
@ -2235,7 +2233,6 @@ mb_for_species_aq(int n)
store_mb_unknowns(unknown_ptr, s_diff_layer[n][charge_ptr->Get_name()].Get_g_moles_address(),
s[n]->z, s_diff_layer[n][charge_ptr->Get_name()].Get_dg_g_moles_address());
j++;
}
}
}

View File

@ -1141,7 +1141,7 @@ copy_token_tab(std::string& token, const char **cptr)
* EOL,
* UNKNOWN.
*/
int i, return_value;
int return_value;
char c;
/*
* Strip leading spaces
@ -1180,7 +1180,6 @@ copy_token_tab(std::string& token, const char **cptr)
/*
* Begin copying to token
*/
i = 0;
for (;;)
{
c = **cptr;
@ -1197,7 +1196,6 @@ copy_token_tab(std::string& token, const char **cptr)
{
token.push_back(c);
(*cptr)++;
i++;
}
}
return (return_value);

View File

@ -798,7 +798,6 @@ build_tally_table(void)
*/
int j, k, l, p, save_print_use;
size_t n;
int count_tt_pure_phase, count_tt_ss_phase, count_tt_kinetics;
class phase *phase_ptr;
char token[MAX_LENGTH];
const char* cptr;
@ -871,7 +870,6 @@ build_tally_table(void)
/*
* Count pure phases
*/
count_tt_pure_phase = 0;
if (Rxn_pp_assemblage_map.size() > 0)
{
/*
@ -904,7 +902,6 @@ build_tally_table(void)
/*
* Add to table
*/
count_tt_pure_phase++;
n = count_tally_table_columns;
extend_tally_table();
tally_table[n].name = phase_ptr->name;
@ -931,7 +928,6 @@ build_tally_table(void)
/*
* Add solid-solution pure phases
*/
count_tt_ss_phase = 0;
if (Rxn_ss_assemblage_map.size() > 0)
{
/*
@ -964,7 +960,6 @@ build_tally_table(void)
/*
* Add to table
*/
count_tt_ss_phase++;
n = count_tally_table_columns;
extend_tally_table();
tally_table[n].name = phase_ptr->name;
@ -982,7 +977,6 @@ build_tally_table(void)
/*
* Add kinetic reactants
*/
count_tt_kinetics = 0;
if (Rxn_kinetics_map.size() > 0)
{
std::map<int, cxxKinetics>::iterator it;
@ -1006,7 +1000,6 @@ build_tally_table(void)
/*
* Add to table
*/
count_tt_kinetics++;
n = count_tally_table_columns;
extend_tally_table();
tally_table[n].name = string_hsave(kinetics_comp_ptr->Get_rate_name().c_str());