diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-11-27 16:29:13 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-11-27 16:29:13 (GMT) |
commit | d456c2bb82be98bc2b7c1039927eb52258d1a0eb (patch) | |
tree | a7d8a65aef5d962c89b0965c86eb535917c023ad /test/tarray.c | |
parent | 05264c88788f9bd9b04a58673ded246904210235 (diff) | |
download | hdf5-d456c2bb82be98bc2b7c1039927eb52258d1a0eb.zip hdf5-d456c2bb82be98bc2b7c1039927eb52258d1a0eb.tar.gz hdf5-d456c2bb82be98bc2b7c1039927eb52258d1a0eb.tar.bz2 |
[svn-r4643] Purpose:
Code cleanup
Description:
Windows is generating hundreds of warnings from some of the practices in
the library. Mostly, they are because size_t is 32-bit and hsize_t is
64-bit on Windows and we were carelessly casting the larger values down to
the smaller ones without checking for overflow.
Also, some other small code cleanups,etc.
Solution:
Re-worked some algorithms to eliminate the casts and also added more
overflow checking for assignments and function parameters which needed
casts.
Kent did most of the work, I just went over his changes and fit them into
the the library code a bit better.
Platforms tested:
FreeBSD 4.4 (hawkwind)
Diffstat (limited to 'test/tarray.c')
-rw-r--r-- | test/tarray.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/tarray.c b/test/tarray.c index 4b0943c..6b5e556 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -507,7 +507,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=i*2.5+j; + wdata[i][j].f=(float)(i*2.5+j); } /* end for */ /* Create file */ @@ -724,7 +724,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]=i*10+j*2.5+k; + wdata[i][j].f[k]=(float)(i*10+j*2.5+k); } /* end for */ /* Create file */ @@ -1536,7 +1536,7 @@ test_array_bkg(void) for (j = 0; j < ALEN; j++) { cf[i].a[j] = 100*(i+1) + j; - cf[i].b[j] = 100.*(i+1) + 0.01*j; + cf[i].b[j] = (float)(100.*(i+1) + 0.01*j); cf[i].c[j] = 100.*(i+1) + 0.02*j; } } @@ -1679,7 +1679,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] = 1.313; + cf[i].b[j]=fld[i].b[j] = (float)1.313; status = H5Dwrite (dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, fld); CHECK(status, FAIL, "H5Dwrite"); |