From d18b858c0be9b0ff2a68db8271a2f04be9d3a46e Mon Sep 17 00:00:00 2001 From: tradke Date: Thu, 19 Apr 2001 21:10:39 +0000 Subject: Fixed minor gcc compiler warnings. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@25 7842ec3a-9562-4be5-9c5b-06ba18f2b668 --- src/ioHDF5UtilGH.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/ioHDF5UtilGH.h') 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; -- cgit v1.2.3