summaryrefslogtreecommitdiffstats
path: root/src/H5VMprivate.h
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2023-06-16 04:49:02 (GMT)
committerGitHub <noreply@github.com>2023-06-16 04:49:02 (GMT)
commit68eba3da69e659fab69bbef5901ce42e82cea1dc (patch)
treef36805f798df6c04092c14dc6803d2cb82f6eff2 /src/H5VMprivate.h
parent10093f7c4345061bdbebc12888debbf08fe85a5b (diff)
downloadhdf5-68eba3da69e659fab69bbef5901ce42e82cea1dc.zip
hdf5-68eba3da69e659fab69bbef5901ce42e82cea1dc.tar.gz
hdf5-68eba3da69e659fab69bbef5901ce42e82cea1dc.tar.bz2
Many clang -Wextra-semi-stmt fixes (#2537)
* Adds semicolons to function-like macros * Adds a do..while(0) loop to some macros * Removes semicolons when inappropriate, especially H5E_TRY_BEGIN/END
Diffstat (limited to 'src/H5VMprivate.h')
-rw-r--r--src/H5VMprivate.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index 49bb53d..0c96fef 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -35,13 +35,13 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len,
/* Other functions */
#define H5VM_vector_cpy(N, DST, SRC) \
- { \
+ do { \
HDassert(sizeof(*(DST)) == sizeof(*(SRC))); \
if (SRC) \
H5MM_memcpy(DST, SRC, (N) * sizeof(*(DST))); \
else \
HDmemset(DST, 0, (N) * sizeof(*(DST))); \
- }
+ } while (0)
#define H5VM_vector_zero(N, DST) HDmemset(DST, 0, (N) * sizeof(*(DST)))
@@ -49,7 +49,7 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len,
* dimension (UNLIM_DIM) value to offset 0, sliding any intermediate values down
* one position. */
#define H5VM_swizzle_coords(TYPE, COORDS, UNLIM_DIM) \
- { \
+ do { \
/* COORDS must be an array of type TYPE */ \
HDassert(sizeof(COORDS[0]) == sizeof(TYPE)); \
\
@@ -60,14 +60,14 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len,
HDmemmove(&(COORDS)[1], &(COORDS)[0], sizeof(TYPE) * (UNLIM_DIM)); \
(COORDS)[0] = _tmp; \
} /* end if */ \
- }
+ } while (0)
/* Given a coordinate offset array (COORDS) of type TYPE, move the value at
* offset 0 to offset of the unlimied dimension (UNLIM_DIM), sliding any
* intermediate values up one position. Undoes the "swizzle_coords" operation.
*/
#define H5VM_unswizzle_coords(TYPE, COORDS, UNLIM_DIM) \
- { \
+ do { \
/* COORDS must be an array of type TYPE */ \
HDassert(sizeof(COORDS[0]) == sizeof(TYPE)); \
\
@@ -78,7 +78,7 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len,
HDmemmove(&(COORDS)[0], &(COORDS)[1], sizeof(TYPE) * (UNLIM_DIM)); \
(COORDS)[UNLIM_DIM] = _tmp; \
} /* end if */ \
- }
+ } while (0)
/* A null pointer is equivalent to a zero vector */
#define H5VM_ZERO NULL