clang-tidy fixes
This commit is contained in:
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user