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:
@ -56,7 +56,7 @@ void WriteCoeff::command(int narg, char **arg)
|
||||
char str[256], coeff[256];
|
||||
FILE *one = fopen(file,"wb+");
|
||||
|
||||
if (one == NULL)
|
||||
if (one == nullptr)
|
||||
error->one(FLERR,fmt::format("Cannot open coeff file {}: {}",
|
||||
file, utils::getsyserror()));
|
||||
|
||||
@ -90,7 +90,7 @@ void WriteCoeff::command(int narg, char **arg)
|
||||
rewind(one);
|
||||
|
||||
FILE *two = fopen(file+4,"w");
|
||||
if (two == NULL)
|
||||
if (two == nullptr)
|
||||
error->one(FLERR,fmt::format("Cannot open coeff file {}: {}",
|
||||
file+4, utils::getsyserror()));
|
||||
|
||||
@ -99,15 +99,15 @@ void WriteCoeff::command(int narg, char **arg)
|
||||
|
||||
while(1) {
|
||||
int coeff_mode = REGULAR_MODE;
|
||||
if (fgets(str,256,one) == NULL) break;
|
||||
if (fgets(str,256,one) == nullptr) break;
|
||||
|
||||
// some coeffs need special treatment
|
||||
if (strstr(str,"class2") != NULL) {
|
||||
if (strstr(str,"angle_style") != NULL)
|
||||
if (strstr(str,"class2") != nullptr) {
|
||||
if (strstr(str,"angle_style") != nullptr)
|
||||
coeff_mode = CLASS2_MODE;
|
||||
else if (strstr(str,"dihedral_style") != NULL)
|
||||
else if (strstr(str,"dihedral_style") != nullptr)
|
||||
coeff_mode = CLASS2_MODE;
|
||||
else if (strstr(str,"improper_style") != NULL)
|
||||
else if (strstr(str,"improper_style") != nullptr)
|
||||
coeff_mode = CLASS2_MODE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user