diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-10 17:08:27 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-10 17:08:27 (GMT) |
commit | 9d27b9765ad7d5ec04762895752bc77b8ac1ec3d (patch) | |
tree | a0e442dbb7b27f963a9ba8240db1605ca6de6615 /src/H5HP.c | |
parent | 61c693615a1f4f90f7654f639170eed2f3c85262 (diff) | |
download | hdf5-9d27b9765ad7d5ec04762895752bc77b8ac1ec3d.zip hdf5-9d27b9765ad7d5ec04762895752bc77b8ac1ec3d.tar.gz hdf5-9d27b9765ad7d5ec04762895752bc77b8ac1ec3d.tar.bz2 |
[svn-r17313] Description:
Bring back various minor code cleanups from the file free space branch
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5HP.c')
-rw-r--r-- | src/H5HP.c | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -378,11 +378,11 @@ H5HP_create(H5HP_type_t heap_type) done: /* Error cleanup */ - if(ret_value==NULL) { - if(new_heap!=NULL) { - if(new_heap->heap!=NULL) - H5FL_SEQ_FREE(H5HP_ent_t,new_heap->heap); - (void)H5FL_FREE(H5HP_t,new_heap); + if(NULL ==ret_value) { + if(NULL != new_heap) { + if(NULL != new_heap->heap) + new_heap->heap = H5FL_SEQ_FREE(H5HP_ent_t, new_heap->heap); + new_heap = H5FL_FREE(H5HP_t, new_heap); } /* end if */ } /* end if */ @@ -772,20 +772,20 @@ H5HP_incr(H5HP_t *heap, unsigned amt, void *_obj) assert(heap->heap[0].obj==NULL); /* Get the location of the object in the heap */ - obj_loc=obj->heap_loc; - assert(obj_loc>0 && obj_loc<=heap->nobjs); + obj_loc = obj->heap_loc; + assert(obj_loc > 0 && obj_loc <= heap->nobjs); /* Change the heap object's priority */ - heap->heap[obj_loc].val+=amt; + heap->heap[obj_loc].val += (int)amt; /* Restore heap condition */ - if(heap->type==H5HP_MAX_HEAP) { - if(H5HP_swim_max(heap,obj_loc)<0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); + if(H5HP_MAX_HEAP == heap->type) { + if(H5HP_swim_max(heap, obj_loc) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition") } /* end if */ else { - if(H5HP_sink_min(heap,obj_loc)<0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition"); + if(H5HP_sink_min(heap, obj_loc) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRESTORE, FAIL, "unable to restore heap condition") } /* end else */ done: @@ -910,10 +910,10 @@ H5HP_close(H5HP_t *heap) HDassert(NULL == heap->heap[0].obj); /* Free internal structures for heap */ - H5FL_SEQ_FREE(H5HP_ent_t, heap->heap); + heap->heap = H5FL_SEQ_FREE(H5HP_ent_t, heap->heap); /* Free actual heap object */ - (void)H5FL_FREE(H5HP_t, heap); + heap = H5FL_FREE(H5HP_t, heap); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5HP_close() */ |