summaryrefslogtreecommitdiffstats
path: root/test/fheap.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-03-21 20:28:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-03-21 20:28:59 (GMT)
commit5c0ed1b304967c5df569cef8d0b884938e595f5b (patch)
tree0f7e5fc6b8c82ee322a2903892405137576b3a72 /test/fheap.c
parente0b060b4305d8db5ed33a96a1f38d376064a2700 (diff)
downloadhdf5-5c0ed1b304967c5df569cef8d0b884938e595f5b.zip
hdf5-5c0ed1b304967c5df569cef8d0b884938e595f5b.tar.gz
hdf5-5c0ed1b304967c5df569cef8d0b884938e595f5b.tar.bz2
[svn-r22113] Description:
Bring r22112 from trunk to 1.8 branch: Minor code safety issue in test/fheap.c and whitespace in other files. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug (Too minor to require h5committest)
Diffstat (limited to 'test/fheap.c')
-rw-r--r--test/fheap.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/fheap.c b/test/fheap.c
index a6992f1..9616991 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -415,13 +415,20 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off,
if(keep_ids) {
/* Check for needing to increase size of heap ID array */
if(keep_ids->num_ids + 1 > keep_ids->alloc_ids) {
+ unsigned char *tmp_ids;
+ size_t *tmp_lens;
+ size_t *tmp_offs;
+
keep_ids->alloc_ids = MAX(1024, (keep_ids->alloc_ids * 2));
- if(NULL == (keep_ids->ids = H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids)))
+ if(NULL == (tmp_ids = (unsigned char *)H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids)))
TEST_ERROR
- if(NULL == (keep_ids->lens = H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids)))
+ keep_ids->ids = tmp_ids;
+ if(NULL == (tmp_lens = (size_t *)H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids)))
TEST_ERROR
- if(NULL == (keep_ids->offs = H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids)))
+ keep_ids->lens = tmp_lens;
+ if(NULL == (tmp_offs = (size_t *)H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids)))
TEST_ERROR
+ keep_ids->offs = tmp_offs;
} /* end if */
/* Append the object info onto the array */