summaryrefslogtreecommitdiffstats
path: root/src/H5Oint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Oint.c')
-rw-r--r--src/H5Oint.c206
1 files changed, 103 insertions, 103 deletions
diff --git a/src/H5Oint.c b/src/H5Oint.c
index f262545..72ab043 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -222,8 +222,8 @@ H5O__set_version(H5F_t *f, H5O_t *oh, uint8_t oh_flags, hbool_t store_msg_crt_id
FUNC_ENTER_PACKAGE
/* check arguments */
- HDassert(f);
- HDassert(oh);
+ assert(f);
+ assert(oh);
/* Set the correct version to encode object header with */
if (store_msg_crt_idx || (oh_flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED))
@@ -272,9 +272,9 @@ H5O_create(H5F_t *f, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc
FUNC_ENTER_NOAPI(FAIL)
- HDassert(f);
- HDassert(loc);
- HDassert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE));
+ assert(f);
+ assert(loc);
+ assert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE));
/* create object header in freelist
* header version is set internally
@@ -318,8 +318,8 @@ H5O_create_ohdr(H5F_t *f, hid_t ocpl_id)
FUNC_ENTER_NOAPI(NULL)
- HDassert(f);
- HDassert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE));
+ assert(f);
+ assert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE));
/* Check for invalid access request */
if (0 == (H5F_INTENT(f) & H5F_ACC_RDWR))
@@ -384,10 +384,10 @@ H5O_apply_ohdr(H5F_t *f, H5O_t *oh, hid_t ocpl_id, size_t size_hint, size_t init
FUNC_ENTER_NOAPI(FAIL)
- HDassert(f);
- HDassert(loc_out);
- HDassert(oh);
- HDassert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE));
+ assert(f);
+ assert(loc_out);
+ assert(oh);
+ assert(TRUE == H5P_isa_class(ocpl_id, H5P_OBJECT_CREATE));
/* Allocate at least a reasonable size for the object header */
size_hint = H5O_ALIGN_F(f, MAX(H5O_MIN_SIZE, size_hint));
@@ -566,8 +566,8 @@ H5O_open(H5O_loc_t *loc)
FUNC_ENTER_NOAPI_NOERR
/* Check args */
- HDassert(loc);
- HDassert(loc->file);
+ assert(loc);
+ assert(loc->file);
#ifdef H5O_DEBUG
if (H5DEBUG(O))
@@ -608,8 +608,8 @@ H5O_open_name(const H5G_loc_t *loc, const char *name, H5I_type_t *opened_type)
FUNC_ENTER_NOAPI(NULL)
/* Check args */
- HDassert(loc);
- HDassert(name && *name);
+ assert(loc);
+ assert(name && *name);
/* Set up opened group location to fill in */
obj_loc.oloc = &obj_oloc;
@@ -659,7 +659,7 @@ H5O__open_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5
FUNC_ENTER_PACKAGE
/* Check arguments */
- HDassert(loc);
+ assert(loc);
/* Set up opened group location to fill in */
obj_loc.oloc = &obj_oloc;
@@ -708,7 +708,7 @@ H5O__open_by_addr(const H5G_loc_t *loc, haddr_t addr, H5I_type_t *opened_type)
FUNC_ENTER_PACKAGE
/* Check arguments */
- HDassert(loc);
+ assert(loc);
/* Set up opened group location to fill in */
obj_loc.oloc = &obj_oloc;
@@ -747,14 +747,14 @@ H5O_open_by_loc(const H5G_loc_t *obj_loc, H5I_type_t *opened_type)
FUNC_ENTER_NOAPI(NULL)
- HDassert(obj_loc);
+ assert(obj_loc);
/* Get the object class for this location */
if (NULL == (obj_class = H5O__obj_class(obj_loc->oloc)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to determine object class")
/* Call the object class's 'open' routine */
- HDassert(obj_class->open);
+ assert(obj_class->open);
if (NULL == (ret_value = obj_class->open(obj_loc, opened_type)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object")
@@ -782,9 +782,9 @@ H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- HDassert(loc);
- HDassert(loc->file);
- HDassert(H5F_NOPEN_OBJS(loc->file) > 0);
+ assert(loc);
+ assert(loc->file);
+ assert(H5F_NOPEN_OBJS(loc->file) > 0);
/* Set the file_closed flag to the default value.
* This flag lets downstream code know if the file struct is
@@ -849,9 +849,9 @@ H5O__link_oh(H5F_t *f, int adjust, H5O_t *oh, hbool_t *deleted)
FUNC_ENTER_PACKAGE
/* check args */
- HDassert(f);
- HDassert(oh);
- HDassert(deleted);
+ assert(f);
+ assert(oh);
+ assert(deleted);
/* Check for adjusting link count */
if (adjust) {
@@ -965,9 +965,9 @@ H5O_link(const H5O_loc_t *loc, int adjust)
FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL)
/* check args */
- HDassert(loc);
- HDassert(loc->file);
- HDassert(H5_addr_defined(loc->addr));
+ assert(loc);
+ assert(loc->file);
+ assert(H5_addr_defined(loc->addr));
/* Pin the object header */
if (NULL == (oh = H5O_pin(loc)))
@@ -1014,11 +1014,11 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks)
FUNC_ENTER_NOAPI_TAG(loc->addr, NULL)
/* check args */
- HDassert(loc);
- HDassert(loc->file);
+ assert(loc);
+ assert(loc->file);
/* prot_flags may only contain the H5AC__READ_ONLY_FLAG */
- HDassert((prot_flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
+ assert((prot_flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0);
/* Check for valid address */
if (!H5_addr_defined(loc->addr))
@@ -1054,8 +1054,8 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks)
/* Sanity check - we should only have continuation messages to process
* when the object header is actually loaded from the file.
*/
- HDassert(udata.made_attempt == TRUE);
- HDassert(cont_msg_info.msgs);
+ assert(udata.made_attempt == TRUE);
+ assert(cont_msg_info.msgs);
/* Construct the user data for protecting chunks */
chk_udata.decoding = TRUE;
@@ -1087,9 +1087,9 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks)
HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk")
/* Sanity check */
- HDassert(chk_proxy->oh == oh);
- HDassert(chk_proxy->chunkno == chkcnt);
- HDassert(oh->nchunks == (chkcnt + 1));
+ assert(chk_proxy->oh == oh);
+ assert(chk_proxy->chunkno == chkcnt);
+ assert(oh->nchunks == (chkcnt + 1));
/* Release the chunk from the cache */
if (H5AC_unprotect(loc->file, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, chk_proxy,
@@ -1136,7 +1136,7 @@ H5O_protect(const H5O_loc_t *loc, unsigned prot_flags, hbool_t pin_all_chunks)
unsigned u; /* Local index variable */
/* Sanity check */
- HDassert(oh->swmr_write);
+ assert(oh->swmr_write);
/* Iterate over chunks > 0 */
for (u = 1; u < oh->nchunks; u++) {
@@ -1203,7 +1203,7 @@ H5O_pin(const H5O_loc_t *loc)
FUNC_ENTER_NOAPI(NULL)
/* check args */
- HDassert(loc);
+ assert(loc);
/* Get header */
if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE)))
@@ -1247,7 +1247,7 @@ H5O_unpin(H5O_t *oh)
FUNC_ENTER_NOAPI(FAIL)
/* check args */
- HDassert(oh);
+ assert(oh);
/* Decrement the reference count on the object header */
/* (which will unpin it, if appropriate) */
@@ -1281,15 +1281,15 @@ H5O_unprotect(const H5O_loc_t *loc, H5O_t *oh, unsigned oh_flags)
FUNC_ENTER_NOAPI(FAIL)
/* check args */
- HDassert(loc);
- HDassert(oh);
+ assert(loc);
+ assert(oh);
/* Unpin the other chunks */
if (oh->chunks_pinned && oh->nchunks > 1) {
unsigned u; /* Local index variable */
/* Sanity check */
- HDassert(oh->swmr_write);
+ assert(oh->swmr_write);
/* Iterate over chunks > 0 */
for (u = 1; u < oh->nchunks; u++) {
@@ -1337,8 +1337,8 @@ H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force)
FUNC_ENTER_NOAPI_NOINIT
- HDassert(f);
- HDassert(oh);
+ assert(f);
+ assert(oh);
/* Check if this object header is tracking times */
if (oh->flags & H5O_HDR_STORE_TIMES) {
@@ -1434,7 +1434,7 @@ H5O_touch(const H5O_loc_t *loc, hbool_t force)
FUNC_ENTER_NOAPI(FAIL)
/* check args */
- HDassert(loc);
+ assert(loc);
/* Get the object header */
if (NULL == (oh = H5O_protect(loc, H5AC__NO_FLAGS_SET, FALSE)))
@@ -1477,8 +1477,8 @@ H5O_bogus_oh(H5F_t *f, H5O_t *oh, unsigned bogus_id, unsigned mesg_flags)
FUNC_ENTER_NOAPI(FAIL)
- HDassert(f);
- HDassert(oh);
+ assert(f);
+ assert(oh);
/* Look for existing message */
for (idx = 0; idx < oh->nmesgs; idx++)
@@ -1550,8 +1550,8 @@ H5O_delete(H5F_t *f, haddr_t addr)
FUNC_ENTER_NOAPI_TAG(addr, FAIL)
/* Check args */
- HDassert(f);
- HDassert(H5_addr_defined(addr));
+ assert(f);
+ assert(H5_addr_defined(addr));
/* Set up the object location */
loc.file = f;
@@ -1609,8 +1609,8 @@ H5O__delete_oh(H5F_t *f, H5O_t *oh)
FUNC_ENTER_PACKAGE
/* Check args */
- HDassert(f);
- HDassert(oh);
+ assert(f);
+ assert(oh);
/* Walk through the list of object header messages, asking each one to
* delete any file space used
@@ -1683,8 +1683,8 @@ H5O__obj_type_real(const H5O_t *oh, H5O_type_t *obj_type)
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
- HDassert(oh);
- HDassert(obj_type);
+ assert(oh);
+ assert(obj_type);
/* Look up class for object header */
if (NULL == (obj_class = H5O__obj_class_real(oh))) {
@@ -1759,7 +1759,7 @@ H5O__obj_class_real(const H5O_t *oh)
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(oh);
+ assert(oh);
/* Test whether entry qualifies as a particular type of object */
/* (Note: loop is in reverse order, to test specific objects first) */
@@ -1860,7 +1860,7 @@ H5O_loc_reset(H5O_loc_t *loc)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check arguments */
- HDassert(loc);
+ assert(loc);
/* Clear the object location to an empty state */
HDmemset(loc, 0, sizeof(H5O_loc_t));
@@ -1888,9 +1888,9 @@ H5O_loc_copy(H5O_loc_t *dst, H5O_loc_t *src, H5_copy_depth_t depth)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check arguments */
- HDassert(src);
- HDassert(dst);
- HDassert(depth == H5_COPY_SHALLOW || depth == H5_COPY_DEEP);
+ assert(src);
+ assert(dst);
+ assert(depth == H5_COPY_SHALLOW || depth == H5_COPY_DEEP);
/* Invoke correct routine */
if (depth == H5_COPY_SHALLOW)
@@ -1923,8 +1923,8 @@ H5O_loc_copy_shallow(H5O_loc_t *dst, H5O_loc_t *src)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check arguments */
- HDassert(src);
- HDassert(dst);
+ assert(src);
+ assert(dst);
/* Copy the top level information */
H5MM_memcpy(dst, src, sizeof(H5O_loc_t));
@@ -1956,8 +1956,8 @@ H5O_loc_copy_deep(H5O_loc_t *dst, const H5O_loc_t *src)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check arguments */
- HDassert(src);
- HDassert(dst);
+ assert(src);
+ assert(dst);
/* Copy the top level information */
H5MM_memcpy(dst, src, sizeof(H5O_loc_t));
@@ -1991,8 +1991,8 @@ H5O_loc_hold_file(H5O_loc_t *loc)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check arguments */
- HDassert(loc);
- HDassert(loc->file);
+ assert(loc);
+ assert(loc->file);
/* If this location is not already holding its file open, do so. */
if (!loc->holding_file) {
@@ -2026,7 +2026,7 @@ H5O_loc_free(H5O_loc_t *loc)
FUNC_ENTER_NOAPI_NOINIT
/* Check arguments */
- HDassert(loc);
+ assert(loc);
/* If this location is holding its file open try to close the file. */
if (loc->holding_file) {
@@ -2064,8 +2064,8 @@ H5O_get_hdr_info(const H5O_loc_t *loc, H5O_hdr_info_t *hdr)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- HDassert(loc);
- HDassert(hdr);
+ assert(loc);
+ assert(hdr);
/* Reset the object header info structure */
HDmemset(hdr, 0, sizeof(*hdr));
@@ -2108,8 +2108,8 @@ H5O__get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr)
FUNC_ENTER_PACKAGE_NOERR
/* Check args */
- HDassert(oh);
- HDassert(hdr);
+ assert(oh);
+ assert(hdr);
/* Set the version for the object header */
hdr->version = oh->version;
@@ -2160,7 +2160,7 @@ H5O__get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr)
} /* end for */
/* Sanity check that all the bytes are accounted for */
- HDassert(hdr->space.total == (hdr->space.free + hdr->space.meta + hdr->space.mesg));
+ assert(hdr->space.total == (hdr->space.free + hdr->space.meta + hdr->space.mesg));
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__get_hdr_info_real() */
@@ -2188,8 +2188,8 @@ H5O_get_info(const H5O_loc_t *loc, H5O_info2_t *oinfo, unsigned fields)
FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL)
/* Check args */
- HDassert(loc);
- HDassert(oinfo);
+ assert(loc);
+ assert(oinfo);
/* Get the object header */
if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
@@ -2297,8 +2297,8 @@ H5O_get_native_info(const H5O_loc_t *loc, H5O_native_info_t *oinfo, unsigned fie
FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL)
/* Check args */
- HDassert(loc);
- HDassert(oinfo);
+ assert(loc);
+ assert(oinfo);
/* Get the object header */
if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
@@ -2358,8 +2358,8 @@ H5O_get_create_plist(const H5O_loc_t *loc, H5P_genplist_t *oc_plist)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- HDassert(loc);
- HDassert(oc_plist);
+ assert(loc);
+ assert(oc_plist);
/* Get the object header */
if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
@@ -2416,8 +2416,8 @@ H5O_get_nlinks(const H5O_loc_t *loc, hsize_t *nlinks)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- HDassert(loc);
- HDassert(nlinks);
+ assert(loc);
+ assert(nlinks);
/* Get the object header */
if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
@@ -2455,17 +2455,17 @@ H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc
FUNC_ENTER_NOAPI(NULL)
/* Sanity checks */
- HDassert(f);
- HDassert(obj_type >= H5O_TYPE_GROUP && obj_type <= H5O_TYPE_NAMED_DATATYPE);
- HDassert(crt_info);
- HDassert(obj_loc);
+ assert(f);
+ assert(obj_type >= H5O_TYPE_GROUP && obj_type <= H5O_TYPE_NAMED_DATATYPE);
+ assert(crt_info);
+ assert(obj_loc);
/* Iterate through the object classes */
for (u = 0; u < NELMTS(H5O_obj_class_g); u++) {
/* Check for correct type of object to create */
if (H5O_obj_class_g[u]->type == obj_type) {
/* Call the object class's 'create' routine */
- HDassert(H5O_obj_class_g[u]->create);
+ assert(H5O_obj_class_g[u]->create);
if (NULL == (ret_value = H5O_obj_class_g[u]->create(f, crt_info, obj_loc)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPENOBJ, NULL, "unable to open object")
@@ -2473,7 +2473,7 @@ H5O_obj_create(H5F_t *f, H5O_type_t obj_type, void *crt_info, H5G_loc_t *obj_loc
break;
} /* end if */
} /* end for */
- HDassert(ret_value);
+ assert(ret_value);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -2502,8 +2502,8 @@ H5O_get_oh_addr(const H5O_t *oh)
/* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */
FUNC_ENTER_NOAPI_NOINIT_NOERR
- HDassert(oh);
- HDassert(oh->chunk);
+ assert(oh);
+ assert(oh->chunk);
FUNC_LEAVE_NOAPI(oh->chunk[0].addr)
} /* end H5O_get_oh_addr() */
@@ -2520,7 +2520,7 @@ uint8_t
H5O_get_oh_flags(const H5O_t *oh)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- HDassert(oh);
+ assert(oh);
FUNC_LEAVE_NOAPI(oh->flags) /* flags can be 0 */
} /* H5O_get_oh_flags() */
@@ -2540,8 +2540,8 @@ time_t
H5O_get_oh_mtime(const H5O_t *oh)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- HDassert(oh);
- HDassert(oh->mtime);
+ assert(oh);
+ assert(oh->mtime);
FUNC_LEAVE_NOAPI(oh->mtime)
} /* H5O_get_oh_mtime() */
@@ -2557,8 +2557,8 @@ uint8_t
H5O_get_oh_version(const H5O_t *oh)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- HDassert(oh);
- HDassert(oh->version);
+ assert(oh);
+ assert(oh->version);
FUNC_LEAVE_NOAPI(oh->version)
} /* H5O_get_oh_version() */
@@ -2584,7 +2584,7 @@ H5O_get_rc_and_type(const H5O_loc_t *loc, unsigned *rc, H5O_type_t *otype)
FUNC_ENTER_NOAPI(FAIL)
/* Check args */
- HDassert(loc);
+ assert(loc);
/* Get the object header */
if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
@@ -2654,9 +2654,9 @@ H5O__visit_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t *l
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(name);
- HDassert(linfo);
- HDassert(udata);
+ assert(name);
+ assert(linfo);
+ assert(udata);
/* Check if this is a hard link */
if (linfo->type == H5L_TYPE_HARD) {
@@ -2774,7 +2774,7 @@ H5O__visit(H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type, H5_iter_or
HDmemset(&udata, 0, sizeof(udata));
/* Check args */
- HDassert(loc);
+ assert(loc);
/* Set up opened group location to fill in */
obj_loc.oloc = &obj_oloc;
@@ -2893,7 +2893,7 @@ H5O__inc_rc(H5O_t *oh)
FUNC_ENTER_PACKAGE
/* check args */
- HDassert(oh);
+ assert(oh);
/* Pin the object header when the reference count goes above 0 */
if (oh->rc == 0)
@@ -2964,7 +2964,7 @@ H5O_dec_rc_by_loc(const H5O_loc_t *loc)
FUNC_ENTER_NOAPI(FAIL)
/* check args */
- HDassert(loc);
+ assert(loc);
/* Get header */
if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE)))
@@ -3001,7 +3001,7 @@ H5O_get_proxy(const H5O_t *oh)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
- HDassert(oh);
+ assert(oh);
FUNC_LEAVE_NOAPI(oh->proxy)
} /* end H5O_get_proxy() */
@@ -3027,8 +3027,8 @@ H5O__free(H5O_t *oh, hbool_t H5_ATTR_NDEBUG_UNUSED force)
FUNC_ENTER_PACKAGE
/* check args */
- HDassert(oh);
- HDassert(0 == oh->rc);
+ assert(oh);
+ assert(0 == oh->rc);
/* Destroy chunks */
if (oh->chunk) {
@@ -3049,14 +3049,14 @@ H5O__free(H5O_t *oh, hbool_t H5_ATTR_NDEBUG_UNUSED force)
if (oh->ndecode_dirtied && oh->mesg[u].dirty)
oh->ndecode_dirtied--;
else if (!force)
- HDassert(oh->mesg[u].dirty == 0);
+ assert(oh->mesg[u].dirty == 0);
#endif /* NDEBUG */
H5O__msg_free_mesg(&oh->mesg[u]);
} /* end for */
/* Make sure we accounted for all the messages dirtied by decoding */
- HDassert(!oh->ndecode_dirtied);
+ assert(!oh->ndecode_dirtied);
oh->mesg = (H5O_mesg_t *)H5FL_SEQ_FREE(H5O_mesg_t, oh->mesg);
} /* end if */