diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-06-28 14:31:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 14:31:56 (GMT) |
commit | 7a44581a84778a1346a2fd5b6cca7d9db905a321 (patch) | |
tree | 44ea9c2d1b471eb227698abe8499c34cfa6d47d2 /src/H5Olink.c | |
parent | 622fcbd13881fbc58bbeaed3062583b759f5e864 (diff) | |
download | hdf5-7a44581a84778a1346a2fd5b6cca7d9db905a321.zip hdf5-7a44581a84778a1346a2fd5b6cca7d9db905a321.tar.gz hdf5-7a44581a84778a1346a2fd5b6cca7d9db905a321.tar.bz2 |
Rename HDassert() to assert() (#3191)
* Change HDassert to assert
* Fix bin/make_err
Diffstat (limited to 'src/H5Olink.c')
-rw-r--r-- | src/H5Olink.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/H5Olink.c b/src/H5Olink.c index b4c34de..2afb89c 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -114,8 +114,8 @@ H5O__link_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSE FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) HGOTO_ERROR(H5E_OHDR, H5E_OVERFLOW, NULL, "ran off end of input buffer while decoding") @@ -301,13 +301,13 @@ H5O__link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(lnk); + assert(f); + assert(p); + assert(lnk); /* Get length of link's name */ len = (uint64_t)HDstrlen(lnk->name); - HDassert(len > 0); + assert(len > 0); /* encode */ *p++ = H5O_LINK_VERSION; @@ -357,7 +357,7 @@ H5O__link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co break; default: - HDassert(0 && "bad size for name"); + assert(0 && "bad size for name"); } /* end switch */ /* Store the link's name */ @@ -374,7 +374,7 @@ H5O__link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co case H5L_TYPE_SOFT: /* Store the link value */ len = (uint16_t)HDstrlen(lnk->u.soft.name); - HDassert(len > 0); + assert(len > 0); UINT16ENCODE(p, len); H5MM_memcpy(p, lnk->u.soft.name, (size_t)len); p += len; @@ -385,7 +385,7 @@ H5O__link_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co case H5L_TYPE_ERROR: case H5L_TYPE_MAX: default: - HDassert(lnk->type >= H5L_TYPE_UD_MIN && lnk->type <= H5L_TYPE_MAX); + assert(lnk->type >= H5L_TYPE_UD_MIN && lnk->type <= H5L_TYPE_MAX); /* Store the user-supplied data, however long it is */ len = (uint16_t)lnk->u.ud.size; @@ -425,7 +425,7 @@ H5O__link_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(lnk); + assert(lnk); if (!dest && NULL == (dest = H5FL_MALLOC(H5O_link_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -433,7 +433,7 @@ H5O__link_copy(const void *_mesg, void *_dest) *dest = *lnk; /* Duplicate the link's name */ - HDassert(lnk->name); + assert(lnk->name); if (NULL == (dest->name = H5MM_xstrdup(lnk->name))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't duplicate link name") @@ -531,7 +531,7 @@ H5O__link_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void case H5L_TYPE_EXTERNAL: case H5L_TYPE_MAX: default: /* Default is user-defined link type */ - HDassert(lnk->type >= H5L_TYPE_UD_MIN); + assert(lnk->type >= H5L_TYPE_UD_MIN); ret_value += 2 + /* User-defined data size */ lnk->u.ud.size; /* User-defined data */ break; @@ -593,7 +593,7 @@ H5O__link_free(void *_mesg) FUNC_ENTER_PACKAGE_NOERR - HDassert(lnk); + assert(lnk); lnk = H5FL_FREE(H5O_link_t, lnk); @@ -622,8 +622,8 @@ H5O_link_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f); - HDassert(lnk); + assert(f); + assert(lnk); /* Check for adjusting the link count when the link is removed */ /* Adjust the reference count of the object when a hard link is removed */ @@ -633,7 +633,7 @@ H5O_link_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) /* Construct object location for object, in order to decrement it's ref count */ H5O_loc_reset(&oloc); oloc.file = f; - HDassert(H5_addr_defined(lnk->u.hard.addr)); + assert(H5_addr_defined(lnk->u.hard.addr)); oloc.addr = lnk->u.hard.addr; /* Decrement the ref count for the object */ @@ -690,8 +690,8 @@ H5O__link_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(deleted); - HDassert(cpy_info); + assert(deleted); + assert(cpy_info); /* If we are performing a 'shallow hierarchy' copy, and this link won't * be included in the final group, indicate that it should be deleted @@ -729,9 +729,9 @@ H5O__link_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t H5_A FUNC_ENTER_PACKAGE /* check args */ - HDassert(link_src); - HDassert(cpy_info); - HDassert(cpy_info->max_depth < 0 || cpy_info->curr_depth < cpy_info->max_depth); + assert(link_src); + assert(cpy_info); + assert(cpy_info->max_depth < 0 || cpy_info->curr_depth < cpy_info->max_depth); /* Sanity check source link type */ if (link_src->type > H5L_TYPE_SOFT && link_src->type < H5L_TYPE_UD_MIN) @@ -769,13 +769,13 @@ H5O__link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_lo FUNC_ENTER_PACKAGE /* check args */ - HDassert(link_src); - HDassert(dst_oloc); - HDassert(H5_addr_defined(dst_oloc->addr)); - HDassert(dst_oloc->file); - HDassert(link_dst); - HDassert(cpy_info); - HDassert(cpy_info->max_depth < 0 || cpy_info->curr_depth < cpy_info->max_depth); + assert(link_src); + assert(dst_oloc); + assert(H5_addr_defined(dst_oloc->addr)); + assert(dst_oloc->file); + assert(link_dst); + assert(cpy_info); + assert(cpy_info->max_depth < 0 || cpy_info->curr_depth < cpy_info->max_depth); /* Copy the link (and the object it points to) */ if (H5L__link_copy_file(dst_oloc->file, link_src, src_oloc, link_dst, cpy_info) < 0) @@ -806,11 +806,11 @@ H5O__link_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(lnk); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(lnk); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Link Type:", (lnk->type == H5L_TYPE_HARD |