diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2004-04-17 17:16:15 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2004-04-17 17:16:15 (GMT) |
commit | 9c38fa3e320e7adcefa8c6a06a740b868e014e6b (patch) | |
tree | b90727ac64fd5101d82e723c38337af9def77989 /test | |
parent | 4ff7021a37dceb46e2797d97d10a5a1cff00b3cf (diff) | |
download | hdf5-9c38fa3e320e7adcefa8c6a06a740b868e014e6b.zip hdf5-9c38fa3e320e7adcefa8c6a06a740b868e014e6b.tar.gz hdf5-9c38fa3e320e7adcefa8c6a06a740b868e014e6b.tar.bz2 |
[svn-r8369] Purpose:
Bug fix.
Description:
Not all machines (like Sun and AIX) support fabsl() and fabsf() used
in test/dtypes.c. Changed the coding to use macro names HDfabsl and
HDfabsf. Also set the two macros to use ABS for now so that they will
work for all machines. (need more portable fixes which would involve
configure.)
Platforms tested:
h5committested. (also tested in LANL QSC and Theta).
Diffstat (limited to 'test')
-rw-r--r-- | test/dtypes.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index 95e82aa..e6afea8 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -4149,7 +4149,7 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) if (FLT_FLOAT==dst_type) { hw_f = (float)(*((double*)aligned)); hw = (unsigned char*)&hw_f; - underflow = fabs(*((double*)aligned)) < FLT_MIN; + underflow = HDfabs(*((double*)aligned)) < FLT_MIN; } else if (FLT_DOUBLE==dst_type) { hw_d = *((double*)aligned); hw = (unsigned char*)&hw_d; @@ -4166,11 +4166,11 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) if (FLT_FLOAT==dst_type) { hw_f = *((long double*)aligned); hw = (unsigned char*)&hw_f; - underflow = fabsl(*((long double*)aligned)) < FLT_MIN; + underflow = HDfabsl(*((long double*)aligned)) < FLT_MIN; } else if (FLT_DOUBLE==dst_type) { hw_d = *((long double*)aligned); hw = (unsigned char*)&hw_d; - underflow = fabsl(*((long double*)aligned)) < DBL_MIN; + underflow = HDfabsl(*((long double*)aligned)) < DBL_MIN; } else { hw_ld = *((long double*)aligned); hw = (unsigned char*)&hw_ld; @@ -4234,7 +4234,7 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) float x; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); if (underflow && - fabsf(x) <= FLT_MIN && fabsf(hw_f) <= FLT_MIN) + HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN) continue; /* all underflowed, no error */ check_mant[0] = HDfrexpf(x, check_expo+0); check_mant[1] = HDfrexpf(hw_f, check_expo+1); @@ -4242,7 +4242,7 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) double x; HDmemcpy(&x, &buf[j*dst_size], sizeof(double)); if (underflow && - fabs(x) <= DBL_MIN && fabs(hw_d) <= DBL_MIN) + HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN) continue; /* all underflowed, no error */ check_mant[0] = HDfrexp(x, check_expo+0); check_mant[1] = HDfrexp(hw_d, check_expo+1); |