clang-tidy fixes

This commit is contained in:
Axel Kohlmeyer
2022-09-10 03:18:06 -04:00
parent 22709b73e2
commit 4998c065da
3 changed files with 9 additions and 9 deletions

View File

@ -416,7 +416,7 @@ void PairAmoeba::read_keyfile(char *filename)
const auto words = Tokenizer(trimmed).as_vector(); const auto words = Tokenizer(trimmed).as_vector();
const int nwords = words.size(); const int nwords = words.size();
const auto keyword = words[0]; const auto &keyword = words[0];
if (utils::strmatch(keyword, "^[^a-z]+")) { if (utils::strmatch(keyword, "^[^a-z]+")) {
; // ignore keywords that do not start with text ; // ignore keywords that do not start with text

View File

@ -118,7 +118,7 @@ void AtomVecBody::process_args(int narg, char **arg)
#undef BODY_CLASS #undef BODY_CLASS
} else } 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; bptr->avec = this;
icp = bptr->icp; icp = bptr->icp;

View File

@ -212,7 +212,7 @@ void Input::file()
mstart = m; mstart = m;
while (1) { while (true) {
if (maxline-m < 2) reallocate(line,maxline,0); if (maxline-m < 2) reallocate(line,maxline,0);
// end of file reached, so break // end of file reached, so break
@ -437,18 +437,18 @@ void Input::parse()
} }
if (*ptr == '\'') { if (*ptr == '\'') {
ptrmatch = strchr(ptr+1,'\''); ptrmatch = strchr(ptr+1,'\'');
if (ptrmatch == NULL) if (ptrmatch == nullptr)
error->all(FLERR,"Unmatched single quote in command"); error->all(FLERR,"Unmatched single quote in command");
ptr = ptrmatch + 1; ptr = ptrmatch + 1;
} else if (*ptr == '"') { } else if (*ptr == '"') {
if (strstr(ptr,"\"\"\"") == ptr) { if (strstr(ptr,"\"\"\"") == ptr) {
ptrmatch = strstr(ptr+3,"\"\"\""); ptrmatch = strstr(ptr+3,"\"\"\"");
if (ptrmatch == NULL) if (ptrmatch == nullptr)
error->all(FLERR,"Unmatched triple quote in command"); error->all(FLERR,"Unmatched triple quote in command");
ptr = ptrmatch + 3; ptr = ptrmatch + 3;
} else { } else {
ptrmatch = strchr(ptr+1,'"'); ptrmatch = strchr(ptr+1,'"');
if (ptrmatch == NULL) if (ptrmatch == nullptr)
error->all(FLERR,"Unmatched double quote in command"); error->all(FLERR,"Unmatched double quote in command");
ptr = ptrmatch + 1; ptr = ptrmatch + 1;
} }
@ -669,7 +669,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag)
} else if (*ptr == '\'') { } else if (*ptr == '\'') {
ptrmatch = strchr(ptr+1,'\''); ptrmatch = strchr(ptr+1,'\'');
if (ptrmatch == NULL) if (ptrmatch == nullptr)
error->all(FLERR,"Unmatched single quote in command"); error->all(FLERR,"Unmatched single quote in command");
nchars = ptrmatch+1 - ptr; nchars = ptrmatch+1 - ptr;
strncpy(ptr2,ptr,nchars); strncpy(ptr2,ptr,nchars);
@ -678,7 +678,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag)
} else if (*ptr == '"') { } else if (*ptr == '"') {
if (strstr(ptr,"\"\"\"") == ptr) { if (strstr(ptr,"\"\"\"") == ptr) {
ptrmatch = strstr(ptr+3,"\"\"\""); ptrmatch = strstr(ptr+3,"\"\"\"");
if (ptrmatch == NULL) if (ptrmatch == nullptr)
error->all(FLERR,"Unmatched triple quote in command"); error->all(FLERR,"Unmatched triple quote in command");
nchars = ptrmatch+3 - ptr; nchars = ptrmatch+3 - ptr;
strncpy(ptr2,ptr,nchars); strncpy(ptr2,ptr,nchars);
@ -686,7 +686,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag)
ptr2 += nchars; ptr2 += nchars;
} else { } else {
ptrmatch = strchr(ptr+1,'"'); ptrmatch = strchr(ptr+1,'"');
if (ptrmatch == NULL) if (ptrmatch == nullptr)
error->all(FLERR,"Unmatched double quote in command"); error->all(FLERR,"Unmatched double quote in command");
nchars = ptrmatch+1 - ptr; nchars = ptrmatch+1 - ptr;
strncpy(ptr2,ptr,nchars); strncpy(ptr2,ptr,nchars);