summaryrefslogtreecommitdiffstats
path: root/src/H5VMprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5VMprivate.h')
-rw-r--r--src/H5VMprivate.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index f402b36..cbe108a 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -65,6 +65,23 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
} /* end if */ \
}
+/* 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) { \
+ /* COORDS must be an array of type TYPE */ \
+ HDassert(sizeof(COORDS[0]) == sizeof(TYPE)); \
+ \
+ /* Nothing to do when unlimited dimension is at position 0 */ \
+ if(0 != (UNLIM_DIM)) { \
+ TYPE _tmp = (COORDS)[0]; \
+ \
+ HDmemmove(&(COORDS)[0], &(COORDS)[1], sizeof(TYPE) * (UNLIM_DIM)); \
+ (COORDS)[UNLIM_DIM] = _tmp; \
+ } /* end if */ \
+}
+
/* A null pointer is equivalent to a zero vector */
#define H5VM_ZERO NULL