summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-09-28 19:00:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-09-28 19:00:43 (GMT)
commitebb5d3a90d111b5bed0e0cdfa837b9673abb180e (patch)
treeaa209362a35ccae7f85925de3420bc3892f73249 /src
parentefbadc2165e1a7a614615a0668badb9b859becdc (diff)
downloadhdf5-ebb5d3a90d111b5bed0e0cdfa837b9673abb180e.zip
hdf5-ebb5d3a90d111b5bed0e0cdfa837b9673abb180e.tar.gz
hdf5-ebb5d3a90d111b5bed0e0cdfa837b9673abb180e.tar.bz2
[svn-r4489] Purpose:
Bug Fix Description: When writing (or reading) the entire dataset to a chunked dataset, there was a boundary case where the code to generate the description of the piece of the dataset to read into the buffer for data conversion would attempt to read off the boundary of the dataset. This was occuring because the code to detect the edge of the dataset was not propagating the change up through the remaining dimensions when an edge in a fast changing dimension was detected. Solution: Propagate edge detection up through slower changing dimensions properly. Platforms tested: Linux 2.2.18smp (eirene)
Diffstat (limited to 'src')
-rw-r--r--src/H5Dseq.c20
-rw-r--r--src/H5Fseq.c20
2 files changed, 40 insertions, 0 deletions
diff --git a/src/H5Dseq.c b/src/H5Dseq.c
index 45a6815..59e011b 100644
--- a/src/H5Dseq.c
+++ b/src/H5Dseq.c
@@ -348,6 +348,16 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Correct the coords array */
coords[i]=0;
coords[i-1]++;
+
+ /* Carry the coord array correction up the array, if the dimension is finished */
+ while(i>0 && coords[i-1]==(hssize_t)dset_dims[i-1]) {
+ i--;
+ coords[i]=0;
+ if(i>0) {
+ coords[i-1]++;
+ assert(coords[i-1]<=(hssize_t)dset_dims[i-1]);
+ } /* end if */
+ } /* end while */
} /* end if */
} /* end for */
@@ -721,6 +731,16 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Correct the coords array */
coords[i]=0;
coords[i-1]++;
+
+ /* Carry the coord array correction up the array, if the dimension is finished */
+ while(i>0 && coords[i-1]==(hssize_t)dset_dims[i-1]) {
+ i--;
+ coords[i]=0;
+ if(i>0) {
+ coords[i-1]++;
+ assert(coords[i-1]<=(hssize_t)dset_dims[i-1]);
+ } /* end if */
+ } /* end while */
} /* end if */
} /* end for */
diff --git a/src/H5Fseq.c b/src/H5Fseq.c
index 45a6815..59e011b 100644
--- a/src/H5Fseq.c
+++ b/src/H5Fseq.c
@@ -348,6 +348,16 @@ H5F_seq_readv(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Correct the coords array */
coords[i]=0;
coords[i-1]++;
+
+ /* Carry the coord array correction up the array, if the dimension is finished */
+ while(i>0 && coords[i-1]==(hssize_t)dset_dims[i-1]) {
+ i--;
+ coords[i]=0;
+ if(i>0) {
+ coords[i-1]++;
+ assert(coords[i-1]<=(hssize_t)dset_dims[i-1]);
+ } /* end if */
+ } /* end while */
} /* end if */
} /* end for */
@@ -721,6 +731,16 @@ H5F_seq_writev(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout,
/* Correct the coords array */
coords[i]=0;
coords[i-1]++;
+
+ /* Carry the coord array correction up the array, if the dimension is finished */
+ while(i>0 && coords[i-1]==(hssize_t)dset_dims[i-1]) {
+ i--;
+ coords[i]=0;
+ if(i>0) {
+ coords[i-1]++;
+ assert(coords[i-1]<=(hssize_t)dset_dims[i-1]);
+ } /* end if */
+ } /* end while */
} /* end if */
} /* end for */