summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-07-16 19:54:26 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-07-16 19:54:26 (GMT)
commit75f4e51a1a076ea2f1602619e2a7d7bcce13c2f1 (patch)
treeb6e08ce3ecbd535ffe74269d7e44c905e19b137d /src/H5S.c
parent2e3ab09a520ff87ec709b5997273ce7f3b99d9ed (diff)
downloadhdf5-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/H5S.c')
-rw-r--r--src/H5S.c49
1 files changed, 44 insertions, 5 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 5d99066..7ef1da4 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -13,12 +13,19 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/****************/
+/* Module Setup */
+/****************/
+
#define H5S_PACKAGE /*suppress error about including H5Spkg */
/* Interface initialization */
#define H5_INTERFACE_INIT_FUNC H5S_init_interface
+/***********/
+/* Headers */
+/***********/
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
@@ -28,26 +35,48 @@
#include "H5Oprivate.h" /* Object headers */
#include "H5Spkg.h" /* Dataspaces */
-/* Local macro definitions */
-/* Number of reserved IDs in ID group */
-#define H5S_RESERVED_ATOMS 2
+/****************/
+/* Local Macros */
+/****************/
/* Version of datatype encoding */
#define H5S_ENCODE_VERSION 0
-/* Local static function prototypes */
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+
+/********************/
+/* Local Prototypes */
+/********************/
static herr_t H5S_set_extent_simple (H5S_t *space, unsigned rank,
const hsize_t *dims, const hsize_t *max);
static htri_t H5S_is_simple(const H5S_t *sdim);
static herr_t H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc);
static H5S_t *H5S_decode(const unsigned char *buf);
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
#ifdef H5_HAVE_PARALLEL
/* Global vars whose value can be set from environment variable also */
hbool_t H5S_mpi_opt_types_g = TRUE;
#endif /* H5_HAVE_PARALLEL */
+
+/*******************/
+/* Local Variables */
+/*******************/
+
/* Declare a free list to manage the H5S_extent_t struct */
H5FL_DEFINE(H5S_extent_t);
@@ -57,6 +86,16 @@ H5FL_DEFINE(H5S_t);
/* Declare a free list to manage the array's of hsize_t's */
H5FL_ARR_DEFINE(hsize_t,H5S_MAX_RANK);
+/* Dataspace ID class */
+static const H5I_class_t H5I_DATASPACE_CLS[1] = {{
+ H5I_DATASPACE, /* ID class value */
+ 0, /* Class flags */
+ 64, /* Minimum hash size for class */
+ 2, /* # of reserved IDs for class */
+ (H5I_free_t)H5S_close /* Callback routine for closing objects of this class */
+}};
+
+
/*--------------------------------------------------------------------------
NAME
@@ -78,7 +117,7 @@ H5S_init_interface(void)
FUNC_ENTER_NOAPI_NOINIT
/* Initialize the atom group for the file IDs */
- if(H5I_register_type(H5I_DATASPACE, (size_t)H5I_DATASPACEID_HASHSIZE, H5S_RESERVED_ATOMS, (H5I_free_t)H5S_close) < 0)
+ if(H5I_register_type(H5I_DATASPACE_CLS) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize interface")
#ifdef H5_HAVE_PARALLEL