From 47a2d5e48f5f3dcfed57c5be01178952030828c2 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 7 Sep 2017 10:12:43 -0500 Subject: [PATCH] Adding variable initialization Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- c++/src/H5ArrayType.cpp | 2 +- c++/src/H5CompType.cpp | 2 +- c++/src/H5DataType.cpp | 2 +- c++/src/H5EnumType.cpp | 10 +++++----- c++/src/H5FloatType.cpp | 2 +- c++/src/H5IntType.cpp | 2 +- c++/src/H5StrType.cpp | 2 +- c++/src/H5VarLenType.cpp | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index c39ef3554b..15ac140c48 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -147,7 +147,7 @@ ArrayType& ArrayType::operator=(const ArrayType& rhs) //-------------------------------------------------------------------------- DataType* ArrayType::decode() const { - hid_t encoded_arrtype_id; + hid_t encoded_arrtype_id = H5I_INVALID_HID; try { encoded_arrtype_id = p_decode(); } diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index 95fddc100e..da7e3e225c 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -132,7 +132,7 @@ CompType::CompType(const H5Location& loc, const H5std_string& dtype_name) : Data //-------------------------------------------------------------------------- DataType* CompType::decode() const { - hid_t encoded_cmptype_id; + hid_t encoded_cmptype_id = H5I_INVALID_HID; try { encoded_cmptype_id = p_decode(); } diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 11b30ccc5c..28a670ebe5 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -285,7 +285,7 @@ hid_t DataType::p_decode() const //-------------------------------------------------------------------------- DataType* DataType::decode() const { - hid_t encoded_dtype_id; + hid_t encoded_dtype_id = H5I_INVALID_HID; try { encoded_dtype_id = p_decode(); } diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index f9046be010..02ae5a34cc 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -154,16 +154,16 @@ EnumType::EnumType(const H5Location& loc, const H5std_string& dtype_name) : Data //-------------------------------------------------------------------------- DataType* EnumType::decode() const { - hid_t encoded_cmptype_id; + hid_t encoded_enumtype_id = H5I_INVALID_HID; try { - encoded_cmptype_id = p_decode(); + encoded_enumtype_id = p_decode(); } catch (DataTypeIException &err) { throw; } - EnumType *encoded_cmptype = new EnumType; - encoded_cmptype->p_setId(encoded_cmptype_id); - return(encoded_cmptype); + EnumType *encoded_enumtype = new EnumType; + encoded_enumtype->p_setId(encoded_enumtype_id); + return(encoded_enumtype); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index 66a7466505..794c27dd3d 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -136,7 +136,7 @@ FloatType::FloatType(const H5Location& loc, const H5std_string& dtype_name) : At //-------------------------------------------------------------------------- DataType* FloatType::decode() const { - hid_t encoded_flttype_id; + hid_t encoded_flttype_id = H5I_INVALID_HID; try { encoded_flttype_id = p_decode(); } diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index 8408732120..ef4e1a9418 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -135,7 +135,7 @@ IntType::IntType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy //-------------------------------------------------------------------------- DataType* IntType::decode() const { - hid_t encoded_inttype_id; + hid_t encoded_inttype_id = H5I_INVALID_HID; try { encoded_inttype_id = p_decode(); } diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index cbb2103f7a..d2d87e9528 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -189,7 +189,7 @@ StrType::StrType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy //-------------------------------------------------------------------------- DataType* StrType::decode() const { - hid_t encoded_strtype_id; + hid_t encoded_strtype_id = H5I_INVALID_HID; try { encoded_strtype_id = p_decode(); } diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index fcea8cd72f..b5ca9c464a 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -117,7 +117,7 @@ VarLenType::VarLenType(const H5Location& loc, const H5std_string& dtype_name) : //-------------------------------------------------------------------------- DataType* VarLenType::decode() const { - hid_t encoded_vltype_id; + hid_t encoded_vltype_id = H5I_INVALID_HID; try { encoded_vltype_id = p_decode(); }