diff options
author | Sean McBride <sean@rogue-research.com> | 2021-03-08 14:26:58 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 14:26:58 (GMT) |
commit | 5f376ccb3e8d242329a431b89bb4103500b1ad38 (patch) | |
tree | 72a8d27d98197a153e96822a9020a663f559a43a /c++/test | |
parent | 150fb83345bbf9ff6659231ba3f5bcdd536fb35c (diff) | |
download | hdf5-5f376ccb3e8d242329a431b89bb4103500b1ad38.zip hdf5-5f376ccb3e8d242329a431b89bb4103500b1ad38.tar.gz hdf5-5f376ccb3e8d242329a431b89bb4103500b1ad38.tar.bz2 |
Removed bad function pointer casts (#434)
* Removed bad function pointer casts
In one case fixed the actual function signature to be correct.
* Reformat source with clang v10.0.1.
Co-authored-by: Larry Knox <lrknox@hdfgroup.org>
Diffstat (limited to 'c++/test')
-rw-r--r-- | c++/test/dsets.cpp | 14 | ||||
-rw-r--r-- | c++/test/tfilter.cpp | 36 |
2 files changed, 25 insertions, 25 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 65949b6..03e4927 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -398,13 +398,13 @@ test_tconv(H5File &file) /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encode and decode enabled */ - "bogus", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)filter_bogus, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version number */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encode and decode enabled */ + "bogus", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 1ded033..2df88b2 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -49,20 +49,18 @@ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl, /* Temporary filter IDs used for testing */ const int H5Z_FILTER_BOGUS = 305; -#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead -static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); -#endif -static size_t filter_bogus(size_t nbytes); +static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf); + /* This message derives from H5Z */ const H5Z_class2_t H5Z_BOGUS[1] = {{ - H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_BOGUS, /* Filter id number */ - 1, 1, /* Encoding and decoding enabled */ - "bogus", /* Filter name for debugging */ - NULL, /* The "can apply" callback */ - NULL, /* The "set local" callback */ - (H5Z_func_t)filter_bogus, /* The actual filter function */ + H5Z_CLASS_T_VERS, /* H5Z_class_t version */ + H5Z_FILTER_BOGUS, /* Filter id number */ + 1, 1, /* Encoding and decoding enabled */ + "bogus", /* Filter name for debugging */ + NULL, /* The "can apply" callback */ + NULL, /* The "set local" callback */ + filter_bogus, /* The actual filter function */ }}; /*------------------------------------------------------------------------- @@ -79,13 +77,15 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ *------------------------------------------------------------------------- */ static size_t -#if 0 // H5_ATTR_UNUSED variables caused warning, so duplicated below with NULL instead -filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, - const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes, - size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) -#endif -filter_bogus(size_t nbytes) +filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, + size_t *buf_size, void **buf) { + (void)flags; + (void)cd_nelmts; + (void)cd_values; + (void)buf_size; + (void)buf; + return nbytes; } |