summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-10-18 19:05:51 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-10-18 19:05:51 (GMT)
commitd73cd8e77877f066a8dbc1501903200cfff4014d (patch)
tree5d3d906a2d067161614b4ce441e8093de6f816fe /src
parentbf0266f2f6bc74667477c351f0a13e2e6688cbb7 (diff)
downloadhdf5-d73cd8e77877f066a8dbc1501903200cfff4014d.zip
hdf5-d73cd8e77877f066a8dbc1501903200cfff4014d.tar.gz
hdf5-d73cd8e77877f066a8dbc1501903200cfff4014d.tar.bz2
[svn-r7667] Purpose:
Optimize code Description: Eliminate some computations from inner loop, giving about a 5% speedup. Platforms tested: FreeBSD 4.9 (sleipnir) too minor to h5committest
Diffstat (limited to 'src')
-rw-r--r--src/H5Tconv.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 733f9ed..e9fbf90 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -295,13 +295,12 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
/* The main part of every integer hardware conversion macro */
#define H5T_CONV(GUTS,ATYPE,STYPE,DTYPE,ST,DT,D_MIN,D_MAX,STRT) { \
hsize_t elmtno; /*element number */ \
- void *src, *s; /*source buffer */ \
- void *dst, *d; /*destination buffer */ \
+ uint8_t *src, *s; /*source buffer */ \
+ uint8_t *dst, *d; /*destination buffer */ \
H5T_t *st, *dt; /*data type descriptors */ \
ATYPE aligned; /*aligned type */ \
hbool_t s_mv, d_mv; /*move data to align it? */ \
size_t s_stride, d_stride; /*src and dst strides */ \
- int direction; /*1=left-to-right, -1=rt-to-lt */ \
\
switch (cdata->command) { \
case H5T_CONV_INIT: \
@@ -333,10 +332,10 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
if (STRT) { \
src = (uint8_t*)buf+(STRT)*s_stride; \
dst = (uint8_t*)buf+(STRT)*d_stride; \
- direction = -1; \
+ s_stride = -s_stride; \
+ d_stride = -d_stride; \
} else { \
src = dst = buf; \
- direction = 1; \
} \
\
/* Is alignment required for source or dest? */ \
@@ -428,8 +427,8 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
H5_GLUE(H5T_CONV_LOOP_,POST_DALIGN_GUTS)(DT) \
\
/* Advance pointers */ \
- src = (char *)src + direction * s_stride; \
- dst = (char *)dst + direction * d_stride; \
+ src += s_stride; \
+ dst += d_stride; \
}