From 14cc482ecd6d755e12b9511746275a8817e6f020 Mon Sep 17 00:00:00 2001
From: David Fairbrother <DavidFair@users.noreply.github.com>
Date: Wed, 25 Mar 2020 15:18:06 +0000
Subject: [PATCH] Fix cppcheck warnings introduced into master

---
 Framework/Nexus/src/NexusHDF5Descriptor.cpp | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/Framework/Nexus/src/NexusHDF5Descriptor.cpp b/Framework/Nexus/src/NexusHDF5Descriptor.cpp
index 39e0bbe6b12..266397764a7 100644
--- a/Framework/Nexus/src/NexusHDF5Descriptor.cpp
+++ b/Framework/Nexus/src/NexusHDF5Descriptor.cpp
@@ -28,15 +28,12 @@ namespace {
  */
 herr_t readStringAttribute(hid_t attr, char **data) {
   herr_t iRet = 0;
-  hid_t atype = -1;
-  hid_t space;
-  int ndims;
-  hsize_t thedims[H5S_MAX_RANK], sdim;
-
-  atype = H5Aget_type(attr);
-  sdim = H5Tget_size(atype);
-  space = H5Aget_space(attr);
-  ndims = H5Sget_simple_extent_dims(space, thedims, NULL);
+  hsize_t thedims[H5S_MAX_RANK];
+
+  hid_t atype = H5Aget_type(attr);
+  hsize_t sdim = H5Tget_size(atype);
+  hid_t space = H5Aget_space(attr);
+  int ndims = H5Sget_simple_extent_dims(space, thedims, NULL);
 
   if (ndims == 0) {
     if (H5Tis_variable_str(atype)) {
-- 
GitLab