diff --git a/src/BODY/pair_body_rounded_polygon.cpp b/src/BODY/pair_body_rounded_polygon.cpp index 6a176f1083..9040817772 100644 --- a/src/BODY/pair_body_rounded_polygon.cpp +++ b/src/BODY/pair_body_rounded_polygon.cpp @@ -107,7 +107,7 @@ void PairBodyRoundedPolygon::compute(int eflag, int vflag) int nei,nej,iefirst,jefirst; double xtmp,ytmp,ztmp,delx,dely,delz,evdwl; double rsq,rsqinv,r,radi,radj,eradi,eradj,rradi,rradj,k_nij,k_naij; - double xi[3],xj[3],facc[3]; + double facc[3]; int *ilist,*jlist,*numneigh,**firstneigh; evdwl = 0.0; diff --git a/src/MISC/pair_nm_cut.cpp b/src/MISC/pair_nm_cut.cpp index ce077a7a04..4b1611b137 100644 --- a/src/MISC/pair_nm_cut.cpp +++ b/src/MISC/pair_nm_cut.cpp @@ -274,14 +274,6 @@ double PairNMCut::init_one(int i, int j) } MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world); - double rr1 = mm[i][j]*(nn[i][j]-1)*pow(r0[i][j],nn[i][j]); - double rr2 = nn[i][j]*(mm[i][j]-1)*pow(r0[i][j],mm[i][j]); - double p1 = 1-nn[i][j]; - double p2 = 1-mm[i][j]; - - double rrr1 = pow(r0[i][j],nn[i][j])*(1-nn[i][j]); - double rrr2 = pow(r0[i][j],mm[i][j])*(1-mm[i][j]); - double cut3 = cut[i][j]*cut[i][j]*cut[i][j]; ptail_ij = 2.*MY_PI/3.*all[0]*all[1]*e0nm[i][j]*nm[i][j]*cut3 * (pow(r0[i][j]/cut[i][j],nn[i][j])/(nn[i][j]-3) - pow(r0[i][j]/cut[i][j],mm[i][j])/(mm[i][j]-3)); diff --git a/src/MISC/pair_nm_cut_coul_cut.cpp b/src/MISC/pair_nm_cut_coul_cut.cpp index b807bc972b..999fab1d6e 100644 --- a/src/MISC/pair_nm_cut_coul_cut.cpp +++ b/src/MISC/pair_nm_cut_coul_cut.cpp @@ -324,14 +324,6 @@ double PairNMCutCoulCut::init_one(int i, int j) } MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world); - double rr1 = mm[i][j]*(nn[i][j]-1)*pow(r0[i][j],nn[i][j]); - double rr2 = nn[i][j]*(mm[i][j]-1)*pow(r0[i][j],mm[i][j]); - double p1 = 1-nn[i][j]; - double p2 = 1-mm[i][j]; - - double rrr1 = pow(r0[i][j],nn[i][j])*(1-nn[i][j]); - double rrr2 = pow(r0[i][j],mm[i][j])*(1-mm[i][j]); - double cut_lj3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j]; ptail_ij = 2.*MY_PI/3.*all[0]*all[1]*e0nm[i][j]*nm[i][j]*cut_lj3 * (pow(r0[i][j]/cut_lj[i][j],nn[i][j])/(nn[i][j]-3) - pow(r0[i][j]/cut_lj[i][j],mm[i][j])/(mm[i][j]-3)); diff --git a/src/MISC/pair_nm_cut_coul_long.cpp b/src/MISC/pair_nm_cut_coul_long.cpp index 325f3da003..fb82436dba 100644 --- a/src/MISC/pair_nm_cut_coul_long.cpp +++ b/src/MISC/pair_nm_cut_coul_long.cpp @@ -371,14 +371,6 @@ double PairNMCutCoulLong::init_one(int i, int j) } MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world); - double rr1 = mm[i][j]*(nn[i][j]-1)*pow(r0[i][j],nn[i][j]); - double rr2 = nn[i][j]*(mm[i][j]-1)*pow(r0[i][j],mm[i][j]); - double p1 = 1-nn[i][j]; - double p2 = 1-mm[i][j]; - - double rrr1 = pow(r0[i][j],nn[i][j])*(1-nn[i][j]); - double rrr2 = pow(r0[i][j],mm[i][j])*(1-mm[i][j]); - double cut_lj3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j]; ptail_ij = 2.*MY_PI/3.*all[0]*all[1]*e0nm[i][j]*nm[i][j]*cut_lj3 * (pow(r0[i][j]/cut_lj[i][j],nn[i][j])/(nn[i][j]-3) - pow(r0[i][j]/cut_lj[i][j],mm[i][j])/(mm[i][j]-3)); diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index a889a8d0db..ec2588e61b 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -943,7 +943,7 @@ double FixCMAP::dihedral_angle_atan2(double fx, double fy, double fz, { // calculate the dihedral angle - double angle, arg1, arg2; + double angle = 0.0, arg1, arg2; arg1 = absg*(fx*bx+fy*by+fz*bz); arg2 = ax*bx+ay*by+az*bz; diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index f345d52aab..a01878bffd 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -748,19 +748,9 @@ void FixPOEMS::initial_integrate(int vflag) /* ---------------------------------------------------------------------- */ -void FixPOEMS::post_force(int vflag) +void FixPOEMS::post_force(int /* vflag */) { if (earlyflag) compute_forces_and_torques(); - - /* - for (int ibody = 0; ibody < nbody; ibody++) { - if (ibody == 0) { - printf("PFF %d %g %g %g\n",ibody,fcm[ibody][0],fcm[ibody][1],fcm[ibody][2]); - printf("PFT %d %g %g %g\n",ibody, - torque[ibody][0],torque[ibody][1],torque[ibody][2]); - } - } - */ } /* ---------------------------------------------------------------------- @@ -850,7 +840,7 @@ void FixPOEMS::final_integrate() /* ---------------------------------------------------------------------- */ -void FixPOEMS::initial_integrate_respa(int vflag, int ilevel, int iloop) +void FixPOEMS::initial_integrate_respa(int vflag, int ilevel, int /* iloop */) { dtv = step_respa[ilevel]; dtf = 0.5 * step_respa[ilevel] * force->ftm2v; @@ -862,14 +852,14 @@ void FixPOEMS::initial_integrate_respa(int vflag, int ilevel, int iloop) /* ---------------------------------------------------------------------- */ -void FixPOEMS::post_force_respa(int vflag, int ilevel, int iloop) +void FixPOEMS::post_force_respa(int vflag, int ilevel, int /* iloop */) { if (ilevel == nlevels_respa-1) post_force(vflag); } /* ---------------------------------------------------------------------- */ -void FixPOEMS::final_integrate_respa(int ilevel, int iloop) +void FixPOEMS::final_integrate_respa(int ilevel, int /* iloop */) { dtf = 0.5 * step_respa[ilevel] * force->ftm2v; final_integrate(); @@ -949,7 +939,7 @@ int FixPOEMS::dof(int igroup) thus this routine does nothing for now ------------------------------------------------------------------------- */ -void FixPOEMS::deform(int flag) {} +void FixPOEMS::deform(int /* flag */) {} /* ---------------------------------------------------------------------- */ @@ -1607,7 +1597,7 @@ void FixPOEMS::grow_arrays(int nmax) copy values within local atom-based arrays ------------------------------------------------------------------------- */ -void FixPOEMS::copy_arrays(int i, int j, int delflag) +void FixPOEMS::copy_arrays(int i, int j, int /* delflag */) { natom2body[j] = natom2body[i]; for (int k = 0; k < natom2body[j]; k++) atom2body[j][k] = atom2body[i][k]; diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index dac88a8efa..4868cd75de 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -716,7 +716,7 @@ void FixHyperLocal::pre_reverse(int /* eflag */, int /* vflag */) if (update->ntimestep % histo_print == 0) { MPI_Allreduce(histo,allhisto,histo_count+2,MPI_LMP_BIGINT,MPI_SUM,world); - bigint total; + bigint total = 0; for (i = 0; i < histo_count+2; i++) total += allhisto[i]; if (me == 0) { diff --git a/src/REPLICA/fix_hyper_local.h b/src/REPLICA/fix_hyper_local.h index 9fe4d03fb9..967101837e 100644 --- a/src/REPLICA/fix_hyper_local.h +++ b/src/REPLICA/fix_hyper_local.h @@ -87,7 +87,7 @@ class FixHyperLocal : public FixHyper { int nevent; // # of events that trigger bond rebuild int nevent_atom; // # of atoms that experienced an event double cutbondsq,dcutsq; - double beta,t_hyper,invqfactorsq; + double beta,invqfactorsq; double mybias; double maxbondlen; // cummulative max length of any bond double maxdriftsq; // max distance any atom drifts from original pos @@ -147,7 +147,7 @@ class FixHyperLocal : public FixHyper { // histogramming of bond boost cooeficients - int histo_flag,histo_every,histo_count,histo_print,histo_steps; + int histo_every,histo_count,histo_print,histo_steps; double histo_delta,invhisto_delta,histo_lo; bigint *histo,*allhisto; }; diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index cc074bb97d..72a4c0d7de 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -323,7 +323,7 @@ void PairSpinExchange::compute_single_pair(int ii, double fmi[3]) double **x = atom->x; double **sp = atom->sp; double local_cut2; - double xi[3], rij[3]; + double xi[3]; double delx,dely,delz; double spj[3]; diff --git a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp index d31890ea52..569f911eb9 100644 --- a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp @@ -103,9 +103,9 @@ PairOxdna2Coaxstk::~PairOxdna2Coaxstk() void PairOxdna2Coaxstk::compute(int eflag, int vflag) { - double delf[3],delt[3],delta[3],deltb[3]; // force, torque increment; + double delf[3],delta[3],deltb[3]; // force, torque increment; double evdwl,fpair,finc,tpair,factor_lj; - double v1tmp[3],v2tmp[3],v3tmp[3]; + double v1tmp[3]; double delr_ss[3],delr_ss_norm[3],rsq_ss,r_ss,rinv_ss; double delr_st[3],delr_st_norm[3],rsq_st,r_st,rinv_st; double theta1,theta1p,t1dir[3],cost1; @@ -114,12 +114,6 @@ void PairOxdna2Coaxstk::compute(int eflag, int vflag) double theta6,theta6p,t6dir[3],cost6; double cosphi3; - double gamma,gammacub,rinv_ss_cub,fac; - double aybx,azbx,rax,ray,raz,rbx; - double dcdr,dcdrbx; - double dcdaxbx,dcdaybx,dcdazbx; - double dcdrax,dcdray,dcdraz; - // distances COM-backbone site, COM-stacking site double d_cs=-0.4, d_cst=+0.34; // vectors COM-backbone site, COM-stacking site in lab frame diff --git a/src/USER-MISC/compute_stress_mop.cpp b/src/USER-MISC/compute_stress_mop.cpp index e63dff507f..e496fd4dfa 100644 --- a/src/USER-MISC/compute_stress_mop.cpp +++ b/src/USER-MISC/compute_stress_mop.cpp @@ -210,7 +210,7 @@ void ComputeStressMop::init() /* ---------------------------------------------------------------------- */ -void ComputeStressMop::init_list(int id, NeighList *ptr) +void ComputeStressMop::init_list(int /* id */, NeighList *ptr) { list = ptr; } @@ -246,9 +246,9 @@ void ComputeStressMop::compute_vector() void ComputeStressMop::compute_pairs() { - int i,j,m,n,ii,jj,inum,jnum,itype,jtype; + int i,j,m,ii,jj,inum,jnum,itype,jtype; double delx,dely,delz; - double rsq,eng,fpair,factor_coul,factor_lj; + double rsq,fpair,factor_coul,factor_lj; int *ilist,*jlist,*numneigh,**firstneigh; double *mass = atom->mass; @@ -363,8 +363,7 @@ void ComputeStressMop::compute_pairs() // counts local particles transfers across the plane if (which[m] == KIN || which[m] == TOTAL){ - double vcm[3]; - double masstotal,sgn; + double sgn; for (int i = 0; i < nlocal; i++){ diff --git a/src/USER-MISC/compute_stress_mop_profile.cpp b/src/USER-MISC/compute_stress_mop_profile.cpp index 02ad3ea453..9189318381 100644 --- a/src/USER-MISC/compute_stress_mop_profile.cpp +++ b/src/USER-MISC/compute_stress_mop_profile.cpp @@ -211,7 +211,7 @@ void ComputeStressMopProfile::init() /* ---------------------------------------------------------------------- */ -void ComputeStressMopProfile::init_list(int id, NeighList *ptr) +void ComputeStressMopProfile::init_list(int /* id */, NeighList *ptr) { list = ptr; } @@ -253,11 +253,11 @@ void ComputeStressMopProfile::compute_array() void ComputeStressMopProfile::compute_pairs() { - int i,j,m,n,ii,jj,inum,jnum,itype,jtype,ibin; + int i,j,m,ii,jj,inum,jnum,itype,jtype,ibin; double delx,dely,delz; - double rsq,eng,fpair,factor_coul,factor_lj; + double rsq,fpair,factor_coul,factor_lj; int *ilist,*jlist,*numneigh,**firstneigh; - double pos,pos1,pos_temp; + double pos,pos1; double *mass = atom->mass; int *type = atom->type; @@ -385,8 +385,7 @@ void ComputeStressMopProfile::compute_pairs() if (which[m] == KIN || which[m] == TOTAL){ - double vcm[3]; - double masstotal,sgn; + double sgn; for (int i = 0; i < nlocal; i++){ @@ -449,8 +448,8 @@ void ComputeStressMopProfile::compute_pairs() void ComputeStressMopProfile::setup_bins() { - int i,j,k,m,n; - double lo,hi,coord1,coord2; + int i,n; + double lo = 0.0, hi = 0.0; double *boxlo,*boxhi,*prd; boxlo = domain->boxlo; diff --git a/src/USER-MISC/compute_stress_mop_profile.h b/src/USER-MISC/compute_stress_mop_profile.h index 648d86cc7f..0ab774f3db 100644 --- a/src/USER-MISC/compute_stress_mop_profile.h +++ b/src/USER-MISC/compute_stress_mop_profile.h @@ -50,7 +50,6 @@ namespace LAMMPS_NS { double **coord,**coordp; double **values_local,**values_global; - int ndim; double dt,nktv2p,ftm2v; double area; class NeighList *list; diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index e2fb0166a2..d2a57fd2d0 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -108,8 +108,6 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : } t_target=t_start; - const double kT = t_target * force->boltz / force->mvv2e; - // initialize Marsaglia RNG with processor-unique seed // NB: this means runs will not be the same with different numbers of processors @@ -298,7 +296,7 @@ void FixFFL::ffl_integrate() { } -void FixFFL::initial_integrate(int vflag) { +void FixFFL::initial_integrate(int /* vflag */) { double dtfm; // update v and x of atoms in group @@ -391,7 +389,7 @@ void FixFFL::final_integrate() { } /* ---------------------------------------------------------------------- */ -void FixFFL::initial_integrate_respa(int vflag, int ilevel, int iloop) { +void FixFFL::initial_integrate_respa(int vflag, int ilevel, int /* iloop */) { dtv = step_respa[ilevel]; dtf = 0.5 * step_respa[ilevel] * force->ftm2v; @@ -406,7 +404,7 @@ void FixFFL::initial_integrate_respa(int vflag, int ilevel, int iloop) { } } -void FixFFL::final_integrate_respa(int ilevel, int iloop) { +void FixFFL::final_integrate_respa(int ilevel, int /* iloop */) { dtv = step_respa[ilevel]; dtf = 0.5 * step_respa[ilevel] * force->ftm2v; diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 56ab2b3df9..717861e06f 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -592,14 +592,13 @@ void FixFilterCorotate::pre_neighbor() double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); - if (fabs(signum)!= 1) + if (abs(signum) != 1) error->all(FLERR,"Wrong orientation in cluster of size 4" "in fix filter/corotate!"); clist_q0[i][8] *= signum; clist_q0[i][11] *= signum; - } else if (N == 5) - { + } else if (N == 5) { oxy = atom->map(shake_atom[m][0]); atom1 = atom->map(shake_atom[m][1]); atom2 = atom->map(shake_atom[m][2]); @@ -666,14 +665,12 @@ void FixFilterCorotate::pre_neighbor() double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); - if (fabs(signum)!= 1) + if (abs(signum)!= 1) error->all(FLERR,"Wrong orientation in cluster of size 5" "in fix filter/corotate!"); clist_q0[i][8] *= signum; clist_q0[i][11] *= signum; - } - else - { + } else { error->all(FLERR,"Fix filter/corotate cluster with size > 5" "not yet configured..."); } diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index 8be54caada..a4587b1c14 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -80,7 +80,9 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) if (nthreads < 1) error->all(FLERR,"Illegal number of OpenMP threads requested"); +#if defined(_OPENMP) int reset_thr = 0; +#endif if (nthreads != comm->nthreads) { #if defined(_OPENMP) reset_thr = 1; diff --git a/src/USER-OMP/thr_omp.h b/src/USER-OMP/thr_omp.h index 0821f8cea0..87d921290e 100644 --- a/src/USER-OMP/thr_omp.h +++ b/src/USER-OMP/thr_omp.h @@ -185,6 +185,7 @@ static inline void loop_setup_thr(int &ifrom, int &ito, int &tid, tid = 0; ifrom = 0; ito = inum; + nthreads = 1; #endif } diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index ddad7eb62f..61b653b375 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -66,7 +66,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // chunk style and its args - int iarg; + int iarg = 0; binflag = 0; ncoord = 0; @@ -248,7 +248,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"bound") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal compute chunk/atom command"); - int idim; + int idim = 0; if (strcmp(arg[iarg+1],"x") == 0) idim = 0; else if (strcmp(arg[iarg+1],"y") == 0) idim = 1; else if (strcmp(arg[iarg+1],"z") == 0) idim = 2; diff --git a/src/compute_dihedral_local.h b/src/compute_dihedral_local.h index d5f6a64183..5c50a66e96 100644 --- a/src/compute_dihedral_local.h +++ b/src/compute_dihedral_local.h @@ -33,7 +33,7 @@ class ComputeDihedralLocal : public Compute { double memory_usage(); private: - int nvalues,nvar,ncount,setflag,tflag; + int nvalues,nvar,ncount,setflag; int pvar; int *bstyle,*vvar; diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 751c4746ba..e19b565554 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -54,7 +54,7 @@ void CreateBonds::command(int narg, char **arg) int style; - int iarg; + int iarg = 0; if (strcmp(arg[0],"many") == 0) { style = MANY; if (narg != 6) error->all(FLERR,"Illegal create_bonds command"); diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index 04088bec8c..7b29b1d3d5 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -118,7 +118,7 @@ void DisplaceAtoms::command(int narg, char **arg) if (style == RAMP) { - int d_dim; + int d_dim = 0; if (strcmp(arg[2],"x") == 0) d_dim = 0; else if (strcmp(arg[2],"y") == 0) d_dim = 1; else if (strcmp(arg[2],"z") == 0) d_dim = 2; @@ -136,7 +136,7 @@ void DisplaceAtoms::command(int narg, char **arg) d_hi = zscale*force->numeric(FLERR,arg[4]); } - int coord_dim; + int coord_dim = 0; if (strcmp(arg[5],"x") == 0) coord_dim = 0; else if (strcmp(arg[5],"y") == 0) coord_dim = 1; else if (strcmp(arg[5],"z") == 0) coord_dim = 2; diff --git a/src/dump_image.cpp b/src/dump_image.cpp index a488f65161..0d63d2e4cb 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -1290,7 +1290,7 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"amap") == 0) { if (narg < 6) error->all(FLERR,"Illegal dump_modify command"); if (strlen(arg[3]) != 2) error->all(FLERR,"Illegal dump_modify command"); - int factor; + int factor = 0; if (arg[3][0] == 's') factor = 1; else if (arg[3][0] == 'c') factor = 2; else if (arg[3][0] == 'd') factor = 3; diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index c960c310f6..909ead3e2a 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -802,7 +802,7 @@ void FixDeform::end_of_step() // tilt_target can be large positive or large negative value // add/subtract box lengths until tilt_target is closest to current value - int idenom; + int idenom = 0; if (i == 5) idenom = 0; else if (i == 4) idenom = 0; else if (i == 3) idenom = 1; diff --git a/src/fix_move.cpp b/src/fix_move.cpp index 2f9fb0ebaa..0a5f506ab2 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -68,7 +68,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : // parse args - int iarg; + int iarg = 0; if (strcmp(arg[3],"linear") == 0) { if (narg < 7) error->all(FLERR,"Illegal fix move command"); diff --git a/src/input.cpp b/src/input.cpp index f9dd1ec314..8af8da26be 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1138,7 +1138,7 @@ void Input::partition() { if (narg < 3) error->all(FLERR,"Illegal partition command"); - int yesflag; + int yesflag = 0; if (strcmp(arg[0],"yes") == 0) yesflag = 1; else if (strcmp(arg[0],"no") == 0) yesflag = 0; else error->all(FLERR,"Illegal partition command"); diff --git a/src/set.cpp b/src/set.cpp index 7eca4e9a9c..34b86ea328 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -890,7 +890,7 @@ void Set::set(int keyword) // enforce quat rotation vector in z dir for 2d systems else if (keyword == QUAT) { - double *quat; + double *quat = NULL; if (avec_ellipsoid && atom->ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat; else if (avec_tri && atom->tri[i] >= 0) diff --git a/src/variable.cpp b/src/variable.cpp index 1595456f33..af5f647b74 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -182,7 +182,7 @@ void Variable::set(int narg, char **arg) if (find(arg[0]) >= 0) return; if (nvar == maxvar) grow(); style[nvar] = LOOP; - int nfirst,nlast; + int nfirst = 0,nlast = 0; if (narg == 3 || (narg == 4 && strcmp(arg[3],"pad") == 0)) { nfirst = 1; nlast = force->inumeric(FLERR,arg[2]); @@ -3983,7 +3983,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, strcmp(word,"max") == 0 || strcmp(word,"ave") == 0 || strcmp(word,"trap") == 0 || strcmp(word,"slope") == 0) { - int method; + int method = 0; if (strcmp(word,"sum") == 0) method = SUM; else if (strcmp(word,"min") == 0) method = XMIN; else if (strcmp(word,"max") == 0) method = XMAX; diff --git a/src/velocity.cpp b/src/velocity.cpp index 3a0b95fb4d..6d6027cc3c 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -641,7 +641,7 @@ void Velocity::ramp(int /*narg*/, char **arg) // parse args - int v_dim; + int v_dim = 0; if (strcmp(arg[0],"vx") == 0) v_dim = 0; else if (strcmp(arg[0],"vy") == 0) v_dim = 1; else if (strcmp(arg[0],"vz") == 0) v_dim = 2; @@ -662,7 +662,7 @@ void Velocity::ramp(int /*narg*/, char **arg) v_hi = zscale*force->numeric(FLERR,arg[2]); } - int coord_dim; + int coord_dim = 0; if (strcmp(arg[3],"x") == 0) coord_dim = 0; else if (strcmp(arg[3],"y") == 0) coord_dim = 1; else if (strcmp(arg[3],"z") == 0) coord_dim = 2; diff --git a/src/write_dump.cpp b/src/write_dump.cpp index bb79c654b4..6c7375012e 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -45,7 +45,7 @@ void WriteDump::command(int narg, char **arg) // create the Dump instance // create dump command line with extra required args - Dump *dump; + Dump *dump = NULL; char **dumpargs = new char*[modindex+2]; dumpargs[0] = (char *) "WRITE_DUMP"; // dump id