summaryrefslogtreecommitdiffstats
path: root/tools/lib
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 /tools/lib
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 'tools/lib')
-rw-r--r--tools/lib/h5diff_array.c10
-rw-r--r--tools/lib/h5tools_dump.c64
-rw-r--r--tools/lib/h5tools_str.c20
-rw-r--r--tools/lib/io_timer.c4
4 files changed, 49 insertions, 49 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index c554160..5cb22f1 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -224,7 +224,7 @@ diff_array(void *_mem1, void *_mem2, diff_opt_t *opts, hid_t container1_id, hid_
case H5T_NCLASSES:
default:
H5TOOLS_DEBUG("type_class:INVALID");
- HDassert(0);
+ assert(0);
break;
/*-------------------------------------------------------------------------
@@ -707,7 +707,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
size = H5Tget_size(arr_opts.m_tid);
ndims = H5Tget_array_ndims(opts->m_tid);
H5Tget_array_dims2(opts->m_tid, adims);
- HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK);
+ assert(ndims >= 1 && ndims <= H5S_MAX_RANK);
H5TOOLS_DEBUG("attr ph=%d", arr_opts.print_header);
/* calculate the number of array elements */
@@ -1386,9 +1386,9 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di
*/
if (nblocks1 > 0) {
H5TOOLS_DEBUG("region compare blocks");
- HDassert(ndims1 > 0);
+ assert(ndims1 > 0);
alloc_size = (hsize_t)nblocks1 * (unsigned)ndims1 * 2 * sizeof(ptdata1[0]);
- HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
if ((ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) {
opts->err_stat = H5DIFF_ERR;
@@ -1460,7 +1460,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di
if (npoints1 > 0) {
H5TOOLS_DEBUG("region compare points");
alloc_size = (hsize_t)npoints1 * (unsigned)ndims1 * sizeof(ptdata1[0]);
- HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
if ((ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) {
opts->err_stat = H5DIFF_ERR;
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index d444c8c..1273065 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -344,9 +344,9 @@ h5tools_dump_region_attribute(hid_t region_id, FILE *stream, const h5tool_format
hbool_t past_catch = FALSE;
hbool_t ret_value = TRUE;
- HDassert(info);
- HDassert(ctx);
- HDassert(buffer);
+ assert(info);
+ assert(ctx);
+ assert(buffer);
outputformat = *info;
outputformat.idx_fmt = "";
@@ -497,10 +497,10 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for
void *region_buf = NULL;
int ret_value = 0;
- HDassert(info);
- HDassert(cur_ctx);
- HDassert(buffer);
- HDassert(ptdata);
+ assert(info);
+ assert(cur_ctx);
+ assert(buffer);
+ assert(ptdata);
HDmemset(&ctx, 0, sizeof(ctx));
@@ -674,9 +674,9 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea
hbool_t past_catch = FALSE;
hbool_t ret_value = TRUE;
- HDassert(info);
- HDassert(ctx);
- HDassert(buffer);
+ assert(info);
+ assert(ctx);
+ assert(buffer);
H5TOOLS_START_DEBUG(" ");
outputformat = *info;
@@ -712,7 +712,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea
h5tools_str_append(buffer, "REGION_TYPE BLOCK ");
alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]);
- HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
if ((ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL)
H5TOOLS_GOTO_ERROR(dimension_break, "Could not allocate buffer for ptdata");
@@ -893,11 +893,11 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre
hbool_t past_catch = FALSE;
int ret_value = 0;
- HDassert(info);
- HDassert(cur_ctx);
- HDassert(buffer);
- HDassert(ptdata);
- HDassert(ndims > 0);
+ assert(info);
+ assert(cur_ctx);
+ assert(buffer);
+ assert(ptdata);
+ assert(ndims > 0);
H5TOOLS_START_DEBUG(" ");
@@ -1033,9 +1033,9 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea
hbool_t past_catch = FALSE;
hbool_t ret_value = TRUE;
- HDassert(info);
- HDassert(ctx);
- HDassert(buffer);
+ assert(info);
+ assert(ctx);
+ assert(buffer);
H5TOOLS_START_DEBUG(" ");
outputformat = *info;
@@ -1071,7 +1071,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea
h5tools_str_append(buffer, "REGION_TYPE POINT ");
alloc_size = npoints * ndims * sizeof(ptdata[0]);
- HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
H5TOOLS_GOTO_ERROR(dimension_break, "Could not allocate buffer for ptdata");
@@ -1317,10 +1317,10 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
size = 1;
sm_size[i - 1] = MIN(total_size[i - 1], size);
sm_nbytes *= sm_size[i - 1];
- HDassert(sm_nbytes > 0);
+ assert(sm_nbytes > 0);
}
- HDassert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
+ assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
if (NULL == (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nelmts * p_type_nbytes)))
H5TOOLS_THROW(FAIL, "Could not allocate buffer for strip-mine");
@@ -1699,7 +1699,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
if (!sm_nbytes)
goto done;
- HDassert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
+ assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/
if (NULL != (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes))) {
H5TOOLS_DEBUG("stripmine size:%ld", sm_nbytes);
@@ -1848,7 +1848,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
vl_data = TRUE;
alloc_size = p_nelmts * H5Tget_size(p_type);
- HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
if (NULL != (buf = (unsigned char *)HDmalloc((size_t)alloc_size))) {
H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims);
@@ -2747,7 +2747,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
if ((snmembs = H5Tget_nmembers(type)) < 0)
H5TOOLS_THROW((-1), "H5Tget_nmembers failed");
nmembs = (unsigned)snmembs;
- HDassert(nmembs > 0);
+ assert(nmembs > 0);
if ((super = H5Tget_super(type)) < 0)
H5TOOLS_THROW((-1), "H5Tget_super failed");
@@ -3382,12 +3382,12 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
ctx->indent_level++;
ssize_out = H5Pget_virtual_filename(dcpl_id, curr_vmap, NULL, 0);
- HDassert(ssize_out > 0);
- HDassert((size_t)ssize_out < sizeof(name));
+ assert(ssize_out > 0);
+ assert((size_t)ssize_out < sizeof(name));
H5Pget_virtual_filename(dcpl_id, curr_vmap, name, sizeof(name));
ssize_out = H5Pget_virtual_dsetname(dcpl_id, curr_vmap, NULL, 0);
- HDassert(ssize_out > 0);
- HDassert((size_t)ssize_out < sizeof(name));
+ assert(ssize_out > 0);
+ assert((size_t)ssize_out < sizeof(name));
H5Pget_virtual_dsetname(dcpl_id, curr_vmap, dsetname, sizeof(dsetname));
ctx->need_prefix = TRUE;
@@ -3660,7 +3660,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
break;
case H5D_FILL_TIME_ERROR:
default:
- HDassert(0);
+ assert(0);
break;
}
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
@@ -3684,7 +3684,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
break;
case H5D_FILL_VALUE_ERROR:
default:
- HDassert(0);
+ assert(0);
break;
}
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
@@ -3726,7 +3726,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
case H5D_ALLOC_TIME_ERROR:
case H5D_ALLOC_TIME_DEFAULT:
default:
- HDassert(0);
+ assert(0);
break;
}
h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0);
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index a3a6995..a923a52 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -149,9 +149,9 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...)
* Allocate at least twice as much space and try again.
*/
size_t newsize = MAX(str->len + (size_t)nchars + 1, 2 * str->nalloc);
- HDassert(newsize > str->nalloc); /*overflow*/
+ assert(newsize > str->nalloc); /*overflow*/
str->s = (char *)HDrealloc(str->s, newsize);
- HDassert(str->s);
+ assert(str->s);
str->nalloc = newsize;
}
else {
@@ -184,7 +184,7 @@ h5tools_str_reset(h5tools_str_t *str /*in,out*/)
if (!str->s || str->nalloc <= 0) {
str->nalloc = STR_INIT_LEN;
str->s = (char *)HDmalloc(str->nalloc);
- HDassert(str->s);
+ assert(str->s);
}
str->s[0] = '\0';
@@ -238,8 +238,8 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt)
{
char _temp[1024], *temp = _temp;
- HDassert(str);
- HDassert(fmt);
+ assert(str);
+ assert(fmt);
/* If the format string is simply "%s" then don't bother doing anything */
if (!HDstrcmp(fmt, "%s"))
@@ -254,7 +254,7 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt)
if (str->len - start + 1 > n) {
n = str->len - start + 1;
temp = (char *)HDmalloc(n);
- HDassert(temp);
+ assert(temp);
}
HDstrncpy(temp, str->s + start, n - 1);
@@ -471,7 +471,7 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, const h5tool_for
nblocks = (hsize_t)snblocks;
alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]);
- HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
ptdata = (hsize_t *)HDmalloc((size_t)alloc_size);
H5Sget_select_hyper_blocklist(rspace, (hsize_t)0, nblocks, ptdata);
@@ -532,7 +532,7 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, const h5tool_for
npoints = (hsize_t)snpoints;
alloc_size = npoints * ndims * sizeof(ptdata[0]);
- HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
ptdata = (hsize_t *)HDmalloc((size_t)alloc_size);
H5Sget_select_elem_pointlist(rspace, (hsize_t)0, npoints, ptdata);
@@ -1267,13 +1267,13 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
size = H5Tget_size(memb);
ndims = H5Tget_array_ndims(type);
H5Tget_array_dims2(type, dims);
- HDassert(ndims >= 1 && ndims <= H5S_MAX_RANK);
+ assert(ndims >= 1 && ndims <= H5S_MAX_RANK);
/* Calculate the number of array elements */
for (k = 0, nelmts = 1; k < ndims; k++) {
temp_nelmts = nelmts;
temp_nelmts *= dims[k];
- HDassert(temp_nelmts == (hsize_t)((size_t)temp_nelmts));
+ assert(temp_nelmts == (hsize_t)((size_t)temp_nelmts));
nelmts = (size_t)temp_nelmts;
}
/* Print the opening bracket */
diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c
index 6a8d091..d565264 100644
--- a/tools/lib/io_timer.c
+++ b/tools/lib/io_timer.c
@@ -125,7 +125,7 @@ io_time_t *
io_time_set(io_time_t *pt, timer_type t, int start_stop)
{
/* sanity check */
- HDassert(pt);
+ assert(pt);
switch (pt->type) {
#ifdef H5_HAVE_PARALLEL
@@ -214,7 +214,7 @@ H5_ATTR_PURE double
io_time_get(io_time_t *pt, timer_type t)
{
/* sanity check */
- HDassert(pt);
+ assert(pt);
return pt->total_time[t];
}