summaryrefslogtreecommitdiffstats
path: root/src/H5detect.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-03-01 18:48:54 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-03-01 18:48:54 (GMT)
commitd8e3d8e9082f0926e80e7e7010c00bda05a215b3 (patch)
treebf7717a29d0938ab15e6f54ef981e5abfcf467a5 /src/H5detect.c
parentac290b5e45412a0a93fde620490d703c773d27d4 (diff)
downloadhdf5-d8e3d8e9082f0926e80e7e7010c00bda05a215b3.zip
hdf5-d8e3d8e9082f0926e80e7e7010c00bda05a215b3.tar.gz
hdf5-d8e3d8e9082f0926e80e7e7010c00bda05a215b3.tar.bz2
[svn-r26333] Eliminates gcc warnings due to -Wunsuffixed-float-constants.
- Adds 'F' suffixes for most float constants. - A few constants MUST be of type double. These now receive the long double L suffix and are then cast to double. I do this via a new H5_DOUBLE() macro which was added to H5private.h. Fixes: HDFFV-9148 Tested on: h5committest
Diffstat (limited to 'src/H5detect.c')
-rw-r--r--src/H5detect.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/H5detect.c b/src/H5detect.c
index aed7514..b902af4 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -323,7 +323,7 @@ precision (detected_t *d)
* steps). This is necessary because padding bits can change arbitrarily \
* and interfere with detection of the various properties below unless we \
* know to ignore them. */ \
- _v1 = 4.0; \
+ _v1 = (TYPE)4.0L; \
HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \
for(_i = 0; _i < (int)sizeof(TYPE); _i++) \
for(_byte_mask = (unsigned char)1; _byte_mask; _byte_mask <<= 1) { \
@@ -335,10 +335,10 @@ precision (detected_t *d)
} /* end for */ \
\
/* Byte Order */ \
- for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \
+ for(_i = 0, _v1 = (TYPE)0.0L, _v2 = (TYPE)1.0L; _i < (int)sizeof(TYPE); _i++) { \
_v3 = _v1; \
_v1 += _v2; \
- _v2 /= 256.0; \
+ _v2 /= (TYPE)256.0L; \
HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \
HDmemcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \
_j = byte_cmp(sizeof(TYPE), _buf3, _buf1, _pad_mask); \
@@ -353,20 +353,20 @@ precision (detected_t *d)
INFO.is_vax = TRUE; \
\
/* Implicit mantissa bit */ \
- _v1 = 0.5; \
- _v2 = 1.0; \
+ _v1 = (TYPE)0.5L; \
+ _v2 = (TYPE)1.0L; \
INFO.imp = imp_bit (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \
\
/* Sign bit */ \
- _v1 = 1.0; \
- _v2 = -1.0; \
+ _v1 = (TYPE)1.0L; \
+ _v2 = (TYPE)-1.0L; \
INFO.sign = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \
\
/* Mantissa */ \
INFO.mpos = 0; \
\
- _v1 = 1.0; \
- _v2 = 1.5; \
+ _v1 = (TYPE)1.0L; \
+ _v2 = (TYPE)1.5L; \
INFO.msize = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \
INFO.msize += 1 + (INFO.imp?0:1) - INFO.mpos; \
\
@@ -375,7 +375,7 @@ precision (detected_t *d)
\
INFO.esize = INFO.sign - INFO.epos; \
\
- _v1 = 1.0; \
+ _v1 = (TYPE)1.0L; \
INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \
precision (&(INFO)); \
ALIGNMENT(TYPE, INFO); \
@@ -1381,8 +1381,8 @@ detect_C89_integers(void)
static void
detect_C89_floats(void)
{
- DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++;
- DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++;
+ DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++;
+ DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++;
}