summaryrefslogtreecommitdiffstats
path: root/test/hyperslab.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-11-27 16:29:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-11-27 16:29:13 (GMT)
commitd456c2bb82be98bc2b7c1039927eb52258d1a0eb (patch)
treea7d8a65aef5d962c89b0965c86eb535917c023ad /test/hyperslab.c
parent05264c88788f9bd9b04a58673ded246904210235 (diff)
downloadhdf5-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/hyperslab.c')
-rw-r--r--test/hyperslab.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/hyperslab.c b/test/hyperslab.c
index ea11436..2fd1de5 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -212,13 +212,13 @@ test_fill(size_t nx, size_t ny, size_t nz,
* original * fill values and add the new ones.
*/
ref_value = init_full(dst, nx, ny, nz);
- for (u=dst_offset[0];
+ for (u=(size_t)dst_offset[0];
u<dst_offset[0]+dx;
u++) {
- for (v = dst_offset[1];
+ for (v = (size_t)dst_offset[1];
v < dst_offset[1] + dy;
v++) {
- for (w = dst_offset[2];
+ for (w = (size_t)dst_offset[2];
w < dst_offset[2] + dz;
w++) {
ref_value -= dst[u*ny*nz+v*nz+w];