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/H5Dscatgath.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/H5Dscatgath.c')
-rw-r--r-- | src/H5Dscatgath.c | 162 |
1 files changed, 81 insertions, 81 deletions
diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 802544c..b73bb1b 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -105,13 +105,13 @@ H5D__scatter_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset FUNC_ENTER_PACKAGE /* Check args */ - HDassert(_io_info); - HDassert(_dset_info); - HDassert(_dset_info->dset); - HDassert(_dset_info->store); - HDassert(iter); - HDassert(nelmts > 0); - HDassert(_buf); + assert(_io_info); + assert(_dset_info); + assert(_dset_info->dset); + assert(_dset_info->store); + assert(iter); + assert(nelmts > 0); + assert(_buf); /* Set up temporary I/O info object */ H5MM_memcpy(&tmp_io_info, _io_info, sizeof(*_io_info)); @@ -209,13 +209,13 @@ H5D__gather_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset_ FUNC_ENTER_PACKAGE /* Check args */ - HDassert(_io_info); - HDassert(_dset_info); - HDassert(_dset_info->dset); - HDassert(_dset_info->store); - HDassert(iter); - HDassert(nelmts > 0); - HDassert(_buf); + assert(_io_info); + assert(_dset_info); + assert(_dset_info->dset); + assert(_dset_info->store); + assert(iter); + assert(nelmts > 0); + assert(_buf); /* Set up temporary I/O info object */ H5MM_memcpy(&tmp_io_info, _io_info, sizeof(*_io_info)); @@ -304,10 +304,10 @@ H5D__scatter_mem(const void *_tscat_buf, H5S_sel_iter_t *iter, size_t nelmts, vo FUNC_ENTER_PACKAGE /* Check args */ - HDassert(tscat_buf); - HDassert(iter); - HDassert(nelmts > 0); - HDassert(buf); + assert(tscat_buf); + assert(iter); + assert(nelmts > 0); + assert(buf); /* Get info from API context */ if (H5CX_get_vec_size(&dxpl_vec_size) < 0) @@ -389,10 +389,10 @@ H5D__gather_mem(const void *_buf, H5S_sel_iter_t *iter, size_t nelmts, void *_tg FUNC_ENTER_PACKAGE /* Check args */ - HDassert(buf); - HDassert(iter); - HDassert(nelmts > 0); - HDassert(tgath_buf); + assert(buf); + assert(iter); + assert(nelmts > 0); + assert(tgath_buf); /* Get info from API context */ if (H5CX_get_vec_size(&dxpl_vec_size) < 0) @@ -468,11 +468,11 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->mem_space); - HDassert(dset_info->file_space); - HDassert(dset_info->buf.vp); + assert(io_info); + assert(dset_info); + assert(dset_info->mem_space); + assert(dset_info->file_space); + assert(dset_info->buf.vp); /* Set buf pointer */ buf = dset_info->buf.vp; @@ -506,7 +506,7 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ size_t n; /* Elements operated on */ /* Go figure out how many elements to read from the file */ - HDassert(H5S_SELECT_ITER_NELMTS(file_iter) == (dset_info->nelmts - smine_start)); + assert(H5S_SELECT_ITER_NELMTS(file_iter) == (dset_info->nelmts - smine_start)); smine_nelmts = (size_t)MIN(dset_info->type_info.request_nelmts, (dset_info->nelmts - smine_start)); /* @@ -613,11 +613,11 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->mem_space); - HDassert(dset_info->file_space); - HDassert(dset_info->buf.vp); + assert(io_info); + assert(dset_info); + assert(dset_info->mem_space); + assert(dset_info->file_space); + assert(dset_info->buf.vp); /* Set buf pointer */ buf = dset_info->buf.cvp; @@ -652,7 +652,7 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset size_t n; /* Elements operated on */ /* Go figure out how many elements to read from the file */ - HDassert(H5S_SELECT_ITER_NELMTS(file_iter) == (dset_info->nelmts - smine_start)); + assert(H5S_SELECT_ITER_NELMTS(file_iter) == (dset_info->nelmts - smine_start)); smine_nelmts = (size_t)MIN(dset_info->type_info.request_nelmts, (dset_info->nelmts - smine_start)); /* @@ -755,13 +755,13 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(io_info->count > 0); - HDassert(io_info->mem_spaces || io_info->pieces_added == 0); - HDassert(io_info->file_spaces || io_info->pieces_added == 0); - HDassert(io_info->addrs || io_info->pieces_added == 0); - HDassert(io_info->element_sizes || io_info->pieces_added == 0); - HDassert(io_info->rbufs || io_info->pieces_added == 0); + assert(io_info); + assert(io_info->count > 0); + assert(io_info->mem_spaces || io_info->pieces_added == 0); + assert(io_info->file_spaces || io_info->pieces_added == 0); + assert(io_info->addrs || io_info->pieces_added == 0); + assert(io_info->element_sizes || io_info->pieces_added == 0); + assert(io_info->rbufs || io_info->pieces_added == 0); /* Allocate list of buffers (within the tconv buf) */ if (NULL == (tmp_bufs = H5MM_malloc(io_info->pieces_added * sizeof(void *)))) @@ -782,7 +782,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) for (i = 0; i < io_info->pieces_added; i++) { H5D_dset_io_info_t *dset_info = io_info->sel_pieces[i]->dset_info; - HDassert(io_info->sel_pieces[i]->piece_points > 0); + assert(io_info->sel_pieces[i]->piece_points > 0); /* Check if this piece is involved in type conversion */ if (dset_info->type_info.is_xform_noop && dset_info->type_info.is_conv_noop) { @@ -808,7 +808,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) tconv_bytes_used += io_info->sel_pieces[i]->piece_points * MAX(dset_info->type_info.src_type_size, dset_info->type_info.dst_type_size); - HDassert(tconv_bytes_used <= io_info->tconv_buf_size); + assert(tconv_bytes_used <= io_info->tconv_buf_size); } /* Fill background buffer here unless we will use H5D__compound_opt_read(). Must do this before @@ -816,18 +816,18 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) if (!H5D__SCATGATH_USE_CMPD_OPT_READ(dset_info, io_info->sel_pieces[i])) { /* Check for background buffer */ if (dset_info->type_info.need_bkg) { - HDassert(io_info->bkg_buf); + assert(io_info->bkg_buf); /* Calculate background buffer position */ tmp_bkg_buf = io_info->bkg_buf + bkg_bytes_used; bkg_bytes_used += io_info->sel_pieces[i]->piece_points * dset_info->type_info.dst_type_size; - HDassert(bkg_bytes_used <= io_info->bkg_buf_size); + assert(bkg_bytes_used <= io_info->bkg_buf_size); /* Gather data from read buffer to background buffer if necessary */ if (H5T_BKG_YES == dset_info->type_info.need_bkg) { /* Initialize memory iterator */ - HDassert(!mem_iter_init); + assert(!mem_iter_init); if (H5S_select_iter_init(mem_iter, io_info->mem_spaces[i], dset_info->type_info.dst_type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, @@ -841,7 +841,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "mem gather failed") /* Reset selection iterator */ - HDassert(mem_iter_init); + assert(mem_iter_init); if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") mem_iter_init = FALSE; @@ -864,14 +864,14 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) for (i = 0; i < io_info->pieces_added; i++) { H5D_dset_io_info_t *dset_info = io_info->sel_pieces[i]->dset_info; - HDassert(tmp_mem_spaces[i]); + assert(tmp_mem_spaces[i]); /* Check if this piece is involved in type conversion */ if (tmp_mem_spaces[i] != io_info->mem_spaces[i]) { H5_CHECK_OVERFLOW(io_info->sel_pieces[i]->piece_points, hsize_t, size_t); /* Initialize memory iterator */ - HDassert(!mem_iter_init); + assert(!mem_iter_init); if (H5S_select_iter_init(mem_iter, io_info->mem_spaces[i], dset_info->type_info.dst_type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, @@ -890,13 +890,13 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) else { /* Check for background buffer */ if (dset_info->type_info.need_bkg) { - HDassert(io_info->bkg_buf); + assert(io_info->bkg_buf); /* Calculate background buffer position */ tmp_bkg_buf = io_info->bkg_buf + bkg_bytes_used; bkg_bytes_used += io_info->sel_pieces[i]->piece_points * dset_info->type_info.dst_type_size; - HDassert(bkg_bytes_used <= io_info->bkg_buf_size); + assert(bkg_bytes_used <= io_info->bkg_buf_size); } /* @@ -930,7 +930,7 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) } /* Release selection iterator */ - HDassert(mem_iter_init); + assert(mem_iter_init); if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") mem_iter_init = FALSE; @@ -992,13 +992,13 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(io_info->count > 0); - HDassert(io_info->mem_spaces || io_info->pieces_added == 0); - HDassert(io_info->file_spaces || io_info->pieces_added == 0); - HDassert(io_info->addrs || io_info->pieces_added == 0); - HDassert(io_info->element_sizes || io_info->pieces_added == 0); - HDassert(io_info->wbufs || io_info->pieces_added == 0); + assert(io_info); + assert(io_info->count > 0); + assert(io_info->mem_spaces || io_info->pieces_added == 0); + assert(io_info->file_spaces || io_info->pieces_added == 0); + assert(io_info->addrs || io_info->pieces_added == 0); + assert(io_info->element_sizes || io_info->pieces_added == 0); + assert(io_info->wbufs || io_info->pieces_added == 0); /* Allocate list of buffers (within the tconv buf) */ if (NULL == (write_bufs = (const void **)H5MM_malloc(io_info->pieces_added * sizeof(const void *)))) @@ -1019,7 +1019,7 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) for (i = 0; i < io_info->pieces_added; i++) { H5D_dset_io_info_t *dset_info = io_info->sel_pieces[i]->dset_info; - HDassert(io_info->sel_pieces[i]->piece_points > 0); + assert(io_info->sel_pieces[i]->piece_points > 0); /* Check if this piece is involved in type conversion */ if (dset_info->type_info.is_xform_noop && dset_info->type_info.is_conv_noop) { @@ -1035,7 +1035,7 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) H5_CHECK_OVERFLOW(io_info->sel_pieces[i]->piece_points, hsize_t, size_t); /* Initialize memory iterator */ - HDassert(!mem_iter_init); + assert(!mem_iter_init); if (H5S_select_iter_init(mem_iter, io_info->mem_spaces[i], dset_info->type_info.src_type_size, 0) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, @@ -1064,7 +1064,7 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) tconv_bytes_used += io_info->sel_pieces[i]->piece_points * MAX(dset_info->type_info.src_type_size, dset_info->type_info.dst_type_size); - HDassert(tconv_bytes_used <= io_info->tconv_buf_size); + assert(tconv_bytes_used <= io_info->tconv_buf_size); /* Gather data from application buffer into the datatype conversion buffer */ if ((size_t)io_info->sel_pieces[i]->piece_points != @@ -1098,22 +1098,22 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) else { /* Check for background buffer */ if (dset_info->type_info.need_bkg) { - HDassert(io_info->bkg_buf); + assert(io_info->bkg_buf); /* Calculate background buffer position */ tmp_bkg_buf = io_info->bkg_buf + bkg_bytes_used; bkg_bytes_used += io_info->sel_pieces[i]->piece_points * dset_info->type_info.dst_type_size; - HDassert(bkg_bytes_used <= io_info->bkg_buf_size); + assert(bkg_bytes_used <= io_info->bkg_buf_size); } /* Set up background buffer read operation if necessary */ if (H5T_BKG_YES == dset_info->type_info.need_bkg) { - HDassert(io_info->must_fill_bkg); + assert(io_info->must_fill_bkg); /* Allocate arrays of parameters for selection read to background buffer if necessary */ if (!bkg_mem_spaces) { - HDassert(!bkg_file_spaces && !bkg_addrs && !bkg_element_sizes && !bkg_bufs); + assert(!bkg_file_spaces && !bkg_addrs && !bkg_element_sizes && !bkg_bufs); if (NULL == (bkg_mem_spaces = H5MM_malloc(io_info->pieces_added * sizeof(H5S_t *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for memory space list") @@ -1133,7 +1133,7 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) /* Use same (block) memory space, file space, address, and element size as write operation */ - HDassert(bkg_mem_spaces && bkg_file_spaces && bkg_addrs && bkg_element_sizes && bkg_bufs); + assert(bkg_mem_spaces && bkg_file_spaces && bkg_addrs && bkg_element_sizes && bkg_bufs); bkg_mem_spaces[bkg_pieces] = write_mem_spaces[i]; bkg_file_spaces[bkg_pieces] = io_info->file_spaces[i]; bkg_addrs[bkg_pieces] = io_info->addrs[i]; @@ -1175,14 +1175,14 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) } /* Release selection iterator */ - HDassert(mem_iter_init); + assert(mem_iter_init); if (H5S_SELECT_ITER_RELEASE(mem_iter) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") mem_iter_init = FALSE; } } - HDassert(spaces_added == io_info->pieces_added); + assert(spaces_added == io_info->pieces_added); /* Gather data to background buffer if necessary */ if (io_info->must_fill_bkg) { @@ -1224,7 +1224,7 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) /* * Perform datatype conversion. */ - HDassert(j < bkg_pieces); + assert(j < bkg_pieces); if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, dset_info->type_info.dst_type_id, (size_t)io_info->sel_pieces[i]->piece_points, (size_t)0, (size_t)0, @@ -1236,7 +1236,7 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) } } - HDassert(j == bkg_pieces); + assert(j == bkg_pieces); } /* Write data to disk */ @@ -1260,7 +1260,7 @@ done: /* Clear and free write_mem_spaces */ if (write_mem_spaces) { for (i = 0; i < spaces_added; i++) { - HDassert(write_mem_spaces[i]); + assert(write_mem_spaces[i]); if (write_mem_spaces[i] != io_info->mem_spaces[i] && H5S_close(write_mem_spaces[i]) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "Can't close dataspace") } @@ -1331,13 +1331,13 @@ H5D__compound_opt_read(size_t nelmts, H5S_sel_iter_t *iter, const H5D_type_info_ FUNC_ENTER_PACKAGE /* Check args */ - HDassert(nelmts > 0); - HDassert(iter); - HDassert(type_info); - HDassert(type_info->cmpd_subset); - HDassert(H5T_SUBSET_SRC == type_info->cmpd_subset->subset || - H5T_SUBSET_DST == type_info->cmpd_subset->subset); - HDassert(user_buf); + assert(nelmts > 0); + assert(iter); + assert(type_info); + assert(type_info->cmpd_subset); + assert(H5T_SUBSET_SRC == type_info->cmpd_subset->subset || + H5T_SUBSET_DST == type_info->cmpd_subset->subset); + assert(user_buf); /* Get info from API context */ if (H5CX_get_vec_size(&dxpl_vec_size) < 0) @@ -1455,8 +1455,8 @@ H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info, uint8_t FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(nelmts > 0); - HDassert(type_info); + assert(nelmts > 0); + assert(type_info); /* Initialize values for loop */ src_stride = type_info->src_type_size; |