aboutsummaryrefslogtreecommitdiff
path: root/src/ioHDF5UtilGH.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ioHDF5UtilGH.h')
-rw-r--r--src/ioHDF5UtilGH.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/ioHDF5UtilGH.h b/src/ioHDF5UtilGH.h
index 073e400..a5d1a16 100644
--- a/src/ioHDF5UtilGH.h
+++ b/src/ioHDF5UtilGH.h
@@ -38,13 +38,19 @@
{ \
int len; \
hid_t attr; \
- void *val = value; \
+ /* this union is only there to fix a bug in the HDF5 API */ \
+ union \
+ { \
+ const void *const_val; \
+ void *non_const_val; \
+ } v; \
hsize_t arrayDim = dim; \
\
\
+ v.const_val = value; \
if (H5Tget_class (datatype) == H5T_STRING) \
{ \
- len = strlen ((char *) val); \
+ len = strlen ((const char *) v.const_val); \
if (len == 0) /* HDF5 doesn't like zero-len strings */ \
{ \
len++; \
@@ -58,7 +64,7 @@
} \
IOHDF5_ERROR (attr = H5Acreate (dataset, name, datatype, \
dataspace, H5P_DEFAULT)); \
- IOHDF5_ERROR (H5Awrite (attr, datatype, val)); \
+ IOHDF5_ERROR (H5Awrite (attr, datatype, v.non_const_val)); \
IOHDF5_ERROR (H5Aclose (attr)); \
} while (0);
@@ -154,6 +160,9 @@ typedef struct
int ioproc; /* the associated IO processor */
int ioproc_every; /* how many IO processors there are */
int unchunked; /* whether data was written chunked or unchunked */
+ int has_version; /* whether file contains a Cactus version ID
+ (this is used to distinguish checkpoint files
+ with old/new timelevel naming scheme) */
} fileinfo_t;