summaryrefslogtreecommitdiffstats
path: root/src/H5EAcache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-11-16 04:17:45 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-11-16 04:17:45 (GMT)
commit4fe33eda1c243a0e6410e57c151b93e1950cf192 (patch)
tree857b21defd5b7804fd8edd0e3429a57213b849cc /src/H5EAcache.c
parent6d5d4ed1d10498bf776b5a4d41cf2384b4d8fe28 (diff)
downloadhdf5-4fe33eda1c243a0e6410e57c151b93e1950cf192.zip
hdf5-4fe33eda1c243a0e6410e57c151b93e1950cf192.tar.gz
hdf5-4fe33eda1c243a0e6410e57c151b93e1950cf192.tar.bz2
[svn-r17895] Description:
Correct & simplify client callback context for extensible and fixed array data structures. 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/H5EAcache.c')
-rw-r--r--src/H5EAcache.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index 00d3089..5138ae4 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -198,11 +198,11 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{
*/
BEGIN_FUNC(STATIC, ERR,
H5EA_hdr_t *, NULL, NULL,
-H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
+H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1,
void *ctx_udata))
/* Local variables */
- const H5EA_class_t *cls = (const H5EA_class_t *)_cls; /* Extensible array class */
+ H5EA_cls_id_t id; /* ID of extensible array class, as found in file */
H5EA_hdr_t *hdr = NULL; /* Extensible array info */
size_t size; /* Header size */
H5WB_t *wb = NULL; /* Wrapped buffer for header data */
@@ -217,7 +217,7 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
HDassert(H5F_addr_defined(addr));
/* Allocate space for the extensible array data structure */
- if(NULL == (hdr = H5EA__hdr_alloc(f, cls, ctx_udata)))
+ if(NULL == (hdr = H5EA__hdr_alloc(f)))
H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
/* Set the extensible array header's address */
@@ -250,9 +250,11 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
if(*p++ != H5EA_HDR_VERSION)
H5E_THROW(H5E_VERSION, "wrong extensible array header version")
- /* Extensible array type */
- if(*p++ != (uint8_t)cls->id)
+ /* Extensible array class */
+ id = *p++;
+ if(id >= H5EA_NUM_CLS_ID)
H5E_THROW(H5E_BADTYPE, "incorrect extensible array class")
+ hdr->cparam.cls = H5EA_client_class_g[id];
/* General array creation/configuration information */
hdr->cparam.raw_elmt_size = *p++; /* Element size in file (in bytes) */
@@ -314,7 +316,7 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for extensible array header")
/* 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")
HDassert(hdr->size == size);