From df8830ed1a2750861bad8c81242fc62e2a17b53e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 29 Apr 2002 15:23:42 -0500 Subject: [svn-r5285] Purpose: Bug Fix Description: Selection offsets were not being used when iterating through regular and point selections with H5Diterate. Solution: Use the selection offset appropriately. Platforms tested: FreeBSD 4.5 (sleipnir) --- release_docs/RELEASE.txt | 3 +++ src/H5Shyper.c | 6 +++--- src/H5Spoint.c | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f8d85c7..e10f4f9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -70,6 +70,9 @@ New Features Bug Fixes since HDF5-1.4.3 Release ================================== + * Fixed bug where selection offsets were not being used when iterating + through point and hyperslab selections with + H5Diterate(). QAK - 2002/04/29 * Fixed bug where the data for several level deep nested compound & variable-length datatypes used for datasets were getting corrupted when written to the file. QAK - 2002/04/17 diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 2aaf529..a2eaf51 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -5286,12 +5286,12 @@ H5S_hyper_select_iterate_mem_opt(H5S_sel_iter_t UNUSED *iter, void *buf, hid_t t for(u=0; uselect.offset[u]); } /* end for */ /* Initialize the starting location */ for(loc=buf,u=0; uselect.offset[u]) +diminfo[u].stride*(diminfo[u].count-tmp_count[u]) +(diminfo[u].block-tmp_block[u]); loc+=temp_off*slab[u]; diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 0334914..d1955df 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -1319,6 +1319,7 @@ H5S_point_select_iterate(void *buf, hid_t type_id, H5S_t *space, H5D_operator_t void *tmp_buf; /* temporary location of the element in the buffer */ H5S_pnt_node_t *node; /* Point node */ unsigned rank; /* Dataspace rank */ + unsigned u; /* Local index variable */ herr_t ret_value=0; /* return value */ FUNC_ENTER (H5S_point_select_iterate, 0); @@ -1342,11 +1343,15 @@ H5S_point_select_iterate(void *buf, hid_t type_id, H5S_t *space, H5D_operator_t HDmemcpy(mem_offset, node->pnt, rank*sizeof(hssize_t)); mem_offset[rank]=0; + /* Add in the selection offset */ + for(u=0; uselect.offset[u]; + /* Get the offset in the memory buffer */ offset=H5V_array_offset(rank+1,mem_size,(const hssize_t *)mem_offset); tmp_buf=((char *)buf+offset); - ret_value=(*op)(tmp_buf,type_id,(hsize_t)rank,node->pnt,operator_data); + ret_value=(*op)(tmp_buf,type_id,(hsize_t)rank,mem_offset,operator_data); node=node->next; } /* end while */ -- cgit v0.12