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:
14
src/info.cpp
14
src/info.cpp
@ -259,10 +259,10 @@ void Info::command(int narg, char **arg)
|
||||
}
|
||||
}
|
||||
|
||||
if (out == NULL) return;
|
||||
if (out == nullptr) return;
|
||||
|
||||
fputs("\nInfo-Info-Info-Info-Info-Info-Info-Info-Info-Info-Info\n",out);
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
fmt::print(out,"Printed on {}\n",ctime(&now));
|
||||
|
||||
if (flags & CONFIG) {
|
||||
@ -792,7 +792,7 @@ void Info::command_styles(FILE *out)
|
||||
|
||||
bool Info::is_active(const char *category, const char *name)
|
||||
{
|
||||
if ((category == NULL) || (name == NULL)) return false;
|
||||
if ((category == nullptr) || (name == nullptr)) return false;
|
||||
const char *style = "none";
|
||||
|
||||
if (strcmp(category,"package") == 0) {
|
||||
@ -813,7 +813,7 @@ bool Info::is_active(const char *category, const char *name)
|
||||
else error->all(FLERR,"Unknown name for info newton category");
|
||||
|
||||
} else if (strcmp(category,"pair") == 0) {
|
||||
if (force->pair == NULL) return false;
|
||||
if (force->pair == nullptr) return false;
|
||||
if (strcmp(name,"single") == 0) return (force->pair->single_enable != 0);
|
||||
else if (strcmp(name,"respa") == 0) return (force->pair->respa_enable != 0);
|
||||
else if (strcmp(name,"manybody") == 0) return (force->pair->manybody_flag != 0);
|
||||
@ -867,7 +867,7 @@ bool Info::is_active(const char *category, const char *name)
|
||||
|
||||
bool Info::is_available(const char *category, const char *name)
|
||||
{
|
||||
if ((category == NULL) || (name == NULL)) return false;
|
||||
if ((category == nullptr) || (name == nullptr)) return false;
|
||||
|
||||
if (has_style(category, name)) {
|
||||
return true;
|
||||
@ -897,7 +897,7 @@ bool Info::is_available(const char *category, const char *name)
|
||||
|
||||
bool Info::is_defined(const char *category, const char *name)
|
||||
{
|
||||
if ((category == NULL) || (name == NULL)) return false;
|
||||
if ((category == nullptr) || (name == nullptr)) return false;
|
||||
|
||||
if (strcmp(category,"compute") == 0) {
|
||||
int ncompute = modify->ncompute;
|
||||
@ -1137,7 +1137,7 @@ bool Info::has_exceptions() {
|
||||
}
|
||||
|
||||
bool Info::has_package(const char * package_name) {
|
||||
for(int i = 0; LAMMPS::installed_packages[i] != NULL; ++i) {
|
||||
for(int i = 0; LAMMPS::installed_packages[i] != nullptr; ++i) {
|
||||
if(strcmp(package_name, LAMMPS::installed_packages[i]) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user