diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-04-22 13:20:21 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-04-22 13:20:21 (GMT) |
commit | 7f08e6b1d93e06640f4353df32b28b4982aee260 (patch) | |
tree | f91408dc8041eb353c7479f99d89d69f1f6b0adc /src/H5Ocache.c | |
parent | fd9ed5d743dd862cb0575464dfc4fa6dd5983d22 (diff) | |
download | hdf5-7f08e6b1d93e06640f4353df32b28b4982aee260.zip hdf5-7f08e6b1d93e06640f4353df32b28b4982aee260.tar.gz hdf5-7f08e6b1d93e06640f4353df32b28b4982aee260.tar.bz2 |
[svn-r18609] Description:
Bring r18608 from trunk to 1.8 branch:
Simplify object header allocation routines, and clean up some compiler
warnings.
Tested on:
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
(h5committested on trunk)
Diffstat (limited to 'src/H5Ocache.c')
-rw-r--r-- | src/H5Ocache.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 8fe3cf5..1e7ed9a 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -920,10 +920,10 @@ H5O_add_cont_msg(H5O_cont_msgs_t *cont_msg_info, const H5O_cont_t *cont) /* Increase chunk array size, if necessary */ if(cont_msg_info->nmsgs >= cont_msg_info->alloc_nmsgs) { - unsigned na = MAX(H5O_NCHUNKS, cont_msg_info->alloc_nmsgs * 2); /* Double # of messages allocated */ - H5O_cont_t *x = H5FL_SEQ_REALLOC(H5O_cont_t, cont_msg_info->msgs, (size_t)na); + size_t na = MAX(H5O_NCHUNKS, cont_msg_info->alloc_nmsgs * 2); /* Double # of messages allocated */ + H5O_cont_t *x; - if(!x) + if(NULL == (x = H5FL_SEQ_REALLOC(H5O_cont_t, cont_msg_info->msgs, na))) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "memory allocation failed") cont_msg_info->alloc_nmsgs = na; cont_msg_info->msgs = x; @@ -978,10 +978,10 @@ H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, /* Increase chunk array size, if necessary */ if(oh->nchunks >= oh->alloc_nchunks) { - unsigned na = MAX(H5O_NCHUNKS, oh->alloc_nchunks * 2); /* Double # of chunks allocated */ - H5O_chunk_t *x = H5FL_SEQ_REALLOC(H5O_chunk_t, oh->chunk, (size_t)na); + size_t na = MAX(H5O_NCHUNKS, oh->alloc_nchunks * 2); /* Double # of chunks allocated */ + H5O_chunk_t *x; - if(!x) + if(NULL == (x = H5FL_SEQ_REALLOC(H5O_chunk_t, oh->chunk, na))) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, FAIL, "memory allocation failed") oh->alloc_nchunks = na; oh->chunk = x; |