diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2001-01-09 21:22:30 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2001-01-09 21:22:30 (GMT) |
commit | 35bc545296209684a5c46db0cde11beb9403a4dc (patch) | |
tree | 98b5a037ed928085b98abc1fee71fc62f81073c1 /src/H5R.c | |
parent | 1290c4808d3e9890c765b1445f66b823c9026734 (diff) | |
download | hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.zip hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.gz hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.bz2 |
[svn-r3252] Purpose:
Code cleanup.
Description:
Fixed _lots_ (I mean _tons_) of warnings spit out by the gcc with the
extra warnings. Including a few show-stoppers for compression on IRIX
machines.
Solution:
Changed lots of variables' types to more sensible and consistent types,
more range-checking, more variable typecasts, etc.
Platforms tested:
FreeBSD 4.2 (hawkwind), IRIX64-64 (modi4)
Diffstat (limited to 'src/H5R.c')
-rw-r--r-- | src/H5R.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -204,7 +204,8 @@ H5R_create(void *_ref, H5G_entry_t *loc, const char *name, H5R_type_t ref_type, buf_size+=sizeof(haddr_t); /* Allocate the space to store the serialized information */ - if (NULL==(buf = H5MM_malloc(buf_size))) { + assert(buf_size==(hssize_t)((size_t)buf_size)); /*check for overflow*/ + if (NULL==(buf = H5MM_malloc((size_t)buf_size))) { HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } @@ -220,7 +221,8 @@ H5R_create(void *_ref, H5G_entry_t *loc, const char *name, H5R_type_t ref_type, "Unable to serialize selection"); /* Save the serialized buffer for later */ - if(H5HG_insert(loc->file,buf_size,buf,&hobjid)<0) + assert(buf_size==(hssize_t)((size_t)buf_size)); /*check for overflow*/ + if(H5HG_insert(loc->file,(size_t)buf_size,buf,&hobjid)<0) HGOTO_ERROR(H5E_REFERENCE, H5E_WRITEERROR, FAIL, "Unable to serialize selection"); |