diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-05-01 16:10:17 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-05-01 16:10:17 (GMT) |
commit | ecea60e95cd0ddd72ba975a79d5ca65805a44dd5 (patch) | |
tree | 2a8fdb9b8e8d210e67a095f0fd505ab912ff331a /src/H5Sall.c | |
parent | 4f0b880861c6d719ef30302ebc522abdaf84b292 (diff) | |
download | hdf5-ecea60e95cd0ddd72ba975a79d5ca65805a44dd5.zip hdf5-ecea60e95cd0ddd72ba975a79d5ca65805a44dd5.tar.gz hdf5-ecea60e95cd0ddd72ba975a79d5ca65805a44dd5.tar.bz2 |
[svn-r8457] Purpose:
Code optimization
Description:
Stop straddling the line and always use elements instead of bytes to
determine how how I/O to perform on a selection.
Platforms tested:
Solaris 2.7 (arabica)
FreeBSD 4.9 (sleipnir)
too minor to require h5committest
Diffstat (limited to 'src/H5Sall.c')
-rw-r--r-- | src/H5Sall.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/H5Sall.c b/src/H5Sall.c index 6ab8eaf..6f5152d 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -709,7 +709,7 @@ H5S_select_all (H5S_t *space, unsigned rel_prev) /* Check args */ assert(space); - + /* Remove current selection first */ if(rel_prev) if((*space->select.release)(space)<0) @@ -786,10 +786,10 @@ done: position of interest in selection. size_t elem_size; IN: Size of an element size_t maxseq; IN: Maximum number of sequences to generate - size_t maxbytes; IN: Maximum number of bytes to include in the + size_t maxelem; IN: Maximum number of elements to include in the generated sequences size_t *nseq; OUT: Actual number of sequences generated - size_t *nbytes; OUT: Actual number of bytes in sequences generated + size_t *nelem; OUT: Actual number of elements in sequences generated hsize_t *off; OUT: Array of offsets size_t *len; OUT: Array of lengths RETURNS @@ -807,10 +807,9 @@ done: --------------------------------------------------------------------------*/ herr_t H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_iter_t *iter, - size_t elem_size, size_t UNUSED maxseq, size_t maxbytes, size_t *nseq, size_t *nbytes, + size_t elem_size, size_t UNUSED maxseq, size_t maxelem, size_t *nseq, size_t *nelem, hsize_t *off, size_t *len) { - size_t max_elem; /* Maximum number of elements to use */ size_t elem_used; /* The number of elements used */ herr_t ret_value=SUCCEED; /* return value */ @@ -821,18 +820,15 @@ H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_i assert(iter); assert(elem_size>0); assert(maxseq>0); - assert(maxbytes>0); + assert(maxelem>0); assert(nseq); - assert(nbytes); + assert(nelem); assert(off); assert(len); - /* Detemine the maximum # of elements to use for this operation */ - max_elem=maxbytes/elem_size; - /* Determine the actual number of elements to use */ H5_CHECK_OVERFLOW(iter->elmt_left,hsize_t,size_t); - elem_used=MIN(max_elem,(size_t)iter->elmt_left); + elem_used=MIN(maxelem,(size_t)iter->elmt_left); /* Compute the offset in the dataset */ off[0]=iter->u.all.offset*elem_size; @@ -841,8 +837,8 @@ H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_i /* Should only need one sequence for 'all' selections */ *nseq=1; - /* Set the number of bytes used */ - *nbytes=len[0]; + /* Set the number of elements used */ + *nelem=elem_used; /* Update the iterator */ iter->elmt_left-=elem_used; |