From b221b15d24ecd7b701ea5643d16d726964fc05bc Mon Sep 17 00:00:00 2001 From: Anders Hafreager Date: Mon, 7 Nov 2016 15:50:18 +0100 Subject: [PATCH] NULLing ptrs in comm_brick and dump*.cpp --- src/comm_brick.cpp | 5 ++++- src/dump_cfg.cpp | 2 +- src/dump_custom.cpp | 7 ++++++- src/dump_dcd.cpp | 3 ++- src/dump_image.cpp | 4 +++- src/dump_local.cpp | 5 ++++- src/dump_xyz.cpp | 3 ++- 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index c44b41928f..289b11782c 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -51,7 +51,10 @@ enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files /* ---------------------------------------------------------------------- */ -CommBrick::CommBrick(LAMMPS *lmp) : Comm(lmp) +CommBrick::CommBrick(LAMMPS *lmp) : Comm(lmp), + sendnum(NULL), recvnum(NULL), sendproc(NULL), recvproc(NULL), size_forward_recv(NULL), + size_reverse_send(NULL), size_reverse_recv(NULL), slablo(NULL), slabhi(NULL), multilo(NULL), multihi(NULL), + cutghostmulti(NULL), pbc_flag(NULL), pbc(NULL), firstrecv(NULL), sendlist(NULL), maxsendlist(NULL), buf_send(NULL), buf_recv(NULL) { style = 0; layout = LAYOUT_UNIFORM; diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index a9ecafb7c5..8c08bb9edb 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -42,7 +42,7 @@ enum{INT,DOUBLE,STRING,BIGINT}; // same as in DumpCustom /* ---------------------------------------------------------------------- */ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : - DumpCustom(lmp, narg, arg) + DumpCustom(lmp, narg, arg), auxname(NULL) { multifile_override = 0; diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 25757dc594..7dc7e12988 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -54,7 +54,12 @@ enum{INT,DOUBLE,STRING,BIGINT}; // same as in DumpCFG /* ---------------------------------------------------------------------- */ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : - Dump(lmp, narg, arg) + Dump(lmp, narg, arg), + idregion(NULL), thresh_array(NULL), thresh_op(NULL), thresh_value(NULL), thresh_last(NULL), + thresh_fix(NULL), thresh_fixID(NULL), thresh_first(NULL), earg(NULL), vtype(NULL), vformat(NULL), + columns(NULL), choose(NULL), dchoose(NULL), clist(NULL), field2index(NULL), argindex(NULL), + id_compute(NULL), compute(NULL), id_fix(NULL), fix(NULL), id_variable(NULL), variable(NULL), + vbuf(NULL), id_custom(NULL), flag_custom(NULL), typenames(NULL), pack_choice(NULL) { if (narg == 5) error->all(FLERR,"No dump custom arguments specified"); diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp index c99d2f6bf4..ca7246ab24 100644 --- a/src/dump_dcd.cpp +++ b/src/dump_dcd.cpp @@ -52,7 +52,8 @@ static inline void fwrite_int32(FILE* fd, uint32_t i) /* ---------------------------------------------------------------------- */ -DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) +DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), + coords(NULL) { if (narg != 5) error->all(FLERR,"Illegal dump dcd command"); if (binary || compressed || multifile || multiproc) diff --git a/src/dump_image.cpp b/src/dump_image.cpp index 6d971d016a..bb39f845b5 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -49,7 +49,9 @@ enum{NO,YES}; /* ---------------------------------------------------------------------- */ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : - DumpCustom(lmp, narg, arg) + DumpCustom(lmp, narg, arg), phistr(NULL), czstr(NULL), upzstr(NULL), perspstr(NULL), + bdiamtype(NULL), bcolortype(NULL), avec_line(NULL), avec_tri(NULL), avec_body(NULL), + fixptr(NULL), image(NULL), chooseghost(NULL), bufcopy(NULL) { if (binary || multiproc) error->all(FLERR,"Invalid dump image filename"); diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 7e1381b05f..4843352ea2 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -37,7 +37,10 @@ enum{INT,DOUBLE}; /* ---------------------------------------------------------------------- */ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : - Dump(lmp, narg, arg) + Dump(lmp, narg, arg), + label(NULL), vtype(NULL), vformat(NULL), columns(NULL), field2index(NULL), + argindex(NULL), id_compute(NULL), compute(NULL), id_fix(NULL), fix(NULL), + pack_choice(NULL) { if (narg == 5) error->all(FLERR,"No dump local arguments specified"); diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp index 08aebc4c11..7059e85590 100644 --- a/src/dump_xyz.cpp +++ b/src/dump_xyz.cpp @@ -26,7 +26,8 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) +DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), + typenames(NULL) { if (narg != 5) error->all(FLERR,"Illegal dump xyz command"); if (binary || multiproc) error->all(FLERR,"Invalid dump xyz filename");