From 0d8c542e9133004b8b868609470e2b571b208e04 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Fri, 5 Mar 2021 16:14:53 -0500 Subject: [PATCH] Fixed clang-tidy readability-redundant-preprocessor warning For error_test.c the removed code was already dead, because it was in the else of an `#if H5_USE_16_API` block. Based on H5Location.h, I think p_get_ref_obj_type was meant to be in `#ifndef DOXYGEN_SHOULD_SKIP_THIS` and an `#endif` was missing. Similarly, in the header, getObjTypeByIdx is only in H5_NO_DEPRECATED_SYMBOLS, not DOXYGEN_SHOULD_SKIP_THIS. --- c++/src/H5Location.cpp | 7 +++---- test/error_test.c | 5 ----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index 2d14bfcd1bb..c7ca370399f 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -398,6 +398,7 @@ H5Location::getComment(const H5std_string &name, size_t buf_size) const { return (getComment(name.c_str(), buf_size)); } + #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- @@ -646,6 +647,7 @@ H5Location::p_get_obj_type(void *ref, H5R_type_t ref_type) const return (obj_type); } #endif // DOXYGEN_SHOULD_SKIP_THIS + #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- @@ -704,6 +706,7 @@ H5Location::p_get_ref_obj_type(void *ref, H5R_type_t ref_type) const } return (obj_type); } +#endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Location::getRegion @@ -2294,7 +2297,6 @@ H5Location::childObjVersion(const H5std_string &objname) const } #ifndef H5_NO_DEPRECATED_SYMBOLS -#ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: H5Location::getObjTypeByIdx ///\brief Returns the type of an object in this group, given the @@ -2372,7 +2374,6 @@ H5Location::getObjTypeByIdx(hsize_t idx, H5std_string &type_name) const return (obj_type); } -#endif // DOXYGEN_SHOULD_SKIP_THIS #endif /* H5_NO_DEPRECATED_SYMBOLS */ //-------------------------------------------------------------------------- @@ -2433,6 +2434,4 @@ f_DataSpace_setId(DataSpace *dspace, hid_t new_id) //-------------------------------------------------------------------------- H5Location::~H5Location() {} -#endif // DOXYGEN_SHOULD_SKIP_THIS - } // namespace H5 diff --git a/test/error_test.c b/test/error_test.c index e294a43db6c..9bbebec4403 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -129,13 +129,8 @@ test_error(hid_t file) TEST_ERROR; if (old_data != NULL) TEST_ERROR; -#ifdef H5_USE_16_API - if (old_func != (H5E_auto_t)H5Eprint) - TEST_ERROR; -#else /* H5_USE_16_API */ if (old_func != (H5E_auto2_t)H5Eprint2) TEST_ERROR; -#endif /* H5_USE_16_API */ if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) TEST_ERROR;