summaryrefslogtreecommitdiffstats
path: root/src/H5Shyper.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-05-13 23:26:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-05-13 23:26:10 (GMT)
commit6a806870e9938bf0651a7513c109489687b016bb (patch)
treeae62a7792ac7b1e851af807bfee6013e613cec1d /src/H5Shyper.c
parenta9d354fd9592b44f250eb42efe450e26b7fd0d17 (diff)
downloadhdf5-6a806870e9938bf0651a7513c109489687b016bb.zip
hdf5-6a806870e9938bf0651a7513c109489687b016bb.tar.gz
hdf5-6a806870e9938bf0651a7513c109489687b016bb.tar.bz2
[svn-r8520] Purpose:
Code optimization Description: Don't make a separate allocation for the selection offset - incorporate it into the selection structure as a fixed size array. Platforms tested: Solaris 2.7 (arabica) FreeBSD 4.9 (sleipnir) w/parallel
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r--src/H5Shyper.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 7094134..acc78c9 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -4030,20 +4030,17 @@ H5S_hyper_normalize_offset(H5S_t *space)
/* Check for 'all' selection, instead of a hyperslab selection */
/* (Technically, this check shouldn't be in the "hyperslab" routines...) */
if(space->select.type!=H5S_SEL_ALL) {
- /* Check if there is an offset currently */
- if(space->select.offset) {
- /* Invert the selection offset */
- for(u=0; u<space->extent.u.simple.rank; u++)
- space->select.offset[u] =- space->select.offset[u];
-
- /* Call the existing 'adjust' routine */
- if(H5S_hyper_adjust(space, space->select.offset)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization");
-
- /* Zero out the selection offset */
- for(u=0; u<space->extent.u.simple.rank; u++)
- space->select.offset[u] = 0;
- } /* end if */
+ /* Invert the selection offset */
+ for(u=0; u<space->extent.u.simple.rank; u++)
+ space->select.offset[u] =- space->select.offset[u];
+
+ /* Call the existing 'adjust' routine */
+ if(H5S_hyper_adjust(space, space->select.offset)<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization");
+
+ /* Zero out the selection offset */
+ for(u=0; u<space->extent.u.simple.rank; u++)
+ space->select.offset[u] = 0;
} /* end if */
done:
@@ -6796,7 +6793,7 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter,
hsize_t loc_off; /* Element offset in the dataspace */
hsize_t last_span_end=0; /* The offset of the end of the last span */
hssize_t *abs_arr; /* Absolute hyperslab span position */
- hssize_t *off_arr; /* Offset within the dataspace extent */
+ const hssize_t *off_arr; /* Offset within the dataspace extent */
size_t span_size=0; /* Number of bytes in current span to actually process */
size_t io_left; /* Number of elements left to process */
size_t io_bytes_left; /* Number of bytes left to process */
@@ -7224,7 +7221,7 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space,H5S_sel_iter_t *iter,
{
hsize_t *mem_size; /* Size of the source buffer */
hsize_t slab[H5O_LAYOUT_NDIMS]; /* Hyperslab size */
- hssize_t *sel_off; /* Selection offset in dataspace */
+ const hssize_t *sel_off; /* Selection offset in dataspace */
hssize_t offset[H5O_LAYOUT_NDIMS]; /* Coordinate offset in dataspace */
hsize_t tmp_count[H5O_LAYOUT_NDIMS];/* Temporary block count */
hsize_t tmp_block[H5O_LAYOUT_NDIMS];/* Temporary block offset */