diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2000-09-19 21:08:15 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2000-09-19 21:08:15 (GMT) |
commit | 22867dca0e1123aef450b3feae34661cefb64a91 (patch) | |
tree | 879369bd3df77b6e8c7834f7a3d9980236116e8d /src/H5P.c | |
parent | 073ef8f453445bbe0cfa2569abdaed2a50721a95 (diff) | |
download | hdf5-22867dca0e1123aef450b3feae34661cefb64a91.zip hdf5-22867dca0e1123aef450b3feae34661cefb64a91.tar.gz hdf5-22867dca0e1123aef450b3feae34661cefb64a91.tar.bz2 |
[svn-r2579] Purpose:
Clean up small compiler warnings and add missing function prototypes.
Platforms tested:
FreeBSD 4.1
Diffstat (limited to 'src/H5P.c')
-rw-r--r-- | src/H5P.c | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -3212,9 +3212,10 @@ done: PURPOSE Internal routine to remove all properties from a property hash table USAGE - herr_t H5P_free_all_prop(hash, hashsize) + herr_t H5P_free_all_prop(hash, hashsize, make_cb) H5P_gen_prop_t *hash[]; IN/OUT: Pointer to array of properties for hash table uintn hashsize; IN: Size of hash table + uintn make_cb; IN: Whether to make property callbacks or not RETURNS Returns non-negative on success, negative on failure. DESCRIPTION @@ -3226,7 +3227,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P_free_all_prop(H5P_genprop_t *hash[], uintn hashsize) +H5P_free_all_prop(H5P_genprop_t *hash[], uintn hashsize, uintn make_cb) { H5P_genprop_t *tprop, *next;/* Temporary pointer to properties */ uintn u; /* Local index variable */ @@ -3245,7 +3246,7 @@ H5P_free_all_prop(H5P_genprop_t *hash[], uintn hashsize) next=tprop->next; /* Call the close callback and ignore the return value, there's nothing we can do about it */ - if(tprop->close!=NULL) + if(make_cb && tprop->close!=NULL) (tprop->close)(tprop->name,&(tprop->value)); /* Free the property, ignoring return value, nothing we can do */ @@ -3324,10 +3325,10 @@ H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) assert(pclass->name); H5MM_xfree(pclass->name); -/*!! Need to not make callbacks for these... */ + /* Free the class properties without making callbacks */ + H5P_free_all_prop(pclass->props,pclass->hashsize,0); - /* Make calls to any property close callbacks which exist */ -/* H5P_free_all_prop(plist->props,plist->pclass->hashsize); */ + H5MM_xfree(pclass); } /* end if */ #ifdef LATER @@ -3616,7 +3617,7 @@ done: if(ret_value==NULL) { if(plist!=NULL) { /* Close & free all the properties */ - H5P_free_all_prop(plist->props,class->hashsize); + H5P_free_all_prop(plist->props,class->hashsize,1); /* Decrement the number of property lists derived from the class */ class->plists--; @@ -4779,13 +4780,13 @@ herr_t H5P_close_list(H5P_genplist_t *plist) assert(plist); - /* Decrement parent class's dependant property list value! */ + /* Make calls to any property close callbacks which exist */ + H5P_free_all_prop(plist->props,plist->pclass->hashsize,1); + + /* Decrement class's dependant property list value! */ if(H5P_access_class(plist->pclass,H5P_MOD_DEC_LST)<0) HGOTO_ERROR (H5E_PLIST, H5E_CANTINIT, FAIL, "Can't decrement class ref count"); - /* Make calls to any property close callbacks which exist */ - H5P_free_all_prop(plist->props,plist->pclass->hashsize); - /* Destroy property list object */ H5MM_xfree(plist); |