use true/false instead of 1/0 detected and changed by clang-tidy

This commit is contained in:
Axel Kohlmeyer
2021-10-20 12:41:02 -04:00
parent 84666543d1
commit 85433e8bd1
65 changed files with 130 additions and 130 deletions

View File

@ -692,7 +692,7 @@ int Variable::next(int narg, char **arg)
if (!random) random = new RanMars(lmp,seed);
int delay = (int) (1000000*random->uniform());
platform::usleep(delay);
while (1) {
while (true) {
if (!rename("tmp.lammps.variable","tmp.lammps.variable.lock")) break;
delay = (int) (1000000*random->uniform());
platform::usleep(delay);
@ -1234,7 +1234,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
if (str == nullptr)
print_var_error(FLERR,"Invalid syntax in variable formula",ivar);
while (1) {
while (true) {
onechar = str[i];
// whitespace: just skip
@ -3214,7 +3214,7 @@ int Variable::find_matching_paren(char *str, int i, char *&contents, int ivar)
int istart = i;
int ilevel = 0;
while (1) {
while (true) {
i++;
if (!str[i]) break;
if (str[i] == '(') ilevel++;
@ -4722,7 +4722,7 @@ double Variable::evaluate_boolean(char *str)
int i = 0;
int expect = ARG;
while (1) {
while (true) {
onechar = str[i];
// whitespace: just skip
@ -5016,7 +5016,7 @@ int VarReader::read_scalar(char *str)
// read one string from file
if (me == 0) {
while (1) {
while (true) {
ptr = fgets(str,MAXLINE,fp);
if (!ptr) { n=0; break; } // end of file
ptr[strcspn(ptr,"#")] = '\0'; // strip comment
@ -5059,7 +5059,7 @@ int VarReader::read_peratom()
char str[MAXLINE];
if (me == 0) {
while (1) {
while (true) {
ptr = fgets(str,MAXLINE,fp);
if (!ptr) { n=0; break; } // end of file
ptr[strcspn(ptr,"#")] = '\0'; // strip comment