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
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
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. */
double FixQMMM::memory_usage(void)
double FixQMMM::memory_usage()
{
double bytes;

View File

@ -66,28 +66,28 @@ static const char cite_fix_acks2_reax[] =
FixACKS2ReaxFF::FixACKS2ReaxFF(LAMMPS *lmp, int narg, char **arg) :
FixQEqReaxFF(lmp, narg, arg)
{
bcut = NULL;
bcut = nullptr;
X_diag = NULL;
Xdia_inv = NULL;
X_diag = nullptr;
Xdia_inv = nullptr;
// BiCGStab
g = NULL;
q_hat = NULL;
r_hat = NULL;
y = NULL;
z = NULL;
g = nullptr;
q_hat = nullptr;
r_hat = nullptr;
y = nullptr;
z = nullptr;
// X matrix
X.firstnbr = NULL;
X.numnbrs = NULL;
X.jlist = NULL;
X.val = NULL;
X.firstnbr = nullptr;
X.numnbrs = nullptr;
X.jlist = nullptr;
X.val = nullptr;
// Update comm sizes for this fix
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_flag = (comm->me == last_rows_rank);
@ -149,8 +149,8 @@ void FixACKS2ReaxFF::pertype_parameters(char *arg)
bcut_acks2 = (double *) pair->extract("bcut_acks2",tmp);
double* bond_softness_ptr = (double *) pair->extract("bond_softness",tmp);
if (chi == NULL || eta == NULL || gamma == NULL ||
bcut_acks2 == NULL || bond_softness_ptr == NULL)
if (chi == nullptr || eta == nullptr || gamma == nullptr ||
bcut_acks2 == nullptr || bond_softness_ptr == nullptr)
error->all(FLERR,
"Fix acks2/reaxff could not extract params from pair reaxff");
bond_softness = *bond_softness_ptr;
@ -303,7 +303,7 @@ void FixACKS2ReaxFF::init_bondcut()
int ntypes;
ntypes = atom->ntypes;
if (bcut == NULL)
if (bcut == nullptr)
memory->create(bcut,ntypes+1,ntypes+1,"acks2:bondcut");
for (i = 1; i <= ntypes; ++i)
@ -856,7 +856,7 @@ void FixACKS2ReaxFF::more_reverse_comm(double *vec)
if (last_rows_flag)
MPI_Reduce(MPI_IN_PLACE,&vec[2*NN],2,MPI_DOUBLE,MPI_SUM,last_rows_rank,world);
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
#include <windows.h>
#else
#include <signal.h>
#include <csignal>
#endif
#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("-");
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)) {
from = to = num;
} else
return 1;
} else { // range of numbers
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)) {
from = num;
} else
@ -168,7 +168,7 @@ static int save_history(std::string range, std::string file)
}
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)) {
to = num;
} else
@ -340,13 +340,13 @@ static char *variable_expand_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;
static std::size_t idx=0, len;
if (!state) idx = 0;
len = strlen(text);
while ((sub = subcmd[idx]) != NULL) {
while ((sub = subcmd[idx]) != nullptr) {
++idx;
if (strncmp(text,sub,len) == 0)
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)
{
const char *styles[] = {"pair", "fix", "command", NULL};
const char *styles[] = {"pair", "fix", "command", nullptr};
const char *s;
static std::size_t idx=0, len;
if (!state) idx = 0;
len = strlen(text);
while ((s = styles[idx]) != NULL) {
while ((s = styles[idx]) != nullptr) {
++idx;
if (strncmp(text,s,len) == 0)
return dupstring(s);