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:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user