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

@ -31,7 +31,7 @@ enum{ID,TYPE,X,Y,Z};
ReaderXYZ::ReaderXYZ(LAMMPS *lmp) : Reader(lmp)
{
line = new char[MAXLINE];
fieldindex = NULL;
fieldindex = nullptr;
nstep = 0;
}
@ -52,7 +52,7 @@ ReaderXYZ::~ReaderXYZ()
int ReaderXYZ::read_time(bigint &ntimestep)
{
char *eof = fgets(line,MAXLINE,fp);
if (eof == NULL) return 1;
if (eof == nullptr) return 1;
// first line has to have the number of atoms
// truncate the string to the first whitespace,
@ -109,7 +109,7 @@ void ReaderXYZ::skip()
match Nfield fields to per-atom column labels
allocate and set fieldindex = which column each field maps to
fieldtype = X,VX,IZ etc
fieldlabel = user-specified label or NULL if use fieldtype default
fieldlabel = user-specified label or nullptr if use fieldtype default
xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu
only called by proc 0
------------------------------------------------------------------------- */
@ -174,7 +174,7 @@ void ReaderXYZ::read_atoms(int n, int nfield, double **fields)
for (i = 0; i < n; i++) {
eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of dump file");
if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file");
++nid;
rv = sscanf(line,"%*s%lg%lg%lg", &myx, &myy, &myz);
@ -216,8 +216,8 @@ void ReaderXYZ::read_atoms(int n, int nfield, double **fields)
void ReaderXYZ::read_lines(int n)
{
char *eof = NULL;
char *eof = nullptr;
if (n <= 0) return;
for (int i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of dump file");
if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file");
}