catch up on previous clang-tidy refactor for files that were skipped before

This commit is contained in:
Axel Kohlmeyer
2021-10-13 23:59:43 -04:00
parent 2fba6b44e4
commit 3ad75c40ec
3 changed files with 26 additions and 26 deletions

View File

@ -822,7 +822,7 @@ void FixQMMM::post_force(int vflag)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
/* local memory usage. approximately. */ /* local memory usage. approximately. */
double FixQMMM::memory_usage(void) double FixQMMM::memory_usage()
{ {
double bytes; double bytes;

View File

@ -66,28 +66,28 @@ static const char cite_fix_acks2_reax[] =
FixACKS2ReaxFF::FixACKS2ReaxFF(LAMMPS *lmp, int narg, char **arg) : FixACKS2ReaxFF::FixACKS2ReaxFF(LAMMPS *lmp, int narg, char **arg) :
FixQEqReaxFF(lmp, narg, arg) FixQEqReaxFF(lmp, narg, arg)
{ {
bcut = NULL; bcut = nullptr;
X_diag = NULL; X_diag = nullptr;
Xdia_inv = NULL; Xdia_inv = nullptr;
// BiCGStab // BiCGStab
g = NULL; g = nullptr;
q_hat = NULL; q_hat = nullptr;
r_hat = NULL; r_hat = nullptr;
y = NULL; y = nullptr;
z = NULL; z = nullptr;
// X matrix // X matrix
X.firstnbr = NULL; X.firstnbr = nullptr;
X.numnbrs = NULL; X.numnbrs = nullptr;
X.jlist = NULL; X.jlist = nullptr;
X.val = NULL; X.val = nullptr;
// Update comm sizes for this fix // Update comm sizes for this fix
comm_forward = comm_reverse = 2; comm_forward = comm_reverse = 2;
s_hist_X = s_hist_last = NULL; s_hist_X = s_hist_last = nullptr;
last_rows_rank = 0; last_rows_rank = 0;
last_rows_flag = (comm->me == last_rows_rank); last_rows_flag = (comm->me == last_rows_rank);
@ -149,8 +149,8 @@ void FixACKS2ReaxFF::pertype_parameters(char *arg)
bcut_acks2 = (double *) pair->extract("bcut_acks2",tmp); bcut_acks2 = (double *) pair->extract("bcut_acks2",tmp);
double* bond_softness_ptr = (double *) pair->extract("bond_softness",tmp); double* bond_softness_ptr = (double *) pair->extract("bond_softness",tmp);
if (chi == NULL || eta == NULL || gamma == NULL || if (chi == nullptr || eta == nullptr || gamma == nullptr ||
bcut_acks2 == NULL || bond_softness_ptr == NULL) bcut_acks2 == nullptr || bond_softness_ptr == nullptr)
error->all(FLERR, error->all(FLERR,
"Fix acks2/reaxff could not extract params from pair reaxff"); "Fix acks2/reaxff could not extract params from pair reaxff");
bond_softness = *bond_softness_ptr; bond_softness = *bond_softness_ptr;
@ -303,7 +303,7 @@ void FixACKS2ReaxFF::init_bondcut()
int ntypes; int ntypes;
ntypes = atom->ntypes; ntypes = atom->ntypes;
if (bcut == NULL) if (bcut == nullptr)
memory->create(bcut,ntypes+1,ntypes+1,"acks2:bondcut"); memory->create(bcut,ntypes+1,ntypes+1,"acks2:bondcut");
for (i = 1; i <= ntypes; ++i) for (i = 1; i <= ntypes; ++i)
@ -856,7 +856,7 @@ void FixACKS2ReaxFF::more_reverse_comm(double *vec)
if (last_rows_flag) if (last_rows_flag)
MPI_Reduce(MPI_IN_PLACE,&vec[2*NN],2,MPI_DOUBLE,MPI_SUM,last_rows_rank,world); MPI_Reduce(MPI_IN_PLACE,&vec[2*NN],2,MPI_DOUBLE,MPI_SUM,last_rows_rank,world);
else else
MPI_Reduce(&vec[2*NN],NULL,2,MPI_DOUBLE,MPI_SUM,last_rows_rank,world); MPI_Reduce(&vec[2*NN],nullptr,2,MPI_DOUBLE,MPI_SUM,last_rows_rank,world);
} }
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------

View File

@ -21,7 +21,7 @@
#endif #endif
#include <windows.h> #include <windows.h>
#else #else
#include <signal.h> #include <csignal>
#endif #endif
#if defined(_OPENMP) #if defined(_OPENMP)
@ -153,14 +153,14 @@ static int save_history(std::string range, std::string file)
std::size_t found = range.find_first_of("-"); std::size_t found = range.find_first_of("-");
if (found == std::string::npos) { // only a single number if (found == std::string::npos) { // only a single number
int num = strtol(range.c_str(), NULL, 10); int num = strtol(range.c_str(), nullptr, 10);
if ((num >= from) && (num <= to)) { if ((num >= from) && (num <= to)) {
from = to = num; from = to = num;
} else } else
return 1; return 1;
} else { // range of numbers } else { // range of numbers
if (found > 0) { // get number before '-' if (found > 0) { // get number before '-'
int num = strtol(range.substr(0, found).c_str(), NULL, 10); int num = strtol(range.substr(0, found).c_str(), nullptr, 10);
if ((num >= from) && (num <= to)) { if ((num >= from) && (num <= to)) {
from = num; from = num;
} else } else
@ -168,7 +168,7 @@ static int save_history(std::string range, std::string file)
} }
if (range.size() > found + 1) { // get number after '-' if (range.size() > found + 1) { // get number after '-'
int num = strtol(range.substr(found + 1).c_str(), NULL, 10); int num = strtol(range.substr(found + 1).c_str(), nullptr, 10);
if ((num >= from) && (num <= to)) { if ((num >= from) && (num <= to)) {
to = num; to = num;
} else } else
@ -340,13 +340,13 @@ static char *variable_expand_generator(const char *text, int state)
static char *plugin_generator(const char *text, int state) static char *plugin_generator(const char *text, int state)
{ {
const char *subcmd[] = {"load", "unload", "list", "clear", NULL}; const char *subcmd[] = {"load", "unload", "list", "clear", nullptr};
const char *sub; const char *sub;
static std::size_t idx=0, len; static std::size_t idx=0, len;
if (!state) idx = 0; if (!state) idx = 0;
len = strlen(text); len = strlen(text);
while ((sub = subcmd[idx]) != NULL) { while ((sub = subcmd[idx]) != nullptr) {
++idx; ++idx;
if (strncmp(text,sub,len) == 0) if (strncmp(text,sub,len) == 0)
return dupstring(sub); return dupstring(sub);
@ -356,12 +356,12 @@ static char *plugin_generator(const char *text, int state)
static char *plugin_style_generator(const char *text, int state) static char *plugin_style_generator(const char *text, int state)
{ {
const char *styles[] = {"pair", "fix", "command", NULL}; const char *styles[] = {"pair", "fix", "command", nullptr};
const char *s; const char *s;
static std::size_t idx=0, len; static std::size_t idx=0, len;
if (!state) idx = 0; if (!state) idx = 0;
len = strlen(text); len = strlen(text);
while ((s = styles[idx]) != NULL) { while ((s = styles[idx]) != nullptr) {
++idx; ++idx;
if (strncmp(text,s,len) == 0) if (strncmp(text,s,len) == 0)
return dupstring(s); return dupstring(s);