summaryrefslogtreecommitdiffstats
path: root/test/tattr.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 /test/tattr.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 'test/tattr.c')
-rw-r--r--test/tattr.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/tattr.c b/test/tattr.c
index 2885124..57d19ff 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -97,7 +97,7 @@ int attr_data2[ATTR2_DIM1][ATTR2_DIM2]={{7614,-416},{197814,-3}}; /* Test data f
#define ATTR3_DIM1 2
#define ATTR3_DIM2 2
#define ATTR3_DIM3 2
-double attr_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{2.3,-26.1},{0.123,-10.0}},{{973.23,-0.91827},{2.0,23.0}}}; /* Test data for 3rd attribute */
+double attr_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{2.3F,-26.1F}, {0.123F,-10.0F}},{{973.23F,-0.91827F},{2.0F,23.0F}}}; /* Test data for 3rd attribute */
#define ATTR4_NAME "Attr4"
#define ATTR4_RANK 2
@@ -113,12 +113,12 @@ struct attr4_struct {
int i;
double d;
char c;
- } attr_data4[ATTR4_DIM1][ATTR4_DIM2]={{{3,-26.1,'d'},{-100000, 0.123,'3'}},
- {{-23,981724.2,'Q'},{0,2.0,'\n'}}}; /* Test data for 4th attribute */
+ } attr_data4[ATTR4_DIM1][ATTR4_DIM2]={{{3,-26.1F,'d'},{-100000, 0.123F,'3'}},
+ {{-23,981724.2F,'Q'},{0,2.0F,'\n'}}}; /* Test data for 4th attribute */
#define ATTR5_NAME "Attr5"
#define ATTR5_RANK 0
-float attr_data5=(float)-5.123; /* Test data for 5th attribute */
+float attr_data5=-5.123F; /* Test data for 5th attribute */
#define ATTR6_RANK 3
#define ATTR6_DIM1 100
@@ -500,7 +500,7 @@ test_attr_flush(hid_t fapl)
att, /* Attribute ID */
spc, /* Dataspace ID */
set; /* Dataset ID */
- double wdata=3.14159; /* Data to write */
+ double wdata=3.14159F; /* Data to write */
double rdata; /* Data read in */
herr_t ret; /* Generic return value */
@@ -522,8 +522,8 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if(!DBL_ABS_EQUAL(rdata,0.0))
- TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,0.0);
+ if(!DBL_ABS_EQUAL(rdata,0.0F))
+ TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,0.0F);
ret=H5Fflush(fil, H5F_SCOPE_GLOBAL);
CHECK(ret, FAIL, "H5Fflush");
@@ -531,8 +531,8 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if(!DBL_ABS_EQUAL(rdata,0.0))
- TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,0.0);
+ if(!DBL_ABS_EQUAL(rdata,0.0F))
+ TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,0.0F);
ret=H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata);
CHECK(ret, FAIL, "H5Awrite");
@@ -985,7 +985,7 @@ test_attr_scalar_read(hid_t fapl)
hid_t sid; /* Dataspace ID */
hid_t attr; /* Attribute ID */
H5S_class_t stype; /* Dataspace class */
- float rdata = 0.0; /* Buffer for reading 1st attribute */
+ float rdata = 0.0F; /* Buffer for reading 1st attribute */
H5O_info_t oinfo; /* Object info */
herr_t ret; /* Generic return value */