From 50ac3cd6ecc37bb2196bcebe8a202711e315759d Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Fri, 17 Mar 2017 11:03:18 -0500 Subject: Description: Miscellaneous clean-up: format and comments Platforms tested: Linux/64 (jelly) Darwin (osx1010test) --- c++/src/H5AbstractDs.h | 6 +- c++/src/H5ArrayType.h | 6 +- c++/src/H5AtomType.h | 6 +- c++/src/H5Attribute.cpp | 2 +- c++/src/H5Attribute.h | 5 +- c++/src/H5CommonFG.cpp | 2 +- c++/src/H5CommonFG.h | 6 +- c++/src/H5CompType.h | 6 +- c++/src/H5DataSet.h | 5 +- c++/src/H5DataSpace.h | 6 +- c++/src/H5DataType.cpp | 1 + c++/src/H5DataType.h | 6 +- c++/src/H5DcreatProp.h | 6 +- c++/src/H5DxferProp.h | 6 +- c++/src/H5EnumType.h | 6 +- c++/src/H5Exception.h | 4 +- c++/src/H5FaccProp.h | 5 +- c++/src/H5FcreatProp.cpp | 2 - c++/src/H5FcreatProp.h | 7 +-- c++/src/H5File.cpp | 143 ++++++++++++++++++++++++----------------------- c++/src/H5File.h | 6 +- c++/src/H5FloatType.h | 6 +- c++/src/H5Group.cpp | 25 +++++---- c++/src/H5Group.h | 5 +- c++/src/H5IdComponent.h | 2 +- c++/src/H5IntType.h | 6 +- c++/src/H5LaccProp.h | 5 +- c++/src/H5Library.h | 5 +- c++/src/H5Location.h | 4 +- c++/src/H5Object.h | 4 +- c++/src/H5OcreatProp.h | 5 +- c++/src/H5PredType.h | 5 +- c++/src/H5PropList.h | 5 +- c++/src/H5StrType.h | 6 +- c++/src/H5VarLenType.h | 6 +- c++/test/titerate.cpp | 6 +- c++/test/trefer.cpp | 24 ++++---- c++/test/tvlstr.cpp | 41 +++++++------- 38 files changed, 219 insertions(+), 183 deletions(-) diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index eaa9d14..f0859c8 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -91,6 +91,8 @@ class H5_DLLCPP AbstractDs { private: // This member function is implemented by DataSet and Attribute - pure virtual. virtual hid_t p_get_type() const = 0; -}; -} + +}; // end of AbstractDs +} // namespace H5 + #endif // __AbstractDs_H diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 15b6bb3..dd9db51 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -60,6 +60,8 @@ class H5_DLLCPP ArrayType : public DataType { // Default constructor ArrayType(); -}; -} + +}; // end of ArrayType +} // namespace H5 + #endif // __H5ArrayType_H diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index a1e0262..f4c70fd 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -78,6 +78,8 @@ class H5_DLLCPP AtomType : public DataType { // Constructor that takes an existing id AtomType(const hid_t existing_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of AtomType +} // namespace H5 + #endif // __H5AtomType_H diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index c506906..6701f6e 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -1,7 +1,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * * Copyright by the Board of Trustees of the University of Illinois. * - * All rights reserved. * +/* All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 0243cd9..6d6df2c 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -101,6 +101,7 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { // Friend function to set Attribute id. For library use only. friend void f_Attribute_setId(Attribute* attr, hid_t new_id); -}; -} +}; // end of Attribute +} // namespace H5 + #endif // __H5Attribute_H diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 5c01055..f3390aa 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -381,4 +381,4 @@ void f_DataSet_setId(DataSet* dset, hid_t new_id) #endif // DOXYGEN_SHOULD_SKIP_THIS -} +} // end namespace diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 588d49a..0c7b799 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -84,10 +84,8 @@ class H5_DLLCPP CommonFG { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; // end of CommonFG declaration +}; // end of CommonFG +} // namespace H5 -#ifndef H5_NO_NAMESPACE -} -#endif #endif // __CommonFG_H diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 222044d..042b59f 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -115,6 +115,8 @@ class H5_DLLCPP CompType : public DataType { // Contains common code that is used by the member functions // getMemberXxxType hid_t p_get_member_type(unsigned member_num) const; -}; -} + +}; // end of CompType +} // namespace H5 + #endif // __H5CompType_H diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 93f9782..f9e29ff 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -130,6 +130,7 @@ class H5_DLLCPP DataSet : public H5Object, public AbstractDs { // Friend function to set DataSet id. For library use only. friend void f_DataSet_setId(DataSet* dset, hid_t new_id); -}; -} +}; // end of DataSet +} // namespace H5 + #endif // __H5DataSet_H diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 969e146..281e865 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -149,6 +149,8 @@ class H5_DLLCPP DataSpace : public IdComponent { friend void f_DataSpace_setId(DataSpace *dspace, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DataSpace +} // namespace H5 + #endif // __H5DataSpace_H diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 1cfc259..c88d6eb 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -861,4 +861,5 @@ DataType::~DataType() cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; } } + } // end namespace diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 6501bb9..c2ea2a3 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -155,6 +155,8 @@ class H5_DLLCPP DataType : public H5Object { friend void f_DataType_setId(DataType* dtype, hid_t new_id); void p_commit(hid_t loc_id, const char* name); -}; -} + +}; // end of DataType +} // namespace H5 + #endif // __H5DataType_H diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 5371e03..f0475eb 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -146,6 +146,8 @@ class H5_DLLCPP DSetCreatPropList : public ObjCreatPropList { static DSetCreatPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DSetCreatPropList +} // namespace H5 + #endif // __H5DSCreatPropList_H diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index f1c363f..39d3ba8 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -127,6 +127,8 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { static DSetMemXferPropList* getConstant(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} + +}; // end of DSetMemXferPropList +} // namespace H5 + #endif // __H5DSetMemXferPropList_H diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index 2fbe2cd..cd93eb5 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -78,6 +78,8 @@ class H5_DLLCPP EnumType : public DataType { EnumType(const EnumType& original); virtual ~EnumType(); -}; -} + +}; // end of EnumType +} // namespace H5 + #endif // __H5EnumType_H diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index 1f85711..2e68cf0 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -174,8 +174,8 @@ class H5_DLLCPP IdComponentException : public Exception { IdComponentException(const H5std_string& func_name, const H5std_string& message = DEFAULT_MSG); IdComponentException(); virtual ~IdComponentException() throw(); -}; -} +}; // end of IdComponentException +} // namespace H5 #endif // __H5Exception_H diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 586dcf8..8e488e5 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -162,6 +162,7 @@ class H5_DLLCPP FileAccPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of FileAccPropList +} // namespace H5 + #endif // __H5FileAccPropList_H diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index ea69049..c490f26 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -294,7 +294,6 @@ unsigned FileCreatPropList::getIstorek() const return(ik); } -#ifndef H5_NO_DEPRECATED_SYMBOLS //-------------------------------------------------------------------------- // Function: FileCreatPropList::setFileSpace ///\brief Sets the strategy and the threshold value that the library @@ -365,7 +364,6 @@ hsize_t FileCreatPropList::getFileSpaceThreshold() const } return(threshold); } -#endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- // Function: FileCreatPropList destructor diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 1d999cb..7b594a3 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -65,7 +65,6 @@ class H5_DLLCPP FileCreatPropList : public PropList { // indexing chunked datasets. void setIstorek(unsigned ik) const; -#ifndef H5_NO_DEPRECATED_SYMBOLS // Sets the strategy and the threshold value that the library will // will employ in managing file space. void setFileSpace(H5F_file_space_type_t strategy, hsize_t threshold) const; @@ -76,7 +75,6 @@ class H5_DLLCPP FileCreatPropList : public PropList { // Returns the threshold value that the library uses in tracking free // space sections. hsize_t getFileSpaceThreshold() const; -#endif /* H5_NO_DEPRECATED_SYMBOLS */ ///\brief Returns this class name. virtual H5std_string fromClass() const { return("FileCreatPropList"); } @@ -104,6 +102,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of FileCreatPropList +} // namespace H5 + #endif // __H5FileCreatPropList_H diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index cdb5837..bea4612 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -45,7 +45,7 @@ namespace H5 { using std::endl; //-------------------------------------------------------------------------- -// Function H5File default constructor +// Function H5File default constructor ///\brief Default constructor: creates a stub H5File object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -64,30 +64,30 @@ H5File::H5File() : Group(), id(H5I_INVALID_HID) {} ///\par Description /// Valid values of \a flags include: /// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, -/// erasing all data previously stored in -/// the file. +/// erasing all data previously stored in +/// the file. /// \li \c H5F_ACC_EXCL - Fail if file already exists. -/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive +/// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive /// \li \c H5F_ACC_RDONLY - Open file as read-only, if it already -/// exists, and fail, otherwise +/// exists, and fail, otherwise /// \li \c H5F_ACC_RDWR - Open file for read/write, if it already -/// exists, and fail, otherwise +/// exists, and fail, otherwise ///\par /// For info on file creation in the case of an already-open file, /// please refer to the \b Special \b case section in the C layer /// Reference Manual at: /// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create -// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 +// Notes With a PGI compiler (~2012-2013,) the exception thrown by +// p_get_file could not be caught in the applications. Added try +// block here to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { try { - p_get_file(name, flags, create_plist, access_plist); + p_get_file(name, flags, create_plist, access_plist); } catch (FileIException& open_file) { - throw open_file; + throw open_file; } } @@ -102,17 +102,17 @@ H5File::H5File(const char* name, unsigned int flags, const FileCreatPropList& cr /// FileCreatPropList::DEFAULT ///\param access_plist - IN: File access property list. Default to /// FileAccPropList::DEFAULT -// Notes With a PGI compiler (~2012-2013), the exception thrown by p_get_file -// could not be caught in the applications. Added try block here -// to catch then re-throw it. -BMR 2013/03/21 +// Notes With a PGI compiler (~2012-2013,) the exception thrown by +// p_get_file could not be caught in the applications. Added try +// block here to catch then re-throw it. -BMR 2013/03/21 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File(const H5std_string& name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist) : Group(), id(H5I_INVALID_HID) { try { - p_get_file(name.c_str(), flags, create_plist, access_plist); + p_get_file(name.c_str(), flags, create_plist, access_plist); } catch (FileIException& open_file) { - throw open_file; + throw open_file; } } @@ -131,23 +131,23 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro // create the file. if (flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC)) { - hid_t create_plist_id = create_plist.getId(); - hid_t access_plist_id = access_plist.getId(); - id = H5Fcreate(name, flags, create_plist_id, access_plist_id); - if (id < 0) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fcreate failed"); - } + hid_t create_plist_id = create_plist.getId(); + hid_t access_plist_id = access_plist.getId(); + id = H5Fcreate(name, flags, create_plist_id, access_plist_id); + if (id < 0) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fcreate failed"); + } } // Open the file if none of the bits above are set. else { - hid_t access_plist_id = access_plist.getId(); - id = H5Fopen(name, flags, access_plist_id); - if (id < 0) // throw an exception when open/create fail - { - throw FileIException("H5File constructor", "H5Fopen failed"); - } + hid_t access_plist_id = access_plist.getId(); + id = H5Fopen(name, flags, access_plist_id); + if (id < 0) // throw an exception when open/create fail + { + throw FileIException("H5File constructor", "H5Fopen failed"); + } } } @@ -157,7 +157,7 @@ void H5File::p_get_file(const char* name, unsigned int flags, const FileCreatPro ///\param existing_id - IN: Id of an existing file // Programmer Binh-Minh Ribler - 2015 // Description -// Mar 29, 2015 +// Mar 29, 2015 // Added in responding to a request from user Jason Newton. // However, it is not recommended to use the private member "id" // in applications. Unlike other situations, where similar @@ -230,9 +230,9 @@ bool H5File::isHdf5(const H5std_string& name) ///\par Description /// Valid values of \a flags include: /// H5F_ACC_RDWR: Open with read/write access. If the file is -/// currently open for read-only access then it -/// will be reopened. Absence of this flag -/// implies read-only access. +/// currently open for read-only access then it +/// will be reopened. Absence of this flag +/// implies read-only access. /// /// H5F_ACC_RDONLY: Open with read only access. - default /// @@ -251,7 +251,7 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis id = H5Fopen (name, flags, access_plist_id); if (id < 0) // throw an exception when open fails { - throw FileIException("H5File::openFile", "H5Fopen failed"); + throw FileIException("H5File::openFile", "H5Fopen failed"); } } @@ -397,14 +397,14 @@ hssize_t H5File::getFreeSpace() const ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only /// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // Programmer Binh-Minh Ribler - May 2004 @@ -425,19 +425,19 @@ ssize_t H5File::getObjCount(unsigned types) const /// groups and datatypes) in the same file. ///\param types - Type of object to retrieve the count ///\param max_objs - Maximum number of object identifiers to place -/// into obj_id_list. +/// into obj_id_list. ///\param oid_list - List of open object identifiers ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only /// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // @@ -459,7 +459,7 @@ void H5File::getObjIDs(unsigned types, size_t max_objs, hid_t *oid_list) const /// driver. ///\param fapl - File access property list ///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver +/// the low-level virtual file driver ///\exception H5::FileIException ///\par Description /// For the \c FAMILY or \c MULTI drivers, \a fapl should be @@ -487,10 +487,10 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const // Purpose This is an overloaded member function, kept for backward // compatibility. It differs from the above function in that it // misses const's. This wrapper will be removed in future release. -// Param fapl - File access property list -// Param file_handle - Pointer to the file handle being used by -// the low-level virtual file driver -// Exception H5::FileIException +// Param fapl - File access property list +// Param file_handle - Pointer to the file handle being used by +// the low-level virtual file driver +// Exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 // Modification // Planned for removal. -BMR, 2014/04/16 @@ -508,7 +508,7 @@ void H5File::getVFDHandle(const FileAccPropList& fapl, void **file_handle) const /// It differs from the above function only in what arguments it /// accepts. ///\param file_handle - Pointer to the file handle being used by -/// the low-level virtual file driver +/// the low-level virtual file driver ///\exception H5::FileIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- @@ -547,7 +547,7 @@ hsize_t H5File::getFileSize() const ///\brief Get the id of this file ///\return File identifier // Modification -// May 2008 - BMR +// May 2008 - BMR // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDS and Attribute are moved out of H5Object. In // addition, member IdComponent::id is moved into subclasses, and @@ -562,8 +562,8 @@ hid_t H5File::getId() const #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5File::reopen -// Purpose Reopens this file. -// Exception H5::FileIException +// Purpose Reopens this file. +// Exception H5::FileIException // Description // This function is replaced by the above function reOpen. // Programmer Binh-Minh Ribler - 2000 @@ -575,14 +575,15 @@ void H5File::reopen() //-------------------------------------------------------------------------- // Function: H5File::getLocId -// Purpose Get the id of this file +// Purpose Get the id of this file // Description // This function is a redefinition of CommonFG::getLocId. It // is used by CommonFG member functions to get the file id. // Programmer Binh-Minh Ribler - 2000 // Deprecated: -// After HDFFV-9920, the Group's methods can use getId() and getLocId() -// is kept for backward compatibility. Aug 18, 2016 -BMR +// Aug 18, 2016 -BMR +// After HDFFV-9920, the Group's methods can use getId() and +// getLocId() is kept for backward compatibility. //-------------------------------------------------------------------------- hid_t H5File::getLocId() const { @@ -626,13 +627,13 @@ void H5File::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Fclose(id); - if (ret_value < 0) - { - throw FileIException("H5File::close", "H5Fclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Fclose(id); + if (ret_value < 0) + { + throw FileIException("H5File::close", "H5Fclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } @@ -643,7 +644,7 @@ void H5File::close() ///\param msg - Message describing the failure ///\exception H5::FileIException // Description -// This function is also used in H5Location implementation so that +// This function is also used in H5Location implementation so that // proper exception can be thrown for file or group. The // "H5File::" will be inserted to indicate the function called is // an implementation of H5File. @@ -669,9 +670,9 @@ void H5File::throwException(const H5std_string& func_name, const H5std_string& m H5File::~H5File() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; + cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 5ac9118..df5cca6 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -17,7 +17,6 @@ #ifndef __H5File_H #define __H5File_H - namespace H5 { /*! \class H5File @@ -123,7 +122,8 @@ class H5_DLLCPP H5File : public Group { // constructors taking a string or a char* void p_get_file(const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist); -}; -} +}; // end of H5File +} // namespace H5 + #endif // __H5File_H diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index 2c925de..8affa1a 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -75,6 +75,8 @@ class H5_DLLCPP FloatType : public AtomType { // Noop destructor. virtual ~FloatType(); -}; -} + +}; // end of FloatType +} // namespace H5 + #endif // __H5FloatType_H diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 6e5cdaa..bb9e05d 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -113,14 +113,15 @@ void Group::closeObjId(hid_t obj_id) const //-------------------------------------------------------------------------- // Function: Group::getLocId -// Purpose: Get the id of this group +// Purpose: Get the id of this group // Programmer Binh-Minh Ribler - 2000 // Description // This function is a redefinition of CommonFG::getLocId. It // is used by CommonFG member functions to get the file id. // Deprecated: -// After HDFFV-9920, the Group's methods can use getId() and getLocId() -// is kept for backward compatibility. Aug 18, 2016 -BMR +// Aug 18, 2016 -BMR +// After HDFFV-9920, the Group's methods can use getId() and +// getLocId() is kept for backward compatibility. //-------------------------------------------------------------------------- hid_t Group::getLocId() const { @@ -227,13 +228,13 @@ void Group::close() { if (p_valid_id(id)) { - herr_t ret_value = H5Gclose(id); - if (ret_value < 0) - { - throwException("Group::close", "H5Gclose failed"); - } - // reset the id - id = H5I_INVALID_HID; + herr_t ret_value = H5Gclose(id); + if (ret_value < 0) + { + throwException("Group::close", "H5Gclose failed"); + } + // reset the id + id = H5I_INVALID_HID; } } @@ -270,10 +271,10 @@ void Group::throwException(const H5std_string& func_name, const H5std_string& ms Group::~Group() { try { - close(); + close(); } catch (Exception& close_error) { - cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; + cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; } } diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index 3118aa7..0f44eb9 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -84,7 +84,8 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { private: hid_t id; // HDF5 group id -}; -} +}; // end of Group +} // namespace H5 + #endif // __Group_H diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h index b449d4a..0603e5c 100644 --- a/c++/src/H5IdComponent.h +++ b/c++/src/H5IdComponent.h @@ -123,6 +123,6 @@ class H5_DLLCPP IdComponent { #endif // DOXYGEN_SHOULD_SKIP_THIS }; // end class IdComponent +} // namespace H5 -} #endif // __IdComponent_H diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index ae4b3df..1ce05c8 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -57,6 +57,8 @@ class H5_DLLCPP IntType : public AtomType { // Noop destructor. virtual ~IntType(); -}; -} + +}; // end of IntType +} // namespace H5 + #endif // __H5IntType_H diff --git a/c++/src/H5LaccProp.h b/c++/src/H5LaccProp.h index 1cb80f7..f31c3fc 100644 --- a/c++/src/H5LaccProp.h +++ b/c++/src/H5LaccProp.h @@ -69,6 +69,7 @@ class H5_DLLCPP LinkAccPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of LinkAccPropList +} // namespace H5 + #endif // __H5LinkAccPropList_H diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 018ba38..76b5f82 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -69,6 +69,7 @@ class H5_DLLCPP H5Library { ~H5Library(); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of H5Library +} // namespace H5 + #endif // __H5Library_H diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 337a2b3..3a0d8ca 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -220,7 +220,7 @@ class H5_DLLCPP H5Location : public IdComponent { // Noop destructor. virtual ~H5Location(); -}; /* end class H5Location */ +}; // end of H5Location +} // namespace H5 -} #endif // __H5Location_H diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 866d739..53f183e 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -131,7 +131,7 @@ class H5_DLLCPP H5Object : public H5Location { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; /* end class H5Object */ +}; // end of H5Object +} // namespace H5 -} #endif // __H5Object_H diff --git a/c++/src/H5OcreatProp.h b/c++/src/H5OcreatProp.h index 4858e07..c9c245a 100644 --- a/c++/src/H5OcreatProp.h +++ b/c++/src/H5OcreatProp.h @@ -72,6 +72,7 @@ class H5_DLLCPP ObjCreatPropList : public PropList { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of ObjCreatPropList +} // namespace H5 + #endif // __H5ObjCreatPropList_H diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index a8d6e37..2fd8a6b 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -438,6 +438,7 @@ class H5_DLLCPP PredType : public AtomType { #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of PredType +} // namespace H5 + #endif // __H5PredType_H diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 3977774..0ceaabd 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -135,7 +135,8 @@ class H5_DLLCPP PropList : public IdComponent { friend void f_PropList_setId(PropList* plist, hid_t new_id); #endif // DOXYGEN_SHOULD_SKIP_THIS -}; -} +}; // end of PropList +} // namespace H5 + #endif // __H5PropList_H diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 3272ad3..aa87bba 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -69,6 +69,8 @@ class H5_DLLCPP StrType : public AtomType { // Noop destructor. virtual ~StrType(); -}; -} + +}; // end of StrType +} // namespace H5 + #endif // __H5StrType_H diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h index a93f44d..4dc0eb5 100644 --- a/c++/src/H5VarLenType.h +++ b/c++/src/H5VarLenType.h @@ -49,6 +49,8 @@ class H5_DLLCPP VarLenType : public DataType { // Default constructor VarLenType(); -}; -} + +}; // end of VarLenType +} // namespace H5 + #endif // __H5VarLenType_H diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index fce42fa..34e6892 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -503,9 +503,9 @@ void test_iterate() FileAccPropList fapl; fapl.setLibverBounds(H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - test_iter_group(fapl); // Test iterating groups - test_HDFFV_9920(); // Test the fix of HDFFV-9920 - //test_iter_attr(fapl); // Test iterating attributes + test_iter_group(fapl); // Test iterating groups + test_HDFFV_9920(); // Test the fix of HDFFV-9920 + //test_iter_attr(fapl); // Test iterating attributes } // test_iterate diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index d8a0d5f..c232809 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -16,7 +16,7 @@ /***************************************************************************** FILE trefer.cpp - HDF5 C++ testing the functionalities associated with the C - Reference interface (H5R) + Reference interface (H5R) ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -93,7 +93,7 @@ test_reference_params(void) file1 = new H5File (FILE1, H5F_ACC_TRUNC); // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); // Create a group @@ -172,7 +172,7 @@ test_reference_params(void) catch (Exception& E) { issue_fail_msg("test_reference_param()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -209,7 +209,7 @@ static void test_reference_obj(void) file1 = new H5File (FILE1, H5F_ACC_TRUNC); // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); // Create dataset access property list @@ -364,7 +364,7 @@ static void test_reference_obj(void) catch (Exception& E) { issue_fail_msg("test_reference_obj()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -493,7 +493,7 @@ test_reference_group(void) catch (Exception& E) { issue_fail_msg("test_reference_group()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -523,10 +523,10 @@ test_reference_region_1D(void) SUBTEST("1-D Dataset Region Reference Functions"); try { - hdset_reg_ref_t *wbuf, // buffer to write to disk + hdset_reg_ref_t *wbuf, // buffer to write to disk *rbuf; // buffer read from disk - uint8_t *dwbuf, // Buffer for writing numeric data to disk - *drbuf; // Buffer for reading numeric data from disk + uint8_t *dwbuf, // Buffer for writing numeric data to disk + *drbuf; // Buffer for reading numeric data from disk // Allocate write & read buffers wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); @@ -538,7 +538,7 @@ test_reference_region_1D(void) H5File file1(FILE2, H5F_ACC_TRUNC); // Create dataspace for datasets - hsize_t dims3[] = {SPACE3_DIM1}; + hsize_t dims3[] = {SPACE3_DIM1}; DataSpace sid3(SPACE3_RANK, dims3); // Create dataset access property list @@ -558,7 +558,7 @@ test_reference_region_1D(void) dset3.close(); // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); // Create a dataset @@ -785,7 +785,7 @@ test_reference_region_1D(void) catch (Exception& E) { issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } } /* test_reference_region_1D() */ diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 5dee1a2..859867b 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -57,7 +57,7 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) { void *ret_value=NULL; // Pointer to return size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -91,7 +91,7 @@ static void test_vlstr_free_custom(void *_mem, void *info) { unsigned char *mem; size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -257,7 +257,7 @@ static void test_vlstring_array_dataset() for (ii = 0; ii < SPACE1_DIM1; ii++) { if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0) - TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); + TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); HDfree(string_ds_check[ii]); } @@ -351,23 +351,26 @@ static void test_vlstrings_special() hsize_t ii; // counting variable for (ii=0; ii