summaryrefslogtreecommitdiffstats
path: root/src/H5SMbtree2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5SMbtree2.c')
-rw-r--r--src/H5SMbtree2.c77
1 files changed, 32 insertions, 45 deletions
diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c
index 55ca131..446f721 100644
--- a/src/H5SMbtree2.c
+++ b/src/H5SMbtree2.c
@@ -15,60 +15,54 @@
/* Module Setup */
/****************/
-#define H5O_FRIEND /*suppress error about including H5Opkg */
-#include "H5SMmodule.h" /* This source code file is part of the H5SM module */
-
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#include "H5SMmodule.h" /* This source code file is part of the H5SM module */
/***********/
/* Headers */
/***********/
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5Opkg.h" /* Object Headers */
-#include "H5SMpkg.h" /* Shared object header messages */
-
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Opkg.h" /* Object Headers */
+#include "H5SMpkg.h" /* Shared object header messages */
/****************/
/* Local Macros */
/****************/
-
/******************/
/* Local Typedefs */
/******************/
-
/********************/
/* Local Prototypes */
/********************/
/* v2 B-tree callbacks */
-static void *H5SM__bt2_crt_context(void *udata);
+static void * H5SM__bt2_crt_context(void *udata);
static herr_t H5SM__bt2_dst_context(void *ctx);
static herr_t H5SM__bt2_store(void *native, const void *udata);
-static herr_t H5SM__bt2_debug(FILE *stream, int indent, int fwidth,
- const void *record, const void *_udata);
-
+static herr_t H5SM__bt2_debug(FILE *stream, int indent, int fwidth, const void *record, const void *_udata);
/*****************************/
/* Library Private Variables */
/*****************************/
/* v2 B-tree class for SOHM indexes*/
-const H5B2_class_t H5SM_INDEX[1]={{ /* B-tree class information */
- H5B2_SOHM_INDEX_ID, /* Type of B-tree */
- "H5B2_SOHM_INDEX_ID", /* Name of B-tree class */
- sizeof(H5SM_sohm_t), /* Size of native record */
- H5SM__bt2_crt_context, /* Create client callback context */
- H5SM__bt2_dst_context, /* Destroy client callback context */
- H5SM__bt2_store, /* Record storage callback */
- H5SM__message_compare, /* Record comparison callback */
- H5SM__message_encode, /* Record encoding callback */
- H5SM__message_decode, /* Record decoding callback */
- H5SM__bt2_debug /* Record debugging callback */
+const H5B2_class_t H5SM_INDEX[1] = {{
+ /* B-tree class information */
+ H5B2_SOHM_INDEX_ID, /* Type of B-tree */
+ "H5B2_SOHM_INDEX_ID", /* Name of B-tree class */
+ sizeof(H5SM_sohm_t), /* Size of native record */
+ H5SM__bt2_crt_context, /* Create client callback context */
+ H5SM__bt2_dst_context, /* Destroy client callback context */
+ H5SM__bt2_store, /* Record storage callback */
+ H5SM__message_compare, /* Record comparison callback */
+ H5SM__message_encode, /* Record encoding callback */
+ H5SM__message_decode, /* Record decoding callback */
+ H5SM__bt2_debug /* Record debugging callback */
}};
-
/*******************/
/* Local Variables */
/*******************/
@@ -76,8 +70,6 @@ const H5B2_class_t H5SM_INDEX[1]={{ /* B-tree class information */
/* Declare a free list to manage the H5SM_bt2_ctx_t struct */
H5FL_DEFINE_STATIC(H5SM_bt2_ctx_t);
-
-
/*-------------------------------------------------------------------------
* Function: H5SM__bt2_crt_context
*
@@ -94,9 +86,9 @@ H5FL_DEFINE_STATIC(H5SM_bt2_ctx_t);
static void *
H5SM__bt2_crt_context(void *_f)
{
- H5F_t *f = (H5F_t *)_f; /* User data for building callback context */
- H5SM_bt2_ctx_t *ctx; /* Callback context structure */
- void *ret_value = NULL; /* Return value */
+ H5F_t * f = (H5F_t *)_f; /* User data for building callback context */
+ H5SM_bt2_ctx_t *ctx; /* Callback context structure */
+ void * ret_value = NULL; /* Return value */
FUNC_ENTER_STATIC
@@ -104,7 +96,7 @@ H5SM__bt2_crt_context(void *_f)
HDassert(f);
/* Allocate callback context */
- if(NULL == (ctx = H5FL_MALLOC(H5SM_bt2_ctx_t)))
+ if (NULL == (ctx = H5FL_MALLOC(H5SM_bt2_ctx_t)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate callback context")
/* Determine the size of addresses & lengths in the file */
@@ -117,7 +109,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5SM__bt2_crt_context() */
-
/*-------------------------------------------------------------------------
* Function: H5SM__bt2_dst_context
*
@@ -134,7 +125,7 @@ done:
static herr_t
H5SM__bt2_dst_context(void *_ctx)
{
- H5SM_bt2_ctx_t *ctx = (H5SM_bt2_ctx_t *)_ctx; /* Callback context structure */
+ H5SM_bt2_ctx_t *ctx = (H5SM_bt2_ctx_t *)_ctx; /* Callback context structure */
FUNC_ENTER_STATIC_NOERR
@@ -147,7 +138,6 @@ H5SM__bt2_dst_context(void *_ctx)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5SM__bt2_dst_context() */
-
/*-------------------------------------------------------------------------
* Function: H5SM__bt2_store
*
@@ -176,7 +166,6 @@ H5SM__bt2_store(void *native, const void *udata)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5SM__bt2_store */
-
/*-------------------------------------------------------------------------
* Function: H5SM__bt2_debug
*
@@ -191,24 +180,22 @@ H5SM__bt2_store(void *native, const void *udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5SM__bt2_debug(FILE *stream, int indent, int fwidth,
- const void *record, const void H5_ATTR_UNUSED *_udata)
+H5SM__bt2_debug(FILE *stream, int indent, int fwidth, const void *record, const void H5_ATTR_UNUSED *_udata)
{
const H5SM_sohm_t *sohm = (const H5SM_sohm_t *)record;
FUNC_ENTER_STATIC_NOERR
- if(sohm->location == H5SM_IN_HEAP)
+ if (sohm->location == H5SM_IN_HEAP)
HDfprintf(stream, "%*s%-*s {%" PRIu64 ", %" PRIo32 ", %" PRIxHSIZE "}\n", indent, "", fwidth,
- "Shared Message in heap:",
- sohm->u.heap_loc.fheap_id.val, sohm->hash, sohm->u.heap_loc.ref_count);
+ "Shared Message in heap:", sohm->u.heap_loc.fheap_id.val, sohm->hash,
+ sohm->u.heap_loc.ref_count);
else {
HDassert(sohm->location == H5SM_IN_OH);
HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIo32 ", %x, %" PRIx32 "}\n", indent, "", fwidth,
- "Shared Message in OH:",
- sohm->u.mesg_loc.oh_addr, sohm->hash, sohm->msg_type_id, sohm->u.mesg_loc.index);
+ "Shared Message in OH:", sohm->u.mesg_loc.oh_addr, sohm->hash, sohm->msg_type_id,
+ sohm->u.mesg_loc.index);
} /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5SM__bt2_debug */
-