diff options
Diffstat (limited to 'src/H5B2test.c')
-rw-r--r-- | src/H5B2test.c | 59 |
1 files changed, 7 insertions, 52 deletions
diff --git a/src/H5B2test.c b/src/H5B2test.c index 35771f2..8ed364e 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -25,7 +25,7 @@ /* Module Setup */ /****************/ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ +#include "H5B2module.h" /* This source code file is part of the H5B2 module */ #define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/ @@ -67,9 +67,7 @@ static herr_t H5B2__test_store(void *nrecord, const void *udata); static herr_t H5B2__test_compare(const void *rec1, const void *rec2); static herr_t H5B2__test_encode(uint8_t *raw, const void *nrecord, void *ctx); static herr_t H5B2__test_decode(const uint8_t *raw, void *nrecord, void *ctx); -static herr_t H5B2__test_debug(FILE *stream, const H5F_t *f, hid_t dxpl_id, - int indent, int fwidth, const void *record, const void *_udata); -static void *H5B2__test_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t addr); +static herr_t H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record); /*********************/ @@ -86,9 +84,7 @@ const H5B2_class_t H5B2_TEST[1]={{ /* B-tree class information */ H5B2__test_compare, /* Record comparison callback */ H5B2__test_encode, /* Record encoding callback */ H5B2__test_decode, /* Record decoding callback */ - H5B2__test_debug, /* Record debugging callback */ - H5B2__test_crt_dbg_context, /* Create debugging context */ - H5B2__test_dst_context /* Destroy debugging context */ + H5B2__test_debug /* Record debugging callback */ }}; @@ -124,7 +120,7 @@ H5B2__test_crt_context(void *_f) { H5F_t *f = (H5F_t *)_f; /* User data for building callback context */ H5B2_test_ctx_t *ctx; /* Callback context structure */ - void *ret_value; /* Return value */ + void *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -295,13 +291,11 @@ H5B2__test_decode(const uint8_t *raw, void *nrecord, void *_ctx) *------------------------------------------------------------------------- */ static herr_t -H5B2__test_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id, - int indent, int fwidth, const void *record, - const void H5_ATTR_UNUSED *_udata) +H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record) { FUNC_ENTER_STATIC_NOERR - HDassert (record); + HDassert(record); HDfprintf(stream, "%*s%-*s %Hu\n", indent, "", fwidth, "Record:", *(const hsize_t *)record); @@ -311,45 +305,6 @@ H5B2__test_debug(FILE *stream, const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUS /*------------------------------------------------------------------------- - * Function: H5B2__test_crt_dbg_context - * - * Purpose: Create context for debugging callback - * - * Return: Success: non-NULL - * Failure: NULL - * - * Programmer: Quincey Koziol - * Tuesday, December 1, 2009 - * - *------------------------------------------------------------------------- - */ -static void * -H5B2__test_crt_dbg_context(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t H5_ATTR_UNUSED addr) -{ - H5B2_test_ctx_t *ctx; /* Callback context structure */ - void *ret_value; /* Return value */ - - FUNC_ENTER_STATIC - - /* Sanity check */ - HDassert(f); - - /* Allocate callback context */ - if(NULL == (ctx = H5FL_MALLOC(H5B2_test_ctx_t))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, NULL, "can't allocate callback context") - - /* Determine the size of addresses & lengths in the file */ - ctx->sizeof_size = H5F_SIZEOF_SIZE(f); - - /* Set return value */ - ret_value = ctx; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2__test_crt_dbg_context() */ - - -/*------------------------------------------------------------------------- * Function: H5B2_get_root_addr_test * * Purpose: Retrieve the root node's address @@ -514,7 +469,7 @@ int H5B2_get_node_depth_test(H5B2_t *bt2, hid_t dxpl_id, void *udata) { H5B2_node_info_test_t ninfo; /* Node information */ - int ret_value; /* Return information */ + int ret_value = -1; /* Return information */ FUNC_ENTER_NOAPI(FAIL) |