fix bugs found by or avoid warnings from coverity scan
This commit is contained in:
@ -59,6 +59,7 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
restart_peratom = 1;
|
||||
create_attribute = 1;
|
||||
wallstyle = -1;
|
||||
|
||||
// wall/particle coefficients
|
||||
|
||||
@ -96,7 +97,7 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) :
|
||||
lo = hi = 0.0;
|
||||
cylradius = utils::numeric(FLERR,arg[iarg+1],false,lmp);
|
||||
iarg += 2;
|
||||
}
|
||||
} else error->all(FLERR,fmt::format("Unknown wall style {}",arg[iarg]));
|
||||
|
||||
// check for trailing keyword/values
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
using namespace MathConst;
|
||||
|
||||
enum{XPLANE=0,YPLANE=1,ZPLANE}; // XYZ PLANE need to be 0,1,2
|
||||
enum{XPLANE=0,YPLANE=1,ZPLANE=2}; // XYZ PLANE need to be 0,1,2
|
||||
enum{HOOKE,HOOKE_HISTORY};
|
||||
|
||||
enum {INVALID=0,NONE=1,VERTEX=2};
|
||||
@ -59,6 +59,7 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg)
|
||||
|
||||
restart_peratom = 1;
|
||||
create_attribute = 1;
|
||||
wallstyle = -1;
|
||||
|
||||
// wall/particle coefficients
|
||||
|
||||
|
||||
@ -473,6 +473,7 @@ double PairColloid::single(int /*i*/, int /*j*/, int itype, int jtype, double rs
|
||||
double K[9],h[4],g[4];
|
||||
double r,r2inv,r6inv,forcelj,c1,c2,phi,fR,dUR,dUA;
|
||||
|
||||
phi = 0.0;
|
||||
switch (form[itype][jtype]) {
|
||||
case SMALL_SMALL:
|
||||
r2inv = 1.0/rsq;
|
||||
|
||||
@ -56,6 +56,7 @@ FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
comflag = 0;
|
||||
rotflag = 0;
|
||||
xflag = yflag = zflag = 0;
|
||||
|
||||
int iarg = 6;
|
||||
while (iarg < narg) {
|
||||
|
||||
@ -49,6 +49,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
|
||||
scaleflag = 1;
|
||||
spatflag=0;
|
||||
spatialid = nullptr;
|
||||
size = 0.0;
|
||||
xloflag = xhiflag = yloflag = yhiflag = zloflag = zhiflag = 0;
|
||||
|
||||
tempflag = 0;
|
||||
|
||||
@ -43,6 +43,7 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
|
||||
tempflag = 0;
|
||||
scaleflag = 1;
|
||||
roughflag = 0;
|
||||
roughdist = 0.0;
|
||||
rampflag = 0;
|
||||
rampNL1flag = 0;
|
||||
rampNL2flag = 0;
|
||||
|
||||
@ -386,7 +386,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
// apply scaling factors and cylinder dims orthogonal to axis
|
||||
|
||||
if (binflag) {
|
||||
double scale;
|
||||
double scale = 1.0;
|
||||
if (which == ArgInfo::BIN1D || which == ArgInfo::BIN2D
|
||||
|| which == ArgInfo::BIN3D || which == ArgInfo::BINCYLINDER) {
|
||||
if (which == ArgInfo::BIN1D || which == ArgInfo::BINCYLINDER) ndim = 1;
|
||||
|
||||
@ -50,7 +50,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
indexref = argi.get_index1();
|
||||
idref = argi.copy_name();
|
||||
|
||||
if ((whichref == ArgInfo::UNKNOWN) || (which[nvalues] == ArgInfo::NONE)
|
||||
if ((whichref == ArgInfo::UNKNOWN) || (whichref == ArgInfo::NONE)
|
||||
|| (argi.get_dim() > 1))
|
||||
error->all(FLERR,"Illegal compute global/atom command");
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ FixAveHistoWeight::FixAveHistoWeight(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
// check that length of 2 values is the same
|
||||
|
||||
int size[2];
|
||||
int size[2] = {0,0};
|
||||
|
||||
for (int i = 0; i < nvalues; i++) {
|
||||
if (which[i] == ArgInfo::X || which[i] == ArgInfo::V || which[i] == ArgInfo::F) {
|
||||
|
||||
@ -54,6 +54,7 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp)
|
||||
eflag_atom = vflag_atom = 0;
|
||||
|
||||
dt_default = 1;
|
||||
dt = 0.0;
|
||||
unit_style = nullptr;
|
||||
set_units("lj");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user