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:
@ -43,8 +43,8 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) {
|
||||
cut_global = 0.0;
|
||||
centroidstressflag = 1;
|
||||
|
||||
py_potential = NULL;
|
||||
skip_types = NULL;
|
||||
py_potential = nullptr;
|
||||
skip_types = nullptr;
|
||||
|
||||
python->init();
|
||||
|
||||
@ -54,7 +54,7 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) {
|
||||
|
||||
// if LAMMPS_POTENTIALS environment variable is set, add it to PYTHONPATH as well
|
||||
const char * potentials_path = getenv("LAMMPS_POTENTIALS");
|
||||
if (potentials_path != NULL) {
|
||||
if (potentials_path != nullptr) {
|
||||
PyList_Append(py_path, PY_STRING_FROM_STRING(potentials_path));
|
||||
}
|
||||
}
|
||||
@ -259,7 +259,7 @@ void PairPython::coeff(int narg, char **arg)
|
||||
char * full_cls_name = arg[2];
|
||||
char * lastpos = strrchr(full_cls_name, '.');
|
||||
|
||||
if (lastpos == NULL) {
|
||||
if (lastpos == nullptr) {
|
||||
error->all(FLERR,"Python pair style requires fully qualified class name");
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ void PairPython::coeff(int narg, char **arg)
|
||||
delete [] module_name;
|
||||
delete [] cls_name;
|
||||
|
||||
PyObject * py_pair_instance = PyObject_CallObject(py_pair_type, NULL);
|
||||
PyObject * py_pair_instance = PyObject_CallObject(py_pair_type, nullptr);
|
||||
if (!py_pair_instance) {
|
||||
PyErr_Print();
|
||||
PyErr_Clear();
|
||||
|
||||
Reference in New Issue
Block a user