summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1998-07-15 00:47:18 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1998-07-15 00:47:18 (GMT)
commite350a69a55f2101d7e31dc8b3565da50ef452643 (patch)
tree0b4f2b4b10be3ae4fc73999df45bd980e2cc5635 /src/H5Shyper.c
parente0c9ca3cce62a7cfe072c52cd5d98c334d46b9ff (diff)
downloadhdf5-e350a69a55f2101d7e31dc8b3565da50ef452643.zip
hdf5-e350a69a55f2101d7e31dc8b3565da50ef452643.tar.gz
hdf5-e350a69a55f2101d7e31dc8b3565da50ef452643.tar.bz2
[svn-r493] Fixed a bug when iterating through hyperslabs with greater than 2 dimensions.
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 0c9371e..9eef5ba 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -373,6 +373,10 @@ printf("%s: check 3.0, num_regions=%d\n",FUNC,(int)num_regions);
printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j);
#endif /* QAK */
+ /* If we are moving to a new position in this dim, reset the next lower dim. location */
+ if(fhyper_info->iter->hyp.pos[dim]!=j)
+ fhyper_info->iter->hyp.pos[dim+1]=(-1);
+
/* Set the correct position we are working on */
fhyper_info->iter->hyp.pos[dim]=j;
@@ -588,6 +592,10 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info)
/* Step through each location in each region */
for(j=regions[i].start; j<=regions[i].end && fhyper_info->nelmts>0; j++) {
+ /* If we are moving to a new position in this dim, reset the next lower dim. location */
+ if(fhyper_info->iter->hyp.pos[dim]!=j)
+ fhyper_info->iter->hyp.pos[dim+1]=(-1);
+
/* Set the correct position we are working on */
fhyper_info->iter->hyp.pos[dim]=j;
@@ -817,6 +825,10 @@ printf("%s: check 3.0, num_regions=%d\n",FUNC,(int)num_regions);
printf("%s: check 4.0, dim=%d, location=%d\n",FUNC,dim,j);
#endif /* QAK */
+ /* If we are moving to a new position in this dim, reset the next lower dim. location */
+ if(fhyper_info->iter->hyp.pos[dim]!=j)
+ fhyper_info->iter->hyp.pos[dim+1]=(-1);
+
/* Set the correct position we are working on */
fhyper_info->iter->hyp.pos[dim]=j;
@@ -1054,6 +1066,10 @@ printf("%s: check 3.0\n",FUNC);
/* Step through each location in each region */
for(j=regions[i].start; j<=regions[i].end && fhyper_info->nelmts>0; j++) {
+ /* If we are moving to a new position in this dim, reset the next lower dim. location */
+ if(fhyper_info->iter->hyp.pos[dim]!=j)
+ fhyper_info->iter->hyp.pos[dim+1]=(-1);
+
/* Set the correct position we are working on */
fhyper_info->iter->hyp.pos[dim]=j;