diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-04-07 14:23:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 14:23:35 (GMT) |
commit | 13d852d89ede307314adbfaa036fe670dfa75554 (patch) | |
tree | f3e66489a150de1fd493365cf5cf535963679e5d /c++/src/H5PropList.cpp | |
parent | 541bc15452f71f3eae7471fdecbe7994a7f138e2 (diff) | |
download | hdf5-13d852d89ede307314adbfaa036fe670dfa75554.zip hdf5-13d852d89ede307314adbfaa036fe670dfa75554.tar.gz hdf5-13d852d89ede307314adbfaa036fe670dfa75554.tar.bz2 |
1.12: Brings C++ wrappers in line with develop, minus C++11 bits (#1604)
Diffstat (limited to 'c++/src/H5PropList.cpp')
-rw-r--r-- | c++/src/H5PropList.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 1300641..0ff1afb 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -11,11 +11,10 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include <cstring> #include <iostream> - #include <string> -#include "H5private.h" // for HDmemset #include "H5Include.h" #include "H5Exception.h" #include "H5IdComponent.h" @@ -71,8 +70,7 @@ PropList::getConstant() void PropList::deleteConstants() { - if (DEFAULT_ != 0) - delete DEFAULT_; + delete DEFAULT_; } //-------------------------------------------------------------------------- @@ -305,7 +303,7 @@ PropList::getId() const ///\exception H5::IdComponentException when the attempt to close the HDF5 /// object fails // Description: -// The underlaying reference counting in the C library ensures +// The underlying reference counting in the C library ensures // that the current valid id of this object is properly closed. // Then the object's id is reset to the new id. // Programmer Binh-Minh Ribler - 2000 @@ -461,8 +459,8 @@ PropList::getProperty(const char *name) const size_t size = getPropSize(name); // Allocate buffer then get the property - char *prop_strg_C = new char[size + 1]; // temporary C-string for C API - HDmemset(prop_strg_C, 0, size + 1); // clear buffer + char *prop_strg_C = new char[size + 1]; + memset(prop_strg_C, 0, size + 1); herr_t ret_value = H5Pget(id, name, prop_strg_C); // call C API @@ -634,11 +632,12 @@ PropList::setProperty(const char *name, void *value) const void PropList::setProperty(const char *name, const char *charptr) const { - herr_t ret_value = H5Pset(id, name, (const void *)charptr); + herr_t ret_value = H5Pset(id, name, static_cast<const void *>(charptr)); if (ret_value < 0) { throw PropListIException(inMemFunc("setProperty"), "H5Pset failed"); } } + //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. |