diff options
Diffstat (limited to 'src/H5Spoint.c')
-rw-r--r-- | src/H5Spoint.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 583aab7..4d248b8 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -1149,6 +1149,7 @@ H5S_point_select_iterate(void *buf, hid_t type_id, H5S_t *space, H5D_operator_t void *operator_data) { hsize_t mem_size[H5O_LAYOUT_NDIMS]; /* Dataspace size */ + hsize_t mem_offset[H5O_LAYOUT_NDIMS]; /* Point offset */ hsize_t offset; /* offset of region in buffer */ void *tmp_buf; /* temporary location of the element in the buffer */ H5S_pnt_node_t *node; /* Point node */ @@ -1160,7 +1161,7 @@ H5S_point_select_iterate(void *buf, hid_t type_id, H5S_t *space, H5D_operator_t assert(buf); assert(space); assert(operator); - assert(H5I_DATATYPE != H5I_get_type(type_id)); + assert(H5I_DATATYPE == H5I_get_type(type_id)); /* Get the dataspace extent rank */ rank=space->extent.u.simple.rank; @@ -1172,8 +1173,12 @@ H5S_point_select_iterate(void *buf, hid_t type_id, H5S_t *space, H5D_operator_t /* Iterate through the node, checking the bounds on each element */ node=space->select.sel_info.pnt_lst->head; while(node!=NULL && ret_value==0) { + /* Set up the location of the point */ + HDmemcpy(mem_offset, node->pnt, rank*sizeof(hssize_t)); + mem_offset[rank]=0; + /* Get the offset in the memory buffer */ - offset=H5V_array_offset(rank+1,mem_size,node->pnt); + offset=H5V_array_offset(rank+1,mem_size,mem_offset); tmp_buf=((char *)buf+offset); ret_value=(*operator)(tmp_buf,type_id,rank,node->pnt,operator_data); |