summaryrefslogtreecommitdiffstats
path: root/src/H5EAhdr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-11-16 20:45:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-11-16 20:45:05 (GMT)
commitd2b87ec47ebdb096c331c7b62a195b9cea2f33ae (patch)
treea066f01361afaf5df457cef612bb0bb9fd80fe18 /src/H5EAhdr.c
parentee5a1e07350f0dcf3ef07d9443aa2f4c073392f4 (diff)
downloadhdf5-d2b87ec47ebdb096c331c7b62a195b9cea2f33ae.zip
hdf5-d2b87ec47ebdb096c331c7b62a195b9cea2f33ae.tar.gz
hdf5-d2b87ec47ebdb096c331c7b62a195b9cea2f33ae.tar.bz2
[svn-r17896] Description:
Bring r17546:17895 from trunk to revise_chunks branch. Changes to fixed and extensible array dataset chunk indexing code to accommodate changes to private APIs in those interfaces. Also, other adjustments to source code and expected output in response to changes on the trunk. 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 (jam) w/PGI compilers, w/default API=1.8.x, 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 debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5EAhdr.c')
-rw-r--r--src/H5EAhdr.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index c8dd34d..4280767 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -118,14 +118,13 @@ H5FL_SEQ_DEFINE_STATIC(H5EA_sblk_info_t);
*/
BEGIN_FUNC(PKG, ERR,
H5EA_hdr_t *, NULL, NULL,
-H5EA__hdr_alloc(H5F_t *f, const H5EA_class_t *cls, void *udata))
+H5EA__hdr_alloc(H5F_t *f))
/* Local variables */
H5EA_hdr_t *hdr = NULL; /* Shared extensible array header */
/* Check arguments */
HDassert(f);
- HDassert(cls);
/* Allocate space for the shared information */
if(NULL == (hdr = H5FL_CALLOC(H5EA_hdr_t)))
@@ -140,13 +139,6 @@ H5EA__hdr_alloc(H5F_t *f, const H5EA_class_t *cls, void *udata))
hdr->sizeof_addr = H5F_SIZEOF_ADDR(f);
hdr->sizeof_size = H5F_SIZEOF_SIZE(f);
- /* Set the class of the array */
- hdr->cparam.cls = cls;
-
- /* Create the callback context */
- if(NULL == (hdr->cb_ctx = (*cls->crt_context)(udata)))
- H5E_THROW(H5E_CANTCREATE, "unable to create extensible array client callback context")
-
/* Set the return value */
ret_value = hdr;
@@ -196,7 +188,7 @@ END_FUNC(PKG) /* end H5EA__hdr_alloc() */
*/
BEGIN_FUNC(PKG, ERR,
herr_t, SUCCEED, FAIL,
-H5EA__hdr_init(H5EA_hdr_t *hdr))
+H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata))
/* Local variables */
hsize_t start_idx; /* First element index for each super block */
@@ -241,6 +233,12 @@ HDfprintf(stderr, "%s: hdr->sblk_info[%Zu] = {%Zu, %Zu, %Hu, %Hu}\n", FUNC, u, h
/* Set size of header on disk (locally and in statistics) */
hdr->stats.computed.hdr_size = hdr->size = H5EA_HEADER_SIZE(hdr);
+ /* Create the callback context, if there's one */
+ if(hdr->cparam.cls->crt_context) {
+ if(NULL == (hdr->cb_ctx = (*hdr->cparam.cls->crt_context)(ctx_udata)))
+ H5E_THROW(H5E_CANTCREATE, "unable to create extensible array client callback context")
+ } /* end if */
+
CATCH
END_FUNC(PKG) /* end H5EA__hdr_init() */
@@ -420,7 +418,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
#endif /* NDEBUG */
/* Allocate space for the shared information */
- if(NULL == (hdr = H5EA__hdr_alloc(f, cparam->cls, ctx_udata)))
+ if(NULL == (hdr = H5EA__hdr_alloc(f)))
H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
/* Set the internal parameters for the array */
@@ -430,7 +428,7 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
HDmemcpy(&hdr->cparam, cparam, sizeof(hdr->cparam));
/* Finish initializing extensible array header */
- if(H5EA__hdr_init(hdr) < 0)
+ if(H5EA__hdr_init(hdr, ctx_udata) < 0)
H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header")
/* Allocate space for the header on disk */
@@ -695,8 +693,10 @@ H5EA__hdr_dest(H5EA_hdr_t *hdr))
HDassert(hdr->rc == 0);
/* Destroy the callback context */
- if((*hdr->cparam.cls->dst_context)(hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTRELEASE, "unable to destroy extensible array client callback context")
+ if(hdr->cb_ctx) {
+ if((*hdr->cparam.cls->dst_context)(hdr->cb_ctx) < 0)
+ H5E_THROW(H5E_CANTRELEASE, "unable to destroy extensible array client callback context")
+ } /* end if */
hdr->cb_ctx = NULL;
/* Check for data block element buffer factory info to free */