diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5T.c | 6 | ||||
-rw-r--r-- | src/H5Tprecis.c | 6 |
2 files changed, 6 insertions, 6 deletions
@@ -3614,9 +3614,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; 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: |