summaryrefslogtreecommitdiffstats
path: root/test/trefer.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/trefer.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/trefer.c')
-rw-r--r--test/trefer.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/trefer.c b/test/trefer.c
index 340ef0c..4d852d9 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -211,8 +211,8 @@ test_reference_obj(void)
/* Check information in referenced dataset */
sid1 = H5Dget_space(dset2);
CHECK(sid1, FAIL, "H5Dget_space");
-
- ret=H5Sget_simple_extent_npoints(sid1);
+
+ ret=(int)H5Sget_simple_extent_npoints(sid1);
VERIFY(ret, 4, "H5Sget_simple_extent_npoints");
/* Read from disk */
@@ -359,7 +359,7 @@ test_reference_region(void)
ret = H5Sselect_hyperslab(sid2,H5S_SELECT_SET,start,stride,count,block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- ret = H5Sget_select_npoints(sid2);
+ ret = (int)H5Sget_select_npoints(sid2);
VERIFY(ret, 36, "H5Sget_select_npoints");
/* Store first dataset region */
@@ -380,7 +380,7 @@ test_reference_region(void)
ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
- ret = H5Sget_select_npoints(sid2);
+ ret = (int)H5Sget_select_npoints(sid2);
VERIFY(ret, 10, "H5Sget_select_npoints");
/* Store second dataset region */
@@ -431,7 +431,7 @@ test_reference_region(void)
sid1 = H5Dget_space(dset2);
CHECK(sid1, FAIL, "H5Dget_space");
- ret=H5Sget_simple_extent_npoints(sid1);
+ ret=(int)H5Sget_simple_extent_npoints(sid1);
VERIFY(ret, 100, "H5Sget_simple_extent_npoints");
/* Read from disk */
@@ -446,9 +446,9 @@ test_reference_region(void)
CHECK(sid2, FAIL, "H5Rget_region");
/* Verify correct hyperslab selected */
- ret = H5Sget_select_npoints(sid2);
+ ret = (int)H5Sget_select_npoints(sid2);
VERIFY(ret, 36, "H5Sget_select_npoints");
- ret = H5Sget_select_hyper_nblocks(sid2);
+ ret = (int)H5Sget_select_hyper_nblocks(sid2);
VERIFY(ret, 1, "H5Sget_select_hyper_nblocks");
coords=HDmalloc(ret*SPACE2_RANK*sizeof(hsize_t)*2); /* allocate space for the hyperslab blocks */
ret = H5Sget_select_hyper_blocklist(sid2,(hsize_t)0,(hsize_t)ret,coords);
@@ -474,9 +474,9 @@ test_reference_region(void)
CHECK(sid2, FAIL, "H5Rget_region");
/* Verify correct elements selected */
- ret = H5Sget_select_npoints(sid2);
+ ret = (int)H5Sget_select_npoints(sid2);
VERIFY(ret, 10, "H5Sget_select_npoints");
- ret = H5Sget_select_elem_npoints(sid2);
+ ret = (int)H5Sget_select_elem_npoints(sid2);
VERIFY(ret, 10, "H5Sget_select_elem_npoints");
coords=HDmalloc(ret*SPACE2_RANK*sizeof(hsize_t)); /* allocate space for the element points */
ret = H5Sget_select_elem_pointlist(sid2,(hsize_t)0,(hsize_t)ret,coords);