mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-19 16:50:46 +08:00
[svn-r17838] Description:
Further refactoring of v2 B-tree code, moving toward being able to pass a context information to a client's encode/decode callbacks. Also, clean up of other minor compiler warnings and code formatting issues. 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.1 (amazon) in debug mode Mac OS X/32 10.6.1 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
This commit is contained in:
parent
5793231260
commit
30a52dd1a2
12
src/H5.c
12
src/H5.c
@ -348,7 +348,7 @@ H5dont_atexit(void)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API_NOINIT_NOFS(H5dont_atexit)
|
||||
FUNC_ENTER_API_NOINIT_NOERR_NOFS(H5dont_atexit)
|
||||
H5TRACE0("e","");
|
||||
|
||||
if(H5_dont_atexit_g)
|
||||
@ -622,10 +622,10 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
|
||||
char substr[] = H5_VERS_SUBRELEASE;
|
||||
static int checked = 0; /* If we've already checked the version info */
|
||||
static unsigned int disable_version_check = 0; /* Set if the version check should be disabled */
|
||||
herr_t ret_value=SUCCEED; /* Return value */
|
||||
static char *version_mismatch_warning=VERSION_MISMATCH_WARNING;
|
||||
static const char *version_mismatch_warning = VERSION_MISMATCH_WARNING;
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_API_NOINIT_NOFS(H5check_version)
|
||||
FUNC_ENTER_API_NOINIT_NOERR_NOFS(H5check_version)
|
||||
H5TRACE3("e", "IuIuIu", majnum, minnum, relnum);
|
||||
|
||||
/* Don't check again, if we already have */
|
||||
@ -692,7 +692,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum)
|
||||
*/
|
||||
sprintf(lib_str, "HDF5 library version: %d.%d.%d",
|
||||
H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
|
||||
if (*substr){
|
||||
if(*substr) {
|
||||
HDstrcat(lib_str, "-");
|
||||
HDstrncat(lib_str, substr, (sizeof(lib_str) - HDstrlen(lib_str)) - 1);
|
||||
} /* end if */
|
||||
@ -769,7 +769,7 @@ H5close(void)
|
||||
* whole library just to release it all right away. It is safe to call
|
||||
* this function for an uninitialized library.
|
||||
*/
|
||||
FUNC_ENTER_API_NOINIT_NOFS(H5close)
|
||||
FUNC_ENTER_API_NOINIT_NOERR_NOFS(H5close)
|
||||
H5TRACE0("e","");
|
||||
|
||||
H5_term_library();
|
||||
|
@ -90,7 +90,6 @@ static herr_t H5A_dense_btree2_corder_debug(FILE *stream, const H5F_t *f, hid_t
|
||||
|
||||
/* v2 B-tree driver callbacks for 'name' index */
|
||||
static herr_t H5A_dense_btree2_name_store(void *native, const void *udata);
|
||||
static herr_t H5A_dense_btree2_name_retrieve(void *udata, const void *native);
|
||||
static herr_t H5A_dense_btree2_name_compare(const void *rec1, const void *rec2);
|
||||
static herr_t H5A_dense_btree2_name_encode(const H5F_t *f, uint8_t *raw,
|
||||
const void *native);
|
||||
|
@ -1286,7 +1286,7 @@ H5B_iterate(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
|
||||
{
|
||||
herr_t ret_value; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(H5B_iterate, FAIL)
|
||||
FUNC_ENTER_NOAPI_NOERR(H5B_iterate, -)
|
||||
|
||||
/*
|
||||
* Check arguments.
|
||||
|
1181
src/H5B2.c
1181
src/H5B2.c
File diff suppressed because it is too large
Load Diff
@ -221,7 +221,7 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
|
||||
/*
|
||||
* Load the B-tree internal node
|
||||
*/
|
||||
if(NULL == (internal = H5B2_protect_internal(f, dxpl_id, hdr, addr, nrec, depth, H5AC_READ)))
|
||||
if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, addr, nrec, depth, H5AC_READ)))
|
||||
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node")
|
||||
|
||||
/* Print opening message */
|
||||
|
@ -188,7 +188,7 @@ HDmemset(hdr->page, 0, hdr->node_size);
|
||||
/* Initialize internal node info */
|
||||
if(depth > 0) {
|
||||
for(u = 1; u < (depth + 1); u++) {
|
||||
sz_max_nrec = H5B2_NUM_INT_REC(f, hdr, u);
|
||||
sz_max_nrec = H5B2_NUM_INT_REC(hdr, u);
|
||||
H5_ASSIGN_OVERFLOW(/* To: */ hdr->node_info[u].max_nrec, /* From: */ sz_max_nrec, /* From: */ size_t, /* To: */ unsigned)
|
||||
HDassert(hdr->node_info[u].max_nrec <= hdr->node_info[u - 1].max_nrec);
|
||||
|
||||
@ -248,6 +248,8 @@ H5B2_hdr_alloc(H5F_t *f)
|
||||
|
||||
/* Assign non-zero information */
|
||||
hdr->f = f;
|
||||
hdr->sizeof_addr = H5F_SIZEOF_ADDR(f);
|
||||
hdr->sizeof_size = H5F_SIZEOF_SIZE(f);
|
||||
hdr->root.addr = HADDR_UNDEF;
|
||||
|
||||
/* Set return value */
|
||||
@ -579,7 +581,7 @@ H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id)
|
||||
|
||||
/* Delete all nodes in B-tree */
|
||||
if(H5F_addr_defined(hdr->root.addr))
|
||||
if(H5B2_delete_node(hdr->f, dxpl_id, hdr, hdr->depth, &hdr->root, hdr->remove_op, hdr->remove_op_data) < 0)
|
||||
if(H5B2_delete_node(hdr, dxpl_id, hdr->depth, &hdr->root, hdr->remove_op, hdr->remove_op_data) < 0)
|
||||
HGOTO_ERROR(H5E_BTREE, H5E_CANTDELETE, FAIL, "unable to delete B-tree nodes")
|
||||
|
||||
/* Indicate that the heap header should be deleted & file space freed */
|
||||
|
389
src/H5B2int.c
389
src/H5B2int.c
File diff suppressed because it is too large
Load Diff
@ -48,10 +48,10 @@
|
||||
#define H5B2_TREE_POINTER_SIZE(f) (H5F_SIZEOF_ADDR(f)+H5B2_SIZEOF_RECORDS_PER_NODE+H5F_SIZEOF_SIZE(f))
|
||||
|
||||
/* Size of a internal node pointer (on disk) */
|
||||
#define H5B2_INT_POINTER_SIZE(f, s, d) ( \
|
||||
H5F_SIZEOF_ADDR(f) /* Address of child node */ \
|
||||
+ (s)->max_nrec_size /* # of records in child node */ \
|
||||
+ (s)->node_info[(d) - 1].cum_max_nrec_size /* Total # of records in child & below */ \
|
||||
#define H5B2_INT_POINTER_SIZE(h, d) ( \
|
||||
(h)->sizeof_addr /* Address of child node */ \
|
||||
+ (h)->max_nrec_size /* # of records in child node */ \
|
||||
+ (h)->node_info[(d) - 1].cum_max_nrec_size /* Total # of records in child & below */ \
|
||||
)
|
||||
|
||||
/* Size of checksum information (on disk) */
|
||||
@ -108,8 +108,8 @@
|
||||
|
||||
/* Number of records that fit into internal node */
|
||||
/* (accounts for extra node pointer by counting it in with the prefix bytes) */
|
||||
#define H5B2_NUM_INT_REC(f, s, d) \
|
||||
(((s)->node_size - (H5B2_INT_PREFIX_SIZE + H5B2_INT_POINTER_SIZE(f, s, d))) / ((s)->rrec_size + H5B2_INT_POINTER_SIZE(f, s, d)))
|
||||
#define H5B2_NUM_INT_REC(h, d) \
|
||||
(((h)->node_size - (H5B2_INT_PREFIX_SIZE + H5B2_INT_POINTER_SIZE(h, d))) / ((h)->rrec_size + H5B2_INT_POINTER_SIZE(h, d)))
|
||||
|
||||
|
||||
/****************************/
|
||||
@ -160,6 +160,8 @@ typedef struct H5B2_hdr_t {
|
||||
size_t rc; /* Reference count of nodes using this header */
|
||||
size_t file_rc; /* Reference count of files using this header */
|
||||
hbool_t pending_delete; /* B-tree is pending deletion */
|
||||
size_t sizeof_size; /* Size of file sizes */
|
||||
size_t sizeof_addr; /* Size of file addresses */
|
||||
H5B2_remove_t remove_op; /* Callback operator for deleting B-tree */
|
||||
void *remove_op_data;/* B-tree deletion callback's context */
|
||||
const H5B2_class_t *cls; /* Class of B-tree client */
|
||||
@ -258,58 +260,56 @@ H5_DLL herr_t H5B2_hdr_free(H5B2_hdr_t *hdr);
|
||||
H5_DLL herr_t H5B2_hdr_delete(H5B2_hdr_t *hdr, hid_t dxpl_id);
|
||||
|
||||
/* Routines for operating on internal nodes */
|
||||
H5_DLL H5B2_internal_t *H5B2_protect_internal(H5F_t *f, hid_t dxpl_id,
|
||||
H5B2_hdr_t *hdr, haddr_t addr, unsigned nrec, unsigned depth, H5AC_protect_t rw);
|
||||
H5_DLL H5B2_internal_t *H5B2_protect_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
haddr_t addr, unsigned nrec, unsigned depth, H5AC_protect_t rw);
|
||||
|
||||
/* Routines for allocating nodes */
|
||||
H5_DLL herr_t H5B2_split_root(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr);
|
||||
H5_DLL herr_t H5B2_create_leaf(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_split_root(H5B2_hdr_t *hdr, hid_t dxpl_id);
|
||||
H5_DLL herr_t H5B2_create_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
H5B2_node_ptr_t *node_ptr);
|
||||
|
||||
/* Routines for inserting records */
|
||||
H5_DLL herr_t H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_insert_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
unsigned depth, unsigned *parent_cache_info_flags_ptr,
|
||||
H5B2_node_ptr_t *curr_node_ptr, void *udata);
|
||||
H5_DLL herr_t H5B2_insert_leaf(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
H5B2_node_ptr_t *curr_node_ptr, void *udata);
|
||||
|
||||
/* Routines for iterating over nodes/records */
|
||||
H5_DLL herr_t H5B2_iterate_node(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
unsigned depth, const H5B2_node_ptr_t *curr_node, H5B2_operator_t op,
|
||||
void *op_data);
|
||||
H5_DLL herr_t H5B2_iterate_size_node(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_iterate_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
|
||||
const H5B2_node_ptr_t *curr_node, H5B2_operator_t op, void *op_data);
|
||||
H5_DLL herr_t H5B2_iterate_size_node(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
unsigned depth, const H5B2_node_ptr_t *curr_node, hsize_t *op_data);
|
||||
|
||||
/* Routines for locating records */
|
||||
H5_DLL int H5B2_locate_record(const H5B2_class_t *type, unsigned nrec,
|
||||
size_t *rec_off, const uint8_t *native, const void *udata, unsigned *idx);
|
||||
H5_DLL herr_t H5B2_neighbor_internal(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_neighbor_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
unsigned depth, H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc,
|
||||
H5B2_compare_t comp, void *udata, H5B2_found_t op, void *op_data);
|
||||
H5_DLL herr_t H5B2_neighbor_leaf(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_neighbor_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
H5B2_node_ptr_t *curr_node_ptr, void *neighbor_loc,
|
||||
H5B2_compare_t comp, void *udata, H5B2_found_t op, void *op_data);
|
||||
|
||||
/* Routines for removing records */
|
||||
H5_DLL herr_t H5B2_remove_internal(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_remove_internal(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
hbool_t *depth_decreased, void *swap_loc, unsigned depth, H5AC_info_t *parent_cache_info,
|
||||
hbool_t * parent_cache_info_dirtied_ptr, H5B2_node_ptr_t *curr_node_ptr, void *udata,
|
||||
H5B2_remove_t op, void *op_data);
|
||||
H5_DLL herr_t H5B2_remove_leaf(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
H5B2_node_ptr_t *curr_node_ptr, void *udata, H5B2_remove_t op,
|
||||
void *op_data);
|
||||
H5_DLL herr_t H5B2_remove_internal_by_idx(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_remove_internal_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
hbool_t *depth_decreased, void *swap_loc, unsigned depth, H5AC_info_t *parent_cache_info,
|
||||
hbool_t * parent_cache_info_dirtied_ptr, H5B2_node_ptr_t *curr_node_ptr, hsize_t idx,
|
||||
H5B2_remove_t op, void *op_data);
|
||||
H5_DLL herr_t H5B2_remove_leaf_by_idx(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
H5_DLL herr_t H5B2_remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id,
|
||||
H5B2_node_ptr_t *curr_node_ptr, unsigned idx, H5B2_remove_t op,
|
||||
void *op_data);
|
||||
|
||||
/* Routines for deleting nodes */
|
||||
H5_DLL herr_t H5B2_delete_node(H5F_t *f, hid_t dxpl_id, H5B2_hdr_t *hdr,
|
||||
unsigned depth, const H5B2_node_ptr_t *curr_node, H5B2_remove_t op,
|
||||
void *op_data);
|
||||
H5_DLL herr_t H5B2_delete_node(H5B2_hdr_t *hdr, hid_t dxpl_id, unsigned depth,
|
||||
const H5B2_node_ptr_t *curr_node, H5B2_remove_t op, void *op_data);
|
||||
|
||||
/* Metadata cache callbacks */
|
||||
H5_DLL herr_t H5B2_cache_hdr_dest(H5F_t *f, H5B2_hdr_t *b);
|
||||
|
@ -321,7 +321,7 @@ H5B2_get_node_info_test(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *cls,
|
||||
H5B2_node_ptr_t next_node_ptr; /* Node pointer info for next node */
|
||||
|
||||
/* Lock B-tree current node */
|
||||
if(NULL == (internal = H5B2_protect_internal(f, dxpl_id, hdr, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ)))
|
||||
if(NULL == (internal = H5B2_protect_internal(hdr, dxpl_id, curr_node_ptr.addr, curr_node_ptr.node_nrec, depth, H5AC_READ)))
|
||||
HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to load B-tree internal node")
|
||||
|
||||
/* Locate node pointer for child */
|
||||
|
@ -1040,7 +1040,7 @@ H5D_btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id,
|
||||
H5D_chunk_rec_t chunk_rec; /* Generic chunk record for callback */
|
||||
int ret_value; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_iterate_cb)
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR(H5D_btree_idx_iterate_cb)
|
||||
|
||||
/* Sanity check for memcpy() */
|
||||
HDcompile_assert(offsetof(H5D_chunk_rec_t, nbytes) == offsetof(H5D_btree_key_t, nbytes));
|
||||
@ -1082,7 +1082,7 @@ H5D_btree_idx_iterate(const H5D_chk_idx_info_t *idx_info,
|
||||
H5D_btree_it_ud_t udata; /* User data for B-tree iterator callback */
|
||||
int ret_value; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT(H5D_btree_idx_iterate)
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOERR(H5D_btree_idx_iterate)
|
||||
|
||||
HDassert(idx_info);
|
||||
HDassert(idx_info->f);
|
||||
|
@ -401,7 +401,7 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
|
||||
if((exists = H5O_msg_exists_oh(oh, H5O_EFL_ID)) < 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for EFL message")
|
||||
|
||||
if(exists && H5D_efl_is_space_alloc(&layout)) {
|
||||
if(exists && H5D_efl_is_space_alloc(&layout.storage)) {
|
||||
H5O_efl_t efl; /* External File List message */
|
||||
|
||||
/* Start with clean EFL info */
|
||||
|
@ -609,7 +609,7 @@ H5G_link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip,
|
||||
size_t u; /* Local index variable */
|
||||
herr_t ret_value = H5_ITER_CONT; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(H5G_link_iterate_table, FAIL)
|
||||
FUNC_ENTER_NOAPI_NOERR(H5G_link_iterate_table, -)
|
||||
|
||||
/* Sanity check */
|
||||
HDassert(ltable);
|
||||
|
@ -93,7 +93,10 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
|
||||
fprintf (stream, "%*s%-*s %u/%lu/", indent, "", fwidth,
|
||||
"Objects defined/allocated/max:",
|
||||
nused, (unsigned long)h->nalloc);
|
||||
fprintf (stream, nused ? "%u\n": "NA\n", maxobj);
|
||||
if(nused)
|
||||
fprintf(stream, "%u\n", maxobj);
|
||||
else
|
||||
fprintf(stream, "NA\n");
|
||||
|
||||
fprintf (stream, "%*s%-*s %lu\n", indent, "", fwidth,
|
||||
"Free space:",
|
||||
|
@ -284,7 +284,7 @@ H5WB_unwrap(H5WB_t *wb)
|
||||
} /* end if */
|
||||
|
||||
/* Release the buffer wrapper info */
|
||||
H5FL_FREE(H5WB_t, wb);
|
||||
wb = H5FL_FREE(H5WB_t, wb);
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* end H5WB_unwrap() */
|
||||
|
@ -823,7 +823,7 @@ done:\n\
|
||||
if(dt != NULL) {\n\
|
||||
if(dt->shared != NULL)\n\
|
||||
H5FL_FREE(H5T_shared_t, dt->shared);\n\
|
||||
H5FL_FREE(H5T_t, dt);\n\
|
||||
dt = H5FL_FREE(H5T_t, dt);\n\
|
||||
} /* end if */\n\
|
||||
} /* end if */\n\
|
||||
\n\
|
||||
|
137
src/H5private.h
137
src/H5private.h
@ -1748,10 +1748,14 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
#define FUNC_ENTER_COMMON_NOFUNC(func_name,asrt)
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#define FUNC_ENTER_COMMON(func_name,asrt) \
|
||||
static const char FUNC[]=#func_name; \
|
||||
#define FUNC_ENTER_COMMON(func_name, asrt) \
|
||||
static const char FUNC[] = #func_name; \
|
||||
hbool_t err_occurred = FALSE; \
|
||||
FUNC_ENTER_COMMON_NOFUNC(func_name,asrt);
|
||||
FUNC_ENTER_COMMON_NOFUNC(func_name, asrt);
|
||||
|
||||
#define FUNC_ENTER_COMMON_NOERR(func_name, asrt) \
|
||||
static const char FUNC[] = #func_name; \
|
||||
FUNC_ENTER_COMMON_NOFUNC(func_name, asrt);
|
||||
|
||||
/* Threadsafety initialization code for API routines */
|
||||
#define FUNC_ENTER_API_THREADSAFE \
|
||||
@ -1762,22 +1766,37 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
H5_API_UNSET_CANCEL \
|
||||
H5_API_LOCK
|
||||
|
||||
/* Threadsafety termination code for API routines */
|
||||
#define FUNC_LEAVE_API_THREADSAFE \
|
||||
H5_API_UNLOCK \
|
||||
H5_API_SET_CANCEL
|
||||
|
||||
/* Local variables for API routines */
|
||||
#define FUNC_ENTER_API_VARS(func_name) \
|
||||
MPE_LOG_VARS(func_name) \
|
||||
H5TRACE_DECL
|
||||
|
||||
#define FUNC_ENTER_API_COMMON(func_name) \
|
||||
FUNC_ENTER_API_VARS(func_name) \
|
||||
FUNC_ENTER_COMMON(func_name, H5_IS_API(#func_name)); \
|
||||
FUNC_ENTER_API_THREADSAFE;
|
||||
|
||||
#define FUNC_ENTER_API_INIT(func_name,err) \
|
||||
/* Initialize the library */ \
|
||||
if(!(H5_INIT_GLOBAL)) { \
|
||||
H5_INIT_GLOBAL = TRUE; \
|
||||
if(H5_init_library() < 0) \
|
||||
HGOTO_ERROR(H5E_FUNC, H5E_CANTINIT, err, \
|
||||
"library initialization failed") \
|
||||
} \
|
||||
\
|
||||
/* Initialize the interface, if appropriate */ \
|
||||
H5_INTERFACE_INIT(err) \
|
||||
\
|
||||
/* Push the name of this function on the function stack */ \
|
||||
H5_PUSH_FUNC(#func_name) \
|
||||
\
|
||||
BEGIN_MPE_LOG(func_name)
|
||||
|
||||
/* Use this macro for all "normal" API functions */
|
||||
#define FUNC_ENTER_API(func_name,err) {{ \
|
||||
FUNC_ENTER_API_VARS(func_name) \
|
||||
FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \
|
||||
FUNC_ENTER_API_THREADSAFE; \
|
||||
FUNC_ENTER_API_COMMON(func_name,err); \
|
||||
FUNC_ENTER_API_COMMON(func_name) \
|
||||
FUNC_ENTER_API_INIT(func_name,err); \
|
||||
/* Clear thread error stack entering public functions */ \
|
||||
H5E_clear_stack(NULL); \
|
||||
{
|
||||
@ -1787,10 +1806,8 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
* like H5Eprint and H5Ewalk.
|
||||
*/
|
||||
#define FUNC_ENTER_API_NOCLEAR(func_name,err) {{ \
|
||||
FUNC_ENTER_API_VARS(func_name) \
|
||||
FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \
|
||||
FUNC_ENTER_API_THREADSAFE; \
|
||||
FUNC_ENTER_API_COMMON(func_name,err); \
|
||||
FUNC_ENTER_API_COMMON(func_name) \
|
||||
FUNC_ENTER_API_INIT(func_name,err); \
|
||||
{
|
||||
|
||||
/*
|
||||
@ -1800,9 +1817,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
*
|
||||
*/
|
||||
#define FUNC_ENTER_API_NOINIT(func_name) {{ \
|
||||
FUNC_ENTER_API_VARS(func_name) \
|
||||
FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \
|
||||
FUNC_ENTER_API_THREADSAFE; \
|
||||
FUNC_ENTER_API_COMMON(func_name) \
|
||||
H5_PUSH_FUNC(#func_name) \
|
||||
BEGIN_MPE_LOG(func_name); \
|
||||
{
|
||||
@ -1814,16 +1829,30 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
* are: H5close, H5check_version, etc.
|
||||
*
|
||||
*/
|
||||
#define FUNC_ENTER_API_NOINIT_NOFS(func_name) {{ \
|
||||
#define FUNC_ENTER_API_NOINIT_NOERR_NOFS(func_name) {{ \
|
||||
FUNC_ENTER_API_VARS(func_name) \
|
||||
FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \
|
||||
FUNC_ENTER_API_THREADSAFE; \
|
||||
FUNC_ENTER_COMMON_NOERR(func_name, H5_IS_API(#func_name)); \
|
||||
FUNC_ENTER_API_THREADSAFE; \
|
||||
BEGIN_MPE_LOG(func_name); \
|
||||
{
|
||||
|
||||
/* Note: this macro only works when there's _no_ interface initialization routine for the module */
|
||||
#define FUNC_ENTER_NOAPI_INIT(func_name,err) \
|
||||
/* Initialize the interface, if appropriate */ \
|
||||
H5_INTERFACE_INIT(err) \
|
||||
\
|
||||
/* Push the name of this function on the function stack */ \
|
||||
H5_PUSH_FUNC(#func_name)
|
||||
|
||||
/* Use this macro for all "normal" non-API functions */
|
||||
#define FUNC_ENTER_NOAPI(func_name,err) { \
|
||||
FUNC_ENTER_COMMON(func_name,!H5_IS_API(#func_name)); \
|
||||
FUNC_ENTER_COMMON(func_name, !H5_IS_API(#func_name)); \
|
||||
FUNC_ENTER_NOAPI_INIT(func_name,err) \
|
||||
{
|
||||
|
||||
/* Use this macro for all non-API functions, which propagate errors, but don't issue them */
|
||||
#define FUNC_ENTER_NOAPI_NOERR(func_name,err) { \
|
||||
FUNC_ENTER_COMMON_NOERR(func_name, !H5_IS_API(#func_name)); \
|
||||
FUNC_ENTER_NOAPI_INIT(func_name,err) \
|
||||
{
|
||||
|
||||
@ -1841,8 +1870,22 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
* - functions which are called during library shutdown, since we don't
|
||||
* want to re-initialize the library.
|
||||
*/
|
||||
#define FUNC_ENTER_NOAPI_NOINIT(func_name) { \
|
||||
FUNC_ENTER_COMMON(func_name,!H5_IS_API(#func_name)); \
|
||||
#define FUNC_ENTER_NOAPI_NOINIT(func_name) { \
|
||||
FUNC_ENTER_COMMON(func_name, !H5_IS_API(#func_name)); \
|
||||
H5_PUSH_FUNC(#func_name) \
|
||||
{
|
||||
|
||||
/*
|
||||
* Use this macro for non-API functions which fall into these categories:
|
||||
* - static functions, since they must be called from a function in the
|
||||
* interface, the library and interface must already be
|
||||
* initialized.
|
||||
* - functions which are called during library shutdown, since we don't
|
||||
* want to re-initialize the library.
|
||||
* - functions that propagate, but don't issue errors
|
||||
*/
|
||||
#define FUNC_ENTER_NOAPI_NOINIT_NOERR(func_name) { \
|
||||
FUNC_ENTER_COMMON_NOERR(func_name, !H5_IS_API(#func_name)); \
|
||||
H5_PUSH_FUNC(#func_name) \
|
||||
{
|
||||
|
||||
@ -1876,31 +1919,6 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \
|
||||
{
|
||||
|
||||
#define FUNC_ENTER_API_COMMON(func_name,err) \
|
||||
/* Initialize the library */ \
|
||||
if (!(H5_INIT_GLOBAL)) { \
|
||||
H5_INIT_GLOBAL = TRUE; \
|
||||
if (H5_init_library()<0) \
|
||||
HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
|
||||
"library initialization failed") \
|
||||
} \
|
||||
\
|
||||
/* Initialize the interface, if appropriate */ \
|
||||
H5_INTERFACE_INIT(err) \
|
||||
\
|
||||
/* Push the name of this function on the function stack */ \
|
||||
H5_PUSH_FUNC(#func_name) \
|
||||
\
|
||||
BEGIN_MPE_LOG(func_name)
|
||||
|
||||
/* Note: this macro only works when there's _no_ interface initialization routine for the module */
|
||||
#define FUNC_ENTER_NOAPI_INIT(func_name,err) \
|
||||
/* Initialize the interface, if appropriate */ \
|
||||
H5_INTERFACE_INIT(err) \
|
||||
\
|
||||
/* Push the name of this function on the function stack */ \
|
||||
H5_PUSH_FUNC(#func_name)
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Purpose: Register function exit for code profiling. This should be
|
||||
* the last statement executed by a function.
|
||||
@ -1917,6 +1935,11 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/* Threadsafety termination code for API routines */
|
||||
#define FUNC_LEAVE_API_THREADSAFE \
|
||||
H5_API_UNLOCK \
|
||||
H5_API_SET_CANCEL
|
||||
|
||||
#define FUNC_LEAVE_API(ret_value) \
|
||||
FINISH_MPE_LOG; \
|
||||
H5TRACE_RETURN(ret_value); \
|
||||
@ -1924,28 +1947,26 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
if(err_occurred) \
|
||||
(void)H5E_dump_api_stack(TRUE); \
|
||||
FUNC_LEAVE_API_THREADSAFE \
|
||||
return (ret_value); \
|
||||
return(ret_value); \
|
||||
} /*end scope from end of FUNC_ENTER*/ \
|
||||
}} /*end scope from beginning of FUNC_ENTER*/
|
||||
|
||||
#define FUNC_LEAVE_API_NOFS(ret_value) \
|
||||
FINISH_MPE_LOG; \
|
||||
H5TRACE_RETURN(ret_value); \
|
||||
if(err_occurred) \
|
||||
(void)H5E_dump_api_stack(TRUE); \
|
||||
FUNC_LEAVE_API_THREADSAFE \
|
||||
return (ret_value); \
|
||||
return(ret_value); \
|
||||
} /*end scope from end of FUNC_ENTER*/ \
|
||||
}} /*end scope from beginning of FUNC_ENTER*/
|
||||
|
||||
#define FUNC_LEAVE_NOAPI(ret_value) \
|
||||
H5_POP_FUNC \
|
||||
return (ret_value); \
|
||||
H5_POP_FUNC \
|
||||
return(ret_value); \
|
||||
} /*end scope from end of FUNC_ENTER*/ \
|
||||
} /*end scope from beginning of FUNC_ENTER*/
|
||||
|
||||
#define FUNC_LEAVE_NOAPI_VOID \
|
||||
H5_POP_FUNC \
|
||||
H5_POP_FUNC \
|
||||
return; \
|
||||
} /*end scope from end of FUNC_ENTER*/ \
|
||||
} /*end scope from beginning of FUNC_ENTER*/
|
||||
@ -1956,7 +1977,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
|
||||
* (so far, just the H5CS routines themselves)
|
||||
*/
|
||||
#define FUNC_LEAVE_NOAPI_NOFS(ret_value) \
|
||||
return (ret_value); \
|
||||
return(ret_value); \
|
||||
} /*end scope from end of FUNC_ENTER*/ \
|
||||
} /*end scope from beginning of FUNC_ENTER*/
|
||||
|
||||
|
@ -1454,7 +1454,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
|
||||
/* This may generate recursive call to the library... -QAK */
|
||||
if(NULL != (pclass = (H5P_genclass_t *)H5I_object(pclass_id)) &&
|
||||
(class_name = H5P_get_class_name(pclass))!=NULL) {
|
||||
fprintf (out, class_name);
|
||||
fprintf(out, "%s", class_name);
|
||||
H5MM_xfree(class_name);
|
||||
} /* end if */
|
||||
else {
|
||||
|
@ -85,8 +85,8 @@ Abrt_Handler (int UNUSED sig)
|
||||
int i, n;
|
||||
|
||||
for (i=0; i<T_NUMCLASSES; i++) {
|
||||
fprintf (stderr, "%s ID reference count: %n", IDNAME[i], &n);
|
||||
fprintf (stderr, "%*d\n", (n < ERR_WIDTH) ? (ERR_WIDTH - n) : 0, rc[i]);
|
||||
fprintf(stderr, "%s ID reference count: %n", IDNAME[i], &n);
|
||||
fprintf(stderr, "%*d\n", (n < ERR_WIDTH) ? (ERR_WIDTH - n) : 0, rc[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -779,13 +779,12 @@ void dump_string(const char * string)
|
||||
unsigned int length;
|
||||
unsigned int x;
|
||||
|
||||
printf("The string was:\n");
|
||||
printf(string);
|
||||
printf("The string was:\n %s", string);
|
||||
printf("Or in hex:\n");
|
||||
|
||||
length = strlen(string);
|
||||
|
||||
for(x=0; x<length; x++)
|
||||
for(x=0; x<length; x++)
|
||||
printf("%x ", string[x] & (0x000000FF));
|
||||
|
||||
printf("\n");
|
||||
|
@ -174,7 +174,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
case ERR: /* command syntax error */
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
usage(argv[0]);
|
||||
goto err;
|
||||
}
|
||||
@ -182,7 +182,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (FALSE == outfile_named)
|
||||
{
|
||||
(void) fprintf(stderr, err3);
|
||||
(void) fprintf(stderr, "%s", err3);
|
||||
usage(argv[0]);
|
||||
goto err;
|
||||
}
|
||||
@ -192,7 +192,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
return(EXIT_SUCCESS);
|
||||
err:
|
||||
(void) fprintf(stderr, err4);
|
||||
(void) fprintf(stderr, "%s", err4);
|
||||
return(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@ -397,7 +397,7 @@ processDataFile(char *infile, struct Input *in, FILE **strm, hid_t file_id)
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err10);
|
||||
(void) fprintf(stderr, "%s", err10);
|
||||
return(-1);
|
||||
}
|
||||
return (0);
|
||||
@ -435,7 +435,7 @@ readIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%hd", &temp) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
(*in08) = (H5DT_INT8)temp;
|
||||
@ -448,14 +448,14 @@ readIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) in08, sizeof(H5DT_INT8), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -469,7 +469,7 @@ readIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%hd", in16) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -481,14 +481,14 @@ readIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) in16, sizeof(H5DT_INT16), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -502,7 +502,7 @@ readIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%d", in32) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -513,14 +513,14 @@ readIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) in32, sizeof(H5DT_INT32), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -535,7 +535,7 @@ readIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%s", buffer) < 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
*in64 = (H5DT_INT64) HDstrtoll(buffer, NULL, 10);
|
||||
@ -547,21 +547,21 @@ readIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) in64, sizeof(H5DT_INT64), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
#endif /* ifndef _WIN32 */
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err3);
|
||||
(void) fprintf(stderr, "%s", err3);
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
@ -598,7 +598,7 @@ readUIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%hu", &temp) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
(*in08) = (H5DT_UINT8)temp;
|
||||
@ -611,14 +611,14 @@ readUIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) in08, sizeof(H5DT_UINT8), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -632,7 +632,7 @@ readUIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%hu", in16) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -643,14 +643,14 @@ readUIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) in16, sizeof(H5DT_UINT16), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -664,7 +664,7 @@ readUIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%u", in32) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -675,14 +675,14 @@ readUIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) in32, sizeof(H5DT_UINT32), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -697,7 +697,7 @@ readUIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%s", buffer) < 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
*in64 = (H5DT_UINT64) HDstrtoll(buffer, NULL, 10);
|
||||
@ -709,21 +709,21 @@ readUIntegerData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) in64, sizeof(H5DT_UINT64), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
#endif /* ifndef _WIN32 */
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err3);
|
||||
(void) fprintf(stderr, "%s", err3);
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
@ -756,7 +756,7 @@ readFloatData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%f", fp32) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -771,7 +771,7 @@ readFloatData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%f", fp32) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -784,14 +784,14 @@ readFloatData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) fp32, sizeof(H5DT_FLOAT32), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -805,7 +805,7 @@ readFloatData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%lf", fp64) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -820,7 +820,7 @@ readFloatData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fscanf(*strm, "%lf", fp64) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -833,20 +833,20 @@ readFloatData(FILE **strm, struct Input *in)
|
||||
{
|
||||
if (fread((char *) fp64, sizeof(H5DT_FLOAT64), 1, *strm) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err3);
|
||||
(void) fprintf(stderr, "%s", err3);
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
@ -1019,7 +1019,7 @@ allocateIntegerStorage(struct Input *in)
|
||||
case 8:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT8))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -1027,7 +1027,7 @@ allocateIntegerStorage(struct Input *in)
|
||||
case 16:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT16))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -1035,7 +1035,7 @@ allocateIntegerStorage(struct Input *in)
|
||||
case 32:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT32))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -1043,13 +1043,13 @@ allocateIntegerStorage(struct Input *in)
|
||||
case 64:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT64))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
@ -1070,7 +1070,7 @@ static int allocateUIntegerStorage(struct Input *in)
|
||||
case 8:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT8))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -1078,7 +1078,7 @@ static int allocateUIntegerStorage(struct Input *in)
|
||||
case 16:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT16))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -1086,7 +1086,7 @@ static int allocateUIntegerStorage(struct Input *in)
|
||||
case 32:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT32))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -1094,13 +1094,13 @@ static int allocateUIntegerStorage(struct Input *in)
|
||||
case 64:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT64))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
@ -1122,7 +1122,7 @@ allocateFloatStorage(struct Input *in)
|
||||
case 32:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT32))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
@ -1130,13 +1130,13 @@ allocateFloatStorage(struct Input *in)
|
||||
case 64:
|
||||
if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_FLOAT64))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
@ -1216,7 +1216,7 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm)
|
||||
}
|
||||
if (fscanf(*strm, "%s", temp) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err18);
|
||||
(void) fprintf(stderr, "%s", err18);
|
||||
return (-1);
|
||||
}
|
||||
if (parsePathInfo(&in->path, temp) == -1)
|
||||
@ -1236,7 +1236,7 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm)
|
||||
|
||||
if (fscanf(*strm, "%s", temp) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err18);
|
||||
(void) fprintf(stderr, "%s", err18);
|
||||
return (-1);
|
||||
}
|
||||
if (getInputClass(in, temp) == -1)
|
||||
@ -1267,7 +1267,7 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm)
|
||||
}
|
||||
if (fscanf(*strm, "%d", (&ival)) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err19);
|
||||
(void) fprintf(stderr, "%s", err19);
|
||||
return (-1);
|
||||
}
|
||||
if (getInputSize(in, ival) == -1)
|
||||
@ -1514,7 +1514,7 @@ validateConfigurationParameters(struct Input * in)
|
||||
(in->configOptionVector[DIM] != 1) ||
|
||||
(in->configOptionVector[RANK] != 1))
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1524,7 +1524,7 @@ validateConfigurationParameters(struct Input * in)
|
||||
(in->configOptionVector[CHUNK] == 1) ||
|
||||
(in->configOptionVector[EXTEND] == 1))
|
||||
{
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -1534,7 +1534,7 @@ validateConfigurationParameters(struct Input * in)
|
||||
{
|
||||
if (in->configOptionVector[CHUNK] != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err3);
|
||||
(void) fprintf(stderr, "%s", err3);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -1543,7 +1543,7 @@ validateConfigurationParameters(struct Input * in)
|
||||
if (in->outputArchitecture == 1)
|
||||
if (in->outputClass == 1)
|
||||
{
|
||||
(void) fprintf(stderr, err4a);
|
||||
(void) fprintf(stderr, "%s", err4a);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1551,7 +1551,7 @@ validateConfigurationParameters(struct Input * in)
|
||||
if (in->outputArchitecture == 2)
|
||||
if (in->outputClass == 0)
|
||||
{
|
||||
(void) fprintf(stderr, err4b);
|
||||
(void) fprintf(stderr, "%s", err4b);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1559,14 +1559,14 @@ validateConfigurationParameters(struct Input * in)
|
||||
if(in->outputSize != 32 &&
|
||||
in->outputSize != 64 )
|
||||
{
|
||||
(void) fprintf(stderr, err5);
|
||||
(void) fprintf(stderr, "%s", err5);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if (in->inputSize == 64 && (in->inputClass == 0 || in->inputClass == 4 || in->inputClass == 6 || in->inputClass == 7) )
|
||||
{
|
||||
(void) fprintf(stderr, err6);
|
||||
(void) fprintf(stderr, "%s", err6);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@ -1626,7 +1626,7 @@ parseDimensions(struct Input *in, char *strm)
|
||||
if ((in->sizeOfDimension =
|
||||
(hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1654,13 +1654,13 @@ getOutputClass(struct Input *in, FILE** strm)
|
||||
|
||||
if (fscanf(*strm, "%s", temp) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if ((kindex = OutputClassStrToInt(temp)) == -1)
|
||||
{
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1694,7 +1694,7 @@ getOutputSize(struct Input *in, FILE** strm)
|
||||
|
||||
if (fscanf(*strm, "%d", (&ival)) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1704,7 +1704,7 @@ getOutputSize(struct Input *in, FILE** strm)
|
||||
in->outputSize = ival;
|
||||
return (0);
|
||||
}
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@ -1716,7 +1716,7 @@ getInputClass(struct Input *in, char * temp)
|
||||
|
||||
if ((kindex = InputClassStrToInt(temp)) == -1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1757,7 +1757,7 @@ getInputSize(struct Input *in, int ival)
|
||||
in->inputSize = ival;
|
||||
return (0);
|
||||
}
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@ -1771,7 +1771,7 @@ getRank(struct Input *in, FILE** strm)
|
||||
|
||||
if (fscanf(*strm, "%d", (&ival)) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
if (ival >=MIN_NUM_DIMENSION && ival <=MAX_NUM_DIMENSION )
|
||||
@ -1780,7 +1780,7 @@ getRank(struct Input *in, FILE** strm)
|
||||
return (0);
|
||||
}
|
||||
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@ -1797,7 +1797,7 @@ getDimensionSizes(struct Input *in, FILE **strm)
|
||||
if ((in->sizeOfDimension =
|
||||
(hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1806,7 +1806,7 @@ getDimensionSizes(struct Input *in, FILE **strm)
|
||||
|
||||
if (in->rank != i)
|
||||
{
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
@ -1825,7 +1825,7 @@ getChunkedDimensionSizes(struct Input *in, FILE **strm)
|
||||
if ((in->sizeOfChunk =
|
||||
(hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1834,14 +1834,14 @@ getChunkedDimensionSizes(struct Input *in, FILE **strm)
|
||||
|
||||
if (in->rank != i)
|
||||
{
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
for (i=0; i<in->rank; i++)
|
||||
if (in->sizeOfChunk[i] > in->sizeOfDimension[i])
|
||||
{
|
||||
(void) fprintf(stderr, err3);
|
||||
(void) fprintf(stderr, "%s", err3);
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
@ -1860,7 +1860,7 @@ getMaximumDimensionSizes(struct Input *in, FILE **strm)
|
||||
if ((in->maxsizeOfDimension =
|
||||
(hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1874,7 +1874,7 @@ getMaximumDimensionSizes(struct Input *in, FILE **strm)
|
||||
|
||||
if (in->rank != i)
|
||||
{
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1883,7 +1883,7 @@ getMaximumDimensionSizes(struct Input *in, FILE **strm)
|
||||
if (in->maxsizeOfDimension[i] != H5S_UNLIMITED)
|
||||
if (in->maxsizeOfDimension[i] < in->sizeOfDimension[i])
|
||||
{
|
||||
(void) fprintf(stderr, err3);
|
||||
(void) fprintf(stderr, "%s", err3);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -1900,13 +1900,13 @@ getOutputArchitecture(struct Input *in, FILE** strm)
|
||||
|
||||
if (fscanf(*strm, "%s", temp) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if ((kindex = OutputArchStrToInt(temp)) == -1)
|
||||
{
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1943,13 +1943,13 @@ getOutputByteOrder(struct Input *in, FILE** strm)
|
||||
|
||||
if (fscanf(*strm, "%s", temp) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if ((kindex = OutputByteOrderStrToInt(temp)) == -1)
|
||||
{
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -1980,13 +1980,13 @@ getCompressionType(struct Input *in, FILE** strm)
|
||||
|
||||
if (fscanf(*strm, "%s", temp) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if ((kindex = CompressionTypeStrToInt(temp)) == -1)
|
||||
{
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -2027,20 +2027,20 @@ getCompressionParameter(struct Input *in, FILE** strm)
|
||||
case 0: /* GZIP */
|
||||
if (fscanf(*strm, "%d", (&ival)) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (ival <0 || ival > 9)
|
||||
{
|
||||
(void) fprintf(stderr, err2);
|
||||
(void) fprintf(stderr, "%s", err2);
|
||||
return (-1);
|
||||
}
|
||||
in->compressionParam = ival;
|
||||
return (0);
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err3);
|
||||
(void) fprintf(stderr, "%s", err3);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -2053,7 +2053,7 @@ getExternalFilename(struct Input *in, FILE** strm)
|
||||
|
||||
if (fscanf(*strm, "%s", temp) != 1)
|
||||
{
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@ -2370,7 +2370,7 @@ createOutputDataType(struct Input *in)
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
return new_type;
|
||||
@ -2447,7 +2447,7 @@ createInputDataType(struct Input *in)
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf(stderr, err1);
|
||||
(void) fprintf(stderr, "%s", err1);
|
||||
return (-1);
|
||||
}
|
||||
return new_type;
|
||||
@ -2555,7 +2555,7 @@ process(struct Options *opt)
|
||||
/* creating the external file if it doesnt exist */
|
||||
if ((extfile = HDfopen(in->externFilename, "ab")) == NULL)
|
||||
{
|
||||
(void) fprintf(stderr, err4);
|
||||
(void) fprintf(stderr, "%s", err4);
|
||||
H5Pclose(proplist);
|
||||
H5Sclose(dataspace);
|
||||
H5Fclose(file_id);
|
||||
@ -2575,7 +2575,7 @@ process(struct Options *opt)
|
||||
H5E_BEGIN_TRY {
|
||||
/* create data set */
|
||||
if((dataset = H5Dcreate2(handle, in->path.group[j], outtype, dataspace, H5P_DEFAULT, proplist, H5P_DEFAULT)) < 0) {
|
||||
(void)fprintf(stderr, err5);
|
||||
(void)fprintf(stderr, "%s", err5);
|
||||
H5Pclose(proplist);
|
||||
H5Sclose(dataspace);
|
||||
H5Fclose(file_id);
|
||||
@ -2587,7 +2587,7 @@ process(struct Options *opt)
|
||||
|
||||
/* write dataset */
|
||||
if(H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0) {
|
||||
(void) fprintf(stderr, err6);
|
||||
(void) fprintf(stderr, "%s", err6);
|
||||
H5Dclose(dataset);
|
||||
H5Pclose(proplist);
|
||||
H5Sclose(dataspace);
|
||||
|
Loading…
x
Reference in New Issue
Block a user