From 50a82bb345d367f16b482657e4969ab3ed4f89b7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 22 Aug 2016 15:49:33 -0400 Subject: [PATCH] address uninitialized variable issues pointed out by valgrind/coverity --- src/fix_controller.cpp | 2 +- src/variable.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fix_controller.cpp b/src/fix_controller.cpp index 28f2873910..d931686515 100644 --- a/src/fix_controller.cpp +++ b/src/fix_controller.cpp @@ -197,7 +197,7 @@ void FixController::end_of_step() // invoke compute if not previously invoked - double current; + double current = 0.0; if (pvwhich == COMPUTE) { if (pvindex == 0) { diff --git a/src/variable.cpp b/src/variable.cpp index f27de2777c..05c55ec7c6 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -898,7 +898,7 @@ double Variable::compute_equal(int ivar) error->all(FLERR,"Variable has circular dependency"); eval_in_progress[ivar] = 1; - double value; + double value = 0.0; if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],NULL); else if (style[ivar] == INTERNAL) value = dvalue[ivar]; else if (style[ivar] == PYTHON) {