From 16b2ed5cc9842a40a8ccd2df3046c42ae9814d7b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 15 May 2024 13:49:54 -0400 Subject: [PATCH] initialize pointers to null in constructor --- src/replicate.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/replicate.cpp b/src/replicate.cpp index e07c7d9a26..15c477faa6 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -26,29 +26,34 @@ #include "comm.h" #include "domain.h" #include "error.h" +#include "label_map.h" #include "memory.h" #include "special.h" -#include "label_map.h" #include using namespace LAMMPS_NS; static constexpr double LB_FACTOR = 1.1; -static constexpr double EPSILON = 1.0e-6; +static constexpr double EPSILON = 1.0e-6; /* ---------------------------------------------------------------------- */ -Replicate::Replicate(LAMMPS *lmp) : Command(lmp) {} +Replicate::Replicate(LAMMPS *lmp) : Command(lmp), old(nullptr), old_x(nullptr), old_tag(nullptr) +{ + bbox_flag = 0; + bond_flag = 0; +} /* ---------------------------------------------------------------------- */ void Replicate::command(int narg, char **arg) { - int i,j,m,n; + int i,n; if (domain->box_exist == 0) error->all(FLERR,"Replicate command before simulation box is defined"); + if (narg < 3 || narg > 4) error->all(FLERR,"Illegal replicate command"); int me = comm->me; @@ -78,9 +83,6 @@ void Replicate::command(int narg, char **arg) // optional keywords - bbox_flag = 0; - bond_flag = 0; - int iarg = 3; while (iarg < narg) { if (strcmp(arg[iarg],"bbox") == 0) {