diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2016-08-12 08:06:35 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2016-08-12 08:06:35 (GMT) |
commit | b8a08e043ec8c3a37ace521314063df6f14e894a (patch) | |
tree | e3e86741e2057df18f054bf0abe2008532242daa /c++/src/H5ArrayType.cpp | |
parent | 6dec81e7ac7edacf524a8f4dbb125d4fe40f3dc0 (diff) | |
download | hdf5-b8a08e043ec8c3a37ace521314063df6f14e894a.zip hdf5-b8a08e043ec8c3a37ace521314063df6f14e894a.tar.gz hdf5-b8a08e043ec8c3a37ace521314063df6f14e894a.tar.bz2 |
[svn-r30280] Purpose: Code improvement (HDFFR-9725)
Description:
- Added "const" to arguments that should be const
- Added "const" to const functions, i.e., function that don't change
the objects they operate on.
- Removed deprecated functions in previous releases due to missing const.
Merged from trunk: 30272 and 30279
Platforms tested:
Linux/32 2.6 (jam)
Linux/64 (platypus)
Darwin (osx1010test)
Diffstat (limited to 'c++/src/H5ArrayType.cpp')
-rw-r--r-- | c++/src/H5ArrayType.cpp | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index e11227a..02596a2 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -80,10 +80,9 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) ///\param rhs - IN: Reference to the existing array datatype ///\return Reference to ArrayType instance ///\exception H5::DataTypeIException -/// std::bad_alloc // Description // Closes the id on the lhs object first with setId, then copies -// each data member from the rhs object. +// each data member from the rhs object. (Issue HDFFV-9562) // Programmer Binh-Minh Ribler - Mar 2016 // Modification //-------------------------------------------------------------------------- @@ -120,24 +119,7 @@ int ArrayType::getArrayNDims() const int ndims = H5Tget_array_ndims(id); if (ndims < 0) { - throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_ndims failed"); - } - - return(ndims); -} -//---------------------------- Deprecated ---------------------------------- -// Function: ArrayType::getArrayNDims -// This non-const version of the above method is here for compatibility -// purposes and may be removed in the future. -// -BMR, Apr 2016 -//-------------------------------------------------------------------------- -int ArrayType::getArrayNDims() -{ - // Get the rank of the array type specified by id from the C API - int ndims = H5Tget_array_ndims(id); - if (ndims < 0) - { - throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_ndims failed"); + throw DataTypeIException("ArrayType::getArrayNDims", "H5Tget_array_ndims failed"); } return(ndims); @@ -159,23 +141,7 @@ int ArrayType::getArrayDims(hsize_t* dims) const // Get the dimensions int ndims = H5Tget_array_dims2(id, dims); if (ndims < 0) - throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_dims2 failed"); - - // Return the number of dimensions - return(ndims); -} -//---------------------------- Deprecated ---------------------------------- -// Function: ArrayType::getArrayDims -// This non-const version of the above method is here for compatibility -// purposes and may be removed in the future. -// -BMR, Apr 2016 -//-------------------------------------------------------------------------- -int ArrayType::getArrayDims(hsize_t* dims) -{ - // Get the dimensions - int ndims = H5Tget_array_dims2(id, dims); - if (ndims < 0) - throw DataTypeIException("ArrayType::setArrayInfo", "H5Tget_array_dims2 failed"); + throw DataTypeIException("ArrayType::getArrayDims", "H5Tget_array_dims2 failed"); // Return the number of dimensions return(ndims); |