summaryrefslogtreecommitdiffstats
path: root/src/H5VMprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-04-05 07:12:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-04-05 07:12:56 (GMT)
commit5d46ad9b3984dcddffaf369a92a8ef95339f8547 (patch)
treec2d31d43ca3a4030d6809b65d719e064ca27fa17 /src/H5VMprivate.h
parenta816d031089f0afd2f2a2261a4e0d6277491e8b5 (diff)
downloadhdf5-5d46ad9b3984dcddffaf369a92a8ef95339f8547.zip
hdf5-5d46ad9b3984dcddffaf369a92a8ef95339f8547.tar.gz
hdf5-5d46ad9b3984dcddffaf369a92a8ef95339f8547.tar.bz2
[svn-r29635] Description:
Bring support for earray and v2 B-trees from revise_chunks branch to trunk. Tested on: MacOSX/64 10.11.4 (amazon) w/serial, parallel & production (h5committest forthcoming)
Diffstat (limited to 'src/H5VMprivate.h')
-rw-r--r--src/H5VMprivate.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h
index 7d3361b..f402b36 100644
--- a/src/H5VMprivate.h
+++ b/src/H5VMprivate.h
@@ -49,6 +49,22 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off,
#define H5VM_vector_zero(N,DST) HDmemset(DST,0,(N)*sizeof(*(DST)))
+/* Given a coordinate offset array (COORDS) of type TYPE, move the unlimited
+ * dimension (UNLIM_DIM) value to offset 0, sliding any intermediate values down
+ * one position. */
+#define H5VM_swizzle_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)[UNLIM_DIM]; \
+ \
+ HDmemmove(&(COORDS)[1], &(COORDS)[0], sizeof(TYPE) * (UNLIM_DIM)); \
+ (COORDS)[0] = _tmp; \
+ } /* end if */ \
+}
+
/* A null pointer is equivalent to a zero vector */
#define H5VM_ZERO NULL