summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-02-25 18:15:02 (GMT)
committerGitHub <noreply@github.com>2021-02-25 18:15:02 (GMT)
commitc29e1b9fdfcba9ca276600b1bad4ec2cf17bb01e (patch)
tree59c16ade26ea62e2ffc89506e1a245b4f296b82e /c++
parentc17b4b93d680340af2b3f2c026f2c03c3baeb33a (diff)
downloadhdf5-c29e1b9fdfcba9ca276600b1bad4ec2cf17bb01e.zip
hdf5-c29e1b9fdfcba9ca276600b1bad4ec2cf17bb01e.tar.gz
hdf5-c29e1b9fdfcba9ca276600b1bad4ec2cf17bb01e.tar.bz2
Patches from vtk (#358)
* Drop the export attribute on forward declaration They don't mean anything on forward declarations anyways. * Fixed -Wunused-parameter warnings in some C++ files Allowed all the attribute #defines to work in C++ also. * Fixed -Wunused-variable warnings by removing dead code * Fixed all -Wshorten-64-to-32 warnings by adjusting casts There was no truncation in fact, since the unsigned result was upcast to size_t then implicitly downcast to uint32_t. * Fixed all -Wcomma warnings by spliting statements onto own lines * Fixed all -Wself-assign warnings with different unused param suppression * Fixed all -Wextra-semi warnings * Fixed all -Wswitch-enum warnings Just added new explicit cases with the existing default case. * Fixed all -Wmissing-prototypes warnings Just made functions static. Moved them into an extern "C" block. * Reformatted source with bin/format_source using clang version 10.0.1 Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Diffstat (limited to 'c++')
-rw-r--r--c++/src/H5Attribute.cpp2
-rw-r--r--c++/src/H5Location.cpp2
-rw-r--r--c++/src/H5Object.cpp14
-rw-r--r--c++/src/H5PredType.cpp3
-rw-r--r--c++/src/H5PropList.cpp3
-rw-r--r--c++/src/H5StrType.cpp3
6 files changed, 20 insertions, 7 deletions
diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp
index 08367c5..81e656f 100644
--- a/c++/src/H5Attribute.cpp
+++ b/c++/src/H5Attribute.cpp
@@ -41,7 +41,7 @@ namespace H5 {
using std::cerr;
using std::endl;
-class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate
+class H5Object; // forward declaration for UserData4Aiterate
//--------------------------------------------------------------------------
// Function: Attribute default constructor
diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp
index 832efea..2d14bfc 100644
--- a/c++/src/H5Location.cpp
+++ b/c++/src/H5Location.cpp
@@ -2153,6 +2153,7 @@ H5Location::childObjType(const char *objname) const
break;
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
+ case H5O_TYPE_MAP:
default:
throwException("childObjType", "Unknown type of object");
}
@@ -2231,6 +2232,7 @@ H5Location::childObjType(hsize_t index, H5_index_t index_type, H5_iter_order_t o
break;
case H5O_TYPE_UNKNOWN:
case H5O_TYPE_NTYPES:
+ case H5O_TYPE_MAP:
default:
throwException("childObjType", "Unknown type of object");
}
diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp
index 669bffc..725d1da 100644
--- a/c++/src/H5Object.cpp
+++ b/c++/src/H5Object.cpp
@@ -42,8 +42,11 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// userAttrOpWrpr interfaces between the user's function and the
// C library function H5Aiterate2
-extern "C" herr_t
-userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data)
+extern "C" {
+
+static herr_t
+userAttrOpWrpr(H5_ATTR_UNUSED hid_t loc_id, const char *attr_name, H5_ATTR_UNUSED const H5A_info_t *ainfo,
+ void *op_data)
{
H5std_string s_attr_name = H5std_string(attr_name);
UserData4Aiterate *myData = reinterpret_cast<UserData4Aiterate *>(op_data);
@@ -53,8 +56,9 @@ userAttrOpWrpr(hid_t loc_id, const char *attr_name, const H5A_info_t *ainfo, voi
// userVisitOpWrpr interfaces between the user's function and the
// C library function H5Ovisit3
-extern "C" herr_t
-userVisitOpWrpr(hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info, void *op_data)
+static herr_t
+userVisitOpWrpr(H5_ATTR_UNUSED hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info,
+ void *op_data)
{
H5std_string s_attr_name = H5std_string(attr_name);
UserData4Visit *myData = reinterpret_cast<UserData4Visit *>(op_data);
@@ -62,6 +66,8 @@ userVisitOpWrpr(hid_t obj_id, const char *attr_name, const H5O_info2_t *obj_info
return status;
}
+} // extern "C"
+
//--------------------------------------------------------------------------
// Function: H5Object default constructor (protected)
// Programmer Binh-Minh Ribler - 2000
diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp
index dd70353..b58569f 100644
--- a/c++/src/H5PredType.cpp
+++ b/c++/src/H5PredType.cpp
@@ -27,6 +27,7 @@
#include "H5DataType.h"
#include "H5AtomType.h"
#include "H5PredType.h"
+#include "H5private.h"
namespace H5 {
@@ -82,7 +83,7 @@ PredType::operator=(const PredType &rhs)
// These dummy functions do not inherit from DataType - they'll
// throw an DataTypeIException if invoked.
void
-PredType::commit(H5Location &loc, const char *name)
+PredType::commit(H5_ATTR_UNUSED H5Location &loc, H5_ATTR_UNUSED const char *name)
{
throw DataTypeIException("PredType::commit",
"Error: Attempted to commit a predefined datatype. Invalid operation!");
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index 3f9a28e..3780220 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -155,6 +155,9 @@ PropList::PropList(const hid_t plist_id) : IdComponent()
case H5I_ERROR_STACK:
case H5I_NTYPES:
case H5I_UNINIT:
+ case H5I_MAP:
+ case H5I_SPACE_SEL_ITER:
+ case H5I_EVENTSET:
default:
id = H5P_DEFAULT;
break;
diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp
index 7bbe3ab..473cab3 100644
--- a/c++/src/H5StrType.cpp
+++ b/c++/src/H5StrType.cpp
@@ -32,6 +32,7 @@
#include "H5StrType.h"
#include "H5DataSet.h"
#include "H5PredType.h"
+#include "H5private.h"
namespace H5 {
@@ -102,7 +103,7 @@ StrType::StrType(const PredType &pred_type, const size_t &size) : AtomType()
// This constructor replaced the previous one.
// Programmer Binh-Minh Ribler - Nov 28, 2005
//--------------------------------------------------------------------------
-StrType::StrType(const int dummy, const size_t &size) : AtomType()
+StrType::StrType(H5_ATTR_UNUSED const int dummy, const size_t &size) : AtomType()
{
// use DataType::copy to make a copy of the string predefined type
// then set its length