Skip to content

Commit

Permalink
Fixed clang-tidy readability-redundant-preprocessor warning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
seanm committed Mar 8, 2021
1 parent 0e3881a commit 0d8c542
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 3 additions & 4 deletions c++/src/H5Location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

//--------------------------------------------------------------------------
Expand Down Expand Up @@ -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 */

//--------------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 */

//--------------------------------------------------------------------------
Expand Down Expand Up @@ -2433,6 +2434,4 @@ f_DataSpace_setId(DataSpace *dspace, hid_t new_id)
//--------------------------------------------------------------------------
H5Location::~H5Location() {}

#endif // DOXYGEN_SHOULD_SKIP_THIS

} // namespace H5
5 changes: 0 additions & 5 deletions test/error_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0d8c542

Please sign in to comment.