T2345: Replace instances of NULL with nullptr

The following changes have been applied to src and lib folders:
regex replace: ([^"_])NULL ⇒ \1nullptr (8968 chgs in src, 1153 in lib)
Manually find/change: (void \*) nullptr ⇒ nullptr (1 case)
regex find: ".*?nullptr.*?"
  Manually ~14 cases back to "NULL" in src, ~2 in lib
  regex finds a few false positive where nullptr appears between two
  strings in a function call
This commit is contained in:
Anne Gunn
2020-09-11 07:39:46 -06:00
parent 101d39142e
commit f1ef7d85a8
1217 changed files with 8531 additions and 8531 deletions

View File

@ -384,7 +384,7 @@ void NEBSpin::readfile(char *file, int flag)
open(file);
while (1) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of neb/spin file");
if (eof == nullptr) error->one(FLERR,"Unexpected end of neb/spin file");
start = &line[strspn(line," \t\n\v\f\r")];
if (*start != '\0' && *start != '#') break;
}
@ -398,7 +398,7 @@ void NEBSpin::readfile(char *file, int flag)
open(file);
while (1) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of neb/spin file");
if (eof == nullptr) error->one(FLERR,"Unexpected end of neb/spin file");
start = &line[strspn(line," \t\n\v\f\r")];
if (*start != '\0' && *start != '#') break;
}
@ -452,7 +452,7 @@ void NEBSpin::readfile(char *file, int flag)
values[0] = strtok(buf," \t\n\r\f");
for (j = 1; j < nwords; j++)
values[j] = strtok(NULL," \t\n\r\f");
values[j] = strtok(nullptr," \t\n\r\f");
// adjust spin coord based on replica fraction
// for flag = 0, interpolate for intermediate and final replicas
@ -705,7 +705,7 @@ void NEBSpin::open(char *file)
#endif
}
if (fp == NULL) {
if (fp == nullptr) {
char str[128];
snprintf(str,128,"Cannot open file %s",file);
error->one(FLERR,str);