aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2006-06-15 15:46:41 +0000
committertradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2006-06-15 15:46:41 +0000
commit7c0834a5ac219d076e913f6b2e66c4000af2eefc (patch)
treee9ae48650fb8a91ef334ef45207873eb1e707bfa
parent9e0a614d94238285ea71c4c02257f421ef359562 (diff)
Fix datatype of the 'origin' argument in H5Sselect_hyperslab() calls.
This has changed after HDF5-1.6.3. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@131 7842ec3a-9562-4be5-9c5b-06ba18f2b668
-rw-r--r--src/DumpVar.c18
-rw-r--r--src/RecoverVar.c9
2 files changed, 21 insertions, 6 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c
index f06bcb5..934ef10 100644
--- a/src/DumpVar.c
+++ b/src/DumpVar.c
@@ -528,7 +528,12 @@ static void WriteData (const cGH *GH, const ioRequest *request,const char *name,
ioHDF5UtilGH *myGH;
hid_t hdf5type, group, dataset, memspace, filespace, plist;
char *chunkname;
+#if (H5_VERS_MAJOR == 1 && \
+ (H5_VERS_MINOR < 6 || (H5_VERS_MINOR == 6 && H5_VERS_RELEASE < 4)))
hssize_t *chunk_origin;
+#else
+ hsize_t *chunk_origin;
+#endif
hsize_t *chunk_dims, *file_dims;
hsize_t buffersize;
DECLARE_CCTK_PARAMETERS
@@ -545,8 +550,8 @@ static void WriteData (const cGH *GH, const ioRequest *request,const char *name,
/* copy the size arrays from CCTK_INT to appropriate types
note that HDF5 wants elements in reverse order */
- chunk_origin = malloc (request->hdim * sizeof (hssize_t));
- chunk_dims = malloc (2*request->hdim * sizeof (hsize_t));
+ chunk_origin = malloc (request->hdim * sizeof (*chunk_origin));
+ chunk_dims = malloc (2*request->hdim * sizeof (*chunk_dims));
file_dims = chunk_dims + request->hdim;
for (i = 0; i < request->hdim; i++)
{
@@ -708,7 +713,12 @@ static void WriteDataCollective (const cGH *GH, const ioRequest *request,
{
int i;
hid_t hdf5type, dataset, memspace, filespace, plist;
+#if (H5_VERS_MAJOR == 1 && \
+ (H5_VERS_MINOR < 6 || (H5_VERS_MINOR == 6 && H5_VERS_RELEASE < 4)))
hssize_t *chunk_origin;
+#else
+ hsize_t *chunk_origin;
+#endif
hsize_t *chunk_dims, *file_dims;
hsize_t buffersize;
const ioHDF5UtilGH *myGH;
@@ -723,8 +733,8 @@ static void WriteDataCollective (const cGH *GH, const ioRequest *request,
/* copy the size arrays from CCTK_INT to appropriate types
note that HDF5 wants elements in reverse order */
- chunk_origin = malloc (request->hdim * sizeof (hssize_t));
- chunk_dims = malloc (2*request->hdim * sizeof (hsize_t));
+ chunk_origin = malloc (request->hdim * sizeof (*chunk_origin));
+ chunk_dims = malloc (2*request->hdim * sizeof (*chunk_dims));
file_dims = chunk_dims + request->hdim;
for (i = 0; i < request->hdim; i++)
{
diff --git a/src/RecoverVar.c b/src/RecoverVar.c
index 90072a2..2097fdf 100644
--- a/src/RecoverVar.c
+++ b/src/RecoverVar.c
@@ -610,7 +610,12 @@ static int IOHDF5Util_RestoreGA (hid_t dataset, int vindex, int timelevel,
hid_t filespace, memspace, chunk;
pGExtras *extras;
char chunkname[32];
+#if (H5_VERS_MAJOR == 1 && \
+ (H5_VERS_MINOR < 6 || (H5_VERS_MINOR == 6 && H5_VERS_RELEASE < 4)))
hssize_t *chunk_origin;
+#else
+ hsize_t *chunk_origin;
+#endif
hsize_t *chunk_dims;
#endif
@@ -634,8 +639,8 @@ static int IOHDF5Util_RestoreGA (hid_t dataset, int vindex, int timelevel,
/* get the dimension of the variable */
dim = CCTK_GroupDimFromVarI (vindex);
- chunk_origin = malloc (dim * sizeof (hssize_t));
- chunk_dims = malloc (dim * sizeof (hsize_t));
+ chunk_origin = malloc (dim * sizeof (*chunk_origin));
+ chunk_dims = malloc (dim * sizeof (*chunk_dims));
/* allocate memory for the biggest chunk */
npoints = 1;