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:
@ -37,7 +37,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
python->init();
|
||||
|
||||
py_move = NULL;
|
||||
py_move = nullptr;
|
||||
|
||||
PyGILState_STATE gstate = PyGILState_Ensure();
|
||||
|
||||
@ -50,7 +50,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) :
|
||||
char * full_cls_name = arg[3];
|
||||
char * lastpos = strrchr(full_cls_name, '.');
|
||||
|
||||
if (lastpos == NULL) {
|
||||
if (lastpos == nullptr) {
|
||||
error->all(FLERR,"Fix python/integrate requires fully qualified class name");
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ void FixPythonMove::init()
|
||||
PyGILState_Release(gstate);
|
||||
error->all(FLERR,"Could not find 'init' method'");
|
||||
}
|
||||
PyObject * result = PyEval_CallObject(py_init, NULL);
|
||||
PyObject * result = PyEval_CallObject(py_init, nullptr);
|
||||
PyGILState_Release(gstate);
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@ void FixPythonMove::final_integrate()
|
||||
PyGILState_Release(gstate);
|
||||
error->all(FLERR,"Could not find 'final_integrate' method'");
|
||||
}
|
||||
PyObject * result = PyEval_CallObject(py_final_integrate, NULL);
|
||||
PyObject * result = PyEval_CallObject(py_final_integrate, nullptr);
|
||||
PyGILState_Release(gstate);
|
||||
}
|
||||
|
||||
@ -229,6 +229,6 @@ void FixPythonMove::reset_dt()
|
||||
PyGILState_Release(gstate);
|
||||
error->all(FLERR,"Could not find 'reset_dt' method'");
|
||||
}
|
||||
PyObject * result = PyEval_CallObject(py_reset_dt, NULL);
|
||||
PyObject * result = PyEval_CallObject(py_reset_dt, nullptr);
|
||||
PyGILState_Release(gstate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user