diff --git a/src/BODY/body_rounded_polygon.cpp b/src/BODY/body_rounded_polygon.cpp index f2e798c93c..c7d006c67f 100644 --- a/src/BODY/body_rounded_polygon.cpp +++ b/src/BODY/body_rounded_polygon.cpp @@ -321,7 +321,7 @@ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is nullptr, just return buffer size + if buf is a null pointer, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolygon::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/body_rounded_polyhedron.cpp b/src/BODY/body_rounded_polyhedron.cpp index b647c7e541..423a3b3443 100644 --- a/src/BODY/body_rounded_polyhedron.cpp +++ b/src/BODY/body_rounded_polyhedron.cpp @@ -373,7 +373,7 @@ void BodyRoundedPolyhedron::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is nullptr, just return buffer size + if buf is a null pointer, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolyhedron::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index 99ae8ed094..2e69f70af7 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -226,7 +226,7 @@ void FixWallBodyPolygon::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to nullptr, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 2507b94d25..472fe5fb21 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -233,7 +233,7 @@ void FixWallBodyPolyhedron::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to nullptr, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index 1d7461199d..a3cffef9cc 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -1880,7 +1880,7 @@ void PairBodyRoundedPolyhedron::project_pt_plane(const double* q, face_index = face index of the body xmi = atom i's coordinates q1 = tested point on the face (e.g. the projection of a point) - q2 = another point (can be nullptr) for face-edge intersection + q2 = another point (can be a null pointer) for face-edge intersection Output: inside1 = 1 if q1 is inside the polygon, 0 otherwise inside2 = 1 if q2 is inside the polygon, 0 otherwise diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index 9b753edd68..a2e3e3ab98 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -117,7 +117,7 @@ void PPPMGPU::init() // thru its deallocate(), allocate() // NOTE: could free density_brick and vdxyz_brick after PPPM allocates them, // before allocating db_gpu and vd_brick down below, if don't need, - // if do this, make sure to set them to nullptr + // if do this, make sure to set them to a null pointer destroy_3d_offset(density_brick_gpu,nzlo_out,nylo_out); destroy_3d_offset(vd_brick,nzlo_out,nylo_out); diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 25d271be9d..9482aae3e7 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -416,7 +416,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : mass_rigid = nullptr; // initialize history as if particle is not touching region - // history_one will be nullptr for wallstyle = REGION + // history_one will be a null pointer for wallstyle = REGION if (use_history && history_one) { int nlocal = atom->nlocal; @@ -576,7 +576,7 @@ void FixWallGran::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to nullptr, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential // set history if pair potential stores history diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 1b3be22e7f..a81a4c787c 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -103,7 +103,7 @@ class FixWallGran : public Fix { // rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h index dd9a843142..c27ce8a9af 100644 --- a/src/GRANULAR/pair_gran_hooke_history.h +++ b/src/GRANULAR/pair_gran_hooke_history.h @@ -61,7 +61,7 @@ class PairGranHookeHistory : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index ce417812de..7ef4f2af98 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -56,7 +56,7 @@ class PairGranular : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, nullptr if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/KIM/fix_store_kim.h b/src/KIM/fix_store_kim.h index 4e4890ea6e..5775056876 100644 --- a/src/KIM/fix_store_kim.h +++ b/src/KIM/fix_store_kim.h @@ -79,8 +79,8 @@ class FixStoreKIM : public Fix { private: void *simulator_model; // pointer to KIM simulator model class void *model_name; // string of KIM model name - void *model_units; // string of unit conversion origin or nullptr - void *user_units; // string of unit conversion target or nullptr + void *model_units; // string of unit conversion origin or null pointer + void *user_units; // string of unit conversion target or null pointer }; } diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 7551216072..c5ae2ec380 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -108,7 +108,7 @@ void KimInteractions::do_setup(int narg, char **arg) // check if we had a kim_init command by finding fix STORE/KIM // retrieve model name and pointer to simulator model class instance. - // validate model name if not given as nullptr. + // validate model name if not given as null pointer. int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index ed0cfccd43..e9093ee0a1 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -282,7 +282,7 @@ int AtomKokkos::add_custom(const char *name, int flag) /* ---------------------------------------------------------------------- remove a custom variable of type flag = 0/1 for int/double at index - free memory for vector and name and set ptrs to nullptr + free memory for vector and name and set ptrs to a null pointer ivector/dvector and iname/dname lists never shrink ------------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 1eaf20eadb..cb55dd3141 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -94,7 +94,7 @@ struct PairComputeFunctor { dup_vatom = Kokkos::Experimental::create_scatter_view::value >(c.d_vatom); }; - // Call cleanup_copy which sets allocations nullptr which are destructed by the PairStyle + // Call cleanup_copy which sets allocations to null which are destructed by the PairStyle ~PairComputeFunctor() {c.cleanup_copy();list.copymode = 1;}; KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const { diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 0581f1e359..055e62c418 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -74,7 +74,7 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : thermo_virial = 1; // store ID of compute pe/atom used to generate Coulomb potential for LATTE - // nullptr means LATTE will compute Coulombic potential + // null pointer means LATTE will compute Coulombic potential coulomb = 0; id_pe = nullptr; diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index 5c3ca7264e..35cca32871 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -137,7 +137,7 @@ void DumpXTC::init_style() void DumpXTC::openfile() { // XTC maintains it's own XDR file ptr - // set fp to nullptr so parent dump class will not use it + // set fp to a null pointer so parent dump class will not use it fp = nullptr; if (me == 0) diff --git a/src/USER-DPD/pair_multi_lucy.cpp b/src/USER-DPD/pair_multi_lucy.cpp index 2e556d82e4..a266e94ccb 100644 --- a/src/USER-DPD/pair_multi_lucy.cpp +++ b/src/USER-DPD/pair_multi_lucy.cpp @@ -582,7 +582,7 @@ void PairMultiLucy::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to nullptr, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucy::null_table(Table *tb) diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index e56743ea1d..d8356d20c4 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -727,7 +727,7 @@ void PairMultiLucyRX::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to nullptr, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucyRX::null_table(Table *tb) diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index c80073f3c7..d8900d2348 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -162,7 +162,7 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) fft = new FFT3d(lmp,world,nz,ny,nx,0,nz-1,0,ny-1,nxlo,nxhi,0,nz-1,0,ny-1,nxlo,nxhi,0,0,&mysize,0); memory->create(fft_data, MAX(1,mynq)*2, "fix_phonon:fft_data"); - // allocate variables; MAX(1,... is used because nullptr buffer will result in error for MPI + // allocate variables; MAX(1,... is used because a null buffer will result in error for MPI memory->create(RIloc,ngroup,(sysdim+1),"fix_phonon:RIloc"); memory->create(RIall,ngroup,(sysdim+1),"fix_phonon:RIall"); memory->create(Rsort,ngroup, sysdim, "fix_phonon:Rsort"); diff --git a/src/atom.cpp b/src/atom.cpp index 539bf6fc0b..e140d2e473 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2201,10 +2201,10 @@ void Atom::add_callback(int flag) int ifix; // find the fix - // if find nullptr: + // if find null pointer: // 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: + // if don't find null pointer: // i is set to nfix = new one currently being added at end of list for (ifix = 0; ifix < modify->nfix; ifix++) diff --git a/src/atom.h b/src/atom.h index 841d224d23..4ea4157fa2 100644 --- a/src/atom.h +++ b/src/atom.h @@ -55,7 +55,7 @@ class Atom : protected Pointers { int firstgroup; // store atoms in this group first, -1 if unset int nfirst; // # of atoms in first group on this proc - char *firstgroupname; // group-ID to store first, nullptr if unset + char *firstgroupname; // group-ID to store first, null pointer if unset // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variable diff --git a/src/comm.cpp b/src/comm.cpp index becb52df91..32a4152294 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -888,7 +888,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, if (inorder) nrvous = irregular->create_data_grouped(n,procs); else nrvous = irregular->create_data(n,procs); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -925,7 +925,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, nout = irregular->create_data_grouped(nrvous_out,procs_rvous); else nout = irregular->create_data(nrvous_out,procs_rvous); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf = (char *) memory->smalloc((bigint) nout*outsize+1, "rendezvous:outbuf"); @@ -967,7 +967,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!inorder) { memory->create(procs_a2a,nprocs,"rendezvous:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer inbuf_a2a = (char *) memory->smalloc((bigint) n*insize+1, "rendezvous:inbuf"); @@ -1032,7 +1032,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, } // all2all comm of inbuf from caller decomp to rendezvous decomp - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -1074,7 +1074,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!outorder) { memory->create(procs_a2a,nprocs,"rendezvous_a2a:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf_a2a = (char *) memory->smalloc((bigint) nrvous_out*outsize+1, "rendezvous:outbuf"); @@ -1135,7 +1135,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // all2all comm of outbuf from rendezvous decomp back to caller decomp // caller will free outbuf - // add 1 item to the allocated buffer size, so the returned pointer is not nullptr + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf = (char *) memory->smalloc((bigint) nout*outsize+1,"rendezvous:outbuf"); diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index 14c86383b7..392179043a 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -96,7 +96,7 @@ class ComputeChunkAtom : public Compute { class FixStore *fixstore; class Fix *lockfix; // ptr to FixAveChunk that is locking out setups - // nullptr if no lock currently in place + // null pointer if no lock currently in place bigint lockstart,lockstop; // timesteps for start and stop of locking bigint invoked_setup; // last timestep setup_chunks and nchunk calculated diff --git a/src/dump.cpp b/src/dump.cpp index 3f1e997d13..2259f9ef3e 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -202,7 +202,7 @@ Dump::~Dump() delete[] nameslist; } - // XTC style sets fp to nullptr since it closes file in its destructor + // XTC style sets fp to a null pointer since it closes file in its destructor if (multifile == 0 && fp != nullptr) { if (compressed) { diff --git a/src/error.cpp b/src/error.cpp index d89ea5b681..fff3072bb1 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -69,7 +69,7 @@ void Error::universe_all(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -95,7 +95,7 @@ void Error::universe_one(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -143,7 +143,7 @@ void Error::all(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -192,7 +192,7 @@ void Error::one(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be nullptr when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 35ac20e370..e6ed9ea023 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -152,7 +152,7 @@ FixPropertyAtom::~FixPropertyAtom() if (border) atom->delete_callback(id,2); // deallocate per-atom vectors in Atom class - // set ptrs to nullptr, so they no longer exist for Atom class + // set ptrs to a null pointer, so they no longer exist for Atom class for (int m = 0; m < nvalue; m++) { if (style[m] == MOLECULE) { diff --git a/src/input.cpp b/src/input.cpp index 5e40d2dede..4539dfabf8 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -338,7 +338,7 @@ char *Input::one(const std::string &single) } // parse the line - // if no command, just return nullptr + // if no command, just return a null pointer parse(); if (command == nullptr) return nullptr; @@ -450,7 +450,7 @@ void Input::parse() treat text between single/double/triple quotes as one arg matching quote must be followed by whitespace char if not end of string strip quotes from returned word - return ptr to start of word or nullptr if no word in string + return ptr to start of word or null pointer if no word in string also return next = ptr after word ------------------------------------------------------------------------- */ diff --git a/src/modify.cpp b/src/modify.cpp index a908cfc7af..0f0a86cdd8 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -821,7 +821,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // warn if new group != old group // delete old fix, but do not call update_callback(), // since will replace this fix and thus other fix locs will not change - // set ptr to nullptr in case new fix scans list of fixes, + // set ptr to a null pointer in case new fix scans list of fixes, // e.g. scan will occur in add_callback() if called by new fix // if fix ID does not exist: // set newflag = 1 so create new fix diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 26e7d6b74b..db67f71548 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -378,7 +378,7 @@ void Neighbor::init() // We cannot remove special neighbors with kspace or kspace-like pair styles // as the exclusion needs to remove the full coulomb and not the damped interaction. // Special treatment is required for hybrid pair styles since Force::pair_match() - // will only return a non-nullptr pointer if there is only one substyle of the kind. + // will only return a non-null pointer if there is only one substyle of the kind. if (force->kspace) { special_flag[1] = special_flag[2] = special_flag[3] = 2; diff --git a/src/output.h b/src/output.h index 6a64e67c93..1af03df228 100644 --- a/src/output.h +++ b/src/output.h @@ -29,7 +29,7 @@ class Output : protected Pointers { bigint next_thermo; // next timestep for thermo output int thermo_every; // output freq for thermo, 0 if first/last only bigint last_thermo; // last timestep thermo was output - char *var_thermo; // variable name for thermo freq, nullptr if every + char *var_thermo; // variable name for thermo freq, null pointer if every int ivar_thermo; // variable index for thermo frequency class Thermo *thermo; // Thermodynamic computations diff --git a/src/pair_table.cpp b/src/pair_table.cpp index c0fad544d7..a92d2e4911 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -821,7 +821,7 @@ void PairTable::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to nullptr, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairTable::null_table(Table *tb) diff --git a/src/read_dump.cpp b/src/read_dump.cpp index dcbb95fccc..426d0f5a92 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -713,7 +713,7 @@ void ReadDump::read_atoms() if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -753,7 +753,7 @@ void ReadDump::read_atoms() nnew = static_cast (olast - ofirst); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -779,7 +779,7 @@ void ReadDump::read_atoms() nnew = static_cast (sum); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid nullptr + maxnew = MAX(nnew,1); // avoid null pointer 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 + newmaxnew = MAX(newmaxnew,1); // avoid null pointer memory->create(newfields,newmaxnew,nfield,"read_dump:newfields"); irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double), (char *) &newfields[0][0]); diff --git a/src/utils.cpp b/src/utils.cpp index e985f9e6e5..b0928fd18a 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -171,7 +171,7 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, errmsg += "'"; if (error) error->one(srcname,srcline,errmsg); - if (s) *s = '\0'; // truncate string to empty in case error is nullptr + if (s) *s = '\0'; // truncate string to empty in case error is null pointer } return; } diff --git a/src/utils.h b/src/utils.h index cf8952b8a6..c9e958365d 100644 --- a/src/utils.h +++ b/src/utils.h @@ -60,7 +60,7 @@ namespace LAMMPS_NS { * \param s buffer for storing the result of fgets() * \param size size of buffer s (max number of bytes read by fgets()) * \param fp file pointer used by fgets() - * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfgets(const char *srcname, int srcline, char *s, int size, @@ -75,7 +75,7 @@ namespace LAMMPS_NS { * \param size size of data elements read by fread() * \param num number of data elements read by fread() * \param fp file pointer used by fread() - * \param filename file name associated with fp (may be nullptr; then LAMMPS will try to detect) + * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) */ void sfread(const char *srcname, int srcline, void *s, size_t size,