diff options
Diffstat (limited to 'test/tattr.c')
-rw-r--r-- | test/tattr.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/tattr.c b/test/tattr.c index 2885124..31a3844 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,(double)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,(double)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 */ @@ -1016,7 +1016,7 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!FLT_ABS_EQUAL(rdata, attr_data5)) printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Aread", attr_data5, rdata, (int)__LINE__, __FILE__); + "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ sid = H5Aget_space(attr); |