diff --git a/src/AMOEBA/amoeba_file.cpp b/src/AMOEBA/amoeba_file.cpp index ebedbc13d5..2089ab3a27 100644 --- a/src/AMOEBA/amoeba_file.cpp +++ b/src/AMOEBA/amoeba_file.cpp @@ -416,7 +416,7 @@ void PairAmoeba::read_keyfile(char *filename) const auto words = Tokenizer(trimmed).as_vector(); const int nwords = words.size(); - const auto keyword = words[0]; + const auto &keyword = words[0]; if (utils::strmatch(keyword, "^[^a-z]+")) { ; // ignore keywords that do not start with text diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index f2eef1d207..0726468c4f 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -118,7 +118,7 @@ void AtomVecBody::process_args(int narg, char **arg) #undef BODY_CLASS } else - error->all(FLERR, utils::check_packages_for_style("body", arg[0], lmp).c_str()); + error->all(FLERR, utils::check_packages_for_style("body", arg[0], lmp)); bptr->avec = this; icp = bptr->icp; diff --git a/src/input.cpp b/src/input.cpp index a641f300a3..09e5d6decb 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -212,7 +212,7 @@ void Input::file() mstart = m; - while (1) { + while (true) { if (maxline-m < 2) reallocate(line,maxline,0); // end of file reached, so break @@ -437,18 +437,18 @@ void Input::parse() } if (*ptr == '\'') { ptrmatch = strchr(ptr+1,'\''); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched single quote in command"); ptr = ptrmatch + 1; } else if (*ptr == '"') { if (strstr(ptr,"\"\"\"") == ptr) { ptrmatch = strstr(ptr+3,"\"\"\""); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched triple quote in command"); ptr = ptrmatch + 3; } else { ptrmatch = strchr(ptr+1,'"'); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched double quote in command"); ptr = ptrmatch + 1; } @@ -669,7 +669,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) } else if (*ptr == '\'') { ptrmatch = strchr(ptr+1,'\''); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched single quote in command"); nchars = ptrmatch+1 - ptr; strncpy(ptr2,ptr,nchars); @@ -678,7 +678,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) } else if (*ptr == '"') { if (strstr(ptr,"\"\"\"") == ptr) { ptrmatch = strstr(ptr+3,"\"\"\""); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched triple quote in command"); nchars = ptrmatch+3 - ptr; strncpy(ptr2,ptr,nchars); @@ -686,7 +686,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) ptr2 += nchars; } else { ptrmatch = strchr(ptr+1,'"'); - if (ptrmatch == NULL) + if (ptrmatch == nullptr) error->all(FLERR,"Unmatched double quote in command"); nchars = ptrmatch+1 - ptr; strncpy(ptr2,ptr,nchars);