summaryrefslogtreecommitdiffstats
path: root/src/H5Ocopy.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-28 14:31:56 (GMT)
committerGitHub <noreply@github.com>2023-06-28 14:31:56 (GMT)
commit7a44581a84778a1346a2fd5b6cca7d9db905a321 (patch)
tree44ea9c2d1b471eb227698abe8499c34cfa6d47d2 /src/H5Ocopy.c
parent622fcbd13881fbc58bbeaed3062583b759f5e864 (diff)
downloadhdf5-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/H5Ocopy.c')
-rw-r--r--src/H5Ocopy.c150
1 files changed, 75 insertions, 75 deletions
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 9da56c7..2c30610 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -136,10 +136,10 @@ H5O__copy(const H5G_loc_t *loc, const char *src_name, H5G_loc_t *dst_loc, const
FUNC_ENTER_PACKAGE
/* Check arguments */
- HDassert(loc);
- HDassert(src_name && *src_name);
- HDassert(dst_loc);
- HDassert(dst_name && *dst_name);
+ assert(loc);
+ assert(src_name && *src_name);
+ assert(dst_loc);
+ assert(dst_name && *dst_name);
/* Check if destination name already exists */
dst_exists = FALSE;
@@ -223,11 +223,11 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
FUNC_ENTER_PACKAGE_TAG(oloc_src->addr)
- HDassert(oloc_src);
- HDassert(oloc_src->file);
- HDassert(H5_addr_defined(oloc_src->addr));
- HDassert(oloc_dst->file);
- HDassert(cpy_info);
+ assert(oloc_src);
+ assert(oloc_src->file);
+ assert(H5_addr_defined(oloc_src->addr));
+ assert(oloc_dst->file);
+ assert(cpy_info);
/* Get pointer to object class for this object */
if (NULL == (obj_class = H5O__obj_class(oloc_src)))
@@ -362,7 +362,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
mesg_src = &(oh_src->mesg[mesgno]);
/* Sanity check */
- HDassert(!mesg_src->dirty); /* Should be cleared by earlier call to flush messages */
+ assert(!mesg_src->dirty); /* Should be cleared by earlier call to flush messages */
/* Get message class to operate on */
copy_type = mesg_src->type;
@@ -375,7 +375,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
++null_msgs;
copy_type = H5O_MSG_NULL;
} /* end if */
- HDassert(copy_type);
+ assert(copy_type);
if (copy_type->pre_copy_file) {
/* Decode the message if necessary. */
@@ -421,7 +421,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
if (FALSE == cpy_info->preserve_null) {
while (deleted[mesgno + null_msgs]) {
++null_msgs;
- HDassert(mesgno + null_msgs < oh_src->nmesgs);
+ assert(mesgno + null_msgs < oh_src->nmesgs);
} /* end while */
} /* end if */
@@ -449,7 +449,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
* converted to a nil message) in the destination -QAK)
*/
copy_type = mesg_dst->type;
- HDassert(copy_type);
+ assert(copy_type);
/* copy this message into destination file */
if (copy_type->copy_file) {
@@ -529,7 +529,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
size_t delta = (size_t)(H5O_MIN_SIZE - dst_oh_size); /* Delta in chunk size needed */
/* Sanity check */
- HDassert((oh_dst->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_1);
+ assert((oh_dst->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_1);
/* Determine whether to create gap or NULL message */
if ((oh_dst->version > H5O_VERSION_1) && (delta < H5O_SIZEOF_MSGHDR_OH(oh_dst)))
@@ -546,7 +546,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
dst_oh_size += delta;
/* Sanity check */
- HDassert(dst_oh_size <= 255);
+ assert(dst_oh_size <= 255);
} /* end if */
/* Add in destination's object header size now */
@@ -581,7 +581,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
* treatment. This has to happen after the destination header has been
* allocated.
*/
- HDassert(H5O_SIZEOF_MSGHDR_OH(oh_src) == H5O_SIZEOF_MSGHDR_OH(oh_dst));
+ assert(H5O_SIZEOF_MSGHDR_OH(oh_src) == H5O_SIZEOF_MSGHDR_OH(oh_dst));
msghdr_size = H5O_SIZEOF_MSGHDR_OH(oh_dst);
current_pos = oh_dst->chunk[0].image;
@@ -602,7 +602,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
if (FALSE == cpy_info->preserve_null) {
while (deleted[mesgno + null_msgs]) {
++null_msgs;
- HDassert(mesgno + null_msgs < oh_src->nmesgs);
+ assert(mesgno + null_msgs < oh_src->nmesgs);
} /* end while */
} /* end if */
@@ -646,11 +646,11 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
} /* end if */
/* Make sure we filled the chunk, except for room at the end for a checksum */
- HDassert(current_pos + dst_oh_gap + dst_oh_null + H5O_SIZEOF_CHKSUM_OH(oh_dst) ==
- (size_t)dst_oh_size + oh_dst->chunk[0].image);
+ assert(current_pos + dst_oh_gap + dst_oh_null + H5O_SIZEOF_CHKSUM_OH(oh_dst) ==
+ (size_t)dst_oh_size + oh_dst->chunk[0].image);
/* Set the dest. object location to the first chunk address */
- HDassert(H5_addr_defined(addr_new));
+ assert(H5_addr_defined(addr_new));
oloc_dst->addr = addr_new;
/* If we are merging committed datatypes and this is a committed datatype, insert
@@ -691,7 +691,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
if (FALSE == cpy_info->preserve_null) {
while (deleted[mesgno + null_msgs]) {
++null_msgs;
- HDassert(mesgno + null_msgs < oh_src->nmesgs);
+ assert(mesgno + null_msgs < oh_src->nmesgs);
} /* end while */
} /* end if */
@@ -704,14 +704,14 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
* converted to a nil message) in the destination -QAK)
*/
copy_type = mesg_dst->type;
- HDassert(copy_type);
+ assert(copy_type);
if (copy_type->post_copy_file && mesg_src->native) {
unsigned mesg_flags; /* Message flags */
/* Sanity check destination message */
- HDassert(mesg_dst->type == mesg_src->type);
- HDassert(mesg_dst->native);
+ assert(mesg_dst->type == mesg_src->type);
+ assert(mesg_dst->native);
/* Get destination message flags. mesg_dst->flags will contain the
* original flags for now. */
@@ -727,7 +727,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
"unable to perform 'post copy' operation on message")
/* Verify that the flags did not change */
- HDassert(mesg_flags == (unsigned)mesg_dst->flags);
+ assert(mesg_flags == (unsigned)mesg_dst->flags);
} /* end if */
} /* end for */
@@ -758,7 +758,7 @@ H5O__copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5
/* Set obj_type and udata, if requested */
if (obj_type) {
- HDassert(udata);
+ assert(udata);
*obj_type = obj_class->type;
*udata = cpy_udata;
} /* end if */
@@ -815,11 +815,11 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5O_
FUNC_ENTER_NOAPI(FAIL)
/* Sanity check */
- HDassert(oloc_src);
- HDassert(oloc_src->file);
- HDassert(oloc_dst);
- HDassert(oloc_dst->file);
- HDassert(cpy_info);
+ assert(oloc_src);
+ assert(oloc_src->file);
+ assert(oloc_dst);
+ assert(oloc_dst->file);
+ assert(cpy_info);
/* Create object "position" struct */
H5F_GET_FILENO(oloc_src->file, src_obj_pos.fileno);
@@ -857,7 +857,7 @@ H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, H5O_
/* Return saved obj_type and udata, if requested */
if (obj_type) {
- HDassert(udata);
+ assert(udata);
*obj_type = addr_map->obj_class->type;
*udata = addr_map->udata;
} /* end if */
@@ -910,12 +910,12 @@ H5O__copy_free_addrmap_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UN
FUNC_ENTER_PACKAGE_NOERR
- HDassert(item);
+ assert(item);
/* Release user data for particular type of object */
if (item->udata) {
- HDassert(item->obj_class);
- HDassert(item->obj_class->free_copy_file_udata);
+ assert(item->obj_class);
+ assert(item->obj_class->free_copy_file_udata);
(item->obj_class->free_copy_file_udata)(item->udata);
} /* end if */
@@ -950,10 +950,10 @@ H5O__copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, hid_t
FUNC_ENTER_PACKAGE
/* Sanity check */
- HDassert(oloc_src);
- HDassert(oloc_src->file);
- HDassert(H5_addr_defined(oloc_src->addr));
- HDassert(oloc_dst->file);
+ assert(oloc_src);
+ assert(oloc_src->file);
+ assert(H5_addr_defined(oloc_src->addr));
+ assert(oloc_dst->file);
/* Initialize copy info before errors can be thrown */
HDmemset(&cpy_info, 0, sizeof(H5O_copy_t));
@@ -1046,11 +1046,11 @@ H5O__copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, hid_
FUNC_ENTER_PACKAGE
- HDassert(src_loc);
- HDassert(src_loc->oloc->file);
- HDassert(dst_loc);
- HDassert(dst_loc->oloc->file);
- HDassert(dst_name);
+ assert(src_loc);
+ assert(src_loc->oloc->file);
+ assert(dst_loc);
+ assert(dst_loc->oloc->file);
+ assert(dst_name);
/* Set up copied object location to fill in */
new_loc.oloc = &new_oloc;
@@ -1104,9 +1104,9 @@ H5O__copy_free_comm_dt_cb(void *item, void *_key, void H5_ATTR_UNUSED *_op_data)
FUNC_ENTER_PACKAGE_NOERR
- HDassert(addr);
- HDassert(key);
- HDassert(key->dt);
+ assert(addr);
+ assert(key);
+ assert(key->dt);
key->dt = (H5T_t *)H5O_msg_free(H5O_DTYPE_ID, key->dt);
key = H5FL_FREE(H5O_copy_search_comm_dt_key_t, key);
@@ -1183,10 +1183,10 @@ H5O__copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata)
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(attr);
- HDassert(udata);
- HDassert(udata->dst_dt_list);
- HDassert(H5_addr_defined(udata->obj_oloc.addr));
+ assert(attr);
+ assert(udata);
+ assert(udata->dst_dt_list);
+ assert(H5_addr_defined(udata->obj_oloc.addr));
/* Get attribute datatype */
if (NULL == (dt = H5A_type(attr)))
@@ -1227,7 +1227,7 @@ done:
key = H5FL_FREE(H5O_copy_search_comm_dt_key_t, key);
} /* end if */
if (addr) {
- HDassert(ret_value < 0);
+ assert(ret_value < 0);
addr = H5FL_FREE(haddr_t, addr);
} /* end if */
} /* end if */
@@ -1263,10 +1263,10 @@ H5O__copy_search_comm_dt_check(H5O_loc_t *obj_oloc, H5O_copy_search_comm_dt_ud_t
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(obj_oloc);
- HDassert(udata);
- HDassert(udata->dst_dt_list);
- HDassert(udata->dst_root_loc);
+ assert(obj_oloc);
+ assert(udata);
+ assert(udata->dst_dt_list);
+ assert(udata->dst_root_loc);
/* Get pointer to object class for this object */
if ((obj_class = H5O__obj_class(obj_oloc)) == NULL)
@@ -1345,7 +1345,7 @@ done:
key = H5FL_FREE(H5O_copy_search_comm_dt_key_t, key);
} /* end if */
if (addr) {
- HDassert(ret_value < 0);
+ assert(ret_value < 0);
addr = H5FL_FREE(haddr_t, addr);
} /* end if */
} /* end if */
@@ -1382,11 +1382,11 @@ H5O__copy_search_comm_dt_cb(hid_t H5_ATTR_UNUSED group, const char *name, const
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(name);
- HDassert(linfo);
- HDassert(udata);
- HDassert(udata->dst_dt_list);
- HDassert(udata->dst_root_loc);
+ assert(name);
+ assert(linfo);
+ assert(udata);
+ assert(udata->dst_dt_list);
+ assert(udata->dst_root_loc);
/* Check if this is a hard link */
if (linfo->type == H5L_TYPE_HARD) {
@@ -1443,11 +1443,11 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(oh_src);
- HDassert(oloc_dst);
- HDassert(oloc_dst->file);
- HDassert(H5F_ID_EXISTS(oloc_dst->file));
- HDassert(cpy_info);
+ assert(oh_src);
+ assert(oloc_dst);
+ assert(oloc_dst->file);
+ assert(H5F_ID_EXISTS(oloc_dst->file));
+ assert(cpy_info);
/* Allocate key */
if (NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t)))
@@ -1536,7 +1536,7 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i
/* Build the complete dst dt list */
/* Set up the root group in the destination file, if necessary */
if (!dst_root_loc.oloc) {
- HDassert(!dst_root_loc.path);
+ assert(!dst_root_loc.path);
if (NULL == (dst_root_loc.oloc = H5G_oloc(H5G_rootof(oloc_dst->file))))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"unable to get object location for root group")
@@ -1544,7 +1544,7 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path for root group")
} /* end if */
else
- HDassert(dst_root_loc.path);
+ assert(dst_root_loc.path);
/* Build udata. Note that this may be done twice in some cases, but
* it should be rare and should be cheaper on average than trying to
@@ -1608,12 +1608,12 @@ H5O__copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst, H5
FUNC_ENTER_PACKAGE
/* Sanity checks */
- HDassert(oh_src);
- HDassert(oloc_dst);
- HDassert(oloc_dst->file);
- HDassert(oloc_dst->addr != HADDR_UNDEF);
- HDassert(cpy_info);
- HDassert(cpy_info->dst_dt_list);
+ assert(oh_src);
+ assert(oloc_dst);
+ assert(oloc_dst->file);
+ assert(oloc_dst->addr != HADDR_UNDEF);
+ assert(cpy_info);
+ assert(cpy_info->dst_dt_list);
/* Allocate key */
if (NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t)))