diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-07-16 19:54:26 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-07-16 19:54:26 (GMT) |
commit | 75f4e51a1a076ea2f1602619e2a7d7bcce13c2f1 (patch) | |
tree | b6e08ce3ecbd535ffe74269d7e44c905e19b137d /src/H5A.c | |
parent | 2e3ab09a520ff87ec709b5997273ce7f3b99d9ed (diff) | |
download | hdf5-75f4e51a1a076ea2f1602619e2a7d7bcce13c2f1.zip hdf5-75f4e51a1a076ea2f1602619e2a7d7bcce13c2f1.tar.gz hdf5-75f4e51a1a076ea2f1602619e2a7d7bcce13c2f1.tar.bz2 |
[svn-r22582] Description:
Refactor ID class registration to be more like how other "class"s in the
library are registered, and clean up compiler warnings.
Tested on:
Mac OSX/64 10.7.4 (amazon) w/debug
(Too minor to require h5comittest)
Diffstat (limited to 'src/H5A.c')
-rw-r--r-- | src/H5A.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -41,9 +41,6 @@ /* Local Macros */ /****************/ -/* The number of reserved IDs in dataset ID group */ -#define H5A_RESERVED_ATOMS 0 - /******************/ /* Local Typedefs */ @@ -94,6 +91,16 @@ H5FL_DEFINE(H5A_shared_t); /* Declare a free list to manage blocks of type conversion data */ H5FL_BLK_DEFINE(attr_buf); +/* Attribute ID class */ +static const H5I_class_t H5I_ATTR_CLS[1] = {{ + H5I_ATTR, /* ID class value */ + 0, /* Class flags */ + 64, /* Minimum hash size for class */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5A_close /* Callback routine for closing objects of this class */ +}}; + + /*------------------------------------------------------------------------- * Function: H5A_init @@ -143,7 +150,7 @@ H5A_init_interface(void) /* * Create attribute ID type. */ - if(H5I_register_type(H5I_ATTR, (size_t)H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, (H5I_free_t)H5A_close) < H5I_FILE) + if(H5I_register_type(H5I_ATTR_CLS) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to initialize interface") done: @@ -172,7 +179,7 @@ H5A_term_interface(void) { int n = 0; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { if((n = H5I_nmembers(H5I_ATTR))>0) { |