silence compiler warnings

This commit is contained in:
Axel Kohlmeyer
2022-02-13 18:19:50 -05:00
parent 81587527fe
commit b42aebc197
2 changed files with 10 additions and 22 deletions

View File

@ -233,23 +233,14 @@ double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type,
double vCG)
{
int i = find_index(grid[0],vCG);
double correction, deltax = vCG - grid[0][i];
double deltax = vCG - grid[0][i];
if (basis_type == BASIS_LINEAR_SPLINE)
{
correction = grid[1][i] + (deltax) *
( grid[1][i+1] - grid[1][i] ) / ( grid[0][i+1] - grid[0][i] );
}
return grid[1][i] + (deltax) * ( grid[1][i+1] - grid[1][i] ) / ( grid[0][i+1] - grid[0][i] );
else if (basis_type == BASIS_CUBIC_SPLINE)
{
correction = grid[1][i] + (grid[2][i] * deltax) +
(grid[3][i] * pow(deltax,2)) + (grid[4][i] * pow(deltax,3));
}
else
{
error->all(FLERR,"bad spline type passed to get_cg_p_corr()\n");
}
return correction;
return grid[1][i] + (grid[2][i] * deltax) + (grid[3][i] * pow(deltax,2)) + (grid[4][i] * pow(deltax,3));
else error->all(FLERR,"bad spline type passed to get_cg_p_corr()\n");
return 0.0;
}
/* ----------------------------------------------------------------------
@ -261,11 +252,8 @@ void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis,
double *sent_phi_coeff, int sent_N_mol,
double sent_vavg)
{
if (basis_type == BASIS_ANALYTIC) { p_basis_type = BASIS_ANALYTIC; }
else
{
error->all(FLERR,"Incorrect basis type passed to ComputePressureBocs\n");
}
if (basis_type == BASIS_ANALYTIC) p_basis_type = BASIS_ANALYTIC;
else error->all(FLERR,"Incorrect basis type passed to ComputePressureBocs\n");
p_match_flag = 1;

View File

@ -1138,7 +1138,7 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
next = strchr(buf,'\n');
*next = '\0';
auto values = Tokenizer(utils::trim_comment(buf)).as_vector();
if (values.size() != nwords)
if ((int)values.size() != nwords)
error->all(FLERR, "Incorrect atom format in data file: {}", utils::trim(buf));
int imx = 0, imy = 0, imz = 0;
@ -1215,7 +1215,7 @@ void Atom::data_vels(int n, char *buf, tagint id_offset)
next = strchr(buf,'\n');
*next = '\0';
auto values = Tokenizer(utils::trim_comment(buf)).as_vector();
if (values.size() != nwords)
if ((int)values.size() != nwords)
error->all(FLERR, "Incorrect atom format in data file: {}", utils::trim(buf));
tagint tagdata = utils::tnumeric(FLERR,values[0],false,lmp) + id_offset;
@ -1594,7 +1594,7 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus, tagint id_offset)
next = strchr(buf,'\n');
*next = '\0';
auto values = Tokenizer(utils::trim_comment(buf)).as_vector();
if (values.size() != nwords)
if ((int)values.size() != nwords)
error->all(FLERR, "Incorrect atom format in data file: {}", utils::trim(buf));
tagint tagdata = utils::tnumeric(FLERR,values[0],false,lmp) + id_offset;