T2345: After examining comments changed by batch conversion of NULL

to nullptr, I've corrected a small number where it seemed clear
that the previous NULL should have been either "NULL" (where the
code is looking for a string with that value),  or null char / null byte
(where the comment is talking about the char/byte that terminates
a c-style string).

Also changed 6 places where the batch change had changed 'NULL ptr'
to 'nullptr ptr'. Now they simply say 'nullptr'.
This commit is contained in:
Anne Gunn
2020-09-12 09:02:31 -06:00
parent 9f0354f816
commit 1597cd5dcb
46 changed files with 56 additions and 56 deletions

View File

@ -324,7 +324,7 @@ void PairEAMAlloyGPU::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -324,7 +324,7 @@ void PairEAMFSGPU::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -938,7 +938,7 @@ void PairEAMAlloyKokkos<DeviceType>::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -938,7 +938,7 @@ void PairEAMFSKokkos<DeviceType>::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -465,7 +465,7 @@ void PairADP::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -185,7 +185,7 @@ void PairAIREBO::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to C and H
// map[i] = which element (0,1) the Ith atom type is, -1 if nullptr
// map[i] = which element (0,1) the Ith atom type is, -1 if "NULL"
for (int i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -40,7 +40,7 @@ class PairAIREBO : public Pair {
enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code
protected:
int *map; // 0 (C), 1 (H), or -1 (nullptr) for each type
int *map; // 0 (C), 1 (H), or -1 ("NULL") for each type
int variant;
int ljflag,torflag; // 0/1 if LJ/Morse,torsion terms included

View File

@ -456,7 +456,7 @@ void PairComb::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -192,7 +192,7 @@ void PairComb3::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -70,7 +70,7 @@ void PairEAMAlloy::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -70,7 +70,7 @@ void PairEAMFS::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -388,7 +388,7 @@ void PairEIM::coeff(int narg, char **arg)
read_file(arg[2+nelements]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3 + nelements; i < narg; i++) {
m = i - (3+nelements) + 1;

View File

@ -283,7 +283,7 @@ void PairGW::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -135,8 +135,8 @@ void PairLCBOP::coeff(int narg, char **arg)
if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to C and nullptr
// map[i] = which element (0 for C) the Ith atom type is, -1 if nullptr
// read args that map atom types to C and "NULL"
// map[i] = which element (0 for C) the Ith atom type is, -1 if "NULL"
for (int i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -39,7 +39,7 @@ class PairLCBOP : public Pair {
protected:
int **pages; // neighbor list pages
int *map; // 0 (C) or -1 (nullptr) for each type
int *map; // 0 (C) or -1 ("NULL") for each type
int me;

View File

@ -198,7 +198,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -479,7 +479,7 @@ void PairPolymorphic::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -262,7 +262,7 @@ void PairSW::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -306,7 +306,7 @@ void PairTersoff::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -269,7 +269,7 @@ void PairVashishta::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -961,7 +961,7 @@ void FixColvars::write_restart(FILE *fp)
proxy->serialize_status(rest_text);
// TODO call write_output_files()
const char *cvm_state = rest_text.c_str();
int len = strlen(cvm_state) + 1; // need to include terminating nullptr byte.
int len = strlen(cvm_state) + 1; // need to include terminating null byte.
fwrite(&len,sizeof(int),1,fp);
fwrite(cvm_state,1,len,fp);
}

View File

@ -69,7 +69,7 @@ void PairEAMAlloyIntel::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -69,7 +69,7 @@ void PairEAMFSIntel::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -556,7 +556,7 @@ void PairMEAMC::read_files(const std::string &globalfile,
delete [] rozero;
delete [] found;
// done if user param file is nullptr
// done if user param file is "NULL"
if (userfile == "NULL") return;

View File

@ -266,7 +266,7 @@ void PairAGNI::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -139,7 +139,7 @@ void PairDRIP::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -779,7 +779,7 @@ void PairEDIP::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -539,7 +539,7 @@ void PairEDIPMulti::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -467,7 +467,7 @@ void PairExTeP::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -167,7 +167,7 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -168,7 +168,7 @@ void PairKolmogorovCrespiFull::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -232,7 +232,7 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg)
utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -228,7 +228,7 @@ void PairLebedevaZ::coeff(int narg, char **arg)
utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -398,7 +398,7 @@ void PairMEAMSpline::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -393,7 +393,7 @@ void PairMEAMSWSpline::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -755,7 +755,7 @@ void PairTersoffTable::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -69,7 +69,7 @@ void PairEAMAlloyOMP::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -69,7 +69,7 @@ void PairEAMFSOMP::coeff(int narg, char **arg)
read_file(arg[2]);
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
for (i = 3; i < narg; i++) {
if (strcmp(arg[i],"NULL") == 0) {

View File

@ -327,7 +327,7 @@ void PairReaxC::coeff( int nargs, char **args )
}
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
int itmp = 0;
int nreax_types = system->reax_param.num_atom_types;

View File

@ -277,7 +277,7 @@ void PairSMTBQ::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -2201,10 +2201,10 @@ void Atom::add_callback(int flag)
int ifix;
// find the fix
// if find nullptr ptr:
// if find nullptr:
// it's this one, since it is being replaced and has just been deleted
// at this point in re-creation
// if don't find nullptr ptr:
// if don't find nullptr:
// i is set to nfix = new one currently being added at end of list
for (ifix = 0; ifix < modify->nfix; ifix++)

View File

@ -67,7 +67,7 @@ void FixSpringRG::init()
{
masstotal = group->mass(igroup);
// if rg0 was specified as nullptr, compute current Rg
// Compute current Rg
// only occurs on 1st run
if (rg0_flag) {

View File

@ -467,10 +467,10 @@ char *Input::nextword(char *str, char **next)
// start = first char beyond quote
// stop = first char of matching quote
// next = first char beyond matching quote
// next must be nullptr or whitespace
// next must be null char or whitespace
// if start is not single/double/triple quote:
// stop = first whitespace char after start
// next = char after stop, or stop itself if stop is nullptr
// next = char after stop, or stop itself if stop is null char
if (strstr(start,"\"\"\"") == start) {
stop = strstr(&start[3],"\"\"\"");
@ -492,7 +492,7 @@ char *Input::nextword(char *str, char **next)
else *next = stop+1;
}
// set stop to nullptr to terminate word
// set stop to null char to terminate word
*stop = '\0';
return start;
@ -510,9 +510,9 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag)
// use str2 as scratch space to expand str, then copy back to str
// reallocate str and str2 as necessary
// do not replace $ inside single/double/triple quotes
// var = pts at variable name, ended by nullptr
// if $ is followed by '{', trailing '}' becomes nullptr
// else $x becomes x followed by nullptr
// var = pts at variable name, ended by null char
// if $ is followed by '{', trailing '}' becomes null char
// else $x becomes x followed by null char
// beyond = points to text following variable
int i,n,paren_count;

View File

@ -143,7 +143,7 @@ void PairCoulStreitz::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
// read args that map atom types to elements in potential file
// map[i] = which element the Ith atom type is, -1 if nullptr
// map[i] = which element the Ith atom type is, -1 if "NULL"
// nelements = # of unique elements
// elements = list of element names

View File

@ -713,7 +713,7 @@ void ReadDump::read_atoms()
if (nnew > maxnew || maxnew == 0) {
memory->destroy(fields);
maxnew = MAX(nnew,1); // avoid nullptr ptr
maxnew = MAX(nnew,1); // avoid nullptr
memory->create(fields,maxnew,nfield,"read_dump:fields");
}
@ -753,7 +753,7 @@ void ReadDump::read_atoms()
nnew = static_cast<int> (olast - ofirst);
if (nnew > maxnew || maxnew == 0) {
memory->destroy(fields);
maxnew = MAX(nnew,1); // avoid nullptr ptr
maxnew = MAX(nnew,1); // avoid nullptr
memory->create(fields,maxnew,nfield,"read_dump:fields");
}
@ -779,7 +779,7 @@ void ReadDump::read_atoms()
nnew = static_cast<int> (sum);
if (nnew > maxnew || maxnew == 0) {
memory->destroy(fields);
maxnew = MAX(nnew,1); // avoid nullptr ptr
maxnew = MAX(nnew,1); // avoid nullptr
memory->create(fields,maxnew,nfield,"read_dump:fields");
}
@ -1105,7 +1105,7 @@ void ReadDump::migrate_new_atoms()
Irregular *irregular = new Irregular(lmp);
int nrecv = irregular->create_data(nnew,procassign,1);
int newmaxnew = MAX(nrecv,maxnew);
newmaxnew = MAX(newmaxnew,1); // avoid nullptr ptr
newmaxnew = MAX(newmaxnew,1); // avoid nullptr
memory->create(newfields,newmaxnew,nfield,"read_dump:newfields");
irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double),
(char *) &newfields[0][0]);

View File

@ -91,7 +91,7 @@ void Run::command(int narg, char **arg)
// all remaining args are commands
// first,last = arg index of first/last commands
// set ncommands = 0 if single command and it is nullptr
// set ncommands = 0 if single command and it is "NULL"
} else if (strcmp(arg[iarg],"every") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal run command");