summaryrefslogtreecommitdiffstats
path: root/tools/h5dumputil.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>1999-04-28 00:06:29 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>1999-04-28 00:06:29 (GMT)
commit07ff900c2631645d81f9a33f817c18bffdda6e1e (patch)
tree425f9effabfe47dd5ae79dfa9d961d5c39190317 /tools/h5dumputil.c
parent97496e9b604fecd6b668f65d38e41bce5b7cc423 (diff)
downloadhdf5-07ff900c2631645d81f9a33f817c18bffdda6e1e.zip
hdf5-07ff900c2631645d81f9a33f817c18bffdda6e1e.tar.gz
hdf5-07ff900c2631645d81f9a33f817c18bffdda6e1e.tar.bz2
[svn-r1226] Purpose:
Bug fix Description: dumper repeated output after the 1st 4 rows. The bug was because the dumper was reading just a small slice a time from the file dataset but did not adjust the offset in the file-space. So, it just kept reading the same first slice. Solution: Stole the offset-adjustion code from the routine that h5ls uses. Platform Tested: O2K.
Diffstat (limited to 'tools/h5dumputil.c')
-rw-r--r--tools/h5dumputil.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/h5dumputil.c b/tools/h5dumputil.c
index d63c98f..2f05e4d 100644
--- a/tools/h5dumputil.c
+++ b/tools/h5dumputil.c
@@ -517,6 +517,7 @@ h5dump_simple(hid_t oid, hid_t p_type, int obj_data)
hid_t f_space; /*file data space */
int ndims; /*dimensionality */
hsize_t elmtno, i; /*counters */
+ int carry; /*counter carry value */
hssize_t zero[8]; /*vector of zeros */
/* Print info */
@@ -645,6 +646,16 @@ h5dump_simple(hid_t oid, hid_t p_type, int obj_data)
default: break;
}
+
+ /* Calculate the next hyperslab offset */
+ for (i=ndims, carry=1; i>0 && carry; --i) {
+ hs_offset[i-1] += hs_size[i-1];
+ if (hs_offset[i-1]==(hssize_t)p_max_idx[i-1]) {
+ hs_offset[i-1] = p_min_idx[i-1];
+ } else {
+ carry = 0;
+ }
+ }
}
H5Sclose(sm_space);