summaryrefslogtreecommitdiffstats
path: root/src/H5Eprivate.h
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2023-07-24 21:18:04 (GMT)
committerGitHub <noreply@github.com>2023-07-24 21:18:04 (GMT)
commit553e1cd31150f7ca58f87f40d63dd8f200721611 (patch)
tree12b0aa9c90279d015bf6596e2b60d443d384c0c1 /src/H5Eprivate.h
parente0083c48e90beb5b56bf93eccdbfa89baa79750a (diff)
downloadhdf5-553e1cd31150f7ca58f87f40d63dd8f200721611.zip
hdf5-553e1cd31150f7ca58f87f40d63dd8f200721611.tar.gz
hdf5-553e1cd31150f7ca58f87f40d63dd8f200721611.tar.bz2
Another round of fixing -Wextra-semi-stmt warnings (#3264)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5Eprivate.h')
-rw-r--r--src/H5Eprivate.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index e3319e5..0491439 100644
--- a/src/H5Eprivate.h
+++ b/src/H5Eprivate.h
@@ -30,16 +30,20 @@ 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__)
+ do { \
+ H5E_printf_stack(NULL, __FILE__, __func__, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__); \
+ } while (0)
/*
* HCOMMON_ERROR macro, used by HDONE_ERROR and HGOTO_ERROR
* (Shouldn't need to be used outside this header file)
*/
#define HCOMMON_ERROR(maj, min, ...) \
- HERROR(maj, min, __VA_ARGS__); \
- err_occurred = TRUE; \
- err_occurred = err_occurred; /* Shut GCC warnings up! */
+ do { \
+ HERROR(maj, min, __VA_ARGS__); \
+ err_occurred = TRUE; \
+ err_occurred = err_occurred; /* Shut GCC warnings up! */ \
+ } while (0)
/*
* HDONE_ERROR macro, used to facilitate error reporting between a
@@ -51,10 +55,10 @@ typedef struct H5E_t H5E_t;
* without jumping to any labels)
*/
#define HDONE_ERROR(maj, min, ret_val, ...) \
- { \
+ do { \
HCOMMON_ERROR(maj, min, __VA_ARGS__); \
ret_value = ret_val; \
- }
+ } while (0)
/*
* HGOTO_ERROR macro, used to facilitate error reporting between a
@@ -74,11 +78,11 @@ typedef struct H5E_t H5E_t;
* H5_END_TAG statements. Resets the metadata tag before leaving the function.
*/
#define HGOTO_ERROR_TAG(maj, min, ret_val, ...) \
- { \
+ do { \
H5AC_tag(prv_tag, NULL); \
HCOMMON_ERROR(maj, min, __VA_ARGS__); \
HGOTO_DONE(ret_val); \
- }
+ } while (0)
/*
* HGOTO_DONE macro, used to facilitate normal return between a FUNC_ENTER()
@@ -97,10 +101,10 @@ typedef struct H5E_t H5E_t;
* H5_END_TAG statements. Resets the metadata tag before leaving the function.
*/
#define HGOTO_DONE_TAG(ret_val) \
- { \
+ do { \
H5AC_tag(prv_tag, NULL); \
HGOTO_DONE(ret_val); \
- }
+ } while (0)
/*
* Macros handling system error messages as described in C standard.