From 5ddfbc2a736f7f4cc8b109ee3f3e53c4655dbec1 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Mon, 28 Jun 2021 16:31:00 -0700 Subject: Assume the library has C99 types in C++ type code (#806) * Assume the library has C99 types in C++ type code * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- c++/src/H5PredType.cpp | 169 ++++++------------------------------------------- c++/src/H5PredType.h | 73 ++------------------- 2 files changed, 25 insertions(+), 217 deletions(-) diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index a932f54..72d560d 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -249,63 +249,32 @@ PredType *PredType::NATIVE_INT32_; PredType *PredType::NATIVE_UINT32_; PredType *PredType::NATIVE_INT64_; PredType *PredType::NATIVE_UINT64_; + // LEAST types -#if H5_SIZEOF_INT_LEAST8_T != 0 PredType *PredType::NATIVE_INT_LEAST8_; -#endif /* H5_SIZEOF_INT_LEAST8_T */ -#if H5_SIZEOF_UINT_LEAST8_T != 0 PredType *PredType::NATIVE_UINT_LEAST8_; -#endif /* H5_SIZEOF_UINT_LEAST8_T */ -#if H5_SIZEOF_INT_LEAST16_T != 0 PredType *PredType::NATIVE_INT_LEAST16_; -#endif /* H5_SIZEOF_INT_LEAST16_T */ -#if H5_SIZEOF_UINT_LEAST16_T != 0 PredType *PredType::NATIVE_UINT_LEAST16_; -#endif /* H5_SIZEOF_UINT_LEAST16_T */ -#if H5_SIZEOF_INT_LEAST32_T != 0 PredType *PredType::NATIVE_INT_LEAST32_; -#endif /* H5_SIZEOF_INT_LEAST32_T */ -#if H5_SIZEOF_UINT_LEAST32_T != 0 PredType *PredType::NATIVE_UINT_LEAST32_; -#endif /* H5_SIZEOF_UINT_LEAST32_T */ -#if H5_SIZEOF_INT_LEAST64_T != 0 PredType *PredType::NATIVE_INT_LEAST64_; -#endif /* H5_SIZEOF_INT_LEAST64_T */ -#if H5_SIZEOF_UINT_LEAST64_T != 0 PredType *PredType::NATIVE_UINT_LEAST64_; -#endif /* H5_SIZEOF_UINT_LEAST64_T */ // FAST types -#if H5_SIZEOF_INT_FAST8_T != 0 PredType *PredType::NATIVE_INT_FAST8_; -#endif /* H5_SIZEOF_INT_FAST8_T */ -#if H5_SIZEOF_UINT_FAST8_T != 0 PredType *PredType::NATIVE_UINT_FAST8_; -#endif /* H5_SIZEOF_UINT_FAST8_T */ -#if H5_SIZEOF_INT_FAST16_T != 0 PredType *PredType::NATIVE_INT_FAST16_; -#endif /* H5_SIZEOF_INT_FAST16_T */ -#if H5_SIZEOF_UINT_FAST16_T != 0 PredType *PredType::NATIVE_UINT_FAST16_; -#endif /* H5_SIZEOF_UINT_FAST16_T */ -#if H5_SIZEOF_INT_FAST32_T != 0 PredType *PredType::NATIVE_INT_FAST32_; -#endif /* H5_SIZEOF_INT_FAST32_T */ -#if H5_SIZEOF_UINT_FAST32_T != 0 PredType *PredType::NATIVE_UINT_FAST32_; -#endif /* H5_SIZEOF_UINT_FAST32_T */ -#if H5_SIZEOF_INT_FAST64_T != 0 PredType *PredType::NATIVE_INT_FAST64_; -#endif /* H5_SIZEOF_INT_FAST64_T */ -#if H5_SIZEOF_UINT_FAST64_T != 0 PredType *PredType::NATIVE_UINT_FAST64_; -#endif /* H5_SIZEOF_UINT_FAST64_T */ //-------------------------------------------------------------------------- // Function: PredType::getPredTypes @@ -472,63 +441,31 @@ PredType::makePredTypes() NATIVE_INT64_ = new PredType(H5T_NATIVE_INT64); NATIVE_UINT64_ = new PredType(H5T_NATIVE_UINT64); -// LEAST types -#if H5_SIZEOF_INT_LEAST8_T != 0 - NATIVE_INT_LEAST8_ = new PredType(H5T_NATIVE_INT_LEAST8); -#endif /* H5_SIZEOF_INT_LEAST8_T */ -#if H5_SIZEOF_UINT_LEAST8_T != 0 + // LEAST types + NATIVE_INT_LEAST8_ = new PredType(H5T_NATIVE_INT_LEAST8); NATIVE_UINT_LEAST8_ = new PredType(H5T_NATIVE_UINT_LEAST8); -#endif /* H5_SIZEOF_UINT_LEAST8_T */ -#if H5_SIZEOF_INT_LEAST16_T != 0 - NATIVE_INT_LEAST16_ = new PredType(H5T_NATIVE_INT_LEAST16); -#endif /* H5_SIZEOF_INT_LEAST16_T */ -#if H5_SIZEOF_UINT_LEAST16_T != 0 + NATIVE_INT_LEAST16_ = new PredType(H5T_NATIVE_INT_LEAST16); NATIVE_UINT_LEAST16_ = new PredType(H5T_NATIVE_UINT_LEAST16); -#endif /* H5_SIZEOF_UINT_LEAST16_T */ -#if H5_SIZEOF_INT_LEAST32_T != 0 - NATIVE_INT_LEAST32_ = new PredType(H5T_NATIVE_INT_LEAST32); -#endif /* H5_SIZEOF_INT_LEAST32_T */ -#if H5_SIZEOF_UINT_LEAST32_T != 0 + NATIVE_INT_LEAST32_ = new PredType(H5T_NATIVE_INT_LEAST32); NATIVE_UINT_LEAST32_ = new PredType(H5T_NATIVE_UINT_LEAST32); -#endif /* H5_SIZEOF_UINT_LEAST32_T */ -#if H5_SIZEOF_INT_LEAST64_T != 0 - NATIVE_INT_LEAST64_ = new PredType(H5T_NATIVE_INT_LEAST64); -#endif /* H5_SIZEOF_INT_LEAST64_T */ -#if H5_SIZEOF_UINT_LEAST64_T != 0 + NATIVE_INT_LEAST64_ = new PredType(H5T_NATIVE_INT_LEAST64); NATIVE_UINT_LEAST64_ = new PredType(H5T_NATIVE_UINT_LEAST64); -#endif /* H5_SIZEOF_UINT_LEAST64_T */ -// FAST types -#if H5_SIZEOF_INT_FAST8_T != 0 - NATIVE_INT_FAST8_ = new PredType(H5T_NATIVE_INT_FAST8); -#endif /* H5_SIZEOF_INT_FAST8_T */ -#if H5_SIZEOF_UINT_FAST8_T != 0 + // FAST types + NATIVE_INT_FAST8_ = new PredType(H5T_NATIVE_INT_FAST8); NATIVE_UINT_FAST8_ = new PredType(H5T_NATIVE_UINT_FAST8); -#endif /* H5_SIZEOF_UINT_FAST8_T */ -#if H5_SIZEOF_INT_FAST16_T != 0 - NATIVE_INT_FAST16_ = new PredType(H5T_NATIVE_INT_FAST16); -#endif /* H5_SIZEOF_INT_FAST16_T */ -#if H5_SIZEOF_UINT_FAST16_T != 0 + NATIVE_INT_FAST16_ = new PredType(H5T_NATIVE_INT_FAST16); NATIVE_UINT_FAST16_ = new PredType(H5T_NATIVE_UINT_FAST16); -#endif /* H5_SIZEOF_UINT_FAST16_T */ -#if H5_SIZEOF_INT_FAST32_T != 0 - NATIVE_INT_FAST32_ = new PredType(H5T_NATIVE_INT_FAST32); -#endif /* H5_SIZEOF_INT_FAST32_T */ -#if H5_SIZEOF_UINT_FAST32_T != 0 + NATIVE_INT_FAST32_ = new PredType(H5T_NATIVE_INT_FAST32); NATIVE_UINT_FAST32_ = new PredType(H5T_NATIVE_UINT_FAST32); -#endif /* H5_SIZEOF_UINT_FAST32_T */ -#if H5_SIZEOF_INT_FAST64_T != 0 - NATIVE_INT_FAST64_ = new PredType(H5T_NATIVE_INT_FAST64); -#endif /* H5_SIZEOF_INT_FAST64_T */ -#if H5_SIZEOF_UINT_FAST64_T != 0 + NATIVE_INT_FAST64_ = new PredType(H5T_NATIVE_INT_FAST64); NATIVE_UINT_FAST64_ = new PredType(H5T_NATIVE_UINT_FAST64); -#endif /* H5_SIZEOF_UINT_FAST64_T */ } // makePredTypes @@ -658,63 +595,31 @@ PredType::deleteConstants() delete NATIVE_INT64_; delete NATIVE_UINT64_; -// LEAST types -#if H5_SIZEOF_INT_LEAST8_T != 0 + // LEAST types delete NATIVE_INT_LEAST8_; -#endif /* H5_SIZEOF_INT_LEAST8_T */ -#if H5_SIZEOF_UINT_LEAST8_T != 0 delete NATIVE_UINT_LEAST8_; -#endif /* H5_SIZEOF_UINT_LEAST8_T */ -#if H5_SIZEOF_INT_LEAST16_T != 0 delete NATIVE_INT_LEAST16_; -#endif /* H5_SIZEOF_INT_LEAST16_T */ -#if H5_SIZEOF_UINT_LEAST16_T != 0 delete NATIVE_UINT_LEAST16_; -#endif /* H5_SIZEOF_UINT_LEAST16_T */ -#if H5_SIZEOF_INT_LEAST32_T != 0 delete NATIVE_INT_LEAST32_; -#endif /* H5_SIZEOF_INT_LEAST32_T */ -#if H5_SIZEOF_UINT_LEAST32_T != 0 delete NATIVE_UINT_LEAST32_; -#endif /* H5_SIZEOF_UINT_LEAST32_T */ -#if H5_SIZEOF_INT_LEAST64_T != 0 delete NATIVE_INT_LEAST64_; -#endif /* H5_SIZEOF_INT_LEAST64_T */ -#if H5_SIZEOF_UINT_LEAST64_T != 0 delete NATIVE_UINT_LEAST64_; -#endif /* H5_SIZEOF_UINT_LEAST64_T */ -// FAST types -#if H5_SIZEOF_INT_FAST8_T != 0 + // FAST types delete NATIVE_INT_FAST8_; -#endif /* H5_SIZEOF_INT_FAST8_T */ -#if H5_SIZEOF_UINT_FAST8_T != 0 delete NATIVE_UINT_FAST8_; -#endif /* H5_SIZEOF_UINT_FAST8_T */ -#if H5_SIZEOF_INT_FAST16_T != 0 delete NATIVE_INT_FAST16_; -#endif /* H5_SIZEOF_INT_FAST16_T */ -#if H5_SIZEOF_UINT_FAST16_T != 0 delete NATIVE_UINT_FAST16_; -#endif /* H5_SIZEOF_UINT_FAST16_T */ -#if H5_SIZEOF_INT_FAST32_T != 0 delete NATIVE_INT_FAST32_; -#endif /* H5_SIZEOF_INT_FAST32_T */ -#if H5_SIZEOF_UINT_FAST32_T != 0 delete NATIVE_UINT_FAST32_; -#endif /* H5_SIZEOF_UINT_FAST32_T */ -#if H5_SIZEOF_INT_FAST64_T != 0 delete NATIVE_INT_FAST64_; -#endif /* H5_SIZEOF_INT_FAST64_T */ -#if H5_SIZEOF_UINT_FAST64_T != 0 delete NATIVE_UINT_FAST64_; -#endif /* H5_SIZEOF_UINT_FAST64_T */ delete PREDTYPE_CONST_; PREDTYPE_CONST_ = 0; @@ -848,62 +753,30 @@ const PredType &PredType::NATIVE_INT64 = *NATIVE_INT64_; const PredType &PredType::NATIVE_UINT64 = *NATIVE_UINT64_; // LEAST types -#if H5_SIZEOF_INT_LEAST8_T != 0 -const PredType &PredType::NATIVE_INT_LEAST8 = *NATIVE_INT_LEAST8_; -#endif /* H5_SIZEOF_INT_LEAST8_T */ -#if H5_SIZEOF_UINT_LEAST8_T != 0 +const PredType &PredType::NATIVE_INT_LEAST8 = *NATIVE_INT_LEAST8_; const PredType &PredType::NATIVE_UINT_LEAST8 = *NATIVE_UINT_LEAST8_; -#endif /* H5_SIZEOF_UINT_LEAST8_T */ -#if H5_SIZEOF_INT_LEAST16_T != 0 -const PredType &PredType::NATIVE_INT_LEAST16 = *NATIVE_INT_LEAST16_; -#endif /* H5_SIZEOF_INT_LEAST16_T */ -#if H5_SIZEOF_UINT_LEAST16_T != 0 +const PredType &PredType::NATIVE_INT_LEAST16 = *NATIVE_INT_LEAST16_; const PredType &PredType::NATIVE_UINT_LEAST16 = *NATIVE_UINT_LEAST16_; -#endif /* H5_SIZEOF_UINT_LEAST16_T */ -#if H5_SIZEOF_INT_LEAST32_T != 0 -const PredType &PredType::NATIVE_INT_LEAST32 = *NATIVE_INT_LEAST32_; -#endif /* H5_SIZEOF_INT_LEAST32_T */ -#if H5_SIZEOF_UINT_LEAST32_T != 0 +const PredType &PredType::NATIVE_INT_LEAST32 = *NATIVE_INT_LEAST32_; const PredType &PredType::NATIVE_UINT_LEAST32 = *NATIVE_UINT_LEAST32_; -#endif /* H5_SIZEOF_UINT_LEAST32_T */ -#if H5_SIZEOF_INT_LEAST64_T != 0 -const PredType &PredType::NATIVE_INT_LEAST64 = *NATIVE_INT_LEAST64_; -#endif /* H5_SIZEOF_INT_LEAST64_T */ -#if H5_SIZEOF_UINT_LEAST64_T != 0 +const PredType &PredType::NATIVE_INT_LEAST64 = *NATIVE_INT_LEAST64_; const PredType &PredType::NATIVE_UINT_LEAST64 = *NATIVE_UINT_LEAST64_; -#endif /* H5_SIZEOF_UINT_LEAST64_T */ // FAST types -#if H5_SIZEOF_INT_FAST8_T != 0 -const PredType &PredType::NATIVE_INT_FAST8 = *NATIVE_INT_FAST8_; -#endif /* H5_SIZEOF_INT_FAST8_T */ -#if H5_SIZEOF_UINT_FAST8_T != 0 +const PredType &PredType::NATIVE_INT_FAST8 = *NATIVE_INT_FAST8_; const PredType &PredType::NATIVE_UINT_FAST8 = *NATIVE_UINT_FAST8_; -#endif /* H5_SIZEOF_UINT_FAST8_T */ -#if H5_SIZEOF_INT_FAST16_T != 0 -const PredType &PredType::NATIVE_INT_FAST16 = *NATIVE_INT_FAST16_; -#endif /* H5_SIZEOF_INT_FAST16_T */ -#if H5_SIZEOF_UINT_FAST16_T != 0 +const PredType &PredType::NATIVE_INT_FAST16 = *NATIVE_INT_FAST16_; const PredType &PredType::NATIVE_UINT_FAST16 = *NATIVE_UINT_FAST16_; -#endif /* H5_SIZEOF_UINT_FAST16_T */ -#if H5_SIZEOF_INT_FAST32_T != 0 -const PredType &PredType::NATIVE_INT_FAST32 = *NATIVE_INT_FAST32_; -#endif /* H5_SIZEOF_INT_FAST32_T */ -#if H5_SIZEOF_UINT_FAST32_T != 0 +const PredType &PredType::NATIVE_INT_FAST32 = *NATIVE_INT_FAST32_; const PredType &PredType::NATIVE_UINT_FAST32 = *NATIVE_UINT_FAST32_; -#endif /* H5_SIZEOF_UINT_FAST32_T */ -#if H5_SIZEOF_INT_FAST64_T != 0 -const PredType &PredType::NATIVE_INT_FAST64 = *NATIVE_INT_FAST64_; -#endif /* H5_SIZEOF_INT_FAST64_T */ -#if H5_SIZEOF_UINT_FAST64_T != 0 +const PredType &PredType::NATIVE_INT_FAST64 = *NATIVE_INT_FAST64_; const PredType &PredType::NATIVE_UINT_FAST64 = *NATIVE_UINT_FAST64_; -#endif /* H5_SIZEOF_UINT_FAST64_T */ #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 0ec5ddd..45f20ab 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -176,63 +176,31 @@ class H5_DLLCPP PredType : public AtomType { static const PredType &NATIVE_INT64; static const PredType &NATIVE_UINT64; -// LEAST types -#if H5_SIZEOF_INT_LEAST8_T != 0 + // LEAST types static const PredType &NATIVE_INT_LEAST8; -#endif /* H5_SIZEOF_INT_LEAST8_T */ -#if H5_SIZEOF_UINT_LEAST8_T != 0 static const PredType &NATIVE_UINT_LEAST8; -#endif /* H5_SIZEOF_UINT_LEAST8_T */ -#if H5_SIZEOF_INT_LEAST16_T != 0 static const PredType &NATIVE_INT_LEAST16; -#endif /* H5_SIZEOF_INT_LEAST16_T */ -#if H5_SIZEOF_UINT_LEAST16_T != 0 static const PredType &NATIVE_UINT_LEAST16; -#endif /* H5_SIZEOF_UINT_LEAST16_T */ -#if H5_SIZEOF_INT_LEAST32_T != 0 static const PredType &NATIVE_INT_LEAST32; -#endif /* H5_SIZEOF_INT_LEAST32_T */ -#if H5_SIZEOF_UINT_LEAST32_T != 0 static const PredType &NATIVE_UINT_LEAST32; -#endif /* H5_SIZEOF_UINT_LEAST32_T */ -#if H5_SIZEOF_INT_LEAST64_T != 0 static const PredType &NATIVE_INT_LEAST64; -#endif /* H5_SIZEOF_INT_LEAST64_T */ -#if H5_SIZEOF_UINT_LEAST64_T != 0 static const PredType &NATIVE_UINT_LEAST64; -#endif /* H5_SIZEOF_UINT_LEAST64_T */ -// FAST types -#if H5_SIZEOF_INT_FAST8_T != 0 + // FAST types static const PredType &NATIVE_INT_FAST8; -#endif /* H5_SIZEOF_INT_FAST8_T */ -#if H5_SIZEOF_UINT_FAST8_T != 0 static const PredType &NATIVE_UINT_FAST8; -#endif /* H5_SIZEOF_UINT_FAST8_T */ -#if H5_SIZEOF_INT_FAST16_T != 0 static const PredType &NATIVE_INT_FAST16; -#endif /* H5_SIZEOF_INT_FAST16_T */ -#if H5_SIZEOF_UINT_FAST16_T != 0 static const PredType &NATIVE_UINT_FAST16; -#endif /* H5_SIZEOF_UINT_FAST16_T */ -#if H5_SIZEOF_INT_FAST32_T != 0 static const PredType &NATIVE_INT_FAST32; -#endif /* H5_SIZEOF_INT_FAST32_T */ -#if H5_SIZEOF_UINT_FAST32_T != 0 static const PredType &NATIVE_UINT_FAST32; -#endif /* H5_SIZEOF_UINT_FAST32_T */ -#if H5_SIZEOF_INT_FAST64_T != 0 static const PredType &NATIVE_INT_FAST64; -#endif /* H5_SIZEOF_INT_FAST64_T */ -#if H5_SIZEOF_UINT_FAST64_T != 0 static const PredType &NATIVE_UINT_FAST64; -#endif /* H5_SIZEOF_UINT_FAST64_T */ #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -378,64 +346,31 @@ class H5_DLLCPP PredType : public AtomType { static PredType *NATIVE_INT64_; static PredType *NATIVE_UINT64_; -// LEAST types -#if H5_SIZEOF_INT_LEAST8_T != 0 + // LEAST types static PredType *NATIVE_INT_LEAST8_; -#endif /* H5_SIZEOF_INT_LEAST8_T */ -#if H5_SIZEOF_UINT_LEAST8_T != 0 static PredType *NATIVE_UINT_LEAST8_; -#endif /* H5_SIZEOF_UINT_LEAST8_T */ -#if H5_SIZEOF_INT_LEAST16_T != 0 static PredType *NATIVE_INT_LEAST16_; -#endif /* H5_SIZEOF_INT_LEAST16_T */ -#if H5_SIZEOF_UINT_LEAST16_T != 0 static PredType *NATIVE_UINT_LEAST16_; -#endif /* H5_SIZEOF_UINT_LEAST16_T */ -#if H5_SIZEOF_INT_LEAST32_T != 0 static PredType *NATIVE_INT_LEAST32_; -#endif /* H5_SIZEOF_INT_LEAST32_T */ -#if H5_SIZEOF_UINT_LEAST32_T != 0 static PredType *NATIVE_UINT_LEAST32_; -#endif /* H5_SIZEOF_UINT_LEAST32_T */ -#if H5_SIZEOF_INT_LEAST64_T != 0 static PredType *NATIVE_INT_LEAST64_; -#endif /* H5_SIZEOF_INT_LEAST64_T */ -#if H5_SIZEOF_UINT_LEAST64_T != 0 static PredType *NATIVE_UINT_LEAST64_; -#endif /* H5_SIZEOF_UINT_LEAST64_T */ -// FAST types -#if H5_SIZEOF_INT_FAST8_T != 0 + // FAST types static PredType *NATIVE_INT_FAST8_; -#endif /* H5_SIZEOF_INT_FAST8_T */ -#if H5_SIZEOF_UINT_FAST8_T != 0 static PredType *NATIVE_UINT_FAST8_; -#endif /* H5_SIZEOF_UINT_FAST8_T */ -#if H5_SIZEOF_INT_FAST16_T != 0 static PredType *NATIVE_INT_FAST16_; -#endif /* H5_SIZEOF_INT_FAST16_T */ -#if H5_SIZEOF_UINT_FAST16_T != 0 static PredType *NATIVE_UINT_FAST16_; -#endif /* H5_SIZEOF_UINT_FAST16_T */ -#if H5_SIZEOF_INT_FAST32_T != 0 static PredType *NATIVE_INT_FAST32_; -#endif /* H5_SIZEOF_INT_FAST32_T */ -#if H5_SIZEOF_UINT_FAST32_T != 0 static PredType *NATIVE_UINT_FAST32_; -#endif /* H5_SIZEOF_UINT_FAST32_T */ -#if H5_SIZEOF_INT_FAST64_T != 0 static PredType *NATIVE_INT_FAST64_; -#endif /* H5_SIZEOF_INT_FAST64_T */ -#if H5_SIZEOF_UINT_FAST64_T != 0 static PredType *NATIVE_UINT_FAST64_; -#endif /* H5_SIZEOF_UINT_FAST64_T */ - // End of Declaration of pointers #endif // DOXYGEN_SHOULD_SKIP_THIS -- cgit v0.12 From 734d317da9c759799c92ff47e05e3be7e3e969a9 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Mon, 28 Jun 2021 21:58:38 -0700 Subject: Removes obsolete equivalents of C99's __func__ (#800) --- bin/trace | 2 +- config/cmake/H5pubconf.h.in | 6 - config/cmake_ext_mod/ConfigureChecks.cmake | 3 - config/cmake_ext_mod/HDFTests.c | 40 --- configure.ac | 12 - src/H5A.c | 24 +- src/H5D.c | 14 +- src/H5Eprivate.h | 2 +- src/H5F.c | 16 +- src/H5FDsplitter.c | 80 ++--- src/H5G.c | 12 +- src/H5HF.c | 12 +- src/H5HFdbg.c | 2 +- src/H5HFdblock.c | 2 +- src/H5L.c | 12 +- src/H5M.c | 10 +- src/H5O.c | 14 +- src/H5R.c | 6 +- src/H5T.c | 2 +- src/H5Tcommit.c | 4 +- src/H5VLcallback.c | 14 +- src/H5private.h | 90 +++--- test/cache.c | 499 +++++++++++++++-------------- test/cache_api.c | 48 +-- test/cache_common.c | 24 +- test/cache_image.c | 36 +-- test/h5test.h | 2 +- tools/lib/h5tools_error.h | 18 +- tools/test/h5copy/h5copygentest.c | 54 ++-- tools/test/h5diff/h5diffgentest.c | 2 +- tools/test/h5repack/h5repacktst.c | 108 +++---- tools/test/misc/vds/UC_common.h | 11 +- 32 files changed, 556 insertions(+), 625 deletions(-) diff --git a/bin/trace b/bin/trace index d51b8cb..cc26f86 100755 --- a/bin/trace +++ b/bin/trace @@ -351,7 +351,7 @@ sub rewrite_func ($$$$$) { # Compose the trace macro $trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\", \""; - $argtrace = "H5ARG_TRACE" . scalar(@arg_str) . "(FUNC, \""; + $argtrace = "H5ARG_TRACE" . scalar(@arg_str) . "(__func__, \""; $trace .= join("", @arg_str) . "\""; $argtrace .= join("", @arg_str) . "\""; diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index e14e212..be366a8 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -102,9 +102,6 @@ and unions */ #cmakedefine H5_HAVE_C99_DESIGNATED_INITIALIZER @H5_HAVE_C99_DESIGNATED_INITIALIZER@ -/* Define if the compiler understands the __func__ keyword */ -#cmakedefine H5_HAVE_C99_FUNC @H5_HAVE_C99_FUNC@ - /* Define to 1 if you have the `clock_gettime' function. */ #cmakedefine H5_HAVE_CLOCK_GETTIME @H5_HAVE_CLOCK_GETTIME@ @@ -159,9 +156,6 @@ /* Define to 1 if you have the `fseeko' function. */ #cmakedefine H5_HAVE_FSEEKO @H5_HAVE_FSEEKO@ -/* Define if the compiler understands the __FUNCTION__ keyword */ -#cmakedefine H5_HAVE_FUNCTION @H5_HAVE_FUNCTION@ - /* Determine if INTEGER*16 is available */ #cmakedefine H5_HAVE_Fortran_INTEGER_SIZEOF_16 @H5_HAVE_Fortran_INTEGER_SIZEOF_16@ diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index ad8496a..ccf7c85 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -74,7 +74,6 @@ if (WINDOWS) set (${HDF_PREFIX}_HAVE_STRDUP 1) if (NOT MINGW) set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1) - set (${HDF_PREFIX}_HAVE_FUNCTION 1) endif () if (NOT UNIX AND NOT CYGWIN) set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1) @@ -507,8 +506,6 @@ endif () if (MINGW OR NOT WINDOWS) foreach (other_test HAVE_ATTRIBUTE - HAVE_C99_FUNC - HAVE_FUNCTION HAVE_C99_DESIGNATED_INITIALIZER SYSTEM_SCOPE_THREADS HAVE_SOCKLEN_T diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 365931b..c434be5 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -44,26 +44,6 @@ main () #endif -#ifdef HAVE_C99_FUNC - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ - const char *fname = __func__; - ; - return 0; -} - -#endif - #ifdef HAVE_ATTRIBUTE #if 0 @@ -90,26 +70,6 @@ int __attribute__((unused)) x #endif /* HAVE_ATTRIBUTE */ -#ifdef HAVE_FUNCTION - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -(void)__FUNCTION__ - ; - return 0; -} - -#endif /* HAVE_FUNCTION */ - #ifdef HAVE_TIMEZONE #ifdef HAVE_SYS_TIME_H diff --git a/configure.ac b/configure.ac index d9a6a5e..dbeb968 100644 --- a/configure.ac +++ b/configure.ac @@ -2024,18 +2024,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[int __attribute__((unused)) x]])], AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) -AC_MSG_CHECKING([for __func__ extension]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ const char *fname = __func__; ]])], - [AC_DEFINE([HAVE_C99_FUNC], [1], - [Define if the compiler understands the __func__ keyword]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) -AC_MSG_CHECKING([for __FUNCTION__ extension]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],,[[ const char *fname = __FUNCTION__; ]])], - [AC_DEFINE([HAVE_FUNCTION], [1], - [Define if the compiler understands the __FUNCTION__ keyword]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) AC_MSG_CHECKING([for C99 designated initialization support]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ typedef struct { diff --git a/src/H5A.c b/src/H5A.c index 5d8737f..c986d1f 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -276,7 +276,7 @@ H5Acreate_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIui*siiiii", app_file, app_func, app_line, loc_id, attr_name, type_id, space_id, acpl_id, aapl_id, es_id)) < 0) { + H5ARG_TRACE10(__func__, "*s*sIui*siiiii", app_file, app_func, app_line, loc_id, attr_name, type_id, space_id, acpl_id, aapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref(ret_value) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID") @@ -425,7 +425,7 @@ H5Acreate_by_name_async(const char *app_file, const char *app_func, unsigned app if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE12(FUNC, "*s*sIui*s*siiiiii", app_file, app_func, app_line, loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id, es_id)) < 0) { + H5ARG_TRACE12(__func__, "*s*sIui*s*siiiiii", app_file, app_func, app_line, loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref(ret_value) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID") @@ -588,7 +588,7 @@ H5Aopen_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, attr_name, aapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, attr_name, aapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref(ret_value) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID") @@ -719,7 +719,7 @@ H5Aopen_by_name_async(const char *app_file, const char *app_func, unsigned app_l if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE9(FUNC, "*s*sIui*s*siii", app_file, app_func, app_line, loc_id, obj_name, attr_name, aapl_id, lapl_id, es_id)) < 0) { + H5ARG_TRACE9(__func__, "*s*sIui*s*siii", app_file, app_func, app_line, loc_id, obj_name, attr_name, aapl_id, lapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref(ret_value) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID") @@ -859,7 +859,7 @@ H5Aopen_by_idx_async(const char *app_file, const char *app_func, unsigned app_li if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE11(FUNC, "*s*sIui*sIiIohiii", app_file, app_func, app_line, loc_id, obj_name, idx_type, order, n, aapl_id, lapl_id, es_id)) < 0) { + H5ARG_TRACE11(__func__, "*s*sIui*sIiIohiii", app_file, app_func, app_line, loc_id, obj_name, idx_type, order, n, aapl_id, lapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref(ret_value) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on attribute ID") @@ -971,7 +971,7 @@ H5Awrite_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIuii*xi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIuii*xi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1079,7 +1079,7 @@ H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIuiixi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIuiixi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1719,7 +1719,7 @@ H5Arename_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*s*si", app_file, app_func, app_line, loc_id, old_name, new_name, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIui*s*si", app_file, app_func, app_line, loc_id, old_name, new_name, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1839,7 +1839,7 @@ H5Arename_by_name_async(const char *app_file, const char *app_func, unsigned app if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE9(FUNC, "*s*sIui*s*s*sii", app_file, app_func, app_line, loc_id, obj_name, old_attr_name, new_attr_name, lapl_id, es_id)) < 0) + H5ARG_TRACE9(__func__, "*s*sIui*s*s*sii", app_file, app_func, app_line, loc_id, obj_name, old_attr_name, new_attr_name, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -2304,7 +2304,7 @@ H5Aclose_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, attr_id, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, attr_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -2460,7 +2460,7 @@ H5Aexists_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*s*bi", app_file, app_func, app_line, obj_id, attr_name, attr_exists, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIui*s*bi", app_file, app_func, app_line, obj_id, attr_name, attr_exists, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -2579,7 +2579,7 @@ H5Aexists_by_name_async(const char *app_file, const char *app_func, unsigned app if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE9(FUNC, "*s*sIui*s*s*bii", app_file, app_func, app_line, loc_id, obj_name, attr_name, attr_exists, lapl_id, es_id)) < 0) + H5ARG_TRACE9(__func__, "*s*sIui*s*s*bii", app_file, app_func, app_line, loc_id, obj_name, attr_name, attr_exists, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set") diff --git a/src/H5D.c b/src/H5D.c index 7d0e934..7153c7d 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -228,7 +228,7 @@ H5Dcreate_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE11(FUNC, "*s*sIui*siiiiii", app_file, app_func, app_line, loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id, es_id)) < 0) { + H5ARG_TRACE11(__func__, "*s*sIui*siiiiii", app_file, app_func, app_line, loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on dataset ID") @@ -437,7 +437,7 @@ H5Dopen_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, dapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, dapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on dataset ID") @@ -531,7 +531,7 @@ H5Dclose_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, dset_id, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, dset_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -647,7 +647,7 @@ H5Dget_space_async(const char *app_file, const char *app_func, unsigned app_line if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, dset_id, es_id)) < 0) { + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, dset_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref(ret_value) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, H5I_INVALID_HID, @@ -1065,7 +1065,7 @@ H5Dread_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIuiiiiixi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIuiiiiixi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1267,7 +1267,7 @@ H5Dwrite_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIuiiiii*xi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIuiiiii*xi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1846,7 +1846,7 @@ H5Dset_extent_async(const char *app_file, const char *app_func, unsigned app_lin if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE6(FUNC, "*s*sIui*hi", app_file, app_func, app_line, dset_id, size, es_id)) < 0) + H5ARG_TRACE6(__func__, "*s*sIui*hi", app_file, app_func, app_line, dset_id, size, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set") diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index cd567aa..a30cb6a 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -31,7 +31,7 @@ typedef struct H5E_t H5E_t; * error number, the minor error number, and a description of the error. */ #define HERROR(maj_id, min_id, ...) \ - H5E_printf_stack(NULL, __FILE__, FUNC, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__) + H5E_printf_stack(NULL, __FILE__, __func__, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__) /* * HCOMMON_ERROR macro, used by HDONE_ERROR and HGOTO_ERROR diff --git a/src/H5F.c b/src/H5F.c index 5950d9e..8a28b00 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -711,7 +711,7 @@ H5Fcreate_async(const char *app_file, const char *app_func, unsigned app_line, c if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE8(FUNC, "*s*sIu*sIuiii", app_file, app_func, app_line, filename, flags, fcpl_id, fapl_id, es_id)) < 0) { + H5ARG_TRACE8(__func__, "*s*sIu*sIuiii", app_file, app_func, app_line, filename, flags, fcpl_id, fapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref(ret_value) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on file ID") @@ -730,7 +730,7 @@ H5Fcreate_async(const char *app_file, const char *app_func, unsigned app_line, c if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE8(FUNC, "*s*sIu*sIuiii", app_file, app_func, app_line, filename, flags, fcpl_id, fapl_id, es_id)) < 0) + H5ARG_TRACE8(__func__, "*s*sIu*sIuiii", app_file, app_func, app_line, filename, flags, fcpl_id, fapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert token into event set") @@ -888,7 +888,7 @@ H5Fopen_async(const char *app_file, const char *app_func, unsigned app_line, con if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIu*sIuii", app_file, app_func, app_line, filename, flags, fapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIu*sIuii", app_file, app_func, app_line, filename, flags, fapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref(ret_value) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on file ID") @@ -907,7 +907,7 @@ H5Fopen_async(const char *app_file, const char *app_func, unsigned app_line, con if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIu*sIuii", app_file, app_func, app_line, filename, flags, fapl_id, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIu*sIuii", app_file, app_func, app_line, filename, flags, fapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert token into event set") @@ -1020,7 +1020,7 @@ H5Fflush_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE6(FUNC, "*s*sIuiFsi", app_file, app_func, app_line, object_id, scope, es_id)) < 0) + H5ARG_TRACE6(__func__, "*s*sIuiFsi", app_file, app_func, app_line, object_id, scope, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1114,7 +1114,7 @@ H5Fclose_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1524,7 +1524,7 @@ H5Freopen_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0) { + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref(ret_value) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on file ID") @@ -1543,7 +1543,7 @@ H5Freopen_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, file_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_FILE, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert token into event set") diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index 298edfb..c27cd1b 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -187,7 +187,7 @@ H5FD__init_package(void) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); if (H5FD_splitter_init() < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize splitter VFD") @@ -213,7 +213,7 @@ H5FD_splitter_init(void) FUNC_ENTER_NOAPI(H5I_INVALID_HID) - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); if (H5I_VFL != H5I_get_type(H5FD_SPLITTER_g)) H5FD_SPLITTER_g = H5FDregister(&H5FD_splitter_g); @@ -237,7 +237,7 @@ H5FD__splitter_term(void) { FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Reset VFL ID */ H5FD_SPLITTER_g = 0; @@ -262,7 +262,7 @@ H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); HDassert(id_out_ptr != NULL); @@ -300,7 +300,7 @@ H5Pset_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *vfd_config) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*#", fapl_id, vfd_config); - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); if (H5FD_SPLITTER_MAGIC != vfd_config->magic) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid configuration (magic number mismatch)") @@ -388,7 +388,7 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/) FUNC_ENTER_API(FAIL) H5TRACE2("e", "ix", fapl_id, config); - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ if (TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) @@ -442,13 +442,13 @@ H5FD__splitter_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closin FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Public API for dxpl "context" */ if (H5FDflush(file->rw_file, dxpl_id, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush R/W file") if (H5FDflush(file->wo_file, dxpl_id, closing) < 0) - H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush W/O file") + H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTFLUSH, FAIL, "unable to flush W/O file") done: FUNC_LEAVE_NOAPI(ret_value) @@ -477,7 +477,7 @@ H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); HDassert(file && file->pub.cls); HDassert(buf); @@ -517,7 +517,7 @@ H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") @@ -527,7 +527,7 @@ H5FD__splitter_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr if (H5FDwrite(file->rw_file, type, dxpl_id, addr, size, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "R/W file write failed") if (H5FDwrite(file->wo_file, type, dxpl_id, addr, size, buf) < 0) - H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write W/O file") + H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write W/O file") done: FUNC_LEAVE_NOAPI(ret_value) @@ -553,7 +553,7 @@ H5FD__splitter_fapl_get(H5FD_t *_file) FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); ret_value = H5FD__splitter_fapl_copy(&(file->fa)); @@ -578,7 +578,7 @@ H5FD__splitter_fapl_copy(const void *_old_fa) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); HDassert(old_fa_ptr); @@ -622,7 +622,7 @@ H5FD__splitter_fapl_free(void *_fapl) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ HDassert(fapl); @@ -660,7 +660,7 @@ H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, ha FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ if (!name || !*name) @@ -716,7 +716,7 @@ H5FD__splitter_open(const char *name, unsigned flags, hid_t splitter_fapl_id, ha file_ptr->wo_file = H5FD_open(fapl_ptr->wo_path, flags, fapl_ptr->wo_fapl_id, HADDR_UNDEF); if (!file_ptr->wo_file) - H5FD_SPLITTER_WO_ERROR(file_ptr, FUNC, H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open W/O file") + H5FD_SPLITTER_WO_ERROR(file_ptr, __func__, H5E_VFL, H5E_CANTOPENFILE, NULL, "unable to open W/O file") ret_value = (H5FD_t *)file_ptr; @@ -757,7 +757,7 @@ H5FD__splitter_close(H5FD_t *_file) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ HDassert(file); @@ -772,7 +772,8 @@ H5FD__splitter_close(H5FD_t *_file) HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close R/W file") if (file->wo_file) if (H5FD_close(file->wo_file) == FAIL) - H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close W/O file") + H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTCLOSEFILE, FAIL, + "unable to close W/O file") if (file->logfp) { HDfclose(file->logfp); @@ -807,7 +808,7 @@ H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ HDassert(file); @@ -838,7 +839,7 @@ H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t ad FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC) + H5FD_SPLITTER_LOG_CALL(__func__) /* Sanity check */ HDassert(file); @@ -849,7 +850,7 @@ H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t ad HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "H5FDset_eoa failed for R/W file") if (H5FD_set_eoa(file->wo_file, type, addr) < 0) - H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTSET, FAIL, "unable to set EOA for W/O file") + H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTSET, FAIL, "unable to set EOA for W/O file") done: FUNC_LEAVE_NOAPI(ret_value) @@ -875,7 +876,7 @@ H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ HDassert(file); @@ -904,7 +905,7 @@ H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); HDassert(file); HDassert(file->rw_file); @@ -914,7 +915,7 @@ H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate R/W file") if (H5FDtruncate(file->wo_file, dxpl_id, closing) < 0) - H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate W/O file") + H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate W/O file") done: FUNC_LEAVE_NOAPI(ret_value) @@ -942,7 +943,7 @@ H5FD__splitter_sb_size(H5FD_t *_file) FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ HDassert(file); @@ -970,7 +971,7 @@ H5FD__splitter_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf / FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ HDassert(file); @@ -1001,7 +1002,7 @@ H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *b FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ HDassert(file); @@ -1032,7 +1033,7 @@ H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); HDassert(f1); HDassert(f2); @@ -1059,7 +1060,7 @@ H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_ FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ HDassert(file); @@ -1090,7 +1091,7 @@ H5FD__splitter_lock(H5FD_t *_file, hbool_t rw) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); HDassert(file); HDassert(file->rw_file); @@ -1101,7 +1102,7 @@ H5FD__splitter_lock(H5FD_t *_file, hbool_t rw) if (file->wo_file != NULL) if (H5FD_lock(file->wo_file, rw) < 0) - H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock W/O file") + H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock W/O file") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1123,7 +1124,7 @@ H5FD__splitter_unlock(H5FD_t *_file) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ HDassert(file); @@ -1158,7 +1159,7 @@ H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); if (file) { HDassert(file); @@ -1195,7 +1196,7 @@ H5FD__splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ HDassert(file); @@ -1206,7 +1207,8 @@ H5FD__splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate for R/W file") if (H5FDalloc(file->wo_file, type, dxpl_id, size) == HADDR_UNDEF) - H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to alloc for W/O file") + H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, + "unable to alloc for W/O file") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1228,7 +1230,7 @@ H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ HDassert(file); @@ -1258,7 +1260,7 @@ H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, FUNC_ENTER_STATIC - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ HDassert(file); @@ -1268,7 +1270,7 @@ H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free for R/W file") if (H5FDfree(file->wo_file, type, dxpl_id, addr, size) < 0) - H5FD_SPLITTER_WO_ERROR(file, FUNC, H5E_VFL, H5E_CANTINIT, FAIL, "unable to free for W/O file") + H5FD_SPLITTER_WO_ERROR(file, __func__, H5E_VFL, H5E_CANTINIT, FAIL, "unable to free for W/O file") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1289,7 +1291,7 @@ H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const FUNC_ENTER_STATIC_NOERR - H5FD_SPLITTER_LOG_CALL(FUNC); + H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ HDassert(file); diff --git a/src/H5G.c b/src/H5G.c index d7e4da9..deaf792 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -271,7 +271,7 @@ H5Gcreate_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE9(FUNC, "*s*sIui*siiii", app_file, app_func, app_line, loc_id, name, lcpl_id, gcpl_id, gapl_id, es_id)) < 0) { + H5ARG_TRACE9(__func__, "*s*sIui*siiii", app_file, app_func, app_line, loc_id, name, lcpl_id, gcpl_id, gapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on group ID") @@ -475,7 +475,7 @@ H5Gopen_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, gapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, gapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on group ID") @@ -630,7 +630,7 @@ H5Gget_info_async(const char *app_file, const char *app_func, unsigned app_line, if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE6(FUNC, "*s*sIuixi", app_file, app_func, app_line, loc_id, group_info, es_id)) < 0) + H5ARG_TRACE6(__func__, "*s*sIuixi", app_file, app_func, app_line, loc_id, group_info, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -738,7 +738,7 @@ H5Gget_info_by_name_async(const char *app_file, const char *app_func, unsigned a if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE8(FUNC, "*s*sIui*sxii", app_file, app_func, app_line, loc_id, name, group_info, lapl_id, es_id)) < 0) + H5ARG_TRACE8(__func__, "*s*sIui*sxii", app_file, app_func, app_line, loc_id, name, group_info, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -852,7 +852,7 @@ H5Gget_info_by_idx_async(const char *app_file, const char *app_func, unsigned ap if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE11(FUNC, "*s*sIui*sIiIohxii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, group_info, lapl_id, es_id)) < 0) + H5ARG_TRACE11(__func__, "*s*sIui*sIiIohxii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, group_info, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -942,7 +942,7 @@ H5Gclose_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, group_id, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, group_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set") diff --git a/src/H5HF.c b/src/H5HF.c index 73281a4..1f4cc26 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -429,7 +429,7 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get 'tiny' object's length") } /* end if */ else { - HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); + HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__); HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ @@ -489,7 +489,7 @@ H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p) *obj_off_p = (hsize_t)0; } /* end if */ else { - HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); + HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__); HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ @@ -552,7 +552,7 @@ H5HF_read(H5HF_t *fh, const void *_id, void *obj /*out*/) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't read 'tiny' object from fractal heap") } /* end if */ else { - HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); + HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__); HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ @@ -628,7 +628,7 @@ H5HF_write(H5HF_t *fh, void *_id, hbool_t H5_ATTR_UNUSED *id_changed, const void HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "modifying 'tiny' object not supported yet") } /* end if */ else { - HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); + HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__); HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ @@ -696,7 +696,7 @@ H5HF_op(H5HF_t *fh, const void *_id, H5HF_operator_t op, void *op_data) HGOTO_ERROR(H5E_HEAP, H5E_CANTOPERATE, FAIL, "can't operate on 'tiny' object from fractal heap") } /* end if */ else { - HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); + HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__); HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ @@ -759,7 +759,7 @@ H5HF_remove(H5HF_t *fh, const void *_id) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove 'tiny' object from fractal heap") } /* end if */ else { - HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); + HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__); HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index a244035..8dbb3f4 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -140,7 +140,7 @@ H5HF_id_print(H5HF_t *fh, const void *_id, FILE *stream, int indent, int fwidth) id_type = 'T'; } /* end if */ else { - HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", FUNC); + HDfprintf(stderr, "%s: Heap ID type not supported yet!\n", __func__); HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "heap ID type not supported yet") } /* end else */ diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 628dcc4..4adb47a 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -397,7 +397,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_ HDfprintf( stderr, "%s: Skipping direct block sizes not supported, min_dblock_size = %zu, next_size = %zu\n", - FUNC, min_dblock_size, next_size); + __func__, min_dblock_size, next_size); HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "skipping direct block sizes not supported yet") } /* end if */ diff --git a/src/H5L.c b/src/H5L.c index 487599b..065cc5c 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -415,7 +415,7 @@ H5Lcreate_soft_async(const char *app_file, const char *app_func, unsigned app_li if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE9(FUNC, "*s*sIu*si*siii", app_file, app_func, app_line, link_target, link_loc_id, link_name, lcpl_id, lapl_id, es_id)) < 0) + H5ARG_TRACE9(__func__, "*s*sIu*si*siii", app_file, app_func, app_line, link_target, link_loc_id, link_name, lcpl_id, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -608,7 +608,7 @@ H5Lcreate_hard_async(const char *app_file, const char *app_func, unsigned app_li if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj_ptr->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIui*si*siii", app_file, app_func, app_line, cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, lapl_id, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIui*si*siii", app_file, app_func, app_line, cur_loc_id, cur_name, new_loc_id, new_name, lcpl_id, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -903,7 +903,7 @@ H5Ldelete_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, lapl_id, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1031,7 +1031,7 @@ H5Ldelete_by_idx_async(const char *app_file, const char *app_func, unsigned app_ if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIui*sIiIohii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, lapl_id, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIui*sIiIohii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1276,7 +1276,7 @@ H5Lexists_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) if (H5ES_insert(es_id, vol_obj->connector, token, /* clang-format off */ - H5ARG_TRACE8(FUNC, "*s*sIui*s*bii", app_file, app_func, app_line, loc_id, name, exists, lapl_id, es_id)) < 0) + H5ARG_TRACE8(__func__, "*s*sIui*s*bii", app_file, app_func, app_line, loc_id, name, exists, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1742,7 +1742,7 @@ H5Literate_async(const char *app_file, const char *app_func, unsigned app_line, if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIuiIiIo*hLI*xi", app_file, app_func, app_line, group_id, idx_type, order, idx_p, op, op_data, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIuiIiIo*hLI*xi", app_file, app_func, app_line, group_id, idx_type, order, idx_p, op, op_data, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_LINK, H5E_CANTINSERT, FAIL, "can't insert token into event set") diff --git a/src/H5M.c b/src/H5M.c index c7d1bc9..b890a5c 100644 --- a/src/H5M.c +++ b/src/H5M.c @@ -390,7 +390,7 @@ H5Mcreate_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE11(FUNC, "*s*sIui*siiiiii", app_file, app_func, app_line, loc_id, name, key_type_id, val_type_id, lcpl_id, mcpl_id, mapl_id, es_id)) < 0) { + H5ARG_TRACE11(__func__, "*s*sIui*siiiiii", app_file, app_func, app_line, loc_id, name, key_type_id, val_type_id, lcpl_id, mcpl_id, mapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HDONE_ERROR(H5E_MAP, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on map ID") @@ -619,7 +619,7 @@ H5Mopen_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, mapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, mapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HDONE_ERROR(H5E_MAP, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on map ID") @@ -713,7 +713,7 @@ H5Mclose_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, map_id, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, map_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_MAP, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1088,7 +1088,7 @@ H5Mput_async(const char *app_file, const char *app_func, unsigned app_line, hid_ if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIuii*xi*xii", app_file, app_func, app_line, map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIuii*xi*xii", app_file, app_func, app_line, map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_MAP, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1226,7 +1226,7 @@ H5Mget_async(const char *app_file, const char *app_func, unsigned app_line, hid_ if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIuii*xi*xii", app_file, app_func, app_line, map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIuii*xi*xii", app_file, app_func, app_line, map_id, key_mem_type_id, key, val_mem_type_id, value, dxpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_MAP, H5E_CANTINSERT, FAIL, "can't insert token into event set") diff --git a/src/H5O.c b/src/H5O.c index 3ad14dd..db3ff31 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -201,7 +201,7 @@ H5Oopen_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, lapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, lapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on object ID") @@ -334,7 +334,7 @@ H5Oopen_by_idx_async(const char *app_file, const char *app_func, unsigned app_li if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIui*sIiIohii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, lapl_id, es_id)) < 0) { + H5ARG_TRACE10(__func__, "*s*sIui*sIiIohii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, lapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on object ID") @@ -594,7 +594,7 @@ H5Ocopy_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIui*si*siii", app_file, app_func, app_line, src_loc_id, src_name, dst_loc_id, dst_name, ocpypl_id, lcpl_id, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIui*si*siii", app_file, app_func, app_line, src_loc_id, src_name, dst_loc_id, dst_name, ocpypl_id, lcpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -700,7 +700,7 @@ H5Oflush_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, obj_id, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, obj_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -806,7 +806,7 @@ H5Orefresh_async(const char *app_file, const char *app_func, unsigned app_line, if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, oid, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, oid, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -1250,7 +1250,7 @@ H5Oget_info_by_name_async(const char *app_file, const char *app_func, unsigned a if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE9(FUNC, "*s*sIui*sxIuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id, es_id)) < 0) + H5ARG_TRACE9(__func__, "*s*sIui*sxIuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -2063,7 +2063,7 @@ H5Oclose_async(const char *app_file, const char *app_func, unsigned app_line, hi if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, object_id, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, object_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set") diff --git a/src/H5R.c b/src/H5R.c index 5fa2a8b..102af7f 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -610,7 +610,7 @@ H5Ropen_object_async(const char *app_file, const char *app_func, unsigned app_li if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, oapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, oapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on object ID") @@ -777,7 +777,7 @@ H5Ropen_region_async(const char *app_file, const char *app_func, unsigned app_li if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, oapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, oapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, H5I_INVALID_HID, "can't decrement count on region ID") @@ -946,7 +946,7 @@ H5Ropen_attr_async(const char *app_file, const char *app_func, unsigned app_line if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, aapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIu*Rriii", app_file, app_func, app_line, ref_ptr, rapl_id, aapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDEC, H5I_INVALID_HID, diff --git a/src/H5T.c b/src/H5T.c index 74b7655..1b0e8c9 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -2045,7 +2045,7 @@ H5Tclose_async(const char *app_file, const char *app_func, unsigned app_line, hi /* If a token was created, add the token to the event set */ if (NULL != token) if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE5(FUNC, "*s*sIuii", app_file, app_func, app_line, type_id, es_id)) < 0) + H5ARG_TRACE5(__func__, "*s*sIuii", app_file, app_func, app_line, type_id, es_id)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert token into event set") done: diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 451a1a8..d079e71 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -218,7 +218,7 @@ H5Tcommit_async(const char *app_file, const char *app_func, unsigned app_line, h if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(FUNC, "*s*sIui*siiiii", app_file, app_func, app_line, loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIui*siiiii", app_file, app_func, app_line, loc_id, name, type_id, lcpl_id, tcpl_id, tapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -726,7 +726,7 @@ H5Topen_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, tapl_id, es_id)) < 0) { + H5ARG_TRACE7(__func__, "*s*sIui*sii", app_file, app_func, app_line, loc_id, name, tapl_id, es_id)) < 0) { /* clang-format on */ if (H5I_dec_app_ref_always_close(ret_value) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, H5I_INVALID_HID, diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index baedbf1..a61b003 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -1712,7 +1712,7 @@ H5VLattr_optional_op(const char *app_file, const char *app_func, unsigned app_li if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*!ii", app_file, app_func, app_line, attr_id, args, dxpl_id, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, attr_id, args, dxpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -2556,7 +2556,7 @@ H5VLdataset_optional_op(const char *app_file, const char *app_func, unsigned app if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*!ii", app_file, app_func, app_line, dset_id, args, dxpl_id, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, dset_id, args, dxpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -3259,7 +3259,7 @@ H5VLdatatype_optional_op(const char *app_file, const char *app_func, unsigned ap if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*!ii", app_file, app_func, app_line, type_id, args, dxpl_id, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, type_id, args, dxpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -4078,7 +4078,7 @@ H5VLfile_optional_op(const char *app_file, const char *app_func, unsigned app_li if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*!ii", app_file, app_func, app_line, file_id, args, dxpl_id, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, file_id, args, dxpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -4725,7 +4725,7 @@ H5VLgroup_optional_op(const char *app_file, const char *app_func, unsigned app_l if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(FUNC, "*s*sIui*!ii", app_file, app_func, app_line, group_id, args, dxpl_id, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIui*!ii", app_file, app_func, app_line, group_id, args, dxpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -5514,7 +5514,7 @@ H5VLlink_optional_op(const char *app_file, const char *app_func, unsigned app_li /* If a token was created, add the token to the event set */ if (NULL != token) /* clang-format off */ - if (H5ES_insert(es_id, vol_obj->connector, token, H5ARG_TRACE9(FUNC, "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id)) < 0) + if (H5ES_insert(es_id, vol_obj->connector, token, H5ARG_TRACE9(__func__, "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set") @@ -6093,7 +6093,7 @@ H5VLobject_optional_op(const char *app_file, const char *app_func, unsigned app_ /* If a token was created, add the token to the event set */ if (NULL != token) /* clang-format off */ - if (H5ES_insert(es_id, vol_obj->connector, token, H5ARG_TRACE9(FUNC, "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id)) < 0) + if (H5ES_insert(es_id, vol_obj->connector, token, H5ARG_TRACE9(__func__, "*s*sIui*si*!ii", app_file, app_func, app_line, loc_id, name, lapl_id, args, dxpl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_VOL, H5E_CANTINSERT, FAIL, "can't insert token into event set") diff --git a/src/H5private.h b/src/H5private.h index ed17d4c..13570db 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1747,15 +1747,6 @@ H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap); #define H5_COLON_SEPC ':' -/* Use FUNC to safely handle variations of C99 __func__ keyword handling */ -#ifdef H5_HAVE_C99_FUNC -#define FUNC __func__ -#elif defined(H5_HAVE_FUNCTION) -#define FUNC __FUNCTION__ -#else -#error "We need __func__ or __FUNCTION__ to test function names!" -#endif - /* * These macros check whether debugging has been requested for a certain * package at run-time. Code for debugging is conditionally compiled by @@ -1836,51 +1827,52 @@ extern char H5libhdf5_settings[]; /* embedded library information */ #define H5TRACE0(R, T) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T) + CALLTIME = H5_trace(NULL, __func__, T) #define H5TRACE1(R, T, A0) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0) #define H5TRACE2(R, T, A0, A1) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1) #define H5TRACE3(R, T, A0, A1, A2) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2) #define H5TRACE4(R, T, A0, A1, A2, A3) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3) #define H5TRACE5(R, T, A0, A1, A2, A3, A4) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4) #define H5TRACE6(R, T, A0, A1, A2, A3, A4, A5) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5) #define H5TRACE7(R, T, A0, A1, A2, A3, A4, A5, A6) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6) #define H5TRACE8(R, T, A0, A1, A2, A3, A4, A5, A6, A7) \ - RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7) + RTYPE = R; \ + CALLTIME = \ + H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, A7) #define H5TRACE9(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \ - A7, #A8, A8) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \ + #A7, A7, #A8, A8) #define H5TRACE10(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \ - A7, #A8, A8, #A9, A9) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \ + #A7, A7, #A8, A8, #A9, A9) #define H5TRACE11(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \ - A7, #A8, A8, #A9, A9, #A10, A10) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \ + #A7, A7, #A8, A8, #A9, A9, #A10, A10) #define H5TRACE12(R, T, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) \ RTYPE = R; \ - CALLTIME = H5_trace(NULL, FUNC, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, #A7, \ - A7, #A8, A8, #A9, A9, #A10, A10, #A11, A11) + CALLTIME = H5_trace(NULL, __func__, T, #A0, A0, #A1, A1, #A2, A2, #A3, A3, #A4, A4, #A5, A5, #A6, A6, \ + #A7, A7, #A8, A8, #A9, A9, #A10, A10, #A11, A11) #define H5TRACE_RETURN(V) \ if (RTYPE) { \ - H5_trace(&CALLTIME, FUNC, RTYPE, NULL, V); \ + H5_trace(&CALLTIME, __func__, RTYPE, NULL, V); \ RTYPE = NULL; \ } #else @@ -2136,7 +2128,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); #define FUNC_ENTER_API_COMMON \ FUNC_ENTER_API_VARS \ - FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON(H5_IS_API(__func__)); \ FUNC_ENTER_API_THREADSAFE; #define FUNC_ENTER_API_INIT(err) \ @@ -2211,7 +2203,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); { \ { \ FUNC_ENTER_API_VARS \ - FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON_NOERR(H5_IS_API(__func__)); \ FUNC_ENTER_API_THREADSAFE; \ BEGIN_MPE_LOG \ { @@ -2228,7 +2220,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); { \ { \ { \ - FUNC_ENTER_COMMON(H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON(H5_IS_API(__func__)); \ FUNC_ENTER_API_THREADSAFE; \ FUNC_ENTER_API_INIT(err); \ { @@ -2247,7 +2239,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); { \ { \ { \ - FUNC_ENTER_COMMON_NOERR(H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON_NOERR(H5_IS_API(__func__)); \ { /* Note: this macro only works when there's _no_ interface initialization routine for the module */ @@ -2261,14 +2253,14 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); /* Use this macro for all "normal" non-API functions */ #define FUNC_ENTER_NOAPI(err) \ { \ - FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \ FUNC_ENTER_NOAPI_INIT(err) \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* Use this macro for all non-API functions, which propagate errors, but don't issue them */ #define FUNC_ENTER_NOAPI_NOERR \ { \ - FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); \ FUNC_ENTER_NOAPI_INIT(-) \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2282,7 +2274,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); */ #define FUNC_ENTER_NOAPI_NOINIT \ { \ - FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \ H5_PUSH_FUNC \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2297,7 +2289,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); */ #define FUNC_ENTER_NOAPI_NOINIT_NOERR \ { \ - FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); \ H5_PUSH_FUNC \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2309,7 +2301,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); */ #define FUNC_ENTER_NOAPI_NOFS \ { \ - FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \ \ /* Initialize the package, if appropriate */ \ H5_PACKAGE_INIT(H5_MY_PKG_INIT, err) \ @@ -2326,7 +2318,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); */ #define FUNC_ENTER_NOAPI_NOERR_NOFS \ { \ - FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* @@ -2338,7 +2330,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); */ #define FUNC_ENTER_NOAPI_NAMECHECK_ONLY \ { \ - FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); + FUNC_ENTER_COMMON_NOERR(!H5_IS_API(__func__)); /* Use the following two macros as replacements for the FUNC_ENTER_NOAPI * and FUNC_ENTER_NOAPI_NOINIT macros when the function needs to set @@ -2347,7 +2339,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); { \ haddr_t prev_tag = HADDR_UNDEF; \ \ - FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \ H5AC_tag(tag, &prev_tag); \ FUNC_ENTER_NOAPI_INIT(err) \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2356,7 +2348,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); { \ haddr_t prev_tag = HADDR_UNDEF; \ \ - FUNC_ENTER_COMMON(!H5_IS_API(FUNC)); \ + FUNC_ENTER_COMMON(!H5_IS_API(__func__)); \ H5AC_tag(tag, &prev_tag); \ H5_PUSH_FUNC \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2364,14 +2356,14 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); /* Use this macro for all "normal" package-level functions */ #define FUNC_ENTER_PACKAGE \ { \ - FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \ H5_PUSH_FUNC \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* Use this macro for package-level functions which propgate errors, but don't issue them */ #define FUNC_ENTER_PACKAGE_NOERR \ { \ - FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ + FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); \ H5_PUSH_FUNC \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2381,7 +2373,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); { \ haddr_t prev_tag = HADDR_UNDEF; \ \ - FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \ H5AC_tag(tag, &prev_tag); \ H5_PUSH_FUNC \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2389,14 +2381,14 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); /* Use this macro for all "normal" staticly-scoped functions */ #define FUNC_ENTER_STATIC \ { \ - FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \ H5_PUSH_FUNC \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* Use this macro for staticly-scoped functions which propgate errors, but don't issue them */ #define FUNC_ENTER_STATIC_NOERR \ { \ - FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ + FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); \ H5_PUSH_FUNC \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { @@ -2404,7 +2396,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); /* And that shouldn't push their name on the function stack */ #define FUNC_ENTER_STATIC_NOERR_NOFS \ { \ - FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ + FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { /* @@ -2416,7 +2408,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); */ #define FUNC_ENTER_STATIC_NAMECHECK_ONLY \ { \ - FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); + FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(__func__)); /* Use the following macro as replacement for the FUNC_ENTER_STATIC * macro when the function needs to set up a metadata tag. */ @@ -2424,7 +2416,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); { \ haddr_t prev_tag = HADDR_UNDEF; \ \ - FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + FUNC_ENTER_COMMON(H5_IS_PKG(__func__)); \ H5AC_tag(tag, &prev_tag); \ H5_PUSH_FUNC \ if (H5_PKG_INIT_VAR || !H5_TERM_GLOBAL) { diff --git a/test/cache.c b/test/cache.c index 78e902c..6ded559 100644 --- a/test/cache.c +++ b/test/cache.c @@ -280,17 +280,17 @@ smoke_check_1(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -308,7 +308,7 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -326,7 +326,7 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -344,7 +344,7 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -354,7 +354,7 @@ smoke_check_1(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -367,7 +367,7 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -377,7 +377,7 @@ smoke_check_1(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -390,12 +390,12 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -409,7 +409,7 @@ smoke_check_1(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -478,17 +478,17 @@ smoke_check_2(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -506,7 +506,7 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -524,7 +524,7 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -542,7 +542,7 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -552,7 +552,7 @@ smoke_check_2(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -565,7 +565,7 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -575,7 +575,7 @@ smoke_check_2(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -588,12 +588,12 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -607,7 +607,7 @@ smoke_check_2(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -675,17 +675,17 @@ smoke_check_3(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -703,7 +703,7 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -721,7 +721,7 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -739,7 +739,7 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -749,7 +749,7 @@ smoke_check_3(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -762,7 +762,7 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -772,7 +772,7 @@ smoke_check_3(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -785,12 +785,12 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -804,7 +804,7 @@ smoke_check_3(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -873,17 +873,17 @@ smoke_check_4(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -901,7 +901,7 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -919,7 +919,7 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -937,7 +937,7 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -947,7 +947,7 @@ smoke_check_4(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -960,7 +960,7 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -970,7 +970,7 @@ smoke_check_4(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -983,12 +983,12 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1002,7 +1002,7 @@ smoke_check_4(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -1116,12 +1116,12 @@ smoke_check_5(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -1138,7 +1138,7 @@ smoke_check_5(int express_test, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1149,7 +1149,7 @@ smoke_check_5(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1160,7 +1160,7 @@ smoke_check_5(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1171,7 +1171,7 @@ smoke_check_5(int express_test, unsigned paged) /* do_inserts */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1181,7 +1181,7 @@ smoke_check_5(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1193,7 +1193,7 @@ smoke_check_5(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1203,7 +1203,7 @@ smoke_check_5(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1215,12 +1215,12 @@ smoke_check_5(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1234,7 +1234,7 @@ smoke_check_5(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -1348,12 +1348,12 @@ smoke_check_6(int express_test, unsigned paged) } if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -1370,7 +1370,7 @@ smoke_check_6(int express_test, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1381,7 +1381,7 @@ smoke_check_6(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1392,7 +1392,7 @@ smoke_check_6(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1403,7 +1403,7 @@ smoke_check_6(int express_test, unsigned paged) /* do_inserts */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1413,7 +1413,7 @@ smoke_check_6(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1425,7 +1425,7 @@ smoke_check_6(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1435,7 +1435,7 @@ smoke_check_6(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1447,12 +1447,12 @@ smoke_check_6(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1466,7 +1466,7 @@ smoke_check_6(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -1581,12 +1581,12 @@ smoke_check_7(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -1603,7 +1603,7 @@ smoke_check_7(int express_test, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1614,7 +1614,7 @@ smoke_check_7(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1625,7 +1625,7 @@ smoke_check_7(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1636,7 +1636,7 @@ smoke_check_7(int express_test, unsigned paged) /* do_inserts */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1646,7 +1646,7 @@ smoke_check_7(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1658,7 +1658,7 @@ smoke_check_7(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1668,7 +1668,7 @@ smoke_check_7(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1680,12 +1680,12 @@ smoke_check_7(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1699,7 +1699,7 @@ smoke_check_7(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -1814,12 +1814,12 @@ smoke_check_8(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -1836,7 +1836,7 @@ smoke_check_8(int express_test, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1847,7 +1847,7 @@ smoke_check_8(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1858,7 +1858,7 @@ smoke_check_8(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1869,7 +1869,7 @@ smoke_check_8(int express_test, unsigned paged) /* do_inserts */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1879,7 +1879,7 @@ smoke_check_8(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1891,7 +1891,7 @@ smoke_check_8(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1901,7 +1901,7 @@ smoke_check_8(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1913,12 +1913,12 @@ smoke_check_8(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1932,7 +1932,7 @@ smoke_check_8(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -2011,12 +2011,12 @@ smoke_check_9(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -2024,7 +2024,7 @@ smoke_check_9(int express_test, unsigned paged) /* disable evictions */ if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2038,7 +2038,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2058,7 +2059,7 @@ smoke_check_9(int express_test, unsigned paged) /* enable evictions */ if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2072,7 +2073,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", __func__, mile_stone++, + (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2090,7 +2092,7 @@ smoke_check_9(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2104,7 +2106,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled \n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled \n", __func__, mile_stone++, + (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2122,7 +2125,7 @@ smoke_check_9(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2136,7 +2139,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", __func__, mile_stone++, + (int)pass); /* flush and destroy all entries in the cache: */ @@ -2146,7 +2150,7 @@ smoke_check_9(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2160,7 +2164,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 12 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2173,7 +2178,7 @@ smoke_check_9(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 13 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -2183,7 +2188,7 @@ smoke_check_9(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 14 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2197,7 +2202,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 15 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2210,7 +2216,7 @@ smoke_check_9(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 16 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2224,12 +2230,13 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 17 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 18 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -2243,7 +2250,7 @@ smoke_check_9(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -2322,18 +2329,19 @@ smoke_check_10(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged); cache_ptr = file_ptr->shared->cache; if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2351,7 +2359,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2365,7 +2373,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2383,7 +2392,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2397,7 +2406,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2415,7 +2425,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2429,7 +2439,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); /* flush and destroy all entries in the cache: */ @@ -2439,7 +2450,7 @@ smoke_check_10(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2453,7 +2464,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2466,7 +2478,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 12 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2480,7 +2492,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 13 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); /* flush all entries in the cache: */ @@ -2490,7 +2503,7 @@ smoke_check_10(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 14 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2504,7 +2517,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 15 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2517,7 +2531,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 16 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2531,12 +2545,13 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 17 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 18 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -2550,7 +2565,7 @@ smoke_check_10(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -2625,17 +2640,17 @@ write_permitted_check(int pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(1 * 1024 * 1024), (size_t)0, paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2653,7 +2668,7 @@ write_permitted_check(int /* dirty_unprotects */ TRUE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); write_permitted = FALSE; @@ -2673,7 +2688,7 @@ write_permitted_check(int /* dirty_unprotects */ NO_CHANGE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); write_permitted = TRUE; @@ -2693,7 +2708,7 @@ write_permitted_check(int /* dirty_unprotects */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -2703,7 +2718,7 @@ write_permitted_check(int /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2716,7 +2731,7 @@ write_permitted_check(int /* dirty_unprotects */ TRUE); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); write_permitted = FALSE; @@ -2733,12 +2748,12 @@ write_permitted_check(int write_permitted = TRUE; if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -2752,7 +2767,7 @@ write_permitted_check(int if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } #else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ @@ -3046,7 +3061,7 @@ check_insert_entry(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -3135,7 +3150,7 @@ check_flush_cache(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -12673,7 +12688,7 @@ check_get_entry_status(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -12954,7 +12969,7 @@ check_expunge_entry(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -13345,7 +13360,7 @@ check_multiple_read_protect(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -13445,7 +13460,7 @@ check_move_entry(unsigned paged) H5_FAILED() if (!pass) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); return (unsigned)!pass; } /* check_move_entry() */ @@ -13703,7 +13718,7 @@ check_pin_protected_entry(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -14571,7 +14586,7 @@ check_resize_entry(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -14656,7 +14671,7 @@ check_evictions_enabled(unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* create the cache */ if (pass) { @@ -14678,7 +14693,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that it is empty */ if (pass) { @@ -14694,7 +14709,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that H5C_get_evictions_enabled() returns the expected value */ if (pass) { @@ -14710,7 +14725,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14722,7 +14737,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that the cache is full */ if (pass) { @@ -14738,7 +14753,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14748,7 +14763,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that an entry has been evicted */ if (pass) { @@ -14764,7 +14779,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14794,7 +14809,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14803,7 +14818,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that another entry has been evicted */ if (pass) { @@ -14820,7 +14835,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14850,7 +14865,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 12 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* disable evictions */ if (pass) { @@ -14866,7 +14881,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 13 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that evictions are disabled */ if (pass) { @@ -14883,7 +14898,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 14 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14893,7 +14908,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 15 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that no entry has been evicted */ if (pass) { @@ -14910,7 +14925,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 16 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14919,7 +14934,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 17 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that no entry has been evicted */ if (pass) { @@ -14936,7 +14951,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 18 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* re-enable evictions */ if (pass) { @@ -14952,7 +14967,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 19 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14962,7 +14977,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 20 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that no entries have been evicted */ if (pass) { @@ -14979,7 +14994,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 21 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14989,7 +15004,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 22 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that the entries have been evicted to bring the * cache back down to its normal size. @@ -15009,7 +15024,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 23 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15039,7 +15054,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 24 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15069,7 +15084,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 25 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* disable evictions again */ if (pass) { @@ -15085,7 +15100,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 26 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15097,7 +15112,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 27 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that the cache has grown */ if (pass) { @@ -15114,7 +15129,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 28 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* re-enable evictions again */ if (pass) { @@ -15130,7 +15145,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 29 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15139,7 +15154,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 30 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that the cache has returned to its maximum size */ if (pass) { @@ -15156,7 +15171,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 31 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15186,7 +15201,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 32 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* disable evictions one last time before we shut down */ if (pass) { @@ -15202,7 +15217,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 33 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15210,7 +15225,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 34 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { PASSED(); @@ -15221,7 +15236,7 @@ check_evictions_enabled(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15319,7 +15334,7 @@ check_flush_protected_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15408,7 +15423,7 @@ check_destroy_pinned_err(unsigned paged) } if (!pass) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); return (unsigned)!pass; @@ -15504,7 +15519,7 @@ check_destroy_protected_err(unsigned paged) } if (!pass) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); return (unsigned)!pass; @@ -15585,7 +15600,7 @@ check_duplicate_insert_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15674,7 +15689,7 @@ check_double_pin_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15772,7 +15787,7 @@ check_double_unpin_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15884,7 +15899,7 @@ check_pin_entry_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15966,7 +15981,7 @@ check_double_protect_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16044,7 +16059,7 @@ check_double_unprotect_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16126,7 +16141,7 @@ check_mark_entry_dirty_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16243,7 +16258,7 @@ check_expunge_entry_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16360,7 +16375,7 @@ check_move_entry_errs(unsigned paged) else { H5_FAILED() - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } /* end else */ return (unsigned)!pass; @@ -16460,7 +16475,7 @@ check_resize_entry_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16581,7 +16596,7 @@ check_unprotect_ro_dirty_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16668,7 +16683,7 @@ check_protect_ro_rw_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16797,7 +16812,7 @@ check_protect_retries(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_msg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_msg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16937,7 +16952,7 @@ check_check_evictions_enabled_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -20803,7 +20818,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) } /* end else */ if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return (unsigned)!pass; } /* check_auto_cache_resize() */ @@ -23403,7 +23418,7 @@ check_auto_cache_resize_disable(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -24090,7 +24105,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -26322,7 +26337,7 @@ check_auto_cache_resize_input_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -26818,7 +26833,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -27048,7 +27063,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } /* end else */ if (show_progress) /* 0 */ - HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27069,7 +27084,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 1 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -27132,7 +27147,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 2 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -27202,7 +27217,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27256,7 +27271,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 4 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27309,7 +27324,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 5 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -27384,7 +27399,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 6 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27455,7 +27470,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 7 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -27514,7 +27529,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 8 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27562,7 +27577,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 9 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27613,7 +27628,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 10 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27659,7 +27674,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 11 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (cache_ptr) { @@ -27669,7 +27684,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 12 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { PASSED(); @@ -33629,7 +33644,7 @@ check_entry_deletions_during_scans(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -35040,7 +35055,7 @@ check_stats(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } #else /* H5C_COLLECT_CACHE_STATS */ @@ -35520,7 +35535,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) hid_t fcpl_id = H5P_DEFAULT; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); saved_fid = -1; @@ -35563,7 +35578,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) } if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass && try_core_file_driver) { if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == FAIL) { @@ -35580,7 +35595,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) core_file_driver_failed = TRUE; if (verbose) - HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC); + HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", __func__); } else { saved_fapl_id = fapl_id; @@ -35588,7 +35603,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* if we either aren't using the core file driver, or a create * with the core file driver failed, try again with a regular file. @@ -35603,7 +35618,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "H5Fcreate() failed."; if (verbose) - HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5Fcreate() failed.\n", __func__); } /* end if */ } /* end if */ @@ -35611,7 +35626,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) H5CX_push(); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { HDassert(fid >= 0); @@ -35621,7 +35636,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "H5Fflush() failed."; if (verbose) - HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5Fflush() failed.\n", __func__); } else { file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE); @@ -35630,13 +35645,13 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "Can't get file_ptr."; if (verbose) - HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5Fflush() failed.\n", __func__); } } } if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -35679,7 +35694,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) } if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { if (cache_ptr == NULL) { @@ -35687,19 +35702,19 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "H5C_create() failed."; if (verbose) - HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5C_create() failed.\n", __func__); } else if (cache_ptr->magic != H5C__H5C_T_MAGIC) { pass = FALSE; failure_mssg = "Bad cache_ptr magic."; if (verbose) - HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC); + HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", __func__); } } if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { /* allocate space for test entries */ actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); @@ -35709,7 +35724,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "H5MF_alloc() failed."; if (verbose) - HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", __func__); } else if (actual_base_addr > BASE_ADDR) { /* If this happens, must increase BASE_ADDR so that the @@ -35720,14 +35735,14 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "actual_base_addr > BASE_ADDR"; if (verbose) - HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", FUNC); + HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", __func__); } saved_actual_base_addr = actual_base_addr; } if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { /* Need to set this else all cache tests will fail */ @@ -35738,7 +35753,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) } if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); return (ret_val); } /* setup_cache() */ diff --git a/test/cache_api.c b/test/cache_api.c index 5d0f395..7858c65 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -478,7 +478,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -821,7 +821,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -1463,7 +1463,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -1841,7 +1841,7 @@ check_fapl_mdc_api_errs(void) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -1894,7 +1894,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: calling h5_fixname().\n", FUNC); + HDfprintf(stdout, "%s: calling h5_fixname().\n", __func__); } if (h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) == NULL) { @@ -1908,7 +1908,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: calling H5Fcreate().\n", FUNC); + HDfprintf(stdout, "%s: calling H5Fcreate().\n", __func__); } file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT); @@ -1929,7 +1929,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", __func__); } H5E_BEGIN_TRY @@ -1949,7 +1949,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", __func__); } H5E_BEGIN_TRY @@ -1970,7 +1970,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", __func__); } H5E_BEGIN_TRY @@ -1993,7 +1993,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", __func__); } H5E_BEGIN_TRY @@ -2013,7 +2013,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", __func__); } H5E_BEGIN_TRY @@ -2033,7 +2033,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) while ((pass) && (i < NUM_INVALID_CONFIGS)) { if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fset_mdc_config() with invalid config %d.\n", FUNC, i); + HDfprintf(stdout, "%s: testing H5Fset_mdc_config() with invalid config %d.\n", __func__, i); } H5E_BEGIN_TRY @@ -2061,7 +2061,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n", __func__); } H5E_BEGIN_TRY @@ -2081,7 +2081,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n", __func__); } H5E_BEGIN_TRY @@ -2102,7 +2102,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n", FUNC); + HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n", __func__); } H5E_BEGIN_TRY @@ -2123,7 +2123,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", __func__); } H5E_BEGIN_TRY @@ -2143,7 +2143,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", __func__); } if ((H5Fget_mdc_size(file_id, &max_size, NULL, NULL, NULL) < 0) || @@ -2162,7 +2162,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: cleaning up from tests.\n", FUNC); + HDfprintf(stdout, "%s: cleaning up from tests.\n", __func__); } if (H5Fclose(file_id) < 0) { @@ -2188,7 +2188,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -2230,26 +2230,26 @@ main(void) invalid_configs = init_invalid_configs(); if (NULL == invalid_configs) { failure_mssg = "Unable to allocate memory for invalid configs."; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) { failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n"; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ /* Set file space strategy to default or paged aggregation strategy */ if ((fcpl2_id = H5Pcopy(fcpl_id)) < 0) { failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n"; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ if (H5Pset_file_space_strategy(fcpl2_id, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) < 0) { failure_mssg = "H5Pset_file_space_strategy() failed.\n"; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ @@ -2282,7 +2282,7 @@ main(void) if (H5Pclose(fcpl_id) < 0) { failure_mssg = "H5Pclose() failed.\n"; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ diff --git a/test/cache_common.c b/test/cache_common.c index 0ddcbb8..07c70f0 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -2770,7 +2770,7 @@ flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_ if (verbose) { - HDfprintf(stdout, "%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n", FUNC, + HDfprintf(stdout, "%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n", __func__, (long long)(cache_ptr->index_len), (long long)(cache_ptr->index_size), (long long)(cache_ptr->clean_index_size), (long long)(cache_ptr->dirty_index_size)); } @@ -3524,7 +3524,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s(): entering.\n", FUNC); + HDfprintf(stdout, "%s(): entering.\n", __func__); if (pass) { cache_ptr = file_ptr->shared->cache; @@ -3856,7 +3856,7 @@ hl_row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s(): entering.\n", FUNC); + HDfprintf(stdout, "%s(): entering.\n", __func__); if (pass) { @@ -3948,7 +3948,7 @@ row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s(): Entering.\n", FUNC); + HDfprintf(stdout, "%s(): Entering.\n", __func__); if (pass) { @@ -4208,7 +4208,7 @@ hl_row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s(): entering.\n", FUNC); + HDfprintf(stdout, "%s(): entering.\n", __func__); if (pass) { @@ -4299,7 +4299,7 @@ col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t int32_t local_max_index[NUMBER_OF_ENTRY_TYPES]; if (verbose) - HDfprintf(stdout, "%s: entering.\n", FUNC); + HDfprintf(stdout, "%s: entering.\n", __func__); if (pass) { int i; @@ -4393,7 +4393,7 @@ hl_col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s: entering.\n", FUNC); + HDfprintf(stdout, "%s: entering.\n", __func__); if (pass) { @@ -4495,7 +4495,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t int32_t local_max_index[NUMBER_OF_ENTRY_TYPES] = {0}; if (verbose) - HDfprintf(stdout, "%s: entering.\n", FUNC); + HDfprintf(stdout, "%s: entering.\n", __func__); if (pass) { int i; @@ -4518,7 +4518,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t idx = local_max_index[NUMBER_OF_ENTRY_TYPES - 1] + lag; if (verbose) /* 1 */ - HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++); + HDfprintf(stdout, "%s: point %d.\n", __func__, mile_stone++); while ((pass) && ((idx + lag) >= 0)) { type = NUMBER_OF_ENTRY_TYPES - 1; @@ -4560,7 +4560,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t } if (verbose) /* 2 */ - HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++); + HDfprintf(stdout, "%s: point %d.\n", __func__, mile_stone++); if ((pass) && (display_stats)) { @@ -4568,7 +4568,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t } if (verbose) - HDfprintf(stdout, "%s: exiting.\n", FUNC); + HDfprintf(stdout, "%s: exiting.\n", __func__); } /* col_major_scan_backward() */ @@ -4600,7 +4600,7 @@ hl_col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, int32_t local_max_index = -1; if (verbose) - HDfprintf(stdout, "%s: entering.\n", FUNC); + HDfprintf(stdout, "%s: entering.\n", __func__); if (pass) { diff --git a/test/cache_image.c b/test/cache_image.c index 40d6f05..4967066 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -1473,7 +1473,7 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -1719,7 +1719,7 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -2093,7 +2093,7 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -2429,7 +2429,7 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -2718,7 +2718,7 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -2969,7 +2969,7 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -3418,7 +3418,7 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -3694,7 +3694,7 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -4082,7 +4082,7 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -4461,7 +4461,7 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; } /* cache_image_smoke_check_4() */ @@ -4965,7 +4965,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -5382,7 +5382,7 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -5738,7 +5738,7 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -6166,7 +6166,7 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -6421,7 +6421,7 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -6978,7 +6978,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -7436,7 +7436,7 @@ get_free_sections_test(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -7809,7 +7809,7 @@ evict_on_close_test(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; #endif /* H5_HAVE_PARALLEL */ diff --git a/test/h5test.h b/test/h5test.h index 89e30da..16fb33c 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -89,7 +89,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ /* * Print the current location on the standard output stream. */ -#define AT() HDprintf(" at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); +#define AT() HDprintf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); /* * The name of the test is printed by saying TESTING("something") which will diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 5840a98..b1ca00f 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -29,15 +29,6 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g; H5TOOLS_DLLVAR hid_t H5E_tools_min_info_id_g; H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; -/* Use FUNC to safely handle variations of C99 __func__ keyword handling */ -#ifdef H5_HAVE_C99_FUNC -#define FUNC __func__ -#elif defined(H5_HAVE_FUNCTION) -#define FUNC __FUNCTION__ -#else -#error "We need __func__ or __FUNCTION__ to test function names!" -#endif - /* * H5TOOLS_INIT_ERROR macro, used to initialize error reporting. */ @@ -105,7 +96,8 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; do { \ if (enable_error_stack > 0) { \ if (estack_id >= 0 && err_cls >= 0) \ - H5Epush2(estack_id, __FILE__, FUNC, __LINE__, err_cls, maj_err_id, min_err_id, __VA_ARGS__); \ + H5Epush2(estack_id, __FILE__, __func__, __LINE__, err_cls, maj_err_id, min_err_id, \ + __VA_ARGS__); \ else { \ HDfprintf(stderr, __VA_ARGS__); \ HDfprintf(stderr, "\n"); \ @@ -175,7 +167,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; #define H5TOOLS_START_DEBUG(...) \ do { \ H5tools_INDENT_g += 2; \ - HDfprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \ + HDfprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ HDfprintf(stderr, __VA_ARGS__); \ HDfprintf(stderr, "\n"); \ HDfflush(stderr); \ @@ -183,7 +175,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; #define H5TOOLS_DEBUG(...) \ do { \ - HDfprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \ + HDfprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ HDfprintf(stderr, __VA_ARGS__); \ HDfprintf(stderr, "\n"); \ HDfflush(stderr); \ @@ -191,7 +183,7 @@ H5TOOLS_DLLVAR hid_t H5E_tools_min_dbg_id_g; #define H5TOOLS_ENDDEBUG(...) \ do { \ - HDfprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \ + HDfprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, __func__); \ HDfprintf(stderr, __VA_ARGS__); \ HDfprintf(stderr, "\n"); \ H5tools_INDENT_g -= 2; \ diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 429ad42..6898839 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -513,21 +513,21 @@ gen_obj_ref(hid_t loc_id) * add dataset */ sid = H5Screate_simple(1, dims1, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } oid = H5Dcreate2(loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -539,7 +539,7 @@ gen_obj_ref(hid_t loc_id) * add group */ oid = H5Gcreate2(loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -547,34 +547,34 @@ gen_obj_ref(hid_t loc_id) status = H5Rcreate(&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Rcreate(&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } sid = H5Screate_simple(1, dims2, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } oid = H5Dcreate2(loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, or_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -613,7 +613,7 @@ gen_region_ref(hid_t loc_id) sid = H5Screate_simple(2, dims2, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -621,7 +621,7 @@ gen_region_ref(hid_t loc_id) /* create normal dataset which is refered */ oid2 = H5Dcreate2(loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid2 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -629,7 +629,7 @@ gen_region_ref(hid_t loc_id) /* write values to dataset */ status = H5Dwrite(oid2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -637,7 +637,7 @@ gen_region_ref(hid_t loc_id) /* select elements space for reference */ status = H5Sselect_elements(sid, H5S_SELECT_SET, 4, coords[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -645,7 +645,7 @@ gen_region_ref(hid_t loc_id) /* create region reference from elements space */ status = H5Rcreate(&rr_data[0], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -653,7 +653,7 @@ gen_region_ref(hid_t loc_id) /* select hyperslab space for reference */ status = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -661,7 +661,7 @@ gen_region_ref(hid_t loc_id) /* create region reference from hyperslab space */ status = H5Rcreate(&rr_data[1], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -671,7 +671,7 @@ gen_region_ref(hid_t loc_id) /* Create dataspace. */ sid = H5Screate_simple(1, dims1, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -679,7 +679,7 @@ gen_region_ref(hid_t loc_id) /* create region reference dataset */ oid1 = H5Dcreate2(loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid1 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -687,7 +687,7 @@ gen_region_ref(hid_t loc_id) /* write data as region references */ status = H5Dwrite(oid1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -816,7 +816,7 @@ gen_extlink_trg(hid_t loc_id) * target file */ gid = H5Gcreate2(loc_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -831,7 +831,7 @@ gen_extlink_trg(hid_t loc_id) tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(loc_id, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -864,7 +864,7 @@ gen_extlink_src(hid_t loc_id) *------------------------------------------------------------------------*/ gid = H5Gcreate2(loc_id, "/group_ext", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -875,7 +875,7 @@ gen_extlink_src(hid_t loc_id) /* link to dataset */ status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/simple", gid, "extlink_dset", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -883,7 +883,7 @@ gen_extlink_src(hid_t loc_id) /* link to group */ status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/group", gid, "extlink_grp", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -892,7 +892,7 @@ gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/datatype", gid, "extlink_datatype", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -900,7 +900,7 @@ gen_extlink_src(hid_t loc_id) /* dangling link - no obj*/ status = H5Lcreate_external(HDF_EXT_TRG_FILE, "notyet", gid, "extlink_notyet1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -908,7 +908,7 @@ gen_extlink_src(hid_t loc_id) /* dangling link - no file */ status = H5Lcreate_external("notyet_file.h5", "notyet", gid, "extlink_notyet2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", __func__, __LINE__); ret = FAIL; goto out; } diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index f03254e..118a3a7 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -112,7 +112,7 @@ size_t H5TOOLS_MALLOCSIZE = (128 * 1024 * 1024); #define SPACE1_DIM2 0 /* Error macros */ -#define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); +#define AT() HDprintf("ERROR at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); #define PROGRAM_ERROR \ do { \ AT(); \ diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index 3396217..acad74e 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -6058,7 +6058,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id) /* ref to dset */ status = H5Rcreate(&data_attr_objref[0], file_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6066,7 +6066,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id) /* ref to group */ status = H5Rcreate(&data_attr_objref[1], file_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6074,7 +6074,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id) /* ref to datatype */ status = H5Rcreate(&data_attr_objref[2], file_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6082,7 +6082,7 @@ add_attr_with_objref(hid_t file_id, hid_t obj_id) /* create attr with obj ref type */ status = make_attr(obj_id, 1, dim_attr_objref, "Attr_OBJREF", H5T_STD_REF_OBJ, data_attr_objref); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6122,7 +6122,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id) */ sid_regrefed_dset = H5Screate_simple(2, dim_regrefed_dset, NULL); if (sid_regrefed_dset < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6130,7 +6130,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id) /* select elements space for reference */ status = H5Sselect_elements(sid_regrefed_dset, H5S_SELECT_SET, (size_t)3, coords_regrefed_dset[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6138,7 +6138,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id) /* create region reference from elements space */ status = H5Rcreate(&data_attr_regref[0], file_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_regrefed_dset); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6146,7 +6146,7 @@ add_attr_with_regref(hid_t file_id, hid_t obj_id) /* create attr with region ref type */ status = make_attr(obj_id, 1, dim_attr_regref, "Attr_REGREF", H5T_STD_REF_DSETREG, data_attr_regref); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6191,21 +6191,21 @@ gen_refered_objs(hid_t loc_id) */ sid = H5Screate_simple(1, dims1, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } did1 = H5Dcreate2(loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (did1 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6216,7 +6216,7 @@ gen_refered_objs(hid_t loc_id) */ gid = H5Gcreate2(loc_id, NAME_OBJ_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6228,7 +6228,7 @@ gen_refered_objs(hid_t loc_id) tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6239,7 +6239,7 @@ gen_refered_objs(hid_t loc_id) */ sid2 = H5Screate_simple(2, dims2, NULL); if (sid2 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6247,7 +6247,7 @@ gen_refered_objs(hid_t loc_id) /* create normal dataset which is refered */ did2 = H5Dcreate2(loc_id, NAME_OBJ_DS2, H5T_STD_I8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (did2 < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6255,7 +6255,7 @@ gen_refered_objs(hid_t loc_id) /* write values to dataset */ status = H5Dwrite(did2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6311,7 +6311,7 @@ gen_obj_ref(hid_t loc_id) /* obj ref to dataset */ status = H5Rcreate(&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6319,7 +6319,7 @@ gen_obj_ref(hid_t loc_id) /* obj ref to group */ status = H5Rcreate(&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6327,7 +6327,7 @@ gen_obj_ref(hid_t loc_id) /* obj ref to named-datatype */ status = H5Rcreate(&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6337,21 +6337,21 @@ gen_obj_ref(hid_t loc_id) */ sid = H5Screate_simple(1, dims_dset_objref, NULL); if (sid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } oid = H5Dcreate2(loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, objref_buf); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6363,7 +6363,7 @@ gen_obj_ref(hid_t loc_id) /* add attribute with obj ref */ status = add_attr_with_objref(loc_id, oid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6371,7 +6371,7 @@ gen_obj_ref(hid_t loc_id) /* add attribute with region ref */ status = add_attr_with_regref(loc_id, oid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6423,7 +6423,7 @@ gen_region_ref(hid_t loc_id) sid_trg = H5Screate_simple(2, dims_trg, NULL); if (sid_trg < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6431,7 +6431,7 @@ gen_region_ref(hid_t loc_id) /* select elements space for reference */ status = H5Sselect_elements(sid_trg, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6439,7 +6439,7 @@ gen_region_ref(hid_t loc_id) /* create region reference from elements space */ status = H5Rcreate(&rr_data[0], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6447,7 +6447,7 @@ gen_region_ref(hid_t loc_id) /* select hyperslab space for reference */ status = H5Sselect_hyperslab(sid_trg, H5S_SELECT_SET, start, stride, count, block); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6455,7 +6455,7 @@ gen_region_ref(hid_t loc_id) /* create region reference from hyperslab space */ status = H5Rcreate(&rr_data[1], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6463,7 +6463,7 @@ gen_region_ref(hid_t loc_id) /* Create dataspace. */ sid_ref = H5Screate_simple(1, dims1, NULL); if (sid_ref < 0) { - HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6472,7 +6472,7 @@ gen_region_ref(hid_t loc_id) oid_ref = H5Dcreate2(loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid_ref, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid_ref < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6480,7 +6480,7 @@ gen_region_ref(hid_t loc_id) /* write data as region references */ status = H5Dwrite(oid_ref, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6492,7 +6492,7 @@ gen_region_ref(hid_t loc_id) /* add attribute with obj ref */ status = add_attr_with_objref(loc_id, oid_ref); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6500,7 +6500,7 @@ gen_region_ref(hid_t loc_id) /* add attribute with region ref */ status = add_attr_with_regref(loc_id, oid_ref); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6667,7 +6667,7 @@ make_complex_attr_references(hid_t loc_id) objdid = H5Dcreate2(loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, objsid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(objdid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6676,7 +6676,7 @@ make_complex_attr_references(hid_t loc_id) objtid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, objtid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6687,7 +6687,7 @@ make_complex_attr_references(hid_t loc_id) * compound type which contain obj and region reference */ main_gid = H5Gcreate2(loc_id, "group_main", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (main_gid < 0) { - HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6702,7 +6702,7 @@ make_complex_attr_references(hid_t loc_id) status = H5Dwrite(main_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6725,7 +6725,7 @@ make_complex_attr_references(hid_t loc_id) /* references to dataset */ status = H5Rcreate(&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6734,7 +6734,7 @@ make_complex_attr_references(hid_t loc_id) /* references to group */ status = H5Rcreate(&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6743,7 +6743,7 @@ make_complex_attr_references(hid_t loc_id) /* references to datatype */ status = H5Rcreate(&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6757,7 +6757,7 @@ make_complex_attr_references(hid_t loc_id) H5Acreate2(main_did, "Comp_OBJREF", comp_objref_tid, comp_objref_attr_sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(comp_objref_aid, comp_objref_tid, comp_objref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6778,13 +6778,13 @@ make_complex_attr_references(hid_t loc_id) */ status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Rcreate(&(comp_regref_data[0].val_regref), loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6798,7 +6798,7 @@ make_complex_attr_references(hid_t loc_id) H5Acreate2(main_did, "Comp_REGREF", comp_regref_tid, comp_regref_attr_sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(comp_regref_aid, comp_regref_tid, comp_regref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6823,7 +6823,7 @@ make_complex_attr_references(hid_t loc_id) status = H5Rcreate(&((hobj_ref_t *)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6831,7 +6831,7 @@ make_complex_attr_references(hid_t loc_id) status = H5Rcreate(&((hobj_ref_t *)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6839,7 +6839,7 @@ make_complex_attr_references(hid_t loc_id) status = H5Rcreate(&((hobj_ref_t *)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6857,7 +6857,7 @@ make_complex_attr_references(hid_t loc_id) H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(vlen_objref_attr_id, vlen_objref_attr_tid, vlen_objref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6865,7 +6865,7 @@ make_complex_attr_references(hid_t loc_id) /* close resource for vlen data */ status = H5Treclaim(vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6885,14 +6885,14 @@ make_complex_attr_references(hid_t loc_id) */ status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", __func__, __LINE__); ret = FAIL; goto out; } status = H5Rcreate(&((hdset_reg_ref_t *)vlen_regref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6910,7 +6910,7 @@ make_complex_attr_references(hid_t loc_id) H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(vlen_regref_attr_id, vlen_regref_attr_tid, vlen_regref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", __func__, __LINE__); ret = FAIL; goto out; } @@ -6918,7 +6918,7 @@ make_complex_attr_references(hid_t loc_id) /* close resource for vlen data */ status = H5Treclaim(vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data); if (status < 0) { - HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", __func__, __LINE__); ret = FAIL; goto out; } diff --git a/tools/test/misc/vds/UC_common.h b/tools/test/misc/vds/UC_common.h index bfa1ed9..d84d545 100644 --- a/tools/test/misc/vds/UC_common.h +++ b/tools/test/misc/vds/UC_common.h @@ -14,15 +14,6 @@ #ifndef USE_CASE_COMMON_H #define USE_CASE_COMMON_H -/* Use FUNC to safely handle variations of C99 __func__ keyword handling */ -#ifdef H5_HAVE_C99_FUNC -#define FUNC __func__ -#elif defined(H5_HAVE_FUNCTION) -#define FUNC __FUNCTION__ -#else -#error "We need __func__ or __FUNCTION__ to test function names!" -#endif - /****************************************** * Symbols used across multiple use cases * ******************************************/ @@ -41,7 +32,7 @@ #define FALSE 0 /* Testing macros */ -#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); +#define AT() printf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); #define UC_ERROR \ { \ puts("*ERROR*"); \ -- cgit v0.12 From 4ff544f9977da3bd54eac03cc124961eea7c4daf Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Mon, 28 Jun 2021 21:59:25 -0700 Subject: Cleans up POSIX/C bits in H5private.h (#804) * Cleans up POSIX/C bits in H5private.h * Assume difftime exists (C89) * Reorg AC_CHECK_HEADERS so headers are in alphabetical order * Split off networking-related AC_CHECK_HEADERS * Remove unused UNAME_CYGWIN from configure.ac * Remove checks for unused sys/timeb.h * Tidying pass over H5private.h HD prefix macros * Tidy H5win32defs.h * Add HD prefix to various scanf calls * Committing clang-format changes * Fixes to the alarm(2) code used in the tests to make Windows happy Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- config/cmake/ConfigureChecks.cmake | 2 - config/cmake/H5pubconf.h.in | 3 - configure.ac | 25 +- hl/test/test_ds.c | 6 +- hl/test/test_image.c | 24 +- java/src/jni/h5util.c | 26 +- src/H5private.h | 823 ++++++++++++++++++------------------ src/H5win32defs.h | 77 ++-- test/h5test.h | 6 +- test/testframe.c | 22 +- tools/src/h5import/h5import.c | 162 +++---- tools/src/h5repack/h5repack_main.c | 6 +- tools/test/h5jam/getub.c | 2 +- tools/test/perform/pio_standalone.h | 35 +- tools/test/perform/sio_standalone.h | 35 +- 15 files changed, 618 insertions(+), 636 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 87b2006..7baf77b 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -117,8 +117,6 @@ endif () # END of WINDOWS Hard code Values # ---------------------------------------------------------------------- -CHECK_FUNCTION_EXISTS (difftime ${HDF_PREFIX}_HAVE_DIFFTIME) - # Find the library containing clock_gettime() if (MINGW OR NOT WINDOWS) CHECK_FUNCTION_EXISTS (clock_gettime CLOCK_GETTIME_IN_LIBC) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index be366a8..051272b 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -114,9 +114,6 @@ /* Define if Darwin or Mac OS X */ #cmakedefine H5_HAVE_DARWIN @H5_HAVE_DARWIN@ -/* Define to 1 if you have the `difftime' function. */ -#cmakedefine H5_HAVE_DIFFTIME @H5_HAVE_DIFFTIME@ - /* Define if the direct I/O virtual file driver (VFD) should be compiled */ #cmakedefine H5_HAVE_DIRECT @H5_HAVE_DIRECT@ diff --git a/configure.ac b/configure.ac index dbeb968..3dd7328 100644 --- a/configure.ac +++ b/configure.ac @@ -1225,11 +1225,9 @@ AC_CHECK_LIB([dl], [dlopen]) ## ## Unix -AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h]) -AC_CHECK_HEADERS([sys/socket.h sys/types.h sys/file.h]) -AC_CHECK_HEADERS([features.h]) -AC_CHECK_HEADERS([dirent.h]) -AC_CHECK_HEADERS([netdb.h netinet/in.h arpa/inet.h]) +AC_CHECK_HEADERS([dirent.h features.h unistd.h]) +AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/resource.h]) +AC_CHECK_HEADERS([sys/stat.h sys/time.h sys/types.h]) ## Darwin AC_SUBST([H5_IS_DARWIN]) @@ -1242,20 +1240,17 @@ case $host_os in esac ## Windows +## The winsock header is needed for gethostname +AC_CHECK_HEADERS([winsock2.h]) case "`uname`" in - CYGWIN*) - AC_CHECK_HEADERS([sys/timeb.h]) - UNAME_CYGWIN="yes" - ;; MINGW*) - AC_CHECK_HEADERS([winsock2.h sys/timeb.h]) AC_HAVE_LIBRARY([ws2_32]) ;; - *) - AC_CHECK_HEADERS([winsock2.h sys/timeb.h]) - ;; esac +# Mirror VFD networking +AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h sys/socket.h]) + ## ---------------------------------------------------------------------- ## Some platforms require that all symbols are resolved when a library ## is linked. We can use the -no-undefined flag to tell libtool that @@ -2007,12 +2002,12 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ## NOTE: clock_gettime may require linking to the rt or posix4 library ## so we'll search for it before calling AC_CHECK_FUNCS. AC_SEARCH_LIBS([clock_gettime], [rt posix4]) -AC_CHECK_FUNCS([alarm clock_gettime difftime fcntl flock fork]) +AC_CHECK_FUNCS([alarm asprintf clock_gettime fcntl flock fork]) AC_CHECK_FUNCS([gethostname getrusage gettimeofday]) AC_CHECK_FUNCS([lstat rand_r random setsysinfo]) AC_CHECK_FUNCS([siglongjmp sigsetjmp sigprocmask]) AC_CHECK_FUNCS([srandom strdup symlink]) -AC_CHECK_FUNCS([tmpfile asprintf vasprintf waitpid]) +AC_CHECK_FUNCS([tmpfile vasprintf waitpid]) ## ---------------------------------------------------------------------- ## Check compiler characteristics diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 786aba8..8c6ef91 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -4964,12 +4964,12 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf) } for (i = 0, nelms = 1; i < ndims; i++) { - if (fscanf(f, "%s %u", str, &j) && HDferror(f)) { + if (HDfscanf(f, "%s %u", str, &j) && HDferror(f)) { HDprintf("fscanf error in file %s\n", data_file); HDfclose(f); return -1; } /* end if */ - if (fscanf(f, "%d", &n) < 0 && HDferror(f)) { + if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s\n", data_file); HDfclose(f); return -1; @@ -4987,7 +4987,7 @@ read_data(const char *fname, int ndims, hsize_t *dims, float **buf) } for (j = 0; j < nelms; j++) { - if (fscanf(f, "%f", &val) < 0 && HDferror(f)) { + if (HDfscanf(f, "%f", &val) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s\n", data_file); HDfclose(f); return -1; diff --git a/hl/test/test_image.c b/hl/test/test_image.c index dc1be96..81340c1 100644 --- a/hl/test/test_image.c +++ b/hl/test/test_image.c @@ -580,11 +580,11 @@ test_generate(void) ! */ - if (fscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) { + if (HDfscanf(f, "%d %d %d", &imax, &jmax, &kmax) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (fscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) { + if (HDfscanf(f, "%f %f %f", &valex, &xmin, &xmax) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -615,7 +615,7 @@ test_generate(void) goto out; for (i = 0; i < n_elements; i++) { - if (fscanf(f, "%f ", &value) < 0 && HDferror(f)) { + if (HDfscanf(f, "%f ", &value) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -779,32 +779,32 @@ read_data(const char *fname, /*IN*/ goto out; } - if (fscanf(f, "%s", str) < 0 && HDferror(f)) { + if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (fscanf(f, "%d", &color_planes) < 0 && HDferror(f)) { + if (HDfscanf(f, "%d", &color_planes) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (fscanf(f, "%s", str) < 0 && HDferror(f)) { + if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (fscanf(f, "%d", &h) < 0 && HDferror(f)) { + if (HDfscanf(f, "%d", &h) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (fscanf(f, "%s", str) < 0 && HDferror(f)) { + if (HDfscanf(f, "%s", str) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ - if (fscanf(f, "%d", &w) < 0 && HDferror(f)) { + if (HDfscanf(f, "%d", &w) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -838,7 +838,7 @@ read_data(const char *fname, /*IN*/ /* Read data elements */ for (i = 0; i < n_elements; i++) { - if (fscanf(f, "%d", &n) < 0 && HDferror(f)) { + if (HDfscanf(f, "%d", &n) < 0 && HDferror(f)) { HDprintf("fscanf error in file %s.\n", data_file); goto out; } /* end if */ @@ -936,7 +936,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size) return -1; } - if (sscanf(buffer, "%u", &nentries) != 1) { + if (HDsscanf(buffer, "%u", &nentries) != 1) { HDfclose(file); return -1; } @@ -950,7 +950,7 @@ read_palette(const char *fname, rgb_t *palette, size_t palette_size) /* read the palette entries */ for (u = 0; u < nentries; u++) { /* extract the red, green and blue color components. */ - if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3) { + if (HDfscanf(file, "%u %u %u", &red, &green, &blue) != 3) { HDfclose(file); return -1; } diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 6281481..8021438 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -225,7 +225,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ case sizeof(float): { float tmp_float = 0.0f; - sscanf(token, "%f", &tmp_float); + HDsscanf(token, "%f", &tmp_float); HDmemcpy(cptr, &tmp_float, sizeof(float)); break; } @@ -233,7 +233,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ case sizeof(double): { double tmp_double = 0.0; - sscanf(token, "%lf", &tmp_double); + HDsscanf(token, "%lf", &tmp_double); HDmemcpy(cptr, &tmp_double, sizeof(double)); break; } @@ -241,7 +241,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ case sizeof(long double): { long double tmp_ldouble = 0.0; - sscanf(token, "%Lg", &tmp_ldouble); + HDsscanf(token, "%Lg", &tmp_ldouble); HDmemcpy(cptr, &tmp_ldouble, sizeof(long double)); break; } @@ -289,11 +289,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ signed char tmp_char = 0; if (H5T_SGN_NONE == nsign) { - sscanf(token, "%hhu", &tmp_uchar); + HDsscanf(token, "%hhu", &tmp_uchar); HDmemcpy(cptr, &tmp_uchar, sizeof(unsigned char)); } else { - sscanf(token, "%hhd", &tmp_char); + HDsscanf(token, "%hhd", &tmp_char); HDmemcpy(cptr, &tmp_char, sizeof(char)); } @@ -305,11 +305,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ short tmp_short = 0; if (H5T_SGN_NONE == nsign) { - sscanf(token, "%hu", &tmp_ushort); + HDsscanf(token, "%hu", &tmp_ushort); HDmemcpy(&tmp_ushort, cptr, sizeof(unsigned short)); } else { - sscanf(token, "%hd", &tmp_short); + HDsscanf(token, "%hd", &tmp_short); HDmemcpy(&tmp_short, cptr, sizeof(short)); } @@ -321,11 +321,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ int tmp_int = 0; if (H5T_SGN_NONE == nsign) { - sscanf(token, "%u", &tmp_uint); + HDsscanf(token, "%u", &tmp_uint); HDmemcpy(cptr, &tmp_uint, sizeof(unsigned int)); } else { - sscanf(token, "%d", &tmp_int); + HDsscanf(token, "%d", &tmp_int); HDmemcpy(cptr, &tmp_int, sizeof(int)); } @@ -338,11 +338,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ long tmp_long = 0; if (H5T_SGN_NONE == nsign) { - sscanf(token, "%lu", &tmp_ulong); + HDsscanf(token, "%lu", &tmp_ulong); HDmemcpy(cptr, &tmp_ulong, sizeof(unsigned long)); } else { - sscanf(token, "%ld", &tmp_long); + HDsscanf(token, "%ld", &tmp_long); HDmemcpy(cptr, &tmp_long, sizeof(long)); } @@ -355,11 +355,11 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_ long long tmp_llong = 0; if (H5T_SGN_NONE == nsign) { - sscanf(token, fmt_ullong, &tmp_ullong); + HDsscanf(token, fmt_ullong, &tmp_ullong); HDmemcpy(cptr, &tmp_ullong, sizeof(unsigned long long)); } else { - sscanf(token, fmt_llong, &tmp_llong); + HDsscanf(token, fmt_llong, &tmp_llong); HDmemcpy(cptr, &tmp_llong, sizeof(long long)); } diff --git a/src/H5private.h b/src/H5private.h index 13570db..4bd0685 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -590,227 +590,231 @@ typedef struct { haddr_t addr; /* The unique address of the object's header in that file */ } H5_obj_t; -/* - * Redefine all the POSIX functions. We should never see a POSIX - * function (or any other non-HDF5 function) in the source! +#define H5_SIZEOF_H5_STAT_SIZE_T H5_SIZEOF_OFF_T + +/* Put all Windows-specific definitions in H5win32defs.h so we + * can (mostly) assume a POSIX platform. Not all of the POSIX calls + * will have a Windows equivalent so some #ifdef protection is still + * necessary (e.g., fork()). */ +#include "H5win32defs.h" -/* Put all platform-specific definitions in the following file */ -/* so that the following definitions are platform free. */ -#include "H5win32defs.h" /* For Windows-specific definitions */ +/* Platform-independent definitions for struct stat and off_t */ +#ifndef H5_HAVE_WIN32_API +/* These definitions differ in Windows and are defined in + * H5win32defs for that platform. + */ +typedef struct stat h5_stat_t; +typedef off_t h5_stat_size_t; +#define HDoff_t off_t +#endif + +#/* Redefine all the POSIX and C functions. We should never see an + * undecorated POSIX or C function (or any other non-HDF5 function) + * in the source. + */ #ifndef HDabort #define HDabort() abort() -#endif /* HDabort */ +#endif #ifndef HDabs #define HDabs(X) abs(X) -#endif /* HDabs */ +#endif #ifndef HDaccept -#define HDaccept(A, B, C) accept((A), (B), (C)) /* mirror VFD */ -#endif /* HDaccept */ +#define HDaccept(A, B, C) accept((A), (B), (C)) +#endif #ifndef HDaccess #define HDaccess(F, M) access(F, M) -#endif /* HDaccess */ +#endif #ifndef HDacos #define HDacos(X) acos(X) -#endif /* HDacos */ +#endif #ifndef HDalarm -#ifdef H5_HAVE_ALARM #define HDalarm(N) alarm(N) -#else /* H5_HAVE_ALARM */ -#define HDalarm(N) (0) -#endif /* H5_HAVE_ALARM */ -#endif /* HDalarm */ +#endif #ifndef HDasctime #define HDasctime(T) asctime(T) -#endif /* HDasctime */ +#endif #ifndef HDasin #define HDasin(X) asin(X) -#endif /* HDasin */ +#endif #ifndef HDasprintf #define HDasprintf asprintf /*varargs*/ -#endif /* HDasprintf */ +#endif #ifndef HDassert #define HDassert(X) assert(X) -#endif /* HDassert */ +#endif #ifndef HDatan #define HDatan(X) atan(X) -#endif /* HDatan */ +#endif #ifndef HDatan2 #define HDatan2(X, Y) atan2(X, Y) -#endif /* HDatan2 */ +#endif #ifndef HDatexit #define HDatexit(F) atexit(F) -#endif /* HDatexit */ +#endif #ifndef HDatof #define HDatof(S) atof(S) -#endif /* HDatof */ +#endif #ifndef HDatoi #define HDatoi(S) atoi(S) -#endif /* HDatoi */ +#endif #ifndef HDatol #define HDatol(S) atol(S) -#endif /* HDatol */ +#endif #ifndef HDatoll #define HDatoll(S) atoll(S) -#endif /* HDatol */ +#endif #ifndef HDbind -#define HDbind(A, B, C) bind((A), (B), (C)) /* mirror VFD */ -#endif /* HDbind */ +#define HDbind(A, B, C) bind((A), (B), (C)) +#endif #ifndef HDbsearch #define HDbsearch(K, B, N, Z, F) bsearch(K, B, N, Z, F) -#endif /* HDbsearch */ +#endif #ifndef HDcalloc #define HDcalloc(N, Z) calloc(N, Z) -#endif /* HDcalloc */ +#endif #ifndef HDceil #define HDceil(X) ceil(X) -#endif /* HDceil */ +#endif #ifndef HDcfgetispeed #define HDcfgetispeed(T) cfgetispeed(T) -#endif /* HDcfgetispeed */ +#endif #ifndef HDcfgetospeed #define HDcfgetospeed(T) cfgetospeed(T) -#endif /* HDcfgetospeed */ +#endif #ifndef HDcfsetispeed #define HDcfsetispeed(T, S) cfsetispeed(T, S) -#endif /* HDcfsetispeed */ +#endif #ifndef HDcfsetospeed #define HDcfsetospeed(T, S) cfsetospeed(T, S) -#endif /* HDcfsetospeed */ +#endif #ifndef HDchdir #define HDchdir(S) chdir(S) -#endif /* HDchdir */ +#endif #ifndef HDchmod #define HDchmod(S, M) chmod(S, M) -#endif /* HDchmod */ +#endif #ifndef HDchown #define HDchown(S, O, G) chown(S, O, G) -#endif /* HDchown */ +#endif #ifndef HDclearerr #define HDclearerr(F) clearerr(F) -#endif /* HDclearerr */ +#endif #ifndef HDclock #define HDclock() clock() -#endif /* HDclock */ +#endif #ifndef HDclock_gettime #define HDclock_gettime(CID, TS) clock_gettime(CID, TS) -#endif /* HDclock_gettime */ +#endif #ifndef HDclose #define HDclose(F) close(F) -#endif /* HDclose */ +#endif #ifndef HDclosedir #define HDclosedir(D) closedir(D) -#endif /* HDclosedir */ +#endif #ifndef HDconnect -#define HDconnect(A, B, C) connect((A), (B), (C)) /* mirror VFD */ -#endif /* HDconnect */ +#define HDconnect(A, B, C) connect((A), (B), (C)) +#endif #ifndef HDcos #define HDcos(X) cos(X) -#endif /* HDcos */ +#endif #ifndef HDcosh #define HDcosh(X) cosh(X) -#endif /* HDcosh */ +#endif #ifndef HDcreat #define HDcreat(S, M) creat(S, M) -#endif /* HDcreat */ +#endif #ifndef HDctermid #define HDctermid(S) ctermid(S) -#endif /* HDctermid */ +#endif #ifndef HDctime #define HDctime(T) ctime(T) -#endif /* HDctime */ +#endif #ifndef HDcuserid #define HDcuserid(S) cuserid(S) -#endif /* HDcuserid */ +#endif #ifndef HDdifftime -#ifdef H5_HAVE_DIFFTIME #define HDdifftime(X, Y) difftime(X, Y) -#else /* H5_HAVE_DIFFTIME */ -#define HDdifftime(X, Y) ((double)(X) - (double)(Y)) -#endif /* H5_HAVE_DIFFTIME */ -#endif /* HDdifftime */ +#endif #ifndef HDdiv #define HDdiv(X, Y) div(X, Y) -#endif /* HDdiv */ +#endif #ifndef HDdup #define HDdup(F) dup(F) -#endif /* HDdup */ +#endif #ifndef HDdup2 #define HDdup2(F, I) dup2(F, I) -#endif /* HDdup2 */ -/* execl() variable arguments */ -/* execle() variable arguments */ -/* execlp() variable arguments */ +#endif #ifndef HDexecv #define HDexecv(S, AV) execv(S, AV) -#endif /* HDexecv */ +#endif #ifndef HDexecve #define HDexecve(S, AV, E) execve(S, AV, E) -#endif /* HDexecve */ +#endif #ifndef HDexecvp #define HDexecvp(S, AV) execvp(S, AV) -#endif /* HDexecvp */ +#endif #ifndef HDexit #define HDexit(N) exit(N) -#endif /* HDexit */ +#endif #ifndef HD_exit #define HD_exit(N) _exit(N) -#endif /* HD_exit */ +#endif #ifndef HDexp #define HDexp(X) exp(X) -#endif /* HDexp */ +#endif #ifndef HDexp2 #define HDexp2(X) exp2(X) -#endif /* HDexp2 */ +#endif #ifndef HDfabs #define HDfabs(X) fabs(X) -#endif /* HDfabs */ +#endif #ifndef HDfabsf #define HDfabsf(X) fabsf(X) -#endif /* HDfabsf */ +#endif #ifndef HDfabsl #define HDfabsl(X) fabsl(X) -#endif /* HDfabsl */ +#endif #ifndef HDfclose #define HDfclose(F) fclose(F) -#endif /* HDfclose */ -#ifdef H5_HAVE_FCNTL +#endif #ifndef HDfcntl #define HDfcntl(F, C, ...) fcntl(F, C, __VA_ARGS__) -#endif /* HDfcntl */ -#endif /* H5_HAVE_FCNTL */ +#endif #ifndef HDfdopen #define HDfdopen(N, S) fdopen(N, S) -#endif /* HDfdopen */ +#endif #ifndef HDfeof #define HDfeof(F) feof(F) -#endif /* HDfeof */ +#endif #ifndef HDferror #define HDferror(F) ferror(F) -#endif /* HDferror */ +#endif #ifndef HDfflush #define HDfflush(F) fflush(F) -#endif /* HDfflush */ +#endif #ifndef HDfgetc #define HDfgetc(F) fgetc(F) -#endif /* HDfgetc */ +#endif #ifndef HDfgetpos #define HDfgetpos(F, P) fgetpos(F, P) -#endif /* HDfgetpos */ +#endif #ifndef HDfgets #define HDfgets(S, N, F) fgets(S, N, F) -#endif /* HDfgets */ +#endif #ifndef HDfileno #define HDfileno(F) fileno(F) -#endif /* HDfileno */ +#endif + /* Since flock is so prevalent, always build these functions * when possible to avoid them becoming dead code. */ #ifdef H5_HAVE_FCNTL H5_DLL int Pflock(int fd, int operation); -#endif /* H5_HAVE_FCNTL */ +#endif H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); + #ifndef HDflock /* NOTE: flock(2) is not present on all POSIX systems. * If it is not present, we try a flock() equivalent based on @@ -824,801 +828,800 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #define HDflock(F, L) Pflock(F, L) #else #define HDflock(F, L) Nflock(F, L) -#endif /* H5_HAVE_FLOCK */ +#endif + #endif /* HDflock */ + #ifndef HDfloor #define HDfloor(X) floor(X) -#endif /* HDfloor */ +#endif #ifndef HDfmod #define HDfmod(X, Y) fmod(X, Y) -#endif /* HDfmod */ +#endif #ifndef HDfopen #define HDfopen(S, M) fopen(S, M) -#endif /* HDfopen */ +#endif #ifndef HDfork #define HDfork() fork() -#endif /* HDfork */ +#endif #ifndef HDfprintf #define HDfprintf fprintf #endif #ifndef HDfpathconf #define HDfpathconf(F, N) fpathconf(F, N) -#endif /* HDfpathconf */ +#endif #ifndef HDfputc #define HDfputc(C, F) fputc(C, F) -#endif /* HDfputc */ +#endif #ifndef HDfputs #define HDfputs(S, F) fputs(S, F) -#endif /* HDfputs */ +#endif #ifndef HDfread #define HDfread(M, Z, N, F) fread(M, Z, N, F) -#endif /* HDfread */ +#endif #ifndef HDfree #define HDfree(M) free(M) -#endif /* HDfree */ +#endif #ifndef HDfreopen #define HDfreopen(S, M, F) freopen(S, M, F) -#endif /* HDfreopen */ +#endif #ifndef HDfrexp #define HDfrexp(X, N) frexp(X, N) -#endif /* HDfrexp */ +#endif #ifndef HDfrexpf #define HDfrexpf(X, N) frexpf(X, N) -#endif /* HDfrexpf */ +#endif #ifndef HDfrexpl #define HDfrexpl(X, N) frexpl(X, N) -#endif /* HDfrexpl */ -/* fscanf() variable arguments */ +#endif +#ifndef HDfscanf +#define HDfscanf fscanf +#endif #ifndef HDfseek #define HDfseek(F, O, W) fseeko(F, O, W) -#endif /* HDfseek */ +#endif #ifndef HDfsetpos #define HDfsetpos(F, P) fsetpos(F, P) -#endif /* HDfsetpos */ +#endif #ifndef HDfstat #define HDfstat(F, B) fstat(F, B) -#endif /* HDfstat */ -#ifndef HDlstat -#define HDlstat(S, B) lstat(S, B) -#endif /* HDlstat */ -#ifndef HDstat -#define HDstat(S, B) stat(S, B) -#endif /* HDstat */ - -#ifndef H5_HAVE_WIN32_API -/* These definitions differ in Windows and are defined in - * H5win32defs for that platform. - */ -typedef struct stat h5_stat_t; -typedef off_t h5_stat_size_t; -#define HDoff_t off_t -#endif /* H5_HAVE_WIN32_API */ - -#define H5_SIZEOF_H5_STAT_SIZE_T H5_SIZEOF_OFF_T - +#endif #ifndef HDftell #define HDftell(F) ftell(F) -#endif /* HDftell */ +#endif #ifndef HDftruncate #define HDftruncate(F, L) ftruncate(F, L) -#endif /* HDftruncate */ +#endif #ifndef HDfwrite #define HDfwrite(M, Z, N, F) fwrite(M, Z, N, F) -#endif /* HDfwrite */ +#endif #ifndef HDgetc #define HDgetc(F) getc(F) -#endif /* HDgetc */ +#endif #ifndef HDgetchar #define HDgetchar() getchar() -#endif /* HDgetchar */ +#endif #ifndef HDgetcwd #define HDgetcwd(S, Z) getcwd(S, Z) -#endif /* HDgetcwd */ +#endif #ifndef HDgetdcwd #define HDgetdcwd(D, S, Z) getcwd(S, Z) -#endif /* HDgetdcwd */ +#endif + +/* Windows only - set to zero on other systems */ #ifndef HDgetdrive #define HDgetdrive() 0 -#endif /* HDgetdrive */ +#endif + #ifndef HDgetegid #define HDgetegid() getegid() -#endif /* HDgetegid() */ +#endif #ifndef HDgetenv #define HDgetenv(S) getenv(S) -#endif /* HDgetenv */ +#endif #ifndef HDgeteuid #define HDgeteuid() geteuid() -#endif /* HDgeteuid */ +#endif #ifndef HDgetgid #define HDgetgid() getgid() -#endif /* HDgetgid */ +#endif #ifndef HDgetgrgid #define HDgetgrgid(G) getgrgid(G) -#endif /* HDgetgrgid */ +#endif #ifndef HDgetgrnam #define HDgetgrnam(S) getgrnam(S) -#endif /* HDgetgrnam */ +#endif #ifndef HDgetgroups #define HDgetgroups(Z, G) getgroups(Z, G) -#endif /* HDgetgroups */ +#endif #ifndef HDgethostbyaddr -#define HDgethostbyaddr(A, B, C) gethostbyaddr((A), (B), (C)) /* mirror VFD */ -#endif /* HDgethostbyaddr */ +#define HDgethostbyaddr(A, B, C) gethostbyaddr((A), (B), (C)) +#endif #ifndef HDgethostname #define HDgethostname(N, L) gethostname(N, L) -#endif /* HDgethostname */ +#endif #ifndef HDgetlogin #define HDgetlogin() getlogin() -#endif /* HDgetlogin */ +#endif #ifndef HDgetpgrp #define HDgetpgrp() getpgrp() -#endif /* HDgetpgrp */ +#endif #ifndef HDgetpid #define HDgetpid() getpid() -#endif /* HDgetpid */ +#endif #ifndef HDgetppid #define HDgetppid() getppid() -#endif /* HDgetppid */ +#endif #ifndef HDgetpwnam #define HDgetpwnam(S) getpwnam(S) -#endif /* HDgetpwnam */ +#endif #ifndef HDgetpwuid #define HDgetpwuid(U) getpwuid(U) -#endif /* HDgetpwuid */ +#endif #ifndef HDgetrusage #define HDgetrusage(X, S) getrusage(X, S) -#endif /* HDgetrusage */ +#endif /* Don't define HDgets - gets() was deprecated in C99 and removed in C11 */ #ifdef HDgets #undef HDgets -#endif /* HDgets */ +#endif #ifndef HDgettimeofday #define HDgettimeofday(S, P) gettimeofday(S, P) -#endif /* HDgettimeofday */ +#endif #ifndef HDgetuid #define HDgetuid() getuid() -#endif /* HDgetuid */ +#endif #ifndef HDgmtime #define HDgmtime(T) gmtime(T) -#endif /* HDgmtime */ +#endif #ifndef HDhtonl -#define HDhtonl(X) htonl((X)) /* mirror VFD */ -#endif /* HDhtonl */ +#define HDhtonl(X) htonl((X)) +#endif #ifndef HDhtons -#define HDhtons(X) htons((X)) /* mirror VFD */ -#endif /* HDhtons */ +#define HDhtons(X) htons((X)) +#endif #ifndef HDinet_addr -#define HDinet_addr(C) inet_addr((C)) /* mirror VFD */ -#endif /* HDinet_addr */ +#define HDinet_addr(C) inet_addr((C)) +#endif #ifndef HDinet_ntoa -#define HDinet_ntoa(C) inet_ntoa((C)) /* mirror VFD */ -#endif /* HDinet_ntoa */ +#define HDinet_ntoa(C) inet_ntoa((C)) +#endif #ifndef HDisalnum -#define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/ -#endif /* HDisalnum */ +#define HDisalnum(C) isalnum((int)(C)) /* Cast for Solaris warning */ +#endif #ifndef HDisalpha -#define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/ -#endif /* HDisalpha */ +#define HDisalpha(C) isalpha((int)(C)) /* Cast for Solaris warning */ +#endif #ifndef HDisatty #define HDisatty(F) isatty(F) -#endif /* HDisatty */ +#endif #ifndef HDiscntrl -#define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/ -#endif /* HDiscntrl */ +#define HDiscntrl(C) iscntrl((int)(C)) /* Cast for solaris warning */ +#endif #ifndef HDisdigit -#define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/ -#endif /* HDisdigit */ +#define HDisdigit(C) isdigit((int)(C)) /* Cast for Solaris warning */ +#endif #ifndef HDisgraph -#define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/ -#endif /* HDisgraph */ +#define HDisgraph(C) isgraph((int)(C)) /* Cast for Solaris warning*/ +#endif #ifndef HDislower -#define HDislower(C) islower((int)(C)) /*cast for solaris warning*/ -#endif /* HDislower */ +#define HDislower(C) islower((int)(C)) /* Cast for Solaris warning */ +#endif #ifndef HDisnan #define HDisnan(X) isnan(X) -#endif /* HDisnan */ +#endif #ifndef HDisprint -#define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/ -#endif /* HDisprint */ +#define HDisprint(C) isprint((int)(C)) /* Cast for Solaris warning */ +#endif #ifndef HDispunct -#define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/ -#endif /* HDispunct */ +#define HDispunct(C) ispunct((int)(C)) /* Cast for Solaris warning */ +#endif #ifndef HDisspace -#define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/ -#endif /* HDisspace */ +#define HDisspace(C) isspace((int)(C)) /* Cast for Solaris warning */ +#endif #ifndef HDisupper -#define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/ -#endif /* HDisupper */ +#define HDisupper(C) isupper((int)(C)) /* Cast for Solaris warning */ +#endif #ifndef HDisxdigit -#define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/ -#endif /* HDisxdigit */ +#define HDisxdigit(C) isxdigit((int)(C)) /* Cast for Solaris warning */ +#endif #ifndef HDkill #define HDkill(P, S) kill(P, S) -#endif /* HDkill */ +#endif #ifndef HDlabs #define HDlabs(X) labs(X) -#endif /* HDlabs */ +#endif #ifndef HDldexp #define HDldexp(X, N) ldexp(X, N) -#endif /* HDldexp */ +#endif #ifndef HDldiv #define HDldiv(X, Y) ldiv(X, Y) -#endif /* HDldiv */ +#endif #ifndef HDlink #define HDlink(OLD, NEW) link(OLD, NEW) -#endif /* HDlink */ +#endif #ifndef HDlisten -#define HDlisten(A, B) listen((A), (B)) /* mirror VFD */ -#endif /* HDlisten */ +#define HDlisten(A, B) listen((A), (B)) +#endif #ifndef HDllround #define HDllround(V) llround(V) -#endif /* HDround */ +#endif #ifndef HDllroundf #define HDllroundf(V) llroundf(V) -#endif /* HDllroundf */ +#endif #ifndef HDllroundl #define HDllroundl(V) llroundl(V) -#endif /* HDllroundl */ +#endif #ifndef HDlocaleconv #define HDlocaleconv() localeconv() -#endif /* HDlocaleconv */ +#endif #ifndef HDlocaltime #define HDlocaltime(T) localtime(T) -#endif /* HDlocaltime */ +#endif #ifndef HDlog #define HDlog(X) log(X) -#endif /* HDlog */ +#endif #ifndef HDlog10 #define HDlog10(X) log10(X) -#endif /* HDlog10 */ +#endif #ifndef HDlongjmp #define HDlongjmp(J, N) longjmp(J, N) -#endif /* HDlongjmp */ +#endif #ifndef HDlround #define HDlround(V) lround(V) -#endif /* HDround */ +#endif #ifndef HDlroundf #define HDlroundf(V) lroundf(V) -#endif /* HDlroundf */ +#endif #ifndef HDlroundl #define HDlroundl(V) lroundl(V) -#endif /* HDroundl */ +#endif #ifndef HDlseek #define HDlseek(F, O, W) lseek(F, O, W) -#endif /* HDlseek */ +#endif +#ifndef HDlstat +#define HDlstat(S, B) lstat(S, B) +#endif #ifndef HDmalloc #define HDmalloc(Z) malloc(Z) -#endif /* HDmalloc */ +#endif #ifndef HDposix_memalign #define HDposix_memalign(P, A, Z) posix_memalign(P, A, Z) -#endif /* HDposix_memalign */ +#endif #ifndef HDmblen #define HDmblen(S, N) mblen(S, N) -#endif /* HDmblen */ +#endif #ifndef HDmbstowcs #define HDmbstowcs(P, S, Z) mbstowcs(P, S, Z) -#endif /* HDmbstowcs */ +#endif #ifndef HDmbtowc #define HDmbtowc(P, S, Z) mbtowc(P, S, Z) -#endif /* HDmbtowc */ +#endif #ifndef HDmemchr #define HDmemchr(S, C, Z) memchr(S, C, Z) -#endif /* HDmemchr */ +#endif #ifndef HDmemcmp #define HDmemcmp(X, Y, Z) memcmp(X, Y, Z) -#endif /* HDmemcmp */ +#endif #ifndef HDmemcpy #define HDmemcpy(X, Y, Z) memcpy(X, Y, Z) -#endif /* HDmemcpy */ +#endif #ifndef HDmemmove #define HDmemmove(X, Y, Z) memmove((char *)(X), (const char *)(Y), Z) -#endif /* HDmemmove */ +#endif #ifndef HDmemset #define HDmemset(X, C, Z) memset(X, C, Z) -#endif /* HDmemset */ +#endif #ifndef HDmkdir #define HDmkdir(S, M) mkdir(S, M) -#endif /* HDmkdir */ +#endif #ifndef HDmkfifo #define HDmkfifo(S, M) mkfifo(S, M) -#endif /* HDmkfifo */ +#endif #ifndef HDmktime #define HDmktime(T) mktime(T) -#endif /* HDmktime */ +#endif #ifndef HDmodf #define HDmodf(X, Y) modf(X, Y) -#endif /* HDmodf */ +#endif #ifndef HDnanosleep #define HDnanosleep(N, O) nanosleep(N, O) -#endif /* HDnanosleep */ +#endif #ifndef HDntohl -#define HDntohl(A) ntohl((A)) /* mirror VFD */ -#endif /* HDntohl */ +#define HDntohl(A) ntohl((A)) +#endif #ifndef HDntohs -#define HDntohs(A) ntohs((A)) /* mirror VFD */ -#endif /* HDntohs */ +#define HDntohs(A) ntohs((A)) +#endif #ifndef HDopen #define HDopen(F, ...) open(F, __VA_ARGS__) -#endif /* HDopen */ +#endif #ifndef HDopendir #define HDopendir(S) opendir(S) -#endif /* HDopendir */ +#endif #ifndef HDpathconf #define HDpathconf(S, N) pathconf(S, N) -#endif /* HDpathconf */ +#endif #ifndef HDpause #define HDpause() pause() -#endif /* HDpause */ +#endif #ifndef HDperror #define HDperror(S) perror(S) -#endif /* HDperror */ +#endif #ifndef HDpipe #define HDpipe(F) pipe(F) -#endif /* HDpipe */ +#endif #ifndef HDpow #define HDpow(X, Y) pow(X, Y) -#endif /* HDpow */ +#endif #ifndef HDpowf #define HDpowf(X, Y) powf(X, Y) -#endif /* HDpowf */ +#endif #ifndef HDpread #define HDpread(F, B, C, O) pread(F, B, C, O) -#endif /* HDpread */ +#endif #ifndef HDprintf -#define HDprintf printf -#endif /* HDprintf */ +#define HDprintf printf /*varargs*/ +#endif #ifndef HDpthread_attr_destroy #define HDpthread_attr_destroy(A) pthread_attr_destroy(A) -#endif /* HDpthread_attr_destroy */ +#endif #ifndef HDpthread_attr_init #define HDpthread_attr_init(A) pthread_attr_init(A) -#endif /* HDpthread_attr_init */ +#endif #ifndef HDpthread_attr_setscope #define HDpthread_attr_setscope(A, S) pthread_attr_setscope(A, S) -#endif /* HDpthread_attr_setscope */ +#endif #ifndef HDpthread_cond_init #define HDpthread_cond_init(C, A) pthread_cond_init(C, A) -#endif /* HDpthread_cond_init */ +#endif #ifndef HDpthread_cond_signal #define HDpthread_cond_signal(C) pthread_cond_signal(C) -#endif /* HDpthread_cond_signal */ +#endif #ifndef HDpthread_cond_wait #define HDpthread_cond_wait(C, M) pthread_cond_wait(C, M) -#endif /* HDpthread_cond_wait */ +#endif #ifndef HDpthread_create #define HDpthread_create(R, A, F, U) pthread_create(R, A, F, U) -#endif /* HDpthread_create */ +#endif #ifndef HDpthread_equal #define HDpthread_equal(T1, T2) pthread_equal(T1, T2) -#endif /* HDpthread_equal */ +#endif #ifndef HDpthread_getspecific #define HDpthread_getspecific(K) pthread_getspecific(K) -#endif /* HDpthread_getspecific */ +#endif #ifndef HDpthread_join #define HDpthread_join(T, V) pthread_join(T, V) -#endif /* HDpthread_join */ +#endif #ifndef HDpthread_key_create #define HDpthread_key_create(K, D) pthread_key_create(K, D) -#endif /* HDpthread_key_create */ +#endif #ifndef HDpthread_mutex_init #define HDpthread_mutex_init(M, A) pthread_mutex_init(M, A) -#endif /* HDpthread_mutex_init */ +#endif #ifndef HDpthread_mutex_lock #define HDpthread_mutex_lock(M) pthread_mutex_lock(M) -#endif /* HDpthread_mutex_lock */ +#endif #ifndef HDpthread_mutex_unlock #define HDpthread_mutex_unlock(M) pthread_mutex_unlock(M) -#endif /* HDpthread_mutex_unlock */ +#endif #ifndef HDpthread_self #define HDpthread_self() pthread_self() -#endif /* HDpthread_self */ +#endif #ifndef HDpthread_setcancelstate #define HDpthread_setcancelstate(N, O) pthread_setcancelstate(N, O) -#endif /* HDpthread_setcancelstate */ +#endif #ifndef HDpthread_setspecific #define HDpthread_setspecific(K, V) pthread_setspecific(K, V) -#endif /* HDpthread_setspecific */ +#endif #ifndef HDputc #define HDputc(C, F) putc(C, F) -#endif /* HDputc*/ +#endif #ifndef HDputchar #define HDputchar(C) putchar(C) -#endif /* HDputchar */ +#endif #ifndef HDputs #define HDputs(S) puts(S) -#endif /* HDputs */ +#endif #ifndef HDpwrite #define HDpwrite(F, B, C, O) pwrite(F, B, C, O) -#endif /* HDpwrite */ +#endif #ifndef HDqsort #define HDqsort(M, N, Z, F) qsort(M, N, Z, F) -#endif /* HDqsort*/ +#endif #ifndef HDraise #define HDraise(N) raise(N) -#endif /* HDraise */ +#endif +/* clang-format off */ #ifdef H5_HAVE_RAND_R -#ifndef HDrandom -#define HDrandom() HDrand() -#endif /* HDrandom */ -H5_DLL int HDrand(void); -#ifndef HDsrandom -#define HDsrandom(S) HDsrand(S) -#endif /* HDsrandom */ -H5_DLL void HDsrand(unsigned int seed); +# ifndef HDrandom +# define HDrandom() HDrand() +# endif + H5_DLL int HDrand(void); +# ifndef HDsrandom +# define HDsrandom(S) HDsrand(S) +# endif + H5_DLL void HDsrand(unsigned int seed); #elif defined(H5_HAVE_RANDOM) -#ifndef HDrand -#define HDrand() random() -#endif /* HDrand */ -#ifndef HDrandom -#define HDrandom() random() -#endif /* HDrandom */ -#ifndef HDsrand -#define HDsrand(S) srandom(S) -#endif /* HDsrand */ -#ifndef HDsrandom -#define HDsrandom(S) srandom(S) -#endif /* HDsrandom */ -#else /* H5_HAVE_RANDOM */ -#ifndef HDrand -#define HDrand() rand() -#endif /* HDrand */ -#ifndef HDrandom -#define HDrandom() rand() -#endif /* HDrandom */ -#ifndef HDsrand -#define HDsrand(S) srand(S) -#endif /* HDsrand */ -#ifndef HDsrandom -#define HDsrandom(S) srand(S) -#endif /* HDsrandom */ -#endif /* H5_HAVE_RANDOM */ +# ifndef HDrand +# define HDrand() random() +# endif +# ifndef HDrandom +# define HDrandom() random() +# endif +# ifndef HDsrand +# define HDsrand(S) srandom(S) +# endif +# ifndef HDsrandom +# define HDsrandom(S) srandom(S) +# endif +#else +# ifndef HDrand +# define HDrand() rand() +# endif +# ifndef HDrandom +# define HDrandom() rand() +# endif +# ifndef HDsrand +# define HDsrand(S) srand(S) +# endif +# ifndef HDsrandom +# define HDsrandom(S) srand(S) +# endif +#endif +/* clang-format on */ #ifndef HDread #define HDread(F, M, Z) read(F, M, Z) -#endif /* HDread */ +#endif #ifndef HDreaddir #define HDreaddir(D) readdir(D) -#endif /* HDreaddir */ +#endif #ifndef HDrealloc #define HDrealloc(M, Z) realloc(M, Z) -#endif /* HDrealloc */ +#endif #ifndef HDrealpath #define HDrealpath(F1, F2) realpath(F1, F2) -#endif /* HDrealloc */ +#endif #ifndef HDremove #define HDremove(S) remove(S) -#endif /* HDremove */ +#endif #ifndef HDrename #define HDrename(OLD, NEW) rename(OLD, NEW) -#endif /* HDrename */ +#endif #ifndef HDrewind #define HDrewind(F) rewind(F) -#endif /* HDrewind */ +#endif #ifndef HDrewinddir #define HDrewinddir(D) rewinddir(D) -#endif /* HDrewinddir */ +#endif #ifndef HDround #define HDround(V) round(V) -#endif /* HDround */ +#endif #ifndef HDroundf #define HDroundf(V) roundf(V) -#endif /* HDroundf */ +#endif #ifndef HDroundl #define HDroundl(V) roundl(V) -#endif /* HDroundl */ +#endif #ifndef HDrmdir #define HDrmdir(S) rmdir(S) -#endif /* HDrmdir */ -/* scanf() variable arguments */ +#endif +#ifndef HDscanf +#define HDscanf scanf /*varargs*/ +#endif #ifndef HDselect #define HDselect(N, RD, WR, ER, T) select(N, RD, WR, ER, T) -#endif /* HDsetbuf */ +#endif #ifndef HDsetbuf #define HDsetbuf(F, S) setbuf(F, S) -#endif /* HDsetbuf */ +#endif #ifndef HDsetenv #define HDsetenv(N, V, O) setenv(N, V, O) -#endif /* HDsetenv */ +#endif #ifndef HDsetgid #define HDsetgid(G) setgid(G) -#endif /* HDsetgid */ +#endif #ifndef HDsetjmp #define HDsetjmp(J) setjmp(J) -#endif /* HDsetjmp */ +#endif #ifndef HDsetlocale #define HDsetlocale(N, S) setlocale(N, S) -#endif /* HDsetlocale */ +#endif #ifndef HDsetpgid #define HDsetpgid(P, PG) setpgid(P, PG) -#endif /* HDsetpgid */ +#endif #ifndef HDsetsid #define HDsetsid() setsid() -#endif /* HDsetsid */ +#endif #ifndef HDsetsockopt -#define HDsetsockopt(A, B, C, D, E) setsockopt((A), (B), (C), (D), (E)) /* mirror VFD */ -#endif /* HDsetsockopt */ +#define HDsetsockopt(A, B, C, D, E) setsockopt((A), (B), (C), (D), (E)) +#endif #ifndef HDsetuid #define HDsetuid(U) setuid(U) -#endif /* HDsetuid */ +#endif #ifndef HDsetvbuf #define HDsetvbuf(F, S, M, Z) setvbuf(F, S, M, Z) -#endif /* HDsetvbuf */ +#endif #ifndef HDshutdown -#define HDshutdown(A, B) shutdown((A), (B)) /* mirror VFD */ -#endif /* HDshutdown */ +#define HDshutdown(A, B) shutdown((A), (B)) +#endif #ifndef HDsigaction #define HDsigaction(S, A, O) sigaction((S), (A), (O)) -#endif /* HDsigaction */ +#endif #ifndef HDsigaddset #define HDsigaddset(S, N) sigaddset(S, N) -#endif /* HDsigaddset */ +#endif #ifndef HDsigdelset #define HDsigdelset(S, N) sigdelset(S, N) -#endif /* HDsigdelset */ +#endif #ifndef HDsigemptyset #define HDsigemptyset(S) sigemptyset(S) -#endif /* HDsigemptyset */ +#endif #ifndef HDsigfillset #define HDsigfillset(S) sigfillset(S) -#endif /* HDsigfillset */ +#endif #ifndef HDsigismember #define HDsigismember(S, N) sigismember(S, N) -#endif /* HDsigismember */ +#endif #ifndef HDsiglongjmp #define HDsiglongjmp(J, N) siglongjmp(J, N) -#endif /* HDsiglongjmp */ +#endif #ifndef HDsignal #define HDsignal(N, F) signal(N, F) -#endif /* HDsignal */ +#endif #ifndef HDsigpending #define HDsigpending(S) sigpending(S) -#endif /* HDsigpending */ +#endif #ifndef HDsigprocmask #define HDsigprocmask(H, S, O) sigprocmask(H, S, O) -#endif /* HDsigprocmask */ +#endif #ifndef HDsigsetjmp #define HDsigsetjmp(J, N) sigsetjmp(J, N) -#endif /* HDsigsetjmp */ +#endif #ifndef HDsigsuspend #define HDsigsuspend(S) sigsuspend(S) -#endif /* HDsigsuspend */ +#endif #ifndef HDsin #define HDsin(X) sin(X) -#endif /* HDsin */ +#endif #ifndef HDsinh #define HDsinh(X) sinh(X) -#endif /* HDsinh */ +#endif #ifndef HDsleep #define HDsleep(N) sleep(N) -#endif /* HDsleep */ +#endif #ifndef HDsnprintf #define HDsnprintf snprintf /*varargs*/ -#endif /* HDsnprintf */ +#endif #ifndef HDsocket -#define HDsocket(A, B, C) socket((A), (B), (C)) /* mirror VFD */ -#endif /* HDsocket */ +#define HDsocket(A, B, C) socket((A), (B), (C)) +#endif #ifndef HDsprintf #define HDsprintf sprintf /*varargs*/ -#endif /* HDsprintf */ +#endif #ifndef HDsqrt #define HDsqrt(X) sqrt(X) -#endif /* HDsqrt */ +#endif #ifndef HDsscanf -#define HDsscanf(S, FMT, ...) sscanf(S, FMT, __VA_ARGS__) -#endif /* HDsscanf */ +#define HDsscanf sscanf /*varargs*/ +#endif +#ifndef HDstat +#define HDstat(S, B) stat(S, B) +#endif #ifndef HDstrcat #define HDstrcat(X, Y) strcat(X, Y) -#endif /* HDstrcat */ +#endif #ifndef HDstrchr #define HDstrchr(S, C) strchr(S, C) -#endif /* HDstrchr */ +#endif #ifndef HDstrcmp #define HDstrcmp(X, Y) strcmp(X, Y) -#endif /* HDstrcmp */ +#endif #ifndef HDstrcasecmp #define HDstrcasecmp(X, Y) strcasecmp(X, Y) -#endif /* HDstrcasecmp */ +#endif #ifndef HDstrcoll #define HDstrcoll(X, Y) strcoll(X, Y) -#endif /* HDstrcoll */ +#endif #ifndef HDstrcpy #define HDstrcpy(X, Y) strcpy(X, Y) -#endif /* HDstrcpy */ +#endif #ifndef HDstrcspn #define HDstrcspn(X, Y) strcspn(X, Y) -#endif /* HDstrcspn */ +#endif #ifndef HDstrdup #define HDstrdup(S) strdup(S) -#endif /* HDstrdup */ +#endif #ifndef HDstrerror #define HDstrerror(N) strerror(N) -#endif /* HDstrerror */ +#endif #ifndef HDstrftime #define HDstrftime(S, Z, F, T) strftime(S, Z, F, T) -#endif /* HDstrftime */ +#endif #ifndef HDstrlen #define HDstrlen(S) strlen(S) -#endif /* HDstrlen */ +#endif #ifndef HDstrncat #define HDstrncat(X, Y, Z) strncat(X, Y, Z) -#endif /* HDstrncat */ +#endif #ifndef HDstrncmp #define HDstrncmp(X, Y, Z) strncmp(X, Y, Z) -#endif /* HDstrncmp */ +#endif #ifndef HDstrncpy #define HDstrncpy(X, Y, Z) strncpy(X, Y, Z) -#endif /* HDstrncpy */ +#endif #ifndef HDstrpbrk #define HDstrpbrk(X, Y) strpbrk(X, Y) -#endif /* HDstrpbrk */ +#endif #ifndef HDstrrchr #define HDstrrchr(S, C) strrchr(S, C) -#endif /* HDstrrchr */ +#endif #ifndef HDstrspn #define HDstrspn(X, Y) strspn(X, Y) -#endif /* HDstrspn */ +#endif #ifndef HDstrstr #define HDstrstr(X, Y) strstr(X, Y) -#endif /* HDstrstr */ +#endif #ifndef HDstrtod #define HDstrtod(S, R) strtod(S, R) -#endif /* HDstrtod */ +#endif #ifndef HDstrtok #define HDstrtok(X, Y) strtok(X, Y) -#endif /* HDstrtok */ +#endif #ifndef HDstrtok_r #define HDstrtok_r(X, Y, Z) strtok_r(X, Y, Z) -#endif /* HDstrtok */ +#endif #ifndef HDstrtol #define HDstrtol(S, R, N) strtol(S, R, N) -#endif /* HDstrtol */ +#endif #ifndef HDstrtoll #define HDstrtoll(S, R, N) strtoll(S, R, N) -#endif /* HDstrtoll */ +#endif #ifndef HDstrtoul #define HDstrtoul(S, R, N) strtoul(S, R, N) -#endif /* HDstrtoul */ +#endif #ifndef HDstrtoull #define HDstrtoull(S, R, N) strtoull(S, R, N) -#endif /* HDstrtoul */ +#endif #ifndef HDstrtoumax #define HDstrtoumax(S, R, N) strtoumax(S, R, N) -#endif /* HDstrtoumax */ +#endif #ifndef HDstrxfrm #define HDstrxfrm(X, Y, Z) strxfrm(X, Y, Z) -#endif /* HDstrxfrm */ -#ifdef H5_HAVE_SYMLINK +#endif #ifndef HDsymlink #define HDsymlink(F1, F2) symlink(F1, F2) -#endif /* HDsymlink */ -#endif /* H5_HAVE_SYMLINK */ +#endif #ifndef HDsysconf #define HDsysconf(N) sysconf(N) -#endif /* HDsysconf */ +#endif #ifndef HDsystem #define HDsystem(S) system(S) -#endif /* HDsystem */ +#endif #ifndef HDtan #define HDtan(X) tan(X) -#endif /* HDtan */ +#endif #ifndef HDtanh #define HDtanh(X) tanh(X) -#endif /* HDtanh */ +#endif #ifndef HDtcdrain #define HDtcdrain(F) tcdrain(F) -#endif /* HDtcdrain */ +#endif #ifndef HDtcflow #define HDtcflow(F, A) tcflow(F, A) -#endif /* HDtcflow */ +#endif #ifndef HDtcflush #define HDtcflush(F, N) tcflush(F, N) -#endif /* HDtcflush */ +#endif #ifndef HDtcgetattr #define HDtcgetattr(F, T) tcgetattr(F, T) -#endif /* HDtcgetattr */ +#endif #ifndef HDtcgetpgrp #define HDtcgetpgrp(F) tcgetpgrp(F) -#endif /* HDtcgetpgrp */ +#endif #ifndef HDtcsendbreak #define HDtcsendbreak(F, N) tcsendbreak(F, N) -#endif /* HDtcsendbreak */ +#endif #ifndef HDtcsetattr #define HDtcsetattr(F, O, T) tcsetattr(F, O, T) -#endif /* HDtcsetattr */ +#endif #ifndef HDtcsetpgrp #define HDtcsetpgrp(F, N) tcsetpgrp(F, N) -#endif /* HDtcsetpgrp */ +#endif #ifndef HDtime #define HDtime(T) time(T) -#endif /* HDtime */ +#endif #ifndef HDtimes #define HDtimes(T) times(T) -#endif /* HDtimes*/ +#endif #ifndef HDtmpfile #define HDtmpfile() tmpfile() -#endif /* HDtmpfile */ +#endif #ifndef HDtmpnam #define HDtmpnam(S) tmpnam(S) -#endif /* HDtmpnam */ +#endif #ifndef HDtolower #define HDtolower(C) tolower(C) -#endif /* HDtolower */ +#endif #ifndef HDtoupper #define HDtoupper(C) toupper(C) -#endif /* HDtoupper */ +#endif #ifndef HDttyname #define HDttyname(F) ttyname(F) -#endif /* HDttyname */ +#endif #ifndef HDtzset #define HDtzset() tzset() -#endif /* HDtzset */ +#endif #ifndef HDumask #define HDumask(N) umask(N) -#endif /* HDumask */ +#endif #ifndef HDuname #define HDuname(S) uname(S) -#endif /* HDuname */ +#endif #ifndef HDungetc #define HDungetc(C, F) ungetc(C, F) -#endif /* HDungetc */ +#endif #ifndef HDunlink #define HDunlink(S) unlink(S) -#endif /* HDunlink */ +#endif #ifndef HDunsetenv #define HDunsetenv(S) unsetenv(S) -#endif /* HDsetenv */ +#endif #ifndef HDutime #define HDutime(S, T) utime(S, T) -#endif /* HDutime */ +#endif + #ifndef HDvasprintf #ifdef H5_HAVE_VASPRINTF #define HDvasprintf(RET, FMT, A) vasprintf(RET, FMT, A) #else H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap); -#endif /* H5_HAVE_VASPRINTF */ -#endif /* HDvasprintf */ +#endif +#endif + #ifndef HDva_arg #define HDva_arg(A, T) va_arg(A, T) -#endif /* HDva_arg */ +#endif #ifndef HDva_copy #define HDva_copy(D, S) va_copy(D, S) -#endif /* HDva_copy */ +#endif #ifndef HDva_end #define HDva_end(A) va_end(A) -#endif /* HDva_end */ +#endif #ifndef HDva_start #define HDva_start(A, P) va_start(A, P) -#endif /* HDva_start */ +#endif #ifndef HDvfprintf #define HDvfprintf(F, FMT, A) vfprintf(F, FMT, A) -#endif /* HDvfprintf */ +#endif #ifndef HDvprintf #define HDvprintf(FMT, A) vprintf(FMT, A) -#endif /* HDvprintf */ +#endif #ifndef HDvsprintf #define HDvsprintf(S, FMT, A) vsprintf(S, FMT, A) -#endif /* HDvsprintf */ +#endif #ifndef HDvsnprintf #define HDvsnprintf(S, N, FMT, A) vsnprintf(S, N, FMT, A) -#endif /* HDvsnprintf */ +#endif #ifndef HDwait #define HDwait(W) wait(W) -#endif /* HDwait */ +#endif #ifndef HDwaitpid #define HDwaitpid(P, W, O) waitpid(P, W, O) -#endif /* HDwaitpid */ +#endif #ifndef HDwcstombs #define HDwcstombs(S, P, Z) wcstombs(S, P, Z) -#endif /* HDwcstombs */ +#endif #ifndef HDwctomb #define HDwctomb(S, C) wctomb(S, C) -#endif /* HDwctomb */ +#endif #ifndef HDwrite #define HDwrite(F, M, Z) write(F, M, Z) -#endif /* HDwrite */ +#endif /* Macro for "stringizing" an integer in the C preprocessor (use H5_TOSTRING) */ /* (use H5_TOSTRING, H5_STRINGIZE is just part of the implementation) */ diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 26bca67..030b65b 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -29,23 +29,35 @@ typedef struct _stati64 h5_stat_t; typedef __int64 h5_stat_size_t; -#define HDaccess(F, M) _access(F, M) -#define HDchdir(S) _chdir(S) -#define HDclose(F) _close(F) -#define HDcreat(S, M) Wopen_utf8(S, O_CREAT | O_TRUNC | O_RDWR, M) -#define HDdup(F) _dup(F) -#define HDfdopen(N, S) _fdopen(N, S) -#define HDfileno(F) _fileno(F) -#define HDfstat(F, B) _fstati64(F, B) -#define HDisatty(F) _isatty(F) +#ifdef H5_HAVE_VISUAL_STUDIO -#define HDgetcwd(S, Z) _getcwd(S, Z) -#define HDgetdcwd(D, S, Z) _getdcwd(D, S, Z) -#define HDgetdrive() _getdrive() -#define HDlseek(F, O, W) _lseeki64(F, O, W) -#define HDlstat(S, B) _lstati64(S, B) -#define HDmkdir(S, M) _mkdir(S) -#define HDoff_t __int64 +struct timezone { + int tz_minuteswest; + int tz_dsttime; +}; + +#endif /* H5_HAVE_VISUAL_STUDIO */ + +#define HDaccess(F, M) _access(F, M) +#define HDchdir(S) _chdir(S) +#define HDclose(F) _close(F) +#define HDcreat(S, M) Wopen_utf8(S, O_CREAT | O_TRUNC | O_RDWR, M) +#define HDdup(F) _dup(F) +#define HDfdopen(N, S) _fdopen(N, S) +#define HDfileno(F) _fileno(F) +#define HDflock(F, L) Wflock(F, L) +#define HDfstat(F, B) _fstati64(F, B) +#define HDgetcwd(S, Z) _getcwd(S, Z) +#define HDgetdcwd(D, S, Z) _getdcwd(D, S, Z) +#define HDgetdrive() _getdrive() +#define HDgetlogin() Wgetlogin() +#define HDgettimeofday(V, Z) Wgettimeofday(V, Z) +#define HDisatty(F) _isatty(F) +#define HDlseek(F, O, W) _lseeki64(F, O, W) +#define HDlstat(S, B) _lstati64(S, B) +#define HDmemset(X, C, Z) memset((void *)(X), C, Z) /* Cast avoids MSVC warning */ +#define HDmkdir(S, M) _mkdir(S) +#define HDoff_t __int64 /* Note that the variadic HDopen macro is using a VC++ extension * where the comma is dropped if nothing is passed to the ellipsis. @@ -55,9 +67,11 @@ typedef __int64 h5_stat_size_t; #else #define HDopen(S, F, ...) Wopen_utf8(S, F, ##__VA_ARGS__) #endif + #define HDread(F, M, Z) _read(F, M, Z) #define HDremove(S) Wremove_utf8(S) #define HDrmdir(S) _rmdir(S) +#define HDsetenv(N, V, O) Wsetenv(N, V, O) #define HDsetvbuf(F, S, M, Z) setvbuf(F, S, M, (Z > 1 ? Z : 2)) #define HDsleep(S) Sleep(S * 1000) #define HDstat(S, B) _stati64(S, B) @@ -66,21 +80,13 @@ typedef __int64 h5_stat_size_t; #define HDstrtok_r(X, Y, Z) strtok_s(X, Y, Z) #define HDtzset() _tzset() #define HDunlink(S) _unlink(S) +#define HDunsetenv(N, V, O) Wsetenv(N, "", 1) #define HDwrite(F, M, Z) _write(F, M, Z) -#ifdef H5_HAVE_VISUAL_STUDIO - -/* - * The (void*) cast just avoids a compiler warning in MSVC - */ -#define HDmemset(X, C, Z) memset((void *)(X), C, Z) - -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - -#endif /* H5_HAVE_VISUAL_STUDIO */ +#ifndef H5_HAVE_MINGW +#define HDftruncate(F, L) _chsize_s(F, L) +#define HDfseek(F, O, W) _fseeki64(F, O, W) +#endif /* H5_HAVE_MINGW */ #ifdef __cplusplus extern "C" { @@ -98,17 +104,4 @@ H5_DLL int H5_get_win32_times(H5_timevals_t *tvs); } #endif /* __cplusplus */ -#define HDgettimeofday(V, Z) Wgettimeofday(V, Z) -#define HDsetenv(N, V, O) Wsetenv(N, V, O) -#define HDunsetenv(N, V, O) Wsetenv(N, "", 1) -#define HDflock(F, L) Wflock(F, L) -#define HDgetlogin() Wgetlogin() - -/* Non-POSIX functions */ - -#ifndef H5_HAVE_MINGW -#define HDftruncate(F, L) _chsize_s(F, L) -#define HDfseek(F, O, W) _fseeki64(F, O, W) -#endif /* H5_HAVE_MINGW */ - #endif /* H5_HAVE_WIN32_API */ diff --git a/test/h5test.h b/test/h5test.h index 16fb33c..db1a887 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -162,12 +162,8 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ goto error; \ } -/* - * Alarm definitions to wait up (terminate) a test that runs too long. - */ +/* Number of seconds to wait before killing a test (requires alarm(2)) */ #define H5_ALARM_SEC 1200 /* default is 20 minutes */ -#define ALARM_ON TestAlarmOn() -#define ALARM_OFF HDalarm(0) /* Flags for h5_fileaccess_flags() */ #define H5_FILEACCESS_VFD 0x01 diff --git a/test/testframe.c b/test/testframe.c index f805997..d3f0211 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -320,9 +320,9 @@ PerformTests(void) MESSAGE(5, ("===============================================\n")); Test[Loop].NumErrors = num_errs; Test_parameters = Test[Loop].Parameters; - ALARM_ON; + TestAlarmOn(); Test[Loop].Call(); - ALARM_OFF; + TestAlarmOff(); Test[Loop].NumErrors = num_errs - Test[Loop].NumErrors; MESSAGE(5, ("===============================================\n")); MESSAGE(5, ("There were %d errors detected.\n\n", (int)Test[Loop].NumErrors)); @@ -620,12 +620,15 @@ SetTest(const char *testname, int action) } } -/* - * Enable alarm on test execution, configurable by environment variable +/* Enable a test timer that will kill long-running tests, the time is configurable + * via an environment variable. + * + * Only useful on POSIX systems where alarm(2) is present. */ void TestAlarmOn(void) { +#ifdef H5_HAVE_ALARM char * env_val = HDgetenv("HDF5_ALARM_SECONDS"); /* Alarm environment */ unsigned long alarm_sec = H5_ALARM_SEC; /* Number of seconds before alarm goes off */ @@ -635,4 +638,15 @@ TestAlarmOn(void) /* Set the number of seconds before alarm goes off */ HDalarm((unsigned)alarm_sec); +#endif +} + +/* Disable the test timer */ +void +TestAlarmOff(void) +{ +#ifdef H5_HAVE_ALARM + /* Set the number of seconds to zero */ + HDalarm(0); +#endif } diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 2a65591..04e1c35 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -489,7 +489,7 @@ readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ in08 = (H5DT_INT8 *)in->data; for (i = 0; i < len; i++, in08++) { - if (fscanf(strm, "%hd", &temp16) != 1) { + if (HDfscanf(strm, "%hd", &temp16) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -521,7 +521,7 @@ readIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 0: /* TEXTIN */ for (i = 0; i < len; i++, in16++) { - if (fscanf(strm, "%hd", in16) != 1) { + if (HDfscanf(strm, "%hd", in16) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -558,7 +558,7 @@ readIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 0: /* TEXTIN */ for (i = 0; i < len; i++, in32++) { - if (fscanf(strm, "%d", in32) != 1) { + if (HDfscanf(strm, "%d", in32) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -595,7 +595,7 @@ readIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 0: /* TEXTIN */ for (i = 0; i < len; i++, in64++) { - if (fscanf(strm, "%s", buffer) < 1) { + if (HDfscanf(strm, "%s", buffer) < 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -664,7 +664,7 @@ readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ in08 = (H5DT_UINT8 *)in->data; for (i = 0; i < len; i++, in08++) { - if (fscanf(strm, "%hu", &temp16) != 1) { + if (HDfscanf(strm, "%hu", &temp16) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -693,7 +693,7 @@ readUIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in16++) { - if (fscanf(strm, "%hu", in16) != 1) { + if (HDfscanf(strm, "%hu", in16) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -729,7 +729,7 @@ readUIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in32++) { - if (fscanf(strm, "%u", in32) != 1) { + if (HDfscanf(strm, "%u", in32) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -766,7 +766,7 @@ readUIntegerData(FILE *strm, struct Input *in) switch (in->inputClass) { case 6: /* TEXTUIN */ for (i = 0; i < len; i++, in64++) { - if (fscanf(strm, "%s", buffer) < 1) { + if (HDfscanf(strm, "%s", buffer) < 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -832,7 +832,7 @@ readFloatData(FILE *strm, struct Input *in) switch (in->inputClass) { case 1: /* TEXTFP */ for (i = 0; i < len; i++, fp32++) { - if (fscanf(strm, "%f", fp32) != 1) { + if (HDfscanf(strm, "%f", fp32) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -845,7 +845,7 @@ readFloatData(FILE *strm, struct Input *in) case 2: /*TEXTFPE */ for (i = 0; i < len; i++, fp32++) { - if (fscanf(strm, "%f", fp32) != 1) { + if (HDfscanf(strm, "%f", fp32) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -884,7 +884,7 @@ readFloatData(FILE *strm, struct Input *in) switch (in->inputClass) { case 1: /* TEXTFP */ for (i = 0; i < len; i++, fp64++) { - if (fscanf(strm, "%lf", fp64) != 1) { + if (HDfscanf(strm, "%lf", fp64) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -897,7 +897,7 @@ readFloatData(FILE *strm, struct Input *in) case 2: /*TEXTFPE */ for (i = 0; i < len; i++, fp64++) { - if (fscanf(strm, "%lf", fp64) != 1) { + if (HDfscanf(strm, "%lf", fp64) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -1469,16 +1469,16 @@ processConfigurationFile(char *infile, struct Input *in) goto error; } - scanret = fscanf(strm, "%254s", key); + scanret = HDfscanf(strm, "%254s", key); if ((scanret == 1) && !HDstrcmp("HDF5", key)) { #ifdef H5DEBUGIMPORT int pndx; HDprintf("\nh5dump file\n"); #endif in->h5dumpInput = 1; - scanret = fscanf(strm, "%254s", temp); /* filename */ - scanret = fscanf(strm, "%254s", temp); /* start bracket */ - scanret = fscanf(strm, "%254s", key); /* DATASET */ + scanret = HDfscanf(strm, "%254s", temp); /* filename */ + scanret = HDfscanf(strm, "%254s", temp); /* start bracket */ + scanret = HDfscanf(strm, "%254s", key); /* DATASET */ while (scanret == 1) { if (!HDstrcmp("DATASET", key)) { /* PATH */ #ifdef H5DEBUGIMPORT @@ -1488,7 +1488,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)HDfprintf(stderr, err3a, infile); goto error; } - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1500,7 +1500,7 @@ processConfigurationFile(char *infile, struct Input *in) goto error; } in->configOptionVector[PATH] = 1; - scanret = fscanf(strm, "%254s", temp); /* start bracket */ + scanret = HDfscanf(strm, "%254s", temp); /* start bracket */ #ifdef H5DEBUGIMPORT HDprintf("h5dump DATASET %s found\n", temp); #endif @@ -1514,7 +1514,7 @@ processConfigurationFile(char *infile, struct Input *in) goto error; } - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1550,20 +1550,20 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump DATATYPE STRING found\n"); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)HDfprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT HDprintf("h5dump DATATYPE STRING %s found\n", temp); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* string properties */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* string properties */ (void)HDfprintf(stderr, "%s", err18); goto error; } while (get_next_prop) { if (!HDstrcmp("STRSIZE", temp)) { /* STRSIZE */ - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err19); goto error; } @@ -1582,8 +1582,8 @@ processConfigurationFile(char *infile, struct Input *in) #endif } } - else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */ - if (fscanf(strm, "%254s", temp) != 1) { /* STRPAD type */ + else if (!HDstrcmp("STRPAD", temp)) { /* STRPAD */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* STRPAD type */ (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1591,8 +1591,8 @@ processConfigurationFile(char *infile, struct Input *in) HDprintf("h5dump DATATYPE STRING STRPAD %s found\n", temp); #endif } - else if (!HDstrcmp("CSET", key)) { /* CSET */ - if (fscanf(strm, "%254s", temp) != 1) { /* CSET type */ + else if (!HDstrcmp("CSET", key)) { /* CSET */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* CSET type */ (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1600,8 +1600,8 @@ processConfigurationFile(char *infile, struct Input *in) HDprintf("h5dump DATATYPE STRING CSET %s found\n", temp); #endif } - else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */ - if (fscanf(strm, "%254s", temp) != 1) { /* CTYPE type */ + else if (!HDstrcmp("CTYPE", temp)) { /* CTYPE */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* CTYPE type */ (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1609,7 +1609,7 @@ processConfigurationFile(char *infile, struct Input *in) HDprintf("h5dump DATATYPE STRING CTYPE %s found\n", temp); #endif } /* if(!HDstrcmp("CSET", key)) */ - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1628,7 +1628,7 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump DATASPACE key\n"); #endif - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1644,14 +1644,14 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump DATASPACE SIMPLE found\n"); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)HDfprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -1662,7 +1662,7 @@ processConfigurationFile(char *infile, struct Input *in) int get_next_dim = 1; int i = 0; - if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ (void)HDfprintf(stderr, err16c, infile); goto error; } @@ -1672,7 +1672,7 @@ processConfigurationFile(char *infile, struct Input *in) while (get_next_dim) { char *more = temp; temp_dims[icount] = HDstrtoull(more, &more, 10); - if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -1716,7 +1716,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)HDfprintf(stderr, err5b, infile); goto error; } - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1728,7 +1728,7 @@ processConfigurationFile(char *infile, struct Input *in) (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { goto error; } - if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -1742,7 +1742,7 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump DATASPACE SIMPLE process max dim values\n"); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim with optional comma */ (void)HDfprintf(stderr, err16c, infile); goto error; } @@ -1762,7 +1762,7 @@ processConfigurationFile(char *infile, struct Input *in) char *more = temp; in->maxsizeOfDimension[i] = HDstrtoull(more, &more, 10); } - if (fscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* max dim or end paren */ (void)HDfprintf(stderr, err16c, infile); goto error; } @@ -1793,7 +1793,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)HDfprintf(stderr, err16c, infile); goto error; } - scanret = fscanf(strm, "%254s", temp); /* end bracket */ + scanret = HDfscanf(strm, "%254s", temp); /* end bracket */ #ifdef H5DEBUGIMPORT HDprintf("h5dump DATASPACE SIMPLE %s found\n", temp); #endif @@ -1808,14 +1808,14 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump STORAGE_LAYOUT key\n"); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)HDfprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT HDprintf("h5dump STORAGE_LAYOUT %s found\n", temp); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* CHUNKED */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* CHUNKED */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -1827,7 +1827,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)HDfprintf(stderr, "Unable to allocate dynamic memory.\n"); goto error; } - if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -1838,7 +1838,7 @@ processConfigurationFile(char *infile, struct Input *in) int get_next_dim = 1; int icount = 0; - if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ (void)HDfprintf(stderr, err16c, infile); goto error; } @@ -1848,7 +1848,7 @@ processConfigurationFile(char *infile, struct Input *in) while (get_next_dim) { char *more = temp; in->sizeOfChunk[icount] = HDstrtoull(more, &more, 10); - if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -1880,7 +1880,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)HDfprintf(stderr, err5b, infile); goto error; } - if (fscanf(strm, "%254s", temp) != 1) { /* SIZE */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* SIZE */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -1888,7 +1888,7 @@ processConfigurationFile(char *infile, struct Input *in) HDprintf("h5dump STORAGE_LAYOUT CHUNKED %s found\n", temp); #endif if (!HDstrcmp("SIZE", temp)) { /* SIZE */ - if (fscanf(strm, "%d", (&ival)) != 1) { + if (HDfscanf(strm, "%d", (&ival)) != 1) { (void)HDfprintf(stderr, "%s", err19); goto error; } @@ -1897,7 +1897,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif } while (HDstrcmp("}", temp) != 0) { - if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */ (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1912,14 +1912,14 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump FILTERS key\n"); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)HDfprintf(stderr, err6b, infile); goto error; } #ifdef H5DEBUGIMPORT HDprintf("h5dump FILTERS %s found\n", temp); #endif - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -1930,28 +1930,28 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump FILTERS COMPRESSION found\n"); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* DEFLATE */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* DEFLATE */ (void)HDfprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* bgin bracket */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* bgin bracket */ (void)HDfprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* LEVEL */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* LEVEL */ (void)HDfprintf(stderr, "%s", err18); goto error; } #ifdef H5DEBUGIMPORT HDprintf("h5dump FILTERS COMPRESSION %s found\n", temp); #endif - if (fscanf(strm, "%d", (&ival)) != 1) { + if (HDfscanf(strm, "%d", (&ival)) != 1) { (void)HDfprintf(stderr, "%s", err19); goto error; } @@ -1959,7 +1959,7 @@ processConfigurationFile(char *infile, struct Input *in) HDprintf("h5dump FILTERS COMPRESSION LEVEL %d found\n", ival); #endif in->compressionParam = ival; - if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */ (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1981,7 +1981,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif in->configOptionVector[COMPRESS] = 0; } - if (fscanf(strm, "%254s", temp) != 1) { /* end bracket */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* end bracket */ (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -1995,14 +1995,14 @@ processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT HDprintf("h5dump SUBSET key\n"); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* start bracket */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start bracket */ (void)HDfprintf(stderr, err20, infile); goto error; } #ifdef H5DEBUGIMPORT HDprintf("h5dump SUBSET %s found\n", temp); #endif - if (fscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* SUBSET keyword */ (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -2012,7 +2012,7 @@ processConfigurationFile(char *infile, struct Input *in) while (get_next_prop) { if (!HDstrcmp("COUNT", temp)) { /* COUNT */ int icount = 0; - if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -2023,7 +2023,7 @@ processConfigurationFile(char *infile, struct Input *in) int get_next_dim = 1; int i = 0; - if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ (void)HDfprintf(stderr, err16c, infile); goto error; } @@ -2033,7 +2033,7 @@ processConfigurationFile(char *infile, struct Input *in) while (get_next_dim) { char *more = temp; temp_dims[icount] = HDstrtoull(more, &more, 10); - if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -2068,7 +2068,7 @@ processConfigurationFile(char *infile, struct Input *in) } /* if(!HDstrcmp("COUNT", temp)) COUNT */ if (!HDstrcmp("BLOCK", temp)) { /* BLOCK */ int icount = 0; - if (fscanf(strm, "%254s", temp) != 1) { /* start paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -2079,7 +2079,7 @@ processConfigurationFile(char *infile, struct Input *in) int get_next_dim = 1; int i = 0; - if (fscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension with optional comma */ (void)HDfprintf(stderr, err16c, infile); goto error; } @@ -2089,7 +2089,7 @@ processConfigurationFile(char *infile, struct Input *in) while (get_next_dim) { char *more = temp; temp_dims[icount] = HDstrtoull(more, &more, 10); - if (fscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ + if (HDfscanf(strm, "%254s", temp) != 1) { /* Dimension or end paren */ (void)HDfprintf(stderr, err6b, infile); goto error; } @@ -2122,7 +2122,7 @@ processConfigurationFile(char *infile, struct Input *in) in->configOptionVector[DIM] = 1; } /* if(!HDstrcmp("(", key)) start paren */ } /* if(!HDstrcmp("BLOCK", temp)) BLOCK */ - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -2141,7 +2141,7 @@ processConfigurationFile(char *infile, struct Input *in) scanret = 0; break; } - scanret = fscanf(strm, "%254s", key); + scanret = HDfscanf(strm, "%254s", key); } #ifdef H5DEBUGIMPORT HDprintf("h5dump path"); @@ -2182,7 +2182,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)HDfprintf(stderr, err3a, infile); goto error; } - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -2199,7 +2199,7 @@ processConfigurationFile(char *infile, struct Input *in) goto error; } - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err18); goto error; } @@ -2226,7 +2226,7 @@ processConfigurationFile(char *infile, struct Input *in) (void)HDfprintf(stderr, err5a, infile); goto error; } - if (fscanf(strm, "%254d", (&ival)) != 1) { + if (HDfscanf(strm, "%254d", (&ival)) != 1) { (void)HDfprintf(stderr, "%s", err19); goto error; } @@ -2423,7 +2423,7 @@ processConfigurationFile(char *infile, struct Input *in) default: break; } - scanret = fscanf(strm, "%254s", key); + scanret = HDfscanf(strm, "%254s", key); } /* @@ -2602,7 +2602,7 @@ getOutputClass(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for output class.\n"; - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -2637,7 +2637,7 @@ getOutputSize(struct Input *in, FILE *strm) const char *err1 = "Unable to get integer value.\n"; const char *err2 = "Invalid value for output size.\n"; - if (fscanf(strm, "%d", (&ival)) != 1) { + if (HDfscanf(strm, "%d", (&ival)) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -3502,7 +3502,7 @@ getInputByteOrder(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for input byte-order.\n"; - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -3524,7 +3524,7 @@ getRank(struct Input *in, FILE *strm) const char *err1 = "Unable to get integer value.\n"; const char *err2 = "Invalid value for rank.\n"; - if (fscanf(strm, "%d", (&ival)) != 1) { + if (HDfscanf(strm, "%d", (&ival)) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -3553,7 +3553,7 @@ getDimensionSizes(struct Input *in, FILE *strm) return (-1); } - while (fscanf(strm, "%llu", (&ullval)) == 1) + while (HDfscanf(strm, "%llu", (&ullval)) == 1) in->sizeOfDimension[i++] = ullval; if (in->rank != i) { @@ -3579,7 +3579,7 @@ getChunkedDimensionSizes(struct Input *in, FILE *strm) return (-1); } - while (fscanf(strm, "%llu", (&ullval)) == 1) + while (HDfscanf(strm, "%llu", (&ullval)) == 1) in->sizeOfChunk[i++] = ullval; if (in->rank != i) { @@ -3612,7 +3612,7 @@ getMaximumDimensionSizes(struct Input *in, FILE *strm) return (-1); } - while (fscanf(strm, "%lld", (&llval)) == 1) { + while (HDfscanf(strm, "%lld", (&llval)) == 1) { if (llval == -1) in->maxsizeOfDimension[i++] = H5S_UNLIMITED; else @@ -3642,7 +3642,7 @@ getOutputArchitecture(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for output architecture.\n"; - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -3675,7 +3675,7 @@ getOutputByteOrder(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for output byte-order.\n"; - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -3708,7 +3708,7 @@ getCompressionType(struct Input *in, FILE *strm) const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for compression.\n"; - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -3750,7 +3750,7 @@ getCompressionParameter(struct Input *in, FILE *strm) switch (in->compressionType) { case 0: /* GZIP */ - if (fscanf(strm, "%d", (&ival)) != 1) { + if (HDfscanf(strm, "%d", (&ival)) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } @@ -3774,7 +3774,7 @@ getExternalFilename(struct Input *in, FILE *strm) char temp[255]; const char *err1 = "Unable to get 'string' value.\n"; - if (fscanf(strm, "%254s", temp) != 1) { + if (HDfscanf(strm, "%254s", temp) != 1) { (void)HDfprintf(stderr, "%s", err1); return (-1); } diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 1f1b821..474a56f 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -363,7 +363,7 @@ read_info(const char *filename, pack_opt_t *options) /* cycle until end of file reached */ while (1) { - if (EOF == fscanf(fp, "%9s", stype)) + if (EOF == HDfscanf(fp, "%9s", stype)) break; /* Info indicator must be for layout or filter */ @@ -378,7 +378,7 @@ read_info(const char *filename, pack_opt_t *options) i = 0; c = '0'; while (c != ' ') { - if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { + if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; @@ -390,7 +390,7 @@ read_info(const char *filename, pack_opt_t *options) c = '0'; /* go until end */ while (c != ' ') { - if (fscanf(fp, "%c", &c) < 0 && HDferror(fp)) { + if (HDfscanf(fp, "%c", &c) < 0 && HDferror(fp)) { error_msg("fscanf error\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index a9b4437..4925708 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -109,7 +109,7 @@ main(int argc, const char *argv[]) filename = HDstrdup(argv[opt_ind]); size = 0; - if (EOF == (res = sscanf(nbytes, "%u", &size))) { + if (EOF == (res = HDsscanf(nbytes, "%u", &size))) { /* fail */ error_msg("missing file name\n"); usage(h5tools_getprogname()); diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index 2d89d30..276fa0f 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -90,27 +90,20 @@ #define HDctermid(S) ctermid(S) #define HDctime(T) ctime(T) #define HDcuserid(S) cuserid(S) -#ifdef H5_HAVE_DIFFTIME -#define HDdifftime(X, Y) difftime(X, Y) -#else -#define HDdifftime(X, Y) ((double)(X) - (double)(Y)) -#endif -#define HDdiv(X, Y) div(X, Y) -#define HDdup(F) dup(F) -#define HDdup2(F, I) dup2(F, I) -/* execl() variable arguments */ -/* execle() variable arguments */ -/* execlp() variable arguments */ -#define HDexecv(S, AV) execv(S, AV) -#define HDexecve(S, AV, E) execve(S, AV, E) -#define HDexecvp(S, AV) execvp(S, AV) -#define HDexit(N) exit(N) -#define HD_exit(N) _exit(N) -#define HDexp(X) exp(X) -#define HDfabs(X) fabs(X) -#define HDfabsf(X) fabsf(X) -#define HDfabsl(X) fabsl(X) -#define HDfclose(F) fclose(F) +#define HDdifftime(X, Y) difftime(X, Y) +#define HDdiv(X, Y) div(X, Y) +#define HDdup(F) dup(F) +#define HDdup2(F, I) dup2(F, I) +#define HDexecv(S, AV) execv(S, AV) +#define HDexecve(S, AV, E) execve(S, AV, E) +#define HDexecvp(S, AV) execvp(S, AV) +#define HDexit(N) exit(N) +#define HD_exit(N) _exit(N) +#define HDexp(X) exp(X) +#define HDfabs(X) fabs(X) +#define HDfabsf(X) fabsf(X) +#define HDfabsl(X) fabsl(X) +#define HDfclose(F) fclose(F) /* fcntl() variable arguments */ #define HDfdopen(N, S) fdopen(N, S) #define HDfeof(F) feof(F) diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index 9bdac29..ea1a2a1 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -105,27 +105,20 @@ #define HDctermid(S) ctermid(S) #define HDctime(T) ctime(T) #define HDcuserid(S) cuserid(S) -#ifdef H5_HAVE_DIFFTIME -#define HDdifftime(X, Y) difftime(X, Y) -#else -#define HDdifftime(X, Y) ((double)(X) - (double)(Y)) -#endif -#define HDdiv(X, Y) div(X, Y) -#define HDdup(F) dup(F) -#define HDdup2(F, I) dup2(F, I) -/* execl() variable arguments */ -/* execle() variable arguments */ -/* execlp() variable arguments */ -#define HDexecv(S, AV) execv(S, AV) -#define HDexecve(S, AV, E) execve(S, AV, E) -#define HDexecvp(S, AV) execvp(S, AV) -#define HDexit(N) exit(N) -#define HD_exit(N) _exit(N) -#define HDexp(X) exp(X) -#define HDfabs(X) fabs(X) -#define HDfabsf(X) fabsf(X) -#define HDfabsl(X) fabsl(X) -#define HDfclose(F) fclose(F) +#define HDdifftime(X, Y) difftime(X, Y) +#define HDdiv(X, Y) div(X, Y) +#define HDdup(F) dup(F) +#define HDdup2(F, I) dup2(F, I) +#define HDexecv(S, AV) execv(S, AV) +#define HDexecve(S, AV, E) execve(S, AV, E) +#define HDexecvp(S, AV) execvp(S, AV) +#define HDexit(N) exit(N) +#define HD_exit(N) _exit(N) +#define HDexp(X) exp(X) +#define HDfabs(X) fabs(X) +#define HDfabsf(X) fabsf(X) +#define HDfabsl(X) fabsl(X) +#define HDfclose(F) fclose(F) /* fcntl() variable arguments */ #define HDfdopen(N, S) fdopen(N, S) #define HDfeof(F) feof(F) -- cgit v0.12 From 2090a527c13a13c0ea5b59b319b3402d2ef8f578 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Tue, 29 Jun 2021 13:06:48 -0700 Subject: Brings the tools getopt(3) replacement into the main library (#803) * Moves get_option from the tools library to the C library * Adds H5 prefix to get_option call and variables * Renames the H5_get_option long options struct and enum --- hl/tools/h5watch/h5watch.c | 60 ++--- src/H5private.h | 51 ++++ src/H5system.c | 164 ++++++++++++ tools/lib/h5tools_utils.c | 169 +----------- tools/lib/h5tools_utils.h | 52 ---- tools/src/h5copy/h5copy.c | 48 ++-- tools/src/h5diff/h5diff_common.c | 108 ++++---- tools/src/h5dump/h5dump.c | 340 ++++++++++++------------ tools/src/h5format_convert/h5format_convert.c | 60 ++--- tools/src/h5jam/h5jam.c | 12 +- tools/src/h5jam/h5unjam.c | 12 +- tools/src/h5repack/h5repack_main.c | 156 +++++------ tools/src/h5stat/h5stat.c | 224 ++++++++-------- tools/src/misc/h5clear.c | 80 +++--- tools/src/misc/h5mkgrp.c | 28 +- tools/test/h5jam/getub.c | 16 +- tools/test/h5jam/tellub.c | 12 +- tools/test/perform/pio_perf.c | 296 ++++++++++----------- tools/test/perform/pio_standalone.c | 58 ++--- tools/test/perform/pio_standalone.h | 23 +- tools/test/perform/sio_perf.c | 356 +++++++++++++------------- tools/test/perform/sio_standalone.c | 58 ++--- tools/test/perform/sio_standalone.h | 23 +- tools/test/perform/zip_perf.c | 132 +++++----- 24 files changed, 1269 insertions(+), 1269 deletions(-) diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index a5e82ca..afbc31d 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -58,27 +58,27 @@ static void parse_command_line(int argc, const char *argv[]); * The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char * s_opts = "?"; -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, - {"dim", no_arg, 'd'}, {"di", no_arg, 'd'}, - {"label", no_arg, 'l'}, {"labe", no_arg, 'l'}, - {"lab", no_arg, 'l'}, {"la", no_arg, 'l'}, - {"simple", no_arg, 'S'}, {"simpl", no_arg, 'S'}, - {"simp", no_arg, 'S'}, {"sim", no_arg, 'S'}, - {"si", no_arg, 'S'}, {"hexdump", no_arg, 'x'}, - {"hexdum", no_arg, 'x'}, {"hexdu", no_arg, 'x'}, - {"hexd", no_arg, 'x'}, {"hex", no_arg, 'x'}, - {"width", require_arg, 'w'}, {"widt", require_arg, 'w'}, - {"wid", require_arg, 'w'}, {"wi", require_arg, 'w'}, - {"polling", require_arg, 'p'}, {"pollin", require_arg, 'p'}, - {"polli", require_arg, 'p'}, {"poll", require_arg, 'p'}, - {"pol", require_arg, 'p'}, {"po", require_arg, 'p'}, - {"fields", require_arg, 'f'}, {"field", require_arg, 'f'}, - {"fiel", require_arg, 'f'}, {"fie", require_arg, 'f'}, - {"fi", require_arg, 'f'}, {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, {"ver", no_arg, 'V'}, - {"ve", no_arg, 'V'}, {NULL, 0, '\0'}}; +static const char * s_opts = "?"; +static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, + {"dim", no_arg, 'd'}, {"di", no_arg, 'd'}, + {"label", no_arg, 'l'}, {"labe", no_arg, 'l'}, + {"lab", no_arg, 'l'}, {"la", no_arg, 'l'}, + {"simple", no_arg, 'S'}, {"simpl", no_arg, 'S'}, + {"simp", no_arg, 'S'}, {"sim", no_arg, 'S'}, + {"si", no_arg, 'S'}, {"hexdump", no_arg, 'x'}, + {"hexdum", no_arg, 'x'}, {"hexdu", no_arg, 'x'}, + {"hexd", no_arg, 'x'}, {"hex", no_arg, 'x'}, + {"width", require_arg, 'w'}, {"widt", require_arg, 'w'}, + {"wid", require_arg, 'w'}, {"wi", require_arg, 'w'}, + {"polling", require_arg, 'p'}, {"pollin", require_arg, 'p'}, + {"polli", require_arg, 'p'}, {"poll", require_arg, 'p'}, + {"pol", require_arg, 'p'}, {"po", require_arg, 'p'}, + {"fields", require_arg, 'f'}, {"field", require_arg, 'f'}, + {"fiel", require_arg, 'f'}, {"fie", require_arg, 'f'}, + {"fi", require_arg, 'f'}, {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, {"ver", no_arg, 'V'}, + {"ve", no_arg, 'V'}, {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: doprint() @@ -677,7 +677,7 @@ parse_command_line(int argc, const char *argv[]) } /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case '?': case 'h': /* --help */ @@ -691,7 +691,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'w': /* --width=N */ - g_display_width = (int)HDstrtol(opt_arg, NULL, 0); + g_display_width = (int)HDstrtol(H5_optarg, NULL, 0); if (g_display_width < 0) { usage(h5tools_getprogname()); leave(EXIT_FAILURE); @@ -711,8 +711,8 @@ parse_command_line(int argc, const char *argv[]) break; case 'p': /* --polling=N */ - /* g_polling_interval = HDstrtod(opt_arg, NULL); */ - if ((tmp = (int)HDstrtol(opt_arg, NULL, 10)) <= 0) { + /* g_polling_interval = HDstrtod(H5_optarg, NULL); */ + if ((tmp = (int)HDstrtol(H5_optarg, NULL, 10)) <= 0) { usage(h5tools_getprogname()); leave(EXIT_FAILURE); } @@ -721,7 +721,7 @@ parse_command_line(int argc, const char *argv[]) case 'f': /* --fields= */ if (g_list_of_fields == NULL) { - if ((g_list_of_fields = HDstrdup(opt_arg)) == NULL) { + if ((g_list_of_fields = HDstrdup(H5_optarg)) == NULL) { error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); leave(EXIT_FAILURE); } @@ -729,7 +729,7 @@ parse_command_line(int argc, const char *argv[]) else { char *str; - if ((str = HDstrdup(opt_arg)) == NULL) { + if ((str = HDstrdup(H5_optarg)) == NULL) { error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); leave(EXIT_FAILURE); } @@ -751,7 +751,7 @@ parse_command_line(int argc, const char *argv[]) } /* check for object to be processed */ - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing dataset name\n"); usage(h5tools_getprogname()); leave(EXIT_FAILURE); @@ -821,7 +821,7 @@ main(int argc, const char *argv[]) /* parse command line options */ parse_command_line(argc, argv); - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing dataset name\n"); usage(h5tools_getprogname()); leave(EXIT_FAILURE); @@ -845,7 +845,7 @@ main(int argc, const char *argv[]) * then there must have been something wrong with the file (perhaps it * doesn't exist). */ - if ((fname = HDstrdup(argv[opt_ind])) == NULL) { + if ((fname = HDstrdup(argv[H5_optind])) == NULL) { error_msg("memory allocation failed (file %s:line %d)\n", __FILE__, __LINE__); h5tools_setstatus(EXIT_FAILURE); goto done; diff --git a/src/H5private.h b/src/H5private.h index 4bd0685..d11b15b 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2634,6 +2634,57 @@ H5_DLL double H5_get_time(void); H5_DLL herr_t H5_build_extpath(const char *name, char **extpath /*out*/); H5_DLL herr_t H5_combine_path(const char *path1, const char *path2, char **full_name /*out*/); +/* getopt(3) equivalent that papers over the lack of long options on BSD + * and lack of Windows support. + */ +H5_DLLVAR int H5_opterr; /* get_option prints errors if this is on */ +H5_DLLVAR int H5_optind; /* token pointer */ +H5_DLLVAR const char *H5_optarg; /* flag argument (or value) */ + +enum h5_arg_level { + no_arg = 0, /* doesn't take an argument */ + require_arg, /* requires an argument */ + optional_arg /* argument is optional */ +}; + +/* + * get_option determines which options are specified on the command line and + * returns a pointer to any arguments possibly associated with the option in + * the ``H5_optarg'' variable. get_option returns the shortname equivalent of + * the option. The long options are specified in the following way: + * + * struct h5_long_options foo[] = { + * { "filename", require_arg, 'f' }, + * { "append", no_arg, 'a' }, + * { "width", require_arg, 'w' }, + * { NULL, 0, 0 } + * }; + * + * Long named options can have arguments specified as either: + * + * ``--param=arg'' or ``--param arg'' + * + * Short named options can have arguments specified as either: + * + * ``-w80'' or ``-w 80'' + * + * and can have more than one short named option specified at one time: + * + * -aw80 + * + * in which case those options which expect an argument need to come at the + * end. + */ +struct h5_long_options { + const char * name; /* Name of the long option */ + enum h5_arg_level has_arg; /* Whether we should look for an arg */ + char shortval; /* The shortname equivalent of long arg + * this gets returned from get_option + */ +}; + +H5_DLL int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt); + #ifdef H5_HAVE_PARALLEL /* Generic MPI functions */ H5_DLL hsize_t H5_mpi_set_bigio_count(hsize_t new_count); diff --git a/src/H5system.c b/src/H5system.c index 7a87a65..0849373 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -936,3 +936,167 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5_expand_windows_env_vars() */ #endif /* H5_HAVE_WIN32_API */ + +/* Global variables */ +int H5_opterr = 1; /* Get_option prints errors if this is on */ +int H5_optind = 1; /* Token pointer */ +const char *H5_optarg; /* Flag argument (or value) */ + +/*------------------------------------------------------------------------- + * Function: H5_get_option + * + * Purpose: Determine the command-line options a user specified. We can + * accept both short and long type command-lines. + * + * Return: Success: The short valued "name" of the command line + * parameter or EOF if there are no more + * parameters to process. + * + * Failure: A question mark. + *------------------------------------------------------------------------- + */ +int +H5_get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts) +{ + static int sp = 1; /* character index in current token */ + int optopt = '?'; /* option character passed back to user */ + + if (sp == 1) { + /* check for more flag-like tokens */ + if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') { + return EOF; + } + else if (HDstrcmp(argv[H5_optind], "--") == 0) { + H5_optind++; + return EOF; + } + } + + if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') { + /* long command line option */ + int i; + const char ch = '='; + char * arg = HDstrdup(&argv[H5_optind][2]); + size_t arg_len = 0; + + H5_optarg = strchr(&argv[H5_optind][2], ch); + arg_len = HDstrlen(&argv[H5_optind][2]); + if (H5_optarg) { + arg_len -= HDstrlen(H5_optarg); + H5_optarg++; /* skip the equal sign */ + } + arg[arg_len] = 0; + + for (i = 0; l_opts && l_opts[i].name; i++) { + if (HDstrcmp(arg, l_opts[i].name) == 0) { + /* we've found a matching long command line flag */ + optopt = l_opts[i].shortval; + + if (l_opts[i].has_arg != no_arg) { + if (H5_optarg == NULL) { + if (l_opts[i].has_arg != optional_arg) { + if (H5_optind < (argc - 1)) + if (argv[H5_optind + 1][0] != '-') + H5_optarg = argv[++H5_optind]; + } + else if (l_opts[i].has_arg == require_arg) { + if (H5_opterr) + HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg); + + optopt = '?'; + } + } + } + else { + if (H5_optarg) { + if (H5_opterr) + HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg); + + optopt = '?'; + } + } + break; + } + } + + if (l_opts[i].name == NULL) { + /* exhausted all of the l_opts we have and still didn't match */ + if (H5_opterr) + HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); + + optopt = '?'; + } + + H5_optind++; + sp = 1; + + HDfree(arg); + } + else { + register char *cp; /* pointer into current token */ + + /* short command line option */ + optopt = argv[H5_optind][sp]; + + if (optopt == ':' || (cp = HDstrchr(opts, optopt)) == 0) { + if (H5_opterr) + HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], optopt); + + /* if no chars left in this token, move to next token */ + if (argv[H5_optind][++sp] == '\0') { + H5_optind++; + sp = 1; + } + return '?'; + } + + if (*++cp == ':') { + /* if a value is expected, get it */ + if (argv[H5_optind][sp + 1] != '\0') { + /* flag value is rest of current token */ + H5_optarg = &argv[H5_optind++][sp + 1]; + } + else if (++H5_optind >= argc) { + if (H5_opterr) + HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], optopt); + + optopt = '?'; + } + else { + /* flag value is next token */ + H5_optarg = argv[H5_optind++]; + } + + sp = 1; + } + /* wildcard argument */ + else if (*cp == '*') { + /* check the next argument */ + H5_optind++; + /* we do have an extra argument, check if not last */ + if ((H5_optind + 1) < argc) { + if (argv[H5_optind][0] != '-') { + H5_optarg = argv[H5_optind++]; + } + else { + H5_optarg = NULL; + } + } + else { + H5_optarg = NULL; + } + } + else { + /* set up to look at next char in token, next time */ + if (argv[H5_optind][++sp] == '\0') { + /* no more in current token, so setup next token */ + H5_optind++; + sp = 1; + } + H5_optarg = NULL; + } + } + + /* return the current flag character found */ + return optopt; +} diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 6aec6b8..f2407bf 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -25,12 +25,8 @@ #include "H5FDros3.h" #endif -/* global variables */ -unsigned h5tools_nCols = 80; -/* ``get_option'' variables */ -int opt_err = 1; /*get_option prints errors if this is on */ -int opt_ind = 1; /*token pointer */ -const char * opt_arg; /*flag argument (or value) */ +/* Global variables */ +unsigned h5tools_nCols = 80; static int h5tools_d_status = 0; static const char *h5tools_progname = "h5tools"; @@ -162,167 +158,6 @@ help_ref_msg(FILE *output) HDfprintf(output, "see the <%s> entry in the 'HDF5 Reference Manual'.\n", h5tools_getprogname()); } -/*------------------------------------------------------------------------- - * Function: get_option - * - * Purpose: Determine the command-line options a user specified. We can - * accept both short and long type command-lines. - * - * Return: Success: The short valued "name" of the command line - * parameter or EOF if there are no more - * parameters to process. - * - * Failure: A question mark. - *------------------------------------------------------------------------- - */ -int -get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts) -{ - static int sp = 1; /* character index in current token */ - int opt_opt = '?'; /* option character passed back to user */ - - if (sp == 1) { - /* check for more flag-like tokens */ - if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { - return EOF; - } - else if (HDstrcmp(argv[opt_ind], "--") == 0) { - opt_ind++; - return EOF; - } - } - - if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') { - /* long command line option */ - int i; - const char ch = '='; - char * arg = HDstrdup(&argv[opt_ind][2]); - size_t arg_len = 0; - - opt_arg = strchr(&argv[opt_ind][2], ch); - arg_len = HDstrlen(&argv[opt_ind][2]); - if (opt_arg) { - arg_len -= HDstrlen(opt_arg); - opt_arg++; /* skip the equal sign */ - } - arg[arg_len] = 0; - - for (i = 0; l_opts && l_opts[i].name; i++) { - if (HDstrcmp(arg, l_opts[i].name) == 0) { - /* we've found a matching long command line flag */ - opt_opt = l_opts[i].shortval; - - if (l_opts[i].has_arg != no_arg) { - if (opt_arg == NULL) { - if (l_opts[i].has_arg != optional_arg) { - if (opt_ind < (argc - 1)) - if (argv[opt_ind + 1][0] != '-') - opt_arg = argv[++opt_ind]; - } - else if (l_opts[i].has_arg == require_arg) { - if (opt_err) - HDfprintf(rawerrorstream, "%s: option required for \"--%s\" flag\n", argv[0], - arg); - - opt_opt = '?'; - } - } - } - else { - if (opt_arg) { - if (opt_err) - HDfprintf(rawerrorstream, "%s: no option required for \"%s\" flag\n", argv[0], - arg); - - opt_opt = '?'; - } - } - break; - } - } - - if (l_opts[i].name == NULL) { - /* exhausted all of the l_opts we have and still didn't match */ - if (opt_err) - HDfprintf(rawerrorstream, "%s: unknown option \"%s\"\n", argv[0], arg); - - opt_opt = '?'; - } - - opt_ind++; - sp = 1; - - HDfree(arg); - } - else { - register char *cp; /* pointer into current token */ - - /* short command line option */ - opt_opt = argv[opt_ind][sp]; - - if (opt_opt == ':' || (cp = HDstrchr(opts, opt_opt)) == 0) { - if (opt_err) - HDfprintf(rawerrorstream, "%s: unknown option \"%c\"\n", argv[0], opt_opt); - - /* if no chars left in this token, move to next token */ - if (argv[opt_ind][++sp] == '\0') { - opt_ind++; - sp = 1; - } - return '?'; - } - - if (*++cp == ':') { - /* if a value is expected, get it */ - if (argv[opt_ind][sp + 1] != '\0') { - /* flag value is rest of current token */ - opt_arg = &argv[opt_ind++][sp + 1]; - } - else if (++opt_ind >= argc) { - if (opt_err) - HDfprintf(rawerrorstream, "%s: value expected for option \"%c\"\n", argv[0], opt_opt); - - opt_opt = '?'; - } - else { - /* flag value is next token */ - opt_arg = argv[opt_ind++]; - } - - sp = 1; - } - /* wildcard argument */ - else if (*cp == '*') { - /* check the next argument */ - opt_ind++; - /* we do have an extra argument, check if not last */ - if ((opt_ind + 1) < argc) { - if (argv[opt_ind][0] != '-') { - opt_arg = argv[opt_ind++]; - } - else { - opt_arg = NULL; - } - } - else { - opt_arg = NULL; - } - } - else { - /* set up to look at next char in token, next time */ - if (argv[opt_ind][++sp] == '\0') { - /* no more in current token, so setup next token */ - opt_ind++; - sp = 1; - } - opt_arg = NULL; - } - } - - /* return the current flag character found */ - return opt_opt; -} - /***************************************************************************** * * Function: parse_tuple() diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 307ce20..095ad6c 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -40,58 +40,6 @@ H5TOOLS_DLLVAR FILE *overflow_file; H5TOOLS_DLLVAR hsize_t H5TOOLS_MALLOCSIZE; /* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */ H5TOOLS_DLLVAR hsize_t H5TOOLS_BUFSIZE; -/* - * begin get_option section - */ -H5TOOLS_DLLVAR int opt_err; /* getoption prints errors if this is on */ -H5TOOLS_DLLVAR int opt_ind; /* token pointer */ -H5TOOLS_DLLVAR const char *opt_arg; /* flag argument (or value) */ - -enum { - no_arg = 0, /* doesn't take an argument */ - require_arg, /* requires an argument */ - optional_arg /* argument is optional */ -}; - -/* - * get_option determines which options are specified on the command line and - * returns a pointer to any arguments possibly associated with the option in - * the ``opt_arg'' variable. get_option returns the shortname equivalent of - * the option. The long options are specified in the following way: - * - * struct long_options foo[] = { - * { "filename", require_arg, 'f' }, - * { "append", no_arg, 'a' }, - * { "width", require_arg, 'w' }, - * { NULL, 0, 0 } - * }; - * - * Long named options can have arguments specified as either: - * - * ``--param=arg'' or ``--param arg'' - * - * Short named options can have arguments specified as either: - * - * ``-w80'' or ``-w 80'' - * - * and can have more than one short named option specified at one time: - * - * -aw80 - * - * in which case those options which expect an argument need to come at the - * end. - */ -typedef struct long_options { - const char *name; /* name of the long option */ - int has_arg; /* whether we should look for an arg */ - char shortval; /* the shortname equivalent of long arg - * this gets returned from get_option */ -} long_options; - -H5TOOLS_DLL int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt); -/* - * end get_option section - */ /*struct taken from the dumper. needed in table struct*/ typedef struct obj_t { diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index f618914..4e9a25e 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -19,23 +19,23 @@ #define PROGRAMNAME "h5copy" /* command-line options: short and long-named parameters */ -static const char * s_opts = "d:f:hi:o:ps:vVE"; -static struct long_options l_opts[] = {{"destination", require_arg, 'd'}, - {"flag", require_arg, 'f'}, - {"help", no_arg, 'h'}, - {"input", require_arg, 'i'}, - {"output", require_arg, 'o'}, - {"parents", no_arg, 'p'}, - {"source", require_arg, 's'}, - {"verbose", no_arg, 'v'}, - {"version", no_arg, 'V'}, - {"enable-error-stack", no_arg, 'E'}, - {NULL, 0, '\0'}}; -char * fname_src = NULL; -char * fname_dst = NULL; -char * oname_src = NULL; -char * oname_dst = NULL; -char * str_flag = NULL; +static const char * s_opts = "d:f:hi:o:ps:vVE"; +static struct h5_long_options l_opts[] = {{"destination", require_arg, 'd'}, + {"flag", require_arg, 'f'}, + {"help", no_arg, 'h'}, + {"input", require_arg, 'i'}, + {"output", require_arg, 'o'}, + {"parents", no_arg, 'p'}, + {"source", require_arg, 's'}, + {"verbose", no_arg, 'v'}, + {"version", no_arg, 'V'}, + {"enable-error-stack", no_arg, 'E'}, + {NULL, 0, '\0'}}; +char * fname_src = NULL; +char * fname_dst = NULL; +char * oname_src = NULL; +char * oname_dst = NULL; +char * str_flag = NULL; /*------------------------------------------------------------------------- * Function: leave @@ -242,19 +242,19 @@ main(int argc, const char *argv[]) } /* end if */ /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'd': - oname_dst = HDstrdup(opt_arg); + oname_dst = HDstrdup(H5_optarg); break; case 'f': /* validate flag */ - if (parse_flag(opt_arg, &flag) < 0) { + if (parse_flag(H5_optarg, &flag) < 0) { usage(); leave(EXIT_FAILURE); } - str_flag = HDstrdup(opt_arg); + str_flag = HDstrdup(H5_optarg); break; case 'h': @@ -263,11 +263,11 @@ main(int argc, const char *argv[]) break; case 'i': - fname_src = HDstrdup(opt_arg); + fname_src = HDstrdup(H5_optarg); break; case 'o': - fname_dst = HDstrdup(opt_arg); + fname_dst = HDstrdup(H5_optarg); break; case 'p': @@ -275,7 +275,7 @@ main(int argc, const char *argv[]) break; case 's': - oname_src = HDstrdup(opt_arg); + oname_src = HDstrdup(H5_optarg); break; case 'V': diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 1b81824..b669087 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -25,30 +25,30 @@ static int check_d_input(const char *); * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S"; -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, - {"version", no_arg, 'V'}, - {"report", no_arg, 'r'}, - {"verbose", optional_arg, 'v'}, - {"quiet", no_arg, 'q'}, - {"count", require_arg, 'n'}, - {"delta", require_arg, 'd'}, - {"relative", require_arg, 'p'}, - {"nan", no_arg, 'N'}, - {"compare", no_arg, 'c'}, - {"use-system-epsilon", no_arg, 'e'}, - {"follow-symlinks", no_arg, 'l'}, - {"no-dangling-links", no_arg, 'x'}, - {"exclude-path", require_arg, 'E'}, - {"exclude-attribute", require_arg, 'A'}, - {"enable-error-stack", no_arg, 'S'}, - {"vol-value-1", require_arg, '1'}, - {"vol-name-1", require_arg, '2'}, - {"vol-info-1", require_arg, '3'}, - {"vol-value-2", require_arg, '4'}, - {"vol-name-2", require_arg, '5'}, - {"vol-info-2", require_arg, '6'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "hVrv*qn:d:p:NcelxE:A:S"; +static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, + {"version", no_arg, 'V'}, + {"report", no_arg, 'r'}, + {"verbose", optional_arg, 'v'}, + {"quiet", no_arg, 'q'}, + {"count", require_arg, 'n'}, + {"delta", require_arg, 'd'}, + {"relative", require_arg, 'p'}, + {"nan", no_arg, 'N'}, + {"compare", no_arg, 'c'}, + {"use-system-epsilon", no_arg, 'e'}, + {"follow-symlinks", no_arg, 'l'}, + {"no-dangling-links", no_arg, 'x'}, + {"exclude-path", require_arg, 'E'}, + {"exclude-attribute", require_arg, 'A'}, + {"enable-error-stack", no_arg, 'S'}, + {"vol-value-1", require_arg, '1'}, + {"vol-name-1", require_arg, '2'}, + {"vol-info-1", require_arg, '3'}, + {"vol-value-2", require_arg, '4'}, + {"vol-name-2", require_arg, '5'}, + {"vol-info-2", require_arg, '6'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: check_options @@ -232,7 +232,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char exclude_attr_head = NULL; /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { default: usage(); @@ -256,20 +256,20 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char * special check for short opt */ if (!strcmp(argv[i], "-v")) { - if (opt_arg != NULL) - opt_ind--; + if (H5_optarg != NULL) + H5_optind--; opts->mode_verbose_level = 0; break; } else if (!strncmp(argv[i], "-v", (size_t)2)) { - if (opt_arg != NULL) - opt_ind--; + if (H5_optarg != NULL) + H5_optind--; opts->mode_verbose_level = atoi(&argv[i][2]); break; } else { - if (opt_arg != NULL) - opts->mode_verbose_level = HDatoi(opt_arg); + if (H5_optarg != NULL) + opts->mode_verbose_level = HDatoi(H5_optarg); else opts->mode_verbose_level = 0; } @@ -308,7 +308,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char } /* init */ - exclude_node->obj_path = opt_arg; + exclude_node->obj_path = H5_optarg; exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; @@ -336,7 +336,7 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char } /* init */ - exclude_attr_node->obj_path = opt_arg; + exclude_attr_node->obj_path = H5_optarg; exclude_attr_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_attr_prev = exclude_attr_head; @@ -356,23 +356,23 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char case 'd': opts->delta_bool = 1; - if (check_d_input(opt_arg) == -1) { - HDprintf("<-d %s> is not a valid option\n", opt_arg); + if (check_d_input(H5_optarg) == -1) { + HDprintf("<-d %s> is not a valid option\n", H5_optarg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->delta = HDatof(opt_arg); + opts->delta = HDatof(H5_optarg); /* do not check against default, the DBL_EPSILON is being replaced by user */ break; case 'p': opts->percent_bool = 1; - if (check_p_input(opt_arg) == -1) { - HDprintf("<-p %s> is not a valid option\n", opt_arg); + if (check_p_input(H5_optarg) == -1) { + HDprintf("<-p %s> is not a valid option\n", H5_optarg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->percent = HDatof(opt_arg); + opts->percent = HDatof(H5_optarg); /* -p 0 is the same as default */ if (H5_DBL_ABS_EQUAL(opts->percent, 0.0)) @@ -381,12 +381,12 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char case 'n': opts->count_bool = 1; - if (check_n_input(opt_arg) == -1) { - HDprintf("<-n %s> is not a valid option\n", opt_arg); + if (check_n_input(H5_optarg) == -1) { + HDprintf("<-n %s> is not a valid option\n", H5_optarg); usage(); h5diff_exit(EXIT_FAILURE); } - opts->count = HDstrtoull(opt_arg, NULL, 0); + opts->count = HDstrtoull(H5_optarg, NULL, 0); break; case 'N': @@ -403,34 +403,34 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char case '1': opts->vol_info[0].type = VOL_BY_VALUE; - opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(opt_arg); + opts->vol_info[0].u.value = (H5VL_class_value_t)HDatoi(H5_optarg); opts->custom_vol[0] = TRUE; break; case '2': opts->vol_info[0].type = VOL_BY_NAME; - opts->vol_info[0].u.name = opt_arg; + opts->vol_info[0].u.name = H5_optarg; opts->custom_vol[0] = TRUE; break; case '3': - opts->vol_info[0].info_string = opt_arg; + opts->vol_info[0].info_string = H5_optarg; break; case '4': opts->vol_info[1].type = VOL_BY_VALUE; - opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(opt_arg); + opts->vol_info[1].u.value = (H5VL_class_value_t)HDatoi(H5_optarg); opts->custom_vol[1] = TRUE; break; case '5': opts->vol_info[1].type = VOL_BY_NAME; - opts->vol_info[1].u.name = opt_arg; + opts->vol_info[1].u.name = H5_optarg; opts->custom_vol[1] = TRUE; break; case '6': - opts->vol_info[1].info_string = opt_arg; + opts->vol_info[1].info_string = H5_optarg; break; } } @@ -447,15 +447,15 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char opts->exclude_attr = exclude_attr_head; /* check for file names to be processed */ - if (argc <= opt_ind || argv[opt_ind + 1] == NULL) { + if (argc <= H5_optind || argv[H5_optind + 1] == NULL) { error_msg("missing file names\n"); usage(); h5diff_exit(EXIT_FAILURE); } - *fname1 = argv[opt_ind]; - *fname2 = argv[opt_ind + 1]; - *objname1 = argv[opt_ind + 2]; + *fname1 = argv[H5_optind]; + *fname2 = argv[H5_optind + 1]; + *objname1 = argv[H5_optind + 2]; H5TOOLS_DEBUG("file1 = %s", *fname1); H5TOOLS_DEBUG("file2 = %s", *fname2); @@ -466,8 +466,8 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char } H5TOOLS_DEBUG("objname1 = %s", *objname1); - if (argv[opt_ind + 3] != NULL) { - *objname2 = argv[opt_ind + 3]; + if (argv[H5_optind + 3] != NULL) { + *objname2 = argv[H5_optind + 3]; } else { *objname2 = *objname1; diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 9f526da..70f03df 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -80,132 +80,132 @@ struct handler_t { */ /* The following initialization makes use of C language concatenating */ /* "xxx" "yyy" into "xxxyyy". */ -static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:"; -static struct long_options l_opts[] = {{"attribute", require_arg, 'a'}, - {"attribut", require_arg, 'a'}, - {"attribu", require_arg, 'a'}, - {"attrib", require_arg, 'a'}, - {"attri", require_arg, 'a'}, - {"attr", require_arg, 'a'}, - {"att", require_arg, 'a'}, - {"at", require_arg, 'a'}, - {"binary", optional_arg, 'b'}, - {"count", require_arg, 'c'}, - {"coun", require_arg, 'c'}, - {"cou", require_arg, 'c'}, - {"co", require_arg, 'c'}, - {"dataset", require_arg, 'd'}, - {"datase", require_arg, 'd'}, - {"datas", require_arg, 'd'}, - {"escape", no_arg, 'e'}, - {"filedriver", require_arg, 'f'}, - {"filedrive", require_arg, 'f'}, - {"filedriv", require_arg, 'f'}, - {"filedri", require_arg, 'f'}, - {"filedr", require_arg, 'f'}, - {"filed", require_arg, 'f'}, - {"file", require_arg, 'f'}, - {"fil", require_arg, 'f'}, - {"fi", require_arg, 'f'}, - {"group", require_arg, 'g'}, - {"grou", require_arg, 'g'}, - {"gro", require_arg, 'g'}, - {"gr", require_arg, 'g'}, - {"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"object-ids", no_arg, 'i'}, - {"object-id", no_arg, 'i'}, - {"object-i", no_arg, 'i'}, - {"object", no_arg, 'i'}, - {"objec", no_arg, 'i'}, - {"obje", no_arg, 'i'}, - {"obj", no_arg, 'i'}, - {"ob", no_arg, 'i'}, - {"block", require_arg, 'k'}, - {"bloc", require_arg, 'k'}, - {"blo", require_arg, 'k'}, - {"bl", require_arg, 'k'}, - {"soft-link", require_arg, 'l'}, - {"soft-lin", require_arg, 'l'}, - {"soft-li", require_arg, 'l'}, - {"soft-l", require_arg, 'l'}, - {"soft", require_arg, 'l'}, - {"sof", require_arg, 'l'}, - {"format", require_arg, 'm'}, - {"contents", optional_arg, 'n'}, - {"output", optional_arg, 'o'}, - {"outpu", optional_arg, 'o'}, - {"outp", optional_arg, 'o'}, - {"out", optional_arg, 'o'}, - {"ou", optional_arg, 'o'}, - {"properties", no_arg, 'p'}, - {"sort_by", require_arg, 'q'}, - {"string", no_arg, 'r'}, - {"strin", no_arg, 'r'}, - {"start", require_arg, 's'}, - {"star", require_arg, 's'}, - {"sta", require_arg, 's'}, - {"datatype", require_arg, 't'}, - {"datatyp", require_arg, 't'}, - {"dataty", require_arg, 't'}, - {"datat", require_arg, 't'}, - {"use-dtd", no_arg, 'u'}, - {"use-dt", no_arg, 'u'}, - {"use-d", no_arg, 'u'}, - {"use-", no_arg, 'u'}, - {"use", no_arg, 'u'}, - {"us", no_arg, 'u'}, - {"u", no_arg, 'u'}, - {"vds-view-first-missing", no_arg, 'v'}, - {"width", require_arg, 'w'}, - {"widt", require_arg, 'w'}, - {"wid", require_arg, 'w'}, - {"wi", require_arg, 'w'}, - {"xml", no_arg, 'x'}, - {"xm", no_arg, 'x'}, - {"noindex", no_arg, 'y'}, - {"sort_order", require_arg, 'z'}, - {"onlyattr", optional_arg, 'A'}, - {"superblock", no_arg, 'B'}, - {"boot-block", no_arg, 'B'}, - {"boot-bloc", no_arg, 'B'}, - {"boot-blo", no_arg, 'B'}, - {"boot-bl", no_arg, 'B'}, - {"boot-b", no_arg, 'B'}, - {"boot", no_arg, 'B'}, - {"boo", no_arg, 'B'}, - {"bo", no_arg, 'B'}, - {"no-compact-subset", no_arg, 'C'}, - {"xml-dtd", require_arg, 'D'}, - {"xml-dt", require_arg, 'D'}, - {"xml-d", require_arg, 'D'}, - {"enable-error-stack", optional_arg, 'E'}, - {"form", require_arg, 'F'}, - {"vds-gap-size", require_arg, 'G'}, - {"header", no_arg, 'H'}, - {"heade", no_arg, 'H'}, - {"head", no_arg, 'H'}, - {"hea", no_arg, 'H'}, - {"packed-bits", require_arg, 'M'}, - {"any_path", require_arg, 'N'}, - {"ddl", optional_arg, 'O'}, - {"region", no_arg, 'R'}, - {"stride", require_arg, 'S'}, - {"strid", require_arg, 'S'}, - {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, - {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, - {"ver", no_arg, 'V'}, - {"ve", no_arg, 'V'}, - {"xml-ns", require_arg, 'X'}, - {"xml-n", require_arg, 'X'}, - {"s3-cred", require_arg, '$'}, - {"hdfs-attrs", require_arg, '#'}, - {"vol-value", require_arg, '1'}, - {"vol-name", require_arg, '2'}, - {"vol-info", require_arg, '3'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "a:b*c:d:ef:g:hik:l:m:n*o*pq:rs:t:uvw:xyz:A*BCD:E*F:G:HM:N:O*RS:VX:"; +static struct h5_long_options l_opts[] = {{"attribute", require_arg, 'a'}, + {"attribut", require_arg, 'a'}, + {"attribu", require_arg, 'a'}, + {"attrib", require_arg, 'a'}, + {"attri", require_arg, 'a'}, + {"attr", require_arg, 'a'}, + {"att", require_arg, 'a'}, + {"at", require_arg, 'a'}, + {"binary", optional_arg, 'b'}, + {"count", require_arg, 'c'}, + {"coun", require_arg, 'c'}, + {"cou", require_arg, 'c'}, + {"co", require_arg, 'c'}, + {"dataset", require_arg, 'd'}, + {"datase", require_arg, 'd'}, + {"datas", require_arg, 'd'}, + {"escape", no_arg, 'e'}, + {"filedriver", require_arg, 'f'}, + {"filedrive", require_arg, 'f'}, + {"filedriv", require_arg, 'f'}, + {"filedri", require_arg, 'f'}, + {"filedr", require_arg, 'f'}, + {"filed", require_arg, 'f'}, + {"file", require_arg, 'f'}, + {"fil", require_arg, 'f'}, + {"fi", require_arg, 'f'}, + {"group", require_arg, 'g'}, + {"grou", require_arg, 'g'}, + {"gro", require_arg, 'g'}, + {"gr", require_arg, 'g'}, + {"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"object-ids", no_arg, 'i'}, + {"object-id", no_arg, 'i'}, + {"object-i", no_arg, 'i'}, + {"object", no_arg, 'i'}, + {"objec", no_arg, 'i'}, + {"obje", no_arg, 'i'}, + {"obj", no_arg, 'i'}, + {"ob", no_arg, 'i'}, + {"block", require_arg, 'k'}, + {"bloc", require_arg, 'k'}, + {"blo", require_arg, 'k'}, + {"bl", require_arg, 'k'}, + {"soft-link", require_arg, 'l'}, + {"soft-lin", require_arg, 'l'}, + {"soft-li", require_arg, 'l'}, + {"soft-l", require_arg, 'l'}, + {"soft", require_arg, 'l'}, + {"sof", require_arg, 'l'}, + {"format", require_arg, 'm'}, + {"contents", optional_arg, 'n'}, + {"output", optional_arg, 'o'}, + {"outpu", optional_arg, 'o'}, + {"outp", optional_arg, 'o'}, + {"out", optional_arg, 'o'}, + {"ou", optional_arg, 'o'}, + {"properties", no_arg, 'p'}, + {"sort_by", require_arg, 'q'}, + {"string", no_arg, 'r'}, + {"strin", no_arg, 'r'}, + {"start", require_arg, 's'}, + {"star", require_arg, 's'}, + {"sta", require_arg, 's'}, + {"datatype", require_arg, 't'}, + {"datatyp", require_arg, 't'}, + {"dataty", require_arg, 't'}, + {"datat", require_arg, 't'}, + {"use-dtd", no_arg, 'u'}, + {"use-dt", no_arg, 'u'}, + {"use-d", no_arg, 'u'}, + {"use-", no_arg, 'u'}, + {"use", no_arg, 'u'}, + {"us", no_arg, 'u'}, + {"u", no_arg, 'u'}, + {"vds-view-first-missing", no_arg, 'v'}, + {"width", require_arg, 'w'}, + {"widt", require_arg, 'w'}, + {"wid", require_arg, 'w'}, + {"wi", require_arg, 'w'}, + {"xml", no_arg, 'x'}, + {"xm", no_arg, 'x'}, + {"noindex", no_arg, 'y'}, + {"sort_order", require_arg, 'z'}, + {"onlyattr", optional_arg, 'A'}, + {"superblock", no_arg, 'B'}, + {"boot-block", no_arg, 'B'}, + {"boot-bloc", no_arg, 'B'}, + {"boot-blo", no_arg, 'B'}, + {"boot-bl", no_arg, 'B'}, + {"boot-b", no_arg, 'B'}, + {"boot", no_arg, 'B'}, + {"boo", no_arg, 'B'}, + {"bo", no_arg, 'B'}, + {"no-compact-subset", no_arg, 'C'}, + {"xml-dtd", require_arg, 'D'}, + {"xml-dt", require_arg, 'D'}, + {"xml-d", require_arg, 'D'}, + {"enable-error-stack", optional_arg, 'E'}, + {"form", require_arg, 'F'}, + {"vds-gap-size", require_arg, 'G'}, + {"header", no_arg, 'H'}, + {"heade", no_arg, 'H'}, + {"head", no_arg, 'H'}, + {"hea", no_arg, 'H'}, + {"packed-bits", require_arg, 'M'}, + {"any_path", require_arg, 'N'}, + {"ddl", optional_arg, 'O'}, + {"region", no_arg, 'R'}, + {"stride", require_arg, 'S'}, + {"strid", require_arg, 'S'}, + {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, + {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, + {"ver", no_arg, 'V'}, + {"ve", no_arg, 'V'}, + {"xml-ns", require_arg, 'X'}, + {"xml-n", require_arg, 'X'}, + {"s3-cred", require_arg, '$'}, + {"hdfs-attrs", require_arg, '#'}, + {"vol-value", require_arg, '1'}, + {"vol-name", require_arg, '2'}, + {"vol-info", require_arg, '3'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: leave @@ -917,7 +917,7 @@ parse_command_line(int argc, const char *argv[]) } /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { parse_start: switch ((char)opt) { case 'R': @@ -931,8 +931,8 @@ parse_start: case 'n': dump_opts.display_fi = TRUE; last_was_dset = FALSE; - if (opt_arg != NULL) - h5trav_set_verbose(HDatoi(opt_arg)); + if (H5_optarg != NULL) + h5trav_set_verbose(HDatoi(H5_optarg)); break; case 'p': dump_opts.display_dcpl = TRUE; @@ -949,8 +949,8 @@ parse_start: last_was_dset = FALSE; break; case 'A': - if (opt_arg != NULL) { - if (0 == HDatoi(opt_arg)) + if (H5_optarg != NULL) { + if (0 == HDatoi(H5_optarg)) dump_opts.include_attrs = FALSE; } else { @@ -974,7 +974,7 @@ parse_start: goto done; break; case 'w': { - int sh5tools_nCols = HDatoi(opt_arg); + int sh5tools_nCols = HDatoi(H5_optarg); if (sh5tools_nCols <= 0) h5tools_nCols = 65535; @@ -988,7 +988,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_paths; - hand[i].obj = HDstrdup(opt_arg); + hand[i].obj = HDstrdup(H5_optarg); break; } @@ -1000,7 +1000,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_attributes; - hand[i].obj = HDstrdup(opt_arg); + hand[i].obj = HDstrdup(H5_optarg); break; } @@ -1012,7 +1012,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_datasets; - hand[i].obj = HDstrdup(opt_arg); + hand[i].obj = HDstrdup(H5_optarg); hand[i].subset_info = parse_subset_params(hand[i].obj); last_dset = &hand[i]; break; @@ -1021,7 +1021,7 @@ parse_start: last_was_dset = TRUE; break; case 'f': - driver_name_g = opt_arg; + driver_name_g = H5_optarg; break; case 'g': dump_opts.display_all = 0; @@ -1029,7 +1029,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_groups; - hand[i].obj = HDstrdup(opt_arg); + hand[i].obj = HDstrdup(H5_optarg); break; } @@ -1041,7 +1041,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_links; - hand[i].obj = HDstrdup(opt_arg); + hand[i].obj = HDstrdup(H5_optarg); break; } @@ -1053,7 +1053,7 @@ parse_start: for (i = 0; i < argc; i++) if (!hand[i].func) { hand[i].func = handle_datatypes; - hand[i].obj = HDstrdup(opt_arg); + hand[i].obj = HDstrdup(H5_optarg); break; } @@ -1061,7 +1061,7 @@ parse_start: break; case 'O': - if (h5tools_set_output_file(opt_arg, 0) < 0) { + if (h5tools_set_output_file(H5_optarg, 0) < 0) { usage(h5tools_getprogname()); goto error; } @@ -1069,20 +1069,20 @@ parse_start: case 'o': if (bin_output) { - if (h5tools_set_data_output_file(opt_arg, 1) < 0) { + if (h5tools_set_data_output_file(H5_optarg, 1) < 0) { usage(h5tools_getprogname()); goto error; } } else { if (dump_opts.display_attr_data && !dump_opts.display_data) { - if (h5tools_set_attr_output_file(opt_arg, 0) < 0) { + if (h5tools_set_attr_output_file(H5_optarg, 0) < 0) { usage(h5tools_getprogname()); goto error; } } if (dump_opts.display_data || dump_opts.display_all) { - if (h5tools_set_data_output_file(opt_arg, 0) < 0) { + if (h5tools_set_data_output_file(H5_optarg, 0) < 0) { usage(h5tools_getprogname()); goto error; } @@ -1091,12 +1091,12 @@ parse_start: dump_opts.usingdasho = TRUE; last_was_dset = FALSE; - outfname_g = opt_arg; + outfname_g = H5_optarg; break; case 'b': - if (opt_arg != NULL) { - if ((bin_form = set_binary_form(opt_arg)) < 0) { + if (H5_optarg != NULL) { + if ((bin_form = set_binary_form(H5_optarg)) < 0) { /* failed to set binary form */ usage(h5tools_getprogname()); goto error; @@ -1115,7 +1115,7 @@ parse_start: break; case 'q': - if ((sort_by = set_sort_by(opt_arg)) < 0) { + if ((sort_by = set_sort_by(H5_optarg)) < 0) { /* failed to set "sort by" form */ usage(h5tools_getprogname()); goto error; @@ -1123,7 +1123,7 @@ parse_start: break; case 'z': - if ((sort_order = set_sort_order(opt_arg)) < 0) { + if ((sort_order = set_sort_order(H5_optarg)) < 0) { /* failed to set "sort order" form */ usage(h5tools_getprogname()); goto error; @@ -1135,7 +1135,7 @@ parse_start: error_msg("option \"-%c\" can only be used after --dataset option\n", opt); goto error; } - if (parse_mask_list(opt_arg) != SUCCEED) { + if (parse_mask_list(H5_optarg) != SUCCEED) { usage(h5tools_getprogname()); goto error; } @@ -1145,7 +1145,7 @@ parse_start: dump_opts.display_vds_first = TRUE; break; case 'G': - dump_opts.vds_gap_size = HDatoi(opt_arg); + dump_opts.vds_gap_size = HDatoi(H5_optarg); if (dump_opts.vds_gap_size < 0) { usage(h5tools_getprogname()); goto error; @@ -1172,13 +1172,13 @@ parse_start: case 'D': /* specify alternative XML DTD or schema */ /* To Do: check format of this value? */ - xml_dtd_uri_g = opt_arg; + xml_dtd_uri_g = H5_optarg; h5tools_nCols = 0; break; case 'm': /* specify alternative floating point printing format */ - fp_format = opt_arg; + fp_format = H5_optarg; h5tools_nCols = 0; break; @@ -1189,10 +1189,10 @@ parse_start: usage(h5tools_getprogname()); goto error; } - if (HDstrcmp(opt_arg, ":") == 0) + if (HDstrcmp(H5_optarg, ":") == 0) xmlnsprefix = ""; else - xmlnsprefix = opt_arg; + xmlnsprefix = H5_optarg; h5tools_nCols = 0; break; /** end XML parameters **/ @@ -1238,33 +1238,33 @@ parse_start: HDfree(s->start.data); s->start.data = NULL; } - parse_hsize_list(opt_arg, &s->start); + parse_hsize_list(H5_optarg, &s->start); break; case 'S': if (s->stride.data) { HDfree(s->stride.data); s->stride.data = NULL; } - parse_hsize_list(opt_arg, &s->stride); + parse_hsize_list(H5_optarg, &s->stride); break; case 'c': if (s->count.data) { HDfree(s->count.data); s->count.data = NULL; } - parse_hsize_list(opt_arg, &s->count); + parse_hsize_list(H5_optarg, &s->count); break; case 'k': if (s->block.data) { HDfree(s->block.data); s->block.data = NULL; } - parse_hsize_list(opt_arg, &s->block); + parse_hsize_list(H5_optarg, &s->block); break; default: goto end_collect; } - } while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF); + } while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF); end_collect: last_was_dset = FALSE; @@ -1277,8 +1277,8 @@ end_collect: /** end subsetting parameters **/ case 'E': - if (opt_arg != NULL) - enable_error_stack = HDatoi(opt_arg); + if (H5_optarg != NULL) + enable_error_stack = HDatoi(H5_optarg); else enable_error_stack = 1; break; @@ -1294,7 +1294,7 @@ end_collect: case '$': #ifdef H5_HAVE_ROS3_VFD - if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa_g) < 0) { + if (h5tools_parse_ros3_fapl_tuple(H5_optarg, ',', &ros3_fa_g) < 0) { error_msg("failed to parse S3 VFD credential info\n"); usage(h5tools_getprogname()); free_handler(hand, argc); @@ -1311,7 +1311,7 @@ end_collect: case '#': #ifdef H5_HAVE_LIBHDFS - if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa_g) < 0) { + if (h5tools_parse_hdfs_fapl_tuple(H5_optarg, ',', &hdfs_fa_g) < 0) { error_msg("failed to parse HDFS VFD configuration info\n"); usage(h5tools_getprogname()); free_handler(hand, argc); @@ -1328,18 +1328,18 @@ end_collect: case '1': vol_info_g.type = VOL_BY_VALUE; - vol_info_g.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + vol_info_g.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); use_custom_vol_g = TRUE; break; case '2': vol_info_g.type = VOL_BY_NAME; - vol_info_g.u.name = opt_arg; + vol_info_g.u.name = H5_optarg; use_custom_vol_g = TRUE; break; case '3': - vol_info_g.info_string = opt_arg; + vol_info_g.info_string = H5_optarg; break; case '?': @@ -1351,7 +1351,7 @@ end_collect: parse_end: /* check for file name to be processed */ - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); goto error; @@ -1443,7 +1443,7 @@ main(int argc, const char *argv[]) } } - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); @@ -1496,8 +1496,8 @@ main(int argc, const char *argv[]) } } - while (opt_ind < argc) { - fname = HDstrdup(argv[opt_ind++]); + while (H5_optind < argc) { + fname = HDstrdup(argv[H5_optind++]); fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl_id, (fapl_id == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0); diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index 321f274..3430c55 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -38,28 +38,28 @@ static int verbose_g = 0; * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "hVvd:n"; -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"version", no_arg, 'V'}, - {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, - {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, - {"verbose", no_arg, 'v'}, - {"verbos", no_arg, 'v'}, - {"verbo", no_arg, 'v'}, - {"verb", no_arg, 'v'}, - {"dname", require_arg, 'd'}, - {"dnam", require_arg, 'd'}, - {"dna", require_arg, 'd'}, - {"dn", require_arg, 'd'}, - {"noop", no_arg, 'n'}, - {"noo", no_arg, 'n'}, - {"no", no_arg, 'n'}, - {"enable-error-stack", no_arg, 'E'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "hVvd:n"; +static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"version", no_arg, 'V'}, + {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, + {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, + {"verbose", no_arg, 'v'}, + {"verbos", no_arg, 'v'}, + {"verbo", no_arg, 'v'}, + {"verb", no_arg, 'v'}, + {"dname", require_arg, 'd'}, + {"dnam", require_arg, 'd'}, + {"dna", require_arg, 'd'}, + {"dn", require_arg, 'd'}, + {"noop", no_arg, 'n'}, + {"noo", no_arg, 'n'}, + {"no", no_arg, 'n'}, + {"enable-error-stack", no_arg, 'E'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -123,7 +123,7 @@ parse_command_line(int argc, const char **argv) } /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': usage(h5tools_getprogname()); @@ -140,11 +140,11 @@ parse_command_line(int argc, const char **argv) break; case 'd': /* -d dname */ - if (opt_arg != NULL && *opt_arg) - dname_g = HDstrdup(opt_arg); + if (H5_optarg != NULL && *H5_optarg) + dname_g = HDstrdup(H5_optarg); if (dname_g == NULL) { h5tools_setstatus(EXIT_FAILURE); - error_msg("No dataset name\n", opt_arg); + error_msg("No dataset name\n", H5_optarg); usage(h5tools_getprogname()); goto error; } @@ -167,19 +167,19 @@ parse_command_line(int argc, const char **argv) } /* switch */ } /* while */ - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); goto error; } - fname_g = HDstrdup(argv[opt_ind]); + fname_g = HDstrdup(argv[H5_optind]); - return (0); + return 0; error: - return (-1); + return -1; ; } /* parse_command_line() */ diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 5bcbf45..0a2ea5d 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -34,8 +34,8 @@ char *ub_file = NULL; * parameters. The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char * s_opts = "hi:u:o:c:V"; /* add more later ? */ -static struct long_options l_opts[] = { +static const char * s_opts = "hi:u:o:c:V"; /* add more later ? */ +static struct h5_long_options l_opts[] = { {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */ {"u", require_arg, 'u'}, /* user block file */ {"o", require_arg, 'o'}, /* output file */ @@ -113,16 +113,16 @@ parse_command_line(int argc, const char *argv[]) int opt = FALSE; /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'o': - output_file = HDstrdup(opt_arg); + output_file = HDstrdup(H5_optarg); break; case 'i': - input_file = HDstrdup(opt_arg); + input_file = HDstrdup(H5_optarg); break; case 'u': - ub_file = HDstrdup(opt_arg); + ub_file = HDstrdup(H5_optarg); break; case 'c': do_clobber = TRUE; diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index cde7ec7..38d1a5e 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -35,8 +35,8 @@ char *ub_file = NULL; * parameters. The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char * s_opts = "hu:i:o:d:V"; -static struct long_options l_opts[] = { +static const char * s_opts = "hu:i:o:d:V"; +static struct h5_long_options l_opts[] = { {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {"i", require_arg, 'i'}, /* input file */ {"u", require_arg, 'u'}, /* user block file */ {"o", require_arg, 'o'}, /* output file */ @@ -101,23 +101,23 @@ parse_command_line(int argc, const char *argv[]) int opt = FALSE; /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'o': - output_file = HDstrdup(opt_arg); + output_file = HDstrdup(H5_optarg); if (output_file) h5tools_set_data_output_file(output_file, 1); break; case 'i': - input_file = HDstrdup(opt_arg); + input_file = HDstrdup(H5_optarg); if (input_file) h5tools_set_input_file(input_file, 1); break; ; case 'u': - ub_file = HDstrdup(opt_arg); + ub_file = HDstrdup(H5_optarg); if (ub_file) h5tools_set_output_file(ub_file, 1); else diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 474a56f..3526268 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -31,44 +31,44 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:"; -static struct long_options l_opts[] = {{"alignment", require_arg, 'a'}, - {"block", require_arg, 'b'}, - {"compact", require_arg, 'c'}, - {"indexed", require_arg, 'd'}, - {"file", require_arg, 'e'}, - {"filter", require_arg, 'f'}, - {"help", no_arg, 'h'}, - {"infile", require_arg, 'i'}, /* for backward compability */ - {"low", require_arg, 'j'}, - {"high", require_arg, 'k'}, - {"layout", require_arg, 'l'}, - {"minimum", require_arg, 'm'}, - {"native", no_arg, 'n'}, - {"outfile", require_arg, 'o'}, /* for backward compability */ - {"sort_by", require_arg, 'q'}, - {"ssize", require_arg, 's'}, - {"threshold", require_arg, 't'}, - {"ublock", require_arg, 'u'}, - {"verbose", no_arg, 'v'}, - {"sort_order", require_arg, 'z'}, - {"enable-error-stack", no_arg, 'E'}, - {"fs_pagesize", require_arg, 'G'}, - {"latest", no_arg, 'L'}, - {"metadata_block_size", require_arg, 'M'}, - {"fs_persist", require_arg, 'P'}, - {"fs_strategy", require_arg, 'S'}, - {"fs_threshold", require_arg, 'T'}, - {"version", no_arg, 'V'}, - {"merge", no_arg, 'X'}, - {"prune", no_arg, 'W'}, - {"src-vol-value", require_arg, '1'}, - {"src-vol-name", require_arg, '2'}, - {"src-vol-info", require_arg, '3'}, - {"dst-vol-value", require_arg, '4'}, - {"dst-vol-name", require_arg, '5'}, - {"dst-vol-info", require_arg, '6'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:"; +static struct h5_long_options l_opts[] = {{"alignment", require_arg, 'a'}, + {"block", require_arg, 'b'}, + {"compact", require_arg, 'c'}, + {"indexed", require_arg, 'd'}, + {"file", require_arg, 'e'}, + {"filter", require_arg, 'f'}, + {"help", no_arg, 'h'}, + {"infile", require_arg, 'i'}, /* for backward compability */ + {"low", require_arg, 'j'}, + {"high", require_arg, 'k'}, + {"layout", require_arg, 'l'}, + {"minimum", require_arg, 'm'}, + {"native", no_arg, 'n'}, + {"outfile", require_arg, 'o'}, /* for backward compability */ + {"sort_by", require_arg, 'q'}, + {"ssize", require_arg, 's'}, + {"threshold", require_arg, 't'}, + {"ublock", require_arg, 'u'}, + {"verbose", no_arg, 'v'}, + {"sort_order", require_arg, 'z'}, + {"enable-error-stack", no_arg, 'E'}, + {"fs_pagesize", require_arg, 'G'}, + {"latest", no_arg, 'L'}, + {"metadata_block_size", require_arg, 'M'}, + {"fs_persist", require_arg, 'P'}, + {"fs_strategy", require_arg, 'S'}, + {"fs_threshold", require_arg, 'T'}, + {"version", no_arg, 'V'}, + {"merge", no_arg, 'X'}, + {"prune", no_arg, 'W'}, + {"src-vol-value", require_arg, '1'}, + {"src-vol-name", require_arg, '2'}, + {"src-vol-info", require_arg, '3'}, + {"dst-vol-value", require_arg, '4'}, + {"dst-vol-name", require_arg, '5'}, + {"dst-vol-info", require_arg, '6'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -497,18 +497,18 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) HDmemset(&out_vol_info, 0, sizeof(h5tools_vol_info_t)); /* parse command line options */ - while (EOF != (opt = get_option(argc, argv, s_opts, l_opts))) { + while (EOF != (opt = H5_get_option(argc, argv, s_opts, l_opts))) { switch ((char)opt) { /* -i for backward compatibility */ case 'i': - infile = opt_arg; + infile = H5_optarg; has_i++; break; /* -o for backward compatibility */ case 'o': - outfile = opt_arg; + outfile = H5_optarg; has_o++; break; @@ -530,7 +530,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 'f': /* parse the -f filter option */ - if (h5repack_addfilter(opt_arg, options) < 0) { + if (h5repack_addfilter(H5_optarg, options) < 0) { error_msg("in parsing filter\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; @@ -540,7 +540,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 'l': /* parse the -l layout option */ - if (h5repack_addlayout(opt_arg, options) < 0) { + if (h5repack_addlayout(H5_optarg, options) < 0) { error_msg("in parsing layout\n"); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; @@ -549,9 +549,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'm': - options->min_comp = HDstrtoull(opt_arg, NULL, 0); + options->min_comp = HDstrtoull(H5_optarg, NULL, 0); if ((int)options->min_comp <= 0) { - error_msg("invalid minimum compress size <%s>\n", opt_arg); + error_msg("invalid minimum compress size <%s>\n", H5_optarg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -559,8 +559,8 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'e': - if ((ret_value = read_info(opt_arg, options)) < 0) { - error_msg("failed to read from repack options file <%s>\n", opt_arg); + if ((ret_value = read_info(H5_optarg, options)) < 0) { + error_msg("failed to read from repack options file <%s>\n", H5_optarg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -576,7 +576,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'j': - bound = HDatoi(opt_arg); + bound = HDatoi(H5_optarg); if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) { error_msg("in parsing low bound\n"); h5tools_setstatus(EXIT_FAILURE); @@ -587,7 +587,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'k': - bound = HDatoi(opt_arg); + bound = HDatoi(H5_optarg); if (bound < H5F_LIBVER_EARLIEST || bound > H5F_LIBVER_LATEST) { error_msg("in parsing high bound\n"); h5tools_setstatus(EXIT_FAILURE); @@ -606,13 +606,13 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'c': - options->grp_compact = HDatoi(opt_arg); + options->grp_compact = HDatoi(H5_optarg); if (options->grp_compact > 0) options->latest = TRUE; /* must use latest format */ break; case 'd': - options->grp_indexed = HDatoi(opt_arg); + options->grp_indexed = HDatoi(H5_optarg); if (options->grp_indexed > 0) options->latest = TRUE; /* must use latest format */ break; @@ -620,10 +620,10 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 's': { int idx = 0; int ssize = 0; - char *msgPtr = HDstrchr(opt_arg, ':'); + char *msgPtr = HDstrchr(H5_optarg, ':'); options->latest = TRUE; /* must use latest format */ if (msgPtr == NULL) { - ssize = HDatoi(opt_arg); + ssize = HDatoi(H5_optarg); for (idx = 0; idx < 5; idx++) options->msg_size[idx] = ssize; } @@ -632,7 +632,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) HDstrcpy(msgType, msgPtr + 1); msgPtr[0] = '\0'; - ssize = HDatoi(opt_arg); + ssize = HDatoi(H5_optarg); if (!HDstrncmp(msgType, "dspace", 6)) options->msg_size[0] = ssize; else if (!HDstrncmp(msgType, "dtype", 5)) @@ -647,25 +647,25 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) } break; case 'u': - options->ublock_filename = opt_arg; + options->ublock_filename = H5_optarg; break; case 'b': - options->ublock_size = (hsize_t)HDatol(opt_arg); + options->ublock_size = (hsize_t)HDatol(H5_optarg); break; case 'M': - options->meta_block_size = (hsize_t)HDatol(opt_arg); + options->meta_block_size = (hsize_t)HDatol(H5_optarg); break; case 't': - options->threshold = (hsize_t)HDatol(opt_arg); + options->threshold = (hsize_t)HDatol(H5_optarg); break; case 'a': - options->alignment = HDstrtoull(opt_arg, NULL, 0); + options->alignment = HDstrtoull(H5_optarg, NULL, 0); if (options->alignment < 1) { - error_msg("invalid alignment size\n", opt_arg); + error_msg("invalid alignment size\n", H5_optarg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -675,7 +675,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case 'S': { char strategy[MAX_NC_NAME]; - HDstrcpy(strategy, opt_arg); + HDstrcpy(strategy, H5_optarg); if (!HDstrcmp(strategy, "FSM_AGGR")) options->fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; else if (!HDstrcmp(strategy, "PAGE")) @@ -685,7 +685,7 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) else if (!HDstrcmp(strategy, "NONE")) options->fs_strategy = H5F_FSPACE_STRATEGY_NONE; else { - error_msg("invalid file space management strategy\n", opt_arg); + error_msg("invalid file space management strategy\n", H5_optarg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -696,29 +696,29 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) } break; case 'P': - options->fs_persist = HDatoi(opt_arg); + options->fs_persist = HDatoi(H5_optarg); if (options->fs_persist == 0) /* To distinguish the "specified" zero value */ options->fs_persist = -1; break; case 'T': - options->fs_threshold = HDatol(opt_arg); + options->fs_threshold = HDatol(H5_optarg); if (options->fs_threshold == 0) /* To distinguish the "specified" zero value */ options->fs_threshold = -1; break; case 'G': - options->fs_pagesize = HDstrtoll(opt_arg, NULL, 0); + options->fs_pagesize = HDstrtoll(H5_optarg, NULL, 0); if (options->fs_pagesize == 0) /* To distinguish the "specified" zero value */ options->fs_pagesize = -1; break; case 'q': - if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(opt_arg))) { - error_msg("failed to set sort by form <%s>\n", opt_arg); + if (H5_INDEX_UNKNOWN == (sort_by = set_sort_by(H5_optarg))) { + error_msg("failed to set sort by form <%s>\n", H5_optarg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -726,8 +726,8 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) break; case 'z': - if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(opt_arg))) { - error_msg("failed to set sort order form <%s>\n", opt_arg); + if (H5_ITER_UNKNOWN == (sort_order = set_sort_order(H5_optarg))) { + error_msg("failed to set sort order form <%s>\n", H5_optarg); h5tools_setstatus(EXIT_FAILURE); ret_value = -1; goto done; @@ -740,34 +740,34 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) case '1': in_vol_info.type = VOL_BY_VALUE; - in_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + in_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); custom_in_fapl = TRUE; break; case '2': in_vol_info.type = VOL_BY_NAME; - in_vol_info.u.name = opt_arg; + in_vol_info.u.name = H5_optarg; custom_in_fapl = TRUE; break; case '3': - in_vol_info.info_string = opt_arg; + in_vol_info.info_string = H5_optarg; break; case '4': out_vol_info.type = VOL_BY_VALUE; - out_vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + out_vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); custom_out_fapl = TRUE; break; case '5': out_vol_info.type = VOL_BY_NAME; - out_vol_info.u.name = opt_arg; + out_vol_info.u.name = H5_optarg; custom_out_fapl = TRUE; break; case '6': - out_vol_info.info_string = opt_arg; + out_vol_info.info_string = H5_optarg; break; default: @@ -777,9 +777,9 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) /* If neither -i nor -o given, get in and out files positionally */ if (0 == (has_i + has_o)) { - if (argv[opt_ind] != NULL && argv[opt_ind + 1] != NULL) { - infile = argv[opt_ind]; - outfile = argv[opt_ind + 1]; + if (argv[H5_optind] != NULL && argv[H5_optind + 1] != NULL) { + infile = argv[H5_optind]; + outfile = argv[H5_optind + 1]; if (!HDstrcmp(infile, outfile)) { error_msg("file names cannot be the same\n"); diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index e091a8a..3bf641a 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -171,106 +171,106 @@ struct handler_t { static const char *s_opts = "Aa:Ddm:EFfhGgl:sSTO:Vw:H:"; /* e.g. "filemetadata" has to precede "file"; "groupmetadata" has to precede "group" etc. */ -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"filemetadata", no_arg, 'F'}, - {"filemetadat", no_arg, 'F'}, - {"filemetada", no_arg, 'F'}, - {"filemetad", no_arg, 'F'}, - {"filemeta", no_arg, 'F'}, - {"filemet", no_arg, 'F'}, - {"fileme", no_arg, 'F'}, - {"filem", no_arg, 'F'}, - {"file", no_arg, 'f'}, - {"fil", no_arg, 'f'}, - {"fi", no_arg, 'f'}, - {"groupmetadata", no_arg, 'G'}, - {"groupmetadat", no_arg, 'G'}, - {"groupmetada", no_arg, 'G'}, - {"groupmetad", no_arg, 'G'}, - {"groupmeta", no_arg, 'G'}, - {"groupmet", no_arg, 'G'}, - {"groupme", no_arg, 'G'}, - {"groupm", no_arg, 'G'}, - {"group", no_arg, 'g'}, - {"grou", no_arg, 'g'}, - {"gro", no_arg, 'g'}, - {"gr", no_arg, 'g'}, - {"links", require_arg, 'l'}, - {"link", require_arg, 'l'}, - {"lin", require_arg, 'l'}, - {"li", require_arg, 'l'}, - {"dsetmetadata", no_arg, 'D'}, - {"dsetmetadat", no_arg, 'D'}, - {"dsetmetada", no_arg, 'D'}, - {"dsetmetad", no_arg, 'D'}, - {"dsetmeta", no_arg, 'D'}, - {"dsetmet", no_arg, 'D'}, - {"dsetme", no_arg, 'D'}, - {"dsetm", no_arg, 'D'}, - {"dset", no_arg, 'd'}, - {"dse", no_arg, 'd'}, - {"ds", no_arg, 'd'}, - {"dims", require_arg, 'm'}, - {"dim", require_arg, 'm'}, - {"di", require_arg, 'm'}, - {"dtypemetadata", no_arg, 'T'}, - {"dtypemetadat", no_arg, 'T'}, - {"dtypemetada", no_arg, 'T'}, - {"dtypemetad", no_arg, 'T'}, - {"dtypemeta", no_arg, 'T'}, - {"dtypemet", no_arg, 'T'}, - {"dtypeme", no_arg, 'T'}, - {"dtypem", no_arg, 'T'}, - {"dtype", no_arg, 'T'}, - {"dtyp", no_arg, 'T'}, - {"dty", no_arg, 'T'}, - {"dt", no_arg, 'T'}, - {"object", require_arg, 'O'}, - {"objec", require_arg, 'O'}, - {"obje", require_arg, 'O'}, - {"obj", require_arg, 'O'}, - {"ob", require_arg, 'O'}, - {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, - {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, - {"ver", no_arg, 'V'}, - {"ve", no_arg, 'V'}, - {"attribute", no_arg, 'A'}, - {"attribut", no_arg, 'A'}, - {"attribu", no_arg, 'A'}, - {"attrib", no_arg, 'A'}, - {"attri", no_arg, 'A'}, - {"attr", no_arg, 'A'}, - {"att", no_arg, 'A'}, - {"at", no_arg, 'A'}, - {"enable-error-stack", no_arg, 'E'}, - {"numattrs", require_arg, 'a'}, - {"numattr", require_arg, 'a'}, - {"numatt", require_arg, 'a'}, - {"numat", require_arg, 'a'}, - {"numa", require_arg, 'a'}, - {"num", require_arg, 'a'}, - {"nu", require_arg, 'a'}, - {"freespace", no_arg, 's'}, - {"freespac", no_arg, 's'}, - {"freespa", no_arg, 's'}, - {"freesp", no_arg, 's'}, - {"frees", no_arg, 's'}, - {"free", no_arg, 's'}, - {"fre", no_arg, 's'}, - {"fr", no_arg, 's'}, - {"summary", no_arg, 'S'}, - {"summar", no_arg, 'S'}, - {"summa", no_arg, 'S'}, - {"summ", no_arg, 'S'}, - {"sum", no_arg, 'S'}, - {"su", no_arg, 'S'}, - {"s3-cred", require_arg, 'w'}, - {"hdfs-attrs", require_arg, 'H'}, - {NULL, 0, '\0'}}; +static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"filemetadata", no_arg, 'F'}, + {"filemetadat", no_arg, 'F'}, + {"filemetada", no_arg, 'F'}, + {"filemetad", no_arg, 'F'}, + {"filemeta", no_arg, 'F'}, + {"filemet", no_arg, 'F'}, + {"fileme", no_arg, 'F'}, + {"filem", no_arg, 'F'}, + {"file", no_arg, 'f'}, + {"fil", no_arg, 'f'}, + {"fi", no_arg, 'f'}, + {"groupmetadata", no_arg, 'G'}, + {"groupmetadat", no_arg, 'G'}, + {"groupmetada", no_arg, 'G'}, + {"groupmetad", no_arg, 'G'}, + {"groupmeta", no_arg, 'G'}, + {"groupmet", no_arg, 'G'}, + {"groupme", no_arg, 'G'}, + {"groupm", no_arg, 'G'}, + {"group", no_arg, 'g'}, + {"grou", no_arg, 'g'}, + {"gro", no_arg, 'g'}, + {"gr", no_arg, 'g'}, + {"links", require_arg, 'l'}, + {"link", require_arg, 'l'}, + {"lin", require_arg, 'l'}, + {"li", require_arg, 'l'}, + {"dsetmetadata", no_arg, 'D'}, + {"dsetmetadat", no_arg, 'D'}, + {"dsetmetada", no_arg, 'D'}, + {"dsetmetad", no_arg, 'D'}, + {"dsetmeta", no_arg, 'D'}, + {"dsetmet", no_arg, 'D'}, + {"dsetme", no_arg, 'D'}, + {"dsetm", no_arg, 'D'}, + {"dset", no_arg, 'd'}, + {"dse", no_arg, 'd'}, + {"ds", no_arg, 'd'}, + {"dims", require_arg, 'm'}, + {"dim", require_arg, 'm'}, + {"di", require_arg, 'm'}, + {"dtypemetadata", no_arg, 'T'}, + {"dtypemetadat", no_arg, 'T'}, + {"dtypemetada", no_arg, 'T'}, + {"dtypemetad", no_arg, 'T'}, + {"dtypemeta", no_arg, 'T'}, + {"dtypemet", no_arg, 'T'}, + {"dtypeme", no_arg, 'T'}, + {"dtypem", no_arg, 'T'}, + {"dtype", no_arg, 'T'}, + {"dtyp", no_arg, 'T'}, + {"dty", no_arg, 'T'}, + {"dt", no_arg, 'T'}, + {"object", require_arg, 'O'}, + {"objec", require_arg, 'O'}, + {"obje", require_arg, 'O'}, + {"obj", require_arg, 'O'}, + {"ob", require_arg, 'O'}, + {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, + {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, + {"ver", no_arg, 'V'}, + {"ve", no_arg, 'V'}, + {"attribute", no_arg, 'A'}, + {"attribut", no_arg, 'A'}, + {"attribu", no_arg, 'A'}, + {"attrib", no_arg, 'A'}, + {"attri", no_arg, 'A'}, + {"attr", no_arg, 'A'}, + {"att", no_arg, 'A'}, + {"at", no_arg, 'A'}, + {"enable-error-stack", no_arg, 'E'}, + {"numattrs", require_arg, 'a'}, + {"numattr", require_arg, 'a'}, + {"numatt", require_arg, 'a'}, + {"numat", require_arg, 'a'}, + {"numa", require_arg, 'a'}, + {"num", require_arg, 'a'}, + {"nu", require_arg, 'a'}, + {"freespace", no_arg, 's'}, + {"freespac", no_arg, 's'}, + {"freespa", no_arg, 's'}, + {"freesp", no_arg, 's'}, + {"frees", no_arg, 's'}, + {"free", no_arg, 's'}, + {"fre", no_arg, 's'}, + {"fr", no_arg, 's'}, + {"summary", no_arg, 'S'}, + {"summar", no_arg, 'S'}, + {"summa", no_arg, 'S'}, + {"summ", no_arg, 'S'}, + {"sum", no_arg, 'S'}, + {"su", no_arg, 'S'}, + {"s3-cred", require_arg, 'w'}, + {"hdfs-attrs", require_arg, 'H'}, + {NULL, 0, '\0'}}; static void leave(int ret) @@ -920,7 +920,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) struct handler_t *hand = NULL; /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': usage(h5tools_getprogname()); @@ -959,8 +959,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) break; case 'l': - if (opt_arg) { - sgroups_threshold = HDatoi(opt_arg); + if (H5_optarg) { + sgroups_threshold = HDatoi(H5_optarg); if (sgroups_threshold < 1) { error_msg("Invalid threshold for small groups\n"); goto error; @@ -982,8 +982,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) break; case 'm': - if (opt_arg) { - sdsets_threshold = HDatoi(opt_arg); + if (H5_optarg) { + sdsets_threshold = HDatoi(H5_optarg); if (sdsets_threshold < 1) { error_msg("Invalid threshold for small datasets\n"); goto error; @@ -1005,8 +1005,8 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) break; case 'a': - if (opt_arg) { - sattrs_threshold = HDatoi(opt_arg); + if (H5_optarg) { + sattrs_threshold = HDatoi(H5_optarg); if (sattrs_threshold < 1) { error_msg("Invalid threshold for small # of attributes\n"); goto error; @@ -1046,7 +1046,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) /* Store object names */ for (u = 0; u < hand->obj_count; u++) - if (NULL == (hand->obj[u] = HDstrdup(opt_arg))) { + if (NULL == (hand->obj[u] = HDstrdup(H5_optarg))) { error_msg("unable to allocate memory for object name\n"); goto error; } /* end if */ @@ -1054,7 +1054,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) case 'w': #ifdef H5_HAVE_ROS3_VFD - if (h5tools_parse_ros3_fapl_tuple(opt_arg, ',', &ros3_fa) < 0) { + if (h5tools_parse_ros3_fapl_tuple(H5_optarg, ',', &ros3_fa) < 0) { error_msg("failed to parse S3 VFD credential info\n"); goto error; } @@ -1068,7 +1068,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) case 'H': #ifdef H5_HAVE_LIBHDFS - if (h5tools_parse_hdfs_fapl_tuple(opt_arg, ',', &hdfs_fa) < 0) { + if (h5tools_parse_hdfs_fapl_tuple(H5_optarg, ',', &hdfs_fa) < 0) { error_msg("failed to parse HDFS VFD configuration info\n"); goto error; } @@ -1087,7 +1087,7 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) } /* end while */ /* check for file name to be processed */ - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); goto error; @@ -1811,7 +1811,7 @@ main(int argc, const char *argv[]) } } - fname = argv[opt_ind]; + fname = argv[H5_optind]; /* Check for filename given */ if (fname) { diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index ac7c0ca..524ad03 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -44,40 +44,40 @@ static hsize_t increment = DEFAULT_INCREMENT; /* * Command-line options: only publicize long options */ -static const char * s_opts = "hVsmzi*"; -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"version", no_arg, 'V'}, - {"version", no_arg, 'V'}, - {"versio", no_arg, 'V'}, - {"versi", no_arg, 'V'}, - {"vers", no_arg, 'V'}, - {"status", no_arg, 's'}, - {"statu", no_arg, 's'}, - {"stat", no_arg, 's'}, - {"sta", no_arg, 's'}, - {"st", no_arg, 's'}, - {"image", no_arg, 'm'}, - {"imag", no_arg, 'm'}, - {"ima", no_arg, 'm'}, - {"im", no_arg, 'm'}, - {"filesize", no_arg, 'z'}, - {"filesiz", no_arg, 'z'}, - {"filesi", no_arg, 'z'}, - {"files", no_arg, 'z'}, - {"file", no_arg, 'z'}, - {"fil", no_arg, 'z'}, - {"fi", no_arg, 'z'}, - {"increment", optional_arg, 'i'}, - {"incremen", optional_arg, 'i'}, - {"increme", optional_arg, 'i'}, - {"increm", optional_arg, 'i'}, - {"incre", optional_arg, 'i'}, - {"incr", optional_arg, 'i'}, - {"inc", optional_arg, 'i'}, - {"in", optional_arg, 'i'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "hVsmzi*"; +static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"version", no_arg, 'V'}, + {"version", no_arg, 'V'}, + {"versio", no_arg, 'V'}, + {"versi", no_arg, 'V'}, + {"vers", no_arg, 'V'}, + {"status", no_arg, 's'}, + {"statu", no_arg, 's'}, + {"stat", no_arg, 's'}, + {"sta", no_arg, 's'}, + {"st", no_arg, 's'}, + {"image", no_arg, 'm'}, + {"imag", no_arg, 'm'}, + {"ima", no_arg, 'm'}, + {"im", no_arg, 'm'}, + {"filesize", no_arg, 'z'}, + {"filesiz", no_arg, 'z'}, + {"filesi", no_arg, 'z'}, + {"files", no_arg, 'z'}, + {"file", no_arg, 'z'}, + {"fil", no_arg, 'z'}, + {"fi", no_arg, 'z'}, + {"increment", optional_arg, 'i'}, + {"incremen", optional_arg, 'i'}, + {"increme", optional_arg, 'i'}, + {"increm", optional_arg, 'i'}, + {"incre", optional_arg, 'i'}, + {"incr", optional_arg, 'i'}, + {"inc", optional_arg, 'i'}, + {"in", optional_arg, 'i'}, + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -150,7 +150,7 @@ parse_command_line(int argc, const char **argv) } /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': usage(h5tools_getprogname()); @@ -176,12 +176,12 @@ parse_command_line(int argc, const char **argv) case 'i': increment_eoa_eof = TRUE; - if (opt_arg != NULL) { - if (HDatoi(opt_arg) < 0) { + if (H5_optarg != NULL) { + if (HDatoi(H5_optarg) < 0) { usage(h5tools_getprogname()); goto done; } - increment = (hsize_t)HDatoi(opt_arg); + increment = (hsize_t)HDatoi(H5_optarg); } break; @@ -193,14 +193,14 @@ parse_command_line(int argc, const char **argv) } /* end while */ /* check for file name to be processed */ - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); goto error; } /* end if */ - fname_g = HDstrdup(argv[opt_ind]); + fname_g = HDstrdup(argv[H5_optind]); done: return (0); diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index 516191c..a85ee4d 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -22,8 +22,8 @@ int d_status = EXIT_SUCCESS; /* command-line options: short and long-named parameters */ -static const char * s_opts = "hlpvV"; -static struct long_options l_opts[] = { +static const char * s_opts = "hlpvV"; +static struct h5_long_options l_opts[] = { {"help", no_arg, 'h'}, {"latest", no_arg, 'l'}, {"parents", no_arg, 'p'}, {"verbose", no_arg, 'v'}, {"version", no_arg, 'V'}, {"vol-value", require_arg, '1'}, {"vol-name", require_arg, '2'}, {"vol-info", require_arg, '3'}, {NULL, 0, '\0'}}; @@ -140,7 +140,7 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t)); /* Parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { /* Display 'help' */ case 'h': @@ -171,18 +171,18 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) case '1': vol_info.type = VOL_BY_VALUE; - vol_info.u.value = (H5VL_class_value_t)HDatoi(opt_arg); + vol_info.u.value = (H5VL_class_value_t)HDatoi(H5_optarg); custom_fapl = TRUE; break; case '2': vol_info.type = VOL_BY_NAME; - vol_info.u.name = opt_arg; + vol_info.u.name = H5_optarg; custom_fapl = TRUE; break; case '3': - vol_info.info_string = opt_arg; + vol_info.info_string = H5_optarg; break; /* Bad command line argument */ @@ -193,33 +193,33 @@ parse_command_line(int argc, const char *argv[], mkgrp_opt_t *options) } /* end while */ /* Check for file name to be processed */ - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); leave(EXIT_FAILURE); } /* Retrieve file name */ - options->fname = HDstrdup(argv[opt_ind]); - opt_ind++; + options->fname = HDstrdup(argv[H5_optind]); + H5_optind++; /* Check for group(s) to be created */ - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing group name(s)\n"); usage(h5tools_getprogname()); leave(EXIT_FAILURE); } /* Allocate space for the group name pointers */ - options->ngroups = (size_t)(argc - opt_ind); + options->ngroups = (size_t)(argc - H5_optind); options->groups = (char **)HDmalloc(options->ngroups * sizeof(char *)); /* Retrieve the group names */ curr_group = 0; - while (opt_ind < argc) { - options->groups[curr_group] = HDstrdup(argv[opt_ind]); + while (H5_optind < argc) { + options->groups[curr_group] = HDstrdup(argv[H5_optind]); curr_group++; - opt_ind++; + H5_optind++; } /* Setup a custom fapl for file accesses */ diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index 4925708..fd21d6c 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -21,9 +21,9 @@ void parse_command_line(int argc, const char *argv[]); #define PROGRAM_NAME "getub" char *nbytes = NULL; -static const char * s_opts = "c:"; /* add more later ? */ -static struct long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file */ - {NULL, 0, '\0'}}; +static const char * s_opts = "c:"; /* add more later ? */ +static struct h5_long_options l_opts[] = {{"c", require_arg, 'c'}, /* input file */ + {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -57,10 +57,10 @@ parse_command_line(int argc, const char *argv[]) int opt; /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'c': - nbytes = HDstrdup(opt_arg); + nbytes = HDstrdup(H5_optarg); break; case '?': default: @@ -69,7 +69,7 @@ parse_command_line(int argc, const char *argv[]) } /* end switch */ } /* end while */ - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); HDexit(EXIT_FAILURE); @@ -100,13 +100,13 @@ main(int argc, const char *argv[]) goto error; } /* end if */ - if (argc <= (opt_ind)) { + if (argc <= (H5_optind)) { error_msg("missing file name\n"); usage(h5tools_getprogname()); goto error; } /* end if */ - filename = HDstrdup(argv[opt_ind]); + filename = HDstrdup(argv[H5_optind]); size = 0; if (EOF == (res = HDsscanf(nbytes, "%u", &size))) { diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c index 45d4af4..e6769ec 100644 --- a/tools/test/h5jam/tellub.c +++ b/tools/test/h5jam/tellub.c @@ -24,8 +24,8 @@ * parameters. The long-named ones can be partially spelled. When * adding more, make sure that they don't clash with each other. */ -static const char * s_opts = "h"; -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {NULL, 0, '\0'}}; +static const char * s_opts = "h"; +static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, {NULL, 0, '\0'}}; /*------------------------------------------------------------------------- * Function: usage @@ -61,7 +61,7 @@ parse_command_line(int argc, const char *argv[]) int opt; /* parse command line options */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'h': usage(h5tools_getprogname()); @@ -75,7 +75,7 @@ parse_command_line(int argc, const char *argv[]) } /* check for file name to be processed */ - if (argc <= opt_ind) { + if (argc <= H5_optind) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); @@ -118,14 +118,14 @@ main(int argc, const char *argv[]) /* enable error reporting if command line option */ h5tools_error_report(); - if (argc <= (opt_ind)) { + if (argc <= (H5_optind)) { error_msg("missing file name\n"); usage(h5tools_getprogname()); h5tools_setstatus(EXIT_FAILURE); goto done; } - ifname = HDstrdup(argv[opt_ind]); + ifname = HDstrdup(argv[H5_optind]); testval = H5Fis_accessible(ifname, H5P_DEFAULT); diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 6fb5043..d38c574 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -123,12 +123,12 @@ static const char *s_opts = "a:A:B:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:"; #else static const char *s_opts = "a:A:bB:cCd:D:e:F:ghi:Imno:p:P:stT:wx:X:"; #endif /* 1 */ -static struct long_options l_opts[] = {{"align", require_arg, 'a'}, - {"alig", require_arg, 'a'}, - {"ali", require_arg, 'a'}, - {"al", require_arg, 'a'}, - {"api", require_arg, 'A'}, - {"ap", require_arg, 'A'}, +static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'}, + {"alig", require_arg, 'a'}, + {"ali", require_arg, 'a'}, + {"al", require_arg, 'a'}, + {"api", require_arg, 'A'}, + {"ap", require_arg, 'A'}, #if 0 /* a sighting of the elusive binary option */ { "binary", no_arg, 'b' }, @@ -137,133 +137,133 @@ static struct long_options l_opts[] = {{"align", require_arg, 'a'}, { "bin", no_arg, 'b' }, { "bi", no_arg, 'b' }, #endif /* 0 */ - {"block-size", require_arg, 'B'}, - {"block-siz", require_arg, 'B'}, - {"block-si", require_arg, 'B'}, - {"block-s", require_arg, 'B'}, - {"block-", require_arg, 'B'}, - {"block", require_arg, 'B'}, - {"bloc", require_arg, 'B'}, - {"blo", require_arg, 'B'}, - {"bl", require_arg, 'B'}, - {"chunk", no_arg, 'c'}, - {"chun", no_arg, 'c'}, - {"chu", no_arg, 'c'}, - {"ch", no_arg, 'c'}, - {"collective", no_arg, 'C'}, - {"collectiv", no_arg, 'C'}, - {"collecti", no_arg, 'C'}, - {"collect", no_arg, 'C'}, - {"collec", no_arg, 'C'}, - {"colle", no_arg, 'C'}, - {"coll", no_arg, 'C'}, - {"col", no_arg, 'C'}, - {"co", no_arg, 'C'}, - {"debug", require_arg, 'D'}, - {"debu", require_arg, 'D'}, - {"deb", require_arg, 'D'}, - {"de", require_arg, 'D'}, - {"geometry", no_arg, 'g'}, - {"geometr", no_arg, 'g'}, - {"geomet", no_arg, 'g'}, - {"geome", no_arg, 'g'}, - {"geom", no_arg, 'g'}, - {"geo", no_arg, 'g'}, - {"ge", no_arg, 'g'}, - {"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"interleaved", require_arg, 'I'}, - {"interleave", require_arg, 'I'}, - {"interleav", require_arg, 'I'}, - {"interlea", require_arg, 'I'}, - {"interle", require_arg, 'I'}, - {"interl", require_arg, 'I'}, - {"inter", require_arg, 'I'}, - {"inte", require_arg, 'I'}, - {"int", require_arg, 'I'}, - {"in", require_arg, 'I'}, - {"max-num-processes", require_arg, 'P'}, - {"max-num-processe", require_arg, 'P'}, - {"max-num-process", require_arg, 'P'}, - {"max-num-proces", require_arg, 'P'}, - {"max-num-proce", require_arg, 'P'}, - {"max-num-proc", require_arg, 'P'}, - {"max-num-pro", require_arg, 'P'}, - {"max-num-pr", require_arg, 'P'}, - {"max-num-p", require_arg, 'P'}, - {"min-num-processes", require_arg, 'p'}, - {"min-num-processe", require_arg, 'p'}, - {"min-num-process", require_arg, 'p'}, - {"min-num-proces", require_arg, 'p'}, - {"min-num-proce", require_arg, 'p'}, - {"min-num-proc", require_arg, 'p'}, - {"min-num-pro", require_arg, 'p'}, - {"min-num-pr", require_arg, 'p'}, - {"min-num-p", require_arg, 'p'}, - {"max-xfer-size", require_arg, 'X'}, - {"max-xfer-siz", require_arg, 'X'}, - {"max-xfer-si", require_arg, 'X'}, - {"max-xfer-s", require_arg, 'X'}, - {"max-xfer", require_arg, 'X'}, - {"max-xfe", require_arg, 'X'}, - {"max-xf", require_arg, 'X'}, - {"max-x", require_arg, 'X'}, - {"min-xfer-size", require_arg, 'x'}, - {"min-xfer-siz", require_arg, 'x'}, - {"min-xfer-si", require_arg, 'x'}, - {"min-xfer-s", require_arg, 'x'}, - {"min-xfer", require_arg, 'x'}, - {"min-xfe", require_arg, 'x'}, - {"min-xf", require_arg, 'x'}, - {"min-x", require_arg, 'x'}, - {"num-bytes", require_arg, 'e'}, - {"num-byte", require_arg, 'e'}, - {"num-byt", require_arg, 'e'}, - {"num-by", require_arg, 'e'}, - {"num-b", require_arg, 'e'}, - {"num-dsets", require_arg, 'd'}, - {"num-dset", require_arg, 'd'}, - {"num-dse", require_arg, 'd'}, - {"num-ds", require_arg, 'd'}, - {"num-d", require_arg, 'd'}, - {"num-files", require_arg, 'F'}, - {"num-file", require_arg, 'F'}, - {"num-fil", require_arg, 'F'}, - {"num-fi", require_arg, 'F'}, - {"num-f", require_arg, 'F'}, - {"num-iterations", require_arg, 'i'}, - {"num-iteration", require_arg, 'i'}, - {"num-iteratio", require_arg, 'i'}, - {"num-iterati", require_arg, 'i'}, - {"num-iterat", require_arg, 'i'}, - {"num-itera", require_arg, 'i'}, - {"num-iter", require_arg, 'i'}, - {"num-ite", require_arg, 'i'}, - {"num-it", require_arg, 'i'}, - {"num-i", require_arg, 'i'}, - {"output", require_arg, 'o'}, - {"outpu", require_arg, 'o'}, - {"outp", require_arg, 'o'}, - {"out", require_arg, 'o'}, - {"ou", require_arg, 'o'}, - {"threshold", require_arg, 'T'}, - {"threshol", require_arg, 'T'}, - {"thresho", require_arg, 'T'}, - {"thresh", require_arg, 'T'}, - {"thres", require_arg, 'T'}, - {"thre", require_arg, 'T'}, - {"thr", require_arg, 'T'}, - {"th", require_arg, 'T'}, - {"write-only", require_arg, 'w'}, - {"write-onl", require_arg, 'w'}, - {"write-on", require_arg, 'w'}, - {"write-o", require_arg, 'w'}, - {"write", require_arg, 'w'}, - {"writ", require_arg, 'w'}, - {"wri", require_arg, 'w'}, - {"wr", require_arg, 'w'}, - {NULL, 0, '\0'}}; + {"block-size", require_arg, 'B'}, + {"block-siz", require_arg, 'B'}, + {"block-si", require_arg, 'B'}, + {"block-s", require_arg, 'B'}, + {"block-", require_arg, 'B'}, + {"block", require_arg, 'B'}, + {"bloc", require_arg, 'B'}, + {"blo", require_arg, 'B'}, + {"bl", require_arg, 'B'}, + {"chunk", no_arg, 'c'}, + {"chun", no_arg, 'c'}, + {"chu", no_arg, 'c'}, + {"ch", no_arg, 'c'}, + {"collective", no_arg, 'C'}, + {"collectiv", no_arg, 'C'}, + {"collecti", no_arg, 'C'}, + {"collect", no_arg, 'C'}, + {"collec", no_arg, 'C'}, + {"colle", no_arg, 'C'}, + {"coll", no_arg, 'C'}, + {"col", no_arg, 'C'}, + {"co", no_arg, 'C'}, + {"debug", require_arg, 'D'}, + {"debu", require_arg, 'D'}, + {"deb", require_arg, 'D'}, + {"de", require_arg, 'D'}, + {"geometry", no_arg, 'g'}, + {"geometr", no_arg, 'g'}, + {"geomet", no_arg, 'g'}, + {"geome", no_arg, 'g'}, + {"geom", no_arg, 'g'}, + {"geo", no_arg, 'g'}, + {"ge", no_arg, 'g'}, + {"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"interleaved", require_arg, 'I'}, + {"interleave", require_arg, 'I'}, + {"interleav", require_arg, 'I'}, + {"interlea", require_arg, 'I'}, + {"interle", require_arg, 'I'}, + {"interl", require_arg, 'I'}, + {"inter", require_arg, 'I'}, + {"inte", require_arg, 'I'}, + {"int", require_arg, 'I'}, + {"in", require_arg, 'I'}, + {"max-num-processes", require_arg, 'P'}, + {"max-num-processe", require_arg, 'P'}, + {"max-num-process", require_arg, 'P'}, + {"max-num-proces", require_arg, 'P'}, + {"max-num-proce", require_arg, 'P'}, + {"max-num-proc", require_arg, 'P'}, + {"max-num-pro", require_arg, 'P'}, + {"max-num-pr", require_arg, 'P'}, + {"max-num-p", require_arg, 'P'}, + {"min-num-processes", require_arg, 'p'}, + {"min-num-processe", require_arg, 'p'}, + {"min-num-process", require_arg, 'p'}, + {"min-num-proces", require_arg, 'p'}, + {"min-num-proce", require_arg, 'p'}, + {"min-num-proc", require_arg, 'p'}, + {"min-num-pro", require_arg, 'p'}, + {"min-num-pr", require_arg, 'p'}, + {"min-num-p", require_arg, 'p'}, + {"max-xfer-size", require_arg, 'X'}, + {"max-xfer-siz", require_arg, 'X'}, + {"max-xfer-si", require_arg, 'X'}, + {"max-xfer-s", require_arg, 'X'}, + {"max-xfer", require_arg, 'X'}, + {"max-xfe", require_arg, 'X'}, + {"max-xf", require_arg, 'X'}, + {"max-x", require_arg, 'X'}, + {"min-xfer-size", require_arg, 'x'}, + {"min-xfer-siz", require_arg, 'x'}, + {"min-xfer-si", require_arg, 'x'}, + {"min-xfer-s", require_arg, 'x'}, + {"min-xfer", require_arg, 'x'}, + {"min-xfe", require_arg, 'x'}, + {"min-xf", require_arg, 'x'}, + {"min-x", require_arg, 'x'}, + {"num-bytes", require_arg, 'e'}, + {"num-byte", require_arg, 'e'}, + {"num-byt", require_arg, 'e'}, + {"num-by", require_arg, 'e'}, + {"num-b", require_arg, 'e'}, + {"num-dsets", require_arg, 'd'}, + {"num-dset", require_arg, 'd'}, + {"num-dse", require_arg, 'd'}, + {"num-ds", require_arg, 'd'}, + {"num-d", require_arg, 'd'}, + {"num-files", require_arg, 'F'}, + {"num-file", require_arg, 'F'}, + {"num-fil", require_arg, 'F'}, + {"num-fi", require_arg, 'F'}, + {"num-f", require_arg, 'F'}, + {"num-iterations", require_arg, 'i'}, + {"num-iteration", require_arg, 'i'}, + {"num-iteratio", require_arg, 'i'}, + {"num-iterati", require_arg, 'i'}, + {"num-iterat", require_arg, 'i'}, + {"num-itera", require_arg, 'i'}, + {"num-iter", require_arg, 'i'}, + {"num-ite", require_arg, 'i'}, + {"num-it", require_arg, 'i'}, + {"num-i", require_arg, 'i'}, + {"output", require_arg, 'o'}, + {"outpu", require_arg, 'o'}, + {"outp", require_arg, 'o'}, + {"out", require_arg, 'o'}, + {"ou", require_arg, 'o'}, + {"threshold", require_arg, 'T'}, + {"threshol", require_arg, 'T'}, + {"thresho", require_arg, 'T'}, + {"thresh", require_arg, 'T'}, + {"thres", require_arg, 'T'}, + {"thre", require_arg, 'T'}, + {"thr", require_arg, 'T'}, + {"th", require_arg, 'T'}, + {"write-only", require_arg, 'w'}, + {"write-onl", require_arg, 'w'}, + {"write-on", require_arg, 'w'}, + {"write-o", require_arg, 'w'}, + {"write", require_arg, 'w'}, + {"writ", require_arg, 'w'}, + {"wri", require_arg, 'w'}, + {"wr", require_arg, 'w'}, + {NULL, 0, '\0'}}; struct options { long io_types; /* bitmask of which I/O types to test */ @@ -1286,13 +1286,13 @@ parse_command_line(int argc, char *argv[]) cl_opts->h5_write_only = FALSE; /* Do both read and write by default */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ - while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, (const char **)argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'a': - cl_opts->h5_alignment = parse_size_directive(opt_arg); + cl_opts->h5_alignment = parse_size_directive(H5_optarg); break; case 'A': { - const char *end = opt_arg; + const char *end = H5_optarg; while (end && *end != '\0') { char buf[10]; @@ -1332,7 +1332,7 @@ parse_command_line(int argc, char *argv[]) break; #endif /* 0 */ case 'B': - cl_opts->blk_size = (size_t)parse_size_directive(opt_arg); + cl_opts->blk_size = (size_t)parse_size_directive(H5_optarg); break; case 'c': /* Turn on chunked HDF5 dataset creation */ @@ -1342,10 +1342,10 @@ parse_command_line(int argc, char *argv[]) cl_opts->collective = 1; break; case 'd': - cl_opts->num_dsets = atoi(opt_arg); + cl_opts->num_dsets = atoi(H5_optarg); break; case 'D': { - const char *end = opt_arg; + const char *end = H5_optarg; while (end && *end != '\0') { char buf[10]; @@ -1402,40 +1402,40 @@ parse_command_line(int argc, char *argv[]) break; case 'e': - cl_opts->num_bpp = parse_size_directive(opt_arg); + cl_opts->num_bpp = parse_size_directive(H5_optarg); break; case 'F': - cl_opts->num_files = HDatoi(opt_arg); + cl_opts->num_files = HDatoi(H5_optarg); break; case 'g': cl_opts->dim2d = 1; break; case 'i': - cl_opts->num_iters = HDatoi(opt_arg); + cl_opts->num_iters = HDatoi(H5_optarg); break; case 'I': cl_opts->interleaved = 1; break; case 'o': - cl_opts->output_file = opt_arg; + cl_opts->output_file = H5_optarg; break; case 'p': - cl_opts->min_num_procs = HDatoi(opt_arg); + cl_opts->min_num_procs = HDatoi(H5_optarg); break; case 'P': - cl_opts->max_num_procs = HDatoi(opt_arg); + cl_opts->max_num_procs = HDatoi(H5_optarg); break; case 'T': - cl_opts->h5_threshold = parse_size_directive(opt_arg); + cl_opts->h5_threshold = parse_size_directive(H5_optarg); break; case 'w': cl_opts->h5_write_only = TRUE; break; case 'x': - cl_opts->min_xfer_size = (size_t)parse_size_directive(opt_arg); + cl_opts->min_xfer_size = (size_t)parse_size_directive(H5_optarg); break; case 'X': - cl_opts->max_xfer_size = (size_t)parse_size_directive(opt_arg); + cl_opts->max_xfer_size = (size_t)parse_size_directive(H5_optarg); break; case 'h': case '?': diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c index 0a9bfc0..db8633e 100644 --- a/tools/test/perform/pio_standalone.c +++ b/tools/test/perform/pio_standalone.c @@ -27,30 +27,30 @@ MPI_Info h5_io_info_g = MPI_INFO_NULL; /* MPI INFO object for IO */ int nCols = 80; /* ``get_option'' variables */ -int opt_err = 1; /*get_option prints errors if this is on */ -int opt_ind = 1; /*token pointer */ -const char *opt_arg; /*flag argument (or value) */ +int H5_opterr = 1; /*get_option prints errors if this is on */ +int H5_optind = 1; /*token pointer */ +const char *H5_optarg; /*flag argument (or value) */ int -get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts) +get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts) { static int sp = 1; /* character index in current token */ int opt_opt = '?'; /* option character passed back to user */ if (sp == 1) { /* check for more flag-like tokens */ - if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { + if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') { return EOF; } - else if (HDstrcmp(argv[opt_ind], "--") == 0) { - opt_ind++; + else if (HDstrcmp(argv[H5_optind], "--") == 0) { + H5_optind++; return EOF; } } - if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') { + if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') { /* long command line option */ - const char *arg = &argv[opt_ind][2]; + const char *arg = &argv[H5_optind][2]; int i; for (i = 0; l_opts && l_opts[i].name; i++) { @@ -62,13 +62,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (l_opts[i].has_arg != no_arg) { if (arg[len] == '=') { - opt_arg = &arg[len + 1]; + H5_optarg = &arg[len + 1]; } - else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') { - opt_arg = argv[++opt_ind]; + else if (H5_optind < (argc - 1) && argv[H5_optind + 1][0] != '-') { + H5_optarg = argv[++H5_optind]; } else if (l_opts[i].has_arg == require_arg) { - if (opt_err) + if (H5_opterr) HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg); opt_opt = '?'; @@ -76,13 +76,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti } else { if (arg[len] == '=') { - if (opt_err) + if (H5_opterr) HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg); opt_opt = '?'; } - opt_arg = NULL; + H5_optarg = NULL; } break; @@ -91,29 +91,29 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (l_opts[i].name == NULL) { /* exhausted all of the l_opts we have and still didn't match */ - if (opt_err) + if (H5_opterr) HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); opt_opt = '?'; } - opt_ind++; + H5_optind++; sp = 1; } else { register char *cp; /* pointer into current token */ /* short command line option */ - opt_opt = argv[opt_ind][sp]; + opt_opt = argv[H5_optind][sp]; if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) { - if (opt_err) + if (H5_opterr) HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt); /* if no chars left in this token, move to next token */ - if (argv[opt_ind][++sp] == '\0') { - opt_ind++; + if (argv[H5_optind][++sp] == '\0') { + H5_optind++; sp = 1; } @@ -122,32 +122,32 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (*++cp == ':') { /* if a value is expected, get it */ - if (argv[opt_ind][sp + 1] != '\0') { + if (argv[H5_optind][sp + 1] != '\0') { /* flag value is rest of current token */ - opt_arg = &argv[opt_ind++][sp + 1]; + H5_optarg = &argv[H5_optind++][sp + 1]; } - else if (++opt_ind >= argc) { - if (opt_err) + else if (++H5_optind >= argc) { + if (H5_opterr) HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt); opt_opt = '?'; } else { /* flag value is next token */ - opt_arg = argv[opt_ind++]; + H5_optarg = argv[H5_optind++]; } sp = 1; } else { /* set up to look at next char in token, next time */ - if (argv[opt_ind][++sp] == '\0') { + if (argv[H5_optind][++sp] == '\0') { /* no more in current token, so setup next token */ - opt_ind++; + H5_optind++; sp = 1; } - opt_arg = NULL; + H5_optarg = NULL; } } diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index 276fa0f..4b5c7b2 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -454,24 +454,25 @@ void h5_dump_info_object(MPI_Info info); /** From h5tools_utils.h **/ -extern int opt_err; /* getoption prints errors if this is on */ -extern int opt_ind; /* token pointer */ -extern const char *opt_arg; /* flag argument (or value) */ +extern int H5_opterr; /* getoption prints errors if this is on */ +extern int H5_optind; /* token pointer */ +extern const char *H5_optarg; /* flag argument (or value) */ -enum { +enum h5_arg_level { no_arg = 0, /* doesn't take an argument */ require_arg, /* requires an argument */ optional_arg /* argument is optional */ }; -typedef struct long_options { - const char *name; /* name of the long option */ - int has_arg; /* whether we should look for an arg */ - char shortval; /* the shortname equivalent of long arg - * this gets returned from get_option */ -} long_options; +struct h5_long_options { + const char * name; /* Name of the long option */ + enum h5_arg_level has_arg; /* Whether we should look for an arg */ + char shortval; /* The shortname equivalent of long arg + * this gets returned from get_option + */ +}; -extern int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt); +extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt); extern int nCols; /*max number of columns for outputting */ diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index fe4e7e7..51a7825 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -97,13 +97,13 @@ static const char *progname = "h5perf_serial"; * It seems that only the options that accept additional information * such as dataset size (-e) require the colon next to it. */ -static const char * s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:"; -static struct long_options l_opts[] = {{"align", require_arg, 'a'}, - {"alig", require_arg, 'a'}, - {"ali", require_arg, 'a'}, - {"al", require_arg, 'a'}, - {"api", require_arg, 'A'}, - {"ap", require_arg, 'A'}, +static const char * s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:"; +static struct h5_long_options l_opts[] = {{"align", require_arg, 'a'}, + {"alig", require_arg, 'a'}, + {"ali", require_arg, 'a'}, + {"al", require_arg, 'a'}, + {"api", require_arg, 'A'}, + {"ap", require_arg, 'A'}, #if 0 /* a sighting of the elusive binary option */ { "binary", no_arg, 'b' }, @@ -112,156 +112,156 @@ static struct long_options l_opts[] = {{"align", require_arg, 'a'}, { "bin", no_arg, 'b' }, { "bi", no_arg, 'b' }, #endif /* 0 */ - {"block-size", require_arg, 'B'}, - {"block-siz", require_arg, 'B'}, - {"block-si", require_arg, 'B'}, - {"block-s", require_arg, 'B'}, - {"block-", require_arg, 'B'}, - {"block", require_arg, 'B'}, - {"bloc", require_arg, 'B'}, - {"blo", require_arg, 'B'}, - {"bl", require_arg, 'B'}, - {"chunk", no_arg, 'c'}, - {"chun", no_arg, 'c'}, - {"chu", no_arg, 'c'}, - {"ch", no_arg, 'c'}, - {"collective", no_arg, 'C'}, - {"collectiv", no_arg, 'C'}, - {"collecti", no_arg, 'C'}, - {"collect", no_arg, 'C'}, - {"collec", no_arg, 'C'}, - {"colle", no_arg, 'C'}, - {"coll", no_arg, 'C'}, - {"col", no_arg, 'C'}, - {"co", no_arg, 'C'}, - {"debug", require_arg, 'D'}, - {"debu", require_arg, 'D'}, - {"deb", require_arg, 'D'}, - {"de", require_arg, 'D'}, - {"file-driver", require_arg, 'v'}, - {"file-drive", require_arg, 'v'}, - {"file-driv", require_arg, 'v'}, - {"file-dri", require_arg, 'v'}, - {"file-dr", require_arg, 'v'}, - {"file-d", require_arg, 'v'}, - {"file-", require_arg, 'v'}, - {"file", require_arg, 'v'}, - {"fil", require_arg, 'v'}, - {"fi", require_arg, 'v'}, - {"geometry", no_arg, 'g'}, - {"geometr", no_arg, 'g'}, - {"geomet", no_arg, 'g'}, - {"geome", no_arg, 'g'}, - {"geom", no_arg, 'g'}, - {"geo", no_arg, 'g'}, - {"ge", no_arg, 'g'}, - {"help", no_arg, 'h'}, - {"hel", no_arg, 'h'}, - {"he", no_arg, 'h'}, - {"interleaved", require_arg, 'I'}, - {"interleave", require_arg, 'I'}, - {"interleav", require_arg, 'I'}, - {"interlea", require_arg, 'I'}, - {"interle", require_arg, 'I'}, - {"interl", require_arg, 'I'}, - {"inter", require_arg, 'I'}, - {"inte", require_arg, 'I'}, - {"int", require_arg, 'I'}, - {"in", require_arg, 'I'}, - {"max-num-processes", require_arg, 'P'}, - {"max-num-processe", require_arg, 'P'}, - {"max-num-process", require_arg, 'P'}, - {"max-num-proces", require_arg, 'P'}, - {"max-num-proce", require_arg, 'P'}, - {"max-num-proc", require_arg, 'P'}, - {"max-num-pro", require_arg, 'P'}, - {"max-num-pr", require_arg, 'P'}, - {"max-num-p", require_arg, 'P'}, - {"min-num-processes", require_arg, 'p'}, - {"min-num-processe", require_arg, 'p'}, - {"min-num-process", require_arg, 'p'}, - {"min-num-proces", require_arg, 'p'}, - {"min-num-proce", require_arg, 'p'}, - {"min-num-proc", require_arg, 'p'}, - {"min-num-pro", require_arg, 'p'}, - {"min-num-pr", require_arg, 'p'}, - {"min-num-p", require_arg, 'p'}, - {"max-xfer-size", require_arg, 'X'}, - {"max-xfer-siz", require_arg, 'X'}, - {"max-xfer-si", require_arg, 'X'}, - {"max-xfer-s", require_arg, 'X'}, - {"max-xfer", require_arg, 'X'}, - {"max-xfe", require_arg, 'X'}, - {"max-xf", require_arg, 'X'}, - {"max-x", require_arg, 'X'}, - {"min-xfer-size", require_arg, 'x'}, - {"min-xfer-siz", require_arg, 'x'}, - {"min-xfer-si", require_arg, 'x'}, - {"min-xfer-s", require_arg, 'x'}, - {"min-xfer", require_arg, 'x'}, - {"min-xfe", require_arg, 'x'}, - {"min-xf", require_arg, 'x'}, - {"min-x", require_arg, 'x'}, - {"num-bytes", require_arg, 'e'}, - {"num-byte", require_arg, 'e'}, - {"num-byt", require_arg, 'e'}, - {"num-by", require_arg, 'e'}, - {"num-b", require_arg, 'e'}, - {"num-dsets", require_arg, 'd'}, - {"num-dset", require_arg, 'd'}, - {"num-dse", require_arg, 'd'}, - {"num-ds", require_arg, 'd'}, - {"num-d", require_arg, 'd'}, - {"num-files", require_arg, 'F'}, - {"num-file", require_arg, 'F'}, - {"num-fil", require_arg, 'F'}, - {"num-fi", require_arg, 'F'}, - {"num-f", require_arg, 'F'}, - {"num-iterations", require_arg, 'i'}, - {"num-iteration", require_arg, 'i'}, - {"num-iteratio", require_arg, 'i'}, - {"num-iterati", require_arg, 'i'}, - {"num-iterat", require_arg, 'i'}, - {"num-itera", require_arg, 'i'}, - {"num-iter", require_arg, 'i'}, - {"num-ite", require_arg, 'i'}, - {"num-it", require_arg, 'i'}, - {"num-i", require_arg, 'i'}, - {"order", require_arg, 'r'}, - {"orde", require_arg, 'r'}, - {"ord", require_arg, 'r'}, - {"or", require_arg, 'r'}, - {"output", require_arg, 'o'}, - {"outpu", require_arg, 'o'}, - {"outp", require_arg, 'o'}, - {"out", require_arg, 'o'}, - {"ou", require_arg, 'o'}, - {"extendable", no_arg, 't'}, - {"extendabl", no_arg, 't'}, - {"extendab", no_arg, 't'}, - {"extenda", no_arg, 't'}, - {"extend", no_arg, 't'}, - {"exten", no_arg, 't'}, - {"exte", no_arg, 't'}, - {"ext", no_arg, 't'}, - {"ex", no_arg, 't'}, - {"threshold", require_arg, 'T'}, - {"threshol", require_arg, 'T'}, - {"thresho", require_arg, 'T'}, - {"thresh", require_arg, 'T'}, - {"thres", require_arg, 'T'}, - {"thre", require_arg, 'T'}, - {"thr", require_arg, 'T'}, - {"th", require_arg, 'T'}, - {"write-only", require_arg, 'w'}, - {"write-onl", require_arg, 'w'}, - {"write-on", require_arg, 'w'}, - {"write-o", require_arg, 'w'}, - {"write", require_arg, 'w'}, - {"writ", require_arg, 'w'}, - {"wri", require_arg, 'w'}, - {"wr", require_arg, 'w'}, - {NULL, 0, '\0'}}; + {"block-size", require_arg, 'B'}, + {"block-siz", require_arg, 'B'}, + {"block-si", require_arg, 'B'}, + {"block-s", require_arg, 'B'}, + {"block-", require_arg, 'B'}, + {"block", require_arg, 'B'}, + {"bloc", require_arg, 'B'}, + {"blo", require_arg, 'B'}, + {"bl", require_arg, 'B'}, + {"chunk", no_arg, 'c'}, + {"chun", no_arg, 'c'}, + {"chu", no_arg, 'c'}, + {"ch", no_arg, 'c'}, + {"collective", no_arg, 'C'}, + {"collectiv", no_arg, 'C'}, + {"collecti", no_arg, 'C'}, + {"collect", no_arg, 'C'}, + {"collec", no_arg, 'C'}, + {"colle", no_arg, 'C'}, + {"coll", no_arg, 'C'}, + {"col", no_arg, 'C'}, + {"co", no_arg, 'C'}, + {"debug", require_arg, 'D'}, + {"debu", require_arg, 'D'}, + {"deb", require_arg, 'D'}, + {"de", require_arg, 'D'}, + {"file-driver", require_arg, 'v'}, + {"file-drive", require_arg, 'v'}, + {"file-driv", require_arg, 'v'}, + {"file-dri", require_arg, 'v'}, + {"file-dr", require_arg, 'v'}, + {"file-d", require_arg, 'v'}, + {"file-", require_arg, 'v'}, + {"file", require_arg, 'v'}, + {"fil", require_arg, 'v'}, + {"fi", require_arg, 'v'}, + {"geometry", no_arg, 'g'}, + {"geometr", no_arg, 'g'}, + {"geomet", no_arg, 'g'}, + {"geome", no_arg, 'g'}, + {"geom", no_arg, 'g'}, + {"geo", no_arg, 'g'}, + {"ge", no_arg, 'g'}, + {"help", no_arg, 'h'}, + {"hel", no_arg, 'h'}, + {"he", no_arg, 'h'}, + {"interleaved", require_arg, 'I'}, + {"interleave", require_arg, 'I'}, + {"interleav", require_arg, 'I'}, + {"interlea", require_arg, 'I'}, + {"interle", require_arg, 'I'}, + {"interl", require_arg, 'I'}, + {"inter", require_arg, 'I'}, + {"inte", require_arg, 'I'}, + {"int", require_arg, 'I'}, + {"in", require_arg, 'I'}, + {"max-num-processes", require_arg, 'P'}, + {"max-num-processe", require_arg, 'P'}, + {"max-num-process", require_arg, 'P'}, + {"max-num-proces", require_arg, 'P'}, + {"max-num-proce", require_arg, 'P'}, + {"max-num-proc", require_arg, 'P'}, + {"max-num-pro", require_arg, 'P'}, + {"max-num-pr", require_arg, 'P'}, + {"max-num-p", require_arg, 'P'}, + {"min-num-processes", require_arg, 'p'}, + {"min-num-processe", require_arg, 'p'}, + {"min-num-process", require_arg, 'p'}, + {"min-num-proces", require_arg, 'p'}, + {"min-num-proce", require_arg, 'p'}, + {"min-num-proc", require_arg, 'p'}, + {"min-num-pro", require_arg, 'p'}, + {"min-num-pr", require_arg, 'p'}, + {"min-num-p", require_arg, 'p'}, + {"max-xfer-size", require_arg, 'X'}, + {"max-xfer-siz", require_arg, 'X'}, + {"max-xfer-si", require_arg, 'X'}, + {"max-xfer-s", require_arg, 'X'}, + {"max-xfer", require_arg, 'X'}, + {"max-xfe", require_arg, 'X'}, + {"max-xf", require_arg, 'X'}, + {"max-x", require_arg, 'X'}, + {"min-xfer-size", require_arg, 'x'}, + {"min-xfer-siz", require_arg, 'x'}, + {"min-xfer-si", require_arg, 'x'}, + {"min-xfer-s", require_arg, 'x'}, + {"min-xfer", require_arg, 'x'}, + {"min-xfe", require_arg, 'x'}, + {"min-xf", require_arg, 'x'}, + {"min-x", require_arg, 'x'}, + {"num-bytes", require_arg, 'e'}, + {"num-byte", require_arg, 'e'}, + {"num-byt", require_arg, 'e'}, + {"num-by", require_arg, 'e'}, + {"num-b", require_arg, 'e'}, + {"num-dsets", require_arg, 'd'}, + {"num-dset", require_arg, 'd'}, + {"num-dse", require_arg, 'd'}, + {"num-ds", require_arg, 'd'}, + {"num-d", require_arg, 'd'}, + {"num-files", require_arg, 'F'}, + {"num-file", require_arg, 'F'}, + {"num-fil", require_arg, 'F'}, + {"num-fi", require_arg, 'F'}, + {"num-f", require_arg, 'F'}, + {"num-iterations", require_arg, 'i'}, + {"num-iteration", require_arg, 'i'}, + {"num-iteratio", require_arg, 'i'}, + {"num-iterati", require_arg, 'i'}, + {"num-iterat", require_arg, 'i'}, + {"num-itera", require_arg, 'i'}, + {"num-iter", require_arg, 'i'}, + {"num-ite", require_arg, 'i'}, + {"num-it", require_arg, 'i'}, + {"num-i", require_arg, 'i'}, + {"order", require_arg, 'r'}, + {"orde", require_arg, 'r'}, + {"ord", require_arg, 'r'}, + {"or", require_arg, 'r'}, + {"output", require_arg, 'o'}, + {"outpu", require_arg, 'o'}, + {"outp", require_arg, 'o'}, + {"out", require_arg, 'o'}, + {"ou", require_arg, 'o'}, + {"extendable", no_arg, 't'}, + {"extendabl", no_arg, 't'}, + {"extendab", no_arg, 't'}, + {"extenda", no_arg, 't'}, + {"extend", no_arg, 't'}, + {"exten", no_arg, 't'}, + {"exte", no_arg, 't'}, + {"ext", no_arg, 't'}, + {"ex", no_arg, 't'}, + {"threshold", require_arg, 'T'}, + {"threshol", require_arg, 'T'}, + {"thresho", require_arg, 'T'}, + {"thresh", require_arg, 'T'}, + {"thres", require_arg, 'T'}, + {"thre", require_arg, 'T'}, + {"thr", require_arg, 'T'}, + {"th", require_arg, 'T'}, + {"write-only", require_arg, 'w'}, + {"write-onl", require_arg, 'w'}, + {"write-on", require_arg, 'w'}, + {"write-o", require_arg, 'w'}, + {"write", require_arg, 'w'}, + {"writ", require_arg, 'w'}, + {"wri", require_arg, 'w'}, + {"wr", require_arg, 'w'}, + {NULL, 0, '\0'}}; struct options { long io_types; /* bitmask of which I/O types to test */ @@ -993,19 +993,19 @@ parse_command_line(int argc, const char *argv[]) cl_opts->h5_extendable = FALSE; /* Use extendable dataset */ cl_opts->verify = FALSE; /* No Verify data correctness by default */ - while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'a': - cl_opts->h5_alignment = parse_size_directive(opt_arg); + cl_opts->h5_alignment = parse_size_directive(H5_optarg); break; case 'G': - cl_opts->page_size = parse_size_directive(opt_arg); + cl_opts->page_size = parse_size_directive(H5_optarg); break; case 'b': - cl_opts->page_buffer_size = parse_size_directive(opt_arg); + cl_opts->page_buffer_size = parse_size_directive(H5_optarg); break; case 'A': { - const char *end = opt_arg; + const char *end = H5_optarg; while (end && *end != '\0') { char buf[10]; @@ -1043,7 +1043,7 @@ parse_command_line(int argc, const char *argv[]) /* Turn on chunked HDF5 dataset creation */ cl_opts->h5_use_chunks = 1; { - const char *end = opt_arg; + const char *end = H5_optarg; int j = 0; while (end && *end != '\0') { @@ -1070,7 +1070,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'D': { - const char *end = opt_arg; + const char *end = H5_optarg; while (end && *end != '\0') { char buf[10]; @@ -1126,7 +1126,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'e': { - const char *end = opt_arg; + const char *end = H5_optarg; int j = 0; while (end && *end != '\0') { @@ -1153,38 +1153,38 @@ parse_command_line(int argc, const char *argv[]) break; case 'i': - cl_opts->num_iters = HDatoi(opt_arg); + cl_opts->num_iters = HDatoi(H5_optarg); break; case 'o': - cl_opts->output_file = opt_arg; + cl_opts->output_file = H5_optarg; break; case 'T': - cl_opts->h5_threshold = parse_size_directive(opt_arg); + cl_opts->h5_threshold = parse_size_directive(H5_optarg); break; case 'v': - if (!HDstrcasecmp(opt_arg, "sec2")) { + if (!HDstrcasecmp(H5_optarg, "sec2")) { cl_opts->vfd = sec2; } - else if (!HDstrcasecmp(opt_arg, "stdio")) { + else if (!HDstrcasecmp(H5_optarg, "stdio")) { cl_opts->vfd = stdio; } - else if (!HDstrcasecmp(opt_arg, "core")) { + else if (!HDstrcasecmp(H5_optarg, "core")) { cl_opts->vfd = core; } - else if (!HDstrcasecmp(opt_arg, "split")) { + else if (!HDstrcasecmp(H5_optarg, "split")) { cl_opts->vfd = split; } - else if (!HDstrcasecmp(opt_arg, "multi")) { + else if (!HDstrcasecmp(H5_optarg, "multi")) { cl_opts->vfd = multi; } - else if (!HDstrcasecmp(opt_arg, "family")) { + else if (!HDstrcasecmp(H5_optarg, "family")) { cl_opts->vfd = family; } - else if (!HDstrcasecmp(opt_arg, "direct")) { + else if (!HDstrcasecmp(H5_optarg, "direct")) { cl_opts->vfd = direct; } else { - HDfprintf(stderr, "sio_perf: invalid --api option %s\n", opt_arg); + HDfprintf(stderr, "sio_perf: invalid --api option %s\n", H5_optarg); HDexit(EXIT_FAILURE); } break; @@ -1195,7 +1195,7 @@ parse_command_line(int argc, const char *argv[]) cl_opts->h5_extendable = TRUE; break; case 'x': { - const char *end = opt_arg; + const char *end = H5_optarg; int j = 0; while (end && *end != '\0') { @@ -1222,7 +1222,7 @@ parse_command_line(int argc, const char *argv[]) break; case 'r': { - const char *end = opt_arg; + const char *end = H5_optarg; int j = 0; while (end && *end != '\0') { diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c index abc0777..2e793fb 100644 --- a/tools/test/perform/sio_standalone.c +++ b/tools/test/perform/sio_standalone.c @@ -23,30 +23,30 @@ int nCols = 80; /* ``get_option'' variables */ -int opt_err = 1; /*get_option prints errors if this is on */ -int opt_ind = 1; /*token pointer */ -const char *opt_arg; /*flag argument (or value) */ +int H5_opterr = 1; /*get_option prints errors if this is on */ +int H5_optind = 1; /*token pointer */ +const char *H5_optarg; /*flag argument (or value) */ int -get_option(int argc, const char **argv, const char *opts, const struct long_options *l_opts) +get_option(int argc, const char **argv, const char *opts, const struct h5_long_options *l_opts) { static int sp = 1; /* character index in current token */ int opt_opt = '?'; /* option character passed back to user */ if (sp == 1) { /* check for more flag-like tokens */ - if (opt_ind >= argc || argv[opt_ind][0] != '-' || argv[opt_ind][1] == '\0') { + if (H5_optind >= argc || argv[H5_optind][0] != '-' || argv[H5_optind][1] == '\0') { return EOF; } - else if (HDstrcmp(argv[opt_ind], "--") == 0) { - opt_ind++; + else if (HDstrcmp(argv[H5_optind], "--") == 0) { + H5_optind++; return EOF; } } - if (sp == 1 && argv[opt_ind][0] == '-' && argv[opt_ind][1] == '-') { + if (sp == 1 && argv[H5_optind][0] == '-' && argv[H5_optind][1] == '-') { /* long command line option */ - const char *arg = &argv[opt_ind][2]; + const char *arg = &argv[H5_optind][2]; int i; for (i = 0; l_opts && l_opts[i].name; i++) { @@ -58,13 +58,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (l_opts[i].has_arg != no_arg) { if (arg[len] == '=') { - opt_arg = &arg[len + 1]; + H5_optarg = &arg[len + 1]; } - else if (opt_ind < (argc - 1) && argv[opt_ind + 1][0] != '-') { - opt_arg = argv[++opt_ind]; + else if (H5_optind < (argc - 1) && argv[H5_optind + 1][0] != '-') { + H5_optarg = argv[++H5_optind]; } else if (l_opts[i].has_arg == require_arg) { - if (opt_err) + if (H5_opterr) HDfprintf(stderr, "%s: option required for \"--%s\" flag\n", argv[0], arg); opt_opt = '?'; @@ -72,13 +72,13 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti } else { if (arg[len] == '=') { - if (opt_err) + if (H5_opterr) HDfprintf(stderr, "%s: no option required for \"%s\" flag\n", argv[0], arg); opt_opt = '?'; } - opt_arg = NULL; + H5_optarg = NULL; } break; @@ -87,29 +87,29 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (l_opts[i].name == NULL) { /* exhausted all of the l_opts we have and still didn't match */ - if (opt_err) + if (H5_opterr) HDfprintf(stderr, "%s: unknown option \"%s\"\n", argv[0], arg); opt_opt = '?'; } - opt_ind++; + H5_optind++; sp = 1; } else { register char *cp; /* pointer into current token */ /* short command line option */ - opt_opt = argv[opt_ind][sp]; + opt_opt = argv[H5_optind][sp]; if (opt_opt == ':' || (cp = strchr(opts, opt_opt)) == 0) { - if (opt_err) + if (H5_opterr) HDfprintf(stderr, "%s: unknown option \"%c\"\n", argv[0], opt_opt); /* if no chars left in this token, move to next token */ - if (argv[opt_ind][++sp] == '\0') { - opt_ind++; + if (argv[H5_optind][++sp] == '\0') { + H5_optind++; sp = 1; } @@ -118,32 +118,32 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti if (*++cp == ':') { /* if a value is expected, get it */ - if (argv[opt_ind][sp + 1] != '\0') { + if (argv[H5_optind][sp + 1] != '\0') { /* flag value is rest of current token */ - opt_arg = &argv[opt_ind++][sp + 1]; + H5_optarg = &argv[H5_optind++][sp + 1]; } - else if (++opt_ind >= argc) { - if (opt_err) + else if (++H5_optind >= argc) { + if (H5_opterr) HDfprintf(stderr, "%s: value expected for option \"%c\"\n", argv[0], opt_opt); opt_opt = '?'; } else { /* flag value is next token */ - opt_arg = argv[opt_ind++]; + H5_optarg = argv[H5_optind++]; } sp = 1; } else { /* set up to look at next char in token, next time */ - if (argv[opt_ind][++sp] == '\0') { + if (argv[H5_optind][++sp] == '\0') { /* no more in current token, so setup next token */ - opt_ind++; + H5_optind++; sp = 1; } - opt_arg = NULL; + H5_optarg = NULL; } } diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index ea1a2a1..098b98a 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -469,24 +469,25 @@ void h5_dump_info_object(MPI_Info info); /** From h5tools_utils.h **/ -extern int opt_err; /* getoption prints errors if this is on */ -extern int opt_ind; /* token pointer */ -extern const char *opt_arg; /* flag argument (or value) */ +extern int H5_opterr; /* getoption prints errors if this is on */ +extern int H5_optind; /* token pointer */ +extern const char *H5_optarg; /* flag argument (or value) */ -enum { +enum h5_arg_level { no_arg = 0, /* doesn't take an argument */ require_arg, /* requires an argument */ optional_arg /* argument is optional */ }; -typedef struct long_options { - const char *name; /* name of the long option */ - int has_arg; /* whether we should look for an arg */ - char shortval; /* the shortname equivalent of long arg - * this gets returned from get_option */ -} long_options; +struct h5_long_options { + const char * name; /* Name of the long option */ + enum h5_arg_level has_arg; /* Whether we should look for an arg */ + char shortval; /* The shortname equivalent of long arg + * this gets returned from get_option + */ +}; -extern int get_option(int argc, const char **argv, const char *opt, const struct long_options *l_opt); +extern int H5_get_option(int argc, const char **argv, const char *opt, const struct h5_long_options *l_opt); extern int nCols; /*max number of columns for outputting */ diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index 517866b..6231587 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -64,66 +64,66 @@ static void error(const char *fmt, ...); static void compress_buffer(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen); /* commandline options : long and short form */ -static const char * s_opts = "hB:b:c:p:rs:0123456789"; -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, - {"compressability", require_arg, 'c'}, - {"compressabilit", require_arg, 'c'}, - {"compressabili", require_arg, 'c'}, - {"compressabil", require_arg, 'c'}, - {"compressabi", require_arg, 'c'}, - {"compressab", require_arg, 'c'}, - {"compressa", require_arg, 'c'}, - {"compress", require_arg, 'c'}, - {"compres", require_arg, 'c'}, - {"compre", require_arg, 'c'}, - {"compr", require_arg, 'c'}, - {"comp", require_arg, 'c'}, - {"com", require_arg, 'c'}, - {"co", require_arg, 'c'}, - {"file-size", require_arg, 's'}, - {"file-siz", require_arg, 's'}, - {"file-si", require_arg, 's'}, - {"file-s", require_arg, 's'}, - {"file", require_arg, 's'}, - {"fil", require_arg, 's'}, - {"fi", require_arg, 's'}, - {"max-buffer-size", require_arg, 'B'}, - {"max-buffer-siz", require_arg, 'B'}, - {"max-buffer-si", require_arg, 'B'}, - {"max-buffer-s", require_arg, 'B'}, - {"max-buffer", require_arg, 'B'}, - {"max-buffe", require_arg, 'B'}, - {"max-buff", require_arg, 'B'}, - {"max-buf", require_arg, 'B'}, - {"max-bu", require_arg, 'B'}, - {"max-b", require_arg, 'B'}, - {"max", require_arg, 'B'}, - {"min-buffer-size", require_arg, 'b'}, - {"min-buffer-siz", require_arg, 'b'}, - {"min-buffer-si", require_arg, 'b'}, - {"min-buffer-s", require_arg, 'b'}, - {"min-buffer", require_arg, 'b'}, - {"min-buffe", require_arg, 'b'}, - {"min-buff", require_arg, 'b'}, - {"min-buf", require_arg, 'b'}, - {"min-bu", require_arg, 'b'}, - {"min-b", require_arg, 'b'}, - {"min", require_arg, 'b'}, - {"prefix", require_arg, 'p'}, - {"prefi", require_arg, 'p'}, - {"pref", require_arg, 'p'}, - {"pre", require_arg, 'p'}, - {"pr", require_arg, 'p'}, - {"random-test", no_arg, 'r'}, - {"random-tes", no_arg, 'r'}, - {"random-te", no_arg, 'r'}, - {"random-t", no_arg, 'r'}, - {"random", no_arg, 'r'}, - {"rando", no_arg, 'r'}, - {"rand", no_arg, 'r'}, - {"ran", no_arg, 'r'}, - {"ra", no_arg, 'r'}, - {NULL, 0, '\0'}}; +static const char * s_opts = "hB:b:c:p:rs:0123456789"; +static struct h5_long_options l_opts[] = {{"help", no_arg, 'h'}, + {"compressability", require_arg, 'c'}, + {"compressabilit", require_arg, 'c'}, + {"compressabili", require_arg, 'c'}, + {"compressabil", require_arg, 'c'}, + {"compressabi", require_arg, 'c'}, + {"compressab", require_arg, 'c'}, + {"compressa", require_arg, 'c'}, + {"compress", require_arg, 'c'}, + {"compres", require_arg, 'c'}, + {"compre", require_arg, 'c'}, + {"compr", require_arg, 'c'}, + {"comp", require_arg, 'c'}, + {"com", require_arg, 'c'}, + {"co", require_arg, 'c'}, + {"file-size", require_arg, 's'}, + {"file-siz", require_arg, 's'}, + {"file-si", require_arg, 's'}, + {"file-s", require_arg, 's'}, + {"file", require_arg, 's'}, + {"fil", require_arg, 's'}, + {"fi", require_arg, 's'}, + {"max-buffer-size", require_arg, 'B'}, + {"max-buffer-siz", require_arg, 'B'}, + {"max-buffer-si", require_arg, 'B'}, + {"max-buffer-s", require_arg, 'B'}, + {"max-buffer", require_arg, 'B'}, + {"max-buffe", require_arg, 'B'}, + {"max-buff", require_arg, 'B'}, + {"max-buf", require_arg, 'B'}, + {"max-bu", require_arg, 'B'}, + {"max-b", require_arg, 'B'}, + {"max", require_arg, 'B'}, + {"min-buffer-size", require_arg, 'b'}, + {"min-buffer-siz", require_arg, 'b'}, + {"min-buffer-si", require_arg, 'b'}, + {"min-buffer-s", require_arg, 'b'}, + {"min-buffer", require_arg, 'b'}, + {"min-buffe", require_arg, 'b'}, + {"min-buff", require_arg, 'b'}, + {"min-buf", require_arg, 'b'}, + {"min-bu", require_arg, 'b'}, + {"min-b", require_arg, 'b'}, + {"min", require_arg, 'b'}, + {"prefix", require_arg, 'p'}, + {"prefi", require_arg, 'p'}, + {"pref", require_arg, 'p'}, + {"pre", require_arg, 'p'}, + {"pr", require_arg, 'p'}, + {"random-test", no_arg, 'r'}, + {"random-tes", no_arg, 'r'}, + {"random-te", no_arg, 'r'}, + {"random-t", no_arg, 'r'}, + {"random", no_arg, 'r'}, + {"rando", no_arg, 'r'}, + {"rand", no_arg, 'r'}, + {"ran", no_arg, 'r'}, + {"ra", no_arg, 'r'}, + {NULL, 0, '\0'}}; /* * Function: error @@ -551,7 +551,7 @@ main(int argc, const char *argv[]) /* Initialize h5tools lib */ h5tools_init(); - while ((opt = get_option(argc, argv, s_opts, l_opts)) > 0) { + while ((opt = H5_get_option(argc, argv, s_opts, l_opts)) > 0) { switch ((char)opt) { case '0': case '1': @@ -566,13 +566,13 @@ main(int argc, const char *argv[]) compress_level = opt - '0'; break; case 'B': - max_buf_size = parse_size_directive(opt_arg); + max_buf_size = parse_size_directive(H5_optarg); break; case 'b': - min_buf_size = parse_size_directive(opt_arg); + min_buf_size = parse_size_directive(H5_optarg); break; case 'c': - compress_percent = (int)HDstrtol(opt_arg, NULL, 10); + compress_percent = (int)HDstrtol(H5_optarg, NULL, 10); if (compress_percent < 0) compress_percent = 0; @@ -581,13 +581,13 @@ main(int argc, const char *argv[]) break; case 'p': - option_prefix = opt_arg; + option_prefix = H5_optarg; break; case 'r': random_test = TRUE; break; case 's': - file_size = parse_size_directive(opt_arg); + file_size = parse_size_directive(H5_optarg); break; case '?': usage(); -- cgit v0.12 From 9ac96e5a21de2be00aa22300c9d21f3293e9eedc Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Tue, 29 Jun 2021 13:07:19 -0700 Subject: Removes type guesses when C99 types are missing (#807) --- src/H5private.h | 68 --------------------------------------------------------- 1 file changed, 68 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index d11b15b..71b913a 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -356,74 +356,6 @@ #endif /* - * Numeric data types. Some of these might be defined in Posix.1g, otherwise - * we define them with the closest available type which is at least as large - * as the number of bits indicated in the type name. The `int8' types *must* - * be exactly one byte wide because we use it for pointer calculations to - * void* memory. - */ -#if H5_SIZEOF_INT8_T == 0 -typedef signed char int8_t; -#undef H5_SIZEOF_INT8_T -#define H5_SIZEOF_INT8_T H5_SIZEOF_CHAR -#elif H5_SIZEOF_INT8_T == 1 -#else -#error "the int8_t type must be 1 byte wide" -#endif - -#if H5_SIZEOF_UINT8_T == 0 -typedef unsigned char uint8_t; -#undef H5_SIZEOF_UINT8_T -#define H5_SIZEOF_UINT8_T H5_SIZEOF_CHAR -#elif H5_SIZEOF_UINT8_T == 1 -#else -#error "the uint8_t type must be 1 byte wide" -#endif - -#if H5_SIZEOF_INT16_T >= 2 -#elif H5_SIZEOF_SHORT >= 2 -typedef short int16_t; -#undef H5_SIZEOF_INT16_T -#define H5_SIZEOF_INT16_T H5_SIZEOF_SHORT -#elif H5_SIZEOF_INT >= 2 -typedef int int16_t; -#undef H5_SIZEOF_INT16_T -#define H5_SIZEOF_INT16_T H5_SIZEOF_INT -#else -#error "nothing appropriate for int16_t" -#endif - -#if H5_SIZEOF_UINT16_T >= 2 -#elif H5_SIZEOF_SHORT >= 2 -typedef unsigned short uint16_t; -#undef H5_SIZEOF_UINT16_T -#define H5_SIZEOF_UINT16_T H5_SIZEOF_SHORT -#elif H5_SIZEOF_INT >= 2 -typedef unsigned uint16_t; -#undef H5_SIZEOF_UINT16_T -#define H5_SIZEOF_UINT16_T H5_SIZEOF_INT -#else -#error "nothing appropriate for uint16_t" -#endif - -#if H5_SIZEOF_INT32_T >= 4 -#elif H5_SIZEOF_SHORT >= 4 -typedef short int32_t; -#undef H5_SIZEOF_INT32_T -#define H5_SIZEOF_INT32_T H5_SIZEOF_SHORT -#elif H5_SIZEOF_INT >= 4 -typedef int int32_t; -#undef H5_SIZEOF_INT32_T -#define H5_SIZEOF_INT32_T H5_SIZEOF_INT -#elif H5_SIZEOF_LONG >= 4 -typedef long int32_t; -#undef H5_SIZEOF_INT32_T -#define H5_SIZEOF_INT32_T H5_SIZEOF_LONG -#else -#error "nothing appropriate for int32_t" -#endif - -/* * Maximum and minimum values. These should be defined in for the * most part. */ -- cgit v0.12 From 858a2b28662ba18596e668bf9719285acd645df7 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Tue, 29 Jun 2021 13:07:43 -0700 Subject: Assume C99 types exist in H5detect.c (#808) --- src/H5detect.c | 90 ---------------------------------------------------------- 1 file changed, 90 deletions(-) diff --git a/src/H5detect.c b/src/H5detect.c index b2c0924..2e893cf 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -1278,60 +1278,18 @@ detect_C89_floats(void) static void HDF_NO_UBSAN detect_C99_integers8(void) { -#if H5_SIZEOF_INT8_T > 0 -#if H5_SIZEOF_INT8_T == 1 DETECT_BYTE(int8_t, INT8, d_g[nd_g]); nd_g++; -#else - DETECT_I(int8_t, INT8, d_g[nd_g]); - nd_g++; -#endif -#endif -#if H5_SIZEOF_UINT8_T > 0 -#if H5_SIZEOF_UINT8_T == 1 DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++; -#else - DETECT_I(uint8_t, UINT8, d_g[nd_g]); - nd_g++; -#endif -#endif -#if H5_SIZEOF_INT_LEAST8_T > 0 -#if H5_SIZEOF_INT_LEAST8_T == 1 DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; -#else - DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); - nd_g++; -#endif -#endif -#if H5_SIZEOF_UINT_LEAST8_T > 0 -#if H5_SIZEOF_UINT_LEAST8_T == 1 DETECT_BYTE(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; -#else - DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); - nd_g++; -#endif -#endif -#if H5_SIZEOF_INT_FAST8_T > 0 -#if H5_SIZEOF_INT_FAST8_T == 1 DETECT_BYTE(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; -#else - DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); - nd_g++; -#endif -#endif -#if H5_SIZEOF_UINT_FAST8_T > 0 -#if H5_SIZEOF_UINT_FAST8_T == 1 DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; -#else - DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); - nd_g++; -#endif -#endif } /*------------------------------------------------------------------------- @@ -1345,30 +1303,18 @@ detect_C99_integers8(void) static void HDF_NO_UBSAN detect_C99_integers16(void) { -#if H5_SIZEOF_INT16_T > 0 DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_UINT16_T > 0 DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_INT_LEAST16_T > 0 DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_UINT_LEAST16_T > 0 DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_INT_FAST16_T > 0 DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_UINT_FAST16_T > 0 DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++; -#endif } /*------------------------------------------------------------------------- @@ -1382,30 +1328,18 @@ detect_C99_integers16(void) static void HDF_NO_UBSAN detect_C99_integers32(void) { -#if H5_SIZEOF_INT32_T > 0 DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_UINT32_T > 0 DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_INT_LEAST32_T > 0 DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_UINT_LEAST32_T > 0 DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_INT_FAST32_T > 0 DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_UINT_FAST32_T > 0 DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++; -#endif } /*------------------------------------------------------------------------- @@ -1420,47 +1354,23 @@ detect_C99_integers32(void) static void HDF_NO_UBSAN detect_C99_integers64(void) { -#if H5_SIZEOF_INT64_T > 0 DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_UINT64_T > 0 DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_INT_LEAST64_T > 0 DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_UINT_LEAST64_T > 0 DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_INT_FAST64_T > 0 DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_UINT_FAST64_T > 0 DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++; -#endif -#if H5_SIZEOF_LONG_LONG > 0 DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++; DETECT_I(unsigned long long, ULLONG, d_g[nd_g]); nd_g++; -#else - /* - * This architecture doesn't support an integer type larger than `long' - * so we'll just make H5T_NATIVE_LLONG the same as H5T_NATIVE_LONG since - * `long long' is probably equivalent to `long' here anyway. - */ - DETECT_I(long, LLONG, d_g[nd_g]); - nd_g++; - DETECT_I(unsigned long, ULLONG, d_g[nd_g]); - nd_g++; -#endif } /*------------------------------------------------------------------------- -- cgit v0.12