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

@ -160,7 +160,7 @@ void ImproperHybrid::allocate()
maximproper = new int[nstyles];
improperlist = new int**[nstyles];
for (int m = 0; m < nstyles; m++) maximproper[m] = 0;
for (int m = 0; m < nstyles; m++) improperlist[m] = NULL;
for (int m = 0; m < nstyles; m++) improperlist[m] = nullptr;
}
/* ---------------------------------------------------------------------- */
@ -325,7 +325,7 @@ void ImproperHybrid::write_restart(FILE *fp)
void ImproperHybrid::read_restart(FILE *fp)
{
int me = comm->me;
if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error);
if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error);
MPI_Bcast(&nstyles,1,MPI_INT,0,world);
styles = new Improper*[nstyles];
keywords = new char*[nstyles];
@ -334,10 +334,10 @@ void ImproperHybrid::read_restart(FILE *fp)
int n,dummy;
for (int m = 0; m < nstyles; m++) {
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error);
MPI_Bcast(&n,1,MPI_INT,0,world);
keywords[m] = new char[n];
if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error);
if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error);
MPI_Bcast(keywords[m],n,MPI_CHAR,0,world);
styles[m] = force->new_improper(keywords[m],0,dummy);
styles[m]->read_restart_settings(fp);