summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-01-21 20:52:21 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-01-21 20:52:21 (GMT)
commitcfb095ae9ce9d59eb5fbf407d60b5308fef67ba5 (patch)
treea4aa26b05cddfba9ce2b3baba9ae27fee3381341 /src/H5T.c
parent2cd3b4c609eb07baaa0f795983fd2ac85a7d9579 (diff)
downloadhdf5-cfb095ae9ce9d59eb5fbf407d60b5308fef67ba5.zip
hdf5-cfb095ae9ce9d59eb5fbf407d60b5308fef67ba5.tar.gz
hdf5-cfb095ae9ce9d59eb5fbf407d60b5308fef67ba5.tar.bz2
[svn-r9856] Purpose: New test and minor bug fix
Description: Fixed a bug related to user-define functions for derived floating-point data type, like H5Tset_fields, H5Tset_offset, H5Tset_precision, H5Tset_size. Added test for these functions and test for data type conversion between derived floating-point types. Platforms tested: h5committest and fuss
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5T.c b/src/H5T.c
index e87a34b..58fc616 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -3412,9 +3412,9 @@ H5T_set_size(H5T_t *dt, size_t size)
* The sign, mantissa, and exponent fields should be adjusted
* first when decreasing the size of a floating point type.
*/
- if (dt->shared->u.atomic.u.f.sign >= prec ||
- dt->shared->u.atomic.u.f.epos + dt->shared->u.atomic.u.f.esize > prec ||
- dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec) {
+ if (dt->shared->u.atomic.u.f.sign >= prec+offset ||
+ dt->shared->u.atomic.u.f.epos + dt->shared->u.atomic.u.f.esize > prec+offset ||
+ dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec+offset) {
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first");
}
break;