aboutsummaryrefslogtreecommitdiff
path: root/src/util/hdf5_recombiner.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/hdf5_recombiner.c')
-rw-r--r--src/util/hdf5_recombiner.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/util/hdf5_recombiner.c b/src/util/hdf5_recombiner.c
index c3c662d..eb91502 100644
--- a/src/util/hdf5_recombiner.c
+++ b/src/util/hdf5_recombiner.c
@@ -616,7 +616,12 @@ static int RecombineGroupData (const char *groupname)
hid_t unchunked_datatype, unchunked_dataspace, unchunked_dataset;
hid_t slice_dataspace;
hsize_t tmp1, ndims, chunk_ndims, *dims, *chunk_dims, *slice_dims;
+#if (H5_VERS_MAJOR == 1 && \
+ (H5_VERS_MINOR < 6 || (H5_VERS_MINOR == 6 && H5_VERS_RELEASE < 4)))
hssize_t tmp2, *chunk_origin, *slice_origin;
+#else
+ hsize_t tmp2, *chunk_origin, *slice_origin;
+#endif
void *data;
char *chunkname;
H5T_class_t class;
@@ -678,7 +683,7 @@ static int RecombineGroupData (const char *groupname)
NULL));
/* allocate buffers to read a 'chunk_origin' attribute and the chunk dims */
- chunk_origin = calloc (2 * ndims, sizeof (hssize_t));
+ chunk_origin = calloc (2 * ndims, sizeof (*chunk_origin));
chunk_dims = calloc (2 * ndims, sizeof (hsize_t));
slice_origin = chunk_origin + ndims;
slice_dims = chunk_dims + ndims;
@@ -731,7 +736,12 @@ static int RecombineGroupData (const char *groupname)
chunk_ndims = H5Sget_simple_extent_npoints (dataspace);
if (chunk_ndims == ndims)
{
+#if (H5_VERS_MAJOR == 1 && \
+ (H5_VERS_MINOR < 6 || (H5_VERS_MINOR == 6 && H5_VERS_RELEASE < 4)))
CHECK_ERROR (H5Aread (attr, H5T_NATIVE_HSSIZE, chunk_origin));
+#else
+ CHECK_ERROR (H5Aread (attr, H5T_NATIVE_HSIZE, chunk_origin));
+#endif
}
CHECK_ERROR (H5Sclose (dataspace));
CHECK_ERROR (H5Tclose (datatype));
@@ -845,7 +855,7 @@ static int RecombineGroupData (const char *groupname)
chunk_origin[ndims - 1] == 0 &&
(ndims == 1 || chunk_origin[ndims - 2] == 0))
{
- memset (slice_origin, 0, ndims * sizeof (hssize_t));
+ memset (slice_origin, 0, ndims * sizeof (*slice_origin));
memcpy (slice_dims, chunk_dims, ndims * sizeof (hsize_t));
slice_dims[ndims - 1] = dims[ndims - 1];
if (ndims > 1)
@@ -860,7 +870,7 @@ static int RecombineGroupData (const char *groupname)
if (! data)
{
fprintf (stderr, "WARNING: couldn't allocate %d bytes to recombine "
- "slice of dataset '%s' !\n", size, chunkname);
+ "slice of dataset '%s' !\n", (int) size, chunkname);
CHECK_ERROR (H5Sclose (slice_dataspace));
CHECK_ERROR (H5Sclose (chunked_dataspace));
CHECK_ERROR (H5Dclose (chunked_dataset));