one more batch of clang-tidy fixes
This commit is contained in:
@ -346,8 +346,8 @@ void ComputeAcklandAtom::compute_peratom()
|
||||
2nd routine sorts auxiliary array at same time
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#define SWAP(a,b) tmp = a; a = b; b = tmp;
|
||||
#define ISWAP(a,b) itmp = a; a = b; b = itmp;
|
||||
#define SWAP(a,b) tmp = a; (a) = b; (b) = tmp;
|
||||
#define ISWAP(a,b) itmp = a; (a) = b; (b) = itmp;
|
||||
|
||||
void ComputeAcklandAtom::select(int k, int n, double *arr)
|
||||
{
|
||||
|
||||
@ -432,8 +432,8 @@ void ComputeBasalAtom::compute_peratom()
|
||||
2nd routine sorts auxiliary array at same time
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#define SWAP(a,b) tmp = a; a = b; b = tmp;
|
||||
#define ISWAP(a,b) itmp = a; a = b; b = itmp;
|
||||
#define SWAP(a,b) tmp = a; (a) = b; (b) = tmp;
|
||||
#define ISWAP(a,b) itmp = a; (a) = b; (b) = itmp;
|
||||
|
||||
void ComputeBasalAtom::select(int k, int n, double *arr)
|
||||
{
|
||||
|
||||
@ -267,8 +267,8 @@ inline void ComputeHexOrderAtom::calc_qn_trig(double delx, double dely, double &
|
||||
sort auxiliary array at same time
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#define SWAP(a,b) tmp = a; a = b; b = tmp;
|
||||
#define ISWAP(a,b) itmp = a; a = b; b = itmp;
|
||||
#define SWAP(a,b) tmp = a; (a) = b; (b) = tmp;
|
||||
#define ISWAP(a,b) itmp = a; (a) = b; (b) = itmp;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -381,7 +381,7 @@ static int *buf = nullptr;
|
||||
| with some routines to assist in this task (those are marked
|
||||
| static and cannot be called from user programs)
|
||||
*/
|
||||
#define MAXABS INT_MAX-2
|
||||
#define MAXABS (INT_MAX-2)
|
||||
|
||||
#ifndef SQR
|
||||
#define SQR(x) ((x)*(x))
|
||||
|
||||
@ -47,7 +47,7 @@ using namespace MathSpecial;
|
||||
#define THREEROOT3 5.19615242270663202362 // 3*sqrt(3)
|
||||
#define SIXROOT6 14.69693845669906728801 // 6*sqrt(6)
|
||||
#define INVROOT6 0.40824829046386307274 // 1/sqrt(6)
|
||||
#define FOURTHIRDS 4.0/3.0 // 4/3
|
||||
#define FOURTHIRDS (4.0/3.0) // 4/3
|
||||
#define THREEQUARTERS 0.75 // 3/4
|
||||
|
||||
#define EPSILON 1e-10
|
||||
|
||||
@ -76,7 +76,7 @@ void EwaldDipoleSpin::init()
|
||||
|
||||
if (!atom->sp) error->all(FLERR,"Kspace style requires atom attribute sp");
|
||||
|
||||
if ((spinflag && strcmp(update->unit_style,"metal")) != 0)
|
||||
if ((spinflag && strcmp(update->unit_style,"metal") != 0) != 0)
|
||||
error->all(FLERR,"'metal' units have to be used with spins");
|
||||
|
||||
if (slabflag == 0 && domain->nonperiodic > 0)
|
||||
|
||||
@ -186,7 +186,7 @@ FixIPI::FixIPI(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (atom->tag_consecutive() == 0)
|
||||
error->all(FLERR,"Fix ipi requires consecutive atom IDs");
|
||||
|
||||
if (strcmp(arg[1],"all"))
|
||||
if (strcmp(arg[1],"all") != 0)
|
||||
error->warning(FLERR,"Fix ipi always uses group all");
|
||||
|
||||
host = strdup(arg[3]);
|
||||
|
||||
@ -564,10 +564,10 @@ int MolfileInterface::timestep(float *coords, float *vels,
|
||||
// functions to read properties from molfile structure
|
||||
|
||||
#define PROPUPDATE(PROP,ENTRY,VAL) \
|
||||
if (propid == PROP) { VAL = a.ENTRY; }
|
||||
if (propid == (PROP)) { (VAL) = a.ENTRY; }
|
||||
|
||||
#define PROPSTRCPY(PROP,ENTRY,VAL) \
|
||||
if (propid == PROP) { strcpy(VAL,a.ENTRY); }
|
||||
if (propid == (PROP)) { strcpy(VAL,a.ENTRY); }
|
||||
|
||||
// single precision floating point props
|
||||
static float read_float_property(molfile_atom_t &a, const int propid)
|
||||
@ -645,10 +645,10 @@ static const char *read_string_property(molfile_atom_t &a,
|
||||
// functions to store properties into molfile structure
|
||||
|
||||
#define PROPUPDATE(PROP,ENTRY,VAL) \
|
||||
if ((propid & PROP) == PROP) { a.ENTRY = VAL; plist |= PROP; }
|
||||
if ((propid & (PROP)) == (PROP)) { a.ENTRY = VAL; plist |= (PROP); }
|
||||
|
||||
#define PROPSTRCPY(PROP,ENTRY,VAL) \
|
||||
if ((propid & PROP) == PROP) { strcpy(a.ENTRY,VAL); plist |= PROP; }
|
||||
if ((propid & (PROP)) == (PROP)) { strcpy(a.ENTRY,VAL); plist |= (PROP); }
|
||||
|
||||
// floating point props
|
||||
static int write_atom_property(molfile_atom_t &a,
|
||||
|
||||
@ -252,7 +252,7 @@ void DumpCFGMPIIO::init_style()
|
||||
if (multifile == 0 && !multifile_override)
|
||||
error->all(FLERR,"Dump cfg requires one snapshot per file");
|
||||
|
||||
DumpCustom::init_style();
|
||||
DumpCFG::init_style();
|
||||
|
||||
// setup function ptrs
|
||||
|
||||
|
||||
@ -323,12 +323,12 @@ void ComputeCentroAtom::compute_peratom()
|
||||
|
||||
#define SWAP(a, b) \
|
||||
tmp = a; \
|
||||
a = b; \
|
||||
b = tmp;
|
||||
(a) = b; \
|
||||
(b) = tmp;
|
||||
#define ISWAP(a, b) \
|
||||
itmp = a; \
|
||||
a = b; \
|
||||
b = itmp;
|
||||
(a) = b; \
|
||||
(b) = itmp;
|
||||
|
||||
void ComputeCentroAtom::select(int k, int n, double *arr)
|
||||
{
|
||||
|
||||
@ -46,7 +46,7 @@ enum { NODISCARD, MIXED, YESDISCARD };
|
||||
enum { ONCE, NFREQ, EVERY }; // used in several files
|
||||
enum { LIMITMAX, LIMITEXACT };
|
||||
|
||||
#define IDMAX 1024 * 1024
|
||||
#define IDMAX (1024 * 1024)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -334,28 +334,28 @@ double ComputeOrientOrderAtom::memory_usage()
|
||||
#define SWAP(a, b) \
|
||||
do { \
|
||||
tmp = a; \
|
||||
a = b; \
|
||||
b = tmp; \
|
||||
(a) = b; \
|
||||
(b) = tmp; \
|
||||
} while (0)
|
||||
|
||||
#define ISWAP(a, b) \
|
||||
do { \
|
||||
itmp = a; \
|
||||
a = b; \
|
||||
b = itmp; \
|
||||
(a) = b; \
|
||||
(b) = itmp; \
|
||||
} while (0)
|
||||
|
||||
#define SWAP3(a, b) \
|
||||
do { \
|
||||
tmp = a[0]; \
|
||||
a[0] = b[0]; \
|
||||
b[0] = tmp; \
|
||||
tmp = a[1]; \
|
||||
a[1] = b[1]; \
|
||||
b[1] = tmp; \
|
||||
tmp = a[2]; \
|
||||
a[2] = b[2]; \
|
||||
b[2] = tmp; \
|
||||
tmp = (a)[0]; \
|
||||
(a)[0] = (b)[0]; \
|
||||
(b)[0] = tmp; \
|
||||
tmp = (a)[1]; \
|
||||
(a)[1] = (b)[1]; \
|
||||
(b)[1] = tmp; \
|
||||
tmp = (a)[2]; \
|
||||
(a)[2] = (b)[2]; \
|
||||
(b)[2] = tmp; \
|
||||
} while (0)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -40,7 +40,7 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (openflag && (open_faces[3] || open_faces[4] || open_faces[5]))
|
||||
error->all(FLERR,"Invalid region cone open setting");
|
||||
|
||||
if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z"))
|
||||
if (strcmp(arg[2],"x") != 0 && strcmp(arg[2],"y") && strcmp(arg[2],"z") != 0)
|
||||
error->all(FLERR,"Illegal region cylinder command");
|
||||
axis = arg[2][0];
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (openflag && (open_faces[3] || open_faces[4] || open_faces[5]))
|
||||
error->all(FLERR,"Invalid region cylinder open setting");
|
||||
|
||||
if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z"))
|
||||
if (strcmp(arg[2],"x") != 0 && strcmp(arg[2],"y") && strcmp(arg[2],"z") != 0)
|
||||
error->all(FLERR,"Illegal region cylinder command");
|
||||
axis = arg[2][0];
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ using namespace MathConst;
|
||||
#define CHUNK 1024
|
||||
#define MAXFUNCARG 6
|
||||
|
||||
#define MYROUND(a) (( a-floor(a) ) >= .5) ? ceil(a) : floor(a)
|
||||
#define MYROUND(a) (( (a)-floor(a) ) >= .5) ? ceil(a) : floor(a)
|
||||
|
||||
enum{ARG,OP};
|
||||
|
||||
@ -3252,20 +3252,20 @@ int Variable::math_function(char *word, char *contents, Tree **tree, Tree **tree
|
||||
{
|
||||
// word not a match to any math function
|
||||
|
||||
if (strcmp(word,"sqrt") && strcmp(word,"exp") &&
|
||||
strcmp(word,"ln") && strcmp(word,"log") &&
|
||||
strcmp(word,"abs") &&
|
||||
strcmp(word,"sin") && strcmp(word,"cos") &&
|
||||
strcmp(word,"tan") && strcmp(word,"asin") &&
|
||||
strcmp(word,"acos") && strcmp(word,"atan") &&
|
||||
strcmp(word,"atan2") && strcmp(word,"random") &&
|
||||
strcmp(word,"normal") && strcmp(word,"ceil") &&
|
||||
strcmp(word,"floor") && strcmp(word,"round") &&
|
||||
strcmp(word,"ramp") && strcmp(word,"stagger") &&
|
||||
strcmp(word,"logfreq") && strcmp(word,"logfreq2") &&
|
||||
strcmp(word,"logfreq3") && strcmp(word,"stride") &&
|
||||
strcmp(word,"stride2") && strcmp(word,"vdisplace") &&
|
||||
strcmp(word,"swiggle") && strcmp(word,"cwiggle"))
|
||||
if (strcmp(word,"sqrt") != 0 && strcmp(word,"exp") &&
|
||||
strcmp(word,"ln") != 0 && strcmp(word,"log") != 0 &&
|
||||
strcmp(word,"abs") != 0 &&
|
||||
strcmp(word,"sin") != 0 && strcmp(word,"cos") != 0 &&
|
||||
strcmp(word,"tan") != 0 && strcmp(word,"asin") != 0 &&
|
||||
strcmp(word,"acos") != 0 && strcmp(word,"atan") != 0 &&
|
||||
strcmp(word,"atan2") != 0 && strcmp(word,"random") != 0 &&
|
||||
strcmp(word,"normal") != 0 && strcmp(word,"ceil") != 0 &&
|
||||
strcmp(word,"floor") != 0 && strcmp(word,"round") != 0 &&
|
||||
strcmp(word,"ramp") != 0 && strcmp(word,"stagger") != 0 &&
|
||||
strcmp(word,"logfreq") != 0 && strcmp(word,"logfreq2") != 0 &&
|
||||
strcmp(word,"logfreq3") != 0 && strcmp(word,"stride") != 0 &&
|
||||
strcmp(word,"stride2") != 0 && strcmp(word,"vdisplace") != 0 &&
|
||||
strcmp(word,"swiggle") != 0 && strcmp(word,"cwiggle") != 0)
|
||||
return 0;
|
||||
|
||||
// parse contents for comma-separated args
|
||||
@ -3676,13 +3676,13 @@ int Variable::group_function(char *word, char *contents, Tree **tree, Tree **tre
|
||||
{
|
||||
// word not a match to any group function
|
||||
|
||||
if (strcmp(word,"count") && strcmp(word,"mass") &&
|
||||
strcmp(word,"charge") && strcmp(word,"xcm") &&
|
||||
strcmp(word,"vcm") && strcmp(word,"fcm") &&
|
||||
strcmp(word,"bound") && strcmp(word,"gyration") &&
|
||||
strcmp(word,"ke") && strcmp(word,"angmom") &&
|
||||
strcmp(word,"torque") && strcmp(word,"inertia") &&
|
||||
strcmp(word,"omega"))
|
||||
if (strcmp(word,"count") != 0 && strcmp(word,"mass") &&
|
||||
strcmp(word,"charge") != 0 && strcmp(word,"xcm") != 0 &&
|
||||
strcmp(word,"vcm") != 0 && strcmp(word,"fcm") != 0 &&
|
||||
strcmp(word,"bound") != 0 && strcmp(word,"gyration") != 0 &&
|
||||
strcmp(word,"ke") != 0 && strcmp(word,"angmom") != 0 &&
|
||||
strcmp(word,"torque") != 0 && strcmp(word,"inertia") != 0 &&
|
||||
strcmp(word,"omega") != 0)
|
||||
return 0;
|
||||
|
||||
// parse contents for comma-separated args
|
||||
@ -3925,11 +3925,11 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree **t
|
||||
|
||||
// word not a match to any special function
|
||||
|
||||
if (strcmp(word,"sum") && strcmp(word,"min") && strcmp(word,"max") && strcmp(word,"ave") &&
|
||||
strcmp(word,"trap") && strcmp(word,"slope") && strcmp(word,"gmask") && strcmp(word,"rmask") &&
|
||||
strcmp(word,"grmask") && strcmp(word,"next") && strcmp(word,"is_active") &&
|
||||
strcmp(word,"is_defined") && strcmp(word,"is_available") && strcmp(word,"is_file") &&
|
||||
strcmp(word,"extract_setting"))
|
||||
if (strcmp(word,"sum") != 0 && strcmp(word,"min") && strcmp(word,"max") != 0 && strcmp(word,"ave") != 0 &&
|
||||
strcmp(word,"trap") != 0 && strcmp(word,"slope") != 0 && strcmp(word,"gmask") != 0 && strcmp(word,"rmask") != 0 &&
|
||||
strcmp(word,"grmask") != 0 && strcmp(word,"next") != 0 && strcmp(word,"is_active") != 0 &&
|
||||
strcmp(word,"is_defined") != 0 && strcmp(word,"is_available") != 0 && strcmp(word,"is_file") != 0 &&
|
||||
strcmp(word,"extract_setting") != 0)
|
||||
return 0;
|
||||
|
||||
// parse contents for comma-separated args
|
||||
|
||||
Reference in New Issue
Block a user