summaryrefslogtreecommitdiffstats
path: root/test/tarray.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/tarray.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/tarray.c')
-rw-r--r--test/tarray.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/tarray.c b/test/tarray.c
index 1a53336..e3d7c37 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -541,7 +541,7 @@ test_array_compound_atomic(void)
for(i = 0; i < SPACE1_DIM1; i++)
for(j = 0; j < ARRAY1_DIM1; j++) {
wdata[i][j].i = i * 10 + j;
- wdata[i][j].f = (float)(i * 2.5 + j);
+ wdata[i][j].f = (float)(i * 2.5F + j);
} /* end for */
/* Create file */
@@ -745,7 +745,7 @@ test_array_compound_array(void)
for(j=0; j<ARRAY1_DIM1; j++) {
wdata[i][j].i=i*10+j;
for(k=0; k<ARRAY1_DIM1; k++)
- wdata[i][j].f[k]=(float)(i*10+j*2.5+k);
+ wdata[i][j].f[k]=(float)(i * 10.0F + j * 2.5F + k);
} /* end for */
/* Create file */
@@ -1534,8 +1534,8 @@ test_array_bkg(void)
for (j = 0; j < ALEN; j++)
{
cf[i].a[j] = 100*(i+1) + j;
- cf[i].b[j] = (float)(100.*(i+1) + 0.01*j);
- cf[i].c[j] = 100.*(i+1) + 0.02*j;
+ cf[i].b[j] = (float)(100.0F*(i+1) + 0.01F*j);
+ cf[i].c[j] = (double)(100.0F*(i+1) + 0.02F*j);
}
}
@@ -1674,7 +1674,7 @@ test_array_bkg(void)
/* -------------------------------- */
for (i=0; i< LENGTH; i++)
for (j = 0; j < ALEN; j++)
- cf[i].b[j]=fld[i].b[j] = (float)1.313;
+ cf[i].b[j]=fld[i].b[j] = 1.313F;
status = H5Dwrite (dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, fld);
CHECK(status, FAIL, "H5Dwrite");