summaryrefslogtreecommitdiffstats
path: root/src/H5Tprecis.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-01-20 17:32:06 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-01-20 17:32:06 (GMT)
commitdad89387a392c20d9cc0fc181792e479e7c908b7 (patch)
treea4f83c60c2abb8b5edc3e781b8a81b8ccda82e20 /src/H5Tprecis.c
parentfda3252166a55b0f6714796ae0d20187b8f0e3e2 (diff)
downloadhdf5-dad89387a392c20d9cc0fc181792e479e7c908b7.zip
hdf5-dad89387a392c20d9cc0fc181792e479e7c908b7.tar.gz
hdf5-dad89387a392c20d9cc0fc181792e479e7c908b7.tar.bz2
[svn-r9840] Purpose: Bug fix and new test
Description: The functions for user-define floating-point type, like H5Tset_fields, H5Tset_offset, H5Tset_precision, H5Tset_size, have some minor bugs. For error checking, the library didn't include offset value somehow. Solution: Corrected those bugs. Platforms tested: h5committest and fuss Misc. update:
Diffstat (limited to 'src/H5Tprecis.c')
-rw-r--r--src/H5Tprecis.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c
index b7a37d3..e151980 100644
--- a/src/H5Tprecis.c
+++ b/src/H5Tprecis.c
@@ -251,9 +251,9 @@ H5T_set_precision(const H5T_t *dt, size_t prec)
printf("mpos: %d ", dt->shared->u.atomic.u.f.mpos);
printf("msize: %d ", dt->shared->u.atomic.u.f.msize);
printf("prec: %d\n", prec); */
- 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;
default: