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:
@ -44,14 +44,14 @@ enum{PERATOM,LOCAL};
|
||||
|
||||
ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg),
|
||||
nvalues(0), which(NULL), argindex(NULL), flavor(NULL),
|
||||
value2index(NULL), ids(NULL), onevec(NULL), replace(NULL), indices(NULL),
|
||||
owner(NULL), idregion(NULL), varatom(NULL)
|
||||
nvalues(0), which(nullptr), argindex(nullptr), flavor(nullptr),
|
||||
value2index(nullptr), ids(nullptr), onevec(nullptr), replace(nullptr), indices(nullptr),
|
||||
owner(nullptr), idregion(nullptr), varatom(nullptr)
|
||||
{
|
||||
int iarg = 0;
|
||||
if (strcmp(style,"reduce") == 0) {
|
||||
if (narg < 5) error->all(FLERR,"Illegal compute reduce command");
|
||||
idregion = NULL;
|
||||
idregion = nullptr;
|
||||
iarg = 3;
|
||||
} else if (strcmp(style,"reduce/region") == 0) {
|
||||
if (narg < 6) error->all(FLERR,"Illegal compute reduce/region command");
|
||||
@ -93,13 +93,13 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
|
||||
value2index = new int[nargnew];
|
||||
for (int i=0; i < nargnew; ++i) {
|
||||
which[i] = argindex[i] = flavor[i] = value2index[i] = UNKNOWN;
|
||||
ids[i] = NULL;
|
||||
ids[i] = nullptr;
|
||||
}
|
||||
nvalues = 0;
|
||||
|
||||
iarg = 0;
|
||||
while (iarg < nargnew) {
|
||||
ids[nvalues] = NULL;
|
||||
ids[nvalues] = nullptr;
|
||||
|
||||
if (strcmp(arg[iarg],"x") == 0) {
|
||||
which[nvalues] = X;
|
||||
@ -190,7 +190,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (replace[i] >= 0) flag = 1;
|
||||
if (!flag) {
|
||||
delete [] replace;
|
||||
replace = NULL;
|
||||
replace = nullptr;
|
||||
}
|
||||
|
||||
// if wildcard expansion occurred, free earg memory from expand_args()
|
||||
@ -285,8 +285,8 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
|
||||
scalar_flag = 1;
|
||||
if (mode == SUM || mode == SUMSQ) extscalar = 1;
|
||||
else extscalar = 0;
|
||||
vector = onevec = NULL;
|
||||
indices = owner = NULL;
|
||||
vector = onevec = nullptr;
|
||||
indices = owner = nullptr;
|
||||
} else {
|
||||
vector_flag = 1;
|
||||
size_vector = nvalues;
|
||||
@ -299,7 +299,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
|
||||
}
|
||||
|
||||
maxatom = 0;
|
||||
varatom = NULL;
|
||||
varatom = nullptr;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user