summaryrefslogtreecommitdiffstats
path: root/c++/src/H5PropList.cpp
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-06-01 13:49:39 (GMT)
committerGitHub <noreply@github.com>2021-06-01 13:49:39 (GMT)
commit50d0888f491821435f6884c0c4c516f69ff67927 (patch)
treecfb3c7737ad9850667771206bc6f457da4e489fb /c++/src/H5PropList.cpp
parent4ef33ef7cd0f2af55b34682b6949a101a68436bb (diff)
downloadhdf5-50d0888f491821435f6884c0c4c516f69ff67927.zip
hdf5-50d0888f491821435f6884c0c4c516f69ff67927.tar.gz
hdf5-50d0888f491821435f6884c0c4c516f69ff67927.tar.bz2
C++ warning and build fixes (#707)
* Committing clang-format changes * C++ build and warning updates * Fixes all warnings on C++ (with gcc 9.3) * Updates CMake and Autotools C++ builds * Undo warning clobber Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'c++/src/H5PropList.cpp')
-rw-r--r--c++/src/H5PropList.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index 8b45f79..46e4931 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -113,11 +113,8 @@ PropList::PropList(const PropList &original) : IdComponent(), id(original.id)
// property's id to H5P_DEFAULT.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PropList::PropList(const hid_t plist_id) : IdComponent()
+PropList::PropList(const hid_t plist_id) : IdComponent(), id{H5P_DEFAULT}
{
- if (plist_id <= 0)
- id = H5P_DEFAULT;
-
H5I_type_t id_type = H5Iget_type(plist_id);
switch (id_type) {
case H5I_GENPROP_CLS:
@@ -633,11 +630,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.