summaryrefslogtreecommitdiffstats
path: root/src/H5P.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 /src/H5P.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 'src/H5P.c')
-rw-r--r--src/H5P.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5P.c b/src/H5P.c
index 9d03f27..71e14bc 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -1452,7 +1452,7 @@ herr_t
H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size)
{
int idx;
- size_t total, tmp;
+ hsize_t total, tmp;
H5O_efl_t efl;
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=FAIL; /* return value */
@@ -1484,8 +1484,8 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size)
tmp = total + efl.slot[idx].size;
if (tmp <= total)
HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "total external data size overflowed");
- }
- }
+ } /* end for */
+ } /* end if */
/* Add to the list */