aboutsummaryrefslogtreecommitdiff
path: root/src/ioHDF5UtilGH.h
diff options
context:
space:
mode:
authortradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2001-08-10 23:40:58 +0000
committertradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2001-08-10 23:40:58 +0000
commit3f507b050629528b23235ac9c3077185c4b14c57 (patch)
treedb1c861b4dde2da427b2c7be96120eb50c8bca50 /src/ioHDF5UtilGH.h
parent18d2a2d23167259c7d098d83a430ae13cefb22c6 (diff)
Fixed name conflicts in macro.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@42 7842ec3a-9562-4be5-9c5b-06ba18f2b668
Diffstat (limited to 'src/ioHDF5UtilGH.h')
-rw-r--r--src/ioHDF5UtilGH.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/ioHDF5UtilGH.h b/src/ioHDF5UtilGH.h
index 211d999..ed16fb2 100644
--- a/src/ioHDF5UtilGH.h
+++ b/src/ioHDF5UtilGH.h
@@ -22,14 +22,14 @@
#define IOHDF5_ERROR(fn_call) \
do \
{ \
- int error_code = fn_call; \
+ int _error_code = fn_call; \
\
\
- if (error_code < 0) \
+ if (_error_code < 0) \
{ \
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, \
"HDF5 call '%s' returned error code %d\n", \
- #fn_call, error_code); \
+ #fn_call, _error_code); \
} \
} while (0)
@@ -37,73 +37,73 @@
#define WRITE_ATTRIBUTE(name, value, dataset, dataspace, dim, datatype) \
do \
{ \
- int len; \
- hid_t attr; \
+ int _len; \
+ hid_t _attr; \
/* 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; \
+ hsize_t _arrayDim = dim; \
\
\
- v.const_val = value; \
+ _v.const_val = value; \
if (H5Tget_class (datatype) == H5T_STRING) \
{ \
- len = strlen ((const char *) v.const_val); \
- if (len == 0) /* HDF5 doesn't like zero-len strings */ \
+ _len = strlen ((const char *) _v.const_val); \
+ if (_len == 0) /* HDF5 doesn't like zero-len strings */ \
{ \
- len++; \
+ _len++; \
} \
- IOHDF5_ERROR (H5Tset_size (datatype, len)); \
+ IOHDF5_ERROR (H5Tset_size (datatype, _len)); \
} \
- if (arrayDim > 0) \
+ if (_arrayDim > 0) \
{ \
IOHDF5_ERROR (H5Sset_extent_simple (dataspace, 1, \
- &arrayDim, NULL)); \
+ &_arrayDim, NULL)); \
} \
- IOHDF5_ERROR (attr = H5Acreate (dataset, name, datatype, \
- dataspace, H5P_DEFAULT)); \
- IOHDF5_ERROR (H5Awrite (attr, datatype, v.non_const_val)); \
- IOHDF5_ERROR (H5Aclose (attr)); \
+ IOHDF5_ERROR (_attr = H5Acreate (dataset, name, datatype, \
+ dataspace, H5P_DEFAULT)); \
+ IOHDF5_ERROR (H5Awrite (_attr, datatype, _v.non_const_val)); \
+ IOHDF5_ERROR (H5Aclose (_attr)); \
} while (0);
/* macro for reading an attribute */
#define READ_ATTRIBUTE(dataset, attrname, requested_type, buffer) \
do \
{ \
- hid_t attr, attrtype; \
- hsize_t asize = 0; \
+ hid_t _attr, _attrtype; \
+ hsize_t _asize = 0; \
\
\
- if ((attr = H5Aopen_name (dataset, attrname)) < 0) \
+ if ((_attr = H5Aopen_name (dataset, attrname)) < 0) \
{ \
CCTK_WARN (1, "Can't find " attrname " attribute"); \
} \
if (requested_type == H5T_C_S1) \
{ \
- IOHDF5_ERROR (attrtype = H5Aget_type (attr)); \
- IOHDF5_ERROR (asize = H5Tget_size (attrtype)); \
- if (asize + 1 >= sizeof (buffer)) \
+ IOHDF5_ERROR (_attrtype = H5Aget_type (_attr)); \
+ IOHDF5_ERROR (_asize = H5Tget_size (_attrtype)); \
+ if (_asize + 1 >= sizeof (buffer)) \
{ \
CCTK_WARN (1, "Can't read " attrname " attribute (too long)");\
} \
} \
else \
{ \
- attrtype = requested_type; \
+ _attrtype = requested_type; \
} \
- if (H5Aread (attr, attrtype, buffer) < 0) \
+ if (H5Aread (_attr, _attrtype, buffer) < 0) \
{ \
CCTK_WARN (1, "Can't read " attrname " attribute"); \
} \
if (requested_type == H5T_C_S1) \
{ \
- ((char *) buffer)[asize] = 0; \
- IOHDF5_ERROR (H5Tclose (attrtype)); \
+ ((char *) buffer)[_asize] = 0; \
+ IOHDF5_ERROR (H5Tclose (_attrtype)); \
} \
- IOHDF5_ERROR (H5Aclose (attr)); \
+ IOHDF5_ERROR (H5Aclose (_attr)); \
} while (0)