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

@ -36,7 +36,7 @@ using namespace LAMMPS_NS;
ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
vptr(NULL), id_temp(NULL)
vptr(nullptr), id_temp(nullptr)
{
if (narg < 4) error->all(FLERR,"Illegal compute pressure command");
if (igroup) error->all(FLERR,"Compute pressure must use group all");
@ -51,7 +51,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
// store temperature ID used by pressure computation
// insure it is valid for temperature computation
if (strcmp(arg[3],"NULL") == 0) id_temp = NULL;
if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr;
else {
int n = strlen(arg[3]) + 1;
id_temp = new char[n];
@ -130,13 +130,13 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
// error check
if (keflag && id_temp == NULL)
if (keflag && id_temp == nullptr)
error->all(FLERR,"Compute pressure requires temperature ID "
"to include kinetic energy");
vector = new double[size_vector];
nvirial = 0;
vptr = NULL;
vptr = nullptr;
}
/* ---------------------------------------------------------------------- */
@ -185,7 +185,7 @@ void ComputePressure::init()
delete [] vptr;
nvirial = 0;
vptr = NULL;
vptr = nullptr;
if (pairhybridflag && force->pair) nvirial++;
if (pairflag && force->pair) nvirial++;
@ -221,7 +221,7 @@ void ComputePressure::init()
// flag Kspace contribution separately, since not summed across procs
if (kspaceflag && force->kspace) kspace_virial = force->kspace->virial;
else kspace_virial = NULL;
else kspace_virial = nullptr;
}
/* ----------------------------------------------------------------------