diff options
Diffstat (limited to 'src/H5VMprivate.h')
-rw-r--r-- | src/H5VMprivate.h | 12 |
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 |