summaryrefslogtreecommitdiffstats
path: root/src/H5Tconv.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-06-16 19:38:26 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-06-16 19:38:26 (GMT)
commit53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea (patch)
tree76c6163d98ac715ddec1dfe4fa69f8f2753636a0 /src/H5Tconv.c
parenta639a5998c7bc5d9f00f95e0ee4157950b5e49eb (diff)
downloadhdf5-53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea.zip
hdf5-53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea.tar.gz
hdf5-53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea.tar.bz2
[svn-r428] Changes since 19980612
---------------------- ./src/H5Tbit.c ./MANIFEST ./test/Makefile.in ./test/bittests.c NEW Finished the bit vector operations and added test cases. ./src/H5Tconv.c ./test/dtypes.c Finished integer->integer general conversion and added test cases. Overflows and underflows are handled by substituting the closest possible value. Examples: (unsigned)0xffff -> (unsigned) 0xff ( signed)0xffff -> (unsigned)0x0000 (unsigned)0xffff -> ( signed)0x7fff ( signed)0x7fff -> ( signed) 0x7f ( signed)0xbfff -> ( signed) 0xbf ( signed)0x8000 -> ( signed) 0x80 ./src/H5private.h Added definitions for MIN and MAX that take 3 or 4 arguments: MIN3(), MIN4(), MAX3(), MAX4(). Also added MIN2() and MAX2() as aliases for MIN() and MAX(). ./test/tattr.c Removed some redundant `&' operators. ./configure.in ./src/H5config.h.in [regenerated] ./src/H5.c Fixed warnings on DEC where long double is the same as double.
Diffstat (limited to 'src/H5Tconv.c')
-rw-r--r--src/H5Tconv.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 1f2a2a5..f32c310 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -657,7 +657,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
*/
sfirst = H5T_bit_find (s, src->u.atomic.offset, src->u.atomic.prec,
H5T_BIT_MSB, TRUE);
- first = (size_t)first;
+ first = (size_t)sfirst;
if (sfirst<0) {
/*
@@ -759,7 +759,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
FALSE);
size_t fz = (size_t)sfz;
- if (sfz>=0 && fz+2>=dst->u.atomic.prec) {
+ if (sfz>=0 && fz+1>=dst->u.atomic.prec) {
/*underflow*/
H5T_bit_set (d, dst->u.atomic.offset, dst->u.atomic.prec-1,
FALSE);
@@ -784,7 +784,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
* case the destination is set to the largest possible
* positive value.
*/
- if (first+2>=dst->u.atomic.prec) {
+ if (first+1>=dst->u.atomic.prec) {
/*overflow*/
H5T_bit_set (d, dst->u.atomic.offset, dst->u.atomic.prec-1,
TRUE);
@@ -796,6 +796,10 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
src->u.atomic.prec);
H5T_bit_set (d, dst->u.atomic.offset+src->u.atomic.prec,
dst->u.atomic.prec-src->u.atomic.prec, FALSE);
+ } else {
+ H5T_bit_copy (d, dst->u.atomic.offset,
+ s, src->u.atomic.offset,
+ dst->u.atomic.prec);
}
}