summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-07-16 20:28:44 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-07-16 20:28:44 (GMT)
commit43995f12ac694455b3ca42292eb8cea15c08817e (patch)
treeaec930ca82315c1dec81579aff20bc12c1db67db /src/H5A.c
parent0f43d84b3c7292bfb7d51218f02738028f818ff0 (diff)
downloadhdf5-43995f12ac694455b3ca42292eb8cea15c08817e.zip
hdf5-43995f12ac694455b3ca42292eb8cea15c08817e.tar.gz
hdf5-43995f12ac694455b3ca42292eb8cea15c08817e.tar.bz2
[svn-r22583] Description:
Bring r22582 from trunk to 1.8 branch: 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.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 221d190..a423fb6 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -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) {