silence compiler warnings

This commit is contained in:
Axel Kohlmeyer
2020-06-11 19:05:06 -04:00
parent a8c1ce98cf
commit 9ca0d01a5b
13 changed files with 11 additions and 16 deletions

View File

@ -554,7 +554,7 @@ void PairADP::read_file(char *filename)
ValueTokenizer values = reader.next_values(1);
file->nelements = values.next_int();
if (values.count() != file->nelements + 1)
if ((int)values.count() != file->nelements + 1)
error->one(FLERR,"Incorrect element names in ADP potential file");
file->elements = new char*[file->nelements];

View File

@ -3488,7 +3488,7 @@ void PairAIREBO::read_file(char *filename)
// global parameters
current_section = "global parameters";
for(int i = 0; i < params.size(); i++) {
for(int i = 0; i < (int)params.size(); i++) {
*params[i] = reader.next_double();
}

View File

@ -312,7 +312,7 @@ double PairComb3::init_one(int i, int j)
void PairComb3::read_lib()
{
int i,j,k,l,m;
int i,j,k,l;
int ii,jj,kk,ll,mm,iii;
// open library file on proc 0

View File

@ -469,8 +469,6 @@ void PairEAM::read_file(char *filename)
PotentialFileReader reader(lmp, filename, "EAM");
try {
char * line = nullptr;
reader.skip_line();
ValueTokenizer values = reader.next_values(2);

View File

@ -130,7 +130,7 @@ void PairEAMAlloy::read_file(char *filename)
ValueTokenizer values = reader.next_values(1);
file->nelements = values.next_int();
if (values.count() != file->nelements + 1)
if ((int)values.count() != file->nelements + 1)
error->one(FLERR,"Incorrect element names in EAM potential file");
file->elements = new char*[file->nelements];

View File

@ -518,7 +518,7 @@ void PairEAMCD::read_h_coeff(char *filename)
int degree = values.next_int();
nhcoeff = degree+1;
if (values.count() != nhcoeff + 1 || nhcoeff < 1)
if ((int)values.count() != nhcoeff + 1 || nhcoeff < 1)
error->one(FLERR, "Failed to read h(x) function coefficients in EAM file.");
hcoeff = new double[nhcoeff];

View File

@ -122,8 +122,6 @@ void PairEAMFS::read_file(char *filename)
PotentialFileReader reader(lmp, filename, "EAM");
try {
char * line = nullptr;
reader.skip_line();
reader.skip_line();
reader.skip_line();
@ -132,7 +130,7 @@ void PairEAMFS::read_file(char *filename)
ValueTokenizer values = reader.next_values(1);
file->nelements = values.next_int();
if (values.count() != file->nelements + 1)
if ((int)values.count() != file->nelements + 1)
error->one(FLERR,"Incorrect element names in EAM potential file");
file->elements = new char*[file->nelements];

View File

@ -130,7 +130,7 @@ void PairEAMAlloyOMP::read_file(char *filename)
ValueTokenizer values = reader.next_values(1);
file->nelements = values.next_int();
if (values.count() != file->nelements + 1)
if ((int)values.count() != file->nelements + 1)
error->one(FLERR,"Incorrect element names in EAM potential file");
file->elements = new char*[file->nelements];

View File

@ -130,7 +130,7 @@ void PairEAMFSOMP::read_file(char *filename)
ValueTokenizer values = reader.next_values(1);
file->nelements = values.next_int();
if (values.count() != file->nelements + 1)
if ((int)values.count() != file->nelements + 1)
error->one(FLERR,"Incorrect element names in EAM potential file");
file->elements = new char*[file->nelements];

View File

@ -256,7 +256,6 @@ void Comm::init_exchange()
int nfix = modify->nfix;
Fix **fix = modify->fix;
int onefix;
maxexchange_fix = 0;
for (int i = 0; i < nfix; i++)
maxexchange_fix += fix[i]->maxexchange;

View File

@ -1667,7 +1667,7 @@ int lammps_style_name(void* ptr, char * category, int index, char * buffer, int
Info info(lmp);
auto styles = info.get_available_styles(category);
if (index < styles.size()) {
if (index < (int)styles.size()) {
strncpy(buffer, styles[index].c_str(), max_size);
return true;
}

View File

@ -38,7 +38,7 @@ TableFileReader::~TableFileReader() {
char * TableFileReader::find_section_start(const std::string & keyword) {
char * line = nullptr;
while (line = reader->next_line()) {
while ((line = reader->next_line())) {
ValueTokenizer values(line);
std::string word = values.next_string();

View File

@ -498,7 +498,7 @@ std::string utils::get_potential_date(const std::string & path, const std::strin
reader.ignore_comments = false;
char * line = nullptr;
while (line = reader.next_line()) {
while ((line = reader.next_line())) {
ValueTokenizer values(line);
while (values.has_next()) {
std::string word = values.next_string();