From 7a44581a84778a1346a2fd5b6cca7d9db905a321 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Wed, 28 Jun 2023 07:31:56 -0700 Subject: Rename HDassert() to assert() (#3191) * Change HDassert to assert * Fix bin/make_err --- bin/make_err | 4 +- src/H5.c | 2 +- src/H5A.c | 24 +- src/H5AC.c | 230 ++++---- src/H5ACdbg.c | 32 +- src/H5ACmpio.c | 272 +++++----- src/H5ACproxy_entry.c | 56 +- src/H5Abtree2.c | 12 +- src/H5Adense.c | 108 ++-- src/H5Aint.c | 194 +++---- src/H5Atest.c | 2 +- src/H5B.c | 248 ++++----- src/H5B2.c | 100 ++-- src/H5B2cache.c | 134 ++--- src/H5B2dbg.c | 54 +- src/H5B2hdr.c | 60 +-- src/H5B2int.c | 98 ++-- src/H5B2internal.c | 114 ++-- src/H5B2leaf.c | 96 ++-- src/H5B2stat.c | 6 +- src/H5B2test.c | 26 +- src/H5Bcache.c | 32 +- src/H5Bdbg.c | 50 +- src/H5C.c | 116 ++-- src/H5CS.c | 20 +- src/H5CX.c | 316 +++++------ src/H5Cdbg.c | 102 ++-- src/H5Centry.c | 552 +++++++++---------- src/H5Cimage.c | 474 ++++++++--------- src/H5Cint.c | 420 +++++++-------- src/H5Clog.c | 84 +-- src/H5Clog_json.c | 128 ++--- src/H5Clog_trace.c | 108 ++-- src/H5Cmpio.c | 222 ++++---- src/H5Cpkg.h | 222 ++++---- src/H5Cprefetched.c | 20 +- src/H5Cprivate.h | 2 +- src/H5Cquery.c | 24 +- src/H5Ctag.c | 72 +-- src/H5Ctest.c | 4 +- src/H5D.c | 4 +- src/H5Dbtree.c | 258 ++++----- src/H5Dbtree2.c | 232 ++++---- src/H5Dchunk.c | 671 ++++++++++++----------- src/H5Dcompact.c | 42 +- src/H5Dcontig.c | 138 ++--- src/H5Dearray.c | 282 +++++----- src/H5Defl.c | 84 +-- src/H5Dfarray.c | 266 +++++----- src/H5Dfill.c | 44 +- src/H5Dint.c | 194 +++---- src/H5Dio.c | 58 +- src/H5Dlayout.c | 40 +- src/H5Dmpio.c | 226 ++++---- src/H5Dnone.c | 104 ++-- src/H5Doh.c | 26 +- src/H5Dscatgath.c | 162 +++--- src/H5Dselect.c | 28 +- src/H5Dsingle.c | 138 ++--- src/H5Dtest.c | 10 +- src/H5Dvirtual.c | 270 +++++----- src/H5E.c | 36 +- src/H5EA.c | 86 +-- src/H5EAcache.c | 234 ++++---- src/H5EAdbg.c | 66 +-- src/H5EAdblkpage.c | 18 +- src/H5EAdblock.c | 44 +- src/H5EAhdr.c | 68 +-- src/H5EAiblock.c | 30 +- src/H5EAint.c | 8 +- src/H5EAsblock.c | 34 +- src/H5EAstat.c | 4 +- src/H5EAtest.c | 36 +- src/H5ESevent.c | 8 +- src/H5ESint.c | 90 ++-- src/H5ESlist.c | 16 +- src/H5Eint.c | 50 +- src/H5F.c | 8 +- src/H5FA.c | 64 +-- src/H5FAcache.c | 134 ++--- src/H5FAdbg.c | 30 +- src/H5FAdblkpage.c | 16 +- src/H5FAdblock.c | 32 +- src/H5FAhdr.c | 44 +- src/H5FAint.c | 8 +- src/H5FAstat.c | 4 +- src/H5FAtest.c | 34 +- src/H5FD.c | 102 ++-- src/H5FDcore.c | 40 +- src/H5FDdirect.c | 50 +- src/H5FDfamily.c | 18 +- src/H5FDhdfs.c | 62 +-- src/H5FDint.c | 274 +++++----- src/H5FDlog.c | 66 +-- src/H5FDmirror.c | 100 ++-- src/H5FDmpi.c | 36 +- src/H5FDmpio.c | 164 +++--- src/H5FDonion.c | 52 +- src/H5FDonion_header.c | 16 +- src/H5FDonion_history.c | 20 +- src/H5FDonion_index.c | 92 ++-- src/H5FDros3.c | 56 +- src/H5FDs3comms.c | 62 +-- src/H5FDsec2.c | 26 +- src/H5FDspace.c | 52 +- src/H5FDsplitter.c | 94 ++-- src/H5FDsubfiling/H5FDioc.c | 48 +- src/H5FDsubfiling/H5FDioc_int.c | 26 +- src/H5FDsubfiling/H5FDioc_priv.h | 30 +- src/H5FDsubfiling/H5FDioc_threads.c | 122 ++--- src/H5FDsubfiling/H5FDsubfile_int.c | 16 +- src/H5FDsubfiling/H5FDsubfiling.c | 136 ++--- src/H5FDsubfiling/H5subfiling_common.c | 164 +++--- src/H5FL.c | 122 ++--- src/H5FO.c | 78 +-- src/H5FS.c | 100 ++-- src/H5FScache.c | 226 ++++---- src/H5FSdbg.c | 34 +- src/H5FSint.c | 8 +- src/H5FSsection.c | 306 +++++------ src/H5FSstat.c | 4 +- src/H5FStest.c | 8 +- src/H5Faccum.c | 40 +- src/H5Fcwfs.c | 22 +- src/H5Fdbg.c | 10 +- src/H5Fefc.c | 112 ++-- src/H5Fint.c | 190 +++---- src/H5Fio.c | 88 +-- src/H5Fmount.c | 44 +- src/H5Fmpi.c | 32 +- src/H5Fquery.c | 226 ++++---- src/H5Fsfile.c | 10 +- src/H5Fspace.c | 30 +- src/H5Fsuper.c | 98 ++-- src/H5Fsuper_cache.c | 112 ++-- src/H5Gbtree2.c | 10 +- src/H5Gcache.c | 32 +- src/H5Gcompact.c | 52 +- src/H5Gdense.c | 100 ++-- src/H5Gdeprec.c | 8 +- src/H5Gent.c | 44 +- src/H5Gint.c | 80 +-- src/H5Glink.c | 38 +- src/H5Gloc.c | 58 +- src/H5Gname.c | 86 +-- src/H5Gnode.c | 126 ++--- src/H5Gobj.c | 66 +-- src/H5Goh.c | 22 +- src/H5Groot.c | 30 +- src/H5Gstab.c | 76 +-- src/H5Gtest.c | 14 +- src/H5Gtraverse.c | 38 +- src/H5HF.c | 64 +-- src/H5HFbtree2.c | 20 +- src/H5HFcache.c | 462 ++++++++-------- src/H5HFdbg.c | 96 ++-- src/H5HFdblock.c | 60 +-- src/H5HFdtable.c | 18 +- src/H5HFhdr.c | 90 ++-- src/H5HFhuge.c | 84 +-- src/H5HFiblock.c | 158 +++--- src/H5HFiter.c | 56 +- src/H5HFman.c | 60 +-- src/H5HFsection.c | 557 ++++++++++--------- src/H5HFspace.c | 52 +- src/H5HFstat.c | 8 +- src/H5HFtest.c | 48 +- src/H5HFtiny.c | 40 +- src/H5HG.c | 74 +-- src/H5HGcache.c | 50 +- src/H5HGdbg.c | 10 +- src/H5HGquery.c | 6 +- src/H5HL.c | 102 ++-- src/H5HLcache.c | 130 ++--- src/H5HLdbg.c | 10 +- src/H5HLdblk.c | 16 +- src/H5HLint.c | 20 +- src/H5HLprfx.c | 4 +- src/H5Iint.c | 64 +-- src/H5Lexternal.c | 2 +- src/H5Lint.c | 124 ++--- src/H5M.c | 4 +- src/H5MF.c | 366 ++++++------- src/H5MFaggr.c | 126 ++--- src/H5MFdbg.c | 16 +- src/H5MFsection.c | 104 ++-- src/H5MM.c | 6 +- src/H5O.c | 2 +- src/H5Oainfo.c | 48 +- src/H5Oalloc.c | 173 +++--- src/H5Oattr.c | 54 +- src/H5Oattribute.c | 132 ++--- src/H5Obogus.c | 20 +- src/H5Obtreek.c | 24 +- src/H5Ocache.c | 180 +++---- src/H5Ocache_image.c | 30 +- src/H5Ochunk.c | 44 +- src/H5Ocont.c | 30 +- src/H5Ocopy.c | 150 +++--- src/H5Ocopy_ref.c | 16 +- src/H5Odbg.c | 101 ++-- src/H5Odeprec.c | 8 +- src/H5Odrvinfo.c | 30 +- src/H5Odtype.c | 98 ++-- src/H5Oefl.c | 42 +- src/H5Ofill.c | 68 +-- src/H5Oflush.c | 6 +- src/H5Ofsinfo.c | 28 +- src/H5Oginfo.c | 22 +- src/H5Oint.c | 206 +++---- src/H5Olayout.c | 54 +- src/H5Olinfo.c | 50 +- src/H5Olink.c | 66 +-- src/H5Omessage.c | 370 ++++++------- src/H5Omtime.c | 42 +- src/H5Oname.c | 28 +- src/H5Opkg.h | 4 +- src/H5Opline.c | 36 +- src/H5Orefcount.c | 28 +- src/H5Osdspace.c | 36 +- src/H5Oshared.c | 78 +-- src/H5Oshared.h | 15 +- src/H5Oshmesg.c | 24 +- src/H5Ostab.c | 42 +- src/H5Otest.c | 18 +- src/H5Ounknown.c | 2 +- src/H5P.c | 6 +- src/H5PB.c | 102 ++-- src/H5PLint.c | 10 +- src/H5PLpath.c | 62 +-- src/H5PLplugin_cache.c | 10 +- src/H5Pdapl.c | 78 +-- src/H5Pdcpl.c | 120 ++--- src/H5Pdeprec.c | 2 +- src/H5Pdxpl.c | 124 ++--- src/H5Pencdec.c | 68 +-- src/H5Pfapl.c | 170 +++--- src/H5Pfcpl.c | 40 +- src/H5Pint.c | 310 +++++------ src/H5Plapl.c | 42 +- src/H5Pocpl.c | 30 +- src/H5Pocpypl.c | 34 +- src/H5Pstrcpl.c | 10 +- src/H5RS.c | 56 +- src/H5Rdeprec.c | 16 +- src/H5Rint.c | 156 +++--- src/H5S.c | 84 +-- src/H5SL.c | 150 +++--- src/H5SM.c | 204 +++---- src/H5SMbtree2.c | 6 +- src/H5SMcache.c | 104 ++-- src/H5SMmessage.c | 24 +- src/H5SMtest.c | 4 +- src/H5Sall.c | 110 ++-- src/H5Shyper.c | 858 +++++++++++++++--------------- src/H5Smpio.c | 52 +- src/H5Snone.c | 108 ++-- src/H5Spoint.c | 158 +++--- src/H5Sselect.c | 194 +++---- src/H5Stest.c | 12 +- src/H5T.c | 232 ++++---- src/H5Tarray.c | 14 +- src/H5Tbit.c | 24 +- src/H5Tcommit.c | 48 +- src/H5Tcompound.c | 34 +- src/H5Tconv.c | 166 +++--- src/H5Tdbg.c | 6 +- src/H5Tenum.c | 26 +- src/H5Tfields.c | 30 +- src/H5Tfixed.c | 2 +- src/H5Tnative.c | 10 +- src/H5Toffset.c | 12 +- src/H5Toh.c | 10 +- src/H5Tprecis.c | 12 +- src/H5Tref.c | 130 ++--- src/H5Tvisit.c | 4 +- src/H5Tvlen.c | 82 +-- src/H5UC.c | 12 +- src/H5VLcallback.c | 218 ++++---- src/H5VLdyn_ops.c | 10 +- src/H5VLint.c | 122 ++--- src/H5VLnative.c | 22 +- src/H5VLnative_blob.c | 16 +- src/H5VLnative_dataset.c | 20 +- src/H5VLnative_file.c | 2 +- src/H5VLnative_introspect.c | 2 +- src/H5VLnative_token.c | 10 +- src/H5VM.c | 202 +++---- src/H5VMprivate.h | 8 +- src/H5WB.c | 20 +- src/H5Z.c | 72 +-- src/H5Zdeflate.c | 6 +- src/H5Zfletcher32.c | 2 +- src/H5Znbit.c | 22 +- src/H5Zscaleoffset.c | 26 +- src/H5Zshuffle.c | 4 +- src/H5Zszip.c | 20 +- src/H5Ztrans.c | 20 +- src/H5checksum.c | 20 +- src/H5dbg.c | 10 +- src/H5encode.h | 4 +- src/H5mpi.c | 10 +- src/H5private.h | 25 +- src/H5system.c | 26 +- src/H5timer.c | 12 +- src/H5trace.c | 8 +- test/API/tattr.c | 56 +- test/API/testhdf5.c | 10 +- test/API/tfile.c | 2 +- test/API/th5s.c | 16 +- test/API/tselect.c | 218 ++++---- test/API/tunicode.c | 4 +- test/API/tvltypes.c | 12 +- test/accum.c | 58 +- test/big.c | 2 +- test/btree2.c | 6 +- test/cache.c | 108 ++-- test/cache_common.c | 822 ++++++++++++++-------------- test/cache_common.h | 2 +- test/cache_image.c | 22 +- test/cmpd_dset.c | 4 +- test/dsets.c | 56 +- test/dt_arith.c | 70 +-- test/dtypes.c | 48 +- test/earray.c | 60 +-- test/farray.c | 30 +- test/fheap.c | 48 +- test/fillval.c | 8 +- test/freespace.c | 34 +- test/gen_cross.c | 4 +- test/gen_new_super.c | 10 +- test/gen_nullspace.c | 20 +- test/gen_plist.c | 12 +- test/genall5.c | 624 +++++++++++----------- test/gheap.c | 4 +- test/h5test.c | 30 +- test/links.c | 54 +- test/mf.c | 6 +- test/mirror_vfd.c | 12 +- test/objcopy.c | 10 +- test/objcopy_ref.c | 10 +- test/onion.c | 2 +- test/page_buffer.c | 18 +- test/s3comms.c | 30 +- test/swmr_addrem_writer.c | 4 +- test/swmr_common.c | 2 +- test/swmr_generator.c | 4 +- test/swmr_reader.c | 14 +- test/swmr_remove_reader.c | 14 +- test/swmr_remove_writer.c | 4 +- test/swmr_sparse_reader.c | 12 +- test/swmr_sparse_writer.c | 4 +- test/swmr_start_write.c | 6 +- test/swmr_writer.c | 4 +- test/tattr.c | 56 +- test/tfile.c | 2 +- test/th5s.c | 16 +- test/trefer_deprec.c | 4 +- test/tselect.c | 218 ++++---- test/ttsafe_cancel.c | 24 +- test/tunicode.c | 4 +- test/tvltypes.c | 12 +- test/vds.c | 28 +- test/vfd.c | 32 +- testpar/API/t_chunk_alloc.c | 4 +- testpar/API/t_dset.c | 10 +- testpar/API/t_file.c | 4 +- testpar/API/t_mdset.c | 4 +- testpar/API/t_shapesame.c | 122 ++--- testpar/API/t_span_tree.c | 54 +- testpar/t_2Gio.c | 10 +- testpar/t_cache.c | 426 +++++++-------- testpar/t_cache_image.c | 26 +- testpar/t_chunk_alloc.c | 4 +- testpar/t_dset.c | 10 +- testpar/t_file.c | 2 +- testpar/t_mdset.c | 4 +- testpar/t_pflush2.c | 2 +- testpar/t_pread.c | 8 +- testpar/t_shapesame.c | 122 ++--- testpar/t_span_tree.c | 54 +- testpar/t_subfiling_vfd.c | 6 +- testpar/t_vfd.c | 42 +- tools/lib/h5diff_array.c | 10 +- tools/lib/h5tools_dump.c | 64 +-- tools/lib/h5tools_str.c | 20 +- tools/lib/io_timer.c | 4 +- tools/libtest/h5tools_test_utils.c | 16 +- tools/src/h5perf/sio_engine.c | 16 +- tools/src/h5perf/sio_perf.c | 2 +- tools/src/h5repack/h5repack_copy.c | 6 +- tools/src/h5stat/h5stat.c | 10 +- tools/src/misc/h5debug.c | 18 +- tools/test/h5diff/h5diffgentest.c | 20 +- tools/test/h5dump/h5dumpgentest.c | 944 ++++++++++++++++----------------- tools/test/h5repack/h5repacktst.c | 36 +- tools/test/perform/iopipe.c | 32 +- utils/mirror_vfd/mirror_writer.c | 32 +- 398 files changed, 14985 insertions(+), 15007 deletions(-) diff --git a/bin/make_err b/bin/make_err index 31cb964..b5f80d3 100755 --- a/bin/make_err +++ b/bin/make_err @@ -243,7 +243,7 @@ sub create_init ($) { print HEADER "/* Major error codes */\n"; print HEADER "/*********************/\n\n"; foreach $name (keys %major) { - print HEADER " "x(0*$indent),"HDassert(${name}_g==(-1));\n"; + print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n"; print HEADER " "x(0*$indent),"if((msg = H5E__create_msg(cls, H5E_MAJOR, \"${major{$name}}\"))==NULL)\n"; print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\")\n"; print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n"; @@ -259,7 +259,7 @@ sub create_init ($) { # Iterate over all the minor errors in each section for $name ( @{$section_list{$sect_name}}) { - print HEADER " "x(0*$indent),"HDassert(${name}_g==(-1));\n"; + print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n"; print HEADER " "x(0*$indent),"if((msg = H5E__create_msg(cls, H5E_MINOR, \"${minor{$name}}\"))==NULL)\n"; print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\")\n"; print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0)\n"; diff --git a/src/H5.c b/src/H5.c index 12c162a..1e63387 100644 --- a/src/H5.c +++ b/src/H5.c @@ -1255,7 +1255,7 @@ H5is_library_terminating(hbool_t *is_terminating /*out*/) FUNC_ENTER_API_NOINIT H5TRACE1("e", "x", is_terminating); - HDassert(is_terminating); + assert(is_terminating); if (is_terminating) *is_terminating = H5_TERM_GLOBAL; diff --git a/src/H5A.c b/src/H5A.c index 439654b..b110be9 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -119,9 +119,9 @@ H5A__create_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(vol_obj); - HDassert(loc_params); - HDassert(attr_name); + assert(vol_obj); + assert(loc_params); + assert(attr_name); /* Create the attribute */ if (NULL == (attr = H5VL_attr_create(vol_obj, loc_params, attr_name, type_id, space_id, acpl_id, aapl_id, @@ -455,8 +455,8 @@ H5A__open_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const ch FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(vol_obj); - HDassert(loc_params); + assert(vol_obj); + assert(loc_params); /* Open the attribute */ if (NULL == @@ -1205,7 +1205,7 @@ H5Aget_create_plist(hid_t attr_id) FUNC_ENTER_API(H5I_INVALID_HID) H5TRACE1("i", "i", attr_id); - HDassert(H5P_LST_ATTRIBUTE_CREATE_ID_g != -1); + assert(H5P_LST_ATTRIBUTE_CREATE_ID_g != -1); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -1589,10 +1589,10 @@ H5A__rename_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(vol_obj); - HDassert(loc_params); - HDassert(old_name); - HDassert(new_name); + assert(vol_obj); + assert(loc_params); + assert(old_name); + assert(new_name); /* Avoid thrashing things if the names are the same */ if (HDstrcmp(old_name, new_name) != 0) { @@ -2332,8 +2332,8 @@ H5A__exists_common(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, const FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(vol_obj); - HDassert(loc_params); + assert(vol_obj); + assert(loc_params); /* Check arguments */ if (!attr_name || !*attr_name) diff --git a/src/H5AC.c b/src/H5AC.c index dcf7be2..2cae74f 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -207,8 +207,8 @@ H5AC_cache_image_pending(const H5F_t *f) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; ret_value = H5C_cache_image_pending(cache_ptr); @@ -246,11 +246,11 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(f); - HDassert(NULL == f->shared->cache); - HDassert(config_ptr != NULL); - HDassert(image_config_ptr != NULL); - HDassert(image_config_ptr->version == H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION); + assert(f); + assert(NULL == f->shared->cache); + assert(config_ptr != NULL); + assert(image_config_ptr != NULL); + assert(image_config_ptr->version == H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION); HDcompile_assert(NELMTS(H5AC_class_s) == H5AC_NTYPES); HDcompile_assert(H5C__MAX_NUM_TYPE_IDS == H5AC_NTYPES); @@ -426,9 +426,9 @@ H5AC_dest(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); #if H5AC_DUMP_STATS_ON_CLOSE /* Dump debugging info */ @@ -497,17 +497,17 @@ H5AC_dest(H5F_t *f) #ifdef H5_HAVE_PARALLEL if (aux_ptr != NULL) { if (aux_ptr->d_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->d_slist_ptr) == 0); + assert(H5SL_count(aux_ptr->d_slist_ptr) == 0); H5SL_close(aux_ptr->d_slist_ptr); } /* end if */ if (aux_ptr->c_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); + assert(H5SL_count(aux_ptr->c_slist_ptr) == 0); H5SL_close(aux_ptr->c_slist_ptr); } /* end if */ if (aux_ptr->candidate_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); + assert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); H5SL_close(aux_ptr->candidate_slist_ptr); } /* end if */ @@ -540,9 +540,9 @@ H5AC_evict(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); /* Evict all entries in the cache except the pinned superblock entry */ if (H5C_evict(f) < 0) @@ -579,12 +579,12 @@ H5AC_expunge_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, unsigned fl FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - HDassert(type); - HDassert(type->serialize); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->shared); + assert(f->shared->cache); + assert(type); + assert(type->serialize); + assert(H5_addr_defined(addr)); if (H5C_expunge_entry(f, type, addr, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed") @@ -625,9 +625,9 @@ H5AC_flush(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); #ifdef H5_HAVE_PARALLEL /* flushing the cache, so clear all collective entries */ @@ -742,13 +742,13 @@ H5AC_insert_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - HDassert(type); - HDassert(type->serialize); - HDassert(H5_addr_defined(addr)); - HDassert(thing); + assert(f); + assert(f->shared); + assert(f->shared->cache); + assert(type); + assert(type->serialize); + assert(H5_addr_defined(addr)); + assert(thing); /* Check for invalid access request */ if (0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) @@ -812,9 +812,9 @@ H5AC_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); if (H5C_load_cache_image_on_next_protect(f, addr, len, rw) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "call to H5C_load_cache_image_on_next_protect failed") @@ -846,7 +846,7 @@ H5AC_mark_entry_dirty(void *thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(thing); + assert(thing); /* Set up entry & cache pointers */ entry_ptr = (H5AC_info_t *)thing; @@ -900,7 +900,7 @@ H5AC_mark_entry_clean(void *thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(thing); + assert(thing); entry_ptr = (H5AC_info_t *)thing; cache_ptr = entry_ptr->cache_ptr; @@ -953,7 +953,7 @@ H5AC_mark_entry_unserialized(void *thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(thing); + assert(thing); /* Set up entry & cache pointers */ entry_ptr = (H5AC_info_t *)thing; @@ -995,7 +995,7 @@ H5AC_mark_entry_serialized(void *thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(thing); + assert(thing); entry_ptr = (H5AC_info_t *)thing; cache_ptr = entry_ptr->cache_ptr; @@ -1037,12 +1037,12 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared->cache); - HDassert(type); - HDassert(H5_addr_defined(old_addr)); - HDassert(H5_addr_defined(new_addr)); - HDassert(H5_addr_ne(old_addr, new_addr)); + assert(f); + assert(f->shared->cache); + assert(type); + assert(H5_addr_defined(old_addr)); + assert(H5_addr_defined(new_addr)); + assert(H5_addr_ne(old_addr, new_addr)); #ifdef H5_HAVE_PARALLEL /* Log moving the entry */ @@ -1093,11 +1093,11 @@ H5AC_pin_protected_entry(void *thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(thing); + assert(thing); entry_ptr = (H5AC_info_t *)thing; cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); /* Pin entry */ if (H5C_pin_protected_entry(thing) < 0) @@ -1139,9 +1139,9 @@ H5AC_prep_for_file_close(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); if (H5C_prep_for_file_close(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cache prep for file close failed") @@ -1181,9 +1181,9 @@ H5AC_prep_for_file_flush(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't enable skip list") @@ -1225,9 +1225,9 @@ H5AC_secure_from_file_flush(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); if (H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't disable skip list") @@ -1260,12 +1260,12 @@ H5AC_create_flush_dependency(void *parent_thing, void *child_thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(parent_thing); - HDassert(child_thing); + assert(parent_thing); + assert(child_thing); entry_ptr = (H5AC_info_t *)parent_thing; cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); /* Create the flush dependency */ if (H5C_create_flush_dependency(parent_thing, child_thing) < 0) @@ -1314,21 +1314,21 @@ H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata, unsi FUNC_ENTER_NOAPI(NULL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - HDassert(type); - HDassert(type->serialize); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->shared); + assert(f->shared->cache); + assert(type); + assert(type->serialize); + assert(H5_addr_defined(addr)); /* Check for unexpected flags -- H5C__FLUSH_COLLECTIVELY_FLAG * only permitted in the parallel case. */ #ifdef H5_HAVE_PARALLEL - HDassert(0 == (flags & - (unsigned)(~(H5C__READ_ONLY_FLAG | H5C__FLUSH_LAST_FLAG | H5C__FLUSH_COLLECTIVELY_FLAG)))); + assert(0 == (flags & + (unsigned)(~(H5C__READ_ONLY_FLAG | H5C__FLUSH_LAST_FLAG | H5C__FLUSH_COLLECTIVELY_FLAG)))); #else /* H5_HAVE_PARALLEL */ - HDassert(0 == (flags & (unsigned)(~(H5C__READ_ONLY_FLAG | H5C__FLUSH_LAST_FLAG)))); + assert(0 == (flags & (unsigned)(~(H5C__READ_ONLY_FLAG | H5C__FLUSH_LAST_FLAG)))); #endif /* H5_HAVE_PARALLEL */ /* Check for invalid access request */ @@ -1382,11 +1382,11 @@ H5AC_resize_entry(void *thing, size_t new_size) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(thing); + assert(thing); entry_ptr = (H5AC_info_t *)thing; cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); #ifdef H5_HAVE_PARALLEL /* Log the generation of dirty bytes of metadata iff: @@ -1479,11 +1479,11 @@ H5AC_unpin_entry(void *thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(thing); + assert(thing); entry_ptr = (H5AC_info_t *)thing; cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); /* Unpin the entry */ if (H5C_unpin_entry(thing) < 0) @@ -1521,12 +1521,12 @@ H5AC_destroy_flush_dependency(void *parent_thing, void *child_thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(parent_thing); - HDassert(child_thing); + assert(parent_thing); + assert(child_thing); entry_ptr = (H5AC_info_t *)parent_thing; cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); /* Destroy the flush dependency */ if (H5C_destroy_flush_dependency(parent_thing, child_thing) < 0) @@ -1593,16 +1593,16 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, un FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - HDassert(type); - HDassert(type->deserialize); - HDassert(type->image_len); - HDassert(H5_addr_defined(addr)); - HDassert(thing); - HDassert(((H5AC_info_t *)thing)->addr == addr); - HDassert(((H5AC_info_t *)thing)->type == type); + assert(f); + assert(f->shared); + assert(f->shared->cache); + assert(type); + assert(type->deserialize); + assert(type->image_len); + assert(H5_addr_defined(addr)); + assert(thing); + assert(((H5AC_info_t *)thing)->addr == addr); + assert(((H5AC_info_t *)thing)->type == type); dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) || (((H5AC_info_t *)thing)->dirtied)); @@ -1868,7 +1868,7 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, const H5AC_cache_config_t * FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache_ptr); + assert(cache_ptr); if (cache_ptr == NULL) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry") @@ -2094,9 +2094,9 @@ H5AC__check_if_write_permitted(const H5F_t #ifdef H5_HAVE_PARALLEL /* Sanity checks */ - HDassert(f != NULL); - HDassert(f->shared != NULL); - HDassert(f->shared->cache != NULL); + assert(f != NULL); + assert(f->shared != NULL); + assert(f->shared->cache != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache); if (aux_ptr != NULL) { if ((aux_ptr->mpi_rank == 0) || @@ -2199,9 +2199,9 @@ H5AC_ignore_tags(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); /* Set up a new metadata tag */ if (H5C_ignore_tags(f->shared->cache) < 0) @@ -2260,8 +2260,8 @@ H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Call cache-level function to re-tag entries with the COPIED tag */ if (H5C_retag_entries(f->shared->cache, H5AC__COPIED_TAG, metadata_tag) < 0) @@ -2294,8 +2294,8 @@ H5AC_flush_tagged_metadata(H5F_t *f, haddr_t metadata_tag) FUNC_ENTER_NOAPI(FAIL) /* Assertions */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Call cache level function to flush metadata entries with specified tag */ if (H5C_flush_tagged_entries(f, metadata_tag) < 0) @@ -2329,8 +2329,8 @@ H5AC_evict_tagged_metadata(H5F_t *f, haddr_t metadata_tag, hbool_t match_global) FUNC_ENTER_NOAPI(FAIL) /* Assertions */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Call cache level function to evict metadata entries with specified tag */ if (H5C_evict_tagged_entries(f, metadata_tag, match_global) < 0) @@ -2362,8 +2362,8 @@ H5AC_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flag FUNC_ENTER_NOAPI(FAIL) /* Assertions */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Call cache level function to expunge entries with specified tag and type id */ if (H5C_expunge_tag_type_metadata(f, tag, type_id, flags) < 0) @@ -2395,8 +2395,8 @@ H5AC_get_tag(const void *thing, haddr_t *tag) FUNC_ENTER_NOAPI(FAIL) /* Assertions */ - HDassert(thing); - HDassert(tag); + assert(thing); + assert(tag); /* Call cache level function to get the tag */ if (H5C_get_tag(thing, tag) < 0) @@ -2425,11 +2425,11 @@ H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - HDassert(H5_addr_defined(obj_addr)); - HDassert(action == H5AC__SET_CORK || action == H5AC__UNCORK || action == H5AC__GET_CORKED); + assert(f); + assert(f->shared); + assert(f->shared->cache); + assert(H5_addr_defined(obj_addr)); + assert(action == H5AC__SET_CORK || action == H5AC__UNCORK || action == H5AC__GET_CORKED); /* Skip the search on "tag_list" when there are no "corked" objects. * This is done to mitigate the slow down when closing objects. @@ -2437,7 +2437,7 @@ H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked) * in the future. */ if (action == H5AC__GET_CORKED) { - HDassert(corked); + assert(corked); if (H5C_get_num_objs_corked(f->shared->cache) == 0) { *corked = FALSE; HGOTO_DONE(SUCCEED) @@ -2510,9 +2510,9 @@ H5AC_get_entry_ring(const H5F_t *f, haddr_t addr, H5AC_ring_t *ring) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(ring); + assert(f); + assert(H5_addr_defined(addr)); + assert(ring); /* Retrieve the ring value for the entry at address */ if (H5C_get_entry_ring(f, addr, ring) < 0) @@ -2540,7 +2540,7 @@ H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring) { FUNC_ENTER_NOAPI_NOINIT_NOERR - /* Note: orig_ring can be NULL so don't check it with HDassert() */ + /* Note: orig_ring can be NULL so don't check it with assert() */ /* Get the current ring value and return that (if orig_ring is NOT null) */ if (orig_ring) @@ -2589,7 +2589,7 @@ H5AC_unsettle_entry_ring(void *_entry) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry); + assert(entry); /* Unsettle the entry's ring */ if (H5C_unsettle_entry_ring(entry) < 0) @@ -2663,9 +2663,9 @@ H5AC_remove_entry(void *_entry) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry); + assert(entry); cache = entry->cache_ptr; - HDassert(cache); + assert(cache); /* Remove the entry from the cache*/ if (H5C_remove_entry(entry) < 0) diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c index 55f0418..ead20c0 100644 --- a/src/H5ACdbg.c +++ b/src/H5ACdbg.c @@ -79,9 +79,9 @@ H5AC_stats(const H5F_t *f) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); /* at present, this can't fail */ (void)H5C_stats(f->shared->cache, H5F_OPEN_NAME(f), FALSE); @@ -112,9 +112,9 @@ H5AC_dump_cache(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); if (H5C_dump_cache(f->shared->cache, H5F_OPEN_NAME(f)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_dump_cache() failed.") @@ -173,8 +173,8 @@ H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr, void **entry_ptr_ptr) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; if (H5C_get_entry_ptr_from_addr(cache_ptr, addr, entry_ptr_ptr) < 0) @@ -220,8 +220,8 @@ H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr, haddr_t child_addr, FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; ret_value = H5C_flush_dependency_exists(cache_ptr, parent_addr, child_addr, fd_exists_ptr); @@ -269,8 +269,8 @@ H5AC_verify_entry_type(const H5F_t *f, haddr_t addr, const H5AC_class_t *expecte FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; if (H5C_verify_entry_type(cache_ptr, addr, expected_type, in_cache_ptr, type_ok_ptr) < 0) @@ -304,8 +304,8 @@ H5AC_get_serialization_in_progress(H5F_t *f) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; /* Set return value */ @@ -342,8 +342,8 @@ H5AC_cache_is_clean(const H5F_t *f, H5AC_ring_t inner_ring) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; ret_value = H5C_cache_is_clean(cache_ptr, inner_ring); diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 0ef5955..34c408a 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -143,9 +143,9 @@ H5AC__set_sync_point_done_callback(H5C_t *cache_ptr, H5AC_sync_point_done_cb_t s FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(cache_ptr); + assert(cache_ptr); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); + assert(aux_ptr != NULL); aux_ptr->sync_point_done = sync_point_done; @@ -174,9 +174,9 @@ H5AC__set_write_done_callback(H5C_t *cache_ptr, H5AC_write_done_cb_t write_done) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(cache_ptr); + assert(cache_ptr); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); + assert(aux_ptr != NULL); aux_ptr->write_done = write_done; @@ -211,11 +211,11 @@ H5AC_add_candidate(H5AC_t *cache_ptr, haddr_t addr) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); - HDassert(aux_ptr->candidate_slist_ptr != NULL); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + assert(aux_ptr->candidate_slist_ptr != NULL); /* Construct an entry for the supplied address, and insert * it into the candidate slist. @@ -272,16 +272,16 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, had FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->mpi_rank == 0); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); - HDassert(aux_ptr->candidate_slist_ptr != NULL); - HDassert(num_entries_ptr != NULL); - HDassert(*num_entries_ptr == 0); - HDassert(haddr_buf_ptr_ptr != NULL); - HDassert(*haddr_buf_ptr_ptr == NULL); + assert(aux_ptr != NULL); + assert(aux_ptr->mpi_rank == 0); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + assert(aux_ptr->candidate_slist_ptr != NULL); + assert(num_entries_ptr != NULL); + assert(*num_entries_ptr == 0); + assert(haddr_buf_ptr_ptr != NULL); + assert(*haddr_buf_ptr_ptr == NULL); /* First broadcast the number of entries in the list so that the * receivers can set up buffers to receive them. If there aren't @@ -303,8 +303,8 @@ H5AC__broadcast_candidate_list(H5AC_t *cache_ptr, unsigned *num_entries_ptr, had /* Push an error, but still participate in following MPI_Bcast */ HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't construct candidate buffer.") } - HDassert(chk_num_entries == num_entries); - HDassert(haddr_buf_ptr != NULL); + assert(chk_num_entries == num_entries); + assert(haddr_buf_ptr != NULL); /* Now broadcast the list of candidate entries */ buf_size = sizeof(haddr_t) * num_entries; @@ -351,8 +351,8 @@ H5AC__broadcast_clean_list_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_uda FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(slist_entry_ptr); - HDassert(udata); + assert(slist_entry_ptr); + assert(udata); /* Store the entry's address in the buffer */ addr = slist_entry_ptr->addr; @@ -404,11 +404,11 @@ H5AC__broadcast_clean_list(H5AC_t *cache_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->mpi_rank == 0); - HDassert(aux_ptr->c_slist_ptr != NULL); + assert(aux_ptr != NULL); + assert(aux_ptr->mpi_rank == 0); + assert(aux_ptr->c_slist_ptr != NULL); /* First broadcast the number of entries in the list so that the * receives can set up a buffer to receive them. If there aren't @@ -490,17 +490,17 @@ H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t H5_ATTR_NDEBUG_UNUS FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr != NULL); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); - HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE) || (aux_ptr->mpi_rank == 0)); - HDassert(aux_ptr->d_slist_ptr != NULL); - HDassert(aux_ptr->c_slist_ptr != NULL); - HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); - HDassert(aux_ptr->candidate_slist_ptr != NULL); - HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); - HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) || - (sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE)); + assert(cache_ptr != NULL); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + assert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE) || (aux_ptr->mpi_rank == 0)); + assert(aux_ptr->d_slist_ptr != NULL); + assert(aux_ptr->c_slist_ptr != NULL); + assert(H5SL_count(aux_ptr->c_slist_ptr) == 0); + assert(aux_ptr->candidate_slist_ptr != NULL); + assert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); + assert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) || + (sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_CACHE)); switch (sync_point_op) { case H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN: @@ -545,8 +545,8 @@ H5AC__copy_candidate_list_to_buffer_cb(void *_item, void H5_ATTR_UNUSED *_key, v FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(slist_entry_ptr); - HDassert(udata); + assert(slist_entry_ptr); + assert(udata); /* Store the entry's address in the buffer */ udata->addr_buf_ptr[udata->u] = slist_entry_ptr->addr; @@ -603,16 +603,16 @@ H5AC__copy_candidate_list_to_buffer(const H5AC_t *cache_ptr, unsigned *num_entri FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); - HDassert(aux_ptr->candidate_slist_ptr != NULL); - HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) > 0); - HDassert(num_entries_ptr != NULL); - HDassert(*num_entries_ptr == 0); - HDassert(haddr_buf_ptr_ptr != NULL); - HDassert(*haddr_buf_ptr_ptr == NULL); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + assert(aux_ptr->candidate_slist_ptr != NULL); + assert(H5SL_count(aux_ptr->candidate_slist_ptr) > 0); + assert(num_entries_ptr != NULL); + assert(*num_entries_ptr == 0); + assert(haddr_buf_ptr_ptr != NULL); + assert(*haddr_buf_ptr_ptr == NULL); num_entries = (unsigned)H5SL_count(aux_ptr->candidate_slist_ptr); @@ -674,15 +674,15 @@ H5AC__log_deleted_entry(const H5AC_info_t *entry_ptr) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(entry_ptr); + assert(entry_ptr); addr = entry_ptr->addr; cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->mpi_rank == 0); - HDassert(aux_ptr->d_slist_ptr != NULL); - HDassert(aux_ptr->c_slist_ptr != NULL); + assert(aux_ptr != NULL); + assert(aux_ptr->mpi_rank == 0); + assert(aux_ptr->d_slist_ptr != NULL); + assert(aux_ptr->c_slist_ptr != NULL); /* if the entry appears in the dirtied entry slist, remove it. */ if (NULL != (slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_remove(aux_ptr->d_slist_ptr, (void *)(&addr)))) @@ -726,20 +726,20 @@ H5AC__log_dirtied_entry(const H5AC_info_t *entry_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(entry_ptr); - HDassert(entry_ptr->is_dirty == FALSE); + assert(entry_ptr); + assert(entry_ptr->is_dirty == FALSE); cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); + assert(aux_ptr != NULL); if (aux_ptr->mpi_rank == 0) { H5AC_slist_entry_t *slist_entry_ptr; haddr_t addr = entry_ptr->addr; /* Sanity checks */ - HDassert(aux_ptr->d_slist_ptr != NULL); - HDassert(aux_ptr->c_slist_ptr != NULL); + assert(aux_ptr->d_slist_ptr != NULL); + assert(aux_ptr->c_slist_ptr != NULL); if (NULL == H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) { /* insert the address of the entry in the dirty entry list, and @@ -802,20 +802,20 @@ H5AC__log_cleaned_entry(const H5AC_info_t *entry_ptr) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(entry_ptr); - HDassert(entry_ptr->is_dirty == FALSE); + assert(entry_ptr); + assert(entry_ptr->is_dirty == FALSE); cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); + assert(aux_ptr != NULL); if (aux_ptr->mpi_rank == 0) { H5AC_slist_entry_t *slist_entry_ptr; haddr_t addr = entry_ptr->addr; /* Sanity checks */ - HDassert(aux_ptr->d_slist_ptr != NULL); - HDassert(aux_ptr->c_slist_ptr != NULL); + assert(aux_ptr->d_slist_ptr != NULL); + assert(aux_ptr->c_slist_ptr != NULL); /* Remove it from both the cleaned list and the dirtied list. */ if (NULL != @@ -865,11 +865,11 @@ H5AC__log_flushed_entry(H5C_t *cache_ptr, haddr_t addr, hbool_t was_dirty, unsig FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->mpi_rank == 0); - HDassert(aux_ptr->c_slist_ptr != NULL); + assert(aux_ptr != NULL); + assert(aux_ptr->mpi_rank == 0); + assert(aux_ptr->c_slist_ptr != NULL); /* Set local flags */ cleared = ((flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); @@ -931,17 +931,17 @@ H5AC__log_inserted_entry(const H5AC_info_t *entry_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(entry_ptr); + assert(entry_ptr); cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); + assert(aux_ptr != NULL); if (aux_ptr->mpi_rank == 0) { H5AC_slist_entry_t *slist_entry_ptr; - HDassert(aux_ptr->d_slist_ptr != NULL); - HDassert(aux_ptr->c_slist_ptr != NULL); + assert(aux_ptr->d_slist_ptr != NULL); + assert(aux_ptr->c_slist_ptr != NULL); /* Entry to insert should not be in dirty list currently */ if (NULL != H5SL_search(aux_ptr->d_slist_ptr, (const void *)(&entry_ptr->addr))) @@ -1031,12 +1031,12 @@ H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = (H5AC_t *)f->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); + assert(aux_ptr != NULL); /* get entry status, size, etc here */ if (H5C_get_entry_status(f, old_addr, &entry_size, &entry_in_cache, &entry_dirty, NULL, NULL, NULL, NULL, @@ -1048,8 +1048,8 @@ H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr) if (aux_ptr->mpi_rank == 0) { H5AC_slist_entry_t *slist_entry_ptr; - HDassert(aux_ptr->d_slist_ptr != NULL); - HDassert(aux_ptr->c_slist_ptr != NULL); + assert(aux_ptr->d_slist_ptr != NULL); + assert(aux_ptr->c_slist_ptr != NULL); /* if the entry appears in the cleaned entry slist, under its old * address, remove it. @@ -1072,7 +1072,7 @@ H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr) * list under its old address implies that it must have * been clean to start with. */ - HDassert(!entry_dirty); + assert(!entry_dirty); if (NULL == (slist_entry_ptr = H5FL_MALLOC(H5AC_slist_entry_t))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate dirty slist entry .") slist_entry_ptr->addr = new_addr; @@ -1210,12 +1210,12 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f != NULL); + assert(f != NULL); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); /* to prevent "messages from the future" we must synchronize all * processes before we write any entries. @@ -1227,7 +1227,7 @@ H5AC__propagate_and_apply_candidate_list(H5F_t *f) if (H5AC__broadcast_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't broadcast candidate slist.") - HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); + assert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); } /* end if */ else { if (H5AC__receive_candidate_list(cache_ptr, &num_candidates, &candidates_list_ptr) < 0) @@ -1372,17 +1372,17 @@ H5AC__propagate_flushed_and_still_clean_entries_list(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f != NULL); + assert(f != NULL); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); if (aux_ptr->mpi_rank == 0) { if (H5AC__broadcast_clean_list(cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't broadcast clean slist.") - HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); + assert(H5SL_count(aux_ptr->c_slist_ptr) == 0); } /* end if */ else if (H5AC__receive_and_apply_clean_list(f) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive and/or process clean slist broadcast.") @@ -1422,10 +1422,10 @@ H5AC__receive_haddr_list(MPI_Comm mpi_comm, unsigned *num_entries_ptr, haddr_t * FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(num_entries_ptr != NULL); - HDassert(*num_entries_ptr == 0); - HDassert(haddr_buf_ptr_ptr != NULL); - HDassert(*haddr_buf_ptr_ptr == NULL); + assert(num_entries_ptr != NULL); + assert(*num_entries_ptr == 0); + assert(haddr_buf_ptr_ptr != NULL); + assert(*haddr_buf_ptr_ptr == NULL); /* First receive the number of entries in the list so that we * can set up a buffer to receive them. If there aren't @@ -1494,12 +1494,12 @@ H5AC__receive_and_apply_clean_list(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f != NULL); + assert(f != NULL); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->mpi_rank != 0); + assert(aux_ptr != NULL); + assert(aux_ptr->mpi_rank != 0); /* Retrieve the clean list from process 0 */ if (H5AC__receive_haddr_list(aux_ptr->mpi_comm, &num_entries, &haddr_buf_ptr) < 0) @@ -1553,15 +1553,15 @@ H5AC__receive_candidate_list(const H5AC_t *cache_ptr, unsigned *num_entries_ptr, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->mpi_rank != 0); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); - HDassert(num_entries_ptr != NULL); - HDassert(*num_entries_ptr == 0); - HDassert(haddr_buf_ptr_ptr != NULL); - HDassert(*haddr_buf_ptr_ptr == NULL); + assert(aux_ptr != NULL); + assert(aux_ptr->mpi_rank != 0); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + assert(num_entries_ptr != NULL); + assert(*num_entries_ptr == 0); + assert(haddr_buf_ptr_ptr != NULL); + assert(*haddr_buf_ptr_ptr == NULL); /* Retrieve the candidate list from process 0 */ if (H5AC__receive_haddr_list(aux_ptr->mpi_comm, num_entries_ptr, haddr_buf_ptr_ptr) < 0) @@ -1633,12 +1633,12 @@ H5AC__rsp__dist_md_write__flush(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f != NULL); + assert(f != NULL); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); /* first construct the candidate list -- initially, this will be in the * form of a skip list. We will convert it later. @@ -1776,12 +1776,12 @@ H5AC__rsp__dist_md_write__flush_to_min_clean(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f != NULL); + assert(f != NULL); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); /* Query if evictions are allowed */ if (H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0) @@ -1854,12 +1854,12 @@ H5AC__rsp__p0_only__flush(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f != NULL); + assert(f != NULL); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); /* To prevent "messages from the future" we must * synchronize all processes before we start the flush. @@ -1964,12 +1964,12 @@ H5AC__rsp__p0_only__flush_to_min_clean(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f != NULL); + assert(f != NULL); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY); /* Query if evictions are allowed */ if (H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0) @@ -2077,13 +2077,13 @@ H5AC__run_sync_point(H5F_t *f, int sync_point_op) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f != NULL); + assert(f != NULL); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) || - (sync_point_op == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)); + assert(aux_ptr != NULL); + assert((sync_point_op == H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) || + (sync_point_op == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED)); #ifdef H5AC_DEBUG_DIRTY_BYTES_CREATION HDfprintf(stdout, "%d:%s...:%u: (u/uu/i/iu/m/mu) = %zu/%u/%zu/%u/%zu/%u\n", aux_ptr->mpi_rank, @@ -2207,13 +2207,13 @@ H5AC__tidy_cache_0_lists(H5AC_t *cache_ptr, unsigned num_candidates, haddr_t *ca FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr); - HDassert(aux_ptr != NULL); - HDassert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); - HDassert(aux_ptr->mpi_rank == 0); - HDassert(num_candidates > 0); - HDassert(candidates_list_ptr != NULL); + assert(aux_ptr != NULL); + assert(aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED); + assert(aux_ptr->mpi_rank == 0); + assert(num_candidates > 0); + assert(candidates_list_ptr != NULL); /* clean up dirtied and flushed and still clean lists by removing * all entries on the candidate list. Cleared entries should @@ -2266,8 +2266,8 @@ H5AC__flush_entries(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared->cache); + assert(f); + assert(f->shared->cache); /* Check if we have >1 ranks */ if (H5C_get_aux_ptr(f->shared->cache)) diff --git a/src/H5ACproxy_entry.c b/src/H5ACproxy_entry.c index 0af6450..4862c53 100644 --- a/src/H5ACproxy_entry.c +++ b/src/H5ACproxy_entry.c @@ -150,8 +150,8 @@ H5AC_proxy_entry_add_parent(H5AC_proxy_entry_t *pentry, void *_parent) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(parent); - HDassert(pentry); + assert(parent); + assert(pentry); /* Add parent to the list of parents */ if (NULL == pentry->parents) @@ -166,7 +166,7 @@ H5AC_proxy_entry_add_parent(H5AC_proxy_entry_t *pentry, void *_parent) /* Add flush dependency on parent */ if (pentry->nchildren > 0) { /* Sanity check */ - HDassert(H5_addr_defined(pentry->addr)); + assert(H5_addr_defined(pentry->addr)); if (H5AC_create_flush_dependency(parent, pentry) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "unable to set flush dependency on proxy entry") @@ -198,9 +198,9 @@ H5AC_proxy_entry_remove_parent(H5AC_proxy_entry_t *pentry, void *_parent) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(pentry); - HDassert(pentry->parents); - HDassert(parent); + assert(pentry); + assert(pentry->parents); + assert(parent); /* Remove parent from skip list */ if (NULL == (rem_parent = (H5AC_info_t *)H5SL_remove(pentry->parents, &parent->addr))) @@ -211,7 +211,7 @@ H5AC_proxy_entry_remove_parent(H5AC_proxy_entry_t *pentry, void *_parent) /* Shut down the skip list, if this is the last parent */ if (0 == H5SL_count(pentry->parents)) { /* Sanity check */ - HDassert(0 == pentry->nchildren); + assert(0 == pentry->nchildren); if (H5SL_close(pentry->parents) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CLOSEERROR, FAIL, "can't close proxy parent skip list") @@ -279,8 +279,8 @@ H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, void *child) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(pentry); - HDassert(child); + assert(pentry); + assert(child); /* Check for first child */ if (0 == pentry->nchildren) { @@ -372,8 +372,8 @@ H5AC_proxy_entry_remove_child(H5AC_proxy_entry_t *pentry, void *child) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(pentry); - HDassert(child); + assert(pentry); + assert(child); /* Remove flush dependency on proxy entry */ if (H5AC_destroy_flush_dependency(pentry, child) < 0) @@ -423,11 +423,11 @@ H5AC_proxy_entry_dest(H5AC_proxy_entry_t *pentry) FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(pentry); - HDassert(NULL == pentry->parents); - HDassert(0 == pentry->nchildren); - HDassert(0 == pentry->ndirty_children); - HDassert(0 == pentry->nunser_children); + assert(pentry); + assert(NULL == pentry->parents); + assert(0 == pentry->nchildren); + assert(0 == pentry->ndirty_children); + assert(0 == pentry->nunser_children); /* Free the proxy entry object */ pentry = H5FL_FREE(H5AC_proxy_entry_t, pentry); @@ -453,7 +453,7 @@ H5AC__proxy_entry_image_len(const void H5_ATTR_UNUSED *thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image_len); + assert(image_len); /* Set the image length size to 1 byte */ *image_len = 1; @@ -482,7 +482,7 @@ H5AC__proxy_entry_serialize(const H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED * FUNC_ENTER_PACKAGE_NOERR /* Yes, even though this pushes an error on the stack */ /* Should never be invoked */ - HDassert(0 && "Invalid callback?!?"); + assert(0 && "Invalid callback?!?"); HERROR(H5E_CACHE, H5E_CANTSERIALIZE, "called unreachable fcn."); @@ -510,7 +510,7 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(pentry); + assert(pentry); switch (action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: @@ -520,7 +520,7 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "invalid notify action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Invalid action?!?"); + assert(0 && "Invalid action?!?"); #endif /* NDEBUG */ break; @@ -528,28 +528,28 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "invalid notify action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Invalid action?!?"); + assert(0 && "Invalid action?!?"); #endif /* NDEBUG */ break; case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Sanity checks */ - HDassert(0 == pentry->ndirty_children); - HDassert(0 == pentry->nunser_children); + assert(0 == pentry->ndirty_children); + assert(0 == pentry->nunser_children); /* No action */ break; case H5AC_NOTIFY_ACTION_ENTRY_DIRTIED: /* Sanity checks */ - HDassert(pentry->ndirty_children > 0); + assert(pentry->ndirty_children > 0); /* No action */ break; case H5AC_NOTIFY_ACTION_ENTRY_CLEANED: /* Sanity checks */ - HDassert(0 == pentry->ndirty_children); + assert(0 == pentry->ndirty_children); /* No action */ break; @@ -566,7 +566,7 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_CHILD_CLEANED: /* Sanity check */ - HDassert(pentry->ndirty_children > 0); + assert(pentry->ndirty_children > 0); /* Decrement # of dirty children */ pentry->ndirty_children--; @@ -589,7 +589,7 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_CHILD_SERIALIZED: /* Sanity check */ - HDassert(pentry->nunser_children > 0); + assert(pentry->nunser_children > 0); /* Decrement # of unserialized children */ pentry->nunser_children--; @@ -604,7 +604,7 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unknown notify action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c index 18518fd..9dde3ef 100644 --- a/src/H5Abtree2.c +++ b/src/H5Abtree2.c @@ -237,8 +237,8 @@ H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(bt2_udata); - HDassert(bt2_rec); + assert(bt2_udata); + assert(bt2_rec); /* Check hash value */ if (bt2_udata->name_hash < bt2_rec->hash) @@ -250,7 +250,7 @@ H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int H5HF_t *fheap; /* Fractal heap handle to use for finding object */ /* Sanity check */ - HDassert(bt2_udata->name_hash == bt2_rec->hash); + assert(bt2_udata->name_hash == bt2_rec->hash); /* Prepare user data for callback */ /* down */ @@ -268,7 +268,7 @@ H5A__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int fheap = bt2_udata->shared_fheap; else fheap = bt2_udata->fheap; - HDassert(fheap); + assert(fheap); /* Check if the user's attribute and the B-tree's attribute have the same name */ if (H5HF_op(fheap, &bt2_rec->id, H5A__dense_fh_name_cmp, &fh_udata) < 0) @@ -421,8 +421,8 @@ H5A__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, i FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(bt2_udata); - HDassert(bt2_rec); + assert(bt2_udata); + assert(bt2_rec); /* Check creation order value */ if (bt2_udata->corder < bt2_rec->corder) diff --git a/src/H5Adense.c b/src/H5Adense.c index 5397a11..c4f5c1a 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -177,8 +177,8 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); + assert(f); + assert(ainfo); /* Set fractal heap creation parameters */ /* XXX: Give some control of these to applications? */ @@ -206,7 +206,7 @@ H5A__dense_create(H5F_t *f, H5O_ainfo_t *ainfo) /* Retrieve the heap's ID length in the file */ if (H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") - HDassert(fheap_id_len == H5O_FHEAP_ID_LEN); + assert(fheap_id_len == H5O_FHEAP_ID_LEN); } #endif /* NDEBUG */ @@ -279,9 +279,9 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(attr); - HDassert(user_attr); - HDassert(took_ownership); + assert(attr); + assert(user_attr); + assert(took_ownership); /* * If there is an attribute already stored in "user_attr", @@ -343,9 +343,9 @@ H5A__dense_open(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); - HDassert(name); + assert(f); + assert(ainfo); + assert(name); /* Open the fractal heap */ if (NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) @@ -434,9 +434,9 @@ H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); - HDassert(attr); + assert(f); + assert(ainfo); + assert(attr); /* Check if attributes are shared in this file */ if ((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) @@ -459,7 +459,7 @@ H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") /* Attributes can't be "unique be shareable" yet */ - HDassert(!(mesg_flags & H5O_MSG_FLAG_SHAREABLE)); + assert(!(mesg_flags & H5O_MSG_FLAG_SHAREABLE)); } /* end else */ /* Retrieve the address of the shared message's fractal heap */ @@ -481,7 +481,7 @@ H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) /* Check for inserting shared attribute */ if (mesg_flags & H5O_MSG_FLAG_SHARED) { /* Sanity check */ - HDassert(attr_sharable); + assert(attr_sharable); /* Use heap ID for shared message heap */ udata.id = attr->sh_loc.u.heap_id; @@ -535,7 +535,7 @@ H5A__dense_insert(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) /* Check if we should create a creation order index v2 B-tree record */ if (ainfo->index_corder) { /* Open the creation order index v2 B-tree */ - HDassert(H5_addr_defined(ainfo->corder_bt2_addr)); + assert(H5_addr_defined(ainfo->corder_bt2_addr)); if (NULL == (bt2_corder = H5B2_open(f, ainfo->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") @@ -582,8 +582,8 @@ H5A__dense_write_bt2_cb2(void *_record, void *_op_data, hbool_t *changed) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(record); - HDassert(new_heap_id); + assert(record); + assert(new_heap_id); /* Update record's heap ID */ record->id = *new_heap_id; @@ -619,8 +619,8 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(record); - HDassert(op_data); + assert(record); + assert(op_data); /* Check for modifying shared attribute */ if (record->flags & H5O_MSG_FLAG_SHARED) { @@ -687,7 +687,7 @@ H5A__dense_write_bt2_cb(void *_record, void *_op_data, hbool_t *changed) if (H5HF_get_obj_len(op_data->fheap, &record->id, &obj_len) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGETSIZE, FAIL, "can't get object size") - HDassert(obj_len == attr_size); + assert(obj_len == attr_size); } #endif /* NDEBUG */ /* Update existing attribute in heap */ @@ -732,11 +732,11 @@ H5A__dense_write(H5F_t *f, const H5O_ainfo_t *ainfo, H5A_t *attr) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); - HDassert(H5_addr_defined(ainfo->fheap_addr)); - HDassert(H5_addr_defined(ainfo->name_bt2_addr)); - HDassert(attr); + assert(f); + assert(ainfo); + assert(H5_addr_defined(ainfo->fheap_addr)); + assert(H5_addr_defined(ainfo->name_bt2_addr)); + assert(attr); /* Check if attributes are shared in this file */ if ((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) @@ -872,10 +872,10 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); - HDassert(old_name); - HDassert(new_name); + assert(f); + assert(ainfo); + assert(old_name); + assert(new_name); /* Check if attributes are shared in this file */ if ((attr_sharable = H5SM_type_shared(f, H5O_ATTR_ID)) < 0) @@ -922,7 +922,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't search for attribute in name index") if (attr_exists == FALSE) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute in name index") - HDassert(attr_copy); + assert(attr_copy); /* Check if message is already shared */ if ((shared_mesg = H5O_msg_is_shared(H5O_ATTR_ID, attr_copy)) < 0) @@ -946,7 +946,7 @@ H5A__dense_rename(H5F_t *f, const H5O_ainfo_t *ainfo, const char *old_name, cons hbool_t corder_attr_exists; /* Attribute exists in v2 B-tree */ /* Open the creation order index v2 B-tree */ - HDassert(H5_addr_defined(ainfo->corder_bt2_addr)); + assert(H5_addr_defined(ainfo->corder_bt2_addr)); if (NULL == (bt2_corder = H5B2_open(f, ainfo->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation index") @@ -1099,7 +1099,7 @@ H5A__dense_iterate_bt2_cb(const void *_record, void *_bt2_udata) break; default: - HDassert("unknown attribute op type" && 0); + assert("unknown attribute op type" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unsupported attribute op type") #endif /* NDEBUG */ @@ -1148,11 +1148,11 @@ H5A__dense_iterate(H5F_t *f, hid_t loc_id, const H5O_ainfo_t *ainfo, H5_index_t FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); - HDassert(H5_addr_defined(ainfo->fheap_addr)); - HDassert(H5_addr_defined(ainfo->name_bt2_addr)); - HDassert(attr_op); + assert(f); + assert(ainfo); + assert(H5_addr_defined(ainfo->fheap_addr)); + assert(H5_addr_defined(ainfo->name_bt2_addr)); + assert(attr_op); /* Determine the address of the index to use */ if (idx_type == H5_INDEX_NAME) { @@ -1161,14 +1161,14 @@ H5A__dense_iterate(H5F_t *f, hid_t loc_id, const H5O_ainfo_t *ainfo, H5_index_t * table and sorting it. */ if (order == H5_ITER_NATIVE) { - HDassert(H5_addr_defined(ainfo->name_bt2_addr)); + assert(H5_addr_defined(ainfo->name_bt2_addr)); bt2_addr = ainfo->name_bt2_addr; } /* end if */ else bt2_addr = HADDR_UNDEF; } /* end if */ else { - HDassert(idx_type == H5_INDEX_CRT_ORDER); + assert(idx_type == H5_INDEX_CRT_ORDER); /* This address may not be defined if creation order is tracked, but * there's no index on it. If there's no v2 B-tree that indexes @@ -1343,9 +1343,9 @@ H5A__dense_remove(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); - HDassert(name && *name); + assert(f); + assert(ainfo); + assert(name && *name); /* Open the fractal heap */ if (NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) @@ -1445,7 +1445,7 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Call fractal heap 'op' routine, to make copy of attribute to remove */ if (H5HF_op(fheap, &record->id, H5A__dense_copy_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPERATE, FAIL, "attribute removal callback failed") - HDassert(fh_udata.attr); + assert(fh_udata.attr); /* Use the attribute's shared location */ use_sh_loc = FALSE; @@ -1468,7 +1468,7 @@ H5A__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) other_bt2_udata.corder = fh_udata.attr->shared->crt_idx; } /* end if */ else { - HDassert(bt2_udata->idx_type == H5_INDEX_CRT_ORDER); + assert(bt2_udata->idx_type == H5_INDEX_CRT_ORDER); /* Set up the user data for the v2 B-tree 'record remove' callback */ other_bt2_udata.f = bt2_udata->f; @@ -1555,8 +1555,8 @@ H5A__dense_remove_by_idx(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); + assert(f); + assert(ainfo); /* Determine the address of the index to use */ if (idx_type == H5_INDEX_NAME) { @@ -1566,13 +1566,13 @@ H5A__dense_remove_by_idx(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type */ if (order == H5_ITER_NATIVE) { bt2_addr = ainfo->name_bt2_addr; - HDassert(H5_addr_defined(bt2_addr)); + assert(H5_addr_defined(bt2_addr)); } /* end if */ else bt2_addr = HADDR_UNDEF; } /* end if */ else { - HDassert(idx_type == H5_INDEX_CRT_ORDER); + assert(idx_type == H5_INDEX_CRT_ORDER); /* This address may not be defined if creation order is tracked, but * there's no index on it. If there's no v2 B-tree that indexes @@ -1680,10 +1680,10 @@ H5A__dense_exists(H5F_t *f, const H5O_ainfo_t *ainfo, const char *name, hbool_t FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); - HDassert(name); - HDassert(attr_exists); + assert(f); + assert(ainfo); + assert(name); + assert(attr_exists); /* Open the fractal heap */ if (NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) @@ -1825,8 +1825,8 @@ H5A__dense_delete(H5F_t *f, H5O_ainfo_t *ainfo) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(ainfo); + assert(f); + assert(ainfo); /* Open the fractal heap */ if (NULL == (fheap = H5HF_open(f, ainfo->fheap_addr))) diff --git a/src/H5Aint.c b/src/H5Aint.c index 0803ebe..97f9ad7 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -222,7 +222,7 @@ H5A_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(0 == H5I_nmembers(H5I_ATTR)); + assert(0 == H5I_nmembers(H5I_ATTR)); /* Destroy the attribute object id group */ n += (H5I_dec_type_ref(H5I_ATTR) > 0); @@ -254,10 +254,10 @@ H5A__create(const H5G_loc_t *loc, const char *attr_name, const H5T_t *type, cons FUNC_ENTER_PACKAGE_TAG(loc->oloc->addr) /* Check args */ - HDassert(loc); - HDassert(attr_name); - HDassert(type); - HDassert(space); + assert(loc); + assert(attr_name); + assert(type); + assert(space); /* Check for existing attribute with same name */ /* (technically, the "attribute create" operation will fail for a duplicated @@ -286,7 +286,7 @@ H5A__create(const H5G_loc_t *loc, const char *attr_name, const H5T_t *type, cons HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, NULL, "can't allocate shared attr structure") /* If the creation property list is H5P_ATTRIBUTE_CREATE_DEFAULT, use the default character encoding */ - HDassert(acpl_id != H5P_DEFAULT); + assert(acpl_id != H5P_DEFAULT); if (acpl_id == H5P_ATTRIBUTE_CREATE_DEFAULT) attr->shared->encoding = H5F_DEFAULT_CSET; else { @@ -364,8 +364,8 @@ H5A__create(const H5G_loc_t *loc, const char *attr_name, const H5T_t *type, cons HGOTO_ERROR(H5E_ATTR, H5E_CANTCOUNT, NULL, "dataspace is invalid") H5_CHECKED_ASSIGN(nelmts, size_t, snelmts, hssize_t); - HDassert(attr->shared->dt_size > 0); - HDassert(attr->shared->ds_size > 0); + assert(attr->shared->dt_size > 0); + assert(attr->shared->ds_size > 0); attr->shared->data_size = nelmts * H5T_GET_SIZE(attr->shared->dt); /* Hold the symbol table entry (and file) open */ @@ -418,9 +418,9 @@ H5A__create_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr FUNC_ENTER_PACKAGE /* check args */ - HDassert(loc); - HDassert(obj_name); - HDassert(attr_name); + assert(loc); + assert(obj_name); + assert(attr_name); /* Set up opened group location to fill in */ obj_loc.oloc = &obj_oloc; @@ -477,8 +477,8 @@ H5A__open_common(const H5G_loc_t *loc, H5A_t *attr) FUNC_ENTER_PACKAGE /* check args */ - HDassert(loc); - HDassert(attr); + assert(loc); + assert(attr); #if defined(H5_USING_MEMCHECKER) || !defined(NDEBUG) /* Clear object location */ @@ -528,8 +528,8 @@ H5A__open(const H5G_loc_t *loc, const char *attr_name) FUNC_ENTER_PACKAGE /* check args */ - HDassert(loc); - HDassert(attr_name); + assert(loc); + assert(attr_name); /* Read in attribute from object header */ if (NULL == (attr = H5O__attr_open_by_name(loc->oloc, attr_name))) @@ -578,8 +578,8 @@ H5A__open_by_idx(const H5G_loc_t *loc, const char *obj_name, H5_index_t idx_type FUNC_ENTER_PACKAGE /* check args */ - HDassert(loc); - HDassert(obj_name); + assert(loc); + assert(obj_name); /* Set up opened group location to fill in */ obj_loc.oloc = &obj_oloc; @@ -640,9 +640,9 @@ H5A__open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_n FUNC_ENTER_PACKAGE /* check args */ - HDassert(loc); - HDassert(obj_name); - HDassert(attr_name); + assert(loc); + assert(obj_name); + assert(attr_name); /* Set up opened group location to fill in */ obj_loc.oloc = &obj_oloc; @@ -710,9 +710,9 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) FUNC_ENTER_PACKAGE_TAG(attr->oloc.addr) - HDassert(attr); - HDassert(mem_type); - HDassert(buf); + assert(attr); + assert(mem_type); + assert(buf); /* Patch the top level file pointer in attr->shared->dt->shared->u.vlen.f if needed */ if (H5T_patch_vlen_file(attr->shared->dt, H5F_VOL_OBJ(attr->oloc.file)) < 0) @@ -765,7 +765,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) /* Copy the application buffer into the background buffer if necessary */ if (need_bkg == H5T_BKG_YES) { - HDassert(buf_size >= (dst_type_size * nelmts)); + assert(buf_size >= (dst_type_size * nelmts)); H5MM_memcpy(bkg_buf, buf, dst_type_size * nelmts); } } @@ -779,7 +779,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) } /* end if */ /* No type conversion necessary */ else { - HDassert(dst_type_size == src_type_size); + assert(dst_type_size == src_type_size); /* Copy the attribute data into the user's buffer */ H5MM_memcpy(buf, attr->shared->data, (dst_type_size * nelmts)); @@ -832,9 +832,9 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) FUNC_ENTER_PACKAGE_TAG(attr->oloc.addr) - HDassert(attr); - HDassert(mem_type); - HDassert(buf); + assert(attr); + assert(mem_type); + assert(buf); /* Patch the top level file pointer in attr->shared->dt->shared->u.vlen.f if needed */ if (H5T_patch_vlen_file(attr->shared->dt, H5F_VOL_OBJ(attr->oloc.file)) < 0) @@ -909,7 +909,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) } /* end if */ /* No type conversion necessary */ else { - HDassert(dst_type_size == src_type_size); + assert(dst_type_size == src_type_size); /* Allocate the attribute buffer, if there isn't one */ if (attr->shared->data == NULL) @@ -963,8 +963,8 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf, size_t *attr_name_len) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(attr); - HDassert(attr_name_len); + assert(attr); + assert(attr_name_len); /* Get the real attribute length */ nbytes = HDstrlen(attr->shared->name); @@ -1005,7 +1005,7 @@ H5A_get_space(H5A_t *attr) FUNC_ENTER_NOAPI_NOINIT - HDassert(attr); + assert(attr); /* Copy the attribute's dataspace */ if (NULL == (ds = H5S_copy(attr->shared->ds, FALSE, TRUE))) @@ -1040,7 +1040,7 @@ H5A__get_type(H5A_t *attr) FUNC_ENTER_PACKAGE - HDassert(attr); + assert(attr); /* Patch the datatype's "top level" file pointer */ if (H5T_patch_file(attr->shared->dt, attr->oloc.file) < 0) @@ -1146,8 +1146,8 @@ H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo) FUNC_ENTER_NOAPI_NOERR /* Check args */ - HDassert(attr); - HDassert(ainfo); + assert(attr); + assert(ainfo); /* Set info for attribute */ ainfo->cset = attr->shared->encoding; @@ -1187,7 +1187,7 @@ H5A__copy(H5A_t *_new_attr, const H5A_t *old_attr) FUNC_ENTER_PACKAGE /* check args */ - HDassert(old_attr); + assert(old_attr); /* Allocate attribute structure */ if (_new_attr == NULL) { @@ -1247,8 +1247,8 @@ H5A__shared_free(H5A_t *attr) FUNC_ENTER_PACKAGE - HDassert(attr); - HDassert(attr->shared); + assert(attr); + assert(attr->shared); /* Free dynamically allocated items. * When possible, keep trying to shut things down (via HDONE_ERROR). @@ -1293,7 +1293,7 @@ H5A__close_cb(H5VL_object_t *attr_vol_obj, void **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(attr_vol_obj); + assert(attr_vol_obj); /* Close the attribute */ if (H5VL_attr_close(attr_vol_obj, H5P_DATASET_XFER_DEFAULT, request) < 0) @@ -1326,8 +1326,8 @@ H5A__close(H5A_t *attr) FUNC_ENTER_PACKAGE - HDassert(attr); - HDassert(attr->shared); + assert(attr); + assert(attr->shared); /* Close the object's symbol-table entry */ if (attr->obj_opened && (H5O_close(&(attr->oloc), NULL) < 0)) @@ -1379,7 +1379,7 @@ H5A_oloc(H5A_t *attr) FUNC_ENTER_NOAPI_NOERR - HDassert(attr); + assert(attr); /* Set return value */ ret_value = &(attr->oloc); @@ -1409,7 +1409,7 @@ H5A_nameof(H5A_t *attr) FUNC_ENTER_NOAPI_NOERR - HDassert(attr); + assert(attr); /* Set return value */ ret_value = &(attr->path); @@ -1437,7 +1437,7 @@ H5A_type(const H5A_t *attr) FUNC_ENTER_NOAPI_NOERR - HDassert(attr); + assert(attr); /* Set return value */ ret_value = attr->shared->dt; @@ -1469,9 +1469,9 @@ H5A__exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(obj_name); - HDassert(attr_name); - HDassert(attr_exists); + assert(obj_name); + assert(attr_name); + assert(attr_exists); /* Set up opened group location to fill in */ obj_loc.oloc = &obj_oloc; @@ -1522,7 +1522,7 @@ H5A__compact_build_table_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg /*in,out* FUNC_ENTER_PACKAGE /* check args */ - HDassert(mesg); + assert(mesg); /* Re-allocate the table if necessary */ if (udata->curr_attr == udata->atable->nattrs) { @@ -1581,9 +1581,9 @@ H5A__compact_build_table(H5F_t *f, H5O_t *oh, H5_index_t idx_type, H5_iter_order FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(oh); - HDassert(atable); + assert(f); + assert(oh); + assert(atable); /* Initialize table */ atable->attrs = NULL; @@ -1639,9 +1639,9 @@ H5A__dense_build_table_cb(const H5A_t *attr, void *_udata) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(attr); - HDassert(udata); - HDassert(udata->curr_attr < udata->atable->nattrs); + assert(attr); + assert(udata); + assert(udata->curr_attr < udata->atable->nattrs); /* Allocate attribute for entry in the table */ if (NULL == (udata->atable->attrs[udata->curr_attr] = H5FL_CALLOC(H5A_t))) @@ -1686,11 +1686,11 @@ H5A__dense_build_table(H5F_t *f, const H5O_ainfo_t *ainfo, H5_index_t idx_type, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(ainfo); - HDassert(H5_addr_defined(ainfo->fheap_addr)); - HDassert(H5_addr_defined(ainfo->name_bt2_addr)); - HDassert(atable); + assert(f); + assert(ainfo); + assert(H5_addr_defined(ainfo->fheap_addr)); + assert(H5_addr_defined(ainfo->name_bt2_addr)); + assert(atable); /* Open the name index v2 B-tree */ if (NULL == (bt2_name = H5B2_open(f, ainfo->name_bt2_addr, NULL))) @@ -1880,7 +1880,7 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, H5_iter_orde FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(atable); + assert(atable); /* Pick appropriate comparison routine */ if (idx_type == H5_INDEX_NAME) { @@ -1889,16 +1889,16 @@ H5A__attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, H5_iter_orde else if (order == H5_ITER_DEC) qsort(atable->attrs, atable->nattrs, sizeof(H5A_t *), H5A__attr_cmp_name_dec); else - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); } /* end if */ else { - HDassert(idx_type == H5_INDEX_CRT_ORDER); + assert(idx_type == H5_INDEX_CRT_ORDER); if (order == H5_ITER_INC) qsort(atable->attrs, atable->nattrs, sizeof(H5A_t *), H5A__attr_cmp_corder_inc); else if (order == H5_ITER_DEC) qsort(atable->attrs, atable->nattrs, sizeof(H5A_t *), H5A__attr_cmp_corder_dec); else - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -1927,8 +1927,8 @@ H5A__attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, hsize_t *l FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(atable); - HDassert(attr_op); + assert(atable); + assert(attr_op); /* Skip over attributes, if requested */ if (last_attr) @@ -1964,7 +1964,7 @@ H5A__attr_iterate_table(const H5A_attr_table_t *atable, hsize_t skip, hsize_t *l break; default: - HDassert("unknown attribute op type" && 0); + assert("unknown attribute op type" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unsupported attribute op type") #endif /* NDEBUG */ @@ -2003,7 +2003,7 @@ H5A__attr_release_table(H5A_attr_table_t *atable) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(atable); + assert(atable); /* Release attribute info, if any. */ if (atable->nattrs > 0) { @@ -2015,7 +2015,7 @@ H5A__attr_release_table(H5A_attr_table_t *atable) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute") } /* end if */ else - HDassert(atable->attrs == NULL); + assert(atable->attrs == NULL); atable->attrs = (H5A_t **)H5FL_SEQ_FREE(H5A_t_ptr, atable->attrs); @@ -2045,9 +2045,9 @@ H5A__get_ainfo(H5F_t *f, H5O_t *oh, H5O_ainfo_t *ainfo) FUNC_ENTER_NOAPI_TAG(oh->cache_info.addr, FAIL) /* check arguments */ - HDassert(f); - HDassert(oh); - HDassert(ainfo); + assert(f); + assert(oh); + assert(ainfo); /* Check if the "attribute info" message exists */ if ((ret_value = H5O_msg_exists_oh(oh, H5O_AINFO_ID)) < 0) @@ -2109,8 +2109,8 @@ H5A__set_version(const H5F_t *f, H5A_t *attr) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f); - HDassert(attr); + assert(f); + assert(attr); /* Check whether datatype and dataspace are shared */ if (H5O_msg_is_shared(H5O_DTYPE_ID, attr->shared->dt) > 0) @@ -2186,10 +2186,10 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s FUNC_ENTER_PACKAGE /* check args */ - HDassert(attr_src); - HDassert(file_dst); - HDassert(cpy_info); - HDassert(!cpy_info->copy_without_attr); + assert(attr_src); + assert(file_dst); + assert(cpy_info); + assert(!cpy_info->copy_without_attr); /* Allocate space for the destination message */ if (NULL == (attr_dst = H5FL_CALLOC(H5A_t))) @@ -2211,7 +2211,7 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s /* Copy attribute's name */ attr_dst->shared->name = H5MM_strdup(attr_src->shared->name); - HDassert(attr_dst->shared->name); + assert(attr_dst->shared->name); attr_dst->shared->encoding = attr_src->shared->encoding; /* Copy attribute's datatype */ @@ -2236,7 +2236,7 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s /* Copy the dataspace for the attribute. Make sure the maximal dimension is also copied. * Otherwise the comparison in the test may complain about it. SLU 2011/4/12 */ attr_dst->shared->ds = H5S_copy(attr_src->shared->ds, FALSE, TRUE); - HDassert(attr_dst->shared->ds); + assert(attr_dst->shared->ds); /* Reset the dataspace's sharing in the source file before trying to share * it in the destination. @@ -2257,9 +2257,9 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s * size unless they're shared. */ attr_dst->shared->dt_size = H5O_msg_raw_size(file_dst, H5O_DTYPE_ID, FALSE, attr_dst->shared->dt); - HDassert(attr_dst->shared->dt_size > 0); + assert(attr_dst->shared->dt_size > 0); attr_dst->shared->ds_size = H5O_msg_raw_size(file_dst, H5O_SDSPACE_ID, FALSE, attr_dst->shared->ds); - HDassert(attr_dst->shared->ds_size > 0); + assert(attr_dst->shared->ds_size > 0); /* Check whether to recompute the size of the attribute */ /* (happens when the datatype or dataspace changes sharing status) */ @@ -2384,7 +2384,7 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_s HGOTO_ERROR(H5E_DATASET, H5E_BADITER, NULL, "unable to reclaim variable-length data") } /* end if */ else { - HDassert(attr_dst->shared->data_size == attr_src->shared->data_size); + assert(attr_dst->shared->data_size == attr_src->shared->data_size); H5MM_memcpy(attr_dst->shared->data, attr_src->shared->data, attr_src->shared->data_size); } /* end else */ } /* end if(attr_src->shared->data) */ @@ -2458,16 +2458,16 @@ H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, H5O_l FUNC_ENTER_PACKAGE /* check args */ - HDassert(src_oloc); - HDassert(dst_oloc); - HDassert(attr_dst); - HDassert(attr_src); + assert(src_oloc); + assert(dst_oloc); + assert(attr_dst); + assert(attr_src); file_src = src_oloc->file; file_dst = dst_oloc->file; - HDassert(file_src); - HDassert(file_dst); + assert(file_src); + assert(file_dst); if (H5T_is_named(attr_src->shared->dt)) { H5O_loc_t *src_oloc_dt; /* Pointer to source datatype's object location */ @@ -2475,9 +2475,9 @@ H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, H5O_l /* Get group entries for source & destination */ src_oloc_dt = H5T_oloc(attr_src->shared->dt); - HDassert(src_oloc_dt); + assert(src_oloc_dt); dst_oloc_dt = H5T_oloc(attr_dst->shared->dt); - HDassert(dst_oloc_dt); + assert(dst_oloc_dt); /* Reset object location for new object */ H5O_loc_reset(dst_oloc_dt); @@ -2548,11 +2548,11 @@ H5A__dense_post_copy_file_cb(const H5A_t *attr_src, void *_udata) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(attr_src); - HDassert(udata); - HDassert(udata->ainfo); - HDassert(udata->file); - HDassert(udata->cpy_info); + assert(attr_src); + assert(udata); + assert(udata->ainfo); + assert(udata->file); + assert(udata->cpy_info); if (NULL == (attr_dst = H5A__attr_copy_file(attr_src, udata->file, udata->recompute_size, udata->cpy_info))) @@ -2606,8 +2606,8 @@ H5A__dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t *ainf FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(ainfo_src); - HDassert(ainfo_dst); + assert(ainfo_src); + assert(ainfo_dst); udata.ainfo = ainfo_dst; /* Destination dense information */ udata.file = dst_oloc->file; /* Destination file */ diff --git a/src/H5Atest.c b/src/H5Atest.c index 803d3cd..cb7671d 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -128,7 +128,7 @@ H5A__get_shared_rc_test(hid_t attr_id, hsize_t *ref_count) api_ctx_pushed = TRUE; /* Sanity check */ - HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); + assert(H5O_msg_is_shared(H5O_ATTR_ID, attr)); /* Retrieve ref count for shared or shareable attribute */ if (H5SM_get_refcount(attr->oloc.file, H5O_ATTR_ID, &attr->sh_loc, ref_count) < 0) diff --git a/src/H5B.c b/src/H5B.c index daaa9ef..94b108e 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -211,9 +211,9 @@ H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p /*out /* * Check arguments. */ - HDassert(f); - HDassert(type); - HDassert(addr_p); + assert(f); + assert(type); + assert(addr_p); /* * Allocate file and memory data structures. @@ -229,7 +229,7 @@ H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p /*out HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree node buffer") H5UC_INC(bt->rc_shared); shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); - HDassert(shared); + assert(shared); if (NULL == (bt->native = H5FL_BLK_MALLOC(native_block, shared->sizeof_keys)) || NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for B-tree root node") @@ -298,18 +298,18 @@ H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, hbool_t *found, void * /* * Check arguments. */ - HDassert(f); - HDassert(type); - HDassert(type->decode); - HDassert(type->cmp3); - HDassert(type->found); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(type); + assert(type->decode); + assert(type->cmp3); + assert(type->found); + assert(H5_addr_defined(addr)); /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + assert(shared); /* * Perform a binary search to locate the child which contains @@ -338,7 +338,7 @@ H5B_find(H5F_t *f, const H5B_class_t *type, haddr_t addr, hbool_t *found, void * /* * Follow the link to the subtree or to the data node. */ - HDassert(idx < bt->nchildren); + assert(idx < bt->nchildren); if (bt->level > 0) { if ((ret_value = H5B_find(f, type, bt->child[idx], found, udata)) < 0) @@ -392,19 +392,19 @@ H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_ /* * Check arguments. */ - HDassert(f); - HDassert(bt_ud); - HDassert(bt_ud->bt); - HDassert(H5_addr_defined(bt_ud->addr)); - HDassert(split_bt_ud); - HDassert(!split_bt_ud->bt); + assert(f); + assert(bt_ud); + assert(bt_ud->bt); + assert(H5_addr_defined(bt_ud->addr)); + assert(split_bt_ud); + assert(!split_bt_ud->bt); /* * Initialize variables. */ shared = (H5B_shared_t *)H5UC_GET_OBJ(bt_ud->bt->rc_shared); - HDassert(shared); - HDassert(bt_ud->bt->nchildren == shared->two_k); + assert(shared); + assert(bt_ud->bt->nchildren == shared->two_k); /* Get B-tree split ratios */ if (H5CX_get_btree_split_ratios(split_ratios) < 0) @@ -503,7 +503,7 @@ H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_ } /* end if */ bt_ud->bt->right = split_bt_ud->addr; - HDassert(bt_ud->cache_flags & H5AC__DIRTIED_FLAG); + assert(bt_ud->cache_flags & H5AC__DIRTIED_FLAG); done: if (ret_value < 0) { @@ -556,16 +556,16 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(f); - HDassert(type); - HDassert(type->sizeof_nkey <= sizeof _lt_key); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(type); + assert(type->sizeof_nkey <= sizeof _lt_key); + assert(H5_addr_defined(addr)); /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + assert(shared); /* Protect the root node */ cache_udata.f = f; @@ -583,12 +583,12 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) /* Check if the root node split */ if (H5B_INS_NOOP == my_ins) { /* The root node did not split - just return */ - HDassert(!split_bt_ud.bt); + assert(!split_bt_ud.bt); HGOTO_DONE(SUCCEED) } /* end if */ - HDassert(H5B_INS_RIGHT == my_ins); - HDassert(split_bt_ud.bt); - HDassert(H5_addr_defined(split_bt_ud.addr)); + assert(H5B_INS_RIGHT == my_ins); + assert(split_bt_ud.bt); + assert(H5_addr_defined(split_bt_ud.addr)); /* Get level of old root */ level = bt_ud.bt->level; @@ -694,12 +694,12 @@ H5B__insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5 FUNC_ENTER_PACKAGE_NOERR - HDassert(bt); - HDassert(bt_flags); - HDassert(H5_addr_defined(child)); + assert(bt); + assert(bt_flags); + assert(H5_addr_defined(child)); shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); - HDassert(shared); - HDassert(bt->nchildren < shared->two_k); + assert(shared); + assert(bt->nchildren < shared->two_k); /* Check for inserting right-most key into node (common when just appending * records to an unlimited dimension chunked dataset) @@ -791,22 +791,22 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 /* * Check arguments */ - HDassert(f); - HDassert(bt_ud); - HDassert(bt_ud->bt); - HDassert(H5_addr_defined(bt_ud->addr)); - HDassert(type); - HDassert(type->decode); - HDassert(type->cmp3); - HDassert(type->new_node); - HDassert(lt_key); - HDassert(lt_key_changed); - HDassert(rt_key); - HDassert(rt_key_changed); - HDassert(split_bt_ud); - HDassert(!split_bt_ud->bt); - HDassert(!H5_addr_defined(split_bt_ud->addr)); - HDassert(split_bt_ud->cache_flags == H5AC__NO_FLAGS_SET); + assert(f); + assert(bt_ud); + assert(bt_ud->bt); + assert(H5_addr_defined(bt_ud->addr)); + assert(type); + assert(type->decode); + assert(type->cmp3); + assert(type->new_node); + assert(lt_key); + assert(lt_key_changed); + assert(rt_key); + assert(rt_key_changed); + assert(split_bt_ud); + assert(!split_bt_ud->bt); + assert(!H5_addr_defined(split_bt_ud->addr)); + assert(split_bt_ud->cache_flags == H5AC__NO_FLAGS_SET); bt = bt_ud->bt; @@ -817,7 +817,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 if (NULL == (rc_shared = (type->get_shared)(f, udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + assert(shared); /* * Use a binary search to find the child that will receive the new @@ -844,7 +844,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 * The value being inserted will be the only value in this tree. We * must necessarily be at level zero. */ - HDassert(0 == bt->level); + assert(0 == bt->level); if ((type->new_node)(f, H5B_INS_FIRST, H5B_NKEY(bt, shared, 0), udata, H5B_NKEY(bt, shared, 1), bt->child + 0 /*out*/) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, H5B_INS_ERROR, "unable to create leaf node") @@ -965,7 +965,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 * We couldn't figure out which branch to follow out of this node. THIS * IS A MAJOR PROBLEM THAT NEEDS TO BE FIXED --rpm. */ - HDassert("INTERNAL HDF5 ERROR (contact rpm)" && 0); + assert("INTERNAL HDF5 ERROR (contact rpm)" && 0); #ifdef NDEBUG HDabort(); #endif /* NDEBUG */ @@ -974,7 +974,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 /* * Follow a branch out of this node to another subtree. */ - HDassert(idx < bt->nchildren); + assert(idx < bt->nchildren); child_bt_ud.addr = bt->child[idx]; if (NULL == (child_bt_ud.bt = (H5B_t *)H5AC_protect(f, H5AC_BT, child_bt_ud.addr, &cache_udata, H5AC__NO_FLAGS_SET))) @@ -989,13 +989,13 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 /* * Follow a branch out of this node to a leaf node of some other type. */ - HDassert(idx < bt->nchildren); + assert(idx < bt->nchildren); if ((int)(my_ins = (type->insert)(f, bt->child[idx], H5B_NKEY(bt, shared, idx), lt_key_changed, md_key, udata, H5B_NKEY(bt, shared, idx + 1), rt_key_changed, &new_child_bt_ud.addr /*out*/)) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert leaf node") } - HDassert((int)my_ins >= 0); + assert((int)my_ins >= 0); /* * Update the left and right keys of the current node. @@ -1003,8 +1003,8 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 if (*lt_key_changed) { bt_ud->cache_flags |= H5AC__DIRTIED_FLAG; if (idx > 0) { - HDassert(type->critical_key == H5B_LEFT); - HDassert(!(H5B_INS_LEFT == my_ins || H5B_INS_RIGHT == my_ins)); + assert(type->critical_key == H5B_LEFT); + assert(!(H5B_INS_LEFT == my_ins || H5B_INS_RIGHT == my_ins)); *lt_key_changed = FALSE; } /* end if */ else @@ -1013,8 +1013,8 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 if (*rt_key_changed) { bt_ud->cache_flags |= H5AC__DIRTIED_FLAG; if (idx + 1 < bt->nchildren) { - HDassert(type->critical_key == H5B_RIGHT); - HDassert(!(H5B_INS_LEFT == my_ins || H5B_INS_RIGHT == my_ins)); + assert(type->critical_key == H5B_RIGHT); + assert(!(H5B_INS_LEFT == my_ins || H5B_INS_RIGHT == my_ins)); *rt_key_changed = FALSE; } /* end if */ else @@ -1024,13 +1024,13 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 /* * Handle changes/additions to children */ - HDassert(!(bt->level == 0) != !(child_bt_ud.bt)); + assert(!(bt->level == 0) != !(child_bt_ud.bt)); if (H5B_INS_CHANGE == my_ins) { /* * The insertion simply changed the address for the child. */ - HDassert(!child_bt_ud.bt); - HDassert(bt->level == 0); + assert(!child_bt_ud.bt); + assert(bt->level == 0); bt->child[idx] = new_child_bt_ud.addr; bt_ud->cache_flags |= H5AC__DIRTIED_FLAG; } @@ -1077,7 +1077,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 * in the new node. */ cmp = (type->cmp2)(H5B_NKEY(bt, shared, bt->nchildren), udata, H5B_NKEY(split_bt_ud->bt, shared, 0)); - HDassert(0 == cmp); + assert(0 == cmp); #endif } /* end if */ else @@ -1124,17 +1124,17 @@ H5B__iterate_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_operato /* * Check arguments. */ - HDassert(f); - HDassert(type); - HDassert(H5_addr_defined(addr)); - HDassert(op); - HDassert(udata); + assert(f); + assert(type); + assert(H5_addr_defined(addr)); + assert(op); + assert(udata); /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + assert(shared); /* Protect the initial/current node */ cache_udata.f = f; @@ -1183,11 +1183,11 @@ H5B_iterate(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_operator_t op, /* * Check arguments. */ - HDassert(f); - HDassert(type); - HDassert(H5_addr_defined(addr)); - HDassert(op); - HDassert(udata); + assert(f); + assert(type); + assert(H5_addr_defined(addr)); + assert(op); + assert(udata); /* Iterate over the B-tree records */ if ((ret_value = H5B__iterate_helper(f, type, addr, op, udata)) < 0) @@ -1236,20 +1236,20 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(type); - HDassert(type->decode); - HDassert(type->cmp3); - HDassert(lt_key && lt_key_changed); - HDassert(udata); - HDassert(rt_key && rt_key_changed); + assert(f); + assert(H5_addr_defined(addr)); + assert(type); + assert(type->decode); + assert(type->cmp3); + assert(lt_key && lt_key_changed); + assert(udata); + assert(rt_key && rt_key_changed); /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, H5B_INS_ERROR, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + assert(shared); /* * Perform a binary search to locate the child which contains the thing @@ -1276,7 +1276,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u * Follow the link to the subtree or to the data node. The return value * will be one of H5B_INS_ERROR, H5B_INS_NOOP, or H5B_INS_REMOVE. */ - HDassert(idx < bt->nchildren); + assert(idx < bt->nchildren); if (bt->level > 0) { /* We're at an internal node -- call recursively */ if ((int)(ret_value = @@ -1315,7 +1315,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u * our right key and indicate that it changed. */ if (*lt_key_changed) { - HDassert(type->critical_key == H5B_LEFT); + assert(type->critical_key == H5B_LEFT); bt_flags |= H5AC__DIRTIED_FLAG; if (idx > 0) @@ -1325,7 +1325,7 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u H5MM_memcpy(lt_key, H5B_NKEY(bt, shared, idx), type->sizeof_nkey); } /* end if */ if (*rt_key_changed) { - HDassert(type->critical_key == H5B_RIGHT); + assert(type->critical_key == H5B_RIGHT); bt_flags |= H5AC__DIRTIED_FLAG; if (idx + 1 < bt->nchildren) /* Don't propagate change out of this B-tree node */ @@ -1342,8 +1342,8 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u /* Clients should not change keys when a node is removed. This function * will handle it as appropriate, based on the value of bt->critical_key */ - HDassert(!(*lt_key_changed)); - HDassert(!(*rt_key_changed)); + assert(!(*lt_key_changed)); + assert(!(*rt_key_changed)); if (1 == bt->nchildren) { /* @@ -1496,8 +1496,8 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u /* Patch keys in neighboring trees if necessary */ if (*lt_key_changed && H5_addr_defined(bt->left)) { - HDassert(type->critical_key == H5B_LEFT); - HDassert(level > 0); + assert(type->critical_key == H5B_LEFT); + assert(level > 0); /* Update the rightmost key in the left sibling */ if (NULL == (sibling = (H5B_t *)H5AC_protect(f, H5AC_BT, bt->left, &cache_udata, H5AC__NO_FLAGS_SET))) @@ -1511,8 +1511,8 @@ H5B__remove_helper(H5F_t *f, haddr_t addr, const H5B_class_t *type, int level, u sibling = NULL; /* Make certain future references will be caught */ } /* end if */ else if (*rt_key_changed && H5_addr_defined(bt->right)) { - HDassert(type->critical_key == H5B_RIGHT); - HDassert(level > 0); + assert(type->critical_key == H5B_RIGHT); + assert(level > 0); /* Update the lefttmost key in the right sibling */ if (NULL == @@ -1563,10 +1563,10 @@ H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(f); - HDassert(type); - HDassert(type->sizeof_nkey <= sizeof _lt_key); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(type); + assert(type->sizeof_nkey <= sizeof _lt_key); + assert(H5_addr_defined(addr)); /* The actual removal */ if (H5B_INS_ERROR == @@ -1606,15 +1606,15 @@ H5B_delete(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(f); - HDassert(type); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(type); + assert(H5_addr_defined(addr)); /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + assert(shared); /* Lock this B-tree node into memory for now */ cache_udata.f = f; @@ -1678,7 +1678,7 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey) /* * Check arguments. */ - HDassert(type); + assert(type); /* Allocate space for the shared structure */ if (NULL == (shared = H5FL_CALLOC(H5B_shared_t))) @@ -1690,12 +1690,12 @@ H5B_shared_new(const H5F_t *f, const H5B_class_t *type, size_t sizeof_rkey) shared->sizeof_addr = H5F_SIZEOF_ADDR(f); shared->sizeof_len = H5F_SIZEOF_SIZE(f); shared->sizeof_rkey = sizeof_rkey; - HDassert(shared->sizeof_rkey); + assert(shared->sizeof_rkey); shared->sizeof_keys = (shared->two_k + 1) * type->sizeof_nkey; shared->sizeof_rnode = ((size_t)H5B_SIZEOF_HDR(f) + /*node header */ shared->two_k * H5F_SIZEOF_ADDR(f) + /*child pointers */ (shared->two_k + 1) * shared->sizeof_rkey); /*keys */ - HDassert(shared->sizeof_rnode); + assert(shared->sizeof_rnode); /* Allocate and clear shared buffers */ if (NULL == (shared->page = H5FL_BLK_MALLOC(page, shared->sizeof_rnode))) @@ -1782,9 +1782,9 @@ H5B__copy(const H5B_t *old_bt) /* * Check arguments. */ - HDassert(old_bt); + assert(old_bt); shared = (H5B_shared_t *)H5UC_GET_OBJ(old_bt->rc_shared); - HDassert(shared); + assert(shared); /* Allocate memory for the new H5B_t object */ if (NULL == (new_node = H5FL_MALLOC(H5B_t))) @@ -1852,18 +1852,18 @@ H5B__get_info_helper(H5F_t *f, const H5B_class_t *type, haddr_t addr, const H5B_ /* * Check arguments. */ - HDassert(f); - HDassert(type); - HDassert(H5_addr_defined(addr)); - HDassert(info_udata); - HDassert(info_udata->bt_info); - HDassert(info_udata->udata); + assert(f); + assert(type); + assert(H5_addr_defined(addr)); + assert(info_udata); + assert(info_udata->bt_info); + assert(info_udata->udata); /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, info_udata->udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + assert(shared); /* Get the raw node size for iteration */ sizeof_rnode = shared->sizeof_rnode; @@ -1950,11 +1950,11 @@ H5B_get_info(H5F_t *f, const H5B_class_t *type, haddr_t addr, H5B_info_t *bt_inf /* * Check arguments. */ - HDassert(f); - HDassert(type); - HDassert(bt_info); - HDassert(H5_addr_defined(addr)); - HDassert(udata); + assert(f); + assert(type); + assert(bt_info); + assert(H5_addr_defined(addr)); + assert(udata); /* Portably initialize B-tree info struct */ HDmemset(bt_info, 0, sizeof(*bt_info)); @@ -2002,8 +2002,8 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr) /* * Check arguments. */ - HDassert(f); - HDassert(type); + assert(f); + assert(type); if (!H5_addr_defined(addr)) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "address is undefined") @@ -2011,7 +2011,7 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr) /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, NULL))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") - HDassert(H5UC_GET_OBJ(rc_shared) != NULL); + assert(H5UC_GET_OBJ(rc_shared) != NULL); /* * Load the tree node. @@ -2049,8 +2049,8 @@ H5B__node_dest(H5B_t *bt) FUNC_ENTER_PACKAGE_NOERR /* check arguments */ - HDassert(bt); - HDassert(bt->rc_shared); + assert(bt); + assert(bt->rc_shared); bt->child = H5FL_SEQ_FREE(haddr_t, bt->child); bt->native = H5FL_BLK_FREE(native_block, bt->native); diff --git a/src/H5B2.c b/src/H5B2.c index 093f8ee..04895fa 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -132,8 +132,8 @@ H5B2_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata) /* * Check arguments. */ - HDassert(f); - HDassert(cparam); + assert(f); + assert(cparam); /* H5B2 interface sanity check */ HDcompile_assert(H5B2_NUM_BTREE_ID == NELMTS(H5B2_client_class_g)); @@ -200,8 +200,8 @@ H5B2_open(H5F_t *f, haddr_t addr, void *ctx_udata) FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(H5_addr_defined(addr)); /* Look up the B-tree header */ if (NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__READ_ONLY_FLAG))) @@ -263,8 +263,8 @@ H5B2_insert(H5B2_t *bt2, void *udata) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(bt2); - HDassert(udata); + assert(bt2); + assert(udata); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -305,8 +305,8 @@ H5B2_update(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(bt2); - HDassert(udata); + assert(bt2); + assert(udata); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -333,7 +333,7 @@ H5B2_update(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) } /* end else */ /* Sanity check */ - HDassert(H5B2_UPDATE_UNKNOWN != status); + assert(H5B2_UPDATE_UNKNOWN != status); /* Use insert algorithm if nodes to leaf full */ if (H5B2_UPDATE_INSERT_CHILD_FULL == status) { @@ -347,7 +347,7 @@ H5B2_update(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) } /* end else-if */ else { /* Sanity check */ - HDassert(H5B2_UPDATE_MODIFY_DONE == status); + assert(H5B2_UPDATE_MODIFY_DONE == status); } /* end else */ done: @@ -374,8 +374,8 @@ H5B2_get_addr(const H5B2_t *bt2, haddr_t *addr_p) /* * Check arguments. */ - HDassert(bt2); - HDassert(addr_p); + assert(bt2); + assert(addr_p); /* Retrieve the header address for this v2 B-tree */ *addr_p = bt2->hdr->addr; @@ -408,8 +408,8 @@ H5B2_iterate(H5B2_t *bt2, H5B2_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOERR /* Check arguments. */ - HDassert(bt2); - HDassert(op); + assert(bt2); + assert(op); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -463,8 +463,8 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(bt2); - HDassert(found); + assert(bt2); + assert(found); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -686,7 +686,7 @@ H5B2_find(H5B2_t *bt2, void *udata, hbool_t *found, H5B2_found_t op, void *op_da done: if (parent) { - HDassert(ret_value < 0); + assert(ret_value < 0); if (parent != hdr && H5AC_unpin_entry(parent) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPIN, FAIL, "unable to unpin parent entry") } /* end if */ @@ -723,8 +723,8 @@ H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, voi FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(bt2); - HDassert(op); + assert(bt2); + assert(op); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -845,7 +845,7 @@ H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, voi } /* end if */ else /* Index that is greater than the number of records in the tree? */ - HDassert(0 && "Index off end of tree??"); + assert(0 && "Index off end of tree??"); } /* end if */ /* Decrement depth we're at in B-tree */ @@ -867,7 +867,7 @@ H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, voi } /* end if */ /* Sanity check index */ - HDassert(idx < leaf->nrec); + assert(idx < leaf->nrec); /* Make callback for correct record */ if ((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data) < 0) { @@ -885,7 +885,7 @@ H5B2_index(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_found_t op, voi done: if (parent) { - HDassert(ret_value < 0); + assert(ret_value < 0); if (parent != hdr && H5AC_unpin_entry(parent) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPIN, FAIL, "unable to unpin parent entry") } /* end if */ @@ -914,7 +914,7 @@ H5B2_remove(H5B2_t *bt2, void *udata, H5B2_remove_t op, void *op_data) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(bt2); + assert(bt2); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -946,7 +946,7 @@ H5B2_remove(H5B2_t *bt2, void *udata, H5B2_remove_t op, void *op_data) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy node's node pointer block factory") - HDassert((uint16_t)(hdr->depth - depth_decreased) < hdr->depth); + assert((uint16_t)(hdr->depth - depth_decreased) < hdr->depth); hdr->depth = (uint16_t)(hdr->depth - depth_decreased); } /* end for */ } /* end if */ @@ -987,7 +987,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_remove_ FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(bt2); + assert(bt2); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -1027,7 +1027,7 @@ H5B2_remove_by_idx(H5B2_t *bt2, H5_iter_order_t order, hsize_t idx, H5B2_remove_ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't destroy node's node pointer block factory") - HDassert((uint16_t)(hdr->depth - depth_decreased) < hdr->depth); + assert((uint16_t)(hdr->depth - depth_decreased) < hdr->depth); hdr->depth = (uint16_t)(hdr->depth - depth_decreased); } /* end for */ } /* end if */ @@ -1065,8 +1065,8 @@ H5B2_get_nrec(const H5B2_t *bt2, hsize_t *nrec) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(bt2); - HDassert(nrec); + assert(bt2); + assert(nrec); /* Get B-tree number of records */ *nrec = bt2->hdr->root.all_nrec; @@ -1107,8 +1107,8 @@ H5B2_neighbor(H5B2_t *bt2, H5B2_compare_t range, void *udata, H5B2_found_t op, v FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(bt2); - HDassert(op); + assert(bt2); + assert(op); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -1169,8 +1169,8 @@ H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(bt2); - HDassert(op); + assert(bt2); + assert(op); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -1263,7 +1263,7 @@ H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) /* Make callback for current record */ if ((op)(H5B2_INT_NREC(internal, hdr, idx), op_data, &changed) < 0) { /* Make certain that the callback didn't modify the value if it failed */ - HDassert(changed == FALSE); + assert(changed == FALSE); /* Unlock current node */ if (H5AC_unprotect(hdr->f, H5AC_BT2_INT, curr_node_ptr.addr, internal, H5AC__NO_FLAGS_SET) < @@ -1327,7 +1327,7 @@ H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) /* Make callback for current record */ if ((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data, &changed) < 0) { /* Make certain that the callback didn't modify the value if it failed */ - HDassert(changed == FALSE); + assert(changed == FALSE); /* Unlock current node */ if (H5AC_unprotect(hdr->f, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) @@ -1371,7 +1371,7 @@ H5B2_modify(H5B2_t *bt2, void *udata, H5B2_modify_t op, void *op_data) done: if (parent) { - HDassert(ret_value < 0); + assert(ret_value < 0); if (parent != hdr && H5AC_unpin_entry(parent) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPIN, FAIL, "unable to unpin parent entry") } /* end if */ @@ -1401,8 +1401,8 @@ H5B2_close(H5B2_t *bt2) FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ - HDassert(bt2); - HDassert(bt2->f); + assert(bt2); + assert(bt2->f); /* Decrement file reference & check if this is the last open v2 B-tree using the shared B-tree header */ if (0 == H5B2__hdr_fuse_decr(bt2->hdr)) { @@ -1424,7 +1424,7 @@ H5B2_close(H5B2_t *bt2) H5B2_hdr_t *hdr; /* Another pointer to v2 B-tree header */ /* Sanity check */ - HDassert(H5_addr_defined(bt2_addr)); + assert(H5_addr_defined(bt2_addr)); #ifndef NDEBUG { @@ -1437,9 +1437,9 @@ H5B2_close(H5B2_t *bt2) (unsigned long long)bt2_addr) /* Sanity checks on header */ - HDassert(hdr_status & H5AC_ES__IN_CACHE); - HDassert(hdr_status & H5AC_ES__IS_PINNED); - HDassert(!(hdr_status & H5AC_ES__IS_PROTECTED)); + assert(hdr_status & H5AC_ES__IN_CACHE); + assert(hdr_status & H5AC_ES__IS_PINNED); + assert(!(hdr_status & H5AC_ES__IS_PROTECTED)); } #endif /* NDEBUG */ @@ -1511,8 +1511,8 @@ H5B2_delete(H5F_t *f, haddr_t addr, void *ctx_udata, H5B2_remove_t op, void *op_ FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(H5_addr_defined(addr)); /* Lock the v2 B-tree header into memory */ if (NULL == (hdr = H5B2__hdr_protect(f, addr, ctx_udata, H5AC__NO_FLAGS_SET))) @@ -1568,10 +1568,10 @@ H5B2_depend(H5B2_t *bt2, H5AC_proxy_entry_t *parent) /* * Check arguments. */ - HDassert(bt2); - HDassert(hdr); - HDassert(parent); - HDassert(hdr->parent == NULL || hdr->parent == parent); + assert(bt2); + assert(hdr); + assert(parent); + assert(hdr->parent == NULL || hdr->parent == parent); /* * Check to see if the flush dependency between the parent @@ -1580,7 +1580,7 @@ H5B2_depend(H5B2_t *bt2, H5AC_proxy_entry_t *parent) */ if (NULL == hdr->parent) { /* Sanity check */ - HDassert(hdr->top_proxy); + assert(hdr->top_proxy); /* Set the shared v2 B-tree header's file context for this operation */ hdr->f = bt2->f; @@ -1615,8 +1615,8 @@ H5B2_patch_file(H5B2_t *bt2, H5F_t *f) /* * Check arguments. */ - HDassert(bt2); - HDassert(f); + assert(bt2); + assert(f); if (bt2->f != f || bt2->hdr->f != f) bt2->f = bt2->hdr->f = f; diff --git a/src/H5B2cache.c b/src/H5B2cache.c index e29d0c7..cf23705 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -168,9 +168,9 @@ H5B2__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->f); - HDassert(image_len); + assert(udata); + assert(udata->f); + assert(image_len); /* Set the image length size */ *image_len = H5B2_HEADER_SIZE_FILE(udata->f); @@ -202,7 +202,7 @@ H5B2__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -242,8 +242,8 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* Allocate new B-tree header and reset cache info */ if (NULL == (hdr = H5B2__hdr_alloc(udata->f))) @@ -287,7 +287,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == hdr->hdr_size); + assert((size_t)(image - (const uint8_t *)_image) == hdr->hdr_size); /* Initialize B-tree header info */ cparam.cls = H5B2_client_class_g[id]; @@ -298,7 +298,7 @@ H5B2__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void hdr->addr = udata->addr; /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) <= len); + assert((size_t)(image - (const uint8_t *)_image) <= len); /* Set return value */ ret_value = hdr; @@ -331,8 +331,8 @@ H5B2__cache_hdr_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(hdr); - HDassert(image_len); + assert(hdr); + assert(image_len); /* Set the image length size */ *image_len = hdr->hdr_size; @@ -362,9 +362,9 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le FUNC_ENTER_PACKAGE_NOERR /* check arguments */ - HDassert(f); - HDassert(image); - HDassert(hdr); + assert(f); + assert(image); + assert(hdr); /* Magic number */ H5MM_memcpy(image, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -374,7 +374,7 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le *image++ = H5B2_HDR_VERSION; /* B-tree type */ - HDassert(hdr->cls->id <= 255); + assert(hdr->cls->id <= 255); *image++ = (uint8_t)hdr->cls->id; /* Node size (in bytes) */ @@ -404,7 +404,7 @@ H5B2__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5B2__cache_hdr_serialize() */ @@ -432,7 +432,7 @@ H5B2__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Check if the file was opened with SWMR-write access */ if (hdr->swmr_write) { @@ -463,7 +463,7 @@ H5B2__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) */ if (hdr->parent) { /* Sanity check */ - HDassert(hdr->top_proxy); + assert(hdr->top_proxy); /* Destroy flush dependency on object header proxy */ if (H5AC_proxy_entry_remove_child((H5AC_proxy_entry_t *)hdr->parent, @@ -487,12 +487,12 @@ H5B2__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ } /* end if */ else - HDassert(NULL == hdr->parent); + assert(NULL == hdr->parent); done: FUNC_LEAVE_NOAPI(ret_value) @@ -519,7 +519,7 @@ H5B2__cache_hdr_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Destroy v2 B-tree header */ if (H5B2__hdr_free((H5B2_hdr_t *)thing) < 0) @@ -549,9 +549,9 @@ H5B2__cache_int_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(image_len); + assert(udata); + assert(udata->hdr); + assert(image_len); /* Set the image length size */ *image_len = udata->hdr->node_size; @@ -585,8 +585,8 @@ H5B2__cache_int_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, voi FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* Internal node prefix header + records + child pointer triplets: size with checksum at the end */ chk_size = H5B2_INT_PREFIX_SIZE + (udata->nrec * udata->hdr->rrec_size) + @@ -631,8 +631,8 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* Allocate new internal node and reset cache info */ if (NULL == (internal = H5FL_CALLOC(H5B2_internal_t))) @@ -711,7 +711,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void UINT32DECODE(image, stored_chksum); /* Sanity check parsing */ - HDassert((size_t)(image - (const uint8_t *)_image) <= len); + assert((size_t)(image - (const uint8_t *)_image) <= len); /* Set return value */ ret_value = internal; @@ -745,9 +745,9 @@ H5B2__cache_int_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(internal); - HDassert(internal->hdr); - HDassert(image_len); + assert(internal); + assert(internal->hdr); + assert(image_len); /* Set the image length size */ *image_len = internal->hdr->node_size; @@ -781,10 +781,10 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f); - HDassert(image); - HDassert(internal); - HDassert(internal->hdr); + assert(f); + assert(image); + assert(internal); + assert(internal->hdr); /* Magic number */ H5MM_memcpy(image, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -794,9 +794,9 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le *image++ = H5B2_INT_VERSION; /* B-tree type */ - HDassert(internal->hdr->cls->id <= 255); + assert(internal->hdr->cls->id <= 255); *image++ = (uint8_t)internal->hdr->cls->id; - HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); + assert((size_t)(image - (uint8_t *)_image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); /* Serialize records for internal node */ native = internal->int_native; @@ -831,7 +831,7 @@ H5B2__cache_int_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) <= len); + assert((size_t)(image - (uint8_t *)_image) <= len); /* Clear rest of internal node */ HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image)); @@ -863,8 +863,8 @@ H5B2__cache_int_notify(H5AC_notify_action_t action, void *_thing) /* * Check arguments. */ - HDassert(internal); - HDassert(internal->hdr); + assert(internal); + assert(internal->hdr); /* Check if the file was opened with SWMR-write access */ if (internal->hdr->swmr_write) { @@ -905,12 +905,12 @@ H5B2__cache_int_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ } /* end if */ else - HDassert(NULL == internal->top_proxy); + assert(NULL == internal->top_proxy); done: FUNC_LEAVE_NOAPI(ret_value) @@ -938,7 +938,7 @@ H5B2__cache_int_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(internal); + assert(internal); /* Release v2 B-tree internal node */ if (H5B2__internal_free(internal) < 0) @@ -968,9 +968,9 @@ H5B2__cache_leaf_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(image_len); + assert(udata); + assert(udata->hdr); + assert(image_len); /* Set the image length size */ *image_len = udata->hdr->node_size; @@ -1004,8 +1004,8 @@ H5B2__cache_leaf_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* Leaf node prefix header + records: size with checksum at the end */ chk_size = H5B2_LEAF_PREFIX_SIZE + (udata->nrec * udata->hdr->rrec_size); @@ -1047,8 +1047,8 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* Allocate new leaf node and reset cache info */ if (NULL == (leaf = H5FL_CALLOC(H5B2_leaf_t))) @@ -1101,10 +1101,10 @@ H5B2__cache_leaf_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, void UINT32DECODE(image, stored_chksum); /* Sanity check parsing */ - HDassert((size_t)(image - (const uint8_t *)_image) <= udata->hdr->node_size); + assert((size_t)(image - (const uint8_t *)_image) <= udata->hdr->node_size); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) <= len); + assert((size_t)(image - (const uint8_t *)_image) <= len); /* Set return value */ ret_value = leaf; @@ -1137,9 +1137,9 @@ H5B2__cache_leaf_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(leaf); - HDassert(leaf->hdr); - HDassert(image_len); + assert(leaf); + assert(leaf->hdr); + assert(image_len); /* Set the image length size */ *image_len = leaf->hdr->node_size; @@ -1173,10 +1173,10 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f); - HDassert(image); - HDassert(leaf); - HDassert(leaf->hdr); + assert(f); + assert(image); + assert(leaf); + assert(leaf->hdr); /* magic number */ H5MM_memcpy(image, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -1186,9 +1186,9 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H *image++ = H5B2_LEAF_VERSION; /* B-tree type */ - HDassert(leaf->hdr->cls->id <= 255); + assert(leaf->hdr->cls->id <= 255); *image++ = (uint8_t)leaf->hdr->cls->id; - HDassert((size_t)(image - (uint8_t *)_image) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); + assert((size_t)(image - (uint8_t *)_image) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); /* Serialize records for leaf node */ native = leaf->leaf_native; @@ -1210,7 +1210,7 @@ H5B2__cache_leaf_serialize(const H5F_t H5_ATTR_UNUSED *f, void *_image, size_t H UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) <= len); + assert((size_t)(image - (uint8_t *)_image) <= len); /* Clear rest of leaf node */ HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image)); @@ -1242,8 +1242,8 @@ H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *_thing) /* * Check arguments. */ - HDassert(leaf); - HDassert(leaf->hdr); + assert(leaf); + assert(leaf->hdr); /* Check if the file was opened with SWMR-write access */ if (leaf->hdr->swmr_write) { @@ -1284,12 +1284,12 @@ H5B2__cache_leaf_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ } /* end if */ else - HDassert(NULL == leaf->top_proxy); + assert(NULL == leaf->top_proxy); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1317,7 +1317,7 @@ H5B2__cache_leaf_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(leaf); + assert(leaf); /* Destroy v2 B-tree leaf node */ if (H5B2__leaf_free(leaf) < 0) diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index 9effa74..a94bc76 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -89,13 +89,13 @@ H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(H5_addr_defined(obj_addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(type); + assert(f); + assert(H5_addr_defined(addr)); + assert(H5_addr_defined(obj_addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(type); /* Load the B-tree header */ if (NULL == (hdr = H5B2__hdr_protect(f, addr, f, H5AC__READ_ONLY_FLAG))) @@ -170,15 +170,15 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, co /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(type); - HDassert(H5_addr_defined(hdr_addr)); - HDassert(H5_addr_defined(obj_addr)); - HDassert(nrec > 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(type); + assert(H5_addr_defined(hdr_addr)); + assert(H5_addr_defined(obj_addr)); + assert(nrec > 0); /* Load the B-tree header */ if (NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, f, H5AC__READ_ONLY_FLAG))) @@ -223,7 +223,7 @@ H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, co /* Print record */ HDsnprintf(temp_str, sizeof(temp_str), "Record #%u:", u); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); - HDassert(H5B2_INT_NREC(internal, hdr, u)); + assert(H5B2_INT_NREC(internal, hdr, u)); (void)(type->debug)(stream, indent + 6, MAX(0, fwidth - 6), H5B2_INT_NREC(internal, hdr, u), hdr->cb_ctx); } /* end for */ @@ -271,15 +271,15 @@ H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, c /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(type); - HDassert(H5_addr_defined(hdr_addr)); - HDassert(H5_addr_defined(obj_addr)); - HDassert(nrec > 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(type); + assert(H5_addr_defined(hdr_addr)); + assert(H5_addr_defined(obj_addr)); + assert(nrec > 0); /* Load the B-tree header */ if (NULL == (hdr = H5B2__hdr_protect(f, hdr_addr, f, H5AC__READ_ONLY_FLAG))) @@ -317,7 +317,7 @@ H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, c /* Print record */ HDsnprintf(temp_str, sizeof(temp_str), "Record #%u:", u); HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), temp_str); - HDassert(H5B2_LEAF_NREC(leaf, hdr, u)); + assert(H5B2_LEAF_NREC(leaf, hdr, u)); (void)(type->debug)(stream, indent + 6, MAX(0, fwidth - 6), H5B2_LEAF_NREC(leaf, hdr, u), hdr->cb_ctx); } /* end for */ diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 30a40e9..fea5848 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -108,16 +108,16 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, ui /* * Check arguments. */ - HDassert(hdr); - HDassert(cparam); - HDassert(cparam->cls); - HDassert((cparam->cls->crt_context && cparam->cls->dst_context) || - (NULL == cparam->cls->crt_context && NULL == cparam->cls->dst_context)); - HDassert(cparam->node_size > 0); - HDassert(cparam->rrec_size > 0); - HDassert(cparam->merge_percent > 0 && cparam->merge_percent <= 100); - HDassert(cparam->split_percent > 0 && cparam->split_percent <= 100); - HDassert(cparam->merge_percent < (cparam->split_percent / 2)); + assert(hdr); + assert(cparam); + assert(cparam->cls); + assert((cparam->cls->crt_context && cparam->cls->dst_context) || + (NULL == cparam->cls->crt_context && NULL == cparam->cls->dst_context)); + assert(cparam->node_size > 0); + assert(cparam->rrec_size > 0); + assert(cparam->merge_percent > 0 && cparam->merge_percent <= 100); + assert(cparam->split_percent > 0 && cparam->split_percent <= 100); + assert(cparam->merge_percent < (cparam->split_percent / 2)); /* Assign dynamic information */ hdr->depth = depth; @@ -166,14 +166,14 @@ H5B2__hdr_init(H5B2_hdr_t *hdr, const H5B2_create_t *cparam, void *ctx_udata, ui /* (uses leaf # of records because its the largest) */ u_max_nrec_size = H5VM_limit_enc_size((uint64_t)hdr->node_info[0].max_nrec); H5_CHECKED_ASSIGN(hdr->max_nrec_size, uint8_t, u_max_nrec_size, unsigned); - HDassert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); + assert(hdr->max_nrec_size <= H5B2_SIZEOF_RECORDS_PER_NODE); /* Initialize internal node info */ if (depth > 0) { for (u = 1; u < (unsigned)(depth + 1); u++) { sz_max_nrec = H5B2_NUM_INT_REC(hdr, u); H5_CHECKED_ASSIGN(hdr->node_info[u].max_nrec, unsigned, sz_max_nrec, size_t); - HDassert(hdr->node_info[u].max_nrec <= hdr->node_info[u - 1].max_nrec); + assert(hdr->node_info[u].max_nrec <= hdr->node_info[u - 1].max_nrec); hdr->node_info[u].split_nrec = (hdr->node_info[u].max_nrec * hdr->split_percent) / 100; hdr->node_info[u].merge_nrec = (hdr->node_info[u].max_nrec * hdr->merge_percent) / 100; @@ -237,7 +237,7 @@ H5B2__hdr_alloc(H5F_t *f) /* * Check arguments. */ - HDassert(f); + assert(f); /* Allocate space for the shared information */ if (NULL == (hdr = H5FL_CALLOC(H5B2_hdr_t))) @@ -282,8 +282,8 @@ H5B2__hdr_create(H5F_t *f, const H5B2_create_t *cparam, void *ctx_udata) /* * Check arguments. */ - HDassert(f); - HDassert(cparam); + assert(f); + assert(cparam); /* Allocate v2 B-tree header */ if (NULL == (hdr = H5B2__hdr_alloc(f))) @@ -358,7 +358,7 @@ H5B2__hdr_incr(H5B2_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(hdr); + assert(hdr); /* Mark header as un-evictable when a B-tree node is depending on it */ if (hdr->rc == 0) @@ -392,8 +392,8 @@ H5B2__hdr_decr(H5B2_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(hdr->rc > 0); + assert(hdr); + assert(hdr->rc > 0); /* Decrement reference count on B-tree header */ hdr->rc--; @@ -425,7 +425,7 @@ H5B2__hdr_fuse_incr(H5B2_hdr_t *hdr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Increment file reference count on shared header */ hdr->file_rc++; @@ -451,8 +451,8 @@ H5B2__hdr_fuse_decr(H5B2_hdr_t *hdr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(hdr); - HDassert(hdr->file_rc); + assert(hdr); + assert(hdr->file_rc); /* Decrement file reference count on shared header */ hdr->file_rc--; @@ -480,7 +480,7 @@ H5B2__hdr_dirty(H5B2_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Mark B-tree header as dirty in cache */ if (H5AC_mark_entry_dirty(hdr) < 0) @@ -512,11 +512,11 @@ H5B2__hdr_protect(H5F_t *f, haddr_t hdr_addr, void *ctx_udata, unsigned flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(H5_addr_defined(hdr_addr)); + assert(f); + assert(H5_addr_defined(hdr_addr)); /* only the H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data for cache callbacks */ udata.f = f; @@ -575,7 +575,7 @@ H5B2__hdr_unprotect(H5B2_hdr_t *hdr, unsigned cache_flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Unprotect the header */ if (H5AC_unprotect(hdr->f, H5AC_BT2_HDR, hdr->addr, hdr, cache_flags) < 0) @@ -606,7 +606,7 @@ H5B2__hdr_free(H5B2_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Destroy the callback context */ if (hdr->cb_ctx) { @@ -684,7 +684,7 @@ H5B2__hdr_delete(H5B2_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); #ifndef NDEBUG { @@ -696,8 +696,8 @@ H5B2__hdr_delete(H5B2_hdr_t *hdr) "unable to check metadata cache status for v2 B-tree header") /* Sanity checks on v2 B-tree header */ - HDassert(hdr_status & H5AC_ES__IN_CACHE); - HDassert(hdr_status & H5AC_ES__IS_PROTECTED); + assert(hdr_status & H5AC_ES__IN_CACHE); + assert(hdr_status & H5AC_ES__IS_PROTECTED); } /* end block */ #endif /* NDEBUG */ diff --git a/src/H5B2int.c b/src/H5B2int.c index 3ce3e15..a2c021f 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -153,9 +153,9 @@ H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(internal); - HDassert(internal_flags_ptr); + assert(hdr); + assert(internal); + assert(internal_flags_ptr); /* Slide records in parent node up one space, to make room for promoted record */ if (idx < internal->nrec) { @@ -350,7 +350,7 @@ H5B2__split_root(H5B2_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); + assert(hdr); /* Update depth of B-tree */ hdr->depth++; @@ -437,8 +437,8 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(internal); + assert(hdr); + assert(internal); /* Check for the kind of B-tree node to redistribute */ if (depth > 1) { @@ -582,7 +582,7 @@ H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, (uint16_t)(*left_nrec - new_left_nrec); /* Number of records to move from left node to right */ /* Sanity check */ - HDassert(*left_nrec > *right_nrec); + assert(*left_nrec > *right_nrec); /* Slide records in right node up */ HDmemmove(H5B2_NAT_NREC(right_native, hdr, move_nrec), H5B2_NAT_NREC(right_native, hdr, 0), @@ -716,9 +716,9 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(internal); - HDassert(internal_flags_ptr); + assert(hdr); + assert(internal); + assert(internal_flags_ptr); /* Check for the kind of B-tree node to redistribute */ if (depth > 1) { @@ -806,8 +806,8 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, uint16_t curr_middle_nrec = *middle_nrec; /* Sanity check rounding */ - HDassert(new_middle_nrec <= new_left_nrec); - HDassert(new_middle_nrec <= new_right_nrec); + assert(new_middle_nrec <= new_left_nrec); + assert(new_middle_nrec <= new_right_nrec); /* Move records into left node */ if (new_left_nrec > *left_nrec) { @@ -1135,10 +1135,10 @@ H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node_ptr); - HDassert(internal); - HDassert(internal_flags_ptr); + assert(hdr); + assert(curr_node_ptr); + assert(internal); + assert(internal_flags_ptr); /* Check for the kind of B-tree node to split */ if (depth > 1) { @@ -1317,10 +1317,10 @@ H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node_ptr); - HDassert(internal); - HDassert(internal_flags_ptr); + assert(hdr); + assert(curr_node_ptr); + assert(internal); + assert(internal_flags_ptr); /* Check for the kind of B-tree node to split */ if (depth > 1) { @@ -1565,8 +1565,8 @@ H5B2__insert(H5B2_hdr_t *hdr, void *udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(udata); + assert(hdr); + assert(udata); /* Check if the root node is allocated yet */ if (!H5_addr_defined(hdr->root.addr)) { @@ -1631,9 +1631,9 @@ H5B2__iterate_node(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node); - HDassert(op); + assert(hdr); + assert(curr_node); + assert(op); /* Protect current node & set up variables */ if (depth > 0) { @@ -1748,8 +1748,8 @@ H5B2__delete_node(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, v FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node); + assert(hdr); + assert(curr_node); if (depth > 0) { H5B2_internal_t *internal; /* Pointer to internal node */ @@ -1830,10 +1830,10 @@ H5B2__node_size(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node, voi FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node); - HDassert(btree_size); - HDassert(depth > 0); + assert(hdr); + assert(curr_node); + assert(btree_size); + assert(depth > 0); /* Lock the current B-tree node */ if (NULL == @@ -1883,8 +1883,8 @@ H5B2__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(parent_entry); - HDassert(child_entry); + assert(parent_entry); + assert(child_entry); /* Create a flush dependency between parent and child entry */ if (H5AC_create_flush_dependency(parent_entry, child_entry) < 0) @@ -1918,11 +1918,11 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, H5B2_node_ptr_t *node FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(hdr); - HDassert(depth > 0); - HDassert(node_ptr); - HDassert(old_parent); - HDassert(new_parent); + assert(hdr); + assert(depth > 0); + assert(node_ptr); + assert(old_parent); + assert(new_parent); /* Check the node's entry status in the metadata cache */ if (H5AC_get_entry_status(hdr->f, node_ptr->addr, &node_status) < 0) @@ -1949,7 +1949,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, H5B2_node_ptr_t *node update_deps = TRUE; } /* end if */ else - HDassert(child_int->parent == new_parent); + assert(child_int->parent == new_parent); } /* end if */ else { H5B2_leaf_t *child_leaf; @@ -1966,13 +1966,13 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, H5B2_node_ptr_t *node update_deps = TRUE; } /* end if */ else - HDassert(child_leaf->parent == new_parent); + assert(child_leaf->parent == new_parent); } /* end else */ /* Update flush dependencies if necessary */ if (update_deps) { /* Sanity check */ - HDassert(parent_ptr); + assert(parent_ptr); /* Switch the flush dependency for the node */ if (H5B2__destroy_flush_depend((H5AC_info_t *)old_parent, (H5AC_info_t *)child) < 0) @@ -2014,12 +2014,12 @@ H5B2__update_child_flush_depends(H5B2_hdr_t *hdr, unsigned depth, H5B2_node_ptr_ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(hdr); - HDassert(depth > 1); - HDassert(node_ptrs); - HDassert(start_idx <= end_idx); - HDassert(old_parent); - HDassert(new_parent); + assert(hdr); + assert(depth > 1); + assert(node_ptrs); + assert(start_idx <= end_idx); + assert(old_parent); + assert(new_parent); /* Loop over children */ for (u = start_idx; u < end_idx; u++) @@ -2051,8 +2051,8 @@ H5B2__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(parent_entry); - HDassert(child_entry); + assert(parent_entry); + assert(child_entry); /* Destroy a flush dependency between parent and child entry */ if (H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) diff --git a/src/H5B2internal.c b/src/H5B2internal.c index 6fe586f..6ce8cfb 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -90,9 +90,9 @@ H5B2__create_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(node_ptr); - HDassert(depth > 0); + assert(hdr); + assert(node_ptr); + assert(depth > 0); /* Allocate memory for internal node information */ if (NULL == (internal = H5FL_CALLOC(H5B2_internal_t))) @@ -190,13 +190,13 @@ H5B2__protect_internal(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(node_ptr); - HDassert(H5_addr_defined(node_ptr->addr)); - HDassert(depth > 0); + assert(hdr); + assert(node_ptr); + assert(H5_addr_defined(node_ptr->addr)); + assert(depth > 0); /* only H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data for callback */ udata.f = hdr->f; @@ -289,11 +289,11 @@ H5B2__neighbor_internal(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_n FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(depth > 0); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); - HDassert(op); + assert(hdr); + assert(depth > 0); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); + assert(op); /* Lock current B-tree node */ if (NULL == @@ -313,7 +313,7 @@ H5B2__neighbor_internal(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_n neighbor_loc = H5B2_INT_NREC(internal, hdr, idx - 1); } /* end if */ else { - HDassert(comp == H5B2_COMPARE_GREATER); + assert(comp == H5B2_COMPARE_GREATER); if (idx < internal->nrec) neighbor_loc = H5B2_INT_NREC(internal, hdr, idx); @@ -366,10 +366,10 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(depth > 0); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(hdr); + assert(depth > 0); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ if (NULL == @@ -377,7 +377,7 @@ H5B2__insert_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Sanity check number of records */ - HDassert(internal->nrec == curr_node_ptr->node_nrec); + assert(internal->nrec == curr_node_ptr->node_nrec); /* Split or redistribute child node pointers, if necessary */ { @@ -537,10 +537,10 @@ H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(depth > 0); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(hdr); + assert(depth > 0); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ if (NULL == @@ -548,7 +548,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") /* Sanity check number of records */ - HDassert(internal->nrec == curr_node_ptr->node_nrec); + assert(internal->nrec == curr_node_ptr->node_nrec); /* Locate node pointer for child */ if (H5B2__locate_record(hdr->cls, internal->nrec, hdr->nat_off, internal->int_native, udata, &idx, &cmp) < @@ -562,7 +562,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in /* Make callback for current record */ if ((op)(H5B2_INT_NREC(internal, hdr, idx), op_data, &changed) < 0) { /* Make certain that the callback didn't modify the value if it failed */ - HDassert(changed == FALSE); + assert(changed == FALSE); HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree update operation") @@ -691,7 +691,7 @@ H5B2__update_internal(H5B2_hdr_t *hdr, uint16_t depth, unsigned *parent_cache_in case H5B2_UPDATE_UNKNOWN: default: - HDassert(0 && "Invalid update status"); + assert(0 && "Invalid update status"); HGOTO_ERROR(H5E_BTREE, H5E_CANTUPDATE, FAIL, "invalid update status") } /* end switch */ } /* end else */ @@ -746,12 +746,12 @@ H5B2__shadow_internal(H5B2_internal_t *internal, H5B2_node_ptr_t *curr_node_ptr) /* * Check arguments. */ - HDassert(internal); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(internal); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); hdr = internal->hdr; - HDassert(hdr); - HDassert(hdr->swmr_write); + assert(hdr); + assert(hdr->swmr_write); /* We only need to shadow the node if it has not been shadowed since the * last time the header was flushed, as otherwise it will be unreachable by @@ -819,11 +819,11 @@ H5B2__remove_internal(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *swap_loc, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(depth > 0); - HDassert(parent_cache_info); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(hdr); + assert(depth > 0); + assert(parent_cache_info); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ if (NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, FALSE, @@ -1063,19 +1063,19 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(depth > 0); - HDassert(parent_cache_info); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(hdr); + assert(depth > 0); + assert(parent_cache_info); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ if (NULL == (internal = H5B2__protect_internal(hdr, parent_cache_info, curr_node_ptr, depth, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree internal node") internal_addr = curr_node_ptr->addr; - HDassert(internal->nrec == curr_node_ptr->node_nrec); - HDassert(depth == hdr->depth || internal->nrec > 1); + assert(internal->nrec == curr_node_ptr->node_nrec); + assert(depth == hdr->depth || internal->nrec > 1); /* Determine the correct number of records to merge at */ merge_nrec = hdr->node_info[depth - 1].merge_nrec; @@ -1084,7 +1084,7 @@ H5B2__remove_internal_by_idx(H5B2_hdr_t *hdr, hbool_t *depth_decreased, void *sw /* (The root node is the only internal node allowed to have 1 record) */ if (internal->nrec == 1 && ((internal->node_ptrs[0].node_nrec + internal->node_ptrs[1].node_nrec) <= ((merge_nrec * 2) + 1))) { - HDassert(depth == hdr->depth); + assert(depth == hdr->depth); /* Merge children of root node */ if (H5B2__merge2(hdr, depth, curr_node_ptr, parent_cache_info_flags_ptr, internal, &internal_flags, @@ -1347,7 +1347,7 @@ H5B2__internal_free(H5B2_internal_t *internal) /* * Check arguments. */ - HDassert(internal); + assert(internal); /* Release internal node's native key buffer */ if (internal->int_native) @@ -1364,7 +1364,7 @@ H5B2__internal_free(H5B2_internal_t *internal) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement ref. count on B-tree header") /* Sanity check */ - HDassert(NULL == internal->top_proxy); + assert(NULL == internal->top_proxy); /* Free B-tree internal node info */ internal = H5FL_FREE(H5B2_internal_t, internal); @@ -1395,22 +1395,22 @@ H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_U uint16_t u, v; /* Local index variables */ /* General sanity checking on node */ - HDassert(internal->nrec <= hdr->node_info->split_nrec); + assert(internal->nrec <= hdr->node_info->split_nrec); /* Sanity checking on node pointers */ tot_all_nrec = internal->nrec; for (u = 0; u < internal->nrec + 1; u++) { tot_all_nrec += internal->node_ptrs[u].all_nrec; - HDassert(H5_addr_defined(internal->node_ptrs[u].addr)); - HDassert(internal->node_ptrs[u].addr > 0); + assert(H5_addr_defined(internal->node_ptrs[u].addr)); + assert(internal->node_ptrs[u].addr > 0); for (v = 0; v < u; v++) - HDassert(internal->node_ptrs[u].addr != internal->node_ptrs[v].addr); + assert(internal->node_ptrs[u].addr != internal->node_ptrs[v].addr); } /* end for */ /* Sanity check all_nrec total in parent */ if (parent_all_nrec > 0) - HDassert(tot_all_nrec == parent_all_nrec); + assert(tot_all_nrec == parent_all_nrec); return (0); } /* end H5B2__assert_internal() */ @@ -1435,24 +1435,24 @@ H5B2__assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_ uint16_t u, v; /* Local index variables */ /* General sanity checking on node */ - HDassert(internal->nrec <= hdr->node_info->split_nrec); + assert(internal->nrec <= hdr->node_info->split_nrec); /* Sanity checking on node pointers */ tot_all_nrec = internal->nrec; for (u = 0; u < internal->nrec + 1; u++) { tot_all_nrec += internal->node_ptrs[u].all_nrec; - HDassert(H5_addr_defined(internal->node_ptrs[u].addr)); - HDassert(internal->node_ptrs[u].addr > 0); + assert(H5_addr_defined(internal->node_ptrs[u].addr)); + assert(internal->node_ptrs[u].addr > 0); for (v = 0; v < u; v++) - HDassert(internal->node_ptrs[u].addr != internal->node_ptrs[v].addr); + assert(internal->node_ptrs[u].addr != internal->node_ptrs[v].addr); for (v = 0; v < internal2->nrec + 1; v++) - HDassert(internal->node_ptrs[u].addr != internal2->node_ptrs[v].addr); + assert(internal->node_ptrs[u].addr != internal2->node_ptrs[v].addr); } /* end for */ /* Sanity check all_nrec total in parent */ if (parent_all_nrec > 0) - HDassert(tot_all_nrec == parent_all_nrec); + assert(tot_all_nrec == parent_all_nrec); return (0); } /* end H5B2__assert_internal2() */ diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index 390c9d6..84e0afd 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -91,8 +91,8 @@ H5B2__create_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(node_ptr); + assert(hdr); + assert(node_ptr); /* Allocate memory for leaf information */ if (NULL == (leaf = H5FL_CALLOC(H5B2_leaf_t))) @@ -178,12 +178,12 @@ H5B2__protect_leaf(H5B2_hdr_t *hdr, void *parent, H5B2_node_ptr_t *node_ptr, hbo FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(node_ptr); - HDassert(H5_addr_defined(node_ptr->addr)); + assert(hdr); + assert(node_ptr); + assert(H5_addr_defined(node_ptr->addr)); /* only H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data for callback */ udata.f = hdr->f; @@ -273,10 +273,10 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, void *neigh FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); - HDassert(op); + assert(hdr); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); + assert(op); /* Lock current B-tree node */ if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__READ_ONLY_FLAG))) @@ -296,7 +296,7 @@ H5B2__neighbor_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, void *neigh neighbor_loc = H5B2_LEAF_NREC(leaf, hdr, idx - 1); } /* end if */ else { - HDassert(comp == H5B2_COMPARE_GREATER); + assert(comp == H5B2_COMPARE_GREATER); if (idx < leaf->nrec) neighbor_loc = H5B2_LEAF_NREC(leaf, hdr, idx); @@ -345,20 +345,20 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_ FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(hdr); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Must have a leaf node with enough space to insert a record now */ - HDassert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec); + assert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec); /* Sanity check number of records */ - HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec); - HDassert(leaf->nrec == curr_node_ptr->node_nrec); + assert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec); + assert(leaf->nrec == curr_node_ptr->node_nrec); /* Check for inserting into empty leaf */ if (leaf->nrec == 0) @@ -459,17 +459,17 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_s FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(hdr); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "unable to protect B-tree leaf node") /* Sanity check number of records */ - HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec); - HDassert(leaf->nrec == curr_node_ptr->node_nrec); + assert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec); + assert(leaf->nrec == curr_node_ptr->node_nrec); /* Check for inserting into empty leaf */ if (leaf->nrec == 0) @@ -508,7 +508,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_s /* Make callback for current record */ if ((op)(H5B2_LEAF_NREC(leaf, hdr, idx), op_data, &changed) < 0) { /* Make certain that the callback didn't modify the value if it failed */ - HDassert(changed == FALSE); + assert(changed == FALSE); HGOTO_ERROR(H5E_BTREE, H5E_CANTMODIFY, FAIL, "'modify' callback failed for B-tree update operation") @@ -522,7 +522,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_update_s } /* end if */ else { /* Must have a leaf node with enough space to insert a record now */ - HDassert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec); + assert(curr_node_ptr->node_nrec < hdr->node_info[0].max_nrec); /* Make callback to store record in native form */ if ((hdr->cls->store)(H5B2_LEAF_NREC(leaf, hdr, idx), udata) < 0) @@ -615,10 +615,10 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsi FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(internal); - HDassert(internal_flags_ptr); - HDassert(idx <= internal->nrec); + assert(hdr); + assert(internal); + assert(internal_flags_ptr); + assert(idx <= internal->nrec); /* Check for the kind of B-tree node to swap */ if (depth > 1) { @@ -706,12 +706,12 @@ H5B2__shadow_leaf(H5B2_leaf_t *leaf, H5B2_node_ptr_t *curr_node_ptr) /* * Check arguments. */ - HDassert(leaf); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(leaf); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); hdr = leaf->hdr; - HDassert(hdr); - HDassert(hdr->swmr_write); + assert(hdr); + assert(hdr->swmr_write); /* We only need to shadow the node if it has not been shadowed since the * last time the header was flushed, as otherwise it will be unreachable by @@ -773,9 +773,9 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_ FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(hdr); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock current B-tree node */ if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) @@ -783,8 +783,8 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_nodepos_ leaf_addr = curr_node_ptr->addr; /* Sanity check number of records */ - HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec); - HDassert(leaf->nrec == curr_node_ptr->node_nrec); + assert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec); + assert(leaf->nrec == curr_node_ptr->node_nrec); /* Find correct location to remove this record */ if (H5B2__locate_record(hdr->cls, leaf->nrec, hdr->nat_off, leaf->leaf_native, udata, &idx, &cmp) < 0) @@ -879,9 +879,9 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_n FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(curr_node_ptr); - HDassert(H5_addr_defined(curr_node_ptr->addr)); + assert(hdr); + assert(curr_node_ptr); + assert(H5_addr_defined(curr_node_ptr->addr)); /* Lock B-tree leaf node */ if (NULL == (leaf = H5B2__protect_leaf(hdr, parent, curr_node_ptr, FALSE, H5AC__NO_FLAGS_SET))) @@ -889,9 +889,9 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, H5B2_node_ptr_t *curr_node_ptr, H5B2_n leaf_addr = curr_node_ptr->addr; /* Sanity check number of records */ - HDassert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec); - HDassert(leaf->nrec == curr_node_ptr->node_nrec); - HDassert(idx < leaf->nrec); + assert(curr_node_ptr->all_nrec == curr_node_ptr->node_nrec); + assert(leaf->nrec == curr_node_ptr->node_nrec); + assert(idx < leaf->nrec); /* Check for invalidating the min/max record for the tree */ if (H5B2_POS_MIDDLE != curr_pos) { @@ -977,7 +977,7 @@ H5B2__leaf_free(H5B2_leaf_t *leaf) /* * Check arguments. */ - HDassert(leaf); + assert(leaf); /* Release leaf's native key buffer */ if (leaf->leaf_native) @@ -988,7 +988,7 @@ H5B2__leaf_free(H5B2_leaf_t *leaf) HGOTO_ERROR(H5E_BTREE, H5E_CANTDEC, FAIL, "can't decrement ref. count on B-tree header") /* Sanity check */ - HDassert(NULL == leaf->top_proxy); + assert(NULL == leaf->top_proxy); /* Free B-tree leaf node info */ leaf = H5FL_FREE(H5B2_leaf_t, leaf); @@ -1015,7 +1015,7 @@ H5_ATTR_PURE herr_t H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_leaf_t H5_ATTR_NDEBUG_UNUSED *leaf) { /* General sanity checking on node */ - HDassert(leaf->nrec <= hdr->node_info->split_nrec); + assert(leaf->nrec <= hdr->node_info->split_nrec); return (0); } /* end H5B2__assert_leaf() */ @@ -1037,7 +1037,7 @@ H5B2__assert_leaf2(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_leaf_ const H5B2_leaf_t H5_ATTR_UNUSED *leaf2) { /* General sanity checking on node */ - HDassert(leaf->nrec <= hdr->node_info->split_nrec); + assert(leaf->nrec <= hdr->node_info->split_nrec); return (0); } /* end H5B2__assert_leaf2() */ diff --git a/src/H5B2stat.c b/src/H5B2stat.c index 1295638..4b399ba 100644 --- a/src/H5B2stat.c +++ b/src/H5B2stat.c @@ -76,7 +76,7 @@ H5B2_stat_info(H5B2_t *bt2, H5B2_stat_t *info) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(info); + assert(info); /* Get information about the B-tree */ info->depth = bt2->hdr->depth; @@ -107,8 +107,8 @@ H5B2_size(H5B2_t *bt2, hsize_t *btree_size) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(bt2); - HDassert(btree_size); + assert(bt2); + assert(btree_size); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; diff --git a/src/H5B2test.c b/src/H5B2test.c index 8b278da..9a72d59 100644 --- a/src/H5B2test.c +++ b/src/H5B2test.c @@ -138,7 +138,7 @@ H5B2__test_crt_context(void *_f) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); + assert(f); /* Allocate callback context */ if (NULL == (ctx = H5FL_MALLOC(H5B2_test_ctx_t))) @@ -175,7 +175,7 @@ H5B2__test_dst_context(void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Release callback context */ ctx = H5FL_FREE(H5B2_test_ctx_t, ctx); @@ -251,7 +251,7 @@ H5B2__test_encode(uint8_t *raw, const void *nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); H5_ENCODE_LENGTH_LEN(raw, *(const hsize_t *)nrecord, ctx->sizeof_size); @@ -279,7 +279,7 @@ H5B2__test_decode(const uint8_t *raw, void *nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); H5_DECODE_LENGTH_LEN(raw, *(hsize_t *)nrecord, ctx->sizeof_size); @@ -304,7 +304,7 @@ H5B2__test_debug(FILE *stream, int indent, int fwidth, const void *record, const { FUNC_ENTER_PACKAGE_NOERR - HDassert(record); + assert(record); HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Record:", *(const hsize_t *)record); @@ -379,7 +379,7 @@ H5B2__test2_encode(uint8_t *raw, const void *nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); H5_ENCODE_LENGTH_LEN(raw, ((const H5B2_test_rec_t *)nrecord)->key, ctx->sizeof_size); H5_ENCODE_LENGTH_LEN(raw, ((const H5B2_test_rec_t *)nrecord)->val, ctx->sizeof_size); @@ -408,7 +408,7 @@ H5B2__test2_decode(const uint8_t *raw, void *nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); H5_DECODE_LENGTH_LEN(raw, ((H5B2_test_rec_t *)nrecord)->key, ctx->sizeof_size); H5_DECODE_LENGTH_LEN(raw, ((H5B2_test_rec_t *)nrecord)->val, ctx->sizeof_size); @@ -434,7 +434,7 @@ H5B2__test2_debug(FILE *stream, int indent, int fwidth, const void *record, cons { FUNC_ENTER_PACKAGE_NOERR - HDassert(record); + assert(record); HDfprintf(stream, "%*s%-*s (%" PRIuHSIZE ", %" PRIuHSIZE ")\n", indent, "", fwidth, "Record:", ((const H5B2_test_rec_t *)record)->key, ((const H5B2_test_rec_t *)record)->val); @@ -460,8 +460,8 @@ H5B2__get_root_addr_test(H5B2_t *bt2, haddr_t *root_addr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(bt2); - HDassert(root_addr); + assert(bt2); + assert(root_addr); /* Get B-tree root addr */ *root_addr = bt2->hdr->root.addr; @@ -495,7 +495,7 @@ H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(bt2); + assert(bt2); /* Set the shared v2 B-tree header's file context for this operation */ bt2->hdr->f = bt2->f; @@ -609,7 +609,7 @@ H5B2__get_node_info_test(H5B2_t *bt2, void *udata, H5B2_node_info_test_t *ninfo) done: if (parent) { - HDassert(ret_value < 0); + assert(ret_value < 0); if (parent != hdr && H5AC_unpin_entry(parent) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPIN, FAIL, "unable to unpin parent entry") } /* end if */ @@ -643,7 +643,7 @@ H5B2__get_node_depth_test(H5B2_t *bt2, void *udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(bt2); + assert(bt2); /* Get information abou the node */ if (H5B2__get_node_info_test(bt2, udata, &ninfo) < 0) diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 437bc1b..692b1ce 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -95,12 +95,12 @@ H5B__cache_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(image_len); + assert(udata); + assert(image_len); /* Get shared info for B-tree */ shared = (H5B_shared_t *)H5UC_GET_OBJ(udata->rc_shared); - HDassert(shared); + assert(shared); /* Set the image length size */ *image_len = shared->sizeof_rnode; @@ -132,8 +132,8 @@ H5B__cache_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* Allocate the B-tree node in memory */ if (NULL == (bt = H5FL_MALLOC(H5B_t))) @@ -239,12 +239,12 @@ H5B__cache_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(bt); - HDassert(image_len); + assert(bt); + assert(image_len); /* Get shared info for B-tree */ shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); - HDassert(shared); + assert(shared); /* Set the image length size */ *image_len = shared->sizeof_rnode; @@ -273,13 +273,13 @@ H5B__cache_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, vo FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(image); - HDassert(bt); - HDassert(bt->rc_shared); + assert(image); + assert(bt); + assert(bt->rc_shared); shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); - HDassert(shared); - HDassert(shared->type); - HDassert(shared->type->encode); + assert(shared); + assert(shared->type); + assert(shared->type->encode); /* magic number */ H5MM_memcpy(image, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -322,7 +322,7 @@ H5B__cache_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, vo } /* end if */ /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) <= len); + assert((size_t)(image - (uint8_t *)_image) <= len); /* Clear rest of node */ HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image)); @@ -347,7 +347,7 @@ H5B__cache_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Destroy B-tree node */ if (H5B__node_dest((H5B_t *)thing) < 0) diff --git a/src/H5Bdbg.c b/src/H5Bdbg.c index 6e4c4b2..46ed7f4 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -62,21 +62,21 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5 /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(type); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(type); /* Currently does not support SWMR access */ - HDassert(!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)); + assert(!(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE)); /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + assert(shared); /* * Load the tree node. @@ -116,12 +116,12 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5 if (type->debug_key) { /* Decode the 'left' key & print it */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(3, fwidth) - 3, "Left Key:"); - HDassert(H5B_NKEY(bt, shared, u)); + assert(H5B_NKEY(bt, shared, u)); (void)(type->debug_key)(stream, indent + 6, MAX(6, fwidth) - 6, H5B_NKEY(bt, shared, u), udata); /* Decode the 'right' key & print it */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(3, fwidth) - 3, "Right Key:"); - HDassert(H5B_NKEY(bt, shared, u + 1)); + assert(H5B_NKEY(bt, shared, u + 1)); (void)(type->debug_key)(stream, indent + 6, MAX(6, fwidth) - 6, H5B_NKEY(bt, shared, u + 1), udata); } /* end if */ @@ -179,24 +179,24 @@ H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) if (NULL == (rc_shared = (type->get_shared)(f, udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + assert(shared); /* Initialize the queue */ cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG); - HDassert(bt); + assert(bt); shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); - HDassert(shared); + assert(shared); cur = (struct child_t *)H5MM_calloc(sizeof(struct child_t)); - HDassert(cur); + assert(cur); cur->addr = addr; cur->level = bt->level; head = tail = cur; status = H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET); - HDassert(status >= 0); + assert(status >= 0); bt = NULL; /* Make certain future references will be caught */ /* @@ -207,18 +207,18 @@ H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) */ for (ncell = 0; cur; ncell++) { bt = (H5B_t *)H5AC_protect(f, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG); - HDassert(bt); + assert(bt); /* Check node header */ - HDassert(bt->level == cur->level); + assert(bt->level == cur->level); if (cur->next && cur->next->level == bt->level) - HDassert(H5_addr_eq(bt->right, cur->next->addr)); + assert(H5_addr_eq(bt->right, cur->next->addr)); else - HDassert(!H5_addr_defined(bt->right)); + assert(!H5_addr_defined(bt->right)); if (prev && prev->level == bt->level) - HDassert(H5_addr_eq(bt->left, prev->addr)); + assert(H5_addr_eq(bt->left, prev->addr)); else - HDassert(!H5_addr_defined(bt->left)); + assert(!H5_addr_defined(bt->left)); if (cur->level > 0) { unsigned u; @@ -229,11 +229,11 @@ H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) * have then the tree has a cycle. */ for (tmp = head; tmp; tmp = tmp->next) - HDassert(H5_addr_ne(tmp->addr, bt->child[u])); + assert(H5_addr_ne(tmp->addr, bt->child[u])); /* Add the child node to the end of the queue */ tmp = (struct child_t *)H5MM_calloc(sizeof(struct child_t)); - HDassert(tmp); + assert(tmp); tmp->addr = bt->child[u]; tmp->level = bt->level - 1; tail->next = tmp; @@ -241,13 +241,13 @@ H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) /* Check that the keys are monotonically increasing */ cmp = (type->cmp2)(H5B_NKEY(bt, shared, u), udata, H5B_NKEY(bt, shared, u + 1)); - HDassert(cmp < 0); + assert(cmp < 0); } /* end for */ } /* end if */ /* Release node */ status = H5AC_unprotect(f, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET); - HDassert(status >= 0); + assert(status >= 0); bt = NULL; /* Make certain future references will be caught */ /* Advance current location in queue */ diff --git a/src/H5C.c b/src/H5C.c index b85a545..6a71308 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -133,17 +133,17 @@ H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, FUNC_ENTER_NOAPI(NULL) - HDassert(max_cache_size >= H5C__MIN_MAX_CACHE_SIZE); - HDassert(max_cache_size <= H5C__MAX_MAX_CACHE_SIZE); - HDassert(min_clean_size <= max_cache_size); + assert(max_cache_size >= H5C__MIN_MAX_CACHE_SIZE); + assert(max_cache_size <= H5C__MAX_MAX_CACHE_SIZE); + assert(min_clean_size <= max_cache_size); - HDassert(max_type_id >= 0); - HDassert(max_type_id < H5C__MAX_NUM_TYPE_IDS); - HDassert(class_table_ptr); + assert(max_type_id >= 0); + assert(max_type_id < H5C__MAX_NUM_TYPE_IDS); + assert(class_table_ptr); for (i = 0; i <= max_type_id; i++) { - HDassert((class_table_ptr)[i]); - HDassert(HDstrlen((class_table_ptr)[i]->name) > 0); + assert((class_table_ptr)[i]); + assert(HDstrlen((class_table_ptr)[i]->name) > 0); } /* end for */ if (NULL == (cache_ptr = H5FL_CALLOC(H5C_t))) @@ -404,11 +404,11 @@ H5C_prep_for_file_close(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); cache_ptr = f->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); /* It is possible to receive the close warning more than once */ if (cache_ptr->close_warning_received) @@ -416,7 +416,7 @@ H5C_prep_for_file_close(H5F_t *f) cache_ptr->close_warning_received = TRUE; /* Make certain there aren't any protected entries */ - HDassert(cache_ptr->pl_len == 0); + assert(cache_ptr->pl_len == 0); /* Prepare cache image */ if (H5C__prep_image_for_file_close(f, &image_generated) < 0) @@ -495,8 +495,8 @@ H5C_dest(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(cache_ptr); - HDassert(cache_ptr->close_warning_received); + assert(cache_ptr); + assert(cache_ptr->close_warning_received); #if H5AC_DUMP_IMAGE_STATS_ON_CLOSE if (H5C__image_stats(cache_ptr, TRUE) < 0) @@ -520,8 +520,8 @@ H5C_dest(H5F_t *f) * point? If no, shouldn't this if statement be an assert? */ if (cache_ptr->slist_ptr != NULL) { - HDassert(cache_ptr->slist_len == 0); - HDassert(cache_ptr->slist_size == 0); + assert(cache_ptr->slist_len == 0); + assert(cache_ptr->slist_size == 0); H5SL_close(cache_ptr->slist_ptr); cache_ptr->slist_ptr = NULL; @@ -578,7 +578,7 @@ H5C_evict(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); + assert(f); /* Enable the slist, as it is needed in the flush */ if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) @@ -634,19 +634,19 @@ H5C_flush_cache(H5F_t *f, unsigned flags) FUNC_ENTER_NOAPI(FAIL) - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->slist_ptr); + assert(cache_ptr); + assert(cache_ptr->slist_ptr); #ifdef H5C_DO_SANITY_CHECKS - HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); + assert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); + assert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); for (i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { index_len += cache_ptr->index_ring_len[i]; @@ -658,12 +658,12 @@ H5C_flush_cache(H5F_t *f, unsigned flags) slist_size += cache_ptr->slist_ring_size[i]; } /* end for */ - HDassert(cache_ptr->index_len == index_len); - HDassert(cache_ptr->index_size == index_size); - HDassert(cache_ptr->clean_index_size == clean_index_size); - HDassert(cache_ptr->dirty_index_size == dirty_index_size); - HDassert(cache_ptr->slist_len == slist_len); - HDassert(cache_ptr->slist_size == slist_size); + assert(cache_ptr->index_len == index_len); + assert(cache_ptr->index_size == index_size); + assert(cache_ptr->clean_index_size == clean_index_size); + assert(cache_ptr->dirty_index_size == dirty_index_size); + assert(cache_ptr->slist_len == slist_len); + assert(cache_ptr->slist_size == slist_size); #endif /* H5C_DO_SANITY_CHECKS */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS @@ -673,8 +673,8 @@ H5C_flush_cache(H5F_t *f, unsigned flags) #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ destroy = ((flags & H5C__FLUSH_INVALIDATE_FLAG) != 0); - HDassert(!(destroy && ((flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0))); - HDassert(!(cache_ptr->flush_in_progress)); + assert(!(destroy && ((flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0))); + assert(!(cache_ptr->flush_in_progress)); cache_ptr->flush_in_progress = TRUE; @@ -765,10 +765,10 @@ H5C_flush_to_min_clean(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); if (cache_ptr->check_write_permitted != NULL) { if ((cache_ptr->check_write_permitted)(f, &write_permitted) < 0) @@ -956,9 +956,9 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_p * * by definition. */ - HDassert(new_min_clean_size <= new_max_cache_size); - HDassert(cache_ptr->resize_ctl.min_size <= new_max_cache_size); - HDassert(new_max_cache_size <= cache_ptr->resize_ctl.max_size); + assert(new_min_clean_size <= new_max_cache_size); + assert(cache_ptr->resize_ctl.min_size <= new_max_cache_size); + assert(new_max_cache_size <= cache_ptr->resize_ctl.max_size); if (new_max_cache_size < cache_ptr->max_cache_size) cache_ptr->size_decreased = TRUE; @@ -1142,7 +1142,7 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_sli * and in any case, there is no requirement that all dirty entries * will reside on the dirty LRU. */ - HDassert(cache_ptr->dirty_index_size == cache_ptr->slist_size); + assert(cache_ptr->dirty_index_size == cache_ptr->slist_size); } else { /* take down the skip list */ if (!cache_ptr->slist_enabled) @@ -1165,8 +1165,8 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_sli cache_ptr->slist_enabled = FALSE; - HDassert(0 == cache_ptr->slist_len); - HDassert(0 == cache_ptr->slist_size); + assert(0 == cache_ptr->slist_len); + assert(0 == cache_ptr->slist_size); } done: @@ -1206,10 +1206,10 @@ H5C_unsettle_ring(H5F_t *f, H5C_ring_t ring) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - HDassert((H5C_RING_RDFSM == ring) || (H5C_RING_MDFSM == ring)); + assert(f); + assert(f->shared); + assert(f->shared->cache); + assert((H5C_RING_RDFSM == ring) || (H5C_RING_MDFSM == ring)); cache_ptr = f->shared->cache; switch (ring) { @@ -1230,7 +1230,7 @@ H5C_unsettle_ring(H5F_t *f, H5C_ring_t ring) break; default: - HDassert(FALSE); /* this should be un-reachable */ + assert(FALSE); /* this should be un-reachable */ break; } /* end switch */ @@ -1403,15 +1403,15 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) FUNC_ENTER_NOAPI_NOINIT /* Assertions */ - HDassert(cache_ptr != NULL); - HDassert(H5_addr_defined(obj_addr)); - HDassert(action == H5C__SET_CORK || action == H5C__UNCORK || action == H5C__GET_CORKED); + assert(cache_ptr != NULL); + assert(H5_addr_defined(obj_addr)); + assert(action == H5C__SET_CORK || action == H5C__UNCORK || action == H5C__GET_CORKED); /* Search the list of corked object addresses in the cache */ HASH_FIND(hh, cache_ptr->tag_list, &obj_addr, sizeof(haddr_t), tag_info); if (H5C__GET_CORKED == action) { - HDassert(corked); + assert(corked); if (tag_info != NULL && tag_info->corked) *corked = TRUE; else @@ -1419,7 +1419,7 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) } else { /* Sanity check */ - HDassert(H5C__SET_CORK == action || H5C__UNCORK == action); + assert(H5C__SET_CORK == action || H5C__UNCORK == action); /* Perform appropriate action */ if (H5C__SET_CORK == action) { @@ -1439,7 +1439,7 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) /* Check for object already corked */ if (tag_info->corked) HGOTO_ERROR(H5E_CACHE, H5E_CANTCORK, FAIL, "object already corked") - HDassert(tag_info->entry_cnt > 0 && tag_info->head); + assert(tag_info->entry_cnt > 0 && tag_info->head); } /* Set the corked status for the entire object */ @@ -1462,7 +1462,7 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) /* Remove the tag info from the tag list, if there's no more entries with this tag */ if (0 == tag_info->entry_cnt) { /* Sanity check */ - HDassert(NULL == tag_info->head); + assert(NULL == tag_info->head); HASH_DELETE(hh, cache_ptr->tag_list, tag_info); @@ -1470,7 +1470,7 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) tag_info = H5FL_FREE(H5C_tag_info_t, tag_info); } else - HDassert(NULL != tag_info->head); + assert(NULL != tag_info->head); } } diff --git a/src/H5CS.c b/src/H5CS.c index a532d9c..4f625af 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -93,7 +93,7 @@ H5CS__get_stack(void) fstack = (H5CS_t *)HDmalloc( sizeof(H5CS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */ #endif /* H5_HAVE_WIN_THREADS */ - HDassert(fstack); + assert(fstack); /* Set the thread-specific info */ fstack->nused = 0; @@ -133,7 +133,7 @@ H5CS_print_stack(const H5CS_t *fstack, FILE *stream) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - HDassert(fstack); + assert(fstack); /* Default to outputting information to stderr */ if (!stream) @@ -174,9 +174,9 @@ H5CS_push(const char *func_name) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - HDassert(fstack); - HDassert(fstack->nused <= fstack->nalloc); - HDassert(func_name); + assert(fstack); + assert(fstack->nused <= fstack->nalloc); + assert(func_name); /* Check if we need to expand the stack of records */ if (fstack->nused == fstack->nalloc) { @@ -186,7 +186,7 @@ H5CS_push(const char *func_name) const char **x = (const char **)HDrealloc(fstack->rec, na * sizeof(const char *)); /* (Avoid returning an error from this routine, currently -QAK) */ - HDassert(x); + assert(x); fstack->rec = x; fstack->nalloc = na; } /* end if */ @@ -219,8 +219,8 @@ H5CS_pop(void) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - HDassert(fstack); - HDassert(fstack->nused > 0); + assert(fstack); + assert(fstack->nused > 0); /* Pop the function. */ fstack->nused--; @@ -252,7 +252,7 @@ H5CS_copy_stack(void) FUNC_ENTER_NOAPI_NOFS /* Sanity check */ - HDassert(old_stack); + assert(old_stack); /* Allocate a new stack */ /* (Don't use library allocate code, since this code stack supports it) */ @@ -294,7 +294,7 @@ H5CS_close_stack(H5CS_t *stack) FUNC_ENTER_NOAPI_NOERR_NOFS /* Sanity check */ - HDassert(stack); + assert(stack); /* Free stack */ /* The function name string are statically allocated (by the compiler) diff --git a/src/H5CX.c b/src/H5CX.c index e5595b7..c5bb520 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -741,7 +741,7 @@ H5CX__get_context(void) */ ctx = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *)); #endif /* H5_HAVE_WIN_THREADS */ - HDassert(ctx); + assert(ctx); /* Reset the thread-specific info */ *ctx = NULL; @@ -778,9 +778,9 @@ H5CX__push_common(H5CX_node_t *cnode) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(cnode); + assert(cnode); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head); + assert(head); /* Set non-zero context info */ cnode->ctx.dxpl_id = H5P_DATASET_XFER_DEFAULT; @@ -853,7 +853,7 @@ H5CX_push_special(void) /* Allocate & clear API context node, without using library API routines */ cnode = (H5CX_node_t *)HDcalloc(1, sizeof(H5CX_node_t)); - HDassert(cnode); + assert(cnode); /* Set context info */ H5CX__push_common(cnode); @@ -888,8 +888,8 @@ H5CX_retrieve_state(H5CX_state_t **api_state) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(api_state); + assert(head && *head); + assert(api_state); /* Allocate & clear API context state */ if (NULL == (*api_state = H5FL_CALLOC(H5CX_state_t))) @@ -946,7 +946,7 @@ H5CX_retrieve_state(H5CX_state_t **api_state) /* Keep a reference to the current VOL wrapping context */ (*api_state)->vol_wrap_ctx = (*head)->ctx.vol_wrap_ctx; if (NULL != (*api_state)->vol_wrap_ctx) { - HDassert((*head)->ctx.vol_wrap_ctx_valid); + assert((*head)->ctx.vol_wrap_ctx_valid); if (H5VL_inc_vol_wrapper((*api_state)->vol_wrap_ctx) < 0) HGOTO_ERROR(H5E_CONTEXT, H5E_CANTINC, FAIL, "can't increment refcount on VOL wrapping context") } /* end if */ @@ -1027,8 +1027,8 @@ H5CX_restore_state(const H5CX_state_t *api_state) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(api_state); + assert(head && *head); + assert(api_state); /* Restore the DCPL info */ (*head)->ctx.dcpl_id = api_state->dcpl_id; @@ -1086,7 +1086,7 @@ H5CX_free_state(H5CX_state_t *api_state) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(api_state); + assert(api_state); /* Release the DCPL */ if (0 != api_state->dcpl_id && H5P_DATASET_CREATE_DEFAULT != api_state->dcpl_id) @@ -1154,7 +1154,7 @@ H5CX_is_def_dxpl(void) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set return value */ is_def_dxpl = ((*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT); @@ -1183,7 +1183,7 @@ H5CX_set_dxpl(hid_t dxpl_id) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context's DXPL to a new value */ (*head)->ctx.dxpl_id = dxpl_id; @@ -1212,7 +1212,7 @@ H5CX_set_dcpl(hid_t dcpl_id) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context's DCPL to a new value */ (*head)->ctx.dcpl_id = dcpl_id; @@ -1243,7 +1243,7 @@ H5CX_set_libver_bounds(H5F_t *f) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context value */ (*head)->ctx.low_bound = (f == NULL) ? H5F_LIBVER_LATEST : H5F_LOW_BOUND(f); @@ -1277,7 +1277,7 @@ H5CX_set_lcpl(hid_t lcpl_id) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context's LCPL to a new value */ (*head)->ctx.lcpl_id = lcpl_id; @@ -1306,7 +1306,7 @@ H5CX_set_lapl(hid_t lapl_id) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context's LAPL to a new value */ (*head)->ctx.lapl_id = lapl_id; @@ -1346,10 +1346,10 @@ H5CX_set_apl(hid_t *acspl_id, const H5P_libclass_t *libclass, FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(acspl_id); - HDassert(libclass); + assert(acspl_id); + assert(libclass); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set access plist to the default property list of the appropriate class if it's the generic default */ if (H5P_DEFAULT == *acspl_id) @@ -1468,7 +1468,7 @@ H5CX_set_loc(hid_t /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set collective metadata read flag */ (*head)->ctx.coll_metadata_read = TRUE; @@ -1520,7 +1520,7 @@ H5CX_set_vol_wrap_ctx(void *vol_wrap_ctx) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context value */ (*head)->ctx.vol_wrap_ctx = vol_wrap_ctx; @@ -1553,7 +1553,7 @@ H5CX_set_vol_connector_prop(const H5VL_connector_prop_t *vol_connector_prop) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context value */ H5MM_memcpy(&(*head)->ctx.vol_connector_prop, vol_connector_prop, sizeof(H5VL_connector_prop_t)); @@ -1586,7 +1586,7 @@ H5CX_get_dxpl(void) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set return value */ dxpl_id = (*head)->ctx.dxpl_id; @@ -1616,7 +1616,7 @@ H5CX_get_lapl(void) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set return value */ lapl_id = (*head)->ctx.lapl_id; @@ -1645,7 +1645,7 @@ H5CX_get_vol_wrap_ctx(void **vol_wrap_ctx) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_wrap_ctx); + assert(vol_wrap_ctx); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ /* No error is expected at this point. But in case an application calls H5VLwrap_register @@ -1689,9 +1689,9 @@ H5CX_get_vol_connector_prop(H5VL_connector_prop_t *vol_connector_prop) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(vol_connector_prop); + assert(vol_connector_prop); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Check for value that was set */ if ((*head)->ctx.vol_connector_prop_valid) @@ -1725,7 +1725,7 @@ H5CX_get_tag(void) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set return value */ tag = (*head)->ctx.tag; @@ -1755,7 +1755,7 @@ H5CX_get_ring(void) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set return value */ ring = (*head)->ctx.ring; @@ -1787,7 +1787,7 @@ H5CX_get_coll_metadata_read(void) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set return value */ coll_md_read = (*head)->ctx.coll_metadata_read; @@ -1818,10 +1818,10 @@ H5CX_get_mpi_coll_datatypes(MPI_Datatype *btype, MPI_Datatype *ftype) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(btype); - HDassert(ftype); + assert(btype); + assert(ftype); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context values */ *btype = (*head)->ctx.btype; @@ -1852,7 +1852,7 @@ H5CX_get_mpi_file_flushing(void) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set return value */ flushing = (*head)->ctx.mpi_file_flushing; @@ -1883,7 +1883,7 @@ H5CX_get_mpio_rank0_bcast(void) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set return value */ do_rank0_bcast = (*head)->ctx.rank0_bcast; @@ -1913,10 +1913,10 @@ H5CX_get_btree_split_ratios(double split_ratio[3]) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(split_ratio); + assert(split_ratio); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_BTREE_SPLIT_RATIO_NAME, btree_split_ratio) @@ -1949,10 +1949,10 @@ H5CX_get_max_temp_buf(size_t *max_temp_buf) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(max_temp_buf); + assert(max_temp_buf); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MAX_TEMP_BUF_NAME, max_temp_buf) @@ -1984,10 +1984,10 @@ H5CX_get_tconv_buf(void **tconv_buf) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(tconv_buf); + assert(tconv_buf); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_TCONV_BUF_NAME, tconv_buf) @@ -2019,10 +2019,10 @@ H5CX_get_bkgr_buf(void **bkgr_buf) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(bkgr_buf); + assert(bkgr_buf); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_BKGR_BUF_NAME, bkgr_buf) @@ -2054,10 +2054,10 @@ H5CX_get_bkgr_buf_type(H5T_bkg_t *bkgr_buf_type) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(bkgr_buf_type); + assert(bkgr_buf_type); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_BKGR_BUF_TYPE_NAME, bkgr_buf_type) @@ -2089,10 +2089,10 @@ H5CX_get_vec_size(size_t *vec_size) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vec_size); + assert(vec_size); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_HYPER_VECTOR_SIZE_NAME, vec_size) @@ -2126,10 +2126,10 @@ H5CX_get_io_xfer_mode(H5FD_mpio_xfer_t *io_xfer_mode) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(io_xfer_mode); + assert(io_xfer_mode); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_IO_XFER_MODE_NAME, io_xfer_mode) @@ -2161,10 +2161,10 @@ H5CX_get_mpio_coll_opt(H5FD_mpio_collective_opt_t *mpio_coll_opt) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(mpio_coll_opt); + assert(mpio_coll_opt); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, mpio_coll_opt) @@ -2196,10 +2196,10 @@ H5CX_get_mpio_local_no_coll_cause(uint32_t *mpio_local_no_coll_cause) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(mpio_local_no_coll_cause); + assert(mpio_local_no_coll_cause); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_MPIO_LOCAL_NO_COLLECTIVE_CAUSE_NAME, mpio_local_no_coll_cause) @@ -2232,10 +2232,10 @@ H5CX_get_mpio_global_no_coll_cause(uint32_t *mpio_global_no_coll_cause) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(mpio_global_no_coll_cause); + assert(mpio_global_no_coll_cause); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_MPIO_GLOBAL_NO_COLLECTIVE_CAUSE_NAME, mpio_global_no_coll_cause) @@ -2268,10 +2268,10 @@ H5CX_get_mpio_chunk_opt_mode(H5FD_mpio_chunk_opt_t *mpio_chunk_opt_mode) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(mpio_chunk_opt_mode); + assert(mpio_chunk_opt_mode); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME, mpio_chunk_opt_mode) @@ -2304,10 +2304,10 @@ H5CX_get_mpio_chunk_opt_num(unsigned *mpio_chunk_opt_num) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(mpio_chunk_opt_num); + assert(mpio_chunk_opt_num); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_CHUNK_OPT_NUM_NAME, mpio_chunk_opt_num) @@ -2340,10 +2340,10 @@ H5CX_get_mpio_chunk_opt_ratio(unsigned *mpio_chunk_opt_ratio) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(mpio_chunk_opt_ratio); + assert(mpio_chunk_opt_ratio); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME, mpio_chunk_opt_ratio) @@ -2377,10 +2377,10 @@ H5CX_get_err_detect(H5Z_EDC_t *err_detect) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(err_detect); + assert(err_detect); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_EDC_NAME, err_detect) @@ -2412,10 +2412,10 @@ H5CX_get_filter_cb(H5Z_cb_t *filter_cb) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(filter_cb); + assert(filter_cb); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_FILTER_CB_NAME, filter_cb) @@ -2447,10 +2447,10 @@ H5CX_get_data_transform(H5Z_data_xform_t **data_transform) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(data_transform); + assert(data_transform); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); /* Check if the value has been retrieved already */ if (!(*head)->ctx.data_transform_valid) { @@ -2505,10 +2505,10 @@ H5CX_get_vlen_alloc_info(H5T_vlen_alloc_info_t *vl_alloc_info) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vl_alloc_info); + assert(vl_alloc_info); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); /* Check if the value has been retrieved already */ if (!(*head)->ctx.vl_alloc_info_valid) { @@ -2570,10 +2570,10 @@ H5CX_get_dt_conv_cb(H5T_conv_cb_t *dt_conv_cb) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(dt_conv_cb); + assert(dt_conv_cb); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_CONV_CB_NAME, dt_conv_cb) @@ -2605,10 +2605,10 @@ H5CX_get_selection_io_mode(H5D_selection_io_mode_t *selection_io_mode) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(selection_io_mode); + assert(selection_io_mode); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_SELECTION_IO_MODE_NAME, selection_io_mode) @@ -2642,10 +2642,10 @@ H5CX_get_no_selection_io_cause(uint32_t *no_selection_io_cause) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(no_selection_io_cause); + assert(no_selection_io_cause); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID_SET(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_NO_SELECTION_IO_CAUSE_NAME, no_selection_io_cause) @@ -2675,10 +2675,10 @@ H5CX_get_modify_write_buf(hbool_t *modify_write_buf) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(modify_write_buf); + assert(modify_write_buf); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(dxpl, H5P_DATASET_XFER_DEFAULT, H5D_XFER_MODIFY_WRITE_BUF_NAME, modify_write_buf) @@ -2710,10 +2710,10 @@ H5CX_get_encoding(H5T_cset_t *encoding) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(encoding); + assert(encoding); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.lcpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.lcpl_id); H5CX_RETRIEVE_PROP_VALID(lcpl, H5P_LINK_CREATE_DEFAULT, H5P_STRCRT_CHAR_ENCODING_NAME, encoding) @@ -2745,10 +2745,10 @@ H5CX_get_intermediate_group(unsigned *crt_intermed_group) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(crt_intermed_group); + assert(crt_intermed_group); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.lcpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.lcpl_id); H5CX_RETRIEVE_PROP_VALID(lcpl, H5P_LINK_CREATE_DEFAULT, H5L_CRT_INTERMEDIATE_GROUP_NAME, intermediate_group) @@ -2781,10 +2781,10 @@ H5CX_get_nlinks(size_t *nlinks) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(nlinks); + assert(nlinks); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dxpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dxpl_id); H5CX_RETRIEVE_PROP_VALID(lapl, H5P_LINK_ACCESS_DEFAULT, H5L_ACS_NLINKS_NAME, nlinks) @@ -2816,11 +2816,11 @@ H5CX_get_libver_bounds(H5F_libver_t *low_bound, H5F_libver_t *high_bound) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(low_bound); - HDassert(high_bound); + assert(low_bound); + assert(high_bound); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.fapl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.fapl_id); H5CX_RETRIEVE_PROP_VALID(fapl, H5P_FILE_ACCESS_DEFAULT, H5F_ACS_LIBVER_LOW_BOUND_NAME, low_bound) H5CX_RETRIEVE_PROP_VALID(fapl, H5P_FILE_ACCESS_DEFAULT, H5F_ACS_LIBVER_HIGH_BOUND_NAME, high_bound) @@ -2855,10 +2855,10 @@ H5CX_get_dset_min_ohdr_flag(hbool_t *dset_min_ohdr_flag) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(dset_min_ohdr_flag); + assert(dset_min_ohdr_flag); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dcpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dcpl_id); H5CX_RETRIEVE_PROP_VALID(dcpl, H5P_DATASET_CREATE_DEFAULT, H5D_CRT_MIN_DSET_HDR_SIZE_NAME, do_min_dset_ohdr) @@ -2891,10 +2891,10 @@ H5CX_get_ext_file_prefix(const char **extfile_prefix) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(extfile_prefix); + assert(extfile_prefix); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dapl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dapl_id); /* Check if the value has been retrieved already */ if (!(*head)->ctx.extfile_prefix_valid) { @@ -2949,10 +2949,10 @@ H5CX_get_vds_prefix(const char **vds_prefix) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vds_prefix); + assert(vds_prefix); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dapl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dapl_id); /* Check if the value has been retrieved already */ if (!(*head)->ctx.vds_prefix_valid) { @@ -3007,7 +3007,7 @@ H5CX_set_tag(haddr_t tag) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); (*head)->ctx.tag = tag; @@ -3035,7 +3035,7 @@ H5CX_set_ring(H5AC_ring_t ring) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); (*head)->ctx.ring = ring; @@ -3065,7 +3065,7 @@ H5CX_set_coll_metadata_read(hbool_t cmdr) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); (*head)->ctx.coll_metadata_read = cmdr; @@ -3097,7 +3097,7 @@ H5CX_set_mpi_coll_datatypes(MPI_Datatype btype, MPI_Datatype ftype) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context values */ (*head)->ctx.btype = btype; @@ -3128,7 +3128,7 @@ H5CX_set_io_xfer_mode(H5FD_mpio_xfer_t io_xfer_mode) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context value */ (*head)->ctx.io_xfer_mode = io_xfer_mode; @@ -3161,7 +3161,7 @@ H5CX_set_mpio_coll_opt(H5FD_mpio_collective_opt_t mpio_coll_opt) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context value */ (*head)->ctx.mpio_coll_opt = mpio_coll_opt; @@ -3193,7 +3193,7 @@ H5CX_set_mpi_file_flushing(hbool_t flushing) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); (*head)->ctx.mpi_file_flushing = flushing; @@ -3222,7 +3222,7 @@ H5CX_set_mpio_rank0_bcast(hbool_t rank0_bcast) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); (*head)->ctx.rank0_bcast = rank0_bcast; @@ -3252,7 +3252,7 @@ H5CX_set_vlen_alloc_info(H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context value */ (*head)->ctx.vl_alloc_info.alloc_func = alloc_func; @@ -3288,7 +3288,7 @@ H5CX_set_nlinks(size_t nlinks) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Set the API context value */ (*head)->ctx.nlinks = nlinks; @@ -3322,8 +3322,8 @@ H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chun /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + assert(head && *head); + assert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); /* Cache the value for later, marking it to set in DXPL when context popped */ (*head)->ctx.mpio_actual_chunk_opt = mpio_actual_chunk_opt; @@ -3353,8 +3353,8 @@ H5CX_set_mpio_actual_io_mode(H5D_mpio_actual_io_mode_t mpio_actual_io_mode) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + assert(head && *head); + assert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); /* Cache the value for later, marking it to set in DXPL when context popped */ (*head)->ctx.mpio_actual_io_mode = mpio_actual_io_mode; @@ -3384,8 +3384,8 @@ H5CX_set_mpio_local_no_coll_cause(uint32_t mpio_local_no_coll_cause) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert((*head)->ctx.dxpl_id != H5P_DEFAULT); + assert(head && *head); + assert((*head)->ctx.dxpl_id != H5P_DEFAULT); /* If we're using the default DXPL, don't modify it */ if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { @@ -3418,8 +3418,8 @@ H5CX_set_mpio_global_no_coll_cause(uint32_t mpio_global_no_coll_cause) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert((*head)->ctx.dxpl_id != H5P_DEFAULT); + assert(head && *head); + assert((*head)->ctx.dxpl_id != H5P_DEFAULT); /* If we're using the default DXPL, don't modify it */ if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { @@ -3457,8 +3457,8 @@ H5CX_test_set_mpio_coll_chunk_link_hard(int mpio_coll_chunk_link_hard) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + assert(head && *head); + assert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, mpio_coll_chunk_link_hard) @@ -3490,8 +3490,8 @@ H5CX_test_set_mpio_coll_chunk_multi_hard(int mpio_coll_chunk_multi_hard) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + assert(head && *head); + assert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, mpio_coll_chunk_multi_hard) @@ -3523,8 +3523,8 @@ H5CX_test_set_mpio_coll_chunk_link_num_true(int mpio_coll_chunk_link_num_true) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + assert(head && *head); + assert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, mpio_coll_chunk_link_num_true) @@ -3557,8 +3557,8 @@ H5CX_test_set_mpio_coll_chunk_link_num_false(int mpio_coll_chunk_link_num_false) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + assert(head && *head); + assert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, mpio_coll_chunk_link_num_false) @@ -3591,8 +3591,8 @@ H5CX_test_set_mpio_coll_chunk_multi_ratio_coll(int mpio_coll_chunk_multi_ratio_c /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + assert(head && *head); + assert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, mpio_coll_chunk_multi_ratio_coll) @@ -3625,8 +3625,8 @@ H5CX_test_set_mpio_coll_chunk_multi_ratio_ind(int mpio_coll_chunk_multi_ratio_in /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + assert(head && *head); + assert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, mpio_coll_chunk_multi_ratio_ind) @@ -3658,8 +3658,8 @@ H5CX_test_set_mpio_coll_rank0_bcast(hbool_t mpio_coll_rank0_bcast) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); + assert(head && *head); + assert(!((*head)->ctx.dxpl_id == H5P_DEFAULT || (*head)->ctx.dxpl_id == H5P_DATASET_XFER_DEFAULT)); H5CX_TEST_SET_PROP(H5D_XFER_COLL_RANK0_BCAST_NAME, mpio_coll_rank0_bcast) @@ -3691,8 +3691,8 @@ H5CX_set_no_selection_io_cause(uint32_t no_selection_io_cause) /* Sanity checks */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert((*head)->ctx.dxpl_id != H5P_DEFAULT); + assert(head && *head); + assert((*head)->ctx.dxpl_id != H5P_DEFAULT); /* If we're using the default DXPL, don't modify it */ if ((*head)->ctx.dxpl_id != H5P_DATASET_XFER_DEFAULT) { @@ -3725,10 +3725,10 @@ H5CX_get_ohdr_flags(uint8_t *ohdr_flags) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(ohdr_flags); + assert(ohdr_flags); head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); - HDassert(H5P_DEFAULT != (*head)->ctx.dcpl_id); + assert(head && *head); + assert(H5P_DEFAULT != (*head)->ctx.dcpl_id); H5CX_RETRIEVE_PROP_VALID(dcpl, H5P_DATASET_CREATE_DEFAULT, H5O_CRT_OHDR_FLAGS_NAME, ohdr_flags) @@ -3761,7 +3761,7 @@ H5CX__pop_common(hbool_t update_dxpl_props) /* Sanity check */ head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ - HDassert(head && *head); + assert(head && *head); /* Check for cached DXPL properties to return to application */ if (update_dxpl_props) { diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 1311f63..7fe00cf 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -85,8 +85,8 @@ H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(cache_ptr != NULL); - HDassert(cache_name != NULL); + assert(cache_ptr != NULL); + assert(cache_name != NULL); /* First, create a skip list */ if (NULL == (slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) @@ -153,7 +153,7 @@ H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name) HDfprintf(stdout, "\n\n"); /* Verify that all the entries were removed from the skip list */ - HDassert(H5SL_count(slist_ptr) == 0); + assert(H5SL_count(slist_ptr) == 0); done: /* Discard the skip list */ @@ -188,8 +188,8 @@ H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(cache_ptr != NULL); - HDassert(cache_name != NULL); + assert(cache_ptr != NULL); + assert(cache_name != NULL); HDfprintf(stdout, "\n\nDump of metadata cache LRU \"%s\"\n", cache_name); HDfprintf(stdout, "LRU len = %d, LRU size = %d\n", cache_ptr->LRU_list_len, @@ -264,8 +264,8 @@ H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn) FUNC_ENTER_NOAPI_NOERR - HDassert(cache_ptr != NULL); - HDassert(calling_fcn != NULL); + assert(cache_ptr != NULL); + assert(calling_fcn != NULL); HDfprintf(stdout, "\n\nDumping metadata cache skip list from %s.\n", calling_fcn); HDfprintf(stdout, " slist %s.\n", cache_ptr->slist_enabled ? "enabled" : "disabled"); @@ -706,7 +706,7 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED *cache_ptr) int i; #endif /* H5C_COLLECT_CACHE_STATS */ - HDassert(cache_ptr); + assert(cache_ptr); #if H5C_COLLECT_CACHE_STATS for (i = 0; i <= cache_ptr->max_type_id; i++) { @@ -829,10 +829,10 @@ H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child FUNC_ENTER_NOAPI(NULL) /* Sanity checks */ - HDassert(cache_ptr); - HDassert(H5_addr_defined(parent_addr)); - HDassert(H5_addr_defined(child_addr)); - HDassert(fd_exists_ptr); + assert(cache_ptr); + assert(H5_addr_defined(parent_addr)); + assert(H5_addr_defined(child_addr)); + assert(fd_exists_ptr); H5C__SEARCH_INDEX(cache_ptr, parent_addr, parent_ptr, FAIL); H5C__SEARCH_INDEX(cache_ptr, child_addr, child_ptr, FAIL); @@ -841,13 +841,13 @@ H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child if (child_ptr->flush_dep_nparents > 0) { unsigned u; /* Local index variable */ - HDassert(child_ptr->flush_dep_parent); - HDassert(child_ptr->flush_dep_parent_nalloc >= child_ptr->flush_dep_nparents); + assert(child_ptr->flush_dep_parent); + assert(child_ptr->flush_dep_parent_nalloc >= child_ptr->flush_dep_nparents); for (u = 0; u < child_ptr->flush_dep_nparents; u++) { if (child_ptr->flush_dep_parent[u] == parent_ptr) { fd_exists = TRUE; - HDassert(parent_ptr->flush_dep_nchildren > 0); + assert(parent_ptr->flush_dep_nchildren > 0); break; } /* end if */ } /* end for */ @@ -895,7 +895,7 @@ H5C_validate_index_list(H5C_t *cache_ptr) FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ - HDassert(cache_ptr); + assert(cache_ptr); for (i = 0; i < H5C_RING_NTYPES; i++) { index_ring_len[i] = 0; @@ -928,8 +928,8 @@ H5C_validate_index_list(H5C_t *cache_ptr) ((entry_ptr->il_next == NULL) || (entry_ptr->il_next->il_prev != entry_ptr))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid") - HDassert(entry_ptr->ring > 0); - HDassert(entry_ptr->ring < H5C_RING_NTYPES); + assert(entry_ptr->ring > 0); + assert(entry_ptr->ring < H5C_RING_NTYPES); len++; index_ring_len[entry_ptr->ring] += 1; @@ -969,7 +969,7 @@ H5C_validate_index_list(H5C_t *cache_ptr) done: if (ret_value != SUCCEED) - HDassert(0); + assert(0); FUNC_LEAVE_NOAPI(ret_value) } /* H5C_validate_index_list() */ @@ -1020,9 +1020,9 @@ H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache_ptr); - HDassert(H5_addr_defined(addr)); - HDassert(entry_ptr_ptr); + assert(cache_ptr); + assert(H5_addr_defined(addr)); + assert(entry_ptr_ptr); H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL); @@ -1063,7 +1063,7 @@ H5C_get_serialization_in_progress(const H5C_t *cache_ptr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(cache_ptr); + assert(cache_ptr); FUNC_LEAVE_NOAPI(cache_ptr->serialization_in_progress) } /* H5C_get_serialization_in_progress() */ @@ -1095,9 +1095,9 @@ H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(cache_ptr); - HDassert(inner_ring >= H5C_RING_USER); - HDassert(inner_ring <= H5C_RING_SB); + assert(cache_ptr); + assert(inner_ring >= H5C_RING_USER); + assert(inner_ring <= H5C_RING_SB); while (ring <= inner_ring) { if (cache_ptr->dirty_index_ring_size[ring] > 0) @@ -1146,11 +1146,11 @@ H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expecte FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache_ptr); - HDassert(H5_addr_defined(addr)); - HDassert(expected_type); - HDassert(in_cache_ptr); - HDassert(type_ok_ptr); + assert(cache_ptr); + assert(H5_addr_defined(addr)); + assert(expected_type); + assert(in_cache_ptr); + assert(type_ok_ptr); H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL); @@ -1198,8 +1198,8 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size, size_t new_max_cache_size, size_t old_min_clean_size, size_t new_min_clean_size) { - HDassert(cache_ptr != NULL); - HDassert(version == H5C__CURR_AUTO_RESIZE_RPT_FCN_VER); + assert(cache_ptr != NULL); + assert(version == H5C__CURR_AUTO_RESIZE_RPT_FCN_VER); switch (status) { case in_spec: @@ -1208,8 +1208,8 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, break; case increase: - HDassert(hit_rate < cache_ptr->resize_ctl.lower_hr_threshold); - HDassert(old_max_cache_size < new_max_cache_size); + assert(hit_rate < cache_ptr->resize_ctl.lower_hr_threshold); + assert(old_max_cache_size < new_max_cache_size); HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) out of bounds low (%6.5lf).\n", cache_ptr->prefix, hit_rate, cache_ptr->resize_ctl.lower_hr_threshold); @@ -1218,7 +1218,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, break; case flash_increase: - HDassert(old_max_cache_size < new_max_cache_size); + assert(old_max_cache_size < new_max_cache_size); HDfprintf(stdout, "%sflash cache resize(%d) -- size threshold = %zu.\n", cache_ptr->prefix, (int)(cache_ptr->resize_ctl.flash_incr_mode), cache_ptr->flash_size_increase_threshold); @@ -1227,7 +1227,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, break; case decrease: - HDassert(old_max_cache_size > new_max_cache_size); + assert(old_max_cache_size > new_max_cache_size); switch (cache_ptr->resize_ctl.decr_mode) { case H5C_decr__off: @@ -1236,7 +1236,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, break; case H5C_decr__threshold: - HDassert(hit_rate > cache_ptr->resize_ctl.upper_hr_threshold); + assert(hit_rate > cache_ptr->resize_ctl.upper_hr_threshold); HDfprintf(stdout, "%sAuto cache resize -- decrease by threshold. HR = %lf > %6.5lf\n", cache_ptr->prefix, hit_rate, cache_ptr->resize_ctl.upper_hr_threshold); @@ -1250,7 +1250,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, break; case H5C_decr__age_out_with_threshold: - HDassert(hit_rate > cache_ptr->resize_ctl.upper_hr_threshold); + assert(hit_rate > cache_ptr->resize_ctl.upper_hr_threshold); HDfprintf(stdout, "%sAuto cache resize -- decrease by ageout with threshold. HR = %lf > %6.5lf\n", @@ -1289,7 +1289,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, break; case not_full: - HDassert(hit_rate < cache_ptr->resize_ctl.lower_hr_threshold); + assert(hit_rate < cache_ptr->resize_ctl.lower_hr_threshold); HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) out of bounds low (%6.5lf).\n", cache_ptr->prefix, hit_rate, cache_ptr->resize_ctl.lower_hr_threshold); @@ -1328,7 +1328,7 @@ H5C__validate_lru_list(H5C_t *cache_ptr) FUNC_ENTER_PACKAGE - HDassert(cache_ptr); + assert(cache_ptr); if (((cache_ptr->LRU_head_ptr == NULL) || (cache_ptr->LRU_tail_ptr == NULL)) && (cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr)) @@ -1367,7 +1367,7 @@ H5C__validate_lru_list(H5C_t *cache_ptr) done: if (ret_value != SUCCEED) - HDassert(0); + assert(0); FUNC_LEAVE_NOAPI(ret_value) } /* H5C__validate_lru_list() */ @@ -1400,7 +1400,7 @@ H5C__validate_pinned_entry_list(H5C_t *cache_ptr) FUNC_ENTER_PACKAGE - HDassert(cache_ptr); + assert(cache_ptr); if (((cache_ptr->pel_head_ptr == NULL) || (cache_ptr->pel_tail_ptr == NULL)) && (cache_ptr->pel_head_ptr != cache_ptr->pel_tail_ptr)) @@ -1442,7 +1442,7 @@ H5C__validate_pinned_entry_list(H5C_t *cache_ptr) done: if (ret_value != SUCCEED) - HDassert(0); + assert(0); FUNC_LEAVE_NOAPI(ret_value) } /* H5C__validate_pinned_entry_list() */ @@ -1475,7 +1475,7 @@ H5C__validate_protected_entry_list(H5C_t *cache_ptr) FUNC_ENTER_PACKAGE - HDassert(cache_ptr); + assert(cache_ptr); if (((cache_ptr->pl_head_ptr == NULL) || (cache_ptr->pl_tail_ptr == NULL)) && (cache_ptr->pl_head_ptr != cache_ptr->pl_tail_ptr)) @@ -1517,7 +1517,7 @@ H5C__validate_protected_entry_list(H5C_t *cache_ptr) done: if (ret_value != SUCCEED) - HDassert(0); + assert(0); FUNC_LEAVE_NOAPI(ret_value) } /* H5C__validate_protected_entry_list() */ @@ -1548,8 +1548,8 @@ H5C__entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr) FUNC_ENTER_PACKAGE /* Assertions */ - HDassert(cache_ptr); - HDassert(cache_ptr->slist_ptr); + assert(cache_ptr); + assert(cache_ptr->slist_ptr); node_ptr = H5SL_first(cache_ptr->slist_ptr); in_slist = FALSE; @@ -1558,9 +1558,9 @@ H5C__entry_in_skip_list(H5C_t *cache_ptr, H5C_cache_entry_t *target_ptr) entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - HDassert(entry_ptr); - HDassert(entry_ptr->is_dirty); - HDassert(entry_ptr->in_slist); + assert(entry_ptr); + assert(entry_ptr->is_dirty); + assert(entry_ptr->in_slist); if (entry_ptr == target_ptr) in_slist = TRUE; diff --git a/src/H5Centry.c b/src/H5Centry.c index 46f3dd6..130995c 100644 --- a/src/H5Centry.c +++ b/src/H5Centry.c @@ -123,9 +123,9 @@ H5C__pin_entry_from_client(H5C_t FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr); - HDassert(entry_ptr); - HDassert(entry_ptr->is_protected); + assert(cache_ptr); + assert(entry_ptr); + assert(entry_ptr->is_protected); /* Check if the entry is already pinned */ if (entry_ptr->is_pinned) { @@ -170,9 +170,9 @@ H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbool_t up #endif /* Sanity checking */ - HDassert(cache_ptr); - HDassert(entry_ptr); - HDassert(entry_ptr->is_pinned); + assert(cache_ptr); + assert(entry_ptr); + assert(entry_ptr->is_pinned); /* If requested, update the replacement policy if the entry is not protected */ if (update_rp && !entry_ptr->is_protected) @@ -210,8 +210,8 @@ H5C__unpin_entry_from_client(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, hbo FUNC_ENTER_PACKAGE /* Sanity checking */ - HDassert(cache_ptr); - HDassert(entry_ptr); + assert(cache_ptr); + assert(entry_ptr); /* Error checking (should be sanity checks?) */ if (!entry_ptr->is_pinned) @@ -264,13 +264,13 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(cache_ptr); - HDassert(entry_ptr); - HDassert(!entry_ptr->image_up_to_date); - HDassert(entry_ptr->is_dirty); - HDassert(!entry_ptr->is_protected); - HDassert(entry_ptr->type); + assert(f); + assert(cache_ptr); + assert(entry_ptr); + assert(!entry_ptr->image_up_to_date); + assert(entry_ptr->is_dirty); + assert(!entry_ptr->is_protected); + assert(entry_ptr->type); /* make note of the entry's current address */ old_addr = entry_ptr->addr; @@ -316,7 +316,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) */ if (serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) { /* Sanity check */ - HDassert(new_len > 0); + assert(new_len > 0); /* Allocate a new image buffer */ if (NULL == @@ -349,8 +349,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) * H5C__UPDATE_SLIST_FOR_SIZE_CHANGE() is a no-op if the * slist is enabled, call it un-conditionally. */ - HDassert(entry_ptr->is_dirty); - HDassert((entry_ptr->in_slist) || (!cache_ptr->slist_enabled)); + assert(entry_ptr->is_dirty); + assert((entry_ptr->in_slist) || (!cache_ptr->slist_enabled)); H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len); @@ -379,7 +379,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL); } /* end if */ else /* move is already done for us -- just do sanity checks */ - HDassert(entry_ptr->addr == new_addr); + assert(entry_ptr->addr == new_addr); } /* end if */ } /* end if(serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) */ @@ -388,8 +388,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to serialize entry") #if H5C_DO_MEMORY_SANITY_CHECKS - HDassert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, - H5C_IMAGE_EXTRA_SPACE)); + assert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, + H5C_IMAGE_EXTRA_SPACE)); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ entry_ptr->image_up_to_date = TRUE; @@ -400,7 +400,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) * (see assertion on entry), no need to check that -- only check * for flush dependency parents. */ - HDassert(entry_ptr->flush_dep_nunser_children == 0); + assert(entry_ptr->flush_dep_nunser_children == 0); if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_serialized(entry_ptr) < 0) @@ -458,12 +458,12 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) FUNC_ENTER_PACKAGE - HDassert(f); + assert(f); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(entry_ptr); - HDassert(entry_ptr->ring != H5C_RING_UNDEFINED); - HDassert(entry_ptr->type); + assert(cache_ptr); + assert(entry_ptr); + assert(entry_ptr->ring != H5C_RING_UNDEFINED); + assert(entry_ptr->type); /* setup external flags from the flags parameter */ destroy = ((flags & H5C__FLUSH_INVALIDATE_FLAG) != 0); @@ -502,11 +502,11 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) cache_ptr->num_entries_in_image > 0 && cache_ptr->image_entries != NULL) { /* Sanity checks */ - HDassert(entry_ptr->image_up_to_date || !(entry_ptr->include_in_image)); - HDassert(entry_ptr->image_ptr || !(entry_ptr->include_in_image)); - HDassert((!clear_only) || !(entry_ptr->include_in_image)); - HDassert((!take_ownership) || !(entry_ptr->include_in_image)); - HDassert((!free_file_space) || !(entry_ptr->include_in_image)); + assert(entry_ptr->image_up_to_date || !(entry_ptr->include_in_image)); + assert(entry_ptr->image_ptr || !(entry_ptr->include_in_image)); + assert((!clear_only) || !(entry_ptr->include_in_image)); + assert((!take_ownership) || !(entry_ptr->include_in_image)); + assert((!free_file_space) || !(entry_ptr->include_in_image)); suppress_image_entry_frees = TRUE; @@ -518,19 +518,19 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) #ifdef H5C_DO_SANITY_CHECKS if (cache_ptr->slist_enabled) { if (entry_ptr->in_slist) { - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->is_dirty); if (entry_ptr->flush_marker && !entry_ptr->is_dirty) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry in slist failed sanity checks") } /* end if */ else { - HDassert(!entry_ptr->is_dirty); - HDassert(!entry_ptr->flush_marker); + assert(!entry_ptr->is_dirty); + assert(!entry_ptr->flush_marker); if (entry_ptr->is_dirty || entry_ptr->flush_marker) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry failed sanity checks") } /* end else */ } else { /* slist is disabled */ - HDassert(!entry_ptr->in_slist); + assert(!entry_ptr->in_slist); if (!entry_ptr->is_dirty) if (entry_ptr->flush_marker) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flush marked clean entry?") @@ -558,7 +558,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * entry. */ if (write_entry || generate_image) { - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->is_dirty); if (NULL == entry_ptr->image_ptr) { if (NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, @@ -573,7 +573,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) if (!entry_ptr->image_up_to_date) { /* Sanity check */ - HDassert(!entry_ptr->prefetched); + assert(!entry_ptr->prefetched); /* Generate the entry's image */ if (H5C__generate_image(f, cache_ptr, entry_ptr) < 0) @@ -588,7 +588,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * flag should only be used in test code. */ if (write_entry) { - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->is_dirty); #ifdef H5C_DO_SANITY_CHECKS if (cache_ptr->check_write_permitted && !cache_ptr->write_permitted) @@ -614,7 +614,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) else { #endif /* H5_HAVE_PARALLEL */ if (entry_ptr->prefetched) { - HDassert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); + assert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); mem_type = cache_ptr->class_table_ptr[entry_ptr->prefetch_type_id]->mem_type; } /* end if */ else @@ -650,7 +650,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) } else if (write_entry) { - HDassert(was_dirty); + assert(was_dirty); /* only log a flush if we actually wrote to disk */ H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) @@ -665,11 +665,11 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) if (destroy) { /* Sanity checks */ if (take_ownership) - HDassert(!destroy_entry); + assert(!destroy_entry); else - HDassert(destroy_entry); + assert(destroy_entry); - HDassert(!entry_ptr->is_pinned); + assert(!entry_ptr->is_pinned); /* Update stats, while entry is still in the cache */ H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr, take_ownership) @@ -718,13 +718,13 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove entry from tag list") /* verify that the entry is no longer part of any flush dependencies */ - HDassert(entry_ptr->flush_dep_nparents == 0); - HDassert(entry_ptr->flush_dep_nchildren == 0); + assert(entry_ptr->flush_dep_nparents == 0); + assert(entry_ptr->flush_dep_nchildren == 0); } /* end if */ else { - HDassert(clear_only || write_entry); - HDassert(entry_ptr->is_dirty); - HDassert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); + assert(clear_only || write_entry); + assert(entry_ptr->is_dirty); + assert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); /* We are either doing a flush or a clear. * @@ -758,7 +758,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * if appropriate */ if (entry_ptr->flush_dep_ndirty_children != 0) - HDassert(entry_ptr->flush_dep_ndirty_children == 0); + assert(entry_ptr->flush_dep_ndirty_children == 0); if (entry_ptr->flush_dep_nparents > 0) if (H5C__mark_flush_dep_clean(entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKCLEAN, FAIL, "Can't propagate flush dep clean flag") @@ -780,7 +780,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) */ if (destroy) { /* Sanity check */ - HDassert(0 == entry_ptr->flush_dep_nparents); + assert(0 == entry_ptr->flush_dep_nparents); /* if both suppress_image_entry_frees and entry_ptr->include_in_image * are true, simply set entry_ptr->image_ptr to NULL, as we have @@ -801,8 +801,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * the flush dependency parents addresses array if necessary. */ if (!entry_ptr->prefetched) { - HDassert(0 == entry_ptr->fd_parent_count); - HDassert(NULL == entry_ptr->fd_parent_addrs); + assert(0 == entry_ptr->fd_parent_count); + assert(NULL == entry_ptr->fd_parent_addrs); } /* end if */ /* Check whether we should free the space in the file that @@ -812,15 +812,15 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) hsize_t fsf_size; /* Sanity checks */ - HDassert(H5_addr_defined(entry_ptr->addr)); - HDassert(!H5F_IS_TMP_ADDR(f, entry_ptr->addr)); + assert(H5_addr_defined(entry_ptr->addr)); + assert(!H5F_IS_TMP_ADDR(f, entry_ptr->addr)); #ifndef NDEBUG { size_t curr_len; /* Get the actual image size for the thing again */ entry_ptr->type->image_len((void *)entry_ptr, &curr_len); - HDassert(curr_len == entry_ptr->size); + assert(curr_len == entry_ptr->size); } #endif @@ -882,13 +882,13 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) } /* end if */ /* verify that the image has been freed */ - HDassert(entry_ptr->image_ptr == NULL); + assert(entry_ptr->image_ptr == NULL); if (entry_ptr->type->free_icr((void *)entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "free_icr callback failed") } /* end if */ else { - HDassert(take_ownership); + assert(take_ownership); } /* end else */ } /* if (destroy) */ @@ -897,8 +897,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) */ if (update_page_buffer) { /* Sanity check */ - HDassert(!destroy); - HDassert(entry_ptr->image_ptr); + assert(!destroy); + assert(entry_ptr->image_ptr); if (f->shared->page_buf && (f->shared->page_buf->page_size >= entry_ptr->size)) if (H5PB_update_entry(f->shared->page_buf, entry_ptr->addr, entry_ptr->size, @@ -911,8 +911,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "log_flush callback failed") done: - HDassert((ret_value != SUCCEED) || (destroy_entry) || (!entry_ptr->flush_in_progress)); - HDassert((ret_value != SUCCEED) || (destroy_entry) || (take_ownership) || (!entry_ptr->is_dirty)); + assert((ret_value != SUCCEED) || (destroy_entry) || (!entry_ptr->flush_in_progress)); + assert((ret_value != SUCCEED) || (destroy_entry) || (take_ownership) || (!entry_ptr->is_dirty)); FUNC_LEAVE_NOAPI(ret_value) } /* H5C__flush_single_entry() */ @@ -1017,27 +1017,27 @@ H5C__load_entry(H5F_t *f, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - HDassert(type); - HDassert(H5_addr_defined(addr)); - HDassert(type->get_initial_load_size); + assert(f); + assert(f->shared); + assert(f->shared->cache); + assert(type); + assert(H5_addr_defined(addr)); + assert(type->get_initial_load_size); if (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) - HDassert(type->get_final_load_size); + assert(type->get_final_load_size); else - HDassert(NULL == type->get_final_load_size); - HDassert(type->deserialize); + assert(NULL == type->get_final_load_size); + assert(type->deserialize); /* Can't see how skip reads could be usefully combined with * the speculative read flag. Hence disallow. */ - HDassert(!((type->flags & H5C__CLASS_SKIP_READS) && (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG))); + assert(!((type->flags & H5C__CLASS_SKIP_READS) && (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG))); /* Call the get_initial_load_size callback, to retrieve the initial size of image */ if (type->get_initial_load_size(udata, &len) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't retrieve image size") - HDassert(len > 0); + assert(len > 0); /* Check for possible speculative read off the end of the file */ if (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) @@ -1234,7 +1234,7 @@ H5C__load_entry(H5F_t *f, * * In the following assert: * - * HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); + * assert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); * * note that type ids 5 & 6 are associated with object headers in the * metadata cache. @@ -1244,12 +1244,12 @@ H5C__load_entry(H5F_t *f, * metadata cache. */ - HDassert((dirty == FALSE) || (type->id == 5 || type->id == 6)); + assert((dirty == FALSE) || (type->id == 5 || type->id == 6)); entry->cache_ptr = f->shared->cache; entry->addr = addr; entry->size = len; - HDassert(entry->size < H5C_MAX_ENTRY_SIZE); + assert(entry->size < H5C_MAX_ENTRY_SIZE); entry->image_ptr = image; entry->image_up_to_date = !dirty; entry->type = type; @@ -1359,13 +1359,13 @@ H5C__mark_flush_dep_dirty(H5C_cache_entry_t *entry) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(entry); + assert(entry); /* Iterate over the parent entries, if any */ for (u = 0; u < entry->flush_dep_nparents; u++) { /* Sanity check */ - HDassert(entry->flush_dep_parent[u]->flush_dep_ndirty_children < - entry->flush_dep_parent[u]->flush_dep_nchildren); + assert(entry->flush_dep_parent[u]->flush_dep_ndirty_children < + entry->flush_dep_parent[u]->flush_dep_nchildren); /* Adjust the parent's number of dirty children */ entry->flush_dep_parent[u]->flush_dep_ndirty_children++; @@ -1406,7 +1406,7 @@ H5C__mark_flush_dep_clean(H5C_cache_entry_t *entry) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(entry); + assert(entry); /* Iterate over the parent entries, if any */ /* Note reverse iteration order, in case the callback removes the flush @@ -1414,7 +1414,7 @@ H5C__mark_flush_dep_clean(H5C_cache_entry_t *entry) */ for (i = ((int)entry->flush_dep_nparents) - 1; i >= 0; i--) { /* Sanity check */ - HDassert(entry->flush_dep_parent[i]->flush_dep_ndirty_children > 0); + assert(entry->flush_dep_parent[i]->flush_dep_ndirty_children > 0); /* Adjust the parent's number of dirty children */ entry->flush_dep_parent[i]->flush_dep_ndirty_children--; @@ -1454,7 +1454,7 @@ H5C__mark_flush_dep_serialized(H5C_cache_entry_t *entry_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(entry_ptr); + assert(entry_ptr); /* Iterate over the parent entries, if any */ /* Note reverse iteration order, in case the callback removes the flush @@ -1462,8 +1462,8 @@ H5C__mark_flush_dep_serialized(H5C_cache_entry_t *entry_ptr) */ for (i = ((int)entry_ptr->flush_dep_nparents) - 1; i >= 0; i--) { /* Sanity checks */ - HDassert(entry_ptr->flush_dep_parent); - HDassert(entry_ptr->flush_dep_parent[i]->flush_dep_nunser_children > 0); + assert(entry_ptr->flush_dep_parent); + assert(entry_ptr->flush_dep_parent[i]->flush_dep_nunser_children > 0); /* decrement the parents number of unserialized children */ entry_ptr->flush_dep_parent[i]->flush_dep_nunser_children--; @@ -1503,14 +1503,14 @@ H5C__mark_flush_dep_unserialized(H5C_cache_entry_t *entry_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(entry_ptr); + assert(entry_ptr); /* Iterate over the parent entries, if any */ for (u = 0; u < entry_ptr->flush_dep_nparents; u++) { /* Sanity check */ - HDassert(entry_ptr->flush_dep_parent); - HDassert(entry_ptr->flush_dep_parent[u]->flush_dep_nunser_children < - entry_ptr->flush_dep_parent[u]->flush_dep_nchildren); + assert(entry_ptr->flush_dep_parent); + assert(entry_ptr->flush_dep_parent[u]->flush_dep_nunser_children < + entry_ptr->flush_dep_parent[u]->flush_dep_nchildren); /* increment parents number of usserialized children */ entry_ptr->flush_dep_parent[u]->flush_dep_nunser_children++; @@ -1551,11 +1551,11 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t *entry, const H5C_cache_en FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(entry); - HDassert(base_entry); + assert(entry); + assert(base_entry); /* Make sure the entries are not the same */ - HDassert(base_entry != entry); + assert(base_entry != entry); /* Iterate over entry's parents (if any) */ for (u = 0; u < entry->flush_dep_nparents; u++) @@ -1585,15 +1585,15 @@ H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(cache_ptr); - HDassert(entry_ptr); - HDassert(!entry_ptr->prefetched); - HDassert(!entry_ptr->image_up_to_date); - HDassert(entry_ptr->is_dirty); - HDassert(!entry_ptr->is_protected); - HDassert(!entry_ptr->flush_in_progress); - HDassert(entry_ptr->type); + assert(f); + assert(cache_ptr); + assert(entry_ptr); + assert(!entry_ptr->prefetched); + assert(!entry_ptr->image_up_to_date); + assert(entry_ptr->is_dirty); + assert(!entry_ptr->is_protected); + assert(!entry_ptr->flush_in_progress); + assert(entry_ptr->type); /* Set entry_ptr->flush_in_progress to TRUE so the target entry * will not be evicted out from under us. Must set it back to FALSE @@ -1603,7 +1603,7 @@ H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry /* Allocate buffer for the entry image if required. */ if (NULL == entry_ptr->image_ptr) { - HDassert(entry_ptr->size > 0); + assert(entry_ptr->size > 0); if (NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") #if H5C_DO_MEMORY_SANITY_CHECKS @@ -1620,8 +1620,8 @@ H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry entry_ptr->flush_in_progress = FALSE; done: - HDassert((ret_value != SUCCEED) || (!entry_ptr->flush_in_progress)); - HDassert((ret_value != SUCCEED) || (entry_ptr->image_up_to_date)); + assert((ret_value != SUCCEED) || (!entry_ptr->flush_in_progress)); + assert((ret_value != SUCCEED) || (entry_ptr->image_up_to_date)); FUNC_LEAVE_NOAPI(ret_value) } /* H5C__serialize_single_entry() */ @@ -1665,13 +1665,13 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr); - HDassert(pf_entry_ptr); - HDassert(pf_entry_ptr->type); - HDassert(pf_entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); - HDassert(pf_entry_ptr->prefetched); - HDassert(pf_entry_ptr->fd_child_count > 0); - HDassert(fd_children); + assert(cache_ptr); + assert(pf_entry_ptr); + assert(pf_entry_ptr->type); + assert(pf_entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); + assert(pf_entry_ptr->prefetched); + assert(pf_entry_ptr->fd_child_count > 0); + assert(fd_children); /* Scan each entry on the index list */ entry_ptr = cache_ptr->il_head; @@ -1689,16 +1689,16 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e found = FALSE; /* Sanity checks */ - HDassert(entry_ptr->type); - HDassert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); - HDassert(entry_ptr->fd_parent_count >= entry_ptr->flush_dep_nparents); - HDassert(entry_ptr->fd_parent_addrs); - HDassert(entry_ptr->flush_dep_parent); + assert(entry_ptr->type); + assert(entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); + assert(entry_ptr->fd_parent_count >= entry_ptr->flush_dep_nparents); + assert(entry_ptr->fd_parent_addrs); + assert(entry_ptr->flush_dep_parent); /* Look for correct entry */ while (!found && (u < entry_ptr->fd_parent_count)) { /* Sanity check entry */ - HDassert(entry_ptr->flush_dep_parent[u]); + assert(entry_ptr->flush_dep_parent[u]); /* Correct entry? */ if (pf_entry_ptr == entry_ptr->flush_dep_parent[u]) @@ -1708,7 +1708,7 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e } /* end while */ if (found) { - HDassert(NULL == fd_children[fd_children_found]); + assert(NULL == fd_children[fd_children_found]); /* Remove flush dependency */ fd_children[fd_children_found] = entry_ptr; @@ -1731,7 +1731,7 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e found = TRUE; u++; } /* end while */ - HDassert(found); + assert(found); #endif } /* end if */ } /* end if */ @@ -1743,10 +1743,10 @@ H5C__destroy_pf_entry_child_flush_deps(H5C_t *cache_ptr, H5C_cache_entry_t *pf_e } /* end while */ /* Post-op sanity checks */ - HDassert(NULL == fd_children[fd_children_found]); - HDassert((unsigned)fd_children_found == pf_entry_ptr->fd_child_count); - HDassert(entries_visited == cache_ptr->index_len); - HDassert(!pf_entry_ptr->is_pinned); + assert(NULL == fd_children[fd_children_found]); + assert((unsigned)fd_children_found == pf_entry_ptr->fd_child_count); + assert(entries_visited == cache_ptr->index_len); + assert(!pf_entry_ptr->is_pinned); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1814,53 +1814,53 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t FUNC_ENTER_PACKAGE /* sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - HDassert(f->shared->cache == cache_ptr); - HDassert(entry_ptr_ptr); - HDassert(*entry_ptr_ptr); + assert(f); + assert(f->shared); + assert(f->shared->cache); + assert(f->shared->cache == cache_ptr); + assert(entry_ptr_ptr); + assert(*entry_ptr_ptr); pf_entry_ptr = *entry_ptr_ptr; - HDassert(pf_entry_ptr->type); - HDassert(pf_entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); - HDassert(pf_entry_ptr->prefetched); - HDassert(pf_entry_ptr->image_up_to_date); - HDassert(pf_entry_ptr->image_ptr); - HDassert(pf_entry_ptr->size > 0); - HDassert(pf_entry_ptr->addr == addr); - HDassert(type); - HDassert(type->id == pf_entry_ptr->prefetch_type_id); - HDassert(type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type); + assert(pf_entry_ptr->type); + assert(pf_entry_ptr->type->id == H5AC_PREFETCHED_ENTRY_ID); + assert(pf_entry_ptr->prefetched); + assert(pf_entry_ptr->image_up_to_date); + assert(pf_entry_ptr->image_ptr); + assert(pf_entry_ptr->size > 0); + assert(pf_entry_ptr->addr == addr); + assert(type); + assert(type->id == pf_entry_ptr->prefetch_type_id); + assert(type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type); /* verify absence of prohibited or unsupported type flag combinations */ - HDassert(!(type->flags & H5C__CLASS_SKIP_READS)); + assert(!(type->flags & H5C__CLASS_SKIP_READS)); /* Can't see how skip reads could be usefully combined with * either the speculative read flag. Hence disallow. */ - HDassert(!((type->flags & H5C__CLASS_SKIP_READS) && (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG))); - HDassert(H5_addr_defined(addr)); - HDassert(type->get_initial_load_size); - HDassert(type->deserialize); + assert(!((type->flags & H5C__CLASS_SKIP_READS) && (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG))); + assert(H5_addr_defined(addr)); + assert(type->get_initial_load_size); + assert(type->deserialize); /* if *pf_entry_ptr is a flush dependency child, destroy all such * relationships now. The client will restore the relationship(s) with * the deserialized entry if appropriate. */ - HDassert(pf_entry_ptr->fd_parent_count == pf_entry_ptr->flush_dep_nparents); + assert(pf_entry_ptr->fd_parent_count == pf_entry_ptr->flush_dep_nparents); for (i = (int)(pf_entry_ptr->fd_parent_count) - 1; i >= 0; i--) { - HDassert(pf_entry_ptr->flush_dep_parent); - HDassert(pf_entry_ptr->flush_dep_parent[i]); - HDassert(pf_entry_ptr->flush_dep_parent[i]->flush_dep_nchildren > 0); - HDassert(pf_entry_ptr->fd_parent_addrs); - HDassert(pf_entry_ptr->flush_dep_parent[i]->addr == pf_entry_ptr->fd_parent_addrs[i]); + assert(pf_entry_ptr->flush_dep_parent); + assert(pf_entry_ptr->flush_dep_parent[i]); + assert(pf_entry_ptr->flush_dep_parent[i]->flush_dep_nchildren > 0); + assert(pf_entry_ptr->fd_parent_addrs); + assert(pf_entry_ptr->flush_dep_parent[i]->addr == pf_entry_ptr->fd_parent_addrs[i]); if (H5C_destroy_flush_dependency(pf_entry_ptr->flush_dep_parent[i], pf_entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "can't destroy pf entry parent flush dependency") pf_entry_ptr->fd_parent_addrs[i] = HADDR_UNDEF; } /* end for */ - HDassert(pf_entry_ptr->flush_dep_nparents == 0); + assert(pf_entry_ptr->flush_dep_nparents == 0); /* If *pf_entry_ptr is a flush dependency parent, destroy its flush * dependency relationships with all its children (which must be @@ -1906,7 +1906,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t * * In the following assert: * - * HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); + * assert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); * * note that type ids 5 & 6 are associated with object headers in the * metadata cache. @@ -1923,12 +1923,12 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t * hence the value assigned to ds_entry_ptr->is_dirty below. */ - HDassert((dirty == FALSE) || (type->id == 5 || type->id == 6)); + assert((dirty == FALSE) || (type->id == 5 || type->id == 6)); ds_entry_ptr->cache_ptr = f->shared->cache; ds_entry_ptr->addr = addr; ds_entry_ptr->size = len; - HDassert(ds_entry_ptr->size < H5C_MAX_ENTRY_SIZE); + assert(ds_entry_ptr->size < H5C_MAX_ENTRY_SIZE); ds_entry_ptr->image_ptr = pf_entry_ptr->image_ptr; ds_entry_ptr->image_up_to_date = !dirty; ds_entry_ptr->type = type; @@ -2022,8 +2022,8 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t pf_entry_ptr->image_ptr = NULL; if (pf_entry_ptr->is_dirty) { - HDassert(((cache_ptr->slist_enabled) && (pf_entry_ptr->in_slist)) || - ((!cache_ptr->slist_enabled) && (!pf_entry_ptr->in_slist))); + assert(((cache_ptr->slist_enabled) && (pf_entry_ptr->in_slist)) || + ((!cache_ptr->slist_enabled) && (!pf_entry_ptr->in_slist))); flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; } /* end if */ @@ -2034,13 +2034,13 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t #ifndef NDEGUG /* verify deletion */ H5C__SEARCH_INDEX(cache_ptr, addr, pf_entry_ptr, FAIL); - HDassert(NULL == pf_entry_ptr); + assert(NULL == pf_entry_ptr); #endif /* Insert the deserialized entry into the cache. */ H5C__INSERT_IN_INDEX(cache_ptr, ds_entry_ptr, FAIL); - HDassert(!ds_entry_ptr->in_slist); + assert(!ds_entry_ptr->in_slist); if (ds_entry_ptr->is_dirty) H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, ds_entry_ptr, FAIL); @@ -2066,9 +2066,9 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t ds_entry_ptr->is_protected = TRUE; while (fd_children[i] != NULL) { /* Sanity checks */ - HDassert((fd_children[i])->prefetched); - HDassert((fd_children[i])->fd_parent_count > 0); - HDassert((fd_children[i])->fd_parent_addrs); + assert((fd_children[i])->prefetched); + assert((fd_children[i])->fd_parent_count > 0); + assert((fd_children[i])->fd_parent_addrs); #ifndef NDEBUG { @@ -2083,7 +2083,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t j++; } /* end while */ - HDassert(found); + assert(found); } #endif @@ -2096,7 +2096,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, ds_entry_ptr, FAIL); ds_entry_ptr->is_protected = FALSE; } /* end if ( fd_children != NULL ) */ - HDassert((unsigned)i == ds_entry_ptr->fd_child_count); + assert((unsigned)i == ds_entry_ptr->fd_child_count); ds_entry_ptr->fd_child_count = 0; H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) @@ -2150,17 +2150,17 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u FUNC_ENTER_NOAPI(FAIL) - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(type); - HDassert(type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type); - HDassert(type->image_len); - HDassert(H5_addr_defined(addr)); - HDassert(thing); + assert(cache_ptr); + assert(type); + assert(type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type); + assert(type->image_len); + assert(H5_addr_defined(addr)); + assert(thing); #ifdef H5C_DO_EXTREME_SANITY_CHECKS /* no need to verify that entry is not already in the index as */ @@ -2217,7 +2217,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u /* Retrieve the size of the thing */ if ((type->image_len)(thing, &(entry_ptr->size)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "can't get size of thing") - HDassert(entry_ptr->size > 0 && entry_ptr->size < H5C_MAX_ENTRY_SIZE); + assert(entry_ptr->size > 0 && entry_ptr->size < H5C_MAX_ENTRY_SIZE); entry_ptr->in_slist = FALSE; @@ -2311,7 +2311,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u else write_permitted = cache_ptr->write_permitted; - HDassert(entry_ptr->size <= H5C_MAX_ENTRY_SIZE); + assert(entry_ptr->size <= H5C_MAX_ENTRY_SIZE); space_needed = entry_ptr->size; if (space_needed > cache_ptr->max_cache_size) space_needed = cache_ptr->max_cache_size; @@ -2345,7 +2345,7 @@ H5C_insert_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *thing, u H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL); /* New entries are presumed to be dirty */ - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->is_dirty); entry_ptr->flush_marker = set_flush_marker; H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL); H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, FAIL) @@ -2433,13 +2433,13 @@ H5C_mark_entry_dirty(void *thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry_ptr); - HDassert(H5_addr_defined(entry_ptr->addr)); + assert(entry_ptr); + assert(H5_addr_defined(entry_ptr->addr)); cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); if (entry_ptr->is_protected) { - HDassert(!((entry_ptr)->is_read_only)); + assert(!((entry_ptr)->is_read_only)); /* set the dirtied flag */ entry_ptr->dirtied = TRUE; @@ -2530,10 +2530,10 @@ H5C_mark_entry_clean(void *_thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry_ptr); - HDassert(H5_addr_defined(entry_ptr->addr)); + assert(entry_ptr); + assert(H5_addr_defined(entry_ptr->addr)); cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); /* Operate on pinned entry */ if (entry_ptr->is_protected) @@ -2604,11 +2604,11 @@ H5C_mark_entry_unserialized(void *thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry); - HDassert(H5_addr_defined(entry->addr)); + assert(entry); + assert(H5_addr_defined(entry->addr)); if (entry->is_protected || entry->is_pinned) { - HDassert(!entry->is_read_only); + assert(!entry->is_read_only); /* Reset image_up_to_date */ if (entry->image_up_to_date) { @@ -2650,8 +2650,8 @@ H5C_mark_entry_serialized(void *_thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry); - HDassert(H5_addr_defined(entry->addr)); + assert(entry); + assert(H5_addr_defined(entry->addr)); /* Operate on pinned entry */ if (entry->is_protected) @@ -2698,11 +2698,11 @@ H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, hadd FUNC_ENTER_NOAPI(FAIL) - HDassert(cache_ptr); - HDassert(type); - HDassert(H5_addr_defined(old_addr)); - HDassert(H5_addr_defined(new_addr)); - HDassert(H5_addr_ne(old_addr, new_addr)); + assert(cache_ptr); + assert(type); + assert(H5_addr_defined(old_addr)); + assert(H5_addr_defined(new_addr)); + assert(H5_addr_ne(old_addr, new_addr)); #ifdef H5C_DO_EXTREME_SANITY_CHECKS if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || @@ -2716,8 +2716,8 @@ H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, hadd /* the old item doesn't exist in the cache, so we are done. */ HGOTO_DONE(SUCCEED) - HDassert(entry_ptr->addr == old_addr); - HDassert(entry_ptr->type == type); + assert(entry_ptr->addr == old_addr); + assert(entry_ptr->type == type); /* Check for R/W status, otherwise error */ /* (Moving a R/O entry would mark it dirty, which shouldn't @@ -2754,7 +2754,7 @@ H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type, haddr_t old_addr, hadd H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr, FAIL); if (entry_ptr->in_slist) { - HDassert(cache_ptr->slist_ptr); + assert(cache_ptr->slist_ptr); H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE, FAIL) } /* end if */ } /* end if */ @@ -2845,10 +2845,10 @@ H5C_resize_entry(void *thing, size_t new_size) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry_ptr); - HDassert(H5_addr_defined(entry_ptr->addr)); + assert(entry_ptr); + assert(H5_addr_defined(entry_ptr->addr)); cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); /* Check for usage errors */ if (new_size <= 0) @@ -2977,10 +2977,10 @@ H5C_pin_protected_entry(void *thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry_ptr); - HDassert(H5_addr_defined(entry_ptr->addr)); + assert(entry_ptr); + assert(H5_addr_defined(entry_ptr->addr)); cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); #ifdef H5C_DO_EXTREME_SANITY_CHECKS if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || @@ -3050,13 +3050,13 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign FUNC_ENTER_NOAPI(NULL) /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(type); - HDassert(type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type); - HDassert(H5_addr_defined(addr)); + assert(cache_ptr); + assert(type); + assert(type->mem_type == cache_ptr->class_table_ptr[type->id]->mem_type); + assert(H5_addr_defined(addr)); #ifdef H5C_DO_EXTREME_SANITY_CHECKS if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || @@ -3097,8 +3097,8 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign if (H5C__deserialize_prefetched_entry(f, cache_ptr, &entry_ptr, type, addr, udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "can't deserialize prefetched entry") - HDassert(!entry_ptr->prefetched); - HDassert(entry_ptr->addr == addr); + assert(!entry_ptr->prefetched); + assert(entry_ptr->addr == addr); } /* end if */ /* Check for trying to load the wrong type of entry from an address */ @@ -3141,7 +3141,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign */ HDONE_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't generate entry's image") } /* end if */ - HDassert(entry_ptr->image_ptr); + assert(entry_ptr->image_ptr); H5_CHECKED_ASSIGN(buf_size, int, entry_ptr->size, size_t); if (MPI_SUCCESS != (mpi_code = MPI_Bcast(entry_ptr->image_ptr, buf_size, MPI_BYTE, 0, comm))) @@ -3240,7 +3240,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign have_write_permitted = TRUE; } /* end else */ - HDassert(entry_ptr->size <= H5C_MAX_ENTRY_SIZE); + assert(entry_ptr->size <= H5C_MAX_ENTRY_SIZE); space_needed = entry_ptr->size; if (space_needed > cache_ptr->max_cache_size) space_needed = cache_ptr->max_cache_size; @@ -3305,12 +3305,12 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign was_loaded = TRUE; } /* end else */ - HDassert(entry_ptr->addr == addr); - HDassert(entry_ptr->type == type); + assert(entry_ptr->addr == addr); + assert(entry_ptr->type == type); if (entry_ptr->is_protected) { if (read_only && entry_ptr->is_read_only) { - HDassert(entry_ptr->ro_ref_count > 0); + assert(entry_ptr->ro_ref_count > 0); (entry_ptr->ro_ref_count)++; } /* end if */ else @@ -3443,9 +3443,9 @@ H5C_unpin_entry(void *_entry_ptr) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(entry_ptr); + assert(entry_ptr); cache_ptr = entry_ptr->cache_ptr; - HDassert(cache_ptr); + assert(cache_ptr); #ifdef H5C_DO_EXTREME_SANITY_CHECKS if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || @@ -3521,27 +3521,27 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) free_file_space = ((flags & H5C__FREE_FILE_SPACE_FLAG) != 0); take_ownership = ((flags & H5C__TAKE_OWNERSHIP_FLAG) != 0); - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(H5_addr_defined(addr)); - HDassert(thing); - HDassert(!(pin_entry && unpin_entry)); + assert(cache_ptr); + assert(H5_addr_defined(addr)); + assert(thing); + assert(!(pin_entry && unpin_entry)); /* deleted flag must accompany free_file_space */ - HDassert((!free_file_space) || (deleted)); + assert((!free_file_space) || (deleted)); /* deleted flag must accompany take_ownership */ - HDassert((!take_ownership) || (deleted)); + assert((!take_ownership) || (deleted)); /* can't have both free_file_space & take_ownership */ - HDassert(!(free_file_space && take_ownership)); + assert(!(free_file_space && take_ownership)); entry_ptr = (H5C_cache_entry_t *)thing; - HDassert(entry_ptr->addr == addr); + assert(entry_ptr->addr == addr); /* also set the dirtied variable if the dirtied field is set in * the entry. @@ -3561,8 +3561,8 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) */ if (entry_ptr->ro_ref_count > 1) { /* Sanity check */ - HDassert(entry_ptr->is_protected); - HDassert(entry_ptr->is_read_only); + assert(entry_ptr->is_protected); + assert(entry_ptr->is_read_only); if (dirtied) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??") @@ -3585,7 +3585,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) else { if (entry_ptr->is_read_only) { /* Sanity check */ - HDassert(entry_ptr->ro_ref_count == 1); + assert(entry_ptr->ro_ref_count == 1); if (dirtied) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Read only entry modified??") @@ -3612,7 +3612,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) */ if (entry_ptr->clear_on_unprotect) { /* Sanity check */ - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->is_dirty); entry_ptr->clear_on_unprotect = FALSE; if (!dirtied) @@ -3730,7 +3730,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) /* Delete the entry from the skip list on destroy */ flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; - HDassert((!cache_ptr->slist_enabled) || (((!was_clean) || dirtied) == (entry_ptr->in_slist))); + assert((!cache_ptr->slist_enabled) || (((!was_clean) || dirtied) == (entry_ptr->in_slist))); if (H5C__flush_single_entry(f, entry_ptr, flush_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush entry") @@ -3799,12 +3799,12 @@ H5C_unsettle_entry_ring(void *_entry) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry); - HDassert(entry->ring != H5C_RING_UNDEFINED); - HDassert((H5C_RING_USER == entry->ring) || (H5C_RING_RDFSM == entry->ring) || - (H5C_RING_MDFSM == entry->ring)); + assert(entry); + assert(entry->ring != H5C_RING_UNDEFINED); + assert((H5C_RING_USER == entry->ring) || (H5C_RING_RDFSM == entry->ring) || + (H5C_RING_MDFSM == entry->ring)); cache = entry->cache_ptr; - HDassert(cache); + assert(cache); switch (entry->ring) { case H5C_RING_USER: @@ -3828,7 +3828,7 @@ H5C_unsettle_entry_ring(void *_entry) break; default: - HDassert(FALSE); /* this should be un-reachable */ + assert(FALSE); /* this should be un-reachable */ break; } /* end switch */ @@ -3869,20 +3869,20 @@ H5C_create_flush_dependency(void *parent_thing, void *child_thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(parent_entry); - HDassert(H5_addr_defined(parent_entry->addr)); - HDassert(child_entry); - HDassert(H5_addr_defined(child_entry->addr)); + assert(parent_entry); + assert(H5_addr_defined(parent_entry->addr)); + assert(child_entry); + assert(H5_addr_defined(child_entry->addr)); cache_ptr = parent_entry->cache_ptr; - HDassert(cache_ptr); - HDassert(cache_ptr == child_entry->cache_ptr); + assert(cache_ptr); + assert(cache_ptr == child_entry->cache_ptr); #ifndef NDEBUG /* Make sure the parent is not already a parent */ { unsigned u; for (u = 0; u < child_entry->flush_dep_nparents; u++) - HDassert(child_entry->flush_dep_parent[u] != parent_entry); + assert(child_entry->flush_dep_parent[u] != parent_entry); } /* end block */ #endif @@ -3895,9 +3895,9 @@ H5C_create_flush_dependency(void *parent_thing, void *child_thing) /* Check for parent not pinned */ if (!parent_entry->is_pinned) { /* Sanity check */ - HDassert(parent_entry->flush_dep_nchildren == 0); - HDassert(!parent_entry->pinned_from_client); - HDassert(!parent_entry->pinned_from_cache); + assert(parent_entry->flush_dep_nchildren == 0); + assert(!parent_entry->pinned_from_client); + assert(!parent_entry->pinned_from_cache); /* Pin the parent entry */ parent_entry->is_pinned = TRUE; @@ -3911,7 +3911,7 @@ H5C_create_flush_dependency(void *parent_thing, void *child_thing) if (child_entry->flush_dep_nparents >= child_entry->flush_dep_parent_nalloc) { if (child_entry->flush_dep_parent_nalloc == 0) { /* Array does not exist yet, allocate it */ - HDassert(!child_entry->flush_dep_parent); + assert(!child_entry->flush_dep_parent); if (NULL == (child_entry->flush_dep_parent = H5FL_SEQ_MALLOC(H5C_cache_entry_ptr_t, H5C_FLUSH_DEP_PARENT_INIT))) @@ -3921,7 +3921,7 @@ H5C_create_flush_dependency(void *parent_thing, void *child_thing) } /* end if */ else { /* Resize existing array */ - HDassert(child_entry->flush_dep_parent); + assert(child_entry->flush_dep_parent); if (NULL == (child_entry->flush_dep_parent = H5FL_SEQ_REALLOC(H5C_cache_entry_ptr_t, child_entry->flush_dep_parent, @@ -3943,7 +3943,7 @@ H5C_create_flush_dependency(void *parent_thing, void *child_thing) /* Adjust the number of dirty children */ if (child_entry->is_dirty) { /* Sanity check */ - HDassert(parent_entry->flush_dep_ndirty_children < parent_entry->flush_dep_nchildren); + assert(parent_entry->flush_dep_ndirty_children < parent_entry->flush_dep_nchildren); parent_entry->flush_dep_ndirty_children++; @@ -3958,7 +3958,7 @@ H5C_create_flush_dependency(void *parent_thing, void *child_thing) * that it is possible for and entry to be clean and unserialized. */ if (!child_entry->image_up_to_date) { - HDassert(parent_entry->flush_dep_nunser_children < parent_entry->flush_dep_nchildren); + assert(parent_entry->flush_dep_nunser_children < parent_entry->flush_dep_nchildren); parent_entry->flush_dep_nunser_children++; @@ -3970,11 +3970,11 @@ H5C_create_flush_dependency(void *parent_thing, void *child_thing) } /* end if */ /* Post-conditions, for successful operation */ - HDassert(parent_entry->is_pinned); - HDassert(parent_entry->flush_dep_nchildren > 0); - HDassert(child_entry->flush_dep_parent); - HDassert(child_entry->flush_dep_nparents > 0); - HDassert(child_entry->flush_dep_parent_nalloc > 0); + assert(parent_entry->is_pinned); + assert(parent_entry->flush_dep_nchildren > 0); + assert(child_entry->flush_dep_parent); + assert(child_entry->flush_dep_nparents > 0); + assert(child_entry->flush_dep_parent_nalloc > 0); #ifndef NDEBUG H5C__assert_flush_dep_nocycle(parent_entry, child_entry); #endif @@ -4008,13 +4008,13 @@ H5C_destroy_flush_dependency(void *parent_thing, void *child_thing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(parent_entry); - HDassert(H5_addr_defined(parent_entry->addr)); - HDassert(child_entry); - HDassert(H5_addr_defined(child_entry->addr)); + assert(parent_entry); + assert(H5_addr_defined(parent_entry->addr)); + assert(child_entry); + assert(H5_addr_defined(child_entry->addr)); cache_ptr = parent_entry->cache_ptr; - HDassert(cache_ptr); - HDassert(cache_ptr == child_entry->cache_ptr); + assert(cache_ptr); + assert(cache_ptr == child_entry->cache_ptr); /* Usage checks */ if (!parent_entry->is_pinned) @@ -4046,7 +4046,7 @@ H5C_destroy_flush_dependency(void *parent_thing, void *child_thing) parent_entry->flush_dep_nchildren--; if (0 == parent_entry->flush_dep_nchildren) { /* Sanity check */ - HDassert(parent_entry->pinned_from_cache); + assert(parent_entry->pinned_from_cache); /* Check if we should unpin parent entry now */ if (!parent_entry->pinned_from_client) @@ -4060,7 +4060,7 @@ H5C_destroy_flush_dependency(void *parent_thing, void *child_thing) /* Adjust parent entry's ndirty_children */ if (child_entry->is_dirty) { /* Sanity check */ - HDassert(parent_entry->flush_dep_ndirty_children > 0); + assert(parent_entry->flush_dep_ndirty_children > 0); parent_entry->flush_dep_ndirty_children--; @@ -4073,7 +4073,7 @@ H5C_destroy_flush_dependency(void *parent_thing, void *child_thing) /* adjust parent entry's number of unserialized children */ if (!child_entry->image_up_to_date) { - HDassert(parent_entry->flush_dep_nunser_children > 0); + assert(parent_entry->flush_dep_nunser_children > 0); parent_entry->flush_dep_nunser_children--; @@ -4127,12 +4127,12 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag FUNC_ENTER_NOAPI(FAIL) - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(type); - HDassert(H5_addr_defined(addr)); + assert(cache_ptr); + assert(type); + assert(H5_addr_defined(addr)); #ifdef H5C_DO_EXTREME_SANITY_CHECKS if (H5C__validate_lru_list(cache_ptr) < 0) @@ -4145,8 +4145,8 @@ H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flag /* the target doesn't exist in the cache, so we are done. */ HGOTO_DONE(SUCCEED) - HDassert(entry_ptr->addr == addr); - HDassert(entry_ptr->type == type); + assert(entry_ptr->addr == addr); + assert(entry_ptr->type == type); /* Check for entry being pinned or protected */ if (entry_ptr->is_protected) @@ -4200,10 +4200,10 @@ H5C_remove_entry(void *_entry) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(entry); - HDassert(entry->ring != H5C_RING_UNDEFINED); + assert(entry); + assert(entry->ring != H5C_RING_UNDEFINED); cache = entry->cache_ptr; - HDassert(cache); + assert(cache); /* Check for error conditions */ if (entry->is_dirty) @@ -4226,9 +4226,9 @@ H5C_remove_entry(void *_entry) "can't remove entry with flush dependency children from cache") /* Additional internal cache consistency checks */ - HDassert(!entry->in_slist); - HDassert(!entry->flush_marker); - HDassert(!entry->flush_in_progress); + assert(!entry->in_slist); + assert(!entry->flush_marker); + assert(!entry->flush_in_progress); /* Note that the algorithm below is (very) similar to the set of operations * in H5C__flush_single_entry() and should be kept in sync with changes diff --git a/src/H5Cimage.c b/src/H5Cimage.c index 8582d5d..bfe1796 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -91,13 +91,13 @@ #define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) \ { \ /* make sure image len is still good */ \ - HDassert((cache_ptr)->image_len > 0); \ + assert((cache_ptr)->image_len > 0); \ (cache_ptr)->images_read++; \ } #define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) \ { \ /* make sure image len is still good */ \ - HDassert((cache_ptr)->image_len > 0); \ + assert((cache_ptr)->image_len > 0); \ (cache_ptr)->images_loaded++; \ (cache_ptr)->last_image_size = (cache_ptr)->image_len; \ } @@ -178,7 +178,7 @@ H5C_cache_image_pending(const H5C_t *cache_ptr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(cache_ptr); + assert(cache_ptr); ret_value = (cache_ptr->load_image && !cache_ptr->image_loaded); @@ -215,12 +215,12 @@ H5C_cache_image_status(H5F_t *f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(load_ci_ptr); - HDassert(write_ci_ptr); + assert(cache_ptr); + assert(load_ci_ptr); + assert(write_ci_ptr); *load_ci_ptr = cache_ptr->load_image || cache_ptr->image_loaded; *write_ci_ptr = cache_ptr->image_ctl.generate_image; @@ -255,16 +255,16 @@ H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(cache_ptr == f->shared->cache); - HDassert(cache_ptr); - HDassert(cache_ptr->close_warning_received); - HDassert(cache_ptr->image_ctl.generate_image); - HDassert(cache_ptr->num_entries_in_image > 0); - HDassert(cache_ptr->index_len == 0); - HDassert(cache_ptr->image_data_len > 0); - HDassert(cache_ptr->image_data_len <= cache_ptr->image_len); + assert(f); + assert(f->shared); + assert(cache_ptr == f->shared->cache); + assert(cache_ptr); + assert(cache_ptr->close_warning_received); + assert(cache_ptr->image_ctl.generate_image); + assert(cache_ptr->num_entries_in_image > 0); + assert(cache_ptr->index_len == 0); + assert(cache_ptr->image_data_len > 0); + assert(cache_ptr->image_data_len <= cache_ptr->image_len); /* Allocate the buffer in which to construct the cache image block */ if (NULL == (cache_ptr->image_buffer = H5MM_malloc(cache_ptr->image_len + 1))) @@ -274,13 +274,13 @@ H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr) p = (uint8_t *)cache_ptr->image_buffer; if (H5C__encode_cache_image_header(f, cache_ptr, &p) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTENCODE, FAIL, "header image construction failed") - HDassert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) < cache_ptr->image_data_len); + assert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) < cache_ptr->image_data_len); /* Construct the cache entry images */ for (u = 0; u < cache_ptr->num_entries_in_image; u++) if (H5C__encode_cache_image_entry(f, cache_ptr, &p, u) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTENCODE, FAIL, "entry image construction failed") - HDassert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) < cache_ptr->image_data_len); + assert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) < cache_ptr->image_data_len); /* Construct the adaptive resize status image -- not yet */ @@ -288,8 +288,8 @@ H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr) chksum = H5_checksum_metadata(cache_ptr->image_buffer, (size_t)(cache_ptr->image_data_len - H5F_SIZEOF_CHKSUM), 0); UINT32ENCODE(p, chksum); - HDassert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) == cache_ptr->image_data_len); - HDassert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) <= cache_ptr->image_len); + assert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) == cache_ptr->image_data_len); + assert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) <= cache_ptr->image_len); #ifndef NDEBUG /* validate the metadata cache image we just constructed by decoding it @@ -303,20 +303,20 @@ H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr) herr_t status; /* Status from decoding */ fake_cache_ptr = (H5C_t *)H5MM_malloc(sizeof(H5C_t)); - HDassert(fake_cache_ptr); + assert(fake_cache_ptr); /* needed for sanity checks */ fake_cache_ptr->image_len = cache_ptr->image_len; q = (const uint8_t *)cache_ptr->image_buffer; status = H5C__decode_cache_image_header(f, fake_cache_ptr, &q); - HDassert(status >= 0); + assert(status >= 0); - HDassert(NULL != p); - HDassert(fake_cache_ptr->num_entries_in_image == cache_ptr->num_entries_in_image); + assert(NULL != p); + assert(fake_cache_ptr->num_entries_in_image == cache_ptr->num_entries_in_image); fake_cache_ptr->image_entries = (H5C_image_entry_t *)H5MM_malloc( sizeof(H5C_image_entry_t) * (size_t)(fake_cache_ptr->num_entries_in_image + 1)); - HDassert(fake_cache_ptr->image_entries); + assert(fake_cache_ptr->image_entries); for (u = 0; u < fake_cache_ptr->num_entries_in_image; u++) { fake_cache_ptr->image_entries[u].image_ptr = NULL; @@ -324,58 +324,58 @@ H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr) /* touch up f->shared->cache to satisfy sanity checks... */ f->shared->cache = fake_cache_ptr; status = H5C__decode_cache_image_entry(f, fake_cache_ptr, &q, u); - HDassert(status >= 0); + assert(status >= 0); /* ...and then return f->shared->cache to its correct value */ f->shared->cache = cache_ptr; /* verify expected contents */ - HDassert(cache_ptr->image_entries[u].addr == fake_cache_ptr->image_entries[u].addr); - HDassert(cache_ptr->image_entries[u].size == fake_cache_ptr->image_entries[u].size); - HDassert(cache_ptr->image_entries[u].type_id == fake_cache_ptr->image_entries[u].type_id); - HDassert(cache_ptr->image_entries[u].lru_rank == fake_cache_ptr->image_entries[u].lru_rank); - HDassert(cache_ptr->image_entries[u].is_dirty == fake_cache_ptr->image_entries[u].is_dirty); + assert(cache_ptr->image_entries[u].addr == fake_cache_ptr->image_entries[u].addr); + assert(cache_ptr->image_entries[u].size == fake_cache_ptr->image_entries[u].size); + assert(cache_ptr->image_entries[u].type_id == fake_cache_ptr->image_entries[u].type_id); + assert(cache_ptr->image_entries[u].lru_rank == fake_cache_ptr->image_entries[u].lru_rank); + assert(cache_ptr->image_entries[u].is_dirty == fake_cache_ptr->image_entries[u].is_dirty); /* don't check image_fd_height as it is not stored in * the metadata cache image block. */ - HDassert(cache_ptr->image_entries[u].fd_child_count == - fake_cache_ptr->image_entries[u].fd_child_count); - HDassert(cache_ptr->image_entries[u].fd_dirty_child_count == - fake_cache_ptr->image_entries[u].fd_dirty_child_count); - HDassert(cache_ptr->image_entries[u].fd_parent_count == - fake_cache_ptr->image_entries[u].fd_parent_count); + assert(cache_ptr->image_entries[u].fd_child_count == + fake_cache_ptr->image_entries[u].fd_child_count); + assert(cache_ptr->image_entries[u].fd_dirty_child_count == + fake_cache_ptr->image_entries[u].fd_dirty_child_count); + assert(cache_ptr->image_entries[u].fd_parent_count == + fake_cache_ptr->image_entries[u].fd_parent_count); for (v = 0; v < cache_ptr->image_entries[u].fd_parent_count; v++) - HDassert(cache_ptr->image_entries[u].fd_parent_addrs[v] == - fake_cache_ptr->image_entries[u].fd_parent_addrs[v]); + assert(cache_ptr->image_entries[u].fd_parent_addrs[v] == + fake_cache_ptr->image_entries[u].fd_parent_addrs[v]); /* free the fd_parent_addrs array if it exists */ if (fake_cache_ptr->image_entries[u].fd_parent_addrs) { - HDassert(fake_cache_ptr->image_entries[u].fd_parent_count > 0); + assert(fake_cache_ptr->image_entries[u].fd_parent_count > 0); fake_cache_ptr->image_entries[u].fd_parent_addrs = (haddr_t *)H5MM_xfree(fake_cache_ptr->image_entries[u].fd_parent_addrs); fake_cache_ptr->image_entries[u].fd_parent_count = 0; } /* end if */ else - HDassert(fake_cache_ptr->image_entries[u].fd_parent_count == 0); + assert(fake_cache_ptr->image_entries[u].fd_parent_count == 0); - HDassert(cache_ptr->image_entries[u].image_ptr); - HDassert(fake_cache_ptr->image_entries[u].image_ptr); - HDassert(!HDmemcmp(cache_ptr->image_entries[u].image_ptr, - fake_cache_ptr->image_entries[u].image_ptr, cache_ptr->image_entries[u].size)); + assert(cache_ptr->image_entries[u].image_ptr); + assert(fake_cache_ptr->image_entries[u].image_ptr); + assert(!HDmemcmp(cache_ptr->image_entries[u].image_ptr, + fake_cache_ptr->image_entries[u].image_ptr, cache_ptr->image_entries[u].size)); fake_cache_ptr->image_entries[u].image_ptr = H5MM_xfree(fake_cache_ptr->image_entries[u].image_ptr); } /* end for */ - HDassert((size_t)(q - (const uint8_t *)cache_ptr->image_buffer) == - cache_ptr->image_data_len - H5F_SIZEOF_CHKSUM); + assert((size_t)(q - (const uint8_t *)cache_ptr->image_buffer) == + cache_ptr->image_data_len - H5F_SIZEOF_CHKSUM); /* compute the checksum */ old_chksum = chksum; chksum = H5_checksum_metadata(cache_ptr->image_buffer, (size_t)(cache_ptr->image_data_len - H5F_SIZEOF_CHKSUM), 0); - HDassert(chksum == old_chksum); + assert(chksum == old_chksum); fake_cache_ptr->image_entries = (H5C_image_entry_t *)H5MM_xfree(fake_cache_ptr->image_entries); fake_cache_ptr = (H5C_t *)H5MM_xfree(fake_cache_ptr); @@ -407,10 +407,10 @@ H5C__generate_cache_image(H5F_t *f, H5C_t *cache_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(cache_ptr == f->shared->cache); - HDassert(cache_ptr); + assert(f); + assert(f->shared); + assert(cache_ptr == f->shared->cache); + assert(cache_ptr); /* Construct cache image */ if (H5C__construct_cache_image_buffer(f, cache_ptr) < 0) @@ -429,7 +429,7 @@ H5C__generate_cache_image(H5F_t *f, H5C_t *cache_ptr) } /* end if */ /* Free cache image buffer */ - HDassert(cache_ptr->image_buffer); + assert(cache_ptr->image_buffer); cache_ptr->image_buffer = H5MM_xfree(cache_ptr->image_buffer); done: @@ -459,10 +459,10 @@ H5C__free_image_entries_array(H5C_t *cache_ptr) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->close_warning_received); - HDassert(cache_ptr->image_ctl.generate_image); - HDassert(cache_ptr->index_len == 0); + assert(cache_ptr); + assert(cache_ptr->close_warning_received); + assert(cache_ptr->image_ctl.generate_image); + assert(cache_ptr->index_len == 0); /* Check for entries to free */ if (cache_ptr->image_entries != NULL) { @@ -475,17 +475,17 @@ H5C__free_image_entries_array(H5C_t *cache_ptr) ie_ptr = &(cache_ptr->image_entries[u]); /* Sanity checks */ - HDassert(ie_ptr); - HDassert(ie_ptr->image_ptr); + assert(ie_ptr); + assert(ie_ptr->image_ptr); /* Free the parent addrs array if appropriate */ if (ie_ptr->fd_parent_addrs) { - HDassert(ie_ptr->fd_parent_count > 0); + assert(ie_ptr->fd_parent_count > 0); ie_ptr->fd_parent_addrs = (haddr_t *)H5MM_xfree(ie_ptr->fd_parent_addrs); } /* end if */ else - HDassert(ie_ptr->fd_parent_count == 0); + assert(ie_ptr->fd_parent_count == 0); /* Free the image */ ie_ptr->image_ptr = H5MM_xfree(ie_ptr->image_ptr); @@ -551,11 +551,11 @@ H5C__read_cache_image(H5F_t *f, H5C_t *cache_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(cache_ptr); - HDassert(H5_addr_defined(cache_ptr->image_addr)); - HDassert(cache_ptr->image_len > 0); - HDassert(cache_ptr->image_buffer); + assert(f); + assert(cache_ptr); + assert(H5_addr_defined(cache_ptr->image_addr)); + assert(cache_ptr->image_len > 0); + assert(cache_ptr->image_buffer); #ifdef H5_HAVE_PARALLEL { @@ -622,10 +622,10 @@ H5C__load_cache_image(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); /* If the image address is defined, load the image, decode it, * and insert its contents into the metadata cache. @@ -638,8 +638,8 @@ H5C__load_cache_image(H5F_t *f) */ if (H5_addr_defined(cache_ptr->image_addr)) { /* Sanity checks */ - HDassert(cache_ptr->image_len > 0); - HDassert(cache_ptr->image_buffer == NULL); + assert(cache_ptr->image_len > 0); + assert(cache_ptr->image_buffer == NULL); /* Allocate space for the image */ if (NULL == (cache_ptr->image_buffer = H5MM_malloc(cache_ptr->image_len + 1))) @@ -716,10 +716,10 @@ H5C_load_cache_image_on_next_protect(H5F_t *f, haddr_t addr, hsize_t len, hbool_ FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); /* Set information needed to load cache image */ cache_ptr->image_addr = addr; @@ -764,8 +764,8 @@ H5C__image_entry_cmp(const void *_entry1, const void *_entry2) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(entry1); - HDassert(entry2); + assert(entry1); + assert(entry2); if (entry1->image_fd_height > entry2->image_fd_height) ret_value = -1; @@ -773,8 +773,8 @@ H5C__image_entry_cmp(const void *_entry1, const void *_entry2) ret_value = 1; else { /* Sanity check */ - HDassert(entry1->lru_rank >= -1); - HDassert(entry2->lru_rank >= -1); + assert(entry1->lru_rank >= -1); + assert(entry2->lru_rank >= -1); if (entry1->lru_rank < entry2->lru_rank) ret_value = -1; @@ -843,12 +843,12 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(image_generated); + assert(cache_ptr); + assert(image_generated); /* If the file is opened and closed without any access to * any group or data set, it is possible that the cache image (if @@ -879,7 +879,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) H5C_cache_image_ctl_t default_image_ctl = H5C__DEFAULT_CACHE_IMAGE_CTL; cache_ptr->image_ctl = default_image_ctl; - HDassert(!(cache_ptr->image_ctl.generate_image)); + assert(!(cache_ptr->image_ctl.generate_image)); } /* end if */ /* Generate the cache image, if requested */ @@ -924,7 +924,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) */ if (H5C__prep_for_file_close__scan_entries(f, cache_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C__prep_for_file_close__scan_entries failed") - HDassert(HADDR_UNDEF == cache_ptr->image_addr); + assert(HADDR_UNDEF == cache_ptr->image_addr); #ifdef H5_HAVE_PARALLEL /* In the parallel case, overwrite the image_len with the @@ -944,7 +944,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) (mpi_result = MPI_Bcast(&p0_image_len, 1, MPI_UNSIGNED, 0, aux_ptr->mpi_comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) - HDassert(p0_image_len == aux_ptr->p0_image_len); + assert(p0_image_len == aux_ptr->p0_image_len); } /* end if */ else { if (MPI_SUCCESS != @@ -986,7 +986,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * shutdown the self referential free space managers after * we destroy the metadata cache. */ - HDassert(HADDR_UNDEF == f->shared->eoa_post_mdci_fsalloc); + assert(HADDR_UNDEF == f->shared->eoa_post_mdci_fsalloc); if (HADDR_UNDEF == (f->shared->eoa_post_mdci_fsalloc = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size") @@ -1002,7 +1002,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) * a fragment on a cache image allocation, leave the following * assertion in the code so we will find out. */ - HDassert((eoa_frag_size == 0) || (f->shared->alignment != 1)); + assert((eoa_frag_size == 0) || (f->shared->alignment != 1)); /* Eventually it will be possible for the length of the cache image * block on file to be greater than the size of the data it @@ -1066,7 +1066,7 @@ H5C__prep_image_for_file_close(H5F_t *f, hbool_t *image_generated) sizeof(H5C_image_entry_t), H5C__image_entry_cmp); } /* end if */ else { /* cancel creation of metadata cache image */ - HDassert(cache_ptr->image_entries == NULL); + assert(cache_ptr->image_entries == NULL); /* To avoid breaking the control flow tests, only delete * the mdci superblock extension message if the @@ -1125,9 +1125,9 @@ H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_image_ctl FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache == f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache == f->shared->cache); /* Check arguments */ if (cache_ptr == NULL) @@ -1146,7 +1146,7 @@ H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_image_ctl H5C_cache_image_ctl_t default_image_ctl = H5C__DEFAULT_CACHE_IMAGE_CTL; cache_ptr->image_ctl = default_image_ctl; - HDassert(!(cache_ptr->image_ctl.generate_image)); + assert(!(cache_ptr->image_ctl.generate_image)); } /* end if */ else { #endif /* H5_HAVE_PARALLEL */ @@ -1168,7 +1168,7 @@ H5C_set_cache_image_config(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_image_ctl H5C_cache_image_ctl_t default_image_ctl = H5C__DEFAULT_CACHE_IMAGE_CTL; cache_ptr->image_ctl = default_image_ctl; - HDassert(!(cache_ptr->image_ctl.generate_image)); + assert(!(cache_ptr->image_ctl.generate_image)); } /* end else */ #ifdef H5_HAVE_PARALLEL } /* end else */ @@ -1327,9 +1327,9 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t * FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr); - HDassert(buf); - HDassert(*buf); + assert(cache_ptr); + assert(buf); + assert(*buf); /* Point to buffer to decode */ p = *buf; @@ -1423,15 +1423,15 @@ H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, const uint FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(cache_ptr == f->shared->cache); - HDassert(cache_ptr); - HDassert(buf); - HDassert(*buf); - HDassert(entry_num < cache_ptr->num_entries_in_image); + assert(f); + assert(f->shared); + assert(cache_ptr == f->shared->cache); + assert(cache_ptr); + assert(buf); + assert(*buf); + assert(entry_num < cache_ptr->num_entries_in_image); ie_ptr = &(cache_ptr->image_entries[entry_num]); - HDassert(ie_ptr); + assert(ie_ptr); /* Get pointer to buffer */ p = *buf; @@ -1452,15 +1452,15 @@ H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, const uint /* Decode ring */ ring = *p++; - HDassert(ring > (uint8_t)(H5C_RING_UNDEFINED)); - HDassert(ring < (uint8_t)(H5C_RING_NTYPES)); + assert(ring > (uint8_t)(H5C_RING_UNDEFINED)); + assert(ring < (uint8_t)(H5C_RING_NTYPES)); /* Decode age */ age = *p++; /* Decode dependency child count */ UINT16DECODE(p, fd_child_count); - HDassert((is_fd_parent && fd_child_count > 0) || (!is_fd_parent && fd_child_count == 0)); + assert((is_fd_parent && fd_child_count > 0) || (!is_fd_parent && fd_child_count == 0)); /* Decode dirty dependency child count */ UINT16DECODE(p, fd_dirty_child_count); @@ -1469,11 +1469,11 @@ H5C__decode_cache_image_entry(const H5F_t *f, const H5C_t *cache_ptr, const uint /* Decode dependency parent count */ UINT16DECODE(p, fd_parent_count); - HDassert((is_fd_child && fd_parent_count > 0) || (!is_fd_child && fd_parent_count == 0)); + assert((is_fd_child && fd_parent_count > 0) || (!is_fd_child && fd_parent_count == 0)); /* Decode index in LRU */ INT32DECODE(p, lru_rank); - HDassert((in_lru && lru_rank >= 0) || (!in_lru && lru_rank == -1)); + assert((in_lru && lru_rank >= 0) || (!in_lru && lru_rank == -1)); /* Decode entry offset */ H5F_addr_decode(f, &p, &addr); @@ -1565,14 +1565,14 @@ H5C__encode_cache_image_header(const H5F_t *f, const H5C_t *cache_ptr, uint8_t * FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->close_warning_received); - HDassert(cache_ptr->image_ctl.generate_image); - HDassert(cache_ptr->index_len == 0); - HDassert(cache_ptr->image_data_len > 0); - HDassert(cache_ptr->image_data_len <= cache_ptr->image_len); - HDassert(buf); - HDassert(*buf); + assert(cache_ptr); + assert(cache_ptr->close_warning_received); + assert(cache_ptr->image_ctl.generate_image); + assert(cache_ptr->index_len == 0); + assert(cache_ptr->image_data_len > 0); + assert(cache_ptr->image_data_len <= cache_ptr->image_len); + assert(buf); + assert(*buf); /* Set pointer into buffer */ p = *buf; @@ -1587,7 +1587,7 @@ H5C__encode_cache_image_header(const H5F_t *f, const H5C_t *cache_ptr, uint8_t * /* setup and write flags */ /* at present we don't support saving resize status */ - HDassert(!cache_ptr->image_ctl.save_resize_status); + assert(!cache_ptr->image_ctl.save_resize_status); if (cache_ptr->image_ctl.save_resize_status) flags |= H5C__MDCI_HEADER_HAVE_RESIZE_STATUS; @@ -1595,7 +1595,7 @@ H5C__encode_cache_image_header(const H5F_t *f, const H5C_t *cache_ptr, uint8_t * /* Encode image data length */ /* this must be true at present */ - HDassert(cache_ptr->image_len == cache_ptr->image_data_len); + assert(cache_ptr->image_len == cache_ptr->image_data_len); H5F_ENCODE_LENGTH(f, p, cache_ptr->image_data_len); /* write num entries */ @@ -1640,16 +1640,16 @@ H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf, unsigne FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(cache_ptr == f->shared->cache); - HDassert(cache_ptr); - HDassert(cache_ptr->close_warning_received); - HDassert(cache_ptr->image_ctl.generate_image); - HDassert(cache_ptr->index_len == 0); - HDassert(buf); - HDassert(*buf); - HDassert(entry_num < cache_ptr->num_entries_in_image); + assert(f); + assert(f->shared); + assert(cache_ptr == f->shared->cache); + assert(cache_ptr); + assert(cache_ptr->close_warning_received); + assert(cache_ptr->image_ctl.generate_image); + assert(cache_ptr->index_len == 0); + assert(buf); + assert(*buf); + assert(entry_num < cache_ptr->num_entries_in_image); ie_ptr = &(cache_ptr->image_entries[entry_num]); /* Get pointer to buffer to encode into */ @@ -1785,7 +1785,7 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) FUNC_ENTER_PACKAGE /* sanity checks */ - HDassert(cache_ptr); + assert(cache_ptr); /* Remove from the cache image all dirty entries that are * flush dependency children of dirty entries that are not in the @@ -1801,12 +1801,12 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) while (entry_ptr != NULL) { /* Should this entry be in the image */ if (entry_ptr->image_dirty && entry_ptr->include_in_image && (entry_ptr->fd_parent_count > 0)) { - HDassert(entry_ptr->flush_dep_parent != NULL); + assert(entry_ptr->flush_dep_parent != NULL); for (u = 0; u < entry_ptr->flush_dep_nparents; u++) { parent_ptr = entry_ptr->flush_dep_parent[u]; /* Sanity check parent */ - HDassert(entry_ptr->ring == parent_ptr->ring); + assert(entry_ptr->ring == parent_ptr->ring); if (parent_ptr->is_dirty && !parent_ptr->include_in_image && entry_ptr->include_in_image) { @@ -1830,7 +1830,7 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) * so. Note that this will change when we start aging entries out * of the cache image. */ - HDassert(entries_removed_from_image == 0); + assert(entries_removed_from_image == 0); /* Next, remove from entries in the cache image, references to * flush dependency parents or children that are not in the cache image. @@ -1838,21 +1838,21 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) entry_ptr = cache_ptr->il_head; while (entry_ptr != NULL) { if (!entry_ptr->include_in_image && entry_ptr->flush_dep_nparents > 0) { - HDassert(entry_ptr->flush_dep_parent != NULL); + assert(entry_ptr->flush_dep_parent != NULL); for (u = 0; u < entry_ptr->flush_dep_nparents; u++) { parent_ptr = entry_ptr->flush_dep_parent[u]; /* Sanity check parent */ - HDassert(entry_ptr->ring == parent_ptr->ring); + assert(entry_ptr->ring == parent_ptr->ring); if (parent_ptr->include_in_image) { /* Must remove reference to child */ - HDassert(parent_ptr->fd_child_count > 0); + assert(parent_ptr->fd_child_count > 0); parent_ptr->fd_child_count--; if (entry_ptr->is_dirty) { - HDassert(parent_ptr->fd_dirty_child_count > 0); + assert(parent_ptr->fd_dirty_child_count > 0); parent_ptr->fd_dirty_child_count--; } /* end if */ @@ -1864,22 +1864,22 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) } /* end if */ else if (entry_ptr->include_in_image && entry_ptr->flush_dep_nparents > 0) { /* Sanity checks */ - HDassert(entry_ptr->flush_dep_parent != NULL); - HDassert(entry_ptr->flush_dep_nparents == entry_ptr->fd_parent_count); - HDassert(entry_ptr->fd_parent_addrs); + assert(entry_ptr->flush_dep_parent != NULL); + assert(entry_ptr->flush_dep_nparents == entry_ptr->fd_parent_count); + assert(entry_ptr->fd_parent_addrs); for (u = 0; u < entry_ptr->flush_dep_nparents; u++) { parent_ptr = entry_ptr->flush_dep_parent[u]; /* Sanity check parent */ - HDassert(entry_ptr->ring == parent_ptr->ring); + assert(entry_ptr->ring == parent_ptr->ring); if (!parent_ptr->include_in_image) { /* Must remove reference to parent */ - HDassert(entry_ptr->fd_parent_count > 0); + assert(entry_ptr->fd_parent_count > 0); parent_ptr->fd_child_count--; - HDassert(parent_ptr->addr == entry_ptr->fd_parent_addrs[u]); + assert(parent_ptr->addr == entry_ptr->fd_parent_addrs[u]); entry_ptr->fd_parent_addrs[u] = HADDR_UNDEF; #ifndef NDEBUG @@ -1910,7 +1910,7 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) } /* end if */ } /* end for */ - HDassert(v == entry_ptr->fd_parent_count); + assert(v == entry_ptr->fd_parent_count); } /* end else-if */ } /* end else-if */ @@ -1921,8 +1921,8 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr) * should exist -- hence the following assertions. This will change * if we support ageout of entries in the cache image. */ - HDassert(external_child_fd_refs_removed == 0); - HDassert(external_parent_fd_refs_removed == 0); + assert(external_child_fd_refs_removed == 0); + assert(external_parent_fd_refs_removed == 0); /* At this point we should have removed all flush dependencies that * cross cache image boundaries. Now compute the flush dependency @@ -2006,17 +2006,17 @@ H5C__prep_for_file_close__compute_fd_heights_real(H5C_cache_entry_t *entry_ptr, FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(entry_ptr); - HDassert(entry_ptr->include_in_image); - HDassert((entry_ptr->image_fd_height == 0) || (entry_ptr->image_fd_height < fd_height)); - HDassert(((fd_height == 0) && (entry_ptr->fd_child_count == 0)) || - ((fd_height > 0) && (entry_ptr->fd_child_count > 0))); + assert(entry_ptr); + assert(entry_ptr->include_in_image); + assert((entry_ptr->image_fd_height == 0) || (entry_ptr->image_fd_height < fd_height)); + assert(((fd_height == 0) && (entry_ptr->fd_child_count == 0)) || + ((fd_height > 0) && (entry_ptr->fd_child_count > 0))); entry_ptr->image_fd_height = fd_height; if (entry_ptr->flush_dep_nparents > 0) { unsigned u; - HDassert(entry_ptr->flush_dep_parent); + assert(entry_ptr->flush_dep_parent); for (u = 0; u < entry_ptr->fd_parent_count; u++) { H5C_cache_entry_t *parent_ptr; @@ -2058,11 +2058,11 @@ H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->close_warning_received); - HDassert(cache_ptr->pl_len == 0); - HDassert(cache_ptr->num_entries_in_image > 0); - HDassert(cache_ptr->image_entries == NULL); + assert(cache_ptr); + assert(cache_ptr->close_warning_received); + assert(cache_ptr->pl_len == 0); + assert(cache_ptr->num_entries_in_image > 0); + assert(cache_ptr->image_entries == NULL); /* Allocate and initialize image_entries array */ if (NULL == (image_entries = (H5C_image_entry_t *)H5MM_calloc( @@ -2084,9 +2084,9 @@ H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr) /* Since we have already serialized the cache, the following * should hold. */ - HDassert(entry_ptr->image_up_to_date); - HDassert(entry_ptr->image_ptr); - HDassert(entry_ptr->type); + assert(entry_ptr->image_up_to_date); + assert(entry_ptr->image_ptr); + assert(entry_ptr->type); image_entries[u].addr = entry_ptr->addr; image_entries[u].size = entry_ptr->size; @@ -2129,7 +2129,7 @@ H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr) u++; - HDassert(u <= cache_ptr->num_entries_in_image); + assert(u <= cache_ptr->num_entries_in_image); } /* end if */ #ifndef NDEBUG @@ -2140,11 +2140,11 @@ H5C__prep_for_file_close__setup_image_entries_array(H5C_t *cache_ptr) } /* end while */ /* Sanity checks */ - HDassert(entries_visited == cache_ptr->index_len); - HDassert(u == cache_ptr->num_entries_in_image); + assert(entries_visited == cache_ptr->index_len); + assert(u == cache_ptr->num_entries_in_image); - HDassert(image_entries[u].fd_parent_addrs == NULL); - HDassert(image_entries[u].image_ptr == NULL); + assert(image_entries[u].fd_parent_addrs == NULL); + assert(image_entries[u].image_ptr == NULL); cache_ptr->image_entries = image_entries; @@ -2201,12 +2201,12 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); - HDassert(cache_ptr); - HDassert(cache_ptr->close_warning_received); - HDassert(cache_ptr->pl_len == 0); + assert(f); + assert(f->shared); + assert(f->shared->sblock); + assert(cache_ptr); + assert(cache_ptr->close_warning_received); + assert(cache_ptr->pl_len == 0); /* Initialize image len to the size of the metadata cache image block * header. @@ -2220,8 +2220,8 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) /* Since we have already serialized the cache, the following * should hold. */ - HDassert(entry_ptr->image_up_to_date); - HDassert(entry_ptr->image_ptr); + assert(entry_ptr->image_up_to_date); + assert(entry_ptr->image_ptr); /* Initially, we mark all entries in the rings included * in the cache image as being included in the in the @@ -2251,15 +2251,15 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) /* parent addresses array should already be allocated * and of the correct size. */ - HDassert(entry_ptr->fd_parent_addrs); + assert(entry_ptr->fd_parent_addrs); } /* end if */ else if (entry_ptr->fd_parent_count > 0) { - HDassert(entry_ptr->fd_parent_addrs); + assert(entry_ptr->fd_parent_addrs); entry_ptr->fd_parent_addrs = (haddr_t *)H5MM_xfree(entry_ptr->fd_parent_addrs); } /* end else-if */ else { - HDassert(entry_ptr->fd_parent_count == 0); - HDassert(entry_ptr->fd_parent_addrs == NULL); + assert(entry_ptr->fd_parent_count == 0); + assert(entry_ptr->fd_parent_addrs == NULL); } /* end else */ entry_ptr->fd_parent_count = entry_ptr->flush_dep_nparents; @@ -2271,15 +2271,15 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) for (int i = 0; i < (int)(entry_ptr->fd_parent_count); i++) { entry_ptr->fd_parent_addrs[i] = entry_ptr->flush_dep_parent[i]->addr; - HDassert(H5_addr_defined(entry_ptr->fd_parent_addrs[i])); + assert(H5_addr_defined(entry_ptr->fd_parent_addrs[i])); } /* end for */ } /* end if */ else if (entry_ptr->fd_parent_count > 0) { - HDassert(entry_ptr->fd_parent_addrs); + assert(entry_ptr->fd_parent_addrs); entry_ptr->fd_parent_addrs = (haddr_t *)H5MM_xfree(entry_ptr->fd_parent_addrs); } /* end else-if */ else - HDassert(entry_ptr->fd_parent_addrs == NULL); + assert(entry_ptr->fd_parent_addrs == NULL); /* Initially, all flush dependency children are included int * the count of flush dependency child relationships to be @@ -2304,7 +2304,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) #endif entry_ptr = entry_ptr->il_next; } /* end while */ - HDassert(entries_visited == cache_ptr->index_len); + assert(entries_visited == cache_ptr->index_len); /* Now compute the flush dependency heights of all flush dependency * relationships to be represented in the image. @@ -2356,8 +2356,8 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) #endif entry_ptr = entry_ptr->il_next; } /* end while */ - HDassert(entries_visited == cache_ptr->index_len); - HDassert(num_entries_in_image <= num_entries_tentatively_in_image); + assert(entries_visited == cache_ptr->index_len); + assert(num_entries_in_image <= num_entries_tentatively_in_image); #ifndef NDEBUG { @@ -2366,7 +2366,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) j += cache_ptr->index_ring_len[i]; /* This will change */ - HDassert(entries_visited == (num_entries_tentatively_in_image + j)); + assert(entries_visited == (num_entries_tentatively_in_image + j)); } #endif @@ -2387,7 +2387,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) */ entry_ptr = cache_ptr->LRU_head_ptr; while (entry_ptr != NULL) { - HDassert(entry_ptr->type != NULL); + assert(entry_ptr->type != NULL); /* to avoid confusion, don't set lru_rank on epoch markers. * Note that we still increment the lru_rank, so that the holes @@ -2410,7 +2410,7 @@ H5C__prep_for_file_close__scan_entries(const H5F_t *f, H5C_t *cache_ptr) #endif entry_ptr = entry_ptr->next; } /* end while */ - HDassert(entries_visited == cache_ptr->LRU_list_len); + assert(entries_visited == cache_ptr->LRU_list_len); image_len += H5F_SIZEOF_CHKSUM; cache_ptr->image_data_len = image_len; @@ -2447,23 +2447,23 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(cache_ptr == f->shared->cache); - HDassert(cache_ptr); - HDassert(cache_ptr->image_buffer); - HDassert(cache_ptr->image_len > 0); + assert(f); + assert(f->shared); + assert(cache_ptr == f->shared->cache); + assert(cache_ptr); + assert(cache_ptr->image_buffer); + assert(cache_ptr->image_len > 0); /* Decode metadata cache image header */ p = (uint8_t *)cache_ptr->image_buffer; if (H5C__decode_cache_image_header(f, cache_ptr, &p) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTDECODE, FAIL, "cache image header decode failed") - HDassert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) < cache_ptr->image_len); + assert((size_t)(p - (uint8_t *)cache_ptr->image_buffer) < cache_ptr->image_len); /* The image_data_len and # of entries should be defined now */ - HDassert(cache_ptr->image_data_len > 0); - HDassert(cache_ptr->image_data_len <= cache_ptr->image_len); - HDassert(cache_ptr->num_entries_in_image > 0); + assert(cache_ptr->image_data_len > 0); + assert(cache_ptr->image_data_len <= cache_ptr->image_len); + assert(cache_ptr->num_entries_in_image > 0); /* Reconstruct entries in image */ for (u = 0; u < cache_ptr->num_entries_in_image; u++) { @@ -2498,8 +2498,8 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) */ for (v = 0; v < pf_entry_ptr->fd_parent_count; v++) { /* Sanity checks */ - HDassert(pf_entry_ptr->fd_parent_addrs); - HDassert(H5_addr_defined(pf_entry_ptr->fd_parent_addrs[v])); + assert(pf_entry_ptr->fd_parent_addrs); + assert(H5_addr_defined(pf_entry_ptr->fd_parent_addrs[v])); /* Find the parent entry */ parent_ptr = NULL; @@ -2508,8 +2508,8 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "fd parent not in cache?!?") /* Sanity checks */ - HDassert(parent_ptr->addr == pf_entry_ptr->fd_parent_addrs[v]); - HDassert(parent_ptr->lru_rank == -1); + assert(parent_ptr->addr == pf_entry_ptr->fd_parent_addrs[v]); + assert(parent_ptr->lru_rank == -1); /* Must protect parent entry to set up a flush dependency. * Do this now, and then uprotect when done. @@ -2533,22 +2533,22 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) */ pf_entry_ptr = cache_ptr->il_head; while (pf_entry_ptr != NULL) { - HDassert((pf_entry_ptr->prefetched && pf_entry_ptr->type == H5AC_PREFETCHED_ENTRY) || - (!pf_entry_ptr->prefetched && pf_entry_ptr->type != H5AC_PREFETCHED_ENTRY)); + assert((pf_entry_ptr->prefetched && pf_entry_ptr->type == H5AC_PREFETCHED_ENTRY) || + (!pf_entry_ptr->prefetched && pf_entry_ptr->type != H5AC_PREFETCHED_ENTRY)); if (pf_entry_ptr->type == H5AC_PREFETCHED_ENTRY) - HDassert(pf_entry_ptr->fd_parent_count == pf_entry_ptr->flush_dep_nparents); + assert(pf_entry_ptr->fd_parent_count == pf_entry_ptr->flush_dep_nparents); for (v = 0; v < pf_entry_ptr->fd_parent_count; v++) { parent_ptr = pf_entry_ptr->flush_dep_parent[v]; - HDassert(parent_ptr); - HDassert(pf_entry_ptr->fd_parent_addrs); - HDassert(pf_entry_ptr->fd_parent_addrs[v] == parent_ptr->addr); - HDassert(parent_ptr->flush_dep_nchildren > 0); + assert(parent_ptr); + assert(pf_entry_ptr->fd_parent_addrs); + assert(pf_entry_ptr->fd_parent_addrs[v] == parent_ptr->addr); + assert(parent_ptr->flush_dep_nchildren > 0); } /* end for */ if (pf_entry_ptr->type == H5AC_PREFETCHED_ENTRY) { - HDassert(pf_entry_ptr->fd_child_count == pf_entry_ptr->flush_dep_nchildren); - HDassert(pf_entry_ptr->fd_dirty_child_count == pf_entry_ptr->flush_dep_ndirty_children); + assert(pf_entry_ptr->fd_child_count == pf_entry_ptr->flush_dep_nchildren); + assert(pf_entry_ptr->fd_dirty_child_count == pf_entry_ptr->flush_dep_ndirty_children); } /* end if */ pf_entry_ptr = pf_entry_ptr->il_next; @@ -2565,11 +2565,11 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) i = -1; entry_ptr = cache_ptr->LRU_head_ptr; while (entry_ptr != NULL) { - HDassert(entry_ptr->type != NULL); + assert(entry_ptr->type != NULL); if (entry_ptr->prefetched) { - HDassert(entry_ptr->lru_rank != 0); - HDassert((entry_ptr->lru_rank == -1) || (entry_ptr->lru_rank > i)); + assert(entry_ptr->lru_rank != 0); + assert((entry_ptr->lru_rank == -1) || (entry_ptr->lru_rank > i)); if ((entry_ptr->lru_rank > 1) && (entry_ptr->lru_rank > i + 1)) lru_rank_holes += entry_ptr->lru_rank - (i + 1); @@ -2585,7 +2585,7 @@ H5C__reconstruct_cache_contents(H5F_t *f, H5C_t *cache_ptr) * the following sanity check will have to be revised when * we add code to store and restore adaptive resize status. */ - HDassert(lru_rank_holes <= H5C__MAX_EPOCH_MARKERS); + assert(lru_rank_holes <= H5C__MAX_EPOCH_MARKERS); } /* end block */ #endif @@ -2646,9 +2646,9 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **b FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache_ptr); - HDassert(cache_ptr->num_entries_in_image > 0); - HDassert(buf && *buf); + assert(cache_ptr); + assert(cache_ptr->num_entries_in_image > 0); + assert(buf && *buf); /* Key R/W access off of whether the image will be deleted */ file_is_rw = cache_ptr->delete_image; @@ -2692,16 +2692,16 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **b /* Decode ring */ pf_entry_ptr->ring = *p++; - HDassert(pf_entry_ptr->ring > (uint8_t)(H5C_RING_UNDEFINED)); - HDassert(pf_entry_ptr->ring < (uint8_t)(H5C_RING_NTYPES)); + assert(pf_entry_ptr->ring > (uint8_t)(H5C_RING_UNDEFINED)); + assert(pf_entry_ptr->ring < (uint8_t)(H5C_RING_NTYPES)); /* Decode age */ pf_entry_ptr->age = *p++; /* Decode dependency child count */ UINT16DECODE(p, pf_entry_ptr->fd_child_count); - HDassert((is_fd_parent && pf_entry_ptr->fd_child_count > 0) || - (!is_fd_parent && pf_entry_ptr->fd_child_count == 0)); + assert((is_fd_parent && pf_entry_ptr->fd_child_count > 0) || + (!is_fd_parent && pf_entry_ptr->fd_child_count == 0)); /* Decode dirty dependency child count */ UINT16DECODE(p, pf_entry_ptr->fd_dirty_child_count); @@ -2712,12 +2712,12 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **b /* Decode dependency parent count */ UINT16DECODE(p, pf_entry_ptr->fd_parent_count); - HDassert((is_fd_child && pf_entry_ptr->fd_parent_count > 0) || - (!is_fd_child && pf_entry_ptr->fd_parent_count == 0)); + assert((is_fd_child && pf_entry_ptr->fd_parent_count > 0) || + (!is_fd_child && pf_entry_ptr->fd_parent_count == 0)); /* Decode index in LRU */ INT32DECODE(p, pf_entry_ptr->lru_rank); - HDassert((in_lru && pf_entry_ptr->lru_rank >= 0) || (!in_lru && pf_entry_ptr->lru_rank == -1)); + assert((in_lru && pf_entry_ptr->lru_rank >= 0) || (!in_lru && pf_entry_ptr->lru_rank == -1)); /* Decode entry offset */ H5F_addr_decode(f, &p, &pf_entry_ptr->addr); @@ -2770,7 +2770,7 @@ H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **b pf_entry_ptr->prefetched_dirty = is_dirty && (!file_is_rw); /* Sanity checks */ - HDassert(pf_entry_ptr->size > 0 && pf_entry_ptr->size < H5C_MAX_ENTRY_SIZE); + assert(pf_entry_ptr->size > 0 && pf_entry_ptr->size < H5C_MAX_ENTRY_SIZE); /* Update buffer pointer */ *buf = p; @@ -2814,12 +2814,12 @@ H5C__write_cache_image_superblock_msg(H5F_t *f, hbool_t create) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); + assert(f); + assert(f->shared); + assert(f->shared->cache); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->close_warning_received); + assert(cache_ptr); + assert(cache_ptr->close_warning_received); /* Write data into the metadata cache image superblock extension message. * Note that this data will be bogus when we first create the message. @@ -2867,11 +2867,11 @@ H5C__write_cache_image(H5F_t *f, const H5C_t *cache_ptr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(cache_ptr); - HDassert(H5_addr_defined(cache_ptr->image_addr)); - HDassert(cache_ptr->image_len > 0); - HDassert(cache_ptr->image_buffer); + assert(f); + assert(cache_ptr); + assert(H5_addr_defined(cache_ptr->image_addr)); + assert(cache_ptr->image_len > 0); + assert(cache_ptr->image_buffer); #ifdef H5_HAVE_PARALLEL { diff --git a/src/H5Cint.c b/src/H5Cint.c index f676367..9738e09 100644 --- a/src/H5Cint.c +++ b/src/H5Cint.c @@ -103,11 +103,11 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(cache_ptr); - HDassert(cache_ptr->cache_accesses >= cache_ptr->resize_ctl.epoch_length); - HDassert(0.0 <= cache_ptr->resize_ctl.min_clean_fraction); - HDassert(cache_ptr->resize_ctl.min_clean_fraction <= 100.0); + assert(f); + assert(cache_ptr); + assert(cache_ptr->cache_accesses >= cache_ptr->resize_ctl.epoch_length); + assert(0.0 <= cache_ptr->resize_ctl.min_clean_fraction); + assert(cache_ptr->resize_ctl.min_clean_fraction <= 100.0); /* check to see if cache_ptr->resize_in_progress is TRUE. If it, this * is a re-entrant call via a client callback called in the resize @@ -124,13 +124,13 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) if (!cache_ptr->resize_enabled) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Auto cache resize disabled") - HDassert((cache_ptr->resize_ctl.incr_mode != H5C_incr__off) || - (cache_ptr->resize_ctl.decr_mode != H5C_decr__off)); + assert((cache_ptr->resize_ctl.incr_mode != H5C_incr__off) || + (cache_ptr->resize_ctl.decr_mode != H5C_decr__off)); if (H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate") - HDassert((0.0 <= hit_rate) && (hit_rate <= 1.0)); + assert((0.0 <= hit_rate) && (hit_rate <= 1.0)); switch (cache_ptr->resize_ctl.incr_mode) { case H5C_incr__off: @@ -143,7 +143,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) if (!cache_ptr->size_increase_possible) status = increase_disabled; else if (cache_ptr->max_cache_size >= cache_ptr->resize_ctl.max_size) { - HDassert(cache_ptr->max_cache_size == cache_ptr->resize_ctl.max_size); + assert(cache_ptr->max_cache_size == cache_ptr->resize_ctl.max_size); status = at_max_size; } else if (!cache_ptr->cache_full) @@ -208,7 +208,7 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) if (!cache_ptr->size_decrease_possible) status = decrease_disabled; else if (cache_ptr->max_cache_size <= cache_ptr->resize_ctl.min_size) { - HDassert(cache_ptr->max_cache_size == cache_ptr->resize_ctl.min_size); + assert(cache_ptr->max_cache_size == cache_ptr->resize_ctl.min_size); status = at_min_size; } else { @@ -271,9 +271,9 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) * * by definition. */ - HDassert(new_min_clean_size <= new_max_cache_size); - HDassert(cache_ptr->resize_ctl.min_size <= new_max_cache_size); - HDassert(new_max_cache_size <= cache_ptr->resize_ctl.max_size); + assert(new_min_clean_size <= new_max_cache_size); + assert(cache_ptr->resize_ctl.min_size <= new_max_cache_size); + assert(new_max_cache_size <= cache_ptr->resize_ctl.max_size); cache_ptr->max_cache_size = new_max_cache_size; cache_ptr->min_clean_size = new_min_clean_size; @@ -315,10 +315,10 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) done: /* Sanity checks */ - HDassert(cache_ptr->resize_in_progress); + assert(cache_ptr->resize_in_progress); if (!reentrant_call) cache_ptr->resize_in_progress = FALSE; - HDassert((!reentrant_call) || (cache_ptr->resize_in_progress)); + assert((!reentrant_call) || (cache_ptr->resize_in_progress)); FUNC_LEAVE_NOAPI(ret_value) } /* H5C__auto_adjust_cache_size() */ @@ -351,10 +351,10 @@ H5C__autoadjust__ageout(H5F_t *f, double hit_rate, enum H5C_resize_status *statu FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(cache_ptr); - HDassert((status_ptr) && (*status_ptr == in_spec)); - HDassert((new_max_cache_size_ptr) && (*new_max_cache_size_ptr == 0)); + assert(f); + assert(cache_ptr); + assert((status_ptr) && (*status_ptr == in_spec)); + assert((new_max_cache_size_ptr) && (*new_max_cache_size_ptr == 0)); /* remove excess epoch markers if any */ if (cache_ptr->epoch_markers_active > cache_ptr->resize_ctl.epochs_before_eviction) @@ -430,7 +430,7 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t *cache_ptr) FUNC_ENTER_PACKAGE - HDassert(cache_ptr); + assert(cache_ptr); if (cache_ptr->epoch_markers_active <= 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "No active epoch markers on entry?!?!?") @@ -452,9 +452,9 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t *cache_ptr) /* now, re-insert it at the head of the LRU list, and at the tail of * the ring buffer. */ - HDassert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); - HDassert(cache_ptr->epoch_markers[i].next == NULL); - HDassert(cache_ptr->epoch_markers[i].prev == NULL); + assert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); + assert(cache_ptr->epoch_markers[i].next == NULL); + assert(cache_ptr->epoch_markers[i].prev == NULL); cache_ptr->epoch_marker_ringbuf_last = (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); @@ -523,8 +523,8 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(cache_ptr); + assert(f); + assert(cache_ptr); /* if there is a limit on the amount that the cache size can be decrease * in any one round of the cache size reduction algorithm, load that @@ -544,9 +544,9 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte bytes_evicted < eviction_size_limit) { hbool_t skipping_entry = FALSE; - HDassert(!(entry_ptr->is_protected)); - HDassert(!(entry_ptr->is_read_only)); - HDassert((entry_ptr->ro_ref_count) == 0); + assert(!(entry_ptr->is_protected)); + assert(!(entry_ptr->is_read_only)); + assert((entry_ptr->ro_ref_count) == 0); next_ptr = entry_ptr->next; prev_ptr = entry_ptr->prev; @@ -555,7 +555,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte prev_is_dirty = prev_ptr->is_dirty; if (entry_ptr->is_dirty) { - HDassert(!entry_ptr->prefetched_dirty); + assert(!entry_ptr->prefetched_dirty); /* dirty corked entry is skipped */ if (entry_ptr->tag_info && entry_ptr->tag_info->corked) @@ -588,8 +588,8 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } /* end else-if */ else { - HDassert(!entry_ptr->is_dirty); - HDassert(entry_ptr->prefetched_dirty); + assert(!entry_ptr->is_dirty); + assert(entry_ptr->prefetched_dirty); skipping_entry = TRUE; } /* end else */ @@ -643,11 +643,11 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte * performance implications, but it shouldn't cause any net * slowdown. */ - HDassert(H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS); + assert(H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS); entry_ptr = cache_ptr->LRU_tail_ptr; while (entry_ptr != NULL && ((entry_ptr->type)->id != H5AC_EPOCH_MARKER_ID) && (bytes_evicted < eviction_size_limit)) { - HDassert(!(entry_ptr->is_protected)); + assert(!(entry_ptr->is_protected)); prev_ptr = entry_ptr->prev; @@ -695,7 +695,7 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t *cache_ptr) FUNC_ENTER_PACKAGE - HDassert(cache_ptr); + assert(cache_ptr); if (cache_ptr->epoch_markers_active >= cache_ptr->resize_ctl.epochs_before_eviction) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Already have a full complement of markers") @@ -707,9 +707,9 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t *cache_ptr) if (i >= H5C__MAX_EPOCH_MARKERS) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't find unused marker") - HDassert(((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i); - HDassert(((cache_ptr->epoch_markers)[i]).next == NULL); - HDassert(((cache_ptr->epoch_markers)[i]).prev == NULL); + assert(((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i); + assert(((cache_ptr->epoch_markers)[i]).next == NULL); + assert(((cache_ptr->epoch_markers)[i]).prev == NULL); (cache_ptr->epoch_marker_active)[i] = TRUE; @@ -751,7 +751,7 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t *cache_ptr) FUNC_ENTER_PACKAGE - HDassert(cache_ptr); + assert(cache_ptr); while (cache_ptr->epoch_markers_active > 0) { /* get the index of the last epoch marker in the LRU list @@ -778,14 +778,14 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t *cache_ptr) /* mark the epoch marker as unused. */ cache_ptr->epoch_marker_active[i] = FALSE; - HDassert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); - HDassert(cache_ptr->epoch_markers[i].next == NULL); - HDassert(cache_ptr->epoch_markers[i].prev == NULL); + assert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); + assert(cache_ptr->epoch_markers[i].next == NULL); + assert(cache_ptr->epoch_markers[i].prev == NULL); /* decrement the number of active epoch markers */ cache_ptr->epoch_markers_active -= 1; - HDassert(cache_ptr->epoch_markers_active == cache_ptr->epoch_marker_ringbuf_size); + assert(cache_ptr->epoch_markers_active == cache_ptr->epoch_marker_ringbuf_size); } done: @@ -815,7 +815,7 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t *cache_ptr) FUNC_ENTER_PACKAGE - HDassert(cache_ptr); + assert(cache_ptr); if (cache_ptr->epoch_markers_active <= cache_ptr->resize_ctl.epochs_before_eviction) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "no excess markers on entry") @@ -844,14 +844,14 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t *cache_ptr) /* mark the epoch marker as unused. */ cache_ptr->epoch_marker_active[i] = FALSE; - HDassert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); - HDassert(cache_ptr->epoch_markers[i].next == NULL); - HDassert(cache_ptr->epoch_markers[i].prev == NULL); + assert(cache_ptr->epoch_markers[i].addr == (haddr_t)i); + assert(cache_ptr->epoch_markers[i].next == NULL); + assert(cache_ptr->epoch_markers[i].prev == NULL); /* decrement the number of active epoch markers */ cache_ptr->epoch_markers_active -= 1; - HDassert(cache_ptr->epoch_markers_active == cache_ptr->epoch_marker_ringbuf_size); + assert(cache_ptr->epoch_markers_active == cache_ptr->epoch_marker_ringbuf_size); } done: @@ -887,10 +887,10 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n FUNC_ENTER_PACKAGE - HDassert(cache_ptr); - HDassert(cache_ptr->flash_size_increase_possible); - HDassert(new_entry_size > cache_ptr->flash_size_increase_threshold); - HDassert(old_entry_size < new_entry_size); + assert(cache_ptr); + assert(cache_ptr->flash_size_increase_possible); + assert(new_entry_size > cache_ptr->flash_size_increase_threshold); + assert(old_entry_size < new_entry_size); if (old_entry_size >= new_entry_size) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "old_entry_size >= new_entry_size") @@ -906,7 +906,7 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n case H5C_flash_incr__add_space: if (cache_ptr->index_size < cache_ptr->max_cache_size) { - HDassert((cache_ptr->max_cache_size - cache_ptr->index_size) < space_needed); + assert((cache_ptr->max_cache_size - cache_ptr->index_size) < space_needed); space_needed -= cache_ptr->max_cache_size - cache_ptr->index_size; } space_needed = (size_t)(((double)space_needed) * cache_ptr->resize_ctl.flash_multiple); @@ -920,10 +920,10 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n if (new_max_cache_size > cache_ptr->resize_ctl.max_size) new_max_cache_size = cache_ptr->resize_ctl.max_size; - HDassert(new_max_cache_size > cache_ptr->max_cache_size); + assert(new_max_cache_size > cache_ptr->max_cache_size); new_min_clean_size = (size_t)((double)new_max_cache_size * cache_ptr->resize_ctl.min_clean_fraction); - HDassert(new_min_clean_size <= new_max_cache_size); + assert(new_min_clean_size <= new_max_cache_size); old_max_cache_size = cache_ptr->max_cache_size; old_min_clean_size = cache_ptr->min_clean_size; @@ -932,7 +932,7 @@ H5C__flash_increase_cache_size(H5C_t *cache_ptr, size_t old_entry_size, size_t n cache_ptr->min_clean_size = new_min_clean_size; /* update flash cache size increase fields as appropriate */ - HDassert(cache_ptr->flash_size_increase_possible); + assert(cache_ptr->flash_size_increase_possible); switch (cache_ptr->resize_ctl.flash_incr_mode) { case H5C_flash_incr__off: @@ -1017,12 +1017,12 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->slist_ptr); - HDassert(cache_ptr->slist_enabled); + assert(cache_ptr); + assert(cache_ptr->slist_ptr); + assert(cache_ptr->slist_enabled); #ifdef H5C_DO_SANITY_CHECKS { @@ -1034,12 +1034,12 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) size_t dirty_index_size = (size_t)0; size_t slist_size = (size_t)0; - HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); + assert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); + assert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); for (i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { index_len += cache_ptr->index_ring_len[i]; @@ -1051,12 +1051,12 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) slist_size += cache_ptr->slist_ring_size[i]; } /* end for */ - HDassert(cache_ptr->index_len == index_len); - HDassert(cache_ptr->index_size == index_size); - HDassert(cache_ptr->clean_index_size == clean_index_size); - HDassert(cache_ptr->dirty_index_size == dirty_index_size); - HDassert(cache_ptr->slist_len == slist_len); - HDassert(cache_ptr->slist_size == slist_size); + assert(cache_ptr->index_len == index_len); + assert(cache_ptr->index_size == index_size); + assert(cache_ptr->clean_index_size == clean_index_size); + assert(cache_ptr->dirty_index_size == dirty_index_size); + assert(cache_ptr->slist_len == slist_len); + assert(cache_ptr->slist_size == slist_size); } #endif /* H5C_DO_SANITY_CHECKS */ @@ -1078,10 +1078,10 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) #ifndef NDEBUG /* Invariants, after destroying all entries in the hash table */ if (!(flags & H5C__EVICT_ALLOW_LAST_PINS_FLAG)) { - HDassert(cache_ptr->index_size == 0); - HDassert(cache_ptr->clean_index_size == 0); - HDassert(cache_ptr->pel_len == 0); - HDassert(cache_ptr->pel_size == 0); + assert(cache_ptr->index_size == 0); + assert(cache_ptr->clean_index_size == 0); + assert(cache_ptr->pel_len == 0); + assert(cache_ptr->pel_size == 0); } /* end if */ else { H5C_cache_entry_t *entry_ptr; /* Cache entry */ @@ -1090,29 +1090,29 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) /* All rings except ring 4 should be empty now */ /* (Ring 4 has the superblock) */ for (u = H5C_RING_USER; u < H5C_RING_SB; u++) { - HDassert(cache_ptr->index_ring_len[u] == 0); - HDassert(cache_ptr->index_ring_size[u] == 0); - HDassert(cache_ptr->clean_index_ring_size[u] == 0); + assert(cache_ptr->index_ring_len[u] == 0); + assert(cache_ptr->index_ring_size[u] == 0); + assert(cache_ptr->clean_index_ring_size[u] == 0); } /* end for */ /* Check that any remaining pinned entries are in the superblock ring */ entry_ptr = cache_ptr->pel_head_ptr; while (entry_ptr) { /* Check ring */ - HDassert(entry_ptr->ring == H5C_RING_SB); + assert(entry_ptr->ring == H5C_RING_SB); /* Advance to next entry in pinned entry list */ entry_ptr = entry_ptr->next; } /* end while */ } /* end else */ - HDassert(cache_ptr->dirty_index_size == 0); - HDassert(cache_ptr->slist_len == 0); - HDassert(cache_ptr->slist_size == 0); - HDassert(cache_ptr->pl_len == 0); - HDassert(cache_ptr->pl_size == 0); - HDassert(cache_ptr->LRU_list_len == 0); - HDassert(cache_ptr->LRU_list_size == 0); + assert(cache_ptr->dirty_index_size == 0); + assert(cache_ptr->slist_len == 0); + assert(cache_ptr->slist_size == 0); + assert(cache_ptr->pl_len == 0); + assert(cache_ptr->pl_size == 0); + assert(cache_ptr->LRU_list_len == 0); + assert(cache_ptr->LRU_list_size == 0); #endif done: @@ -1177,16 +1177,16 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->slist_enabled); - HDassert(cache_ptr->slist_ptr); - HDassert(ring > H5C_RING_UNDEFINED); - HDassert(ring < H5C_RING_NTYPES); + assert(cache_ptr); + assert(cache_ptr->slist_enabled); + assert(cache_ptr->slist_ptr); + assert(ring > H5C_RING_UNDEFINED); + assert(ring < H5C_RING_NTYPES); - HDassert(cache_ptr->epoch_markers_active == 0); + assert(cache_ptr->epoch_markers_active == 0); /* Filter out the flags that are not relevant to the flush/invalidate. */ @@ -1224,7 +1224,7 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) entry_ptr = cache_ptr->pel_head_ptr; cur_ring_pel_len = 0; while (entry_ptr != NULL) { - HDassert(entry_ptr->ring >= ring); + assert(entry_ptr->ring >= ring); if (entry_ptr->ring == ring) cur_ring_pel_len++; @@ -1290,9 +1290,9 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) if (NULL == next_entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") - HDassert(next_entry_ptr->is_dirty); - HDassert(next_entry_ptr->in_slist); - HDassert(next_entry_ptr->ring >= ring); + assert(next_entry_ptr->is_dirty); + assert(next_entry_ptr->in_slist); + assert(next_entry_ptr->ring >= ring); } /* end if */ entry_ptr = next_entry_ptr; @@ -1308,10 +1308,10 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * slist if we find them. However, best we do some extra * sanity checking just in case. */ - HDassert(entry_ptr != NULL); - HDassert(entry_ptr->in_slist); - HDassert(entry_ptr->is_dirty); - HDassert(entry_ptr->ring >= ring); + assert(entry_ptr != NULL); + assert(entry_ptr->in_slist); + assert(entry_ptr->is_dirty); + assert(entry_ptr->ring >= ring); /* increment node pointer now, before we delete its target * from the slist. @@ -1322,10 +1322,10 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) if (NULL == next_entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") - HDassert(next_entry_ptr->is_dirty); - HDassert(next_entry_ptr->in_slist); - HDassert(next_entry_ptr->ring >= ring); - HDassert(entry_ptr != next_entry_ptr); + assert(next_entry_ptr->is_dirty); + assert(next_entry_ptr->in_slist); + assert(next_entry_ptr->ring >= ring); + assert(entry_ptr != next_entry_ptr); } /* end if */ else next_entry_ptr = NULL; @@ -1400,10 +1400,10 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) */ if (node_ptr == NULL) { - HDassert(cache_ptr->slist_len == - (uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase)); - HDassert(cache_ptr->slist_size == - (size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase)); + assert(cache_ptr->slist_len == + (uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase)); + assert(cache_ptr->slist_size == + (size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase)); } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -1429,7 +1429,7 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) next_entry_ptr = cache_ptr->il_head; while (next_entry_ptr != NULL) { entry_ptr = next_entry_ptr; - HDassert(entry_ptr->ring >= ring); + assert(entry_ptr->ring >= ring); next_entry_ptr = entry_ptr->il_next; @@ -1445,7 +1445,7 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) protected_entries++; if (!entry_ptr->in_slist) - HDassert(!(entry_ptr->is_dirty)); + assert(!(entry_ptr->is_dirty)); } /* end if */ else if (!entry_ptr->is_pinned) { /* if *entry_ptr is dirty, it is possible @@ -1521,7 +1521,7 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) cur_ring_pel_len = 0; while (entry_ptr != NULL) { - HDassert(entry_ptr->ring >= ring); + assert(entry_ptr->ring >= ring); if (entry_ptr->ring == ring) cur_ring_pel_len++; @@ -1543,7 +1543,7 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) (int)cur_ring_pel_len, (int)old_ring_pel_len, (int)ring) } /* end if */ - HDassert(protected_entries == cache_ptr->pl_len); + assert(protected_entries == cache_ptr->pl_len); if ((protected_entries > 0) && (protected_entries == cache_ptr->index_len)) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, @@ -1553,16 +1553,16 @@ H5C__flush_invalidate_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) /* Invariants, after destroying all entries in the ring */ for (i = (int)H5C_RING_UNDEFINED; i <= (int)ring; i++) { - HDassert(cache_ptr->index_ring_len[i] == 0); - HDassert(cache_ptr->index_ring_size[i] == (size_t)0); - HDassert(cache_ptr->clean_index_ring_size[i] == (size_t)0); - HDassert(cache_ptr->dirty_index_ring_size[i] == (size_t)0); + assert(cache_ptr->index_ring_len[i] == 0); + assert(cache_ptr->index_ring_size[i] == (size_t)0); + assert(cache_ptr->clean_index_ring_size[i] == (size_t)0); + assert(cache_ptr->dirty_index_ring_size[i] == (size_t)0); - HDassert(cache_ptr->slist_ring_len[i] == 0); - HDassert(cache_ptr->slist_ring_size[i] == (size_t)0); + assert(cache_ptr->slist_ring_len[i] == 0); + assert(cache_ptr->slist_ring_size[i] == (size_t)0); } /* end for */ - HDassert(protected_entries <= cache_ptr->pl_len); + assert(protected_entries <= cache_ptr->pl_len); if (protected_entries > 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cache has protected entries") @@ -1619,12 +1619,12 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) FUNC_ENTER_PACKAGE - HDassert(cache_ptr); - HDassert(cache_ptr->slist_enabled); - HDassert(cache_ptr->slist_ptr); - HDassert((flags & H5C__FLUSH_INVALIDATE_FLAG) == 0); - HDassert(ring > H5C_RING_UNDEFINED); - HDassert(ring < H5C_RING_NTYPES); + assert(cache_ptr); + assert(cache_ptr->slist_enabled); + assert(cache_ptr->slist_ptr); + assert((flags & H5C__FLUSH_INVALIDATE_FLAG) == 0); + assert(ring > H5C_RING_UNDEFINED); + assert(ring < H5C_RING_NTYPES); #ifdef H5C_DO_EXTREME_SANITY_CHECKS if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || @@ -1637,9 +1637,9 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) if (!flush_marked_entries) for (i = (int)H5C_RING_UNDEFINED; i < (int)ring; i++) - HDassert(cache_ptr->slist_ring_len[i] == 0); + assert(cache_ptr->slist_ring_len[i] == 0); - HDassert(cache_ptr->flush_in_progress); + assert(cache_ptr->flush_in_progress); /* When we are only flushing marked entries, the slist will usually * still contain entries when we have flushed everything we should. @@ -1716,8 +1716,8 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) if (NULL == next_entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") - HDassert(next_entry_ptr->is_dirty); - HDassert(next_entry_ptr->in_slist); + assert(next_entry_ptr->is_dirty); + assert(next_entry_ptr->in_slist); } /* end if */ entry_ptr = next_entry_ptr; @@ -1739,11 +1739,11 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) * with, we do a bit of extra sanity checking on * entry_ptr. */ - HDassert(entry_ptr->in_slist); - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->in_slist); + assert(entry_ptr->is_dirty); if (!flush_marked_entries || entry_ptr->flush_marker) - HDassert(entry_ptr->ring >= ring); + assert(entry_ptr->ring >= ring); /* Advance node pointer now, before we delete its target * from the slist. @@ -1754,13 +1754,13 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) if (NULL == next_entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "next_entry_ptr == NULL ?!?!") - HDassert(next_entry_ptr->is_dirty); - HDassert(next_entry_ptr->in_slist); + assert(next_entry_ptr->is_dirty); + assert(next_entry_ptr->in_slist); if (!flush_marked_entries || next_entry_ptr->flush_marker) - HDassert(next_entry_ptr->ring >= ring); + assert(next_entry_ptr->ring >= ring); - HDassert(entry_ptr != next_entry_ptr); + assert(entry_ptr != next_entry_ptr); } /* end if */ else next_entry_ptr = NULL; @@ -1772,7 +1772,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) ((entry_ptr->flush_dep_nchildren == 0) || (entry_ptr->flush_dep_ndirty_children == 0)) && (entry_ptr->ring == ring)) { - HDassert(entry_ptr->flush_dep_nunser_children == 0); + assert(entry_ptr->flush_dep_nunser_children == 0); if (entry_ptr->is_protected) { /* we probably have major problems -- but lets @@ -1806,22 +1806,22 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) #ifdef H5C_DO_SANITY_CHECKS /* Verify that the slist size and length are as expected. */ - HDassert((uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase) == - cache_ptr->slist_len); - HDassert((size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase) == - cache_ptr->slist_size); + assert((uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase) == + cache_ptr->slist_len); + assert((size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase) == + cache_ptr->slist_size); #endif /* H5C_DO_SANITY_CHECKS */ } /* while */ - HDassert(protected_entries <= cache_ptr->pl_len); + assert(protected_entries <= cache_ptr->pl_len); if (((cache_ptr->pl_len > 0) && !ignore_protected) || tried_to_flush_protected_entry) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "cache has protected items") #ifdef H5C_DO_SANITY_CHECKS if (!flush_marked_entries) { - HDassert(cache_ptr->slist_ring_len[ring] == 0); - HDassert(cache_ptr->slist_ring_size[ring] == 0); + assert(cache_ptr->slist_ring_len[ring] == 0); + assert(cache_ptr->slist_ring_size[ring] == 0); } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -1883,9 +1883,9 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(cache_ptr); - HDassert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); + assert(f); + assert(cache_ptr); + assert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); /* check to see if cache_ptr->msic_in_progress is TRUE. If it, this * is a re-entrant call via a client callback called in the make @@ -1912,9 +1912,9 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) while ((((cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size) || ((empty_space + cache_ptr->clean_index_size) < (cache_ptr->min_clean_size))) && (entries_examined <= (2 * initial_list_len)) && (entry_ptr != NULL)) { - HDassert(!(entry_ptr->is_protected)); - HDassert(!(entry_ptr->is_read_only)); - HDassert((entry_ptr->ro_ref_count) == 0); + assert(!(entry_ptr->is_protected)); + assert(!(entry_ptr->is_read_only)); + assert((entry_ptr->ro_ref_count) == 0); next_ptr = entry_ptr->next; prev_ptr = entry_ptr->prev; @@ -2028,7 +2028,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) else empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; - HDassert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); + assert(cache_ptr->index_size == (cache_ptr->clean_index_size + cache_ptr->dirty_index_size)); } #if H5C_COLLECT_CACHE_STATS @@ -2049,22 +2049,22 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) #endif /* H5C_COLLECT_CACHE_STATS */ /* NEED: work on a better assert for corked entries */ - HDassert((entries_examined > (2 * initial_list_len)) || - ((cache_ptr->pl_size + cache_ptr->pel_size + cache_ptr->min_clean_size) > - cache_ptr->max_cache_size) || - ((cache_ptr->clean_index_size + empty_space) >= cache_ptr->min_clean_size) || - ((num_corked_entries))); + assert((entries_examined > (2 * initial_list_len)) || + ((cache_ptr->pl_size + cache_ptr->pel_size + cache_ptr->min_clean_size) > + cache_ptr->max_cache_size) || + ((cache_ptr->clean_index_size + empty_space) >= cache_ptr->min_clean_size) || + ((num_corked_entries))); #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - HDassert((entries_examined > (2 * initial_list_len)) || - (cache_ptr->cLRU_list_size <= cache_ptr->clean_index_size)); - HDassert((entries_examined > (2 * initial_list_len)) || - (cache_ptr->dLRU_list_size <= cache_ptr->dirty_index_size)); + assert((entries_examined > (2 * initial_list_len)) || + (cache_ptr->cLRU_list_size <= cache_ptr->clean_index_size)); + assert((entries_examined > (2 * initial_list_len)) || + (cache_ptr->dLRU_list_size <= cache_ptr->dirty_index_size)); #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ } else { - HDassert(H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS); + assert(H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS); #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS initial_list_len = cache_ptr->cLRU_list_len; @@ -2072,10 +2072,10 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) while (((cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size) && (entries_examined <= initial_list_len) && (entry_ptr != NULL)) { - HDassert(!(entry_ptr->is_protected)); - HDassert(!(entry_ptr->is_read_only)); - HDassert((entry_ptr->ro_ref_count) == 0); - HDassert(!(entry_ptr->is_dirty)); + assert(!(entry_ptr->is_protected)); + assert(!(entry_ptr->is_read_only)); + assert((entry_ptr->ro_ref_count) == 0); + assert(!(entry_ptr->is_dirty)); prev_ptr = entry_ptr->aux_prev; @@ -2103,10 +2103,10 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) done: /* Sanity checks */ - HDassert(cache_ptr->msic_in_progress); + assert(cache_ptr->msic_in_progress); if (!reentrant_call) cache_ptr->msic_in_progress = FALSE; - HDassert((!reentrant_call) || (cache_ptr->msic_in_progress)); + assert((!reentrant_call) || (cache_ptr->msic_in_progress)); FUNC_LEAVE_NOAPI(ret_value) } /* H5C__make_space_in_cache() */ @@ -2164,19 +2164,19 @@ H5C__serialize_cache(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->slist_ptr); + assert(cache_ptr); + assert(cache_ptr->slist_ptr); #ifdef H5C_DO_SANITY_CHECKS - HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); + assert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); + assert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); for (i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { index_len += cache_ptr->index_ring_len[i]; @@ -2188,12 +2188,12 @@ H5C__serialize_cache(H5F_t *f) slist_size += cache_ptr->slist_ring_size[i]; } /* end for */ - HDassert(cache_ptr->index_len == index_len); - HDassert(cache_ptr->index_size == index_size); - HDassert(cache_ptr->clean_index_size == clean_index_size); - HDassert(cache_ptr->dirty_index_size == dirty_index_size); - HDassert(cache_ptr->slist_len == slist_len); - HDassert(cache_ptr->slist_size == slist_size); + assert(cache_ptr->index_len == index_len); + assert(cache_ptr->index_size == index_size); + assert(cache_ptr->clean_index_size == clean_index_size); + assert(cache_ptr->dirty_index_size == dirty_index_size); + assert(cache_ptr->slist_len == slist_len); + assert(cache_ptr->slist_size == slist_size); #endif /* H5C_DO_SANITY_CHECKS */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS @@ -2227,7 +2227,7 @@ H5C__serialize_cache(H5F_t *f) * turn required to support sanity checking in some cache * clients. */ - HDassert(!cache_ptr->serialization_in_progress); + assert(!cache_ptr->serialization_in_progress); cache_ptr->serialization_in_progress = TRUE; /* Serialize each ring, starting from the outermost ring and @@ -2235,7 +2235,7 @@ H5C__serialize_cache(H5F_t *f) */ ring = H5C_RING_USER; while (ring < H5C_RING_NTYPES) { - HDassert(cache_ptr->close_warning_received); + assert(cache_ptr->close_warning_received); switch (ring) { case H5C_RING_USER: break; @@ -2279,7 +2279,7 @@ H5C__serialize_cache(H5F_t *f) scan_ptr = cache_ptr->il_head; while (scan_ptr != NULL) { - HDassert(scan_ptr->serialization_count <= 1); + assert(scan_ptr->serialization_count <= 1); scan_ptr = scan_ptr->il_next; } /* end while */ @@ -2331,14 +2331,14 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(ring > H5C_RING_UNDEFINED); - HDassert(ring < H5C_RING_NTYPES); + assert(cache_ptr); + assert(ring > H5C_RING_UNDEFINED); + assert(ring < H5C_RING_NTYPES); - HDassert(cache_ptr->serialization_in_progress); + assert(cache_ptr->serialization_in_progress); /* The objective here is to serialize all entries in the cache ring * in flush dependency order. @@ -2431,7 +2431,7 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) * that it is assigned to either the target or an inner * ring. */ - HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); + assert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); /* Skip flush me last entries or inner ring entries */ if (!entry_ptr->flush_me_last && entry_ptr->ring == ring) { @@ -2446,14 +2446,14 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) * and it has no unserialized flush dependency children. */ if (!entry_ptr->image_up_to_date && entry_ptr->flush_dep_nunser_children == 0) { - HDassert(entry_ptr->serialization_count == 0); + assert(entry_ptr->serialization_count == 0); /* Serialize the entry */ if (H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") - HDassert(entry_ptr->flush_dep_nunser_children == 0); - HDassert(entry_ptr->serialization_count == 0); + assert(entry_ptr->flush_dep_nunser_children == 0); + assert(entry_ptr->serialization_count == 0); #ifndef NDEBUG /* Increment serialization counter (to detect multiple serializations) */ @@ -2500,15 +2500,15 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) */ entry_ptr = cache_ptr->il_head; while (entry_ptr != NULL) { - HDassert(entry_ptr->ring > H5C_RING_UNDEFINED); - HDassert(entry_ptr->ring < H5C_RING_NTYPES); - HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); + assert(entry_ptr->ring > H5C_RING_UNDEFINED); + assert(entry_ptr->ring < H5C_RING_NTYPES); + assert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); if (entry_ptr->ring == ring) { if (entry_ptr->flush_me_last) { if (!entry_ptr->image_up_to_date) { - HDassert(entry_ptr->serialization_count == 0); - HDassert(entry_ptr->flush_dep_nunser_children == 0); + assert(entry_ptr->serialization_count == 0); + assert(entry_ptr->flush_dep_nunser_children == 0); /* Serialize the entry */ if (H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) @@ -2521,8 +2521,8 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flush_me_last entry serialization triggered restart") - HDassert(entry_ptr->flush_dep_nunser_children == 0); - HDassert(entry_ptr->serialization_count == 0); + assert(entry_ptr->flush_dep_nunser_children == 0); + assert(entry_ptr->serialization_count == 0); #ifndef NDEBUG /* Increment serialization counter (to detect multiple serializations) */ entry_ptr->serialization_count++; @@ -2530,9 +2530,9 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) } /* end if */ } /* end if */ else { - HDassert(entry_ptr->image_up_to_date); - HDassert(entry_ptr->serialization_count <= 1); - HDassert(entry_ptr->flush_dep_nunser_children == 0); + assert(entry_ptr->image_up_to_date); + assert(entry_ptr->serialization_count <= 1); + assert(entry_ptr->flush_dep_nunser_children == 0); } /* end else */ } /* if ( entry_ptr->ring == ring ) */ @@ -2540,6 +2540,6 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) } /* while ( entry_ptr != NULL ) */ done: - HDassert(cache_ptr->serialization_in_progress); + assert(cache_ptr->serialization_in_progress); FUNC_LEAVE_NOAPI(ret_value) } /* H5C__serialize_ring() */ diff --git a/src/H5Clog.c b/src/H5Clog.c index b0eff4d..01eb0a4 100644 --- a/src/H5Clog.c +++ b/src/H5Clog.c @@ -83,8 +83,8 @@ H5C_log_set_up(H5C_t *cache, const char log_location[], H5C_log_style_t style, h FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); - HDassert(log_location); + assert(cache); + assert(log_location); /* Check logging flags */ if (cache->log_info->enabled) @@ -143,7 +143,7 @@ H5C_log_tear_down(H5C_t *cache) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Check logging flags */ if (FALSE == cache->log_info->enabled) @@ -186,7 +186,7 @@ H5C_start_logging(H5C_t *cache) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Check logging flags */ if (FALSE == cache->log_info->enabled) @@ -229,7 +229,7 @@ H5C_stop_logging(H5C_t *cache) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Check logging flags */ if (FALSE == cache->log_info->enabled) @@ -273,9 +273,9 @@ H5C_get_logging_status(const H5C_t *cache, hbool_t *is_enabled, hbool_t *is_curr FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(cache); - HDassert(is_enabled); - HDassert(is_currently_logging); + assert(cache); + assert(is_enabled); + assert(is_currently_logging); /* Get logging flags */ *is_enabled = cache->log_info->enabled; @@ -304,7 +304,7 @@ H5C_log_write_create_cache_msg(H5C_t *cache, herr_t fxn_ret_value) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ if (cache->log_info->cls->write_create_cache_log_msg) @@ -339,7 +339,7 @@ H5C_log_write_destroy_cache_msg(H5C_t *cache) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ if (cache->log_info->cls->write_destroy_cache_log_msg) @@ -370,7 +370,7 @@ H5C_log_write_evict_cache_msg(H5C_t *cache, herr_t fxn_ret_value) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ if (cache->log_info->cls->write_evict_cache_log_msg) @@ -401,7 +401,7 @@ H5C_log_write_expunge_entry_msg(H5C_t *cache, haddr_t address, int type_id, herr FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ if (cache->log_info->cls->write_expunge_entry_log_msg) @@ -433,7 +433,7 @@ H5C_log_write_flush_cache_msg(H5C_t *cache, herr_t fxn_ret_value) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ if (cache->log_info->cls->write_flush_cache_log_msg) @@ -465,7 +465,7 @@ H5C_log_write_insert_entry_msg(H5C_t *cache, haddr_t address, int type_id, unsig FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ if (cache->log_info->cls->write_insert_entry_log_msg) @@ -497,10 +497,10 @@ H5C_log_write_mark_entry_dirty_msg(H5C_t *cache, const H5C_cache_entry_t *entry, FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(entry); + assert(entry); if (cache->log_info->cls->write_mark_entry_dirty_log_msg) if (cache->log_info->cls->write_mark_entry_dirty_log_msg(cache->log_info->udata, entry, fxn_ret_value) < 0) @@ -530,10 +530,10 @@ H5C_log_write_mark_entry_clean_msg(H5C_t *cache, const H5C_cache_entry_t *entry, FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(entry); + assert(entry); if (cache->log_info->cls->write_mark_entry_clean_log_msg) if (cache->log_info->cls->write_mark_entry_clean_log_msg(cache->log_info->udata, entry, fxn_ret_value) < 0) @@ -563,10 +563,10 @@ H5C_log_write_mark_unserialized_entry_msg(H5C_t *cache, const H5C_cache_entry_t FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(entry); + assert(entry); if (cache->log_info->cls->write_mark_unserialized_entry_log_msg) if (cache->log_info->cls->write_mark_unserialized_entry_log_msg(cache->log_info->udata, entry, fxn_ret_value) < 0) @@ -596,10 +596,10 @@ H5C_log_write_mark_serialized_entry_msg(H5C_t *cache, const H5C_cache_entry_t *e FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(entry); + assert(entry); if (cache->log_info->cls->write_mark_serialized_entry_log_msg) if (cache->log_info->cls->write_mark_serialized_entry_log_msg(cache->log_info->udata, entry, fxn_ret_value) < 0) @@ -630,7 +630,7 @@ H5C_log_write_move_entry_msg(H5C_t *cache, haddr_t old_addr, haddr_t new_addr, i FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ if (cache->log_info->cls->write_move_entry_log_msg) @@ -662,10 +662,10 @@ H5C_log_write_pin_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(entry); + assert(entry); if (cache->log_info->cls->write_pin_entry_log_msg) if (cache->log_info->cls->write_pin_entry_log_msg(cache->log_info->udata, entry, fxn_ret_value) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "log-specific pin entry call failed") @@ -696,11 +696,11 @@ H5C_log_write_create_fd_msg(H5C_t *cache, const H5C_cache_entry_t *parent, const FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(parent); - HDassert(child); + assert(parent); + assert(child); if (cache->log_info->cls->write_create_fd_log_msg) if (cache->log_info->cls->write_create_fd_log_msg(cache->log_info->udata, parent, child, fxn_ret_value) < 0) @@ -731,10 +731,10 @@ H5C_log_write_protect_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, in FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(entry); + assert(entry); if (cache->log_info->cls->write_protect_entry_log_msg) if (cache->log_info->cls->write_protect_entry_log_msg(cache->log_info->udata, entry, type_id, flags, fxn_ret_value) < 0) @@ -765,10 +765,10 @@ H5C_log_write_resize_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, siz FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(entry); + assert(entry); if (cache->log_info->cls->write_resize_entry_log_msg) if (cache->log_info->cls->write_resize_entry_log_msg(cache->log_info->udata, entry, new_size, fxn_ret_value) < 0) @@ -798,10 +798,10 @@ H5C_log_write_unpin_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(entry); + assert(entry); if (cache->log_info->cls->write_unpin_entry_log_msg) if (cache->log_info->cls->write_unpin_entry_log_msg(cache->log_info->udata, entry, fxn_ret_value) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "log-specific unpin entry call failed") @@ -832,11 +832,11 @@ H5C_log_write_destroy_fd_msg(H5C_t *cache, const H5C_cache_entry_t *parent, cons FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(parent); - HDassert(child); + assert(parent); + assert(child); if (cache->log_info->cls->write_destroy_fd_log_msg) if (cache->log_info->cls->write_destroy_fd_log_msg(cache->log_info->udata, parent, child, fxn_ret_value) < 0) @@ -867,7 +867,7 @@ H5C_log_write_unprotect_entry_msg(H5C_t *cache, haddr_t address, int type_id, un FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ if (cache->log_info->cls->write_unprotect_entry_log_msg) @@ -899,10 +899,10 @@ H5C_log_write_set_cache_config_msg(H5C_t *cache, const H5AC_cache_config_t *conf FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(config); + assert(config); if (cache->log_info->cls->write_set_cache_config_log_msg) if (cache->log_info->cls->write_set_cache_config_log_msg(cache->log_info->udata, config, fxn_ret_value) < 0) @@ -932,10 +932,10 @@ H5C_log_write_remove_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, her FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache); + assert(cache); /* Write a log message */ - HDassert(entry); + assert(entry); if (cache->log_info->cls->write_remove_entry_log_msg) if (cache->log_info->cls->write_remove_entry_log_msg(cache->log_info->udata, entry, fxn_ret_value) < 0) diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c index afb81c5..cffd10a 100644 --- a/src/H5Clog_json.c +++ b/src/H5Clog_json.c @@ -166,9 +166,9 @@ H5C__json_write_log_message(H5C_log_json_udata_t *json_udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->outfile); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->outfile); + assert(json_udata->message); /* Write the log message and flush */ n_chars = HDstrlen(json_udata->message); @@ -215,8 +215,8 @@ H5C__log_json_set_up(H5C_log_info_t *log_info, const char log_location[], int mp FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(log_info); - HDassert(log_location); + assert(log_info); + assert(log_location); /* Set up the class struct */ log_info->cls = &H5C_json_log_class_g; @@ -294,7 +294,7 @@ H5C__json_tear_down_logging(H5C_log_info_t *log_info) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(log_info); + assert(log_info); /* Alias */ json_udata = (H5C_log_json_udata_t *)(log_info->udata); @@ -339,8 +339,8 @@ H5C__json_write_start_log_msg(void *udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string (opens the JSON array) */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -382,8 +382,8 @@ H5C__json_write_stop_log_msg(void *udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string (closes the JSON array) */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -424,8 +424,8 @@ H5C__json_write_create_cache_log_msg(void *udata, herr_t fxn_ret_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -466,8 +466,8 @@ H5C__json_write_destroy_cache_log_msg(void *udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -507,8 +507,8 @@ H5C__json_write_evict_cache_log_msg(void *udata, herr_t fxn_ret_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -549,8 +549,8 @@ H5C__json_write_expunge_entry_log_msg(void *udata, haddr_t address, int type_id, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -593,8 +593,8 @@ H5C__json_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -636,8 +636,8 @@ H5C__json_write_insert_entry_log_msg(void *udata, haddr_t address, int type_id, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -683,9 +683,9 @@ H5C__json_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t *e FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(entry); + assert(json_udata); + assert(json_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -727,9 +727,9 @@ H5C__json_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t *e FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(entry); + assert(json_udata); + assert(json_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -772,9 +772,9 @@ H5C__json_write_mark_unserialized_entry_log_msg(void *udata, const H5C_cache_ent FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(entry); + assert(json_udata); + assert(json_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -817,9 +817,9 @@ H5C__json_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entry FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(entry); + assert(json_udata); + assert(json_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -862,8 +862,8 @@ H5C__json_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_ad FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -908,9 +908,9 @@ H5C__json_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, h FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(entry); + assert(json_udata); + assert(json_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -954,10 +954,10 @@ H5C__json_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(parent); - HDassert(child); + assert(json_udata); + assert(json_udata->message); + assert(parent); + assert(child); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -1003,9 +1003,9 @@ H5C__json_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entr FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(entry); + assert(json_udata); + assert(json_udata->message); + assert(entry); if (H5C__READ_ONLY_FLAG == flags) HDstrcpy(rw_s, "READ"); @@ -1057,9 +1057,9 @@ H5C__json_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(entry); + assert(json_udata); + assert(json_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -1102,9 +1102,9 @@ H5C__json_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(entry); + assert(json_udata); + assert(json_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -1148,10 +1148,10 @@ H5C__json_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(parent); - HDassert(child); + assert(json_udata); + assert(json_udata->message); + assert(parent); + assert(child); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -1196,8 +1196,8 @@ H5C__json_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_i FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); + assert(json_udata); + assert(json_udata->message); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -1242,9 +1242,9 @@ H5C__json_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(config); + assert(json_udata); + assert(json_udata->message); + assert(config); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ @@ -1285,9 +1285,9 @@ H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(json_udata); - HDassert(json_udata->message); - HDassert(entry); + assert(json_udata); + assert(json_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, "\ diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c index b095e87..72d93f6 100644 --- a/src/H5Clog_trace.c +++ b/src/H5Clog_trace.c @@ -161,9 +161,9 @@ H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->outfile); - HDassert(trace_udata->message); + assert(trace_udata); + assert(trace_udata->outfile); + assert(trace_udata->message); /* Write the log message and flush */ n_chars = HDstrlen(trace_udata->message); @@ -210,8 +210,8 @@ H5C__log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int m FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(log_info); - HDassert(log_location); + assert(log_info); + assert(log_location); /* Set up the class struct */ log_info->cls = &H5C_trace_log_class_g; @@ -292,7 +292,7 @@ H5C__trace_tear_down_logging(H5C_log_info_t *log_info) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(log_info); + assert(log_info); /* Alias */ trace_udata = (H5C_log_trace_udata_t *)(log_info->udata); @@ -337,8 +337,8 @@ H5C__trace_write_expunge_entry_log_msg(void *udata, haddr_t address, int type_id FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); + assert(trace_udata); + assert(trace_udata->message); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_expunge_entry 0x%lx %d %d\n", @@ -373,8 +373,8 @@ H5C__trace_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); + assert(trace_udata); + assert(trace_udata->message); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_flush %d\n", (int)fxn_ret_value); @@ -409,8 +409,8 @@ H5C__trace_write_insert_entry_log_msg(void *udata, haddr_t address, int type_id, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); + assert(trace_udata); + assert(trace_udata->message); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_insert_entry 0x%lx %d 0x%x %d %d\n", @@ -445,9 +445,9 @@ H5C__trace_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t * FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(entry); + assert(trace_udata); + assert(trace_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_dirty 0x%lx %d\n", @@ -482,9 +482,9 @@ H5C__trace_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t * FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(entry); + assert(trace_udata); + assert(trace_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_clean 0x%lx %d\n", @@ -520,9 +520,9 @@ H5C__trace_write_mark_unserialized_entry_log_msg(void *udata, const H5C_cache_en FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(entry); + assert(trace_udata); + assert(trace_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_unserialized 0x%lx %d\n", @@ -558,9 +558,9 @@ H5C__trace_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entr FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(entry); + assert(trace_udata); + assert(trace_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_serialized 0x%lx %d\n", @@ -596,8 +596,8 @@ H5C__trace_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_a FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); + assert(trace_udata); + assert(trace_udata->message); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_move_entry 0x%lx 0x%lx %d %d\n", @@ -632,9 +632,9 @@ H5C__trace_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(entry); + assert(trace_udata); + assert(trace_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_pin_protected_entry 0x%lx %d\n", @@ -671,10 +671,10 @@ H5C__trace_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(parent); - HDassert(child); + assert(trace_udata); + assert(trace_udata->message); + assert(parent); + assert(child); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, @@ -711,9 +711,9 @@ H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *ent FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(entry); + assert(trace_udata); + assert(trace_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_protect 0x%lx %d 0x%x %d %d\n", @@ -749,9 +749,9 @@ H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entr FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(entry); + assert(trace_udata); + assert(trace_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_resize_entry 0x%lx %d %d\n", @@ -786,9 +786,9 @@ H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(entry); + assert(trace_udata); + assert(trace_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unpin_entry 0x%lx %d\n", @@ -825,10 +825,10 @@ H5C__trace_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(parent); - HDassert(child); + assert(trace_udata); + assert(trace_udata->message); + assert(parent); + assert(child); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, @@ -865,8 +865,8 @@ H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); + assert(trace_udata); + assert(trace_udata->message); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unprotect 0x%lx %d 0x%x %d\n", @@ -902,9 +902,9 @@ H5C__trace_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(config); + assert(trace_udata); + assert(trace_udata->message); + assert(config); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, @@ -951,9 +951,9 @@ H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entr FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(trace_udata); - HDassert(trace_udata->message); - HDassert(entry); + assert(trace_udata); + assert(trace_udata->message); + assert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_remove_entry 0x%lx %d\n", diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 46f1ba7..308a7f3 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -183,12 +183,12 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(cache_ptr != NULL); - HDassert(num_candidates > 0); - HDassert((!cache_ptr->slist_enabled) || (num_candidates <= cache_ptr->slist_len)); - HDassert(candidates_list_ptr != NULL); - HDassert(0 <= mpi_rank); - HDassert(mpi_rank < mpi_size); + assert(cache_ptr != NULL); + assert(num_candidates > 0); + assert((!cache_ptr->slist_enabled) || (num_candidates <= cache_ptr->slist_len)); + assert(candidates_list_ptr != NULL); + assert(0 <= mpi_rank); + assert(mpi_rank < mpi_size); /* Initialize the entries_to_flush and entries_to_clear arrays */ HDmemset(entries_to_flush, 0, sizeof(entries_to_flush)); @@ -209,7 +209,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha if (f->shared->coll_md_write) { /* Sanity check */ - HDassert(NULL == cache_ptr->coll_write_list); + assert(NULL == cache_ptr->coll_write_list); /* Create skip list of entries for collective write */ if (NULL == (cache_ptr->coll_write_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) @@ -243,7 +243,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha candidate_assignment_table[u] = candidate_assignment_table[u - 1] + n; } /* end else */ } /* end else */ - HDassert((candidate_assignment_table[mpi_size - 1] + n) == num_candidates); + assert((candidate_assignment_table[mpi_size - 1] + n) == num_candidates); #ifdef H5C_DO_SANITY_CHECKS /* Verify that the candidate assignment table has the expected form */ @@ -253,9 +253,9 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha a = candidate_assignment_table[u] - candidate_assignment_table[u - 1]; b = candidate_assignment_table[u + 1] - candidate_assignment_table[u]; - HDassert(n + 1 >= a); - HDassert(a >= b); - HDassert(b >= n); + assert(n + 1 >= a); + assert(a >= b); + assert(b >= n); } #endif /* H5C_DO_SANITY_CHECKS */ @@ -279,7 +279,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha for (u = 0; u < num_candidates; u++) { addr = candidates_list_ptr[u]; - HDassert(H5_addr_defined(addr)); + assert(H5_addr_defined(addr)); #ifdef H5C_DO_SANITY_CHECKS if (u > 0) { @@ -305,10 +305,10 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?") /* Sanity checks */ - HDassert(entry_ptr->ring >= H5C_RING_USER); - HDassert(entry_ptr->ring <= H5C_RING_SB); - HDassert(!entry_ptr->flush_immediately); - HDassert(!entry_ptr->clear_on_unprotect); + assert(entry_ptr->ring >= H5C_RING_USER); + assert(entry_ptr->ring <= H5C_RING_SB); + assert(!entry_ptr->flush_immediately); + assert(!entry_ptr->clear_on_unprotect); /* Determine whether the entry is to be cleared or flushed, * and mark it accordingly. We will scan the protected and @@ -350,8 +350,8 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha n += entries_to_clear[u]; } /* end if */ - HDassert((unsigned)m == total_entries_to_flush); - HDassert(n == total_entries_to_clear); + assert((unsigned)m == total_entries_to_flush); + assert(n == total_entries_to_clear); #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG @@ -375,7 +375,7 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha /* If we've deferred writing to do it collectively, take care of that now */ if (f->shared->coll_md_write) { /* Sanity check */ - HDassert(cache_ptr->coll_write_list); + assert(cache_ptr->coll_write_list); /* Write collective list */ if (H5C__collective_write(f) < 0) @@ -419,7 +419,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) FUNC_ENTER_NOAPI(FAIL) - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); /* As a sanity check, set space needed to the dirty_index_size. This * should be the sum total of the sizes of all the dirty entries @@ -428,14 +428,14 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) */ space_needed = cache_ptr->dirty_index_size; - HDassert((!cache_ptr->slist_enabled) || (space_needed == cache_ptr->slist_size)); + assert((!cache_ptr->slist_enabled) || (space_needed == cache_ptr->slist_size)); /* We shouldn't have any protected entries at this point, but it is * possible that some dirty entries may reside on the pinned list. */ - HDassert(cache_ptr->dirty_index_size <= (cache_ptr->dLRU_list_size + cache_ptr->pel_size)); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_len <= (cache_ptr->dLRU_list_len + cache_ptr->pel_len))); + assert(cache_ptr->dirty_index_size <= (cache_ptr->dLRU_list_size + cache_ptr->pel_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_len <= (cache_ptr->dLRU_list_len + cache_ptr->pel_len))); if (space_needed > 0) { H5C_cache_entry_t *entry_ptr; @@ -443,7 +443,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) size_t nominated_entries_size = 0; haddr_t nominated_addr; - HDassert((!cache_ptr->slist_enabled) || (cache_ptr->slist_len > 0)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_len > 0)); /* Scan the dirty LRU list from tail forward and nominate sufficient * entries to free up the necessary space. @@ -452,11 +452,11 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) while ((nominated_entries_size < space_needed) && ((!cache_ptr->slist_enabled) || (nominated_entries_count < cache_ptr->slist_len)) && (entry_ptr != NULL)) { - HDassert(!(entry_ptr->is_protected)); - HDassert(!(entry_ptr->is_read_only)); - HDassert(entry_ptr->ro_ref_count == 0); - HDassert(entry_ptr->is_dirty); - HDassert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); + assert(!(entry_ptr->is_protected)); + assert(!(entry_ptr->is_read_only)); + assert(entry_ptr->ro_ref_count == 0); + assert(entry_ptr->is_dirty); + assert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); nominated_addr = entry_ptr->addr; if (H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) @@ -468,7 +468,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) entry_ptr = entry_ptr->aux_prev; } /* end while */ - HDassert(entry_ptr == NULL); + assert(entry_ptr == NULL); /* it is possible that there are some dirty entries on the * protected entry list as well -- scan it too if necessary @@ -478,11 +478,11 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) ((!cache_ptr->slist_enabled) || (nominated_entries_count < cache_ptr->slist_len)) && (entry_ptr != NULL)) { if (entry_ptr->is_dirty) { - HDassert(!(entry_ptr->is_protected)); - HDassert(!(entry_ptr->is_read_only)); - HDassert(entry_ptr->ro_ref_count == 0); - HDassert(entry_ptr->is_dirty); - HDassert(entry_ptr->in_slist); + assert(!(entry_ptr->is_protected)); + assert(!(entry_ptr->is_read_only)); + assert(entry_ptr->ro_ref_count == 0); + assert(entry_ptr->is_dirty); + assert(entry_ptr->in_slist); nominated_addr = entry_ptr->addr; if (H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) @@ -495,8 +495,8 @@ H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr) entry_ptr = entry_ptr->next; } /* end while */ - HDassert((!cache_ptr->slist_enabled) || (nominated_entries_count == cache_ptr->slist_len)); - HDassert(nominated_entries_size == space_needed); + assert((!cache_ptr->slist_enabled) || (nominated_entries_count == cache_ptr->slist_len)); + assert(nominated_entries_size == space_needed); } /* end if */ done: @@ -529,7 +529,7 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) FUNC_ENTER_NOAPI(FAIL) - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); /* compute the number of bytes (if any) that must be flushed to get the * cache back within its min clean constraints. @@ -555,7 +555,7 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) unsigned nominated_entries_count = 0; size_t nominated_entries_size = 0; - HDassert((!cache_ptr->slist_enabled) || (cache_ptr->slist_len > 0)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_len > 0)); /* Scan the dirty LRU list from tail forward and nominate sufficient * entries to free up the necessary space. @@ -566,11 +566,11 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) (entry_ptr != NULL) && (!entry_ptr->flush_me_last)) { haddr_t nominated_addr; - HDassert(!(entry_ptr->is_protected)); - HDassert(!(entry_ptr->is_read_only)); - HDassert(entry_ptr->ro_ref_count == 0); - HDassert(entry_ptr->is_dirty); - HDassert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); + assert(!(entry_ptr->is_protected)); + assert(!(entry_ptr->is_read_only)); + assert(entry_ptr->ro_ref_count == 0); + assert(entry_ptr->is_dirty); + assert((!cache_ptr->slist_enabled) || (entry_ptr->in_slist)); nominated_addr = entry_ptr->addr; if (H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0) @@ -582,9 +582,9 @@ H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr) entry_ptr = entry_ptr->aux_prev; } /* end while */ - HDassert((!cache_ptr->slist_enabled) || (nominated_entries_count <= cache_ptr->slist_len)); - HDassert(nominated_entries_size <= cache_ptr->dirty_index_size); - HDassert(nominated_entries_size >= space_needed); + assert((!cache_ptr->slist_enabled) || (nominated_entries_count <= cache_ptr->slist_len)); + assert(nominated_entries_size <= cache_ptr->dirty_index_size); + assert(nominated_entries_size >= space_needed); } /* end if */ done: @@ -644,13 +644,13 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr FUNC_ENTER_NOAPI(FAIL) - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); - HDassert(ce_array_len > 0); - HDassert(ce_array_ptr != NULL); + assert(ce_array_len > 0); + assert(ce_array_ptr != NULL); #ifdef H5C_DO_EXTREME_SANITY_CHECKS if (H5C__validate_protected_entry_list(cache_ptr) < 0 || H5C__validate_pinned_entry_list(cache_ptr) < 0 || @@ -678,7 +678,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ #endif /* H5C_DO_SANITY_CHECKS */ - HDassert(H5_addr_defined(addr)); + assert(H5_addr_defined(addr)); H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL); @@ -761,7 +761,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr } /* end while */ #ifdef H5C_DO_SANITY_CHECKS - HDassert(entries_cleared == other_entries_marked); + assert(entries_cleared == other_entries_marked); #endif /* H5C_DO_SANITY_CHECKS */ /* It is also possible that some of the cleared entries are on the @@ -792,11 +792,11 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr } /* end while */ #ifdef H5C_DO_SANITY_CHECKS - HDassert(entries_cleared == pinned_entries_marked + other_entries_marked); - HDassert(entries_cleared + protected_entries_marked == ce_array_len); + assert(entries_cleared == pinned_entries_marked + other_entries_marked); + assert(entries_cleared + protected_entries_marked == ce_array_len); #endif /* H5C_DO_SANITY_CHECKS */ - HDassert((entries_cleared == ce_array_len) || ((ce_array_len - entries_cleared) <= cache_ptr->pl_len)); + assert((entries_cleared == ce_array_len) || ((ce_array_len - entries_cleared) <= cache_ptr->pl_len)); #ifdef H5C_DO_SANITY_CHECKS u = 0; @@ -806,7 +806,7 @@ H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr u++; entry_ptr = entry_ptr->next; } - HDassert((entries_cleared + u) == ce_array_len); + assert((entries_cleared + u) == ce_array_len); #endif /* H5C_DO_SANITY_CHECKS */ done: @@ -851,7 +851,7 @@ H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) H5C_cache_entry_t *prev_ptr = entry_ptr->coll_prev; /* Sanity check */ - HDassert(entry_ptr->coll_access); + assert(entry_ptr->coll_access); /* Mark entry as independent */ entry_ptr->coll_access = FALSE; @@ -898,10 +898,10 @@ H5C__collective_write(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f != NULL); + assert(f != NULL); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); - HDassert(cache_ptr->coll_write_list != NULL); + assert(cache_ptr != NULL); + assert(cache_ptr->coll_write_list != NULL); /* Get original transfer mode */ if (H5CX_get_io_xfer_mode(&orig_xfer_mode) < 0) @@ -932,12 +932,12 @@ H5C__collective_write(H5F_t *f) /* Fill arrays */ node = H5SL_first(cache_ptr->coll_write_list); - HDassert(node); + assert(node); if (NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") /* Set up initial array position & buffer base address */ - HDassert(entry_ptr->type); + assert(entry_ptr->type); base_buf = entry_ptr->image_ptr; addrs[0] = entry_ptr->addr; sizes[0] = entry_ptr->size; @@ -955,7 +955,7 @@ H5C__collective_write(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") /* Set up array position */ - HDassert(entry_ptr->type); + assert(entry_ptr->type); addrs[i] = entry_ptr->addr; sizes[i] = entry_ptr->size; bufs[i] = entry_ptr->image_ptr; @@ -1048,22 +1048,22 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->slist_ptr); + assert(cache_ptr); + assert(cache_ptr->slist_ptr); - HDassert(entries_to_flush[H5C_RING_UNDEFINED] == 0); - HDassert(entries_to_clear[H5C_RING_UNDEFINED] == 0); + assert(entries_to_flush[H5C_RING_UNDEFINED] == 0); + assert(entries_to_clear[H5C_RING_UNDEFINED] == 0); #ifdef H5C_DO_SANITY_CHECKS - HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); - HDassert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); - HDassert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); + assert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->clean_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->dirty_index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); + assert(cache_ptr->slist_ring_len[H5C_RING_UNDEFINED] == 0); + assert(cache_ptr->slist_ring_size[H5C_RING_UNDEFINED] == (size_t)0); for (i = H5C_RING_USER; i < H5C_RING_NTYPES; i++) { index_len += cache_ptr->index_ring_len[i]; @@ -1075,12 +1075,12 @@ H5C__flush_candidate_entries(H5F_t *f, unsigned entries_to_flush[H5C_RING_NTYPES slist_size += cache_ptr->slist_ring_size[i]; } /* end for */ - HDassert(cache_ptr->index_len == index_len); - HDassert(cache_ptr->index_size == index_size); - HDassert(cache_ptr->clean_index_size == clean_index_size); - HDassert(cache_ptr->dirty_index_size == dirty_index_size); - HDassert(cache_ptr->slist_len == slist_len); - HDassert(cache_ptr->slist_size == slist_size); + assert(cache_ptr->index_len == index_len); + assert(cache_ptr->index_size == index_size); + assert(cache_ptr->clean_index_size == clean_index_size); + assert(cache_ptr->dirty_index_size == dirty_index_size); + assert(cache_ptr->slist_len == slist_len); + assert(cache_ptr->slist_size == slist_size); #endif /* H5C_DO_SANITY_CHECKS */ #ifdef H5C_DO_EXTREME_SANITY_CHECKS @@ -1166,13 +1166,13 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(cache_ptr->slist_ptr); - HDassert(ring > H5C_RING_UNDEFINED); - HDassert(ring < H5C_RING_NTYPES); + assert(cache_ptr); + assert(cache_ptr->slist_ptr); + assert(ring > H5C_RING_UNDEFINED); + assert(ring < H5C_RING_NTYPES); #ifdef H5C_DO_EXTREME_SANITY_CHECKS if ((H5C__validate_protected_entry_list(cache_ptr) < 0) || @@ -1202,7 +1202,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu H5C_cache_entry_t *next_ptr; /* Entries in the LRU must not have flush dependency children */ - HDassert(entry_ptr->flush_dep_nchildren == 0); + assert(entry_ptr->flush_dep_nchildren == 0); /* Remember dirty state of entry to advance to */ if (entry_ptr->prev != NULL) @@ -1212,7 +1212,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu if (entry_ptr->ring == ring) { /* If this process needs to clear this entry. */ if (entry_ptr->clear_on_unprotect) { - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->is_dirty); /* Set entry and flags for operation */ op_ptr = entry_ptr; @@ -1226,7 +1226,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu entries_cleared++; } /* end if */ else if (entry_ptr->flush_immediately) { - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->is_dirty); /* Set entry and flags for operation */ op_ptr = entry_ptr; @@ -1299,13 +1299,13 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu * present. Hence the following assertion which should be * removed if the above changes. */ - HDassert(!restart_scan); - HDassert(entry_ptr->is_dirty == prev_is_dirty); - HDassert(entry_ptr->next == next_ptr); - HDassert(!entry_ptr->is_protected); - HDassert(!entry_ptr->is_pinned); + assert(!restart_scan); + assert(entry_ptr->is_dirty == prev_is_dirty); + assert(entry_ptr->next == next_ptr); + assert(!entry_ptr->is_protected); + assert(!entry_ptr->is_pinned); - HDassert(FALSE); /* see comment above */ + assert(FALSE); /* see comment above */ restart_scan = FALSE; entry_ptr = cache_ptr->LRU_tail_ptr; @@ -1344,7 +1344,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu H5C_cache_entry_t *prev_ptr; hbool_t next_is_dirty = FALSE; - HDassert(entry_ptr->is_pinned); + assert(entry_ptr->is_pinned); /* Remember dirty state of entry to advance to */ if (entry_ptr->next != NULL) @@ -1352,7 +1352,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu if (entry_ptr->ring == ring && entry_ptr->flush_dep_ndirty_children == 0) { if (entry_ptr->clear_on_unprotect) { - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->is_dirty); /* Set entry and flags for operation */ op_ptr = entry_ptr; @@ -1364,7 +1364,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu progress = TRUE; } /* end if */ else if (entry_ptr->flush_immediately) { - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->is_dirty); /* Set entry and flags for operation */ op_ptr = entry_ptr; @@ -1424,11 +1424,11 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu * over from the head. */ - HDassert(!restart_scan); - HDassert(entry_ptr->is_dirty == next_is_dirty); - HDassert(entry_ptr->prev == prev_ptr); - HDassert(!entry_ptr->is_protected); - HDassert(entry_ptr->is_pinned); + assert(!restart_scan); + assert(entry_ptr->is_dirty == next_is_dirty); + assert(entry_ptr->prev == prev_ptr); + assert(!entry_ptr->is_protected); + assert(entry_ptr->is_pinned); /* This code should be un-reachable at present, * as all the operations by entries on flush that could cause @@ -1436,7 +1436,7 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu * present. Hence the following assertion which should be * removed if the above changes. */ - HDassert(FALSE); + assert(FALSE); restart_scan = FALSE; @@ -1460,14 +1460,14 @@ H5C__flush_candidates_in_ring(H5F_t *f, H5C_ring_t ring, unsigned entries_to_flu */ #ifdef H5C_DO_SANITY_CHECKS - HDassert(init_index_len == cache_ptr->index_len); + assert(init_index_len == cache_ptr->index_len); #endif /* H5C_DO_SANITY_CHECKS */ if (entries_flushed != entries_to_flush || entries_cleared != entries_to_clear) { entry_ptr = cache_ptr->il_head; while (entry_ptr != NULL) { - HDassert(!entry_ptr->clear_on_unprotect || (entry_ptr->ring > ring)); - HDassert(!entry_ptr->flush_immediately || (entry_ptr->ring > ring)); + assert(!entry_ptr->clear_on_unprotect || (entry_ptr->ring > ring)); + assert(!entry_ptr->flush_immediately || (entry_ptr->ring > ring)); entry_ptr = entry_ptr->il_next; } /* end while */ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index a6204c5..ba8bfaa 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -837,7 +837,7 @@ do { \ } \ if((entry_ptr)->flush_me_last) { \ (cache_ptr)->num_last_entries++; \ - HDassert((cache_ptr)->num_last_entries <= 2); \ + assert((cache_ptr)->num_last_entries <= 2); \ } \ H5C__IL_DLL_APPEND((entry_ptr), (cache_ptr)->il_head, \ (cache_ptr)->il_tail, (cache_ptr)->il_len, \ @@ -872,7 +872,7 @@ do { \ } \ if((entry_ptr)->flush_me_last) { \ (cache_ptr)->num_last_entries--; \ - HDassert((cache_ptr)->num_last_entries <= 1); \ + assert((cache_ptr)->num_last_entries <= 1); \ } \ H5C__IL_DLL_REMOVE((entry_ptr), (cache_ptr)->il_head, \ (cache_ptr)->il_tail, (cache_ptr)->il_len, \ @@ -894,7 +894,7 @@ do { \ if((entry_ptr) != (cache_ptr)->index[k]) { \ if((entry_ptr)->ht_next) \ (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ - HDassert((entry_ptr)->ht_prev != NULL); \ + assert((entry_ptr)->ht_prev != NULL); \ (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \ (cache_ptr)->index[k]->ht_prev = (entry_ptr); \ (entry_ptr)->ht_next = (cache_ptr)->index[k]; \ @@ -1023,21 +1023,21 @@ do { \ #define H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, fail_val) \ do { \ - HDassert(cache_ptr); \ + assert(cache_ptr); \ \ if((cache_ptr)->slist_enabled) { \ - HDassert(entry_ptr); \ - HDassert((entry_ptr)->size > 0); \ - HDassert(H5_addr_defined((entry_ptr)->addr)); \ - HDassert(!(entry_ptr)->in_slist); \ - HDassert(!H5C__ENTRY_IN_SLIST((cache_ptr), (entry_ptr))); \ - HDassert((entry_ptr)->ring > H5C_RING_UNDEFINED); \ - HDassert((entry_ptr)->ring < H5C_RING_NTYPES); \ - HDassert((cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + assert(entry_ptr); \ + assert((entry_ptr)->size > 0); \ + assert(H5_addr_defined((entry_ptr)->addr)); \ + assert(!(entry_ptr)->in_slist); \ + assert(!H5C__ENTRY_IN_SLIST((cache_ptr), (entry_ptr))); \ + assert((entry_ptr)->ring > H5C_RING_UNDEFINED); \ + assert((entry_ptr)->ring < H5C_RING_NTYPES); \ + assert((cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ (cache_ptr)->slist_len); \ - HDassert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + assert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ (cache_ptr)->slist_size); \ - HDassert((cache_ptr)->slist_ptr); \ + assert((cache_ptr)->slist_ptr); \ \ if(H5SL_insert((cache_ptr)->slist_ptr, entry_ptr, &((entry_ptr)->addr)) < 0) \ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), "can't insert entry in skip list") \ @@ -1050,11 +1050,11 @@ do { \ ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) += (entry_ptr)->size;\ H5C__SLIST_INSERT_ENTRY_SC(cache_ptr, entry_ptr) \ \ - HDassert((cache_ptr)->slist_len > 0); \ - HDassert((cache_ptr)->slist_size > 0); \ + assert((cache_ptr)->slist_len > 0); \ + assert((cache_ptr)->slist_size > 0); \ } else { /* slist disabled */ \ - HDassert((cache_ptr)->slist_len == 0); \ - HDassert((cache_ptr)->slist_size == 0); \ + assert((cache_ptr)->slist_len == 0); \ + assert((cache_ptr)->slist_size == 0); \ } \ } while (0) /* H5C__INSERT_ENTRY_IN_SLIST */ @@ -1073,40 +1073,40 @@ do { \ #define H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, during_flush, fail_val) \ { \ - HDassert(cache_ptr); \ + assert(cache_ptr); \ \ if((cache_ptr)->slist_enabled) { \ - HDassert(entry_ptr); \ - HDassert(!(entry_ptr)->is_read_only); \ - HDassert((entry_ptr)->ro_ref_count == 0); \ - HDassert((entry_ptr)->size > 0); \ - HDassert((entry_ptr)->in_slist); \ - HDassert((cache_ptr)->slist_ptr); \ - HDassert((entry_ptr)->ring > H5C_RING_UNDEFINED); \ - HDassert((entry_ptr)->ring < H5C_RING_NTYPES); \ - HDassert((cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + assert(entry_ptr); \ + assert(!(entry_ptr)->is_read_only); \ + assert((entry_ptr)->ro_ref_count == 0); \ + assert((entry_ptr)->size > 0); \ + assert((entry_ptr)->in_slist); \ + assert((cache_ptr)->slist_ptr); \ + assert((entry_ptr)->ring > H5C_RING_UNDEFINED); \ + assert((entry_ptr)->ring < H5C_RING_NTYPES); \ + assert((cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ (cache_ptr)->slist_len); \ - HDassert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + assert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ (cache_ptr)->slist_size); \ - HDassert((cache_ptr)->slist_size >= (entry_ptr)->size); \ + assert((cache_ptr)->slist_size >= (entry_ptr)->size); \ \ if(H5SL_remove((cache_ptr)->slist_ptr, &(entry_ptr)->addr) != (entry_ptr) ) \ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, (fail_val), "can't delete entry from skip list") \ \ - HDassert((cache_ptr)->slist_len > 0); \ + assert((cache_ptr)->slist_len > 0); \ if(!(during_flush)) \ (cache_ptr)->slist_changed = TRUE; \ (cache_ptr)->slist_len--; \ - HDassert((cache_ptr)->slist_size >= (entry_ptr)->size); \ + assert((cache_ptr)->slist_size >= (entry_ptr)->size); \ (cache_ptr)->slist_size -= (entry_ptr)->size; \ (cache_ptr)->slist_ring_len[(entry_ptr)->ring]--; \ - HDassert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] >= (entry_ptr)->size); \ + assert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] >= (entry_ptr)->size); \ ((cache_ptr)->slist_ring_size[(entry_ptr)->ring]) -= (entry_ptr)->size;\ H5C__SLIST_REMOVE_ENTRY_SC(cache_ptr, entry_ptr) \ (entry_ptr)->in_slist = FALSE; \ } else { /* slist disabled */ \ - HDassert((cache_ptr)->slist_len == 0); \ - HDassert((cache_ptr)->slist_size == 0); \ + assert((cache_ptr)->slist_len == 0); \ + assert((cache_ptr)->slist_size == 0); \ } \ } /* H5C__REMOVE_ENTRY_FROM_SLIST */ @@ -1125,38 +1125,38 @@ do { \ #define H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size) \ do { \ - HDassert(cache_ptr); \ + assert(cache_ptr); \ \ if((cache_ptr)->slist_enabled) { \ - HDassert((old_size) > 0); \ - HDassert((new_size) > 0); \ - HDassert((old_size) <= (cache_ptr)->slist_size); \ - HDassert((cache_ptr)->slist_len > 0); \ - HDassert((cache_ptr)->slist_len > 1 || \ + assert((old_size) > 0); \ + assert((new_size) > 0); \ + assert((old_size) <= (cache_ptr)->slist_size); \ + assert((cache_ptr)->slist_len > 0); \ + assert((cache_ptr)->slist_len > 1 || \ (cache_ptr)->slist_size == (old_size)); \ - HDassert((entry_ptr)->ring > H5C_RING_UNDEFINED); \ - HDassert((entry_ptr)->ring < H5C_RING_NTYPES); \ - HDassert((cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ + assert((entry_ptr)->ring > H5C_RING_UNDEFINED); \ + assert((entry_ptr)->ring < H5C_RING_NTYPES); \ + assert((cache_ptr)->slist_ring_len[(entry_ptr)->ring] <= \ (cache_ptr)->slist_len); \ - HDassert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ + assert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] <= \ (cache_ptr)->slist_size); \ \ (cache_ptr)->slist_size -= (old_size); \ (cache_ptr)->slist_size += (new_size); \ \ - HDassert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] >= (old_size)); \ + assert((cache_ptr)->slist_ring_size[(entry_ptr)->ring] >= (old_size)); \ \ (cache_ptr)->slist_ring_size[(entry_ptr)->ring] -= (old_size); \ (cache_ptr)->slist_ring_size[(entry_ptr)->ring] += (new_size); \ \ H5C__SLIST_UPDATE_FOR_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size) \ \ - HDassert((new_size) <= (cache_ptr)->slist_size); \ - HDassert((cache_ptr)->slist_len > 1 || \ + assert((new_size) <= (cache_ptr)->slist_size); \ + assert((cache_ptr)->slist_len > 1 || \ (cache_ptr)->slist_size == (new_size)); \ } else { /* slist disabled */ \ - HDassert((cache_ptr)->slist_len == 0); \ - HDassert((cache_ptr)->slist_size == 0); \ + assert((cache_ptr)->slist_len == 0); \ + assert((cache_ptr)->slist_size == 0); \ } \ } while (0) /* H5C__UPDATE_SLIST_FOR_SIZE_CHANGE */ @@ -1385,13 +1385,13 @@ do { \ #define H5C__UPDATE_RP_FOR_EVICTION(cache_ptr, entry_ptr, fail_val) \ { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ - HDassert(!(entry_ptr)->is_protected); \ - HDassert(!(entry_ptr)->is_read_only); \ - HDassert((entry_ptr)->ro_ref_count == 0); \ - HDassert(!(entry_ptr)->is_pinned); \ - HDassert((entry_ptr)->size > 0); \ + assert(cache_ptr); \ + assert(entry_ptr); \ + assert(!(entry_ptr)->is_protected); \ + assert(!(entry_ptr)->is_read_only); \ + assert((entry_ptr)->ro_ref_count == 0); \ + assert(!(entry_ptr)->is_pinned); \ + assert((entry_ptr)->size > 0); \ \ /* Remove the entry from the LRU list */ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ @@ -1417,12 +1417,12 @@ do { \ #define H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, fail_val) \ { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ - HDassert(!(entry_ptr)->is_protected); \ - HDassert(!(entry_ptr)->is_read_only); \ - HDassert((entry_ptr)->ro_ref_count == 0); \ - HDassert((entry_ptr)->size > 0); \ + assert(cache_ptr); \ + assert(entry_ptr); \ + assert(!(entry_ptr)->is_protected); \ + assert(!(entry_ptr)->is_read_only); \ + assert((entry_ptr)->ro_ref_count == 0); \ + assert((entry_ptr)->size > 0); \ \ if(!(entry_ptr)->is_pinned) { \ /* Remove the entry from its location in the LRU list \ @@ -1462,12 +1462,12 @@ do { \ #define H5C__UPDATE_RP_FOR_INSERT_APPEND(cache_ptr, entry_ptr, fail_val) \ do { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ - HDassert(!(entry_ptr)->is_protected); \ - HDassert(!(entry_ptr)->is_read_only); \ - HDassert((entry_ptr)->ro_ref_count == 0 ); \ - HDassert((entry_ptr)->size > 0 ); \ + assert(cache_ptr); \ + assert(entry_ptr); \ + assert(!(entry_ptr)->is_protected); \ + assert(!(entry_ptr)->is_read_only); \ + assert((entry_ptr)->ro_ref_count == 0 ); \ + assert((entry_ptr)->size > 0 ); \ \ if((entry_ptr)->is_pinned) { \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ @@ -1501,12 +1501,12 @@ do { \ #define H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, fail_val) \ { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ - HDassert(!(entry_ptr)->is_protected); \ - HDassert(!(entry_ptr)->is_read_only); \ - HDassert((entry_ptr)->ro_ref_count == 0); \ - HDassert((entry_ptr)->size > 0); \ + assert(cache_ptr); \ + assert(entry_ptr); \ + assert(!(entry_ptr)->is_protected); \ + assert(!(entry_ptr)->is_read_only); \ + assert((entry_ptr)->ro_ref_count == 0); \ + assert((entry_ptr)->size > 0); \ \ if((entry_ptr)->is_pinned) { \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->pel_head_ptr, \ @@ -1546,12 +1546,12 @@ do { \ #define H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, fail_val) \ { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ - HDassert(!(entry_ptr)->is_protected); \ - HDassert(!(entry_ptr)->is_read_only); \ - HDassert((entry_ptr)->ro_ref_count == 0); \ - HDassert((entry_ptr)->size > 0); \ + assert(cache_ptr); \ + assert(entry_ptr); \ + assert(!(entry_ptr)->is_protected); \ + assert(!(entry_ptr)->is_read_only); \ + assert((entry_ptr)->ro_ref_count == 0); \ + assert((entry_ptr)->size > 0); \ \ if((entry_ptr)->is_pinned) { \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ @@ -1593,11 +1593,11 @@ do { \ #define H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, fail_val) \ do { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ - HDassert(!(entry_ptr)->is_read_only); \ - HDassert((entry_ptr)->ro_ref_count == 0); \ - HDassert((entry_ptr)->size > 0); \ + assert(cache_ptr); \ + assert(entry_ptr); \ + assert(!(entry_ptr)->is_read_only); \ + assert((entry_ptr)->ro_ref_count == 0); \ + assert((entry_ptr)->size > 0); \ \ if(!(entry_ptr)->is_pinned && !(entry_ptr)->is_protected) { \ /* Remove the entry from the LRU list, and re-insert it at the head. \ @@ -1661,13 +1661,13 @@ do { \ #define H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_size, fail_val) \ { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ - HDassert(!(entry_ptr)->is_protected); \ - HDassert(!(entry_ptr)->is_read_only); \ - HDassert((entry_ptr)->ro_ref_count == 0); \ - HDassert((entry_ptr)->size > 0 ); \ - HDassert(new_size > 0 ); \ + assert(cache_ptr); \ + assert(entry_ptr); \ + assert(!(entry_ptr)->is_protected); \ + assert(!(entry_ptr)->is_read_only); \ + assert((entry_ptr)->ro_ref_count == 0); \ + assert((entry_ptr)->size > 0 ); \ + assert(new_size > 0 ); \ \ /* Maintain the collective access list, if enabled */ \ H5C__UPDATE_RP_FOR_SIZE_CHANGE_COLL(cache_ptr, entry_ptr, new_size, fail_val) \ @@ -1708,13 +1708,13 @@ do { \ #define H5C__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, fail_val) \ { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ - HDassert(!(entry_ptr)->is_protected); \ - HDassert(!(entry_ptr)->is_read_only); \ - HDassert((entry_ptr)->ro_ref_count == 0 ); \ - HDassert((entry_ptr)->is_pinned); \ - HDassert((entry_ptr)->size > 0); \ + assert(cache_ptr); \ + assert(entry_ptr); \ + assert(!(entry_ptr)->is_protected); \ + assert(!(entry_ptr)->is_read_only); \ + assert((entry_ptr)->ro_ref_count == 0 ); \ + assert((entry_ptr)->is_pinned); \ + assert((entry_ptr)->size > 0); \ \ /* Regardless of the replacement policy, remove the entry from the \ * pinned entry list. \ @@ -1752,10 +1752,10 @@ do { \ #define H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, fail_val) \ do { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ - HDassert((entry_ptr)->is_protected); \ - HDassert((entry_ptr)->size > 0); \ + assert(cache_ptr); \ + assert(entry_ptr); \ + assert((entry_ptr)->is_protected); \ + assert((entry_ptr)->size > 0); \ \ /* Regardless of the replacement policy, remove the entry from the \ * protected list. \ @@ -1804,8 +1804,8 @@ do { \ #define H5C__INSERT_IN_COLL_LIST(cache_ptr, entry_ptr, fail_val) \ { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ + assert(cache_ptr); \ + assert(entry_ptr); \ \ /* Insert the entry at the head of the list. */ \ H5C__COLL_DLL_PREPEND((entry_ptr), (cache_ptr)->coll_head_ptr, \ @@ -1828,8 +1828,8 @@ do { \ #define H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, fail_val) \ { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ + assert(cache_ptr); \ + assert(entry_ptr); \ \ /* Remove the entry from the list. */ \ H5C__COLL_DLL_REMOVE((entry_ptr), (cache_ptr)->coll_head_ptr, \ @@ -1852,8 +1852,8 @@ do { \ #define H5C__MOVE_TO_TOP_IN_COLL_LIST(cache_ptr, entry_ptr, fail_val) \ { \ - HDassert(cache_ptr); \ - HDassert(entry_ptr); \ + assert(cache_ptr); \ + assert(entry_ptr); \ \ /* Remove entry and insert at the head of the list. */ \ H5C__COLL_DLL_REMOVE((entry_ptr), (cache_ptr)->coll_head_ptr, \ @@ -2218,7 +2218,7 @@ typedef struct H5C_tag_info_t { * Note: At this time, the this field will only be applied to * two types of entries: the superblock and the file driver info * message. The code utilizing these flags is protected with - * HDasserts to enforce this. + * asserts to enforce this. * * The cache must deal with the case in which entries may be dirtied, moved, * or have their sizes changed during a flush. To allow sanity checks in this diff --git a/src/H5Cprefetched.c b/src/H5Cprefetched.c index 5dec6ba..cca6641 100644 --- a/src/H5Cprefetched.c +++ b/src/H5Cprefetched.c @@ -217,8 +217,8 @@ H5C__prefetched_entry_notify(H5C_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(entry_ptr); - HDassert(entry_ptr->prefetched); + assert(entry_ptr); + assert(entry_ptr->prefetched); switch (action) { case H5C_NOTIFY_ACTION_AFTER_INSERT: @@ -238,10 +238,10 @@ H5C__prefetched_entry_notify(H5C_notify_action_t action, void *_thing) H5C_cache_entry_t *parent_ptr; /* Sanity checks */ - HDassert(entry_ptr->flush_dep_parent); + assert(entry_ptr->flush_dep_parent); parent_ptr = entry_ptr->flush_dep_parent[u]; - HDassert(parent_ptr); - HDassert(parent_ptr->flush_dep_nchildren > 0); + assert(parent_ptr); + assert(parent_ptr->flush_dep_nchildren > 0); /* Destroy flush dependency with flush dependency parent */ if (H5C_destroy_flush_dependency(parent_ptr, entry_ptr) < 0) @@ -254,7 +254,7 @@ H5C__prefetched_entry_notify(H5C_notify_action_t action, void *_thing) * field to reflect the destruction of the flush * dependency relationship. */ - HDassert(parent_ptr->fd_child_count > 0); + assert(parent_ptr->fd_child_count > 0); (parent_ptr->fd_child_count)--; } /* end if */ } /* end for */ @@ -293,16 +293,16 @@ H5C__prefetched_entry_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(entry_ptr); - HDassert(entry_ptr->prefetched); + assert(entry_ptr); + assert(entry_ptr->prefetched); /* Release array for flush dependency parent addresses */ if (entry_ptr->fd_parent_addrs != NULL) { - HDassert(entry_ptr->fd_parent_count > 0); + assert(entry_ptr->fd_parent_count > 0); entry_ptr->fd_parent_addrs = (haddr_t *)H5MM_xfree((void *)entry_ptr->fd_parent_addrs); } /* end if */ else - HDassert(entry_ptr->fd_parent_count == 0); + assert(entry_ptr->fd_parent_count == 0); if (entry_ptr->image_ptr != NULL) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "prefetched entry image buffer still attached?") diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 914c579..3a356d2 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -1089,7 +1089,7 @@ typedef int H5C_ring_t; * Note: At this time, the flush_me_last flag will only be applied to * two types of entries: the superblock and the file driver info * message. The code utilizing these flags is protected with - * HDasserts to enforce this. + * asserts to enforce this. * * clear_on_unprotect: Boolean flag used only in PHDF5. When H5C is used * to implement the metadata cache In the parallel case, only diff --git a/src/H5Cquery.c b/src/H5Cquery.c index c25668b..01043ee 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -194,8 +194,8 @@ H5C_get_cache_hit_rate(const H5C_t *cache_ptr, double *hit_rate_ptr) if (hit_rate_ptr == NULL) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad hit_rate_ptr on entry.") - HDassert(cache_ptr->cache_hits >= 0); - HDassert(cache_ptr->cache_accesses >= cache_ptr->cache_hits); + assert(cache_ptr->cache_hits >= 0); + assert(cache_ptr->cache_accesses >= cache_ptr->cache_hits); if (cache_ptr->cache_accesses > 0) *hit_rate_ptr = ((double)(cache_ptr->cache_hits)) / ((double)(cache_ptr->cache_accesses)); @@ -240,12 +240,12 @@ H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr != NULL); - HDassert(H5_addr_defined(addr)); - HDassert(in_cache_ptr != NULL); + assert(cache_ptr != NULL); + assert(H5_addr_defined(addr)); + assert(in_cache_ptr != NULL); if (cache_ptr == NULL) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.") @@ -335,7 +335,7 @@ H5C_get_aux_ptr(const H5C_t *cache_ptr) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(cache_ptr); + assert(cache_ptr); FUNC_LEAVE_NOAPI(cache_ptr->aux_ptr) } /* H5C_get_aux_ptr() */ @@ -365,11 +365,11 @@ H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache_ptr = f->shared->cache; - HDassert(cache_ptr); - HDassert(H5_addr_defined(addr)); + assert(cache_ptr); + assert(H5_addr_defined(addr)); /* Locate the entry at the address */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL); diff --git a/src/H5Ctag.c b/src/H5Ctag.c index 2556cd0..f8727b2 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -125,7 +125,7 @@ H5C_ignore_tags(H5C_t *cache) FUNC_ENTER_NOAPI_NOERR /* Assertions */ - HDassert(cache != NULL); + assert(cache != NULL); /* Set variable to ignore tag values upon assignment */ cache->ignore_tags = TRUE; @@ -151,7 +151,7 @@ H5C_get_ignore_tags(const H5C_t *cache) FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(cache); + assert(cache); /* Return ignore tag value */ FUNC_LEAVE_NOAPI(cache->ignore_tags) @@ -174,7 +174,7 @@ H5C_get_num_objs_corked(const H5C_t *cache) FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(cache); + assert(cache); /* Return value for num_objs_corked */ FUNC_LEAVE_NOAPI(cache->num_objs_corked) @@ -205,8 +205,8 @@ H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry) FUNC_ENTER_PACKAGE /* Assertions */ - HDassert(cache != NULL); - HDassert(entry != NULL); + assert(cache != NULL); + assert(entry != NULL); /* Get the tag */ tag = H5CX_get_tag(); @@ -246,12 +246,12 @@ H5C__tag_entry(H5C_t *cache, H5C_cache_entry_t *entry) HASH_ADD(hh, cache->tag_list, tag, sizeof(haddr_t), tag_info); } else - HDassert(tag_info->corked || (tag_info->entry_cnt > 0 && tag_info->head)); + assert(tag_info->corked || (tag_info->entry_cnt > 0 && tag_info->head)); /* Sanity check entry, to avoid double insertions, etc */ - HDassert(entry->tl_next == NULL); - HDassert(entry->tl_prev == NULL); - HDassert(entry->tag_info == NULL); + assert(entry->tl_next == NULL); + assert(entry->tl_prev == NULL); + assert(entry->tag_info == NULL); /* Add the entry to the list for the tagged object */ entry->tl_next = tag_info->head; @@ -287,8 +287,8 @@ H5C__untag_entry(H5C_t *cache, H5C_cache_entry_t *entry) FUNC_ENTER_PACKAGE_NOERR /* Assertions */ - HDassert(cache != NULL); - HDassert(entry != NULL); + assert(cache != NULL); + assert(entry != NULL); /* Get the entry's tag info struct */ if (NULL != (tag_info = entry->tag_info)) { @@ -309,14 +309,14 @@ H5C__untag_entry(H5C_t *cache, H5C_cache_entry_t *entry) /* Remove the tag info from the tag list, if there's no more entries with this tag */ if (!tag_info->corked && 0 == tag_info->entry_cnt) { /* Sanity check */ - HDassert(NULL == tag_info->head); + assert(NULL == tag_info->head); /* Release the tag info */ HASH_DELETE(hh, cache->tag_list, tag_info); tag_info = H5FL_FREE(H5C_tag_info_t, tag_info); } else - HDassert(tag_info->corked || NULL != tag_info->head); + assert(tag_info->corked || NULL != tag_info->head); } FUNC_LEAVE_NOAPI(ret_value) @@ -344,7 +344,7 @@ H5C__iter_tagged_entries_real(H5C_t *cache, haddr_t tag, H5C_tag_iter_cb_t cb, v FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache != NULL); + assert(cache != NULL); /* Search the list of tagged object addresses in the cache */ HASH_FIND(hh, cache->tag_list, &tag, sizeof(haddr_t), tag_info); @@ -355,8 +355,8 @@ H5C__iter_tagged_entries_real(H5C_t *cache, haddr_t tag, H5C_tag_iter_cb_t cb, v H5C_cache_entry_t *next_entry; /* Pointer to next entry in hash bucket chain */ /* Sanity check */ - HDassert(tag_info->head); - HDassert(tag_info->entry_cnt > 0); + assert(tag_info->head); + assert(tag_info->entry_cnt > 0); /* Iterate over the entries for this tag */ entry = tag_info->head; @@ -398,7 +398,7 @@ H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, H5C_ta FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cache != NULL); + assert(cache != NULL); /* Iterate over the entries for this tag */ if (H5C__iter_tagged_entries_real(cache, tag, cb, cb_ctx) < 0) @@ -441,8 +441,8 @@ H5C__evict_tagged_entries_cb(H5C_cache_entry_t *entry, void *_ctx) FUNC_ENTER_PACKAGE /* Santify checks */ - HDassert(entry); - HDassert(ctx); + assert(entry); + assert(ctx); /* Attempt to evict entry */ if (entry->is_protected) @@ -492,10 +492,10 @@ H5C_evict_tagged_entries(H5F_t *f, haddr_t tag, hbool_t match_global) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache = f->shared->cache; /* Get cache pointer */ - HDassert(cache != NULL); + assert(cache != NULL); /* Construct context for iterator callbacks */ ctx.f = f; @@ -565,7 +565,7 @@ H5C__mark_tagged_entries_cb(H5C_cache_entry_t *entry, void H5_ATTR_UNUSED *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(entry); + assert(entry); /* We only want to set the flush marker on entries that * actually need flushed (i.e., dirty ones) */ @@ -597,7 +597,7 @@ H5C__mark_tagged_entries(H5C_t *cache, haddr_t tag) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(cache); + assert(cache); /* Iterate through hash table entries, marking those with specified tag, as * well as any major global entries which should always be flushed @@ -629,7 +629,7 @@ H5C__flush_marked_entries(H5F_t *f) FUNC_ENTER_PACKAGE /* Assertions */ - HDassert(f != NULL); + assert(f != NULL); /* Enable the slist, as it is needed in the flush */ if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) @@ -744,8 +744,8 @@ H5C_flush_tagged_entries(H5F_t *f, haddr_t tag) FUNC_ENTER_NOAPI(FAIL) /* Assertions */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Get cache pointer */ cache = f->shared->cache; @@ -785,7 +785,7 @@ H5C_retag_entries(H5C_t *cache, haddr_t src_tag, haddr_t dest_tag) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(cache); + assert(cache); /* Remove tag info from tag list */ HASH_FIND(hh, cache->tag_list, &src_tag, sizeof(haddr_t), tag_info); @@ -826,8 +826,8 @@ H5C__expunge_tag_type_metadata_cb(H5C_cache_entry_t *entry, void *_ctx) FUNC_ENTER_PACKAGE /* Santify checks */ - HDassert(entry); - HDassert(ctx); + assert(entry); + assert(ctx); /* Found one with the same tag and type id */ if (entry->type->id == ctx->type_id) @@ -862,10 +862,10 @@ H5C_expunge_tag_type_metadata(H5F_t *f, haddr_t tag, int type_id, unsigned flags FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); cache = f->shared->cache; /* Get cache pointer */ - HDassert(cache != NULL); + assert(cache != NULL); /* Construct context for iterator callbacks */ ctx.f = f; @@ -899,9 +899,9 @@ H5C_get_tag(const void *thing, haddr_t *tag) FUNC_ENTER_NOAPI_NOERR - HDassert(entry); - HDassert(entry->tag_info); - HDassert(tag); + assert(entry); + assert(entry->tag_info); + assert(tag); /* Return the tag */ *tag = entry->tag_info->tag; diff --git a/src/H5Ctest.c b/src/H5Ctest.c index 6097e25..d0be0f9 100644 --- a/src/H5Ctest.c +++ b/src/H5Ctest.c @@ -93,8 +93,8 @@ H5C__verify_cork_tag_test_cb(H5C_cache_entry_t *entry, void *_ctx) FUNC_ENTER_PACKAGE /* Santify checks */ - HDassert(entry); - HDassert(ctx); + assert(entry); + assert(ctx); /* Retrieve corked status for entry */ is_corked = entry->tag_info ? entry->tag_info->corked : FALSE; diff --git a/src/H5D.c b/src/H5D.c index 29cf289..1792d22 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -1756,14 +1756,14 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf if (0 == (nelmts_gathered = H5D__gather_mem(src_buf, iter, MIN(dst_buf_nelmts, (size_t)nelmts), dst_buf))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "gather failed") - HDassert(nelmts_gathered == MIN(dst_buf_nelmts, (size_t)nelmts)); + assert(nelmts_gathered == MIN(dst_buf_nelmts, (size_t)nelmts)); /* Make callback to process dst_buf */ if (op && op(dst_buf, nelmts_gathered * type_size, op_data) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CALLBACK, FAIL, "callback operator returned failure") nelmts -= (hssize_t)nelmts_gathered; - HDassert(op || (nelmts == 0)); + assert(op || (nelmts == 0)); } /* end while */ done: diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index a1eb7ca..a8af152 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -203,10 +203,10 @@ H5D__btree_get_shared(const H5F_t H5_ATTR_UNUSED *f, const void *_udata) FUNC_ENTER_PACKAGE_NOERR - HDassert(udata); - HDassert(udata->storage); - HDassert(udata->storage->idx_type == H5D_CHUNK_IDX_BTREE); - HDassert(udata->storage->u.btree.shared); + assert(udata); + assert(udata->storage); + assert(udata->storage->idx_type == H5D_CHUNK_IDX_BTREE); + assert(udata->storage->u.btree.shared); /* Return the pointer to the ref-count object */ FUNC_LEAVE_NOAPI(udata->storage->u.btree.shared) @@ -243,16 +243,16 @@ H5D__btree_new_node(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5B_ins_t op, void *_lt_key, FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(lt_key); - HDassert(rt_key); - HDassert(udata); - HDassert(udata->common.layout->ndims > 0 && udata->common.layout->ndims < H5O_LAYOUT_NDIMS); - HDassert(addr_p); + assert(f); + assert(lt_key); + assert(rt_key); + assert(udata); + assert(udata->common.layout->ndims > 0 && udata->common.layout->ndims < H5O_LAYOUT_NDIMS); + assert(addr_p); /* Set address */ - HDassert(H5_addr_defined(udata->chunk_block.offset)); - HDassert(udata->chunk_block.length > 0); + assert(H5_addr_defined(udata->chunk_block.offset)); + assert(udata->chunk_block.length > 0); *addr_p = udata->chunk_block.offset; /* @@ -272,7 +272,7 @@ H5D__btree_new_node(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5B_ins_t op, void *_lt_key, rt_key->nbytes = 0; rt_key->filter_mask = 0; for (u = 0; u < udata->common.layout->ndims; u++) { - HDassert(udata->common.scaled[u] + 1 > udata->common.scaled[u]); + assert(udata->common.scaled[u] + 1 > udata->common.scaled[u]); rt_key->scaled[u] = udata->common.scaled[u] + 1; } /* end if */ } /* end if */ @@ -309,10 +309,10 @@ H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) FUNC_ENTER_PACKAGE_NOERR - HDassert(lt_key); - HDassert(rt_key); - HDassert(udata); - HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); + assert(lt_key); + assert(rt_key); + assert(udata); + assert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); /* Compare the offsets but ignore the other fields */ ret_value = H5VM_vector_cmp_u(udata->layout->ndims, lt_key->scaled, rt_key->scaled); @@ -357,10 +357,10 @@ H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) FUNC_ENTER_PACKAGE_NOERR - HDassert(lt_key); - HDassert(rt_key); - HDassert(udata); - HDassert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); + assert(lt_key); + assert(rt_key); + assert(udata); + assert(udata->layout->ndims > 0 && udata->layout->ndims <= H5O_LAYOUT_NDIMS); /* Special case for faster checks on 1-D chunks */ /* (Checking for ndims==2 because last dimension is the datatype size) */ @@ -422,11 +422,11 @@ H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, haddr_t addr, const void *_lt_key, hbo FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(lt_key); - HDassert(found); - HDassert(udata); + assert(f); + assert(H5_addr_defined(addr)); + assert(lt_key); + assert(found); + assert(udata); /* Is this *really* the requested chunk? */ for (u = 0; u < udata->common.layout->ndims; u++) @@ -436,7 +436,7 @@ H5D__btree_found(H5F_t H5_ATTR_UNUSED *f, haddr_t addr, const void *_lt_key, hbo } /* Initialize return values */ - HDassert(lt_key->nbytes > 0); + assert(lt_key->nbytes > 0); udata->chunk_block.offset = addr; udata->chunk_block.length = lt_key->nbytes; udata->filter_mask = lt_key->filter_mask; @@ -470,9 +470,9 @@ H5D__chunk_disjoint(unsigned n, const hsize_t *scaled1, const hsize_t *scaled2) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(n); - HDassert(scaled1); - HDassert(scaled2); + assert(n); + assert(scaled1); + assert(scaled2); /* Loop over two chunks, detecting disjointness and getting out quickly */ for (u = 0; u < n; u++) @@ -527,17 +527,17 @@ H5D__btree_insert(H5F_t H5_ATTR_NDEBUG_UNUSED *f, haddr_t H5_ATTR_NDEBUG_UNUSED FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(lt_key); - HDassert(lt_key_changed); - HDassert(md_key); - HDassert(udata); - HDassert(rt_key); - HDassert(new_node_p); + assert(f); + assert(H5_addr_defined(addr)); + assert(lt_key); + assert(lt_key_changed); + assert(md_key); + assert(udata); + assert(rt_key); + assert(new_node_p); cmp = H5D__btree_cmp3(lt_key, udata, rt_key); - HDassert(cmp <= 0); + assert(cmp <= 0); if (cmp < 0) { /* Negative indices not supported yet */ @@ -551,7 +551,7 @@ H5D__btree_insert(H5F_t H5_ATTR_NDEBUG_UNUSED *f, haddr_t H5_ATTR_NDEBUG_UNUSED */ if (lt_key->nbytes != udata->chunk_block.length) { /* Set node's address (already re-allocated by main chunk routines) */ - HDassert(H5_addr_defined(udata->chunk_block.offset)); + assert(H5_addr_defined(udata->chunk_block.offset)); *new_node_p = udata->chunk_block.offset; H5_CHECKED_ASSIGN(lt_key->nbytes, uint32_t, udata->chunk_block.length, hsize_t); lt_key->filter_mask = udata->filter_mask; @@ -560,12 +560,12 @@ H5D__btree_insert(H5F_t H5_ATTR_NDEBUG_UNUSED *f, haddr_t H5_ATTR_NDEBUG_UNUSED } else { /* Already have address in udata, from main chunk routines */ - HDassert(H5_addr_defined(udata->chunk_block.offset)); + assert(H5_addr_defined(udata->chunk_block.offset)); ret_value = H5B_INS_NOOP; } } else if (H5D__chunk_disjoint(udata->common.layout->ndims, lt_key->scaled, udata->common.scaled)) { - HDassert(H5D__chunk_disjoint(udata->common.layout->ndims, rt_key->scaled, udata->common.scaled)); + assert(H5D__chunk_disjoint(udata->common.layout->ndims, rt_key->scaled, udata->common.scaled)); /* * Split this node, inserting the new new node to the right of the * current node. The MD_KEY is where the split occurs. @@ -575,7 +575,7 @@ H5D__btree_insert(H5F_t H5_ATTR_NDEBUG_UNUSED *f, haddr_t H5_ATTR_NDEBUG_UNUSED for (u = 0; u < udata->common.layout->ndims; u++) md_key->scaled[u] = udata->common.scaled[u]; - HDassert(H5_addr_defined(udata->chunk_block.offset)); + assert(H5_addr_defined(udata->chunk_block.offset)); *new_node_p = udata->chunk_block.offset; ret_value = H5B_INS_RIGHT; } @@ -640,11 +640,11 @@ H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key FUNC_ENTER_PACKAGE - HDassert(shared); - HDassert(raw); - HDassert(key); + assert(shared); + assert(raw); + assert(key); layout = (const H5O_layout_chunk_t *)shared->udata; - HDassert(layout); + assert(layout); if (layout->ndims > H5O_LAYOUT_NDIMS) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "bad number of dimensions") @@ -691,12 +691,12 @@ H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(shared); - HDassert(raw); - HDassert(key); + assert(shared); + assert(raw); + assert(key); layout = (const H5O_layout_chunk_t *)shared->udata; - HDassert(layout); - HDassert(layout->ndims > 0 && layout->ndims <= H5O_LAYOUT_NDIMS); + assert(layout); + assert(layout->ndims > 0 && layout->ndims <= H5O_LAYOUT_NDIMS); /* encode */ UINT32ENCODE(raw, key->nbytes); @@ -731,7 +731,7 @@ H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, con FUNC_ENTER_PACKAGE_NOERR - HDassert(key); + assert(key); HDfprintf(stream, "%*s%-*s %u bytes\n", indent, "", fwidth, "Chunk size:", (unsigned)key->nbytes); HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth, "Filter mask:", key->filter_mask); @@ -844,12 +844,12 @@ H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t H5_ATTR_UNUS FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(dset_ohdr_addr)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(dset_ohdr_addr)); idx_info->storage->u.btree.dset_ohdr_addr = dset_ohdr_addr; @@ -888,12 +888,12 @@ H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(!H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(!H5_addr_defined(idx_info->storage->idx_addr)); /* Initialize "user" data for B-tree callbacks, etc. */ udata.layout = idx_info->layout; @@ -925,7 +925,7 @@ H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) } /* end H5D__btree_idx_is_space_alloc() */ @@ -950,13 +950,13 @@ H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, FUNC_ENTER_PACKAGE - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* * Create the chunk it if it doesn't exist, or reallocate the chunk if @@ -991,14 +991,14 @@ H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udat FUNC_ENTER_PACKAGE - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->layout->ndims > 0); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->layout->ndims > 0); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Go get the chunk information from the B-tree */ found = FALSE; @@ -1075,14 +1075,14 @@ H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t c FUNC_ENTER_PACKAGE_NOERR - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(chunk_cb); - HDassert(chunk_udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(chunk_cb); + assert(chunk_udata); /* Initialize userdata */ HDmemset(&udata, 0, sizeof udata); @@ -1118,13 +1118,13 @@ H5D__btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t FUNC_ENTER_PACKAGE - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Remove the chunk from the v1 B-tree index and release the space for the * chunk (in the B-tree callback). @@ -1158,11 +1158,11 @@ H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); /* Check if the index data structure has been allocated */ if (H5_addr_defined(idx_info->storage->idx_addr)) { @@ -1215,17 +1215,17 @@ H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_ FUNC_ENTER_PACKAGE_TAG(H5AC__COPIED_TAG) - HDassert(idx_info_src); - HDassert(idx_info_src->f); - HDassert(idx_info_src->pline); - HDassert(idx_info_src->layout); - HDassert(idx_info_src->storage); - HDassert(idx_info_dst); - HDassert(idx_info_dst->f); - HDassert(idx_info_dst->pline); - HDassert(idx_info_dst->layout); - HDassert(idx_info_dst->storage); - HDassert(!H5_addr_defined(idx_info_dst->storage->idx_addr)); + assert(idx_info_src); + assert(idx_info_src->f); + assert(idx_info_src->pline); + assert(idx_info_src->layout); + assert(idx_info_src->storage); + assert(idx_info_dst); + assert(idx_info_dst->f); + assert(idx_info_dst->pline); + assert(idx_info_dst->layout); + assert(idx_info_dst->storage); + assert(!H5_addr_defined(idx_info_dst->storage->idx_addr)); /* Create shared B-tree info for each file */ if (H5D__btree_shared_create(idx_info_src->f, idx_info_src->storage, idx_info_src->layout) < 0) @@ -1237,7 +1237,7 @@ H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_ /* Create the root of the B-tree that describes chunked storage in the dest. file */ if (H5D__btree_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") - HDassert(H5_addr_defined(idx_info_dst->storage->idx_addr)); + assert(H5_addr_defined(idx_info_dst->storage->idx_addr)); done: FUNC_LEAVE_NOAPI_TAG(ret_value) @@ -1262,8 +1262,8 @@ H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chunk FUNC_ENTER_PACKAGE - HDassert(storage_src); - HDassert(storage_dst); + assert(storage_src); + assert(storage_dst); /* Decrement refcount on shared B-tree info */ if (H5UC_DEC(storage_src->u.btree.shared) < 0) @@ -1298,12 +1298,12 @@ H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(index_size); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(index_size); /* Initialize B-tree node user-data */ HDmemset(&udata, 0, sizeof udata); @@ -1338,7 +1338,7 @@ H5D__btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) { FUNC_ENTER_PACKAGE_NOERR - HDassert(storage); + assert(storage); /* Reset index info */ if (reset_addr) @@ -1365,8 +1365,8 @@ H5D__btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) { FUNC_ENTER_PACKAGE_NOERR - HDassert(storage); - HDassert(stream); + assert(storage); + assert(stream); HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); @@ -1392,11 +1392,11 @@ H5D__btree_idx_dest(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); /* Free the raw B-tree node buffer */ if (NULL == idx_info->storage->u.btree.shared) diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index 135c564..69c6629 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -221,9 +221,9 @@ H5D__bt2_crt_context(void *_udata) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(udata); - HDassert(udata->f); - HDassert(udata->ndims > 0 && udata->ndims < H5O_LAYOUT_NDIMS); + assert(udata); + assert(udata->f); + assert(udata->ndims > 0 && udata->ndims < H5O_LAYOUT_NDIMS); /* Allocate callback context */ if (NULL == (ctx = H5FL_MALLOC(H5D_bt2_ctx_t))) @@ -275,7 +275,7 @@ H5D__bt2_dst_context(void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Free array for chunk dimension sizes */ if (ctx->dim) @@ -336,8 +336,8 @@ H5D__bt2_compare(const void *_udata, const void *_rec2, int *result) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(rec1); - HDassert(rec2); + assert(rec1); + assert(rec2); /* Compare the offsets but ignore the other fields */ *result = H5VM_vector_cmp_u(udata->ndims, rec1->scaled, rec2->scaled); @@ -368,7 +368,7 @@ H5D__bt2_unfilt_encode(uint8_t *raw, const void *_record, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Encode the record's fields */ H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->chunk_addr); @@ -402,7 +402,7 @@ H5D__bt2_unfilt_decode(const uint8_t *raw, void *_record, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Decode the record's fields */ H5F_addr_decode_len(ctx->sizeof_addr, &raw, &record->chunk_addr); @@ -436,9 +436,9 @@ H5D__bt2_unfilt_debug(FILE *stream, int indent, int fwidth, const void *_record, FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(record); - HDassert(ctx->chunk_size == record->nbytes); - HDassert(0 == record->filter_mask); + assert(record); + assert(ctx->chunk_size == record->nbytes); + assert(0 == record->filter_mask); HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Chunk address:", record->chunk_addr); @@ -473,10 +473,10 @@ H5D__bt2_filt_encode(uint8_t *raw, const void *_record, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); - HDassert(record); - HDassert(H5_addr_defined(record->chunk_addr)); - HDassert(0 != record->nbytes); + assert(ctx); + assert(record); + assert(H5_addr_defined(record->chunk_addr)); + assert(0 != record->nbytes); /* Encode the record's fields */ H5F_addr_encode_len(ctx->sizeof_addr, &raw, record->chunk_addr); @@ -511,8 +511,8 @@ H5D__bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); - HDassert(record); + assert(ctx); + assert(record); /* Decode the record's fields */ H5F_addr_decode_len(ctx->sizeof_addr, &raw, &record->chunk_addr); @@ -522,8 +522,8 @@ H5D__bt2_filt_decode(const uint8_t *raw, void *_record, void *_ctx) UINT64DECODE(raw, record->scaled[u]); /* Sanity checks */ - HDassert(H5_addr_defined(record->chunk_addr)); - HDassert(0 != record->nbytes); + assert(H5_addr_defined(record->chunk_addr)); + assert(0 != record->nbytes); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5D__bt2_filt_decode() */ @@ -550,9 +550,9 @@ H5D__bt2_filt_debug(FILE *stream, int indent, int fwidth, const void *_record, c FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(record); - HDassert(H5_addr_defined(record->chunk_addr)); - HDassert(0 != record->nbytes); + assert(record); + assert(H5_addr_defined(record->chunk_addr)); + assert(0 != record->nbytes); HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Chunk address:", record->chunk_addr); HDfprintf(stream, "%*s%-*s %u bytes\n", indent, "", fwidth, "Chunk size:", (unsigned)record->nbytes); @@ -585,7 +585,7 @@ H5D__bt2_idx_init(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info, const H5S_t FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(H5_addr_defined(dset_ohdr_addr)); + assert(H5_addr_defined(dset_ohdr_addr)); idx_info->storage->u.btree2.dset_ohdr_addr = dset_ohdr_addr; @@ -617,16 +617,16 @@ H5D__btree2_idx_depend(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(H5D_CHUNK_IDX_BT2 == idx_info->layout->idx_type); - HDassert(idx_info->storage); - HDassert(H5D_CHUNK_IDX_BT2 == idx_info->storage->idx_type); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(idx_info->storage->u.btree2.bt2); + assert(idx_info); + assert(idx_info->f); + assert(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE); + assert(idx_info->pline); + assert(idx_info->layout); + assert(H5D_CHUNK_IDX_BT2 == idx_info->layout->idx_type); + assert(idx_info->storage); + assert(H5D_CHUNK_IDX_BT2 == idx_info->storage->idx_type); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info->storage->u.btree2.bt2); /* Set up object header location for dataset */ H5O_loc_reset(&oloc); @@ -680,14 +680,14 @@ H5D__bt2_idx_open(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(H5D_CHUNK_IDX_BT2 == idx_info->layout->idx_type); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(NULL == idx_info->storage->u.btree2.bt2); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(H5D_CHUNK_IDX_BT2 == idx_info->layout->idx_type); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(NULL == idx_info->storage->u.btree2.bt2); /* Set up the user data */ u_ctx.f = idx_info->f; @@ -731,12 +731,12 @@ H5D__bt2_idx_create(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(!H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(!H5_addr_defined(idx_info->storage->idx_addr)); bt2_cparam.rrec_size = H5F_SIZEOF_ADDR(idx_info->f) /* Address of chunk */ + (idx_info->layout->ndims - 1) * 8; /* # of dimensions x 64-bit chunk offsets */ @@ -804,7 +804,7 @@ H5D__bt2_idx_is_space_alloc(const H5O_storage_chunk_t *storage) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) } /* end H5D__bt2_idx_is_space_alloc() */ @@ -837,7 +837,7 @@ H5D__bt2_mod_cb(void *_record, void *_op_data, hbool_t *changed) unsigned u; /* Local index variable */ for (u = 0; u < op_data->ndims; u++) - HDassert(record->scaled[u] == op_data->rec.scaled[u]); + assert(record->scaled[u] == op_data->rec.scaled[u]); } #endif /* NDEBUG */ @@ -880,14 +880,14 @@ H5D__bt2_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); - HDassert(H5_addr_defined(udata->chunk_block.offset)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); + assert(H5_addr_defined(udata->chunk_block.offset)); /* Check if the v2 B-tree is open yet */ if (NULL == idx_info->storage->u.btree2.bt2) { @@ -974,14 +974,14 @@ H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->layout->ndims > 0); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->layout->ndims > 0); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Check if the v2 B-tree is open yet */ if (NULL == idx_info->storage->u.btree2.bt2) { @@ -1017,7 +1017,7 @@ H5D__bt2_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) /* Check if chunk was found */ if (found) { /* Sanity check */ - HDassert(0 != found_rec.nbytes); + assert(0 != found_rec.nbytes); /* Set common info for the chunk */ udata->chunk_block.offset = found_rec.chunk_addr; @@ -1096,14 +1096,14 @@ H5D__bt2_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chu FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(chunk_cb); - HDassert(chunk_udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(chunk_cb); + assert(chunk_udata); /* Check if the v2 B-tree is open yet */ if (NULL == idx_info->storage->u.btree2.bt2) { @@ -1155,7 +1155,7 @@ H5D__bt2_remove_cb(const void *_record, void *_udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); + assert(f); /* Free the space in the file for the object being removed */ H5_CHECK_OVERFLOW(record->nbytes, uint32_t, hsize_t); @@ -1188,13 +1188,13 @@ H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *u FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Check if the v2 B-tree is open yet */ if (NULL == idx_info->storage->u.btree2.bt2) { @@ -1250,11 +1250,11 @@ H5D__bt2_idx_delete(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); /* Check if the index data structure has been allocated */ if (H5_addr_defined(idx_info->storage->idx_addr)) { @@ -1301,19 +1301,19 @@ H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_id FUNC_ENTER_PACKAGE /* Source file */ - HDassert(idx_info_src); - HDassert(idx_info_src->f); - HDassert(idx_info_src->pline); - HDassert(idx_info_src->layout); - HDassert(idx_info_src->storage); + assert(idx_info_src); + assert(idx_info_src->f); + assert(idx_info_src->pline); + assert(idx_info_src->layout); + assert(idx_info_src->storage); /* Destination file */ - HDassert(idx_info_dst); - HDassert(idx_info_dst->f); - HDassert(idx_info_dst->pline); - HDassert(idx_info_dst->layout); - HDassert(idx_info_dst->storage); - HDassert(!H5_addr_defined(idx_info_dst->storage->idx_addr)); + assert(idx_info_dst); + assert(idx_info_dst->f); + assert(idx_info_dst->pline); + assert(idx_info_dst->layout); + assert(idx_info_dst->storage); + assert(!H5_addr_defined(idx_info_dst->storage->idx_addr)); /* Check if the source v2 B-tree is open yet */ if (NULL == idx_info_src->storage->u.btree2.bt2) @@ -1326,7 +1326,7 @@ H5D__bt2_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_id /* Create v2 B-tree that describes the chunked dataset in the destination file */ if (H5D__bt2_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") - HDassert(H5_addr_defined(idx_info_dst->storage->idx_addr)); + assert(H5_addr_defined(idx_info_dst->storage->idx_addr)); /* Reset metadata tag */ H5_END_TAG @@ -1354,10 +1354,10 @@ H5D__bt2_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chunk_t FUNC_ENTER_PACKAGE /* Check args */ - HDassert(storage_src); - HDassert(storage_src->u.btree2.bt2); - HDassert(storage_dst); - HDassert(storage_dst->u.btree2.bt2); + assert(storage_src); + assert(storage_src->u.btree2.bt2); + assert(storage_dst); + assert(storage_dst->u.btree2.bt2); /* Close v2 B-tree for source file */ if (H5B2_close(storage_src->u.btree2.bt2) < 0) @@ -1394,13 +1394,13 @@ H5D__bt2_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(index_size); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(index_size); /* Open v2 B-tree */ if (H5D__bt2_idx_open(idx_info) < 0) @@ -1439,7 +1439,7 @@ H5D__bt2_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(storage); + assert(storage); /* Reset index info */ if (reset_addr) @@ -1466,8 +1466,8 @@ H5D__bt2_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(storage); - HDassert(stream); + assert(storage); + assert(stream); HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); @@ -1493,9 +1493,9 @@ H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->storage); /* Check if the v2-btree is open */ if (idx_info->storage->u.btree2.bt2) { diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 2f86d8e..c40d1d6 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -80,12 +80,12 @@ /* Sanity check on chunk index types: commonly used by a lot of routines in this file */ #define H5D_CHUNK_STORAGE_INDEX_CHK(storage) \ do { \ - HDassert((H5D_CHUNK_IDX_EARRAY == (storage)->idx_type && H5D_COPS_EARRAY == (storage)->ops) || \ - (H5D_CHUNK_IDX_FARRAY == (storage)->idx_type && H5D_COPS_FARRAY == (storage)->ops) || \ - (H5D_CHUNK_IDX_BT2 == (storage)->idx_type && H5D_COPS_BT2 == (storage)->ops) || \ - (H5D_CHUNK_IDX_BTREE == (storage)->idx_type && H5D_COPS_BTREE == (storage)->ops) || \ - (H5D_CHUNK_IDX_SINGLE == (storage)->idx_type && H5D_COPS_SINGLE == (storage)->ops) || \ - (H5D_CHUNK_IDX_NONE == (storage)->idx_type && H5D_COPS_NONE == (storage)->ops)); \ + assert((H5D_CHUNK_IDX_EARRAY == (storage)->idx_type && H5D_COPS_EARRAY == (storage)->ops) || \ + (H5D_CHUNK_IDX_FARRAY == (storage)->idx_type && H5D_COPS_FARRAY == (storage)->ops) || \ + (H5D_CHUNK_IDX_BT2 == (storage)->idx_type && H5D_COPS_BT2 == (storage)->ops) || \ + (H5D_CHUNK_IDX_BTREE == (storage)->idx_type && H5D_COPS_BTREE == (storage)->ops) || \ + (H5D_CHUNK_IDX_SINGLE == (storage)->idx_type && H5D_COPS_SINGLE == (storage)->ops) || \ + (H5D_CHUNK_IDX_NONE == (storage)->idx_type && H5D_COPS_NONE == (storage)->ops)); \ } while (0) /* * Feature: If this constant is defined then every cache preemption and load @@ -393,7 +393,7 @@ H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Sanity checks */ - HDassert(layout->type == H5D_CHUNKED); + assert(layout->type == H5D_CHUNKED); /* Allocate dataspace and initialize it if it hasn't been. */ if (!H5D__chunk_is_space_alloc(&layout->storage)) @@ -409,8 +409,8 @@ H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ - HDassert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || - (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); + assert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); /* Set the file block information for the old chunk */ /* (Which is only defined when overwriting an existing chunk) */ @@ -499,10 +499,10 @@ H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t *filters, vo FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Check args */ - HDassert(dset && H5D_CHUNKED == layout->type); - HDassert(offset); - HDassert(filters); - HDassert(buf); + assert(dset && H5D_CHUNKED == layout->type); + assert(offset); + assert(filters); + assert(buf); *filters = 0; @@ -525,8 +525,8 @@ H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t *filters, vo HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ - HDassert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || - (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); + assert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); /* Check if the requested chunk exists in the chunk cache */ if (UINT_MAX != udata.idx_hint) { @@ -534,8 +534,8 @@ H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t *filters, vo hbool_t flush; /* Sanity checks */ - HDassert(udata.idx_hint < rdcc->nslots); - HDassert(rdcc->slot[udata.idx_hint]); + assert(udata.idx_hint < rdcc->nslots); + assert(rdcc->slot[udata.idx_hint]); flush = (ent->dirty == TRUE) ? TRUE : FALSE; @@ -594,9 +594,9 @@ H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Check args */ - HDassert(dset && H5D_CHUNKED == layout->type); - HDassert(offset); - HDassert(storage_size); + assert(dset && H5D_CHUNKED == layout->type); + assert(offset); + assert(storage_size); /* Allocate dataspace and initialize it if it hasn't been. */ if (!(*layout->ops->is_space_alloc)(&layout->storage)) @@ -616,8 +616,8 @@ H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ - HDassert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || - (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); + assert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); /* The requested chunk is not in cache or on disk */ if (!H5_addr_defined(udata.chunk_block.offset) && UINT_MAX == udata.idx_hint) @@ -630,8 +630,8 @@ H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage H5D_rdcc_ent_t *ent = rdcc->slot[udata.idx_hint]; /* Sanity checks */ - HDassert(udata.idx_hint < rdcc->nslots); - HDassert(rdcc->slot[udata.idx_hint]); + assert(udata.idx_hint < rdcc->nslots); + assert(rdcc->slot[udata.idx_hint]); /* If the cached chunk is dirty, it must be flushed to get accurate size */ if (ent->dirty == TRUE) { @@ -681,8 +681,8 @@ H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize FUNC_ENTER_PACKAGE - HDassert(layout); - HDassert(curr_dims); + assert(layout); + assert(curr_dims); /* Can happen when corrupt files are parsed */ if (ndims == 0) @@ -737,7 +737,7 @@ H5D__chunk_set_info(const H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dset); + assert(dset); /* Set the base layout information */ if (H5D__chunk_set_info_real(&dset->shared->layout.u.chunk, dset->shared->ndims, dset->shared->curr_dims, @@ -776,7 +776,7 @@ H5D__chunk_set_sizes(H5D_t *dset) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(dset); + assert(dset); /* Increment # of chunk dimensions, to account for datatype size as last element */ dset->shared->layout.u.chunk.ndims++; @@ -797,7 +797,7 @@ H5D__chunk_set_sizes(H5D_t *dset) if (enc_bytes_per_dim > max_enc_bytes_per_dim) max_enc_bytes_per_dim = enc_bytes_per_dim; } /* end for */ - HDassert(max_enc_bytes_per_dim > 0 && max_enc_bytes_per_dim <= 8); + assert(max_enc_bytes_per_dim > 0 && max_enc_bytes_per_dim <= 8); dset->shared->layout.u.chunk.enc_bytes_per_dim = max_enc_bytes_per_dim; /* Compute and store the total size of a chunk */ @@ -838,8 +838,8 @@ H5D__chunk_construct(H5F_t H5_ATTR_UNUSED *f, H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(dset); + assert(f); + assert(dset); /* Check for invalid chunk dimension rank */ if (0 == dset->shared->layout.u.chunk.ndims) @@ -850,7 +850,7 @@ H5D__chunk_construct(H5F_t H5_ATTR_UNUSED *f, H5D_t *dset) /* Set chunk sizes */ if (H5D__chunk_set_sizes(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "unable to set chunk sizes") - HDassert((unsigned)(dset->shared->layout.u.chunk.ndims) <= NELMTS(dset->shared->layout.u.chunk.dim)); + assert((unsigned)(dset->shared->layout.u.chunk.ndims) <= NELMTS(dset->shared->layout.u.chunk.dim)); /* Chunked storage is not compatible with external storage (currently) */ if (dset->shared->dcpl_cache.efl.nused > 0) @@ -906,8 +906,8 @@ H5D__chunk_init(H5F_t *f, const H5D_t *const dset, hid_t dapl_id) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(dset); + assert(f); + assert(dset); H5D_CHUNK_STORAGE_INDEX_CHK(sc); if (NULL == (dapl = (H5P_genplist_t *)H5I_object(dapl_id))) @@ -1006,7 +1006,7 @@ H5D__chunk_is_space_alloc(const H5O_storage_t *storage) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(storage); + assert(storage); H5D_CHUNK_STORAGE_INDEX_CHK(sc); /* Query index layer */ @@ -1033,7 +1033,7 @@ H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(shared_dset); + assert(shared_dset); FUNC_LEAVE_NOAPI(shared_dset->cache.chunk.nused > 0) } /* end H5D__chunk_is_data_cached() */ @@ -1170,12 +1170,12 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) FUNC_ENTER_PACKAGE - HDassert(io_info); - HDassert(dinfo); + assert(io_info); + assert(dinfo); /* Set convenience pointers */ fm = dinfo->layout_io_info.chunk_map; - HDassert(fm); + assert(fm); dataset = dinfo->dset; mem_type = dinfo->type_info.mem_type; @@ -1205,14 +1205,14 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to set all selection") } /* end if */ fm->single_space = dataset->shared->cache.chunk.single_space; - HDassert(fm->single_space); + assert(fm->single_space); /* Allocate the single chunk information */ if (NULL == dataset->shared->cache.chunk.single_piece_info) if (NULL == (dataset->shared->cache.chunk.single_piece_info = H5FL_MALLOC(H5D_piece_info_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate chunk info") fm->single_piece_info = dataset->shared->cache.chunk.single_piece_info; - HDassert(fm->single_piece_info); + assert(fm->single_piece_info); /* Reset chunk template information */ fm->mchunk_tmpl = NULL; @@ -1230,7 +1230,7 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) if (NULL == (dataset->shared->cache.chunk.sel_chunks = H5SL_create(H5SL_TYPE_HSIZE, NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create skip list for chunk selections") fm->dset_sel_pieces = dataset->shared->cache.chunk.sel_chunks; - HDassert(fm->dset_sel_pieces); + assert(fm->dset_sel_pieces); /* We are not using single element mode */ fm->use_single = FALSE; @@ -1256,7 +1256,7 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) } /* end if */ else { /* Sanity check */ - HDassert(fm->fsel_type == H5S_SEL_HYPERSLABS); + assert(fm->fsel_type == H5S_SEL_HYPERSLABS); if (H5D__create_piece_file_map_hyper(dinfo, io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") @@ -1380,7 +1380,7 @@ H5D__chunk_mem_alloc(size_t size, void *pline) FUNC_ENTER_PACKAGE_NOERR - HDassert(size); + assert(size); if (_pline && _pline->nused) ret_value = H5MM_malloc(size); @@ -1455,8 +1455,8 @@ H5D__chunk_mem_realloc(void *chk, size_t size, const H5O_pline_t *pline) FUNC_ENTER_PACKAGE_NOERR - HDassert(size); - HDassert(pline); + assert(size); + assert(pline); if (pline->nused > 0) ret_value = H5MM_realloc(chk, size); @@ -1493,7 +1493,7 @@ H5D__free_piece_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED * FUNC_ENTER_PACKAGE_NOERR - HDassert(piece_info); + assert(piece_info); /* Close the piece's file dataspace, if it's not shared */ if (!piece_info->fspace_shared) @@ -1540,8 +1540,8 @@ H5D__create_piece_map_single(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) fm = di->layout_io_info.chunk_map; /* Sanity checks */ - HDassert(fm); - HDassert(fm->f_ndims > 0); + assert(fm); + assert(fm->f_ndims > 0); /* Get coordinate for selection */ if (H5S_SELECT_BOUNDS(di->file_space, sel_start, sel_end) < 0) @@ -1556,7 +1556,7 @@ H5D__create_piece_map_single(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) /* Validate this chunk dimension */ if (di->layout->u.chunk.dim[u] == 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "chunk size must be > 0, dim = %u ", u) - HDassert(sel_start[u] == sel_end[u]); + assert(sel_start[u] == sel_end[u]); piece_info->scaled[u] = sel_start[u] / di->layout->u.chunk.dim[u]; coords[u] = piece_info->scaled[u] * di->layout->u.chunk.dim[u]; } /* end for */ @@ -1638,8 +1638,8 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) fm = di->layout_io_info.chunk_map; /* Sanity checks */ - HDassert(fm); - HDassert(fm->f_ndims > 0); + assert(fm); + assert(fm->f_ndims > 0); /* Get number of elements selected in file */ sel_points = di->nelmts; @@ -1765,7 +1765,7 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) /* Check for previous partial chunk in this dimension */ if (is_partial_dim[curr_dim] && end[curr_dim] < file_dims[curr_dim]) { /* Sanity check */ - HDassert(num_partial_dims > 0); + assert(num_partial_dims > 0); /* Reset partial chunk information for this dimension */ curr_partial_clip[curr_dim] = fm->chunk_dim[curr_dim]; @@ -1796,7 +1796,7 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_info_t *io_info) num_partial_dims++; /* Sanity check */ - HDassert(num_partial_dims <= fm->f_ndims); + assert(num_partial_dims <= fm->f_ndims); } /* end if */ } /* end if */ } /* end if */ @@ -1846,8 +1846,8 @@ H5D__create_piece_file_map_hyper(H5D_dset_io_info_t *dinfo, H5D_io_info_t *io_in fm = dinfo->layout_io_info.chunk_map; /* Sanity checks */ - HDassert(fm); - HDassert(fm->f_ndims > 0); + assert(fm); + assert(fm->f_ndims > 0); /* Get number of elements selected in file */ sel_points = dinfo->nelmts; @@ -2023,7 +2023,7 @@ H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *dinfo) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dinfo->layout_io_info.chunk_map->f_ndims > 0); + assert(dinfo->layout_io_info.chunk_map->f_ndims > 0); /* Set convenience pointer */ fm = dinfo->layout_io_info.chunk_map; @@ -2035,7 +2035,7 @@ H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *dinfo) /* Get pointer to piece's information */ piece_info = (H5D_piece_info_t *)H5SL_item(curr_node); - HDassert(piece_info); + assert(piece_info); /* Just point at the memory dataspace & selection */ piece_info->mspace = dinfo->mem_space; @@ -2053,7 +2053,7 @@ H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *dinfo) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") /* Calculate the adjustment for memory selection from file selection */ - HDassert(fm->m_ndims == fm->f_ndims); + assert(fm->m_ndims == fm->f_ndims); for (u = 0; u < fm->f_ndims; u++) { H5_CHECK_OVERFLOW(file_sel_start[u], hsize_t, hssize_t); H5_CHECK_OVERFLOW(mem_sel_start[u], hsize_t, hssize_t); @@ -2061,7 +2061,7 @@ H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *dinfo) } /* end for */ /* Iterate over each chunk in the chunk list */ - HDassert(fm->dset_sel_pieces); + assert(fm->dset_sel_pieces); curr_node = H5SL_first(fm->dset_sel_pieces); while (curr_node) { hsize_t coords[H5S_MAX_RANK]; /* Current coordinates of chunk */ @@ -2070,7 +2070,7 @@ H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *dinfo) /* Get pointer to piece's information */ piece_info = (H5D_piece_info_t *)H5SL_item(curr_node); - HDassert(piece_info); + assert(piece_info); /* Compute the chunk coordinates from the scaled coordinates */ for (u = 0; u < fm->f_ndims; u++) @@ -2099,7 +2099,7 @@ H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *dinfo) } /* end if */ else { /* Sanity check */ - HDassert(H5S_SEL_HYPERSLABS == chunk_sel_type); + assert(H5S_SEL_HYPERSLABS == chunk_sel_type); /* Copy the file chunk's selection */ if (H5S_SELECT_COPY(piece_info->mspace, piece_info->fspace, FALSE) < 0) @@ -2150,11 +2150,11 @@ H5D__create_piece_mem_map_1d(const H5D_dset_io_info_t *dinfo) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dinfo->layout_io_info.chunk_map->f_ndims > 0); + assert(dinfo->layout_io_info.chunk_map->f_ndims > 0); /* Set convenience pointer */ fm = dinfo->layout_io_info.chunk_map; - HDassert(fm); + assert(fm); /* Check for all I/O going to a single chunk */ if (H5SL_count(fm->dset_sel_pieces) == 1) { @@ -2163,7 +2163,7 @@ H5D__create_piece_mem_map_1d(const H5D_dset_io_info_t *dinfo) /* Get pointer to chunk's information */ piece_info = (H5D_piece_info_t *)H5SL_item(curr_node); - HDassert(piece_info); + assert(piece_info); /* Just point at the memory dataspace & selection */ piece_info->mspace = dinfo->mem_space; @@ -2175,7 +2175,7 @@ H5D__create_piece_mem_map_1d(const H5D_dset_io_info_t *dinfo) hsize_t mem_sel_start[H5S_MAX_RANK]; /* Offset of low bound of file selection */ hsize_t mem_sel_end[H5S_MAX_RANK]; /* Offset of high bound of file selection */ - HDassert(fm->m_ndims == 1); + assert(fm->m_ndims == 1); if (H5S_SELECT_BOUNDS(dinfo->mem_space, mem_sel_start, mem_sel_end) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection bound info") @@ -2188,7 +2188,7 @@ H5D__create_piece_mem_map_1d(const H5D_dset_io_info_t *dinfo) /* Get pointer to chunk's information */ piece_info = (H5D_piece_info_t *)H5SL_item(curr_node); - HDassert(piece_info); + assert(piece_info); /* Copy the memory dataspace */ if ((piece_info->mspace = H5S_copy(dinfo->mem_space, TRUE, FALSE)) == NULL) @@ -2458,8 +2458,8 @@ H5D__chunk_mdio_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) /* Add piece to MDIO operation if it has a file address */ if (H5_addr_defined(piece_info->faddr)) { - HDassert(io_info->sel_pieces); - HDassert(io_info->pieces_added < io_info->piece_count); + assert(io_info->sel_pieces); + assert(io_info->pieces_added < io_info->piece_count); /* Add to sel_pieces and update pieces_added */ io_info->sel_pieces[io_info->pieces_added++] = piece_info; @@ -2497,9 +2497,9 @@ H5D__chunk_cacheable(const H5D_io_info_t H5_ATTR_PARALLEL_USED *io_info, H5D_dse FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset_info); + assert(dset_info); dataset = dset_info->dset; - HDassert(dataset); + assert(dataset); /* Must bring the whole chunk in if there are any filters on the chunk. * Make sure to check if filters are on the dataset but disabled for the @@ -2587,11 +2587,11 @@ H5D__chunk_may_use_select_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *d FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dset_info); + assert(io_info); + assert(dset_info); dataset = dset_info->dset; - HDassert(dataset); + assert(dataset); /* Don't use selection I/O if there are filters on the dataset (for now) */ if (dataset->shared->dcpl_cache.pline.nused > 0) { @@ -2670,9 +2670,9 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->buf.vp); + assert(io_info); + assert(dset_info); + assert(dset_info->buf.vp); /* Set up "nonexistent" I/O info object */ H5MM_memcpy(&nonexistent_io_info, io_info, sizeof(nonexistent_io_info)); @@ -2712,10 +2712,10 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Allocate arrays of dataspaces and offsets for use with selection I/O, * or point to local buffers */ - HDassert(sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]) == - sizeof(chunk_file_spaces_local) / sizeof(chunk_file_spaces_local[0])); - HDassert(sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]) == - sizeof(chunk_addrs_local) / sizeof(chunk_addrs_local[0])); + assert(sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]) == + sizeof(chunk_file_spaces_local) / sizeof(chunk_file_spaces_local[0])); + assert(sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]) == + sizeof(chunk_addrs_local) / sizeof(chunk_addrs_local[0])); if (num_chunks > (sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]))) { if (NULL == (chunk_mem_spaces = H5MM_malloc(num_chunks * sizeof(H5S_t *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, @@ -2751,11 +2751,11 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* There should be no chunks cached */ - HDassert(UINT_MAX == udata.idx_hint); + assert(UINT_MAX == udata.idx_hint); /* Sanity check */ - HDassert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || - (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); + assert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); /* Check for non-existent chunk & skip it if appropriate */ if (H5_addr_defined(udata.chunk_block.offset)) { @@ -2768,12 +2768,12 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) } /* end if */ else { /* Add to mdset selection I/O arrays */ - HDassert(io_info->mem_spaces); - HDassert(io_info->file_spaces); - HDassert(io_info->addrs); - HDassert(io_info->element_sizes); - HDassert(io_info->rbufs); - HDassert(io_info->pieces_added < io_info->piece_count); + assert(io_info->mem_spaces); + assert(io_info->file_spaces); + assert(io_info->addrs); + assert(io_info->element_sizes); + assert(io_info->rbufs); + assert(io_info->pieces_added < io_info->piece_count); io_info->mem_spaces[io_info->pieces_added] = chunk_info->mspace; io_info->file_spaces[io_info->pieces_added] = chunk_info->fspace; @@ -2813,8 +2813,8 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Clean up memory */ if (chunk_mem_spaces != chunk_mem_spaces_local) { - HDassert(chunk_file_spaces != chunk_file_spaces_local); - HDassert(chunk_addrs != chunk_addrs_local); + assert(chunk_file_spaces != chunk_file_spaces_local); + assert(chunk_addrs != chunk_addrs_local); chunk_mem_spaces = H5MM_xfree(chunk_mem_spaces); chunk_file_spaces = H5MM_xfree(chunk_file_spaces); chunk_addrs = H5MM_xfree(chunk_addrs); @@ -2872,8 +2872,8 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ - HDassert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || - (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); + assert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); /* Check for non-existent chunk & skip it if appropriate */ if (H5_addr_defined(udata.chunk_block.offset) || UINT_MAX != udata.idx_hint || @@ -2920,7 +2920,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) } /* end else */ /* Perform the actual read operation */ - HDassert(chk_io_info->count == 1); + assert(chk_io_info->count == 1); chk_io_info->dsets_info[0].file_space = chunk_info->fspace; chk_io_info->dsets_info[0].mem_space = chunk_info->mspace; chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points; @@ -2950,9 +2950,9 @@ done: } /* end if */ /* Make sure we cleaned up */ - HDassert(!chunk_mem_spaces || chunk_mem_spaces == chunk_mem_spaces_local); - HDassert(!chunk_file_spaces || chunk_file_spaces == chunk_file_spaces_local); - HDassert(!chunk_addrs || chunk_addrs == chunk_addrs_local); + assert(!chunk_mem_spaces || chunk_mem_spaces == chunk_mem_spaces_local); + assert(!chunk_file_spaces || chunk_file_spaces == chunk_file_spaces_local); + assert(!chunk_addrs || chunk_addrs == chunk_addrs_local); FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_read() */ @@ -2992,9 +2992,9 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->buf.cvp); + assert(io_info); + assert(dset_info); + assert(dset_info->buf.cvp); /* Set up contiguous I/O info object */ H5MM_memcpy(&ctg_io_info, io_info, sizeof(ctg_io_info)); @@ -3033,10 +3033,10 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Allocate arrays of dataspaces and offsets for use with selection I/O, * or point to local buffers */ - HDassert(sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]) == - sizeof(chunk_file_spaces_local) / sizeof(chunk_file_spaces_local[0])); - HDassert(sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]) == - sizeof(chunk_addrs_local) / sizeof(chunk_addrs_local[0])); + assert(sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]) == + sizeof(chunk_file_spaces_local) / sizeof(chunk_file_spaces_local[0])); + assert(sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]) == + sizeof(chunk_addrs_local) / sizeof(chunk_addrs_local[0])); if (num_chunks > (sizeof(chunk_mem_spaces_local) / sizeof(chunk_mem_spaces_local[0]))) { if (NULL == (chunk_mem_spaces = H5MM_malloc(num_chunks * sizeof(H5S_t *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, @@ -3075,11 +3075,11 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* There should be no chunks cached */ - HDassert(UINT_MAX == udata.idx_hint); + assert(UINT_MAX == udata.idx_hint); /* Sanity check */ - HDassert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || - (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); + assert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); /* Set chunk's [scaled] coordinates */ dset_info->store->chunk.scaled = chunk_info->scaled; @@ -3166,12 +3166,12 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) } /* end if */ else { /* Add to mdset selection I/O arrays */ - HDassert(io_info->mem_spaces); - HDassert(io_info->file_spaces); - HDassert(io_info->addrs); - HDassert(io_info->element_sizes); - HDassert(io_info->wbufs); - HDassert(io_info->pieces_added < io_info->piece_count); + assert(io_info->mem_spaces); + assert(io_info->file_spaces); + assert(io_info->addrs); + assert(io_info->element_sizes); + assert(io_info->wbufs); + assert(io_info->pieces_added < io_info->piece_count); io_info->mem_spaces[io_info->pieces_added] = chunk_info->mspace; io_info->file_spaces[io_info->pieces_added] = chunk_info->fspace; @@ -3202,8 +3202,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Clean up memory */ if (chunk_mem_spaces != chunk_mem_spaces_local) { - HDassert(chunk_file_spaces != chunk_file_spaces_local); - HDassert(chunk_addrs != chunk_addrs_local); + assert(chunk_file_spaces != chunk_file_spaces_local); + assert(chunk_addrs != chunk_addrs_local); chunk_mem_spaces = H5MM_xfree(chunk_mem_spaces); chunk_file_spaces = H5MM_xfree(chunk_file_spaces); chunk_addrs = H5MM_xfree(chunk_addrs); @@ -3236,8 +3236,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") /* Sanity check */ - HDassert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || - (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); + assert((H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length > 0) || + (!H5_addr_defined(udata.chunk_block.offset) && udata.chunk_block.length == 0)); /* Set chunk's [scaled] coordinates */ dset_info->store->chunk.scaled = chunk_info->scaled; @@ -3310,7 +3310,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) } /* end else */ /* Perform the actual write operation */ - HDassert(chk_io_info->count == 1); + assert(chk_io_info->count == 1); chk_io_info->dsets_info[0].file_space = chunk_info->fspace; chk_io_info->dsets_info[0].mem_space = chunk_info->mspace; chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points; @@ -3347,9 +3347,9 @@ done: } /* end if */ /* Make sure we cleaned up */ - HDassert(!chunk_mem_spaces || chunk_mem_spaces == chunk_mem_spaces_local); - HDassert(!chunk_file_spaces || chunk_file_spaces == chunk_file_spaces_local); - HDassert(!chunk_addrs || chunk_addrs == chunk_addrs_local); + assert(!chunk_mem_spaces || chunk_mem_spaces == chunk_mem_spaces_local); + assert(!chunk_file_spaces || chunk_file_spaces == chunk_file_spaces_local); + assert(!chunk_addrs || chunk_addrs == chunk_addrs_local); FUNC_LEAVE_NOAPI(ret_value) } /* H5D__chunk_write() */ @@ -3378,7 +3378,7 @@ H5D__chunk_flush(H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); + assert(dset); /* Loop over all entries in the chunk cache */ for (ent = rdcc->head; ent; ent = next) { @@ -3412,7 +3412,7 @@ H5D__chunk_io_term(H5D_io_info_t H5_ATTR_UNUSED *io_info, H5D_dset_io_info_t *di FUNC_ENTER_PACKAGE - HDassert(di); + assert(di); /* Set convenience pointer */ fm = di->layout_io_info.chunk_map; @@ -3420,11 +3420,11 @@ H5D__chunk_io_term(H5D_io_info_t H5_ATTR_UNUSED *io_info, H5D_dset_io_info_t *di /* Single element I/O vs. multiple element I/O cleanup */ if (fm->use_single) { /* Sanity checks */ - HDassert(fm->dset_sel_pieces == NULL); - HDassert(fm->last_piece_info == NULL); - HDassert(fm->single_piece_info); - HDassert(fm->single_piece_info->fspace_shared); - HDassert(fm->single_piece_info->mspace_shared); + assert(fm->dset_sel_pieces == NULL); + assert(fm->last_piece_info == NULL); + assert(fm->single_piece_info); + assert(fm->single_piece_info->fspace_shared); + assert(fm->single_piece_info->mspace_shared); /* Reset the selection for the single element I/O */ H5S_select_all(fm->single_space, TRUE); @@ -3481,7 +3481,7 @@ H5D__chunk_dest(H5D_t *dset) FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Sanity checks */ - HDassert(dset); + assert(dset); H5D_CHUNK_STORAGE_INDEX_CHK(sc); /* Flush all the cached chunks */ @@ -3534,8 +3534,8 @@ H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(storage); - HDassert(storage->ops); + assert(storage); + assert(storage->ops); H5D_CHUNK_STORAGE_INDEX_CHK(storage); /* Reset index structures */ @@ -3564,7 +3564,7 @@ H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(last); + assert(last); /* Indicate that the cached info is not valid */ last->valid = FALSE; @@ -3590,10 +3590,10 @@ H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *ud FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(last); - HDassert(udata); - HDassert(udata->common.layout); - HDassert(udata->common.scaled); + assert(last); + assert(udata); + assert(udata->common.layout); + assert(udata->common.scaled); /* Stored the information to cache */ H5MM_memcpy(last->scaled, udata->common.scaled, sizeof(hsize_t) * udata->common.layout->ndims); @@ -3628,10 +3628,10 @@ H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *uda FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(last); - HDassert(udata); - HDassert(udata->common.layout); - HDassert(udata->common.scaled); + assert(last); + assert(udata); + assert(udata->common.layout); + assert(udata->common.scaled); /* Check if the cached information is what is desired */ if (last->valid) { @@ -3681,10 +3681,9 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset); - HDassert(H5D_CHUNKED == dset->shared->layout.type); - HDassert(dset->shared->layout.u.chunk.ndims > 0 && - dset->shared->layout.u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(dset); + assert(H5D_CHUNKED == dset->shared->layout.type); + assert(dset->shared->layout.u.chunk.ndims > 0 && dset->shared->layout.u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(sc); #ifndef NDEBUG @@ -3692,7 +3691,7 @@ H5D__chunk_create(const H5D_t *dset /*in,out*/) unsigned u; /* Local index variable */ for (u = 0; u < dset->shared->layout.u.chunk.ndims; u++) - HDassert(dset->shared->layout.u.chunk.dim[u] > 0); + assert(dset->shared->layout.u.chunk.dim[u] > 0); } #endif @@ -3733,8 +3732,8 @@ H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(shared); - HDassert(scaled); + assert(shared); + assert(scaled); /* If the fastest changing dimension doesn't have enough entropy, use * other dimensions too @@ -3781,11 +3780,11 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udat FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dset); - HDassert(dset->shared->layout.u.chunk.ndims > 0); + assert(dset); + assert(dset->shared->layout.u.chunk.ndims > 0); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(scaled); - HDassert(udata); + assert(scaled); + assert(udata); /* Initialize the query information about the chunk we are looking for */ udata->common.layout = &(dset->shared->layout.u.chunk); @@ -3928,11 +3927,11 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) FUNC_ENTER_PACKAGE - HDassert(dset); - HDassert(dset->shared); + assert(dset); + assert(dset->shared); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(ent); - HDassert(!ent->locked); + assert(ent); + assert(!ent->locked); buf = ent->chunk; if (ent->dirty) { @@ -4017,7 +4016,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) ent->edge_chunk_state &= ~H5D_RDCC_NEWLY_DISABLED_FILTERS; } /* end else */ - HDassert(!(ent->edge_chunk_state & H5D_RDCC_NEWLY_DISABLED_FILTERS)); + assert(!(ent->edge_chunk_state & H5D_RDCC_NEWLY_DISABLED_FILTERS)); /* Check if the chunk needs to be allocated (it also could exist already * and the chunk alloc operation could resize it) @@ -4042,7 +4041,7 @@ H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset) } /* end if */ /* Write the data to the file */ - HDassert(H5_addr_defined(udata.chunk_block.offset)); + assert(H5_addr_defined(udata.chunk_block.offset)); H5_CHECK_OVERFLOW(udata.chunk_block.length, hsize_t, size_t); if (H5F_shared_block_write(H5F_SHARED(dset->oloc.file), H5FD_MEM_DRAW, udata.chunk_block.offset, (size_t)udata.chunk_block.length, buf) < 0) @@ -4118,10 +4117,10 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dset); - HDassert(ent); - HDassert(!ent->locked); - HDassert(ent->idx < rdcc->nslots); + assert(dset); + assert(ent); + assert(!ent->locked); + assert(ent->idx < rdcc->nslots); if (flush) { /* Flush */ @@ -4150,7 +4149,7 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush) /* Unlink from temporary list */ if (ent->tmp_prev) { - HDassert(rdcc->tmp_head->tmp_next); + assert(rdcc->tmp_head->tmp_next); ent->tmp_prev->tmp_next = ent->tmp_next; if (ent->tmp_next) { ent->tmp_next->tmp_prev = ent->tmp_prev; @@ -4164,7 +4163,7 @@ H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush) rdcc->slot[ent->idx] = NULL; /* Remove from cache */ - HDassert(rdcc->slot[ent->idx] != ent); + assert(rdcc->slot[ent->idx] != ent); ent->idx = UINT_MAX; rdcc->nbytes_used -= dset->shared->layout.u.chunk.size; --rdcc->nused; @@ -4331,13 +4330,13 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->store); + assert(io_info); + assert(dset_info); + assert(dset_info->store); dset = dset_info->dset; - HDassert(dset); - HDassert(udata); - HDassert(!(udata->new_unfilt_chunk && prev_unfilt_chunk)); + assert(dset); + assert(udata); + assert(!(udata->new_unfilt_chunk && prev_unfilt_chunk)); /* Set convenience pointers */ pline = &(dset->shared->dcpl_cache.pline); @@ -4346,17 +4345,17 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds fill = &(dset->shared->dcpl_cache.fill); rdcc = &(dset->shared->cache.chunk); - HDassert(!rdcc->tmp_head); + assert(!rdcc->tmp_head); /* Get the chunk's size */ - HDassert(layout->u.chunk.size > 0); + assert(layout->u.chunk.size > 0); H5_CHECKED_ASSIGN(chunk_size, size_t, layout->u.chunk.size, uint32_t); /* Check if the chunk is in the cache */ if (UINT_MAX != udata->idx_hint) { /* Sanity check */ - HDassert(udata->idx_hint < rdcc->nslots); - HDassert(rdcc->slot[udata->idx_hint]); + assert(udata->idx_hint < rdcc->nslots); + assert(rdcc->slot[udata->idx_hint]); /* Get the entry */ ent = rdcc->slot[udata->idx_hint]; @@ -4367,7 +4366,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds /* Make sure this is the right chunk */ for (u = 0; u < layout->u.chunk.ndims - 1; u++) - HDassert(dset_info->store->chunk.scaled[u] == ent->scaled[u]); + assert(dset_info->store->chunk.scaled[u] == ent->scaled[u]); } #endif /* NDEBUG */ @@ -4384,9 +4383,9 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds /* If this flag is set then partial chunk filters must be * disabled, and the chunk must not have previously been a * partial chunk (with disabled filters) */ - HDassert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); - HDassert(!(ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS)); - HDassert(old_pline->nused); + assert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); + assert(!(ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS)); + assert(old_pline->nused); /* Disable filters. Set pline to NULL instead of just the * default pipeline to make a quick failure more likely if the @@ -4412,9 +4411,9 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds /* If this flag is set then partial chunk filters must be * disabled, and the chunk must have previously been a partial * chunk (with disabled filters) */ - HDassert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); - HDassert((ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS)); - HDassert(pline->nused); + assert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); + assert((ent->edge_chunk_state & H5D_RDCC_DISABLE_FILTERS)); + assert(pline->nused); /* Mark the old pipeline as having been disabled */ old_pline = NULL; @@ -4466,14 +4465,14 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds /* Check if we should disable filters on this chunk */ if (pline->nused) { if (udata->new_unfilt_chunk) { - HDassert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); + assert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); /* Disable the filters for writing */ disable_filters = TRUE; pline = NULL; } /* end if */ else if (prev_unfilt_chunk) { - HDassert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); + assert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); /* Mark the filters as having been previously disabled (for the * chunk as currently on disk) - disable the filters for reading @@ -4565,7 +4564,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds H5D_fill_value_t fill_status; /* Sanity check */ - HDassert(fill->alloc_time != H5D_ALLOC_TIME_EARLY); + assert(fill->alloc_time != H5D_ALLOC_TIME_EARLY); /* Chunk size on disk isn't [likely] the same size as the final chunk * size in memory, so allocate memory big enough. */ @@ -4640,7 +4639,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds ent->chunk = (uint8_t *)chunk; /* Add it to the cache */ - HDassert(NULL == rdcc->slot[udata->idx_hint]); + assert(NULL == rdcc->slot[udata->idx_hint]); rdcc->slot[udata->idx_hint] = ent; ent->idx = udata->idx_hint; rdcc->nbytes_used += chunk_size; @@ -4668,7 +4667,7 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds /* Lock the chunk into the cache */ if (ent) { - HDassert(!ent->locked); + assert(!ent->locked); ent->locked = TRUE; chunk = ent->chunk; } /* end if */ @@ -4730,9 +4729,9 @@ H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dset_info); - HDassert(udata); + assert(io_info); + assert(dset_info); + assert(udata); /* Set convenience pointers */ layout = &(dset_info->dset->shared->layout); @@ -4748,7 +4747,7 @@ H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ /* Check if we should disable filters on this chunk */ if (udata->new_unfilt_chunk) { - HDassert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); + assert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); is_unfiltered_edge_chunk = TRUE; } /* end if */ @@ -4769,7 +4768,7 @@ H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ if (udata->new_unfilt_chunk) fake_ent.edge_chunk_state |= H5D_RDCC_NEWLY_DISABLED_FILTERS; H5MM_memcpy(fake_ent.scaled, udata->common.scaled, sizeof(hsize_t) * layout->u.chunk.ndims); - HDassert(layout->u.chunk.size > 0); + assert(layout->u.chunk.size > 0); fake_ent.chunk_idx = udata->chunk_idx; fake_ent.chunk_block.offset = udata->chunk_block.offset; fake_ent.chunk_block.length = udata->chunk_block.length; @@ -4788,15 +4787,15 @@ H5D__chunk_unlock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ H5D_rdcc_ent_t *ent; /* Chunk's entry in the cache */ /* Sanity check */ - HDassert(udata->idx_hint < rdcc->nslots); - HDassert(rdcc->slot[udata->idx_hint]); - HDassert(rdcc->slot[udata->idx_hint]->chunk == chunk); + assert(udata->idx_hint < rdcc->nslots); + assert(rdcc->slot[udata->idx_hint]); + assert(rdcc->slot[udata->idx_hint]->chunk == chunk); /* * It's in the cache so unlock it. */ ent = rdcc->slot[udata->idx_hint]; - HDassert(ent->locked); + assert(ent->locked); if (dirty) { ent->dirty = TRUE; ent->wr_count -= MIN(ent->wr_count, naccessed); @@ -4861,8 +4860,8 @@ H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes) FUNC_ENTER_PACKAGE - HDassert(dset); - HDassert(dset->shared); + assert(dset); + assert(dset->shared); H5D_CHUNK_STORAGE_INDEX_CHK(sc); /* Search for cached chunks that haven't been written out */ @@ -4949,8 +4948,8 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset && H5D_CHUNKED == layout->type); - HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(dset && H5D_CHUNKED == layout->type); + assert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(sc); /* Retrieve the dataset dimensions */ @@ -5125,8 +5124,8 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old /* Initialize chunk_size and fill_buf */ if (should_fill && !fb_info.has_vlen_fill_type) { - HDassert(fb_info_init); - HDassert(unfilt_fill_buf); + assert(fb_info_init); + assert(unfilt_fill_buf); if (nunfilt_edge_chunk_dims) { fill_buf = &unfilt_fill_buf; chunk_size = layout->u.chunk.size; @@ -5150,7 +5149,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old #ifndef NDEBUG /* None of the chunks should be allocated */ if (H5D_CHUNK_IDX_NONE != sc->idx_type) - HDassert(!H5_addr_defined(udata.chunk_block.offset)); + assert(!H5_addr_defined(udata.chunk_block.offset)); /* Make sure the chunk is really in the dataset and outside the * original dimensions */ @@ -5159,21 +5158,21 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old hbool_t outside_orig = FALSE; for (v = 0; v < space_ndims; v++) { - HDassert((scaled[v] * chunk_dim[v]) < space_dim[v]); + assert((scaled[v] * chunk_dim[v]) < space_dim[v]); if ((scaled[v] * chunk_dim[v]) >= old_dim[v]) outside_orig = TRUE; } /* end for */ - HDassert(outside_orig); + assert(outside_orig); } /* end block */ #endif /* NDEBUG */ /* Check for VL datatype & non-default fill value */ if (fb_info_init && fb_info.has_vlen_fill_type) { /* Sanity check */ - HDassert(should_fill); - HDassert(!unfilt_fill_buf); + assert(should_fill); + assert(!unfilt_fill_buf); #ifdef H5_HAVE_PARALLEL - HDassert(!using_mpi); /* Can't write VL datatypes in parallel currently */ + assert(!using_mpi); /* Can't write VL datatypes in parallel currently */ #endif /* Check to make sure the buffer is large enough. It is @@ -5221,7 +5220,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old else chunk_size = layout->u.chunk.size; - HDassert(*fill_buf == fb_info.fill_buf); + assert(*fill_buf == fb_info.fill_buf); } /* end if */ /* Initialize the chunk information */ @@ -5235,13 +5234,13 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old /* Allocate the chunk (with all processes) */ if (H5D__chunk_file_alloc(&idx_info, NULL, &udata.chunk_block, &need_insert, scaled) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level") - HDassert(H5_addr_defined(udata.chunk_block.offset)); + assert(H5_addr_defined(udata.chunk_block.offset)); /* Check if fill values should be written to chunks */ if (should_fill) { /* Sanity check */ - HDassert(fb_info_init); - HDassert(udata.chunk_block.length == chunk_size); + assert(fb_info_init); + assert(udata.chunk_block.length == chunk_size); #ifdef H5_HAVE_PARALLEL /* Check if this file is accessed with an MPI-capable file driver */ @@ -5302,7 +5301,7 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old scaled[i] < edge_chunk_scaled[i]) { nunfilt_edge_chunk_dims--; if (should_fill && nunfilt_edge_chunk_dims == 0 && !fb_info.has_vlen_fill_type) { - HDassert( + assert( !H5D__chunk_is_partial_edge_chunk(space_ndims, chunk_dim, scaled, space_dim)); fill_buf = &fb_info.fill_buf; chunk_size = orig_chunk_size; @@ -5312,10 +5311,10 @@ H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old else { /* Check if we just entered the edge in this dimension */ if (unfilt_edge_chunk_dim[i] && scaled[i] == edge_chunk_scaled[i]) { - HDassert(edge_chunk_scaled[i] == max_unalloc[i]); + assert(edge_chunk_scaled[i] == max_unalloc[i]); nunfilt_edge_chunk_dims++; if (should_fill && nunfilt_edge_chunk_dims == 1 && !fb_info.has_vlen_fill_type) { - HDassert( + assert( H5D__chunk_is_partial_edge_chunk(space_ndims, chunk_dim, scaled, space_dim)); fill_buf = &unfilt_fill_buf; chunk_size = layout->u.chunk.size; @@ -5405,11 +5404,11 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset && H5D_CHUNKED == layout->type); - HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(dset && H5D_CHUNKED == layout->type); + assert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(&layout->storage.u.chunk); - HDassert(dset->shared->dcpl_cache.pline.nused > 0); - HDassert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); + assert(dset->shared->dcpl_cache.pline.nused > 0); + assert(layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); /* Retrieve the dataset dimensions */ space_dim = dset->shared->curr_dims; @@ -5477,7 +5476,7 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) if (!new_full_dim[op_dim]) continue; else { - HDassert(max_edge_chunk_sc[op_dim] == old_edge_chunk_sc[op_dim]); + assert(max_edge_chunk_sc[op_dim] == old_edge_chunk_sc[op_dim]); /* Reset the chunk offset indices */ HDmemset(chunk_sc, 0, (space_ndims * sizeof(chunk_sc[0]))); @@ -5490,8 +5489,8 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) int i; /* Local index variable */ /* Make sure the chunk is really a former edge chunk */ - HDassert(H5D__chunk_is_partial_edge_chunk(space_ndims, chunk_dim, chunk_sc, old_dim) && - !H5D__chunk_is_partial_edge_chunk(space_ndims, chunk_dim, chunk_sc, space_dim)); + assert(H5D__chunk_is_partial_edge_chunk(space_ndims, chunk_dim, chunk_sc, old_dim) && + !H5D__chunk_is_partial_edge_chunk(space_ndims, chunk_dim, chunk_sc, space_dim)); /* Lookup the chunk */ if (H5D__chunk_lookup(dset, chunk_sc, &chk_udata) < 0) @@ -5586,7 +5585,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_fill_info_t *chunk_ * that the "don't filter partial edge chunks" flag is set. */ if (partial_chunk_fill_buf) - HDassert(dset->shared->layout.u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); + assert(dset->shared->layout.u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS); /* Get the MPI communicator */ if (MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(dset->oloc.file))) @@ -5683,7 +5682,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_fill_info_t *chunk_ H5_CHECKED_ASSIGN(block_lens[i], int, chunk_fill_info->chunk_info[idx].chunk_size, size_t); if (chunk_fill_info->chunk_info[idx].unfiltered_partial_chunk) { - HDassert(partial_chunk_fill_buf); + assert(partial_chunk_fill_buf); block_disps[i] = partial_fill_buf_disp; } } /* end for */ @@ -5702,7 +5701,7 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_fill_info_t *chunk_ size_t); if (chunk_fill_info->chunk_info[(blocks * mpi_size) + mpi_rank].unfiltered_partial_chunk) { - HDassert(partial_chunk_fill_buf); + assert(partial_chunk_fill_buf); block_disps[blocks] = partial_fill_buf_disp; } @@ -5743,9 +5742,9 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_fill_info_t *chunk_ * Currently, different block lengths implies that there are partial * edge chunks and the "don't filter partial edge chunks" flag is set. */ - HDassert(partial_chunk_fill_buf); - HDassert(block_lens); - HDassert(block_disps); + assert(partial_chunk_fill_buf); + assert(block_lens); + assert(block_disps); mpi_code = MPI_Type_create_hindexed(blocks, block_lens, chunk_disp_array, MPI_BYTE, &file_type); if (mpi_code != MPI_SUCCESS) @@ -5856,7 +5855,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) FUNC_ENTER_PACKAGE /* Get the chunk's size */ - HDassert(layout->u.chunk.size > 0); + assert(layout->u.chunk.size > 0); H5_CHECKED_ASSIGN(chunk_size, size_t, layout->u.chunk.size, uint32_t); /* Get the info for the chunk in the file */ @@ -5881,7 +5880,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) /* Compute the # of elements to leave with existing value, in each dimension */ for (u = 0; u < rank; u++) { count[u] = MIN(layout->u.chunk.dim[u], (udata->space_dim[u] - (scaled[u] * layout->u.chunk.dim[u]))); - HDassert(count[u] > 0); + assert(count[u] > 0); } /* end for */ /* Select all elements in chunk, to begin with */ @@ -6082,8 +6081,8 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset && H5D_CHUNKED == layout->type); - HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(dset && H5D_CHUNKED == layout->type); + assert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); H5D_CHUNK_STORAGE_INDEX_CHK(sc); /* Go get the rank & dimensions (including the element size) */ @@ -6230,7 +6229,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) if (!shrunk_dim[op_dim]) continue; else { - HDassert(max_mod_chunk_sc[op_dim] >= min_mod_chunk_sc[op_dim]); + assert(max_mod_chunk_sc[op_dim] >= min_mod_chunk_sc[op_dim]); /* Reset the chunk offset indices */ HDmemset(scaled, 0, (space_ndims * sizeof(scaled[0]))); @@ -6254,12 +6253,11 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) udata.common.scaled = scaled; if (0 == ndims_outside_fill) { - HDassert(fill_dim[op_dim]); - HDassert(scaled[op_dim] == min_mod_chunk_sc[op_dim]); + assert(fill_dim[op_dim]); + assert(scaled[op_dim] == min_mod_chunk_sc[op_dim]); /* Make sure this is an edge chunk */ - HDassert( - H5D__chunk_is_partial_edge_chunk(space_ndims, layout->u.chunk.dim, scaled, space_dim)); + assert(H5D__chunk_is_partial_edge_chunk(space_ndims, layout->u.chunk.dim, scaled, space_dim)); /* Determine if the chunk just became an unfiltered chunk */ if (new_unfilt_dim[op_dim]) { @@ -6273,10 +6271,10 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) /* Make sure that, if we think this is a new unfiltered chunk, * it was previously not an edge chunk */ - HDassert(!new_unfilt_dim[op_dim] || - (!new_unfilt_chunk != !H5D__chunk_is_partial_edge_chunk( - space_ndims, layout->u.chunk.dim, scaled, old_dim))); - HDassert(!new_unfilt_chunk || new_unfilt_dim[op_dim]); + assert(!new_unfilt_dim[op_dim] || + (!new_unfilt_chunk != !H5D__chunk_is_partial_edge_chunk( + space_ndims, layout->u.chunk.dim, scaled, old_dim))); + assert(!new_unfilt_chunk || new_unfilt_dim[op_dim]); /* Fill the unused parts of the chunk */ if (H5D__chunk_prune_fill(&udata, new_unfilt_chunk) < 0) @@ -6295,7 +6293,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) outside_dim = TRUE; break; } /* end if */ - HDassert(outside_dim); + assert(outside_dim); } /* end block */ #endif /* NDEBUG */ @@ -6436,11 +6434,11 @@ H5D__chunk_addrmap(const H5D_t *dset, haddr_t chunk_addr[]) FUNC_ENTER_PACKAGE - HDassert(dset); - HDassert(dset->shared); + assert(dset); + assert(dset->shared); sc = &(dset->shared->layout.storage.u.chunk); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(chunk_addr); + assert(chunk_addr); /* Set up user data for B-tree callback */ HDmemset(&udata, 0, sizeof(udata)); @@ -6490,9 +6488,9 @@ H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *storage) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(oh); - HDassert(storage); + assert(f); + assert(oh); + assert(storage); H5D_CHUNK_STORAGE_INDEX_CHK(&storage->u.chunk); /* Check for I/O pipeline message */ @@ -6565,12 +6563,11 @@ H5D__chunk_update_cache(H5D_t *dset) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset && H5D_CHUNKED == dset->shared->layout.type); - HDassert(dset->shared->layout.u.chunk.ndims > 0 && - dset->shared->layout.u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(dset && H5D_CHUNKED == dset->shared->layout.type); + assert(dset->shared->layout.u.chunk.ndims > 0 && dset->shared->layout.u.chunk.ndims <= H5O_LAYOUT_NDIMS); /* Check the rank */ - HDassert((dset->shared->layout.u.chunk.ndims - 1) > 1); + assert((dset->shared->layout.u.chunk.ndims - 1) > 1); /* Add temporary entry list to rdcc */ (void)HDmemset(&tmp_head, 0, sizeof(tmp_head)); @@ -6594,14 +6591,14 @@ H5D__chunk_update_cache(H5D_t *dset) /* Check if there is already a chunk at this chunk's new location */ old_ent = rdcc->slot[ent->idx]; if (old_ent != NULL) { - HDassert(old_ent->locked == FALSE); - HDassert(old_ent->deleted == FALSE); + assert(old_ent->locked == FALSE); + assert(old_ent->deleted == FALSE); /* Insert the old entry into the temporary list, but do not * evict (yet). Make sure we do not make any calls to the index * until all chunks have updated indices! */ - HDassert(!old_ent->tmp_next); - HDassert(!old_ent->tmp_prev); + assert(!old_ent->tmp_next); + assert(!old_ent->tmp_prev); tmp_tail->tmp_next = old_ent; old_ent->tmp_prev = tmp_tail; tmp_tail = old_ent; @@ -6614,15 +6611,15 @@ H5D__chunk_update_cache(H5D_t *dset) * not in the hash table, remove it from the temporary list. * Otherwise clear the old hash table slot. */ if (ent->tmp_prev) { - HDassert(tmp_head.tmp_next); - HDassert(tmp_tail != &tmp_head); + assert(tmp_head.tmp_next); + assert(tmp_tail != &tmp_head); ent->tmp_prev->tmp_next = ent->tmp_next; if (ent->tmp_next) { ent->tmp_next->tmp_prev = ent->tmp_prev; ent->tmp_next = NULL; } /* end if */ else { - HDassert(tmp_tail == ent); + assert(tmp_tail == ent); tmp_tail = ent->tmp_prev; } /* end else */ ent->tmp_prev = NULL; @@ -6741,7 +6738,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) } /* end if */ if (udata->chunk_in_cache && udata->chunk) { - HDassert(!H5_addr_defined(chunk_rec->chunk_addr)); + assert(!H5_addr_defined(chunk_rec->chunk_addr)); H5MM_memcpy(buf, udata->chunk, nbytes); udata->chunk = NULL; } @@ -6776,8 +6773,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) if (NULL == ent) HGOTO_ERROR(H5E_IO, H5E_BADVALUE, H5_ITER_ERROR, "NULL chunk entry pointer") - HDassert(H5_addr_defined(chunk_rec->chunk_addr)); - HDassert(H5_addr_defined(ent->chunk_block.offset)); + assert(H5_addr_defined(chunk_rec->chunk_addr)); + assert(H5_addr_defined(ent->chunk_block.offset)); H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t); H5MM_memcpy(buf, ent->chunk, nbytes); @@ -6880,7 +6877,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "unable to insert/resize chunk on chunk level") /* Write chunk data to destination file */ - HDassert(H5_addr_defined(udata_dst.chunk_block.offset)); + assert(H5_addr_defined(udata_dst.chunk_block.offset)); if (H5F_block_write(udata->idx_info_dst->f, H5FD_MEM_DRAW, udata_dst.chunk_block.offset, nbytes, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") @@ -6945,15 +6942,15 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f_src); - HDassert(storage_src); + assert(f_src); + assert(storage_src); H5D_CHUNK_STORAGE_INDEX_CHK(storage_src); - HDassert(layout_src); - HDassert(f_dst); - HDassert(storage_dst); + assert(layout_src); + assert(f_dst); + assert(storage_dst); H5D_CHUNK_STORAGE_INDEX_CHK(storage_dst); - HDassert(ds_extent_src); - HDassert(dt_src); + assert(ds_extent_src); + assert(dt_src); /* Initialize the temporary pipeline info */ if (NULL == pline_src) { @@ -7211,12 +7208,12 @@ H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_ FUNC_ENTER_PACKAGE /* Check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(layout); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(layout); H5D_CHUNK_STORAGE_INDEX_CHK(sc); - HDassert(index_size); + assert(index_size); /* Check for I/O pipeline message */ if ((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0) @@ -7330,7 +7327,7 @@ H5D__chunk_dump_index(H5D_t *dset, FILE *stream) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); + assert(dset); H5D_CHUNK_STORAGE_INDEX_CHK(sc); /* Only display info if stream is defined */ @@ -7509,13 +7506,13 @@ H5D__nonexistent_readvv(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, FUNC_ENTER_PACKAGE /* Check args */ - HDassert(io_info); - HDassert(chunk_curr_seq); - HDassert(chunk_len_arr); - HDassert(chunk_off_arr); - HDassert(mem_curr_seq); - HDassert(mem_len_arr); - HDassert(mem_off_arr); + assert(io_info); + assert(chunk_curr_seq); + assert(chunk_len_arr); + assert(chunk_off_arr); + assert(mem_curr_seq); + assert(mem_len_arr); + assert(mem_off_arr); /* Set up user data for H5VM_opvv() */ udata.rbuf = (unsigned char *)dset_info->buf.vp; @@ -7555,10 +7552,10 @@ H5D__chunk_is_partial_edge_chunk(unsigned dset_ndims, const uint32_t *chunk_dims FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(scaled); - HDassert(dset_ndims > 0); - HDassert(dset_dims); - HDassert(chunk_dims); + assert(scaled); + assert(dset_ndims > 0); + assert(dset_dims); + assert(chunk_dims); /* check if this is a partial edge chunk */ for (u = 0; u < dset_ndims; u++) @@ -7593,20 +7590,20 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(new_chunk); - HDassert(need_insert); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(new_chunk); + assert(need_insert); *need_insert = FALSE; /* Check for filters on chunks */ if (idx_info->pline->nused > 0) { /* Sanity/error checking block */ - HDassert(idx_info->storage->idx_type != H5D_CHUNK_IDX_NONE); + assert(idx_info->storage->idx_type != H5D_CHUNK_IDX_NONE); { unsigned allow_chunk_size_len; /* Allowed size of encoded chunk size */ unsigned new_chunk_size_len; /* Size of encoded chunk size */ @@ -7630,7 +7627,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old if (old_chunk && H5_addr_defined(old_chunk->offset)) { /* Sanity check */ - HDassert(!H5_addr_defined(new_chunk->offset) || H5_addr_eq(new_chunk->offset, old_chunk->offset)); + assert(!H5_addr_defined(new_chunk->offset) || H5_addr_eq(new_chunk->offset, old_chunk->offset)); /* Check for chunk being same size */ if (new_chunk->length != old_chunk->length) { @@ -7651,13 +7648,13 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old } /* end else */ } /* end if */ else { - HDassert(!H5_addr_defined(new_chunk->offset)); + assert(!H5_addr_defined(new_chunk->offset)); alloc_chunk = TRUE; } /* end else */ } /* end if */ else { - HDassert(!H5_addr_defined(new_chunk->offset)); - HDassert(new_chunk->length == idx_info->layout->size); + assert(!H5_addr_defined(new_chunk->offset)); + assert(new_chunk->length == idx_info->layout->size); alloc_chunk = TRUE; } /* end else */ @@ -7671,7 +7668,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old if ((idx_info->storage->ops->get_addr)(idx_info, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query chunk address") new_chunk->offset = udata.chunk_block.offset; - HDassert(new_chunk->length == udata.chunk_block.length); + assert(new_chunk->length == udata.chunk_block.length); break; } @@ -7680,7 +7677,7 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old case H5D_CHUNK_IDX_BT2: case H5D_CHUNK_IDX_BTREE: case H5D_CHUNK_IDX_SINGLE: - HDassert(new_chunk->length > 0); + assert(new_chunk->length > 0); H5_CHECK_OVERFLOW(new_chunk->length, /*From: */ uint32_t, /*To: */ hsize_t); new_chunk->offset = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, (hsize_t)new_chunk->length); if (!H5_addr_defined(new_chunk->offset)) @@ -7690,12 +7687,12 @@ H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old case H5D_CHUNK_IDX_NTYPES: default: - HDassert(0 && "This should never be executed!"); + assert(0 && "This should never be executed!"); break; } /* end switch */ } /* end if */ - HDassert(H5_addr_defined(new_chunk->offset)); + assert(H5_addr_defined(new_chunk->offset)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -7745,7 +7742,7 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5Z_cb_t filter_cb; /* Filter failure callback struct */ size_t read_size = nbytes; /* Bytes to read */ - HDassert(read_size == new_idx_info->layout->size); + assert(read_size == new_idx_info->layout->size); /* Initialize the filter callback struct */ filter_cb.op_data = NULL; @@ -7774,7 +7771,7 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Allocate space for the filtered chunk */ if ((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, (hsize_t)nbytes)) == HADDR_UNDEF) HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") - HDassert(H5_addr_defined(chunk_addr)); + assert(H5_addr_defined(chunk_addr)); /* Write the filtered chunk to disk */ if (H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, buf) < 0) @@ -7822,7 +7819,7 @@ H5D__chunk_format_convert(H5D_t *dset, H5D_chk_idx_info_t *idx_info, H5D_chk_idx FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset); + assert(dset); /* Set up user data */ udata.new_idx_info = new_idx_info; @@ -7888,12 +7885,12 @@ H5D__chunk_index_empty(const H5D_t *dset, hbool_t *empty) FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) - HDassert(dset); - HDassert(dset->shared); - HDassert(empty); + assert(dset); + assert(dset->shared); + assert(empty); rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ - HDassert(rdcc); + assert(rdcc); /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) @@ -7945,7 +7942,7 @@ H5D__get_num_chunks_cb(const H5D_chunk_rec_t H5_ATTR_UNUSED *chunk_rec, void *_u FUNC_ENTER_PACKAGE_NOERR - HDassert(num_chunks); + assert(num_chunks); (*num_chunks)++; @@ -7979,13 +7976,13 @@ H5D__get_num_chunks(const H5D_t *dset, const H5S_t H5_ATTR_UNUSED *space, hsize_ FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) - HDassert(dset); - HDassert(dset->shared); - HDassert(space); - HDassert(nchunks); + assert(dset); + assert(dset->shared); + assert(space); + assert(nchunks); rdcc = &(dset->shared->cache.chunk); /* raw data chunk cache */ - HDassert(rdcc); + assert(rdcc); /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) @@ -8038,8 +8035,8 @@ H5D__get_chunk_info_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(chunk_rec); - HDassert(chunk_info); + assert(chunk_rec); + assert(chunk_info); /* If this is the queried chunk, retrieve its info and stop iterating */ if (chunk_info->curr_idx == chunk_info->chunk_idx) { @@ -8093,13 +8090,13 @@ H5D__get_chunk_info(const H5D_t *dset, const H5S_t H5_ATTR_UNUSED *space, hsize_ FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) - HDassert(dset); - HDassert(dset->shared); - HDassert(space); + assert(dset); + assert(dset->shared); + assert(space); /* Get the raw data chunk cache */ rdcc = &(dset->shared->cache.chunk); - HDassert(rdcc); + assert(rdcc); /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) @@ -8179,8 +8176,8 @@ H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(chunk_rec); - HDassert(chunk_info); + assert(chunk_rec); + assert(chunk_info); /* Going through the scaled, stop when a mismatch is found */ for (ii = 0; ii < chunk_info->ndims && !different; ii++) @@ -8229,16 +8226,16 @@ H5D__get_chunk_info_by_coord(const H5D_t *dset, const hsize_t *offset, unsigned FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Check args */ - HDassert(dset); - HDassert(dset->shared); - HDassert(offset); + assert(dset); + assert(dset->shared); + assert(offset); /* Get dataset layout and raw data chunk cache */ layout = &(dset->shared->layout); rdcc = &(dset->shared->cache.chunk); - HDassert(layout); - HDassert(rdcc); - HDassert(H5D_CHUNKED == layout->type); + assert(layout); + assert(rdcc); + assert(H5D_CHUNKED == layout->type); /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) @@ -8355,15 +8352,15 @@ H5D__chunk_iter(H5D_t *dset, H5D_chunk_iter_op_t op, void *op_data) FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Check args */ - HDassert(dset); - HDassert(dset->shared); + assert(dset); + assert(dset->shared); /* Get dataset layout and raw data chunk cache */ layout = &(dset->shared->layout); rdcc = &(dset->shared->cache.chunk); - HDassert(layout); - HDassert(rdcc); - HDassert(H5D_CHUNKED == layout->type); + assert(layout); + assert(rdcc); + assert(H5D_CHUNKED == layout->type); /* Search for cached chunks that haven't been written out */ for (ent = rdcc->head; ent; ent = ent->next) @@ -8416,9 +8413,9 @@ H5D__chunk_get_offset_copy(const H5D_t *dset, const hsize_t *offset, hsize_t *of FUNC_ENTER_NOAPI(FAIL) - HDassert(dset); - HDassert(offset); - HDassert(offset_copy); + assert(dset); + assert(offset); + assert(offset_copy); /* The library's chunking code requires the offset to terminate with a zero. * So transfer the offset array to an internal offset array that we diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 5f45da4..3427fdc 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -125,10 +125,10 @@ H5D__compact_fill(const H5D_t *dset) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset && H5D_COMPACT == dset->shared->layout.type); - HDassert(dset->shared->layout.storage.u.compact.buf); - HDassert(dset->shared->type); - HDassert(dset->shared->space); + assert(dset && H5D_COMPACT == dset->shared->layout.type); + assert(dset->shared->layout.storage.u.compact.buf); + assert(dset->shared->type); + assert(dset->shared->space); /* Initialize the fill value buffer */ /* (use the compact dataset storage buffer as the fill value buffer) */ @@ -176,8 +176,8 @@ H5D__compact_construct(H5F_t *f, H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(dset); + assert(f); + assert(dset); /* Check for invalid dataset dimensions */ for (u = 0; u < dset->shared->ndims; u++) @@ -189,9 +189,9 @@ H5D__compact_construct(H5F_t *f, H5D_t *dset) * layout. */ stmp_size = H5S_GET_EXTENT_NPOINTS(dset->shared->space); - HDassert(stmp_size >= 0); + assert(stmp_size >= 0); tmp_size = H5T_get_size(dset->shared->type); - HDassert(tmp_size > 0); + assert(tmp_size > 0); tmp_size = tmp_size * (hsize_t)stmp_size; H5_CHECKED_ASSIGN(dset->shared->layout.storage.u.compact.size, size_t, tmp_size, hssize_t); @@ -225,7 +225,7 @@ H5D__compact_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(storage); + assert(storage); /* Compact storage is currently always allocated */ FUNC_LEAVE_NOAPI(TRUE) @@ -328,8 +328,8 @@ H5D__compact_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset FUNC_ENTER_PACKAGE - HDassert(io_info); - HDassert(dset_info); + assert(io_info); + assert(dset_info); /* Check if file driver wishes to do its own memory management */ if (H5F_SHARED_HAS_FEATURE(io_info->f_sh, H5FD_FEAT_MEMMANAGE)) { @@ -389,8 +389,8 @@ H5D__compact_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dse FUNC_ENTER_PACKAGE - HDassert(io_info); - HDassert(dset_info); + assert(io_info); + assert(dset_info); /* Check if file driver wishes to do its own memory management */ if (H5F_SHARED_HAS_FEATURE(io_info->f_sh, H5FD_FEAT_MEMMANAGE)) { @@ -442,7 +442,7 @@ H5D__compact_flush(H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); + assert(dset); /* Check if the buffered compact information is dirty */ if (dset->shared->layout.storage.u.compact.dirty) { @@ -475,7 +475,7 @@ H5D__compact_dest(H5D_t *dset) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(dset); + assert(dset); /* Free the buffer for the raw data for compact datasets */ dset->shared->layout.storage.u.compact.buf = H5MM_xfree(dset->shared->layout.storage.u.compact.buf); @@ -514,12 +514,12 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f_src); - HDassert(storage_src); - HDassert(f_dst); - HDassert(storage_dst); - HDassert(storage_dst->buf); - HDassert(dt_src); + assert(f_src); + assert(storage_src); + assert(f_dst); + assert(storage_dst); + assert(storage_dst->buf); + assert(dt_src); /* If the dataset is open in the file, point to "layout" in the shared struct */ if (shared_fo != NULL) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 3054adc..13d6c10 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -163,8 +163,8 @@ H5D__contig_alloc(H5F_t *f, H5O_storage_contig_t *storage /*out */) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(storage); + assert(f); + assert(storage); /* Allocate space for the contiguous data */ if (HADDR_UNDEF == (storage->addr = H5MF_alloc(f, H5FD_MEM_DRAW, storage->size))) @@ -211,11 +211,11 @@ H5D__contig_fill(H5D_t *dset) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset && H5D_CONTIGUOUS == dset->shared->layout.type); - HDassert(H5_addr_defined(dset->shared->layout.storage.u.contig.addr)); - HDassert(dset->shared->layout.storage.u.contig.size > 0); - HDassert(dset->shared->space); - HDassert(dset->shared->type); + assert(dset && H5D_CONTIGUOUS == dset->shared->layout.type); + assert(H5_addr_defined(dset->shared->layout.storage.u.contig.addr)); + assert(dset->shared->layout.storage.u.contig.size > 0); + assert(dset->shared->space); + assert(dset->shared->type); #ifdef H5_HAVE_PARALLEL /* Retrieve MPI parameters */ @@ -359,8 +359,8 @@ H5D__contig_delete(H5F_t *f, const H5O_storage_t *storage) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(storage); + assert(f); + assert(storage); /* Free the file space for the chunk */ if (H5MF_xfree(f, H5FD_MEM_DRAW, storage->u.contig.addr, storage->u.contig.size) < 0) @@ -396,8 +396,8 @@ H5D__contig_construct(H5F_t *f, H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(dset); + assert(f); + assert(dset); /* * The maximum size of the dataset cannot exceed the storage size. @@ -467,8 +467,8 @@ H5D__contig_init(H5F_t H5_ATTR_UNUSED *f, const H5D_t *dset, hid_t H5_ATTR_UNUSE FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(dset); + assert(f); + assert(dset); /* Compute the size of the contiguous storage for versions of the * layout message less than version 3 because versions 1 & 2 would @@ -535,7 +535,7 @@ H5D__contig_is_space_alloc(const H5O_storage_t *storage) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(storage); + assert(storage); /* Set return value */ ret_value = (hbool_t)H5_addr_defined(storage->u.contig.addr); @@ -561,7 +561,7 @@ H5D__contig_is_data_cached(const H5D_shared_t *shared_dset) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(shared_dset); + assert(shared_dset); FUNC_LEAVE_NOAPI(shared_dset->cache.contig.sieve_size > 0) } /* end H5D__contig_is_data_cached() */ @@ -721,8 +721,8 @@ H5D__contig_mdio_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) /* Add piece if it exists */ if (dinfo->layout_io_info.contig_piece_info) { - HDassert(io_info->sel_pieces); - HDassert(io_info->pieces_added < io_info->piece_count); + assert(io_info->sel_pieces); + assert(io_info->pieces_added < io_info->piece_count); /* Add contiguous data block to sel_pieces */ io_info->sel_pieces[io_info->pieces_added] = dinfo->layout_io_info.contig_piece_info; @@ -757,10 +757,10 @@ H5D__contig_may_use_select_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t * FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->dset); - HDassert(op_type == H5D_IO_OP_READ || op_type == H5D_IO_OP_WRITE); + assert(io_info); + assert(dset_info); + assert(dset_info->dset); + assert(op_type == H5D_IO_OP_READ || op_type == H5D_IO_OP_WRITE); dataset = dset_info->dset; @@ -782,7 +782,7 @@ H5D__contig_may_use_select_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t * else { hbool_t page_buf_enabled; - HDassert(dset_info->layout_ops.writevv == H5D__contig_writevv); + assert(dset_info->layout_ops.writevv == H5D__contig_writevv); /* Check if the page buffer is enabled */ if (H5PB_enabled(io_info->f_sh, H5FD_MEM_DRAW, &page_buf_enabled) < 0) @@ -817,11 +817,11 @@ H5D__contig_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dinfo); - HDassert(dinfo->buf.vp); - HDassert(dinfo->mem_space); - HDassert(dinfo->file_space); + assert(io_info); + assert(dinfo); + assert(dinfo->buf.vp); + assert(dinfo->mem_space); + assert(dinfo->file_space); if (io_info->use_select_io == H5D_SELECTION_IO_MODE_ON) { /* Only perform I/O if not performing multi dataset I/O or type conversion, @@ -842,12 +842,12 @@ H5D__contig_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) else { if (dinfo->layout_io_info.contig_piece_info) { /* Add to mdset selection I/O arrays */ - HDassert(io_info->mem_spaces); - HDassert(io_info->file_spaces); - HDassert(io_info->addrs); - HDassert(io_info->element_sizes); - HDassert(io_info->rbufs); - HDassert(io_info->pieces_added < io_info->piece_count); + assert(io_info->mem_spaces); + assert(io_info->file_spaces); + assert(io_info->addrs); + assert(io_info->element_sizes); + assert(io_info->rbufs); + assert(io_info->pieces_added < io_info->piece_count); io_info->mem_spaces[io_info->pieces_added] = dinfo->mem_space; io_info->file_spaces[io_info->pieces_added] = dinfo->file_space; @@ -894,11 +894,11 @@ H5D__contig_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dinfo); - HDassert(dinfo->buf.cvp); - HDassert(dinfo->mem_space); - HDassert(dinfo->file_space); + assert(io_info); + assert(dinfo); + assert(dinfo->buf.cvp); + assert(dinfo->mem_space); + assert(dinfo->file_space); if (io_info->use_select_io == H5D_SELECTION_IO_MODE_ON) { /* Only perform I/O if not performing multi dataset I/O or type conversion, @@ -919,12 +919,12 @@ H5D__contig_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) else { if (dinfo->layout_io_info.contig_piece_info) { /* Add to mdset selection I/O arrays */ - HDassert(io_info->mem_spaces); - HDassert(io_info->file_spaces); - HDassert(io_info->addrs); - HDassert(io_info->element_sizes); - HDassert(io_info->wbufs); - HDassert(io_info->pieces_added < io_info->piece_count); + assert(io_info->mem_spaces); + assert(io_info->file_spaces); + assert(io_info->addrs); + assert(io_info->element_sizes); + assert(io_info->wbufs); + assert(io_info->pieces_added < io_info->piece_count); io_info->mem_spaces[io_info->pieces_added] = dinfo->mem_space; io_info->file_spaces[io_info->pieces_added] = dinfo->file_space; @@ -978,7 +978,7 @@ H5D__contig_write_one(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hsi FUNC_ENTER_PACKAGE - HDassert(io_info); + assert(io_info); if (H5D__contig_writevv(io_info, dset_info, (size_t)1, &dset_curr_seq, &dset_len, &dset_off, (size_t)1, &mem_curr_seq, &mem_len, &mem_off) < 0) @@ -1212,14 +1212,14 @@ H5D__contig_readvv(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_curr_seq); - HDassert(dset_len_arr); - HDassert(dset_off_arr); - HDassert(mem_curr_seq); - HDassert(mem_len_arr); - HDassert(mem_off_arr); + assert(io_info); + assert(dset_info); + assert(dset_curr_seq); + assert(dset_len_arr); + assert(dset_off_arr); + assert(mem_curr_seq); + assert(mem_len_arr); + assert(mem_off_arr); /* Check if data sieving is enabled */ if (H5F_SHARED_HAS_FEATURE(io_info->f_sh, H5FD_FEAT_DATA_SIEVE)) { @@ -1531,14 +1531,14 @@ H5D__contig_writevv(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_curr_seq); - HDassert(dset_len_arr); - HDassert(dset_off_arr); - HDassert(mem_curr_seq); - HDassert(mem_len_arr); - HDassert(mem_off_arr); + assert(io_info); + assert(dset_info); + assert(dset_curr_seq); + assert(dset_len_arr); + assert(dset_off_arr); + assert(mem_curr_seq); + assert(mem_len_arr); + assert(mem_off_arr); /* Check if data sieving is enabled */ if (H5F_SHARED_HAS_FEATURE(io_info->f_sh, H5FD_FEAT_DATA_SIEVE)) { @@ -1595,7 +1595,7 @@ H5D__contig_flush(H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); + assert(dset); /* Flush any data in sieve buffer */ if (H5D__flush_sieve_buf(dset) < 0) @@ -1621,7 +1621,7 @@ H5D__contig_io_term(H5D_io_info_t H5_ATTR_UNUSED *io_info, H5D_dset_io_info_t *d FUNC_ENTER_PACKAGE - HDassert(di); + assert(di); /* Free piece info */ if (di->layout_io_info.contig_piece_info) { @@ -1686,11 +1686,11 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f_src); - HDassert(storage_src); - HDassert(f_dst); - HDassert(storage_dst); - HDassert(dt_src); + assert(f_src); + assert(storage_src); + assert(f_dst); + assert(storage_dst); + assert(dt_src); /* Allocate space for destination raw data */ if (H5D__contig_alloc(f_dst, storage_dst) < 0) @@ -1787,7 +1787,7 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f } /* end else */ /* Allocate space for copy buffer */ - HDassert(buf_size); + assert(buf_size); if (NULL == (buf = H5FL_BLK_MALLOC(type_conv, buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for copy buffer") diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 36c3dbc..5a98967 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -221,9 +221,9 @@ H5D__earray_crt_context(void *_udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(udata); - HDassert(udata->f); - HDassert(udata->chunk_size > 0); + assert(udata); + assert(udata->f); + assert(udata->chunk_size > 0); /* Allocate new context structure */ if (NULL == (ctx = H5FL_MALLOC(H5D_earray_ctx_t))) @@ -268,7 +268,7 @@ H5D__earray_dst_context(void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(ctx); + assert(ctx); /* Release context structure */ ctx = H5FL_FREE(H5D_earray_ctx_t, ctx); @@ -297,8 +297,8 @@ H5D__earray_fill(void *nat_blk, size_t nelmts) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(nat_blk); - HDassert(nelmts); + assert(nat_blk); + assert(nelmts); H5VM_array_fill(nat_blk, &fill_val, H5EA_CLS_CHUNK->nat_elmt_size, nelmts); @@ -327,10 +327,10 @@ H5D__earray_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); - HDassert(ctx); + assert(raw); + assert(elmt); + assert(nelmts); + assert(ctx); /* Encode native elements into raw elements */ while (nelmts) { @@ -371,9 +371,9 @@ H5D__earray_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); + assert(raw); + assert(elmt); + assert(nelmts); /* Decode raw elements into native elements */ while (nelmts) { @@ -412,8 +412,8 @@ H5D__earray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(stream); - HDassert(elmt); + assert(stream); + assert(elmt); /* Print element */ HDsnprintf(temp_str, sizeof(temp_str), "Element #%" PRIuHSIZE ":", idx); @@ -443,9 +443,9 @@ H5D__earray_filt_fill(void *nat_blk, size_t nelmts) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(nat_blk); - HDassert(nelmts); - HDassert(sizeof(fill_val) == H5EA_CLS_FILT_CHUNK->nat_elmt_size); + assert(nat_blk); + assert(nelmts); + assert(sizeof(fill_val) == H5EA_CLS_FILT_CHUNK->nat_elmt_size); H5VM_array_fill(nat_blk, &fill_val, H5EA_CLS_FILT_CHUNK->nat_elmt_size, nelmts); @@ -476,10 +476,10 @@ H5D__earray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); - HDassert(ctx); + assert(raw); + assert(elmt); + assert(nelmts); + assert(ctx); /* Encode native elements into raw elements */ while (nelmts) { @@ -523,9 +523,9 @@ H5D__earray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); + assert(raw); + assert(elmt); + assert(nelmts); /* Decode raw elements into native elements */ while (nelmts) { @@ -568,8 +568,8 @@ H5D__earray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(stream); - HDassert(elmt); + assert(stream); + assert(elmt); /* Print element */ HDsnprintf(temp_str, sizeof(temp_str), "Element #%" PRIuHSIZE ":", idx); @@ -604,8 +604,8 @@ H5D__earray_crt_dbg_context(H5F_t *f, haddr_t obj_addr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(H5_addr_defined(obj_addr)); + assert(f); + assert(H5_addr_defined(obj_addr)); /* Allocate context for debugging callback */ if (NULL == (dbg_ctx = H5FL_MALLOC(H5D_earray_ctx_ud_t))) @@ -675,7 +675,7 @@ H5D__earray_dst_dbg_context(void *_dbg_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(dbg_ctx); + assert(dbg_ctx); /* Release context structure */ dbg_ctx = H5FL_FREE(H5D_earray_ctx_ud_t, dbg_ctx); @@ -708,16 +708,16 @@ H5D__earray_idx_depend(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(H5D_CHUNK_IDX_EARRAY == idx_info->layout->idx_type); - HDassert(idx_info->storage); - HDassert(H5D_CHUNK_IDX_EARRAY == idx_info->storage->idx_type); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(idx_info->storage->u.earray.ea); + assert(idx_info); + assert(idx_info->f); + assert(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE); + assert(idx_info->pline); + assert(idx_info->layout); + assert(H5D_CHUNK_IDX_EARRAY == idx_info->layout->idx_type); + assert(idx_info->storage); + assert(H5D_CHUNK_IDX_EARRAY == idx_info->storage->idx_type); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info->storage->u.earray.ea); /* Set up object header location for dataset */ H5O_loc_reset(&oloc); @@ -772,15 +772,15 @@ H5D__earray_idx_open(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(H5D_CHUNK_IDX_EARRAY == idx_info->layout->idx_type); - HDassert(idx_info->storage); - HDassert(H5D_CHUNK_IDX_EARRAY == idx_info->storage->idx_type); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(NULL == idx_info->storage->u.earray.ea); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(H5D_CHUNK_IDX_EARRAY == idx_info->layout->idx_type); + assert(idx_info->storage); + assert(H5D_CHUNK_IDX_EARRAY == idx_info->storage->idx_type); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(NULL == idx_info->storage->u.earray.ea); /* Set up the user data */ udata.f = idx_info->f; @@ -826,13 +826,13 @@ H5D__earray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, had FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(space); - HDassert(H5_addr_defined(dset_ohdr_addr)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(space); + assert(H5_addr_defined(dset_ohdr_addr)); /* Get the dim info for dataset */ if ((sndims = H5S_get_simple_extent_dims(space, NULL, max_dims)) < 0) @@ -895,13 +895,13 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(!H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(NULL == idx_info->storage->u.earray.ea); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(!H5_addr_defined(idx_info->storage->idx_addr)); + assert(NULL == idx_info->storage->u.earray.ea); /* General parameters */ if (idx_info->pline->nused > 0) { @@ -922,15 +922,15 @@ H5D__earray_idx_create(const H5D_chk_idx_info_t *idx_info) cparam.raw_elmt_size = (uint8_t)H5F_SIZEOF_ADDR(idx_info->f); } /* end else */ cparam.max_nelmts_bits = idx_info->layout->u.earray.cparam.max_nelmts_bits; - HDassert(cparam.max_nelmts_bits > 0); + assert(cparam.max_nelmts_bits > 0); cparam.idx_blk_elmts = idx_info->layout->u.earray.cparam.idx_blk_elmts; - HDassert(cparam.idx_blk_elmts > 0); + assert(cparam.idx_blk_elmts > 0); cparam.sup_blk_min_data_ptrs = idx_info->layout->u.earray.cparam.sup_blk_min_data_ptrs; - HDassert(cparam.sup_blk_min_data_ptrs > 0); + assert(cparam.sup_blk_min_data_ptrs > 0); cparam.data_blk_min_elmts = idx_info->layout->u.earray.cparam.data_blk_min_elmts; - HDassert(cparam.data_blk_min_elmts > 0); + assert(cparam.data_blk_min_elmts > 0); cparam.max_dblk_page_nelmts_bits = idx_info->layout->u.earray.cparam.max_dblk_page_nelmts_bits; - HDassert(cparam.max_dblk_page_nelmts_bits > 0); + assert(cparam.max_dblk_page_nelmts_bits > 0); /* Set up the user data */ udata.f = idx_info->f; @@ -972,7 +972,7 @@ H5D__earray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) } /* end H5D__earray_idx_is_space_alloc() */ @@ -998,13 +998,13 @@ H5D__earray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Check if the extensible array is open yet */ if (NULL == idx_info->storage->u.earray.ea) { @@ -1069,13 +1069,13 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Check if the extensible array is open yet */ if (NULL == idx_info->storage->u.earray.ea) { @@ -1162,7 +1162,7 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(layout); + assert(layout); /* "Swizzle" constant dimensions for this dataset */ if (layout->u.earray.unlim_dim > 0) { @@ -1232,7 +1232,7 @@ H5D__earray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void * /* Update coordinates of chunk in dataset */ ndims = udata->common.layout->ndims - 1; - HDassert(ndims > 0); + assert(ndims > 0); curr_dim = (int)(ndims - 1); while (curr_dim >= 0) { /* Increment coordinate in current dimension */ @@ -1278,14 +1278,14 @@ H5D__earray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(chunk_cb); - HDassert(chunk_udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(chunk_cb); + assert(chunk_udata); /* Check if the extensible array is open yet */ if (NULL == idx_info->storage->u.earray.ea) { @@ -1350,13 +1350,13 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Check if the extensible array is open yet */ if (NULL == idx_info->storage->u.earray.ea) { @@ -1402,7 +1402,7 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Remove raw data chunk from file if not doing SWMR writes */ - HDassert(H5_addr_defined(elmt.addr)); + assert(H5_addr_defined(elmt.addr)); if (!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(elmt.nbytes, /*From: */ uint32_t, /*To: */ hsize_t); if (H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, elmt.addr, (hsize_t)elmt.nbytes) < 0) @@ -1424,7 +1424,7 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Remove raw data chunk from file if not doing SWMR writes */ - HDassert(H5_addr_defined(addr)); + assert(H5_addr_defined(addr)); if (!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(idx_info->layout->size, /*From: */ uint32_t, /*To: */ hsize_t); if (H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, addr, (hsize_t)idx_info->layout->size) < 0) @@ -1463,10 +1463,10 @@ H5D__earray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(chunk_rec); - HDassert(H5_addr_defined(chunk_rec->chunk_addr)); - HDassert(chunk_rec->nbytes > 0); - HDassert(f); + assert(chunk_rec); + assert(H5_addr_defined(chunk_rec->chunk_addr)); + assert(chunk_rec->nbytes > 0); + assert(f); /* Remove raw data chunk from file */ H5_CHECK_OVERFLOW(chunk_rec->nbytes, /*From: */ uint32_t, /*To: */ hsize_t); @@ -1503,11 +1503,11 @@ H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); /* Check if the index data structure has been allocated */ if (H5_addr_defined(idx_info->storage->idx_addr)) { @@ -1532,7 +1532,7 @@ H5D__earray_idx_delete(const H5D_chk_idx_info_t *idx_info) idx_info->storage->idx_addr = HADDR_UNDEF; } /* end if */ else - HDassert(NULL == idx_info->storage->u.earray.ea); + assert(NULL == idx_info->storage->u.earray.ea); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1558,17 +1558,17 @@ H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info_src); - HDassert(idx_info_src->f); - HDassert(idx_info_src->pline); - HDassert(idx_info_src->layout); - HDassert(idx_info_src->storage); - HDassert(idx_info_dst); - HDassert(idx_info_dst->f); - HDassert(idx_info_dst->pline); - HDassert(idx_info_dst->layout); - HDassert(idx_info_dst->storage); - HDassert(!H5_addr_defined(idx_info_dst->storage->idx_addr)); + assert(idx_info_src); + assert(idx_info_src->f); + assert(idx_info_src->pline); + assert(idx_info_src->layout); + assert(idx_info_src->storage); + assert(idx_info_dst); + assert(idx_info_dst->f); + assert(idx_info_dst->pline); + assert(idx_info_dst->layout); + assert(idx_info_dst->storage); + assert(!H5_addr_defined(idx_info_dst->storage->idx_addr)); /* Check if the source extensible array is open yet */ if (NULL == idx_info_src->storage->u.earray.ea) @@ -1582,7 +1582,7 @@ H5D__earray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk /* Create the extensible array that describes chunked storage in the dest. file */ if (H5D__earray_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") - HDassert(H5_addr_defined(idx_info_dst->storage->idx_addr)); + assert(H5_addr_defined(idx_info_dst->storage->idx_addr)); /* Reset metadata tag */ H5_END_TAG @@ -1611,10 +1611,10 @@ H5D__earray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chun FUNC_ENTER_PACKAGE /* Check args */ - HDassert(storage_src); - HDassert(storage_src->u.earray.ea); - HDassert(storage_dst); - HDassert(storage_dst->u.earray.ea); + assert(storage_src); + assert(storage_src->u.earray.ea); + assert(storage_dst); + assert(storage_dst->u.earray.ea); /* Close extensible arrays */ if (H5EA_close(storage_src->u.earray.ea) < 0) @@ -1651,13 +1651,13 @@ H5D__earray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(index_size); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(index_size); /* Open the extensible array in file */ if (H5D__earray_idx_open(idx_info) < 0) @@ -1702,7 +1702,7 @@ H5D__earray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); /* Reset index info */ if (reset_addr) { @@ -1732,8 +1732,8 @@ H5D__earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); - HDassert(stream); + assert(storage); + assert(stream); HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); @@ -1760,9 +1760,9 @@ H5D__earray_idx_dest(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->storage); /* Check if the extensible array is open */ if (idx_info->storage->u.earray.ea) { diff --git a/src/H5Defl.c b/src/H5Defl.c index 80a85f4..0732829 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -126,8 +126,8 @@ H5D__efl_construct(H5F_t *f, H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(dset); + assert(f); + assert(dset); /* * The maximum size of the dataset cannot exceed the storage size. @@ -158,7 +158,7 @@ H5D__efl_construct(H5F_t *f, H5D_t *dset) /* Compute the total size of dataset */ stmp_size = H5S_GET_EXTENT_NPOINTS(dset->shared->space); - HDassert(stmp_size >= 0); + assert(stmp_size >= 0); tmp_size = (hsize_t)stmp_size * dt_size; H5_CHECKED_ASSIGN(dset->shared->layout.storage.u.contig.size, hsize_t, tmp_size, hssize_t); @@ -187,7 +187,7 @@ H5D__efl_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(storage); + assert(storage); /* EFL storage is currently always treated as allocated */ FUNC_LEAVE_NOAPI(TRUE) @@ -252,10 +252,10 @@ H5D__efl_read(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t size FUNC_ENTER_PACKAGE /* Check args */ - HDassert(efl && efl->nused > 0); - HDassert(H5_addr_defined(addr)); - HDassert(size < SIZE_MAX); - HDassert(buf || 0 == size); + assert(efl && efl->nused > 0); + assert(H5_addr_defined(addr)); + assert(size < SIZE_MAX); + assert(buf || 0 == size); /* Find the first efl member from which to read */ for (u = 0, cur = 0; u < efl->nused; u++) { @@ -268,7 +268,7 @@ H5D__efl_read(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t size /* Read the data */ while (size) { - HDassert(buf); + assert(buf); if (u >= efl->nused) HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "read past logical end of file") if (H5F_OVERFLOW_HSIZET2OFFT((hsize_t)efl->slot[u].offset + skip)) @@ -340,10 +340,10 @@ H5D__efl_write(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t siz FUNC_ENTER_PACKAGE /* Check args */ - HDassert(efl && efl->nused > 0); - HDassert(H5_addr_defined(addr)); - HDassert(size < SIZE_MAX); - HDassert(buf || 0 == size); + assert(efl && efl->nused > 0); + assert(H5_addr_defined(addr)); + assert(size < SIZE_MAX); + assert(buf || 0 == size); /* Find the first efl member in which to write */ for (u = 0, cur = 0; u < efl->nused; u++) { @@ -356,7 +356,7 @@ H5D__efl_write(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t siz /* Write the data */ while (size) { - HDassert(buf); + assert(buf); if (u >= efl->nused) HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "write past logical end of file") if (H5F_OVERFLOW_HSIZET2OFFT((hsize_t)efl->slot[u].offset + skip)) @@ -452,18 +452,18 @@ H5D__efl_readvv(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds FUNC_ENTER_PACKAGE /* Check args */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->store->efl.nused > 0); - HDassert(dset_info->buf.vp); - HDassert(dset_info->dset); - HDassert(dset_info->dset->shared); - HDassert(dset_curr_seq); - HDassert(dset_len_arr); - HDassert(dset_off_arr); - HDassert(mem_curr_seq); - HDassert(mem_len_arr); - HDassert(mem_off_arr); + assert(io_info); + assert(dset_info); + assert(dset_info->store->efl.nused > 0); + assert(dset_info->buf.vp); + assert(dset_info->dset); + assert(dset_info->dset->shared); + assert(dset_curr_seq); + assert(dset_len_arr); + assert(dset_off_arr); + assert(mem_curr_seq); + assert(mem_len_arr); + assert(mem_off_arr); /* Set up user data for H5VM_opvv() */ udata.efl = &(dset_info->store->efl); @@ -533,18 +533,18 @@ H5D__efl_writevv(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_d FUNC_ENTER_PACKAGE /* Check args */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->store->efl.nused > 0); - HDassert(dset_info->buf.cvp); - HDassert(dset_info->dset); - HDassert(dset_info->dset->shared); - HDassert(dset_curr_seq); - HDassert(dset_len_arr); - HDassert(dset_off_arr); - HDassert(mem_curr_seq); - HDassert(mem_len_arr); - HDassert(mem_off_arr); + assert(io_info); + assert(dset_info); + assert(dset_info->store->efl.nused > 0); + assert(dset_info->buf.cvp); + assert(dset_info->dset); + assert(dset_info->dset->shared); + assert(dset_curr_seq); + assert(dset_len_arr); + assert(dset_off_arr); + assert(mem_curr_seq); + assert(mem_len_arr); + assert(mem_off_arr); /* Set up user data for H5VM_opvv() */ udata.efl = &(dset_info->store->efl); @@ -580,10 +580,10 @@ H5D__efl_bh_info(H5F_t *f, H5O_efl_t *efl, hsize_t *heap_size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(efl); - HDassert(H5_addr_defined(efl->heap_addr)); - HDassert(heap_size); + assert(f); + assert(efl); + assert(H5_addr_defined(efl->heap_addr)); + assert(heap_size); /* Get the size of the local heap for EFL's file list */ if (H5HL_heapsize(f, efl->heap_addr, heap_size) < 0) diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index e215230..0cd09dd 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -220,9 +220,9 @@ H5D__farray_crt_context(void *_udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(udata); - HDassert(udata->f); - HDassert(udata->chunk_size > 0); + assert(udata); + assert(udata->f); + assert(udata->chunk_size > 0); /* Allocate new context structure */ if (NULL == (ctx = H5FL_MALLOC(H5D_farray_ctx_t))) @@ -266,7 +266,7 @@ H5D__farray_dst_context(void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(ctx); + assert(ctx); /* Release context structure */ ctx = H5FL_FREE(H5D_farray_ctx_t, ctx); @@ -295,8 +295,8 @@ H5D__farray_fill(void *nat_blk, size_t nelmts) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(nat_blk); - HDassert(nelmts); + assert(nat_blk); + assert(nelmts); H5VM_array_fill(nat_blk, &fill_val, H5FA_CLS_CHUNK->nat_elmt_size, nelmts); @@ -325,10 +325,10 @@ H5D__farray_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); - HDassert(ctx); + assert(raw); + assert(elmt); + assert(nelmts); + assert(ctx); /* Encode native elements into raw elements */ while (nelmts) { @@ -369,9 +369,9 @@ H5D__farray_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); + assert(raw); + assert(elmt); + assert(nelmts); /* Decode raw elements into native elements */ while (nelmts) { @@ -410,8 +410,8 @@ H5D__farray_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(stream); - HDassert(elmt); + assert(stream); + assert(elmt); /* Print element */ HDsnprintf(temp_str, sizeof(temp_str), "Element #%" PRIuHSIZE ":", idx); @@ -446,8 +446,8 @@ H5D__farray_crt_dbg_context(H5F_t *f, haddr_t obj_addr) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(H5_addr_defined(obj_addr)); + assert(f); + assert(H5_addr_defined(obj_addr)); /* Allocate context for debugging callback */ if (NULL == (dbg_ctx = H5FL_MALLOC(H5D_farray_ctx_ud_t))) @@ -516,7 +516,7 @@ H5D__farray_dst_dbg_context(void *_dbg_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(dbg_ctx); + assert(dbg_ctx); /* Release context structure */ dbg_ctx = H5FL_FREE(H5D_farray_ctx_ud_t, dbg_ctx); @@ -545,9 +545,9 @@ H5D__farray_filt_fill(void *nat_blk, size_t nelmts) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(nat_blk); - HDassert(nelmts); - HDassert(sizeof(fill_val) == H5FA_CLS_FILT_CHUNK->nat_elmt_size); + assert(nat_blk); + assert(nelmts); + assert(sizeof(fill_val) == H5FA_CLS_FILT_CHUNK->nat_elmt_size); H5VM_array_fill(nat_blk, &fill_val, H5FA_CLS_FILT_CHUNK->nat_elmt_size, nelmts); @@ -578,10 +578,10 @@ H5D__farray_filt_encode(void *_raw, const void *_elmt, size_t nelmts, void *_ctx FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); - HDassert(ctx); + assert(raw); + assert(elmt); + assert(nelmts); + assert(ctx); /* Encode native elements into raw elements */ while (nelmts) { @@ -625,9 +625,9 @@ H5D__farray_filt_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); + assert(raw); + assert(elmt); + assert(nelmts); /* Decode raw elements into native elements */ while (nelmts) { @@ -670,8 +670,8 @@ H5D__farray_filt_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(stream); - HDassert(elmt); + assert(stream); + assert(elmt); /* Print element */ HDsnprintf(temp_str, sizeof(temp_str), "Element #%" PRIuHSIZE ":", idx); @@ -706,16 +706,16 @@ H5D__farray_idx_depend(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(H5D_CHUNK_IDX_FARRAY == idx_info->layout->idx_type); - HDassert(idx_info->storage); - HDassert(H5D_CHUNK_IDX_FARRAY == idx_info->storage->idx_type); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(idx_info->storage->u.farray.fa); + assert(idx_info); + assert(idx_info->f); + assert(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE); + assert(idx_info->pline); + assert(idx_info->layout); + assert(H5D_CHUNK_IDX_FARRAY == idx_info->layout->idx_type); + assert(idx_info->storage); + assert(H5D_CHUNK_IDX_FARRAY == idx_info->storage->idx_type); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info->storage->u.farray.fa); /* Set up object header location for dataset */ H5O_loc_reset(&oloc); @@ -762,9 +762,9 @@ H5D__farray_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t H5_ATTR_UNU FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(idx_info); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(dset_ohdr_addr)); + assert(idx_info); + assert(idx_info->storage); + assert(H5_addr_defined(dset_ohdr_addr)); idx_info->storage->u.farray.dset_ohdr_addr = dset_ohdr_addr; @@ -794,15 +794,15 @@ H5D__farray_idx_open(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(H5D_CHUNK_IDX_FARRAY == idx_info->layout->idx_type); - HDassert(idx_info->storage); - HDassert(H5D_CHUNK_IDX_FARRAY == idx_info->storage->idx_type); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(NULL == idx_info->storage->u.farray.fa); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(H5D_CHUNK_IDX_FARRAY == idx_info->layout->idx_type); + assert(idx_info->storage); + assert(H5D_CHUNK_IDX_FARRAY == idx_info->storage->idx_type); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(NULL == idx_info->storage->u.farray.fa); /* Set up the user data */ udata.f = idx_info->f; @@ -851,14 +851,14 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(!H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(NULL == idx_info->storage->u.farray.fa); - HDassert(idx_info->layout->nchunks); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(!H5_addr_defined(idx_info->storage->idx_addr)); + assert(NULL == idx_info->storage->u.farray.fa); + assert(idx_info->layout->nchunks); /* General parameters */ if (idx_info->pline->nused > 0) { @@ -879,7 +879,7 @@ H5D__farray_idx_create(const H5D_chk_idx_info_t *idx_info) cparam.raw_elmt_size = (uint8_t)H5F_SIZEOF_ADDR(idx_info->f); } /* end else */ cparam.max_dblk_page_nelmts_bits = idx_info->layout->u.farray.cparam.max_dblk_page_nelmts_bits; - HDassert(cparam.max_dblk_page_nelmts_bits > 0); + assert(cparam.max_dblk_page_nelmts_bits > 0); cparam.nelmts = idx_info->layout->max_nchunks; /* Set up the user data */ @@ -922,7 +922,7 @@ H5D__farray_idx_is_space_alloc(const H5O_storage_chunk_t *storage) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) } /* end H5D__farray_idx_is_space_alloc() */ @@ -948,13 +948,13 @@ H5D__farray_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Check if the fixed array is open yet */ if (NULL == idx_info->storage->u.farray.fa) { @@ -1019,13 +1019,13 @@ H5D__farray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Check if the fixed array is open yet */ if (NULL == idx_info->storage->u.farray.fa) { @@ -1115,7 +1115,7 @@ H5D__farray_idx_iterate_cb(hsize_t H5_ATTR_UNUSED idx, const void *_elmt, void * /* Update coordinates of chunk in dataset */ ndims = udata->common.layout->ndims - 1; - HDassert(ndims > 0); + assert(ndims > 0); curr_dim = (int)(ndims - 1); while (curr_dim >= 0) { /* Increment coordinate in current dimension */ @@ -1157,14 +1157,14 @@ H5D__farray_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(chunk_cb); - HDassert(chunk_udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(chunk_cb); + assert(chunk_udata); /* Check if the fixed array is open yet */ if (NULL == idx_info->storage->u.farray.fa) { @@ -1230,13 +1230,13 @@ H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(udata); /* Check if the fixed array is open yet */ if (NULL == idx_info->storage->u.farray.fa) { @@ -1264,7 +1264,7 @@ H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk info") /* Remove raw data chunk from file if not doing SWMR writes */ - HDassert(H5_addr_defined(elmt.addr)); + assert(H5_addr_defined(elmt.addr)); if (!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(elmt.nbytes, /*From: */ uint32_t, /*To: */ hsize_t); if (H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, elmt.addr, (hsize_t)elmt.nbytes) < 0) @@ -1286,7 +1286,7 @@ H5D__farray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Remove raw data chunk from file if not doing SWMR writes */ - HDassert(H5_addr_defined(addr)); + assert(H5_addr_defined(addr)); if (!(H5F_INTENT(idx_info->f) & H5F_ACC_SWMR_WRITE)) { H5_CHECK_OVERFLOW(idx_info->layout->size, /*From: */ uint32_t, /*To: */ hsize_t); if (H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, addr, (hsize_t)idx_info->layout->size) < 0) @@ -1325,10 +1325,10 @@ H5D__farray_idx_delete_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(chunk_rec); - HDassert(H5_addr_defined(chunk_rec->chunk_addr)); - HDassert(chunk_rec->nbytes > 0); - HDassert(f); + assert(chunk_rec); + assert(H5_addr_defined(chunk_rec->chunk_addr)); + assert(chunk_rec->nbytes > 0); + assert(f); /* Remove raw data chunk from file */ H5_CHECK_OVERFLOW(chunk_rec->nbytes, /*From: */ uint32_t, /*To: */ hsize_t); @@ -1361,11 +1361,11 @@ H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); /* Check if the index data structure has been allocated */ if (H5_addr_defined(idx_info->storage->idx_addr)) { @@ -1390,7 +1390,7 @@ H5D__farray_idx_delete(const H5D_chk_idx_info_t *idx_info) idx_info->storage->idx_addr = HADDR_UNDEF; } /* end if */ else - HDassert(NULL == idx_info->storage->u.farray.fa); + assert(NULL == idx_info->storage->u.farray.fa); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1416,17 +1416,17 @@ H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info_src); - HDassert(idx_info_src->f); - HDassert(idx_info_src->pline); - HDassert(idx_info_src->layout); - HDassert(idx_info_src->storage); - HDassert(idx_info_dst); - HDassert(idx_info_dst->f); - HDassert(idx_info_dst->pline); - HDassert(idx_info_dst->layout); - HDassert(idx_info_dst->storage); - HDassert(!H5_addr_defined(idx_info_dst->storage->idx_addr)); + assert(idx_info_src); + assert(idx_info_src->f); + assert(idx_info_src->pline); + assert(idx_info_src->layout); + assert(idx_info_src->storage); + assert(idx_info_dst); + assert(idx_info_dst->f); + assert(idx_info_dst->pline); + assert(idx_info_dst->layout); + assert(idx_info_dst->storage); + assert(!H5_addr_defined(idx_info_dst->storage->idx_addr)); /* Check if the source fixed array is open yet */ if (NULL == idx_info_src->storage->u.farray.fa) @@ -1440,7 +1440,7 @@ H5D__farray_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk /* Create the fixed array that describes chunked storage in the dest. file */ if (H5D__farray_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") - HDassert(H5_addr_defined(idx_info_dst->storage->idx_addr)); + assert(H5_addr_defined(idx_info_dst->storage->idx_addr)); /* Reset metadata tag */ H5_END_TAG @@ -1469,10 +1469,10 @@ H5D__farray_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chun FUNC_ENTER_PACKAGE /* Check args */ - HDassert(storage_src); - HDassert(storage_src->u.farray.fa); - HDassert(storage_dst); - HDassert(storage_dst->u.farray.fa); + assert(storage_src); + assert(storage_src->u.farray.fa); + assert(storage_dst); + assert(storage_dst->u.farray.fa); /* Close fixed arrays */ if (H5FA_close(storage_src->u.farray.fa) < 0) @@ -1509,13 +1509,13 @@ H5D__farray_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); - HDassert(index_size); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(index_size); /* Open the fixed array in file */ if (H5D__farray_idx_open(idx_info) < 0) @@ -1559,7 +1559,7 @@ H5D__farray_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); /* Reset index info */ if (reset_addr) @@ -1587,8 +1587,8 @@ H5D__farray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); - HDassert(stream); + assert(storage); + assert(stream); HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); @@ -1615,9 +1615,9 @@ H5D__farray_idx_dest(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->storage); /* Check if the fixed array is open */ if (idx_info->storage->u.farray.fa) { diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 5275323..c22036e 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -128,10 +128,10 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ FUNC_ENTER_PACKAGE /* Check args */ - HDassert(fill_type); - HDassert(buf); - HDassert(buf_type); - HDassert(space); + assert(fill_type); + assert(buf); + assert(buf_type); + assert(space); /* Make sure the dataspace has an extent set (or is NULL) */ if (!(H5S_has_extent(space))) @@ -313,10 +313,10 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat FUNC_ENTER_PACKAGE /* Check args */ - HDassert(fb_info); - HDassert(fill); - HDassert(dset_type); - HDassert(dset_type_id > 0); + assert(fb_info); + assert(fill); + assert(dset_type); + assert(dset_type_id > 0); /* Reset fill buffer information */ HDmemset(fb_info, 0, sizeof(*fb_info)); @@ -349,9 +349,9 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat /* Retrieve sizes of memory & file datatypes */ fb_info->mem_elmt_size = H5T_get_size(fb_info->mem_type); - HDassert(fb_info->mem_elmt_size > 0); + assert(fb_info->mem_elmt_size > 0); fb_info->file_elmt_size = H5T_get_size(dset_type); - HDassert(fb_info->file_elmt_size == (size_t)fill->size); + assert(fb_info->file_elmt_size == (size_t)fill->size); /* If fill value is not library default, use it to set the element size */ fb_info->max_elmt_size = MAX(fb_info->mem_elmt_size, fb_info->file_elmt_size); @@ -361,7 +361,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat fb_info->elmts_per_buf = MIN(total_nelmts, MAX(1, (max_buf_size / fb_info->max_elmt_size))); else fb_info->elmts_per_buf = max_buf_size / fb_info->max_elmt_size; - HDassert(fb_info->elmts_per_buf > 0); + assert(fb_info->elmts_per_buf > 0); /* Compute the buffer size to use */ fb_info->fill_buf_size = MIN(max_buf_size, (fb_info->elmts_per_buf * fb_info->max_elmt_size)); @@ -406,7 +406,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat } /* end if */ else { /* If fill value is not library default, use it to set the element size */ - HDassert(fill->size >= 0); + assert(fill->size >= 0); fb_info->max_elmt_size = fb_info->file_elmt_size = fb_info->mem_elmt_size = (size_t)fill->size; /* Compute the number of elements that fit within a buffer to write */ @@ -414,7 +414,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat fb_info->elmts_per_buf = MIN(total_nelmts, MAX(1, (max_buf_size / fb_info->max_elmt_size))); else fb_info->elmts_per_buf = max_buf_size / fb_info->max_elmt_size; - HDassert(fb_info->elmts_per_buf > 0); + assert(fb_info->elmts_per_buf > 0); /* Compute the buffer size to use */ fb_info->fill_buf_size = MIN(max_buf_size, fb_info->elmts_per_buf * fb_info->max_elmt_size); @@ -440,14 +440,14 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat else { /* Fill the buffer with the default fill value */ /* Retrieve size of elements */ fb_info->max_elmt_size = fb_info->file_elmt_size = fb_info->mem_elmt_size = H5T_get_size(dset_type); - HDassert(fb_info->max_elmt_size > 0); + assert(fb_info->max_elmt_size > 0); /* Compute the number of elements that fit within a buffer to write */ if (total_nelmts > 0) fb_info->elmts_per_buf = MIN(total_nelmts, MAX(1, (max_buf_size / fb_info->max_elmt_size))); else fb_info->elmts_per_buf = max_buf_size / fb_info->max_elmt_size; - HDassert(fb_info->elmts_per_buf > 0); + assert(fb_info->elmts_per_buf > 0); /* Compute the buffer size to use */ fb_info->fill_buf_size = MIN(max_buf_size, (fb_info->elmts_per_buf * fb_info->max_elmt_size)); @@ -469,7 +469,7 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat htri_t buf_avail = H5FL_BLK_AVAIL( zero_fill, fb_info->fill_buf_size); /* Check if there is an already zeroed out buffer available */ - HDassert(buf_avail != FAIL); + assert(buf_avail != FAIL); /* Allocate temporary buffer (zeroing it if no buffer is available) */ if (!buf_avail) @@ -512,9 +512,9 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(fb_info); - HDassert(fb_info->has_vlen_fill_type); - HDassert(fb_info->fill_buf); + assert(fb_info); + assert(fb_info->has_vlen_fill_type); + assert(fb_info->fill_buf); /* Make a copy of the (disk-based) fill value into the buffer */ H5MM_memcpy(fb_info->fill_buf, fb_info->fill->buf, fb_info->file_elmt_size); @@ -592,8 +592,8 @@ H5D__fill_release(H5D_fill_buf_info_t *fb_info) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(fb_info); - HDassert(fb_info->fill); + assert(fb_info); + assert(fb_info->fill); /* Free the buffer for fill values */ if (!fb_info->use_caller_fill_buf && fb_info->fill_buf) { @@ -629,7 +629,7 @@ H5D__fill_term(H5D_fill_buf_info_t *fb_info) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(fb_info); + assert(fb_info); /* Free the buffer for fill values */ H5D__fill_release(fb_info); diff --git a/src/H5Dint.c b/src/H5Dint.c index 3c5dbe6..72986d1 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -266,7 +266,7 @@ H5D_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(0 == H5I_nmembers(H5I_DATASET)); + assert(0 == H5I_nmembers(H5I_DATASET)); /* Destroy the dataset object id group */ n += (H5I_dec_type_ref(H5I_DATASET) > 0); @@ -291,7 +291,7 @@ H5D__close_cb(H5VL_object_t *dset_vol_obj, void **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset_vol_obj); + assert(dset_vol_obj); /* Close the dataset */ if (H5VL_dataset_close(dset_vol_obj, H5P_DATASET_XFER_DEFAULT, request) < 0) @@ -326,13 +326,13 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, const H FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); - HDassert(name && *name); - HDassert(type_id != H5P_DEFAULT); - HDassert(space); - HDassert(lcpl_id != H5P_DEFAULT); - HDassert(dcpl_id != H5P_DEFAULT); - HDassert(dapl_id != H5P_DEFAULT); + assert(loc); + assert(name && *name); + assert(type_id != H5P_DEFAULT); + assert(space); + assert(lcpl_id != H5P_DEFAULT); + assert(dcpl_id != H5P_DEFAULT); + assert(dapl_id != H5P_DEFAULT); /* Set up dataset creation info */ dcrt_info.type_id = type_id; @@ -348,7 +348,7 @@ H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, const H /* Create the new dataset and link it to its parent group */ if (H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create and link to dataset") - HDassert(ocrt_info.new_obj); + assert(ocrt_info.new_obj); /* Set the return value */ ret_value = (H5D_t *)ocrt_info.new_obj; @@ -374,7 +374,7 @@ H5D__get_space_status(const H5D_t *dset, H5D_space_status_t *allocation) FUNC_ENTER_PACKAGE - HDassert(dset); + assert(dset); /* Check for chunked layout */ if (dset->shared->layout.type == H5D_CHUNKED) { @@ -385,7 +385,7 @@ H5D__get_space_status(const H5D_t *dset, H5D_space_status_t *allocation) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve number of allocated chunks in dataset") - HDassert(n_chunks_alloc <= n_chunks_total); + assert(n_chunks_alloc <= n_chunks_total); if (n_chunks_alloc == 0) *allocation = H5D_SPACE_STATUS_NOT_ALLOCATED; @@ -498,9 +498,9 @@ H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, H5T_t *type) FUNC_ENTER_PACKAGE /* Sanity checking */ - HDassert(file); - HDassert(dset); - HDassert(type); + assert(file); + assert(dset); + assert(type); /* Check whether the datatype is relocatable */ if ((relocatable = H5T_is_relocatable(type)) < 0) @@ -570,7 +570,7 @@ H5D__cache_dataspace_info(const H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity checking */ - HDassert(dset); + assert(dset); /* Cache info for dataset's dataspace */ if ((sndims = H5S_get_simple_extent_dims(dset->shared->space, dset->shared->curr_dims, @@ -609,9 +609,9 @@ H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) FUNC_ENTER_PACKAGE /* Sanity checking */ - HDassert(file); - HDassert(dset); - HDassert(space); + assert(file); + assert(dset); + assert(space); /* Copy dataspace for dataset */ if (NULL == (dset->shared->space = H5S_copy(space, FALSE, TRUE))) @@ -654,8 +654,8 @@ H5D__use_minimized_dset_headers(H5F_t *file, hbool_t *minimize) FUNC_ENTER_PACKAGE - HDassert(file); - HDassert(minimize); + assert(file); + assert(minimize); /* Get the dataset object header minimize flag for this call */ if (H5CX_get_dset_min_ohdr_flag(minimize) < 0) @@ -695,9 +695,9 @@ H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr) FUNC_ENTER_PACKAGE - HDassert(file); - HDassert(dset); - HDassert(ohdr); + assert(file); + assert(dset); + assert(ohdr); type = dset->shared->type; fill_prop = &(dset->shared->dcpl_cache.fill); @@ -775,7 +775,7 @@ H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr) /* Modification Time message size */ if (H5O_HDR_STORE_TIMES & H5O_OH_GET_FLAGS(ohdr)) { - HDassert(H5O_OH_GET_VERSION(ohdr) >= 1); /* 1 :: H5O_VERSION_1 (H5Opkg.h) */ + assert(H5O_OH_GET_VERSION(ohdr) >= 1); /* 1 :: H5O_VERSION_1 (H5Opkg.h) */ if (H5O_OH_GET_VERSION(ohdr) == 1) { /* v1 object headers store modification time as a message */ @@ -813,9 +813,9 @@ H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc) FUNC_ENTER_PACKAGE - HDassert(file); - HDassert(dset); - HDassert(oloc); + assert(file); + assert(dset); + assert(oloc); oh = H5O_create_ohdr(file, dset->shared->dcpl_id); if (NULL == oh) @@ -861,8 +861,8 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) FUNC_ENTER_PACKAGE /* Sanity checking */ - HDassert(file); - HDassert(dset); + assert(file); + assert(dset); /* Set some local variables, for convenience */ oloc = &dset->oloc; @@ -917,7 +917,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) H5P_genplist_t *dc_plist; /* Dataset's creation property list */ /* Get dataset's property list object */ - HDassert(dset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT); + assert(dset->shared->dcpl_id != H5P_DATASET_CREATE_DEFAULT); if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dset->shared->dcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") @@ -945,7 +945,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset object header") } /* if using default/minimized object headers */ - HDassert(file == dset->oloc.file); + assert(file == dset->oloc.file); /* Pin the object header */ if (NULL == (oh = H5O_pin(oloc))) @@ -1063,10 +1063,10 @@ H5D__build_file_prefix(const H5D_t *dset, H5F_prefix_open_t prefix_type, char ** FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dset); - HDassert(dset->oloc.file); + assert(dset); + assert(dset->oloc.file); filepath = H5F_EXTPATH(dset->oloc.file); - HDassert(filepath); + assert(filepath); /* XXX: Future thread-safety note - getenv is not required * to be reentrant. @@ -1154,10 +1154,10 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t FUNC_ENTER_PACKAGE /* check args */ - HDassert(file); - HDassert(H5I_DATATYPE == H5I_get_type(type_id)); - HDassert(space); - HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + assert(file); + assert(H5I_DATATYPE == H5I_get_type(type_id)); + assert(space); + assert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); /* Get the dataset's datatype */ if (NULL == (dt = (H5T_t *)H5I_object(type_id))) @@ -1411,8 +1411,8 @@ H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl_id) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(loc); - HDassert(name); + assert(loc); + assert(name); /* Set up dataset location to fill in */ dset_loc.oloc = &oloc; @@ -1468,7 +1468,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id) FUNC_ENTER_NOAPI(NULL) /* check args */ - HDassert(loc); + assert(loc); /* Allocate the dataset structure */ if (NULL == (dataset = H5FL_CALLOC(H5D_t))) @@ -1601,8 +1601,8 @@ H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset); - HDassert(dset->shared); + assert(dset); + assert(dset->shared); /* Set default append flush values */ HDmemset(&dset->shared->append_flush, 0, sizeof(dset->shared->append_flush)); @@ -1680,7 +1680,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) /* check args */ - HDassert(dataset); + assert(dataset); /* (Set the 'vl_type' parameter to FALSE since it doesn't matter from here) */ if (NULL == (dataset->shared = H5D__new(H5P_DATASET_CREATE_DEFAULT, dapl_id, FALSE, FALSE))) @@ -1733,7 +1733,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) size_t dset_type_size = H5T_GET_SIZE(dataset->shared->type); size_t dset_data_size = 0; - HDassert(H5D_COMPACT == dataset->shared->layout.storage.type); + assert(H5D_COMPACT == dataset->shared->layout.storage.type); if ((dset_nelemts = H5S_GET_EXTENT_NPOINTS(dataset->shared->space)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get number of elements in dataset's dataspace") @@ -1871,8 +1871,8 @@ H5D_close(H5D_t *dataset) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(dataset && dataset->oloc.file && dataset->shared); - HDassert(dataset->shared->fo_count > 0); + assert(dataset && dataset->oloc.file && dataset->shared); + assert(dataset->shared->fo_count > 0); /* Dump debugging info */ #ifdef H5D_CHUNK_DEBUG @@ -1904,7 +1904,7 @@ H5D_close(H5D_t *dataset) case H5D_CHUNKED: /* Check for skip list for iterating over chunks during I/O to close */ if (dataset->shared->cache.chunk.sel_chunks) { - HDassert(H5SL_count(dataset->shared->cache.chunk.sel_chunks) == 0); + assert(H5SL_count(dataset->shared->cache.chunk.sel_chunks) == 0); H5SL_close(dataset->shared->cache.chunk.sel_chunks); dataset->shared->cache.chunk.sel_chunks = NULL; } /* end if */ @@ -1930,14 +1930,14 @@ H5D_close(H5D_t *dataset) case H5D_VIRTUAL: { size_t i, j; - HDassert(dataset->shared->layout.storage.u.virt.list || - (dataset->shared->layout.storage.u.virt.list_nused == 0)); + assert(dataset->shared->layout.storage.u.virt.list || + (dataset->shared->layout.storage.u.virt.list_nused == 0)); /* Close source datasets */ for (i = 0; i < dataset->shared->layout.storage.u.virt.list_nused; i++) { /* Close source dataset */ if (dataset->shared->layout.storage.u.virt.list[i].source_dset.dset) { - HDassert(dataset->shared->layout.storage.u.virt.list[i].source_dset.dset != dataset); + assert(dataset->shared->layout.storage.u.virt.list[i].source_dset.dset != dataset); if (H5D_close(dataset->shared->layout.storage.u.virt.list[i].source_dset.dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to close source dataset") dataset->shared->layout.storage.u.virt.list[i].source_dset.dset = NULL; @@ -1946,8 +1946,8 @@ H5D_close(H5D_t *dataset) /* Close sub datasets */ for (j = 0; j < dataset->shared->layout.storage.u.virt.list[i].sub_dset_nused; j++) if (dataset->shared->layout.storage.u.virt.list[i].sub_dset[j].dset) { - HDassert(dataset->shared->layout.storage.u.virt.list[i].sub_dset[j].dset != - dataset); + assert(dataset->shared->layout.storage.u.virt.list[i].sub_dset[j].dset != + dataset); if (H5D_close(dataset->shared->layout.storage.u.virt.list[i].sub_dset[j].dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, @@ -1961,7 +1961,7 @@ H5D_close(H5D_t *dataset) case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert("not implemented yet" && 0); + assert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") #endif /* NDEBUG */ @@ -2020,7 +2020,7 @@ H5D_close(H5D_t *dataset) /* * Free memory. Before freeing the memory set the file pointer to NULL. * We always check for a null file pointer in other H5D functions to be - * sure we're not accessing an already freed dataset (see the HDassert() + * sure we're not accessing an already freed dataset (see the assert() * above). */ dataset->oloc.file = NULL; @@ -2080,10 +2080,10 @@ H5D_mult_refresh_close(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* check args */ - HDassert(dataset); - HDassert(dataset->oloc.file); - HDassert(dataset->shared); - HDassert(dataset->shared->fo_count > 0); + assert(dataset); + assert(dataset->oloc.file); + assert(dataset->shared); + assert(dataset->shared->fo_count > 0); if (dataset->shared->fo_count > 1) { /* Free cached information for each kind of dataset */ @@ -2098,7 +2098,7 @@ H5D_mult_refresh_close(hid_t dset_id) case H5D_CHUNKED: /* Check for skip list for iterating over chunks during I/O to close */ if (dataset->shared->cache.chunk.sel_chunks) { - HDassert(H5SL_count(dataset->shared->cache.chunk.sel_chunks) == 0); + assert(H5SL_count(dataset->shared->cache.chunk.sel_chunks) == 0); H5SL_close(dataset->shared->cache.chunk.sel_chunks); dataset->shared->cache.chunk.sel_chunks = NULL; } /* end if */ @@ -2125,7 +2125,7 @@ H5D_mult_refresh_close(hid_t dset_id) case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert("not implemented yet" && 0); + assert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") #endif /* NDEBUG */ @@ -2157,8 +2157,8 @@ H5D_mult_refresh_reopen(H5D_t *dataset) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(dataset && dataset->oloc.file && dataset->shared); - HDassert(dataset->shared->fo_count > 0); + assert(dataset && dataset->oloc.file && dataset->shared); + assert(dataset->shared->fo_count > 0); if (dataset->shared->fo_count > 1) { /* Release dataspace info */ @@ -2242,9 +2242,9 @@ H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwr FUNC_ENTER_PACKAGE /* check args */ - HDassert(dset); + assert(dset); f = dset->oloc.file; - HDassert(f); + assert(f); /* If the data is stored in external files, don't set an address for the layout * We assume that external storage is already @@ -2334,7 +2334,7 @@ H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwr case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert("not implemented yet" && 0); + assert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") #endif /* NDEBUG */ @@ -2410,7 +2410,7 @@ H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[]) FUNC_ENTER_PACKAGE - HDassert(dset); + assert(dset); switch (dset->shared->layout.type) { case H5D_COMPACT: @@ -2455,7 +2455,7 @@ H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[]) case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert("not implemented yet" && 0); + assert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") #endif /* NDEBUG */ @@ -2539,7 +2539,7 @@ H5D__get_offset(const H5D_t *dset) FUNC_ENTER_PACKAGE - HDassert(dset); + assert(dset); switch (dset->shared->layout.type) { case H5D_VIRTUAL: @@ -2625,9 +2625,9 @@ H5D__vlen_get_buf_size_cb(void H5_ATTR_UNUSED *elem, hid_t type_id, unsigned H5_ FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(H5I_DATATYPE == H5I_get_type(type_id)); - HDassert(point); - HDassert(op_data); + assert(H5I_DATATYPE == H5I_get_type(type_id)); + assert(point); + assert(op_data); /* Select point to read in */ if (H5S_select_elements(vlen_bufsize->fspace, H5S_SELECT_SET, (size_t)1, point) < 0) @@ -2778,8 +2778,8 @@ H5D__vlen_get_buf_size_gen_cb(void H5_ATTR_UNUSED *elem, hid_t type_id, unsigned FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(point); - HDassert(op_data); + assert(point); + assert(op_data); /* Check args */ if (NULL == (dt = (H5T_t *)H5I_object(type_id))) @@ -2939,7 +2939,7 @@ H5D__check_filters(H5D_t *dataset) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dataset); + assert(dataset); /* Check if the filters in the DCPL will need to encode, and if so, can they? * @@ -2992,8 +2992,8 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size) FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Check args */ - HDassert(dset); - HDassert(size); + assert(dset); + assert(size); /* Check if we are allowed to modify this file */ if (0 == (H5F_INTENT(dset->oloc.file) & H5F_ACC_RDWR)) @@ -3176,12 +3176,12 @@ H5D__flush_sieve_buf(H5D_t *dataset) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dataset); + assert(dataset); /* Flush the raw data buffer, if we have a dirty one */ if (dataset->shared->cache.contig.sieve_buf && dataset->shared->cache.contig.sieve_dirty) { - HDassert(dataset->shared->layout.type != - H5D_COMPACT); /* We should never have a sieve buffer for compact storage */ + assert(dataset->shared->layout.type != + H5D_COMPACT); /* We should never have a sieve buffer for compact storage */ /* Write dirty data sieve buffer to file */ if (H5F_shared_block_write( @@ -3214,8 +3214,8 @@ H5D__flush_real(H5D_t *dataset) FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) /* Check args */ - HDassert(dataset); - HDassert(dataset->shared); + assert(dataset); + assert(dataset->shared); /* Avoid flushing the dataset (again) if it's closing */ if (!dataset->shared->closing) @@ -3244,8 +3244,8 @@ H5D__flush(H5D_t *dset, hid_t dset_id) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dset); - HDassert(dset->shared); + assert(dset); + assert(dset->shared); /* Currently, H5Oflush causes H5Fclose to trigger an assertion failure in metadata cache. * Leave this situation for the future solution */ @@ -3288,11 +3288,11 @@ H5D__format_convert(H5D_t *dataset) FUNC_ENTER_PACKAGE_TAG(dataset->oloc.addr) /* Check args */ - HDassert(dataset); + assert(dataset); switch (dataset->shared->layout.type) { case H5D_CHUNKED: - HDassert(dataset->shared->layout.u.chunk.idx_type != H5D_CHUNK_IDX_BTREE); + assert(dataset->shared->layout.u.chunk.idx_type != H5D_CHUNK_IDX_BTREE); if (NULL == (newlayout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate buffer") @@ -3363,7 +3363,7 @@ H5D__format_convert(H5D_t *dataset) case H5D_CONTIGUOUS: case H5D_COMPACT: - HDassert(dataset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT); + assert(dataset->shared->layout.version > H5O_LAYOUT_VERSION_DEFAULT); dataset->shared->layout.version = H5O_LAYOUT_VERSION_DEFAULT; if (H5O_msg_write(&(dataset->oloc), H5O_LAYOUT_ID, 0, H5O_UPDATE_TIME, &(dataset->shared->layout)) < 0) @@ -3437,8 +3437,8 @@ H5D__mark(const H5D_t *dataset, unsigned flags) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dataset); - HDassert(!(flags & (unsigned)~(H5D_MARK_SPACE | H5D_MARK_LAYOUT))); + assert(dataset); + assert(!(flags & (unsigned)~(H5D_MARK_SPACE | H5D_MARK_LAYOUT))); /* Mark aspects of the dataset as dirty */ if (flags) { @@ -3467,7 +3467,7 @@ H5D__mark(const H5D_t *dataset, unsigned flags) } /* end if */ /* _Somebody_ should have update the modification time! */ - HDassert(update_flags == 0); + assert(update_flags == 0); } /* end if */ done: @@ -3498,8 +3498,8 @@ H5D__flush_all_cb(void *_dataset, hid_t H5_ATTR_UNUSED id, void *_udata) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dataset); - HDassert(f); + assert(dataset); + assert(f); /* Check for dataset in same file */ if (f == dataset->oloc.file) @@ -3528,7 +3528,7 @@ H5D_flush_all(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(f); + assert(f); /* Iterate over all the open datasets */ if (H5I_iterate(H5I_DATASET, H5D__flush_all_cb, f, FALSE) < 0) @@ -3616,7 +3616,7 @@ H5D_get_create_plist(const H5D_t *dset) case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert(0 && "Unknown layout type!"); + assert(0 && "Unknown layout type!"); } /* end switch */ /* Set back the (possibly modified) layout property to property list */ @@ -3949,8 +3949,8 @@ H5D__refresh(H5D_t *dset, hid_t dset_id) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); - HDassert(dset->shared); + assert(dset); + assert(dset->shared); /* If the layout is virtual... */ if (dset->shared->layout.type == H5D_VIRTUAL) { diff --git a/src/H5Dio.c b/src/H5Dio.c index 69ba310..b128184 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -215,7 +215,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) (unsigned)H5S_GET_EXTENT_NDIMS(dset_info[i].file_space), (hsize_t)dset_info[i].type_info.dst_type_size, &buf_adj) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace") - HDassert(dset_info[i].mem_space); + assert(dset_info[i].mem_space); /* Adjust the buffer by the given amount */ dset_info[i].buf.vp = (void *)(((uint8_t *)dset_info[i].buf.vp) + buf_adj); @@ -264,7 +264,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) /* Sanity check that space is allocated, if there are elements */ if (dset_info[i].nelmts > 0) - HDassert( + assert( (*dset_info[i].dset->shared->layout.ops->is_space_alloc)( &dset_info[i].dset->shared->layout.storage) || (dset_info[i].dset->shared->layout.ops->is_data_cached && @@ -284,7 +284,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) } } /* end of for loop */ - HDassert(io_op_init + io_skipped == count); + assert(io_op_init + io_skipped == count); /* If no datasets have I/O, we're done */ if (io_op_init == 0) @@ -312,8 +312,8 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) if (io_info.md_io_ops.multi_read_md) { /* Create sel_pieces array if any pieces are selected */ if (io_info.piece_count > 0) { - HDassert(!io_info.sel_pieces); - HDassert(io_info.pieces_added == 0); + assert(!io_info.sel_pieces); + assert(io_info.pieces_added == 0); /* Allocate sel_pieces array */ if (NULL == @@ -632,7 +632,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) (unsigned)H5S_GET_EXTENT_NDIMS(dset_info[i].file_space), dset_info[i].type_info.src_type_size, &buf_adj) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to construct projected memory dataspace") - HDassert(dset_info[i].mem_space); + assert(dset_info[i].mem_space); /* Adjust the buffer by the given amount */ dset_info[i].buf.cvp = (const void *)(((const uint8_t *)dset_info[i].buf.cvp) + buf_adj); @@ -692,7 +692,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) H5AC_tag(prev_tag, NULL); } /* end of for loop */ - HDassert(io_op_init == count); + assert(io_op_init == count); /* Perform second phase of type info initialization */ if (H5D__typeinfo_init_phase2(&io_info) < 0) @@ -716,8 +716,8 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) if (io_info.md_io_ops.multi_write_md) { /* Create sel_pieces array if any pieces are selected */ if (io_info.piece_count > 0) { - HDassert(!io_info.sel_pieces); - HDassert(io_info.pieces_added == 0); + assert(!io_info.sel_pieces); + assert(io_info.pieces_added == 0); /* Allocate sel_pieces array */ if (NULL == @@ -773,7 +773,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) /* loop with serial & single-dset write IO path */ for (i = 0; i < count; i++) { - HDassert(!dset_info[i].skip_io); + assert(!dset_info[i].skip_io); /* set metadata tagging with dset oheader addr */ H5AC_tag(dset_info->dset->oloc.addr, &prev_tag); @@ -830,7 +830,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) done: /* Shut down the I/O op information */ for (i = 0; i < io_op_init; i++) { - HDassert(!dset_info[i].skip_io); + assert(!dset_info[i].skip_io); if (dset_info[i].layout_ops.io_term && (*dset_info[i].layout_ops.io_term)(&io_info, &(dset_info[i])) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down I/O op info") @@ -890,10 +890,10 @@ H5D__ioinfo_init(size_t count, H5D_io_op_type_t op_type, H5D_dset_io_info_t *dse FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(count > 0); - HDassert(dset_info); - HDassert(dset_info[0].dset->oloc.file); - HDassert(io_info); + assert(count > 0); + assert(dset_info); + assert(dset_info[0].dset->oloc.file); + assert(io_info); /* Zero out struct */ HDmemset(io_info, 0, sizeof(*io_info)); @@ -952,9 +952,9 @@ H5D__dset_ioinfo_init(H5D_t *dset, H5D_dset_io_info_t *dset_info, H5D_storage_t FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(dset); - HDassert(dset->oloc.file); - HDassert(dset_info->type_info.tpath); + assert(dset); + assert(dset->oloc.file); + assert(dset_info->type_info.tpath); /* Set up "normal" I/O fields */ dset_info->dset = dset; @@ -1014,13 +1014,13 @@ H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hid_t FUNC_ENTER_PACKAGE /* check args */ - HDassert(io_info); - HDassert(dset_info); + assert(io_info); + assert(dset_info); /* Set convenience pointers */ type_info = &dset_info->type_info; dset = dset_info->dset; - HDassert(dset); + assert(dset); /* Patch the top level file pointer for dt->shared->u.vlen.f if needed */ if (H5T_patch_vlen_file(dset->shared->type, H5F_VOL_OBJ(dset->oloc.file)) < 0) @@ -1126,7 +1126,7 @@ H5D__typeinfo_init_phase2(H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE /* check args */ - HDassert(io_info); + assert(io_info); /* If selection I/O mode is default (auto), enable it here if the VFD supports it (it will be turned off * later if something else conflicts), otherwise disable it. If we're using the MPIO VFD, the automatic @@ -1214,12 +1214,12 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE /* check args */ - HDassert(io_info); + assert(io_info); /* check the first dset, should exist either single or multi dset cases */ - HDassert(io_info->dsets_info[0].dset); + assert(io_info->dsets_info[0].dset); dset0 = io_info->dsets_info[0].dset; - HDassert(dset0->oloc.file); + assert(dset0->oloc.file); /* Reset the actual io mode properties to the default values in case * the DXPL (if it's non-default) was previously used in a collective @@ -1349,7 +1349,7 @@ H5D__typeinfo_init_phase3(H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE /* check args */ - HDassert(io_info); + assert(io_info); /* Check if we need to allocate a shared type conversion buffer */ if (io_info->max_tconv_type_size) { @@ -1393,7 +1393,7 @@ H5D__typeinfo_init_phase3(H5D_io_info_t *io_info) size_t i; /* Make sure selection I/O is disabled (DEFAULT should have been handled by now) */ - HDassert(io_info->use_select_io == H5D_SELECTION_IO_MODE_OFF); + assert(io_info->use_select_io == H5D_SELECTION_IO_MODE_OFF); /* Get max buffer size from API context */ if (H5CX_get_max_temp_buf(&max_temp_buf) < 0) @@ -1479,11 +1479,11 @@ H5D__typeinfo_term(H5D_io_info_t *io_info) /* Check for releasing datatype conversion & background buffers */ if (io_info->tconv_buf_allocated) { - HDassert(io_info->tconv_buf); + assert(io_info->tconv_buf); (void)H5FL_BLK_FREE(type_conv, io_info->tconv_buf); } /* end if */ if (io_info->bkg_buf_allocated) { - HDassert(io_info->bkg_buf); + assert(io_info->bkg_buf); (void)H5FL_BLK_FREE(type_conv, io_info->bkg_buf); } /* end if */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index dd1d2b7..b686ed1 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -80,7 +80,7 @@ H5D__layout_set_io_ops(const H5D_t *dataset) FUNC_ENTER_PACKAGE /* check args */ - HDassert(dataset); + assert(dataset); /* Set the I/O functions for each layout type */ switch (dataset->shared->layout.type) { @@ -122,7 +122,7 @@ H5D__layout_set_io_ops(const H5D_t *dataset) case H5D_CHUNK_IDX_NTYPES: default: - HDassert(0 && "Unknown chunk index method!"); + assert(0 && "Unknown chunk index method!"); HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unknown chunk index method") } /* end switch */ break; @@ -168,8 +168,8 @@ H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t includ FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(layout); + assert(f); + assert(layout); ret_value = 1 + /* Version number */ 1; /* layout class type */ @@ -192,7 +192,7 @@ H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t includ case H5D_CHUNKED: if (layout->version < H5O_LAYOUT_VERSION_4) { /* Number of dimensions (1 byte) */ - HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); ret_value++; /* B-tree address */ @@ -206,11 +206,11 @@ H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t includ ret_value++; /* Number of dimensions (1 byte) */ - HDassert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(layout->u.chunk.ndims > 0 && layout->u.chunk.ndims <= H5O_LAYOUT_NDIMS); ret_value++; /* Encoded # of bytes for each chunk dimension */ - HDassert(layout->u.chunk.enc_bytes_per_dim > 0 && layout->u.chunk.enc_bytes_per_dim <= 8); + assert(layout->u.chunk.enc_bytes_per_dim > 0 && layout->u.chunk.enc_bytes_per_dim <= 8); ret_value++; /* Dimension sizes */ @@ -296,8 +296,8 @@ H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(layout); - HDassert(f); + assert(layout); + assert(f); /* Upgrade to the version indicated by the file's low bound if higher */ version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]); @@ -333,9 +333,9 @@ H5D__layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space, const FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(layout); - HDassert(space); - HDassert(dcpl_cache); + assert(layout); + assert(space); + assert(dcpl_cache); /* The indexing methods only apply to chunked datasets (currently) */ if (layout->type == H5D_CHUNKED) { @@ -461,9 +461,9 @@ H5D__layout_oh_create(H5F_t *file, H5O_t *oh, H5D_t *dset, hid_t dapl_id) FUNC_ENTER_PACKAGE_TAG(dset->oloc.addr) /* Sanity checking */ - HDassert(file); - HDassert(oh); - HDassert(dset); + assert(file); + assert(oh); + assert(dset); /* Set some local variables, for convenience */ layout = &dset->shared->layout; @@ -597,8 +597,8 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dapl_id, H5P_genplist_t *plist) FUNC_ENTER_PACKAGE /* Sanity checking */ - HDassert(dataset); - HDassert(plist); + assert(dataset); + assert(plist); /* Get the optional filters message */ if ((msg_exists = H5O_msg_exists(&(dataset->oloc), H5O_PLINE_ID)) < 0) @@ -641,7 +641,7 @@ H5D__layout_oh_read(H5D_t *dataset, hid_t dapl_id, H5P_genplist_t *plist) } /* end if */ /* Sanity check that the layout operations are set up */ - HDassert(dataset->shared->layout.ops); + assert(dataset->shared->layout.ops); /* Initialize the layout information for the dataset */ if (dataset->shared->layout.ops->init && @@ -698,8 +698,8 @@ H5D__layout_oh_write(const H5D_t *dataset, H5O_t *oh, unsigned update_flags) FUNC_ENTER_PACKAGE /* Sanity checking */ - HDassert(dataset); - HDassert(oh); + assert(dataset); + assert(oh); /* Check if the layout message has been added to the dataset's header */ if ((msg_exists = H5O_msg_exists_oh(oh, H5O_LAYOUT_ID)) < 0) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index a9940c7..7a8b121 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -497,7 +497,7 @@ H5D__mpio_parse_debug_str(const char *s) { FUNC_ENTER_PACKAGE_NOERR - HDassert(s); + assert(s); while (*s) { int c = (int)(*s); @@ -544,7 +544,7 @@ H5D__mpio_debug_init(void) FUNC_ENTER_PACKAGE_NOERR - HDassert(!H5D_mpio_debug_inited); + assert(!H5D_mpio_debug_inited); /* Clear the debug flag buffer */ HDmemset(H5D_mpio_debug_flags_s, 0, sizeof(H5D_mpio_debug_flags_s)); @@ -596,11 +596,11 @@ H5D__mpio_opt_possible(H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(io_info); + assert(io_info); for (i = 0; i < io_info->count; i++) { - HDassert(io_info->dsets_info[i].file_space); - HDassert(io_info->dsets_info[i].mem_space); + assert(io_info->dsets_info[i].file_space); + assert(io_info->dsets_info[i].mem_space); } /* For independent I/O, get out quickly and don't try to form consensus */ @@ -671,7 +671,7 @@ H5D__mpio_opt_possible(H5D_io_info_t *io_info) if ((io_info->use_select_io == H5D_SELECTION_IO_MODE_OFF) && local_cause[0] && !(local_cause[0] & ~((unsigned)H5D_MPIO_DATATYPE_CONVERSION | (unsigned)H5D_MPIO_DATA_TRANSFORMS))) { - HDassert(io_info->no_selection_io_cause & H5D_MPIO_NO_SELECTION_IO_CAUSES); + assert(io_info->no_selection_io_cause & H5D_MPIO_NO_SELECTION_IO_CAUSES); local_cause[0] |= H5D_MPIO_NO_SELECTION_IO; } @@ -741,8 +741,8 @@ H5D__mpio_opt_possible(H5D_io_info_t *io_info) * selection I/O and re-enable collective I/O since it's supported by selection I/O */ if (global_cause[0] && !(global_cause[0] & ~((unsigned)H5D_MPIO_DATATYPE_CONVERSION | (unsigned)H5D_MPIO_DATA_TRANSFORMS))) { - HDassert(!(local_cause[0] & - ~((unsigned)H5D_MPIO_DATATYPE_CONVERSION | (unsigned)H5D_MPIO_DATA_TRANSFORMS))); + assert(!(local_cause[0] & + ~((unsigned)H5D_MPIO_DATATYPE_CONVERSION | (unsigned)H5D_MPIO_DATA_TRANSFORMS))); local_cause[0] = 0; global_cause[0] = 0; io_info->use_select_io = H5D_SELECTION_IO_MODE_ON; @@ -800,7 +800,7 @@ H5D__mpio_get_no_coll_cause_strings(char *local_cause, size_t local_cause_len, c FUNC_ENTER_PACKAGE - HDassert((local_cause && local_cause_len > 0) || (global_cause && global_cause_len > 0)); + assert((local_cause && local_cause_len > 0) || (global_cause && global_cause_len > 0)); /* * Use compile-time assertion so this routine is updated @@ -867,7 +867,7 @@ H5D__mpio_get_no_coll_cause_strings(char *local_cause, size_t local_cause_len, c case H5D_MPIO_COLLECTIVE: case H5D_MPIO_NO_COLLECTIVE_MAX_CAUSE: default: - HDassert(0 && "invalid no collective cause reason"); + assert(0 && "invalid no collective cause reason"); break; } @@ -1049,7 +1049,7 @@ H5D__mpio_get_sum_chunk_dset(const H5D_io_info_t *io_info, const H5D_dset_io_inf /* Check for non-chunked dataset, in this case we know the number of "chunks" * is simply the mpi size */ - HDassert(dset_info->layout->type == H5D_CHUNKED); + assert(dset_info->layout->type == H5D_CHUNKED); /* Get the number of chunks to perform I/O on */ num_chunkf = 0; @@ -1122,9 +1122,9 @@ H5D__piece_io(H5D_io_info_t *io_info) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(io_info); - HDassert(io_info->using_mpi_vfd); - HDassert(io_info->count > 0); + assert(io_info); + assert(io_info->using_mpi_vfd); + assert(io_info->count > 0); /* Obtain the current rank of the process and the number of ranks */ if ((mpi_rank = H5F_mpi_get_rank(io_info->dsets_info[0].dset->oloc.file)) < 0) @@ -1244,7 +1244,7 @@ H5D__piece_io(H5D_io_info_t *io_info) } else { /* Chunked I/O path */ - HDassert(io_info->dsets_info[i].layout->type == H5D_CHUNKED); + assert(io_info->dsets_info[i].layout->type == H5D_CHUNKED); /* Recalculate io_option if necessary */ if (recalc_io_option) { @@ -1472,7 +1472,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran /* set actual_io_mode */ for (i = 0; i < io_info->count; i++) { - HDassert(io_info->dsets_info[i].dset->shared->dcpl_cache.pline.nused == 0); + assert(io_info->dsets_info[i].dset->shared->dcpl_cache.pline.nused == 0); if (io_info->dsets_info[i].layout->type == H5D_CHUNKED) actual_io_mode |= H5D_MPIO_CHUNK_COLLECTIVE; else if (io_info->dsets_info[i].layout->type == H5D_CONTIGUOUS) @@ -1512,9 +1512,9 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran hbool_t need_sort = FALSE; /* Check if sel_pieces array is sorted */ - HDassert(io_info->sel_pieces[0]->faddr != HADDR_UNDEF); + assert(io_info->sel_pieces[0]->faddr != HADDR_UNDEF); for (i = 1; i < num_chunk; i++) { - HDassert(io_info->sel_pieces[i]->faddr != HADDR_UNDEF); + assert(io_info->sel_pieces[i]->faddr != HADDR_UNDEF); if (io_info->sel_pieces[i]->faddr < io_info->sel_pieces[i - 1]->faddr) { need_sort = TRUE; @@ -1595,7 +1595,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran /* Sanity check */ if (is_permuted) - HDassert(permute_map); + assert(permute_map); if (H5S_mpio_space_type(piece_info->mspace, piece_info->dset_info->type_info.dst_type_size, &chunk_mtype[i], &chunk_mpi_mem_counts[i], &(chunk_mbt_is_derived_array[i]), FALSE, /* this is a memory @@ -1615,7 +1615,7 @@ H5D__link_piece_collective_io(H5D_io_info_t *io_info, int H5_ATTR_UNUSED mpi_ran HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buf type") /* Sanity check */ if (is_permuted) - HDassert(!permute_map); + assert(!permute_map); /* Piece address relative to the first piece addr * Assign piece address to MPI displacement @@ -1813,7 +1813,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, H5D_dset_io_info_ FUNC_ENTER_PACKAGE_TAG(dset_info->dset->oloc.addr) - HDassert(io_info); + assert(io_info); #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); @@ -1860,7 +1860,7 @@ H5D__link_chunk_filtered_collective_io(H5D_io_info_t *io_info, H5D_dset_io_info_ "unable to send chunk modification data between MPI ranks") /* Make sure the local chunk list was updated correctly */ - HDassert(chunk_list_num_entries == rank_chunks_assigned_map[mpi_rank]); + assert(chunk_list_num_entries == rank_chunks_assigned_map[mpi_rank]); } /* Proceed to update all the chunks this rank owns with its own @@ -2012,7 +2012,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_ FUNC_ENTER_PACKAGE_TAG(dset_info->dset->oloc.addr) - HDassert(dset_info->layout->type == H5D_CHUNKED); + assert(dset_info->layout->type == H5D_CHUNKED); /* Get the current I/O collective opt mode so we can restore it later */ if (H5CX_get_mpio_coll_opt(&orig_coll_opt_mode) < 0) @@ -2023,7 +2023,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_ /* Retrieve total # of chunks in dataset */ H5_CHECKED_ASSIGN(total_chunk, size_t, dset_info->layout->u.chunk.nchunks, hsize_t); - HDassert(total_chunk != 0); + assert(total_chunk != 0); /* Allocate memories */ chunk_io_option = (uint8_t *)H5MM_calloc(total_chunk); @@ -2068,8 +2068,8 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_ /* Check if this chunk is the next chunk in the skip list, if there are * selected chunks left to process */ - HDassert(!num_chunk || next_chunk_info); - HDassert(!num_chunk || next_chunk_info->index >= u); + assert(!num_chunk || next_chunk_info); + assert(!num_chunk || next_chunk_info->index >= u); if (num_chunk && next_chunk_info->index == u) { /* Next chunk is this chunk */ chunk_info = next_chunk_info; @@ -2139,7 +2139,7 @@ H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_ u); #endif - HDassert(chunk_io_option[u] == 0); + assert(chunk_io_option[u] == 0); /* Set the file & memory dataspaces */ if (chunk_info) { @@ -2289,7 +2289,7 @@ H5D__multi_chunk_filtered_collective_io(H5D_io_info_t *io_info, H5D_dset_io_info FUNC_ENTER_PACKAGE_TAG(dset_info->dset->oloc.addr) - HDassert(io_info); + assert(io_info); #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); @@ -2518,7 +2518,7 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *di, H HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain MPI rank") #endif - HDassert(io_info); + assert(io_info); if ((file_space != NULL) && (mem_space != NULL)) { int mpi_file_count; /* Number of file "objects" to transfer */ @@ -2528,7 +2528,7 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *di, H point selection of the file space */ hbool_t is_permuted = FALSE; - HDassert(di); + assert(di); /* Obtain disk and memory MPI derived datatype */ /* NOTE: The permute_map array can be allocated within H5S_mpio_space_type @@ -2550,7 +2550,7 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *di, H HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI file type") /* Sanity check */ if (is_permuted) - HDassert(permute_map); + assert(permute_map); if (H5S_mpio_space_type(mem_space, di->type_info.src_type_size, &mpi_buf_type, &mpi_buf_count, &mbt_is_derived, /* OUT: datatype created */ FALSE, /* this is a memory space, so if @@ -2569,7 +2569,7 @@ H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *di, H HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create MPI buffer type") /* Sanity check */ if (is_permuted) - HDassert(!permute_map); + assert(!permute_map); } /* end if */ else { /* For non-selection, participate with a none MPI derived datatype, the count is 0. */ @@ -2898,7 +2898,7 @@ H5D__obtain_mpio_mode(H5D_io_info_t *io_info, H5D_dset_io_info_t *di, uint8_t as FUNC_ENTER_PACKAGE - HDassert(di->layout->type == H5D_CHUNKED); + assert(di->layout->type == H5D_CHUNKED); /* Assign the rank 0 to the root */ root = 0; @@ -3038,7 +3038,7 @@ done: if (mergebuf) H5MM_free(mergebuf); if (recv_io_mode_info) { - HDassert(mpi_rank == root); + assert(mpi_rank == root); H5MM_free(recv_io_mode_info); } /* end if */ @@ -3074,16 +3074,16 @@ H5D__mpio_collective_filtered_chunk_io_setup(const H5D_io_info_t *io_info, const FUNC_ENTER_PACKAGE - HDassert(io_info); - HDassert(di); - HDassert(chunk_list); - HDassert(num_entries); + assert(io_info); + assert(di); + assert(chunk_list); + assert(num_entries); #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); H5D_MPIO_TIME_START(mpi_rank, "Filtered Collective I/O Setup"); #endif - HDassert(di->layout->type == H5D_CHUNKED); + assert(di->layout->type == H5D_CHUNKED); /* Each rank builds a local list of the chunks they have selected */ if ((num_chunks_selected = H5SL_count(di->layout_io_info.chunk_map->dset_sel_pieces))) { @@ -3293,9 +3293,9 @@ H5D__mpio_redistribute_shared_chunks(H5D_filtered_collective_io_info_t *chunk_li FUNC_ENTER_PACKAGE - HDassert(chunk_list || 0 == chunk_list_num_entries); - HDassert(io_info); - HDassert(mpi_size > 1); /* No chunk sharing is possible for MPI Comm size of 1 */ + assert(chunk_list || 0 == chunk_list_num_entries); + assert(io_info); + assert(mpi_size > 1); /* No chunk sharing is possible for MPI Comm size of 1 */ #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); @@ -3436,10 +3436,10 @@ H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chun FUNC_ENTER_PACKAGE - HDassert(num_chunks_assigned_map); - HDassert(chunk_list || 0 == num_chunks_assigned_map[mpi_rank]); - HDassert(io_info); - HDassert(mpi_size > 1); + assert(num_chunks_assigned_map); + assert(chunk_list || 0 == num_chunks_assigned_map[mpi_rank]); + assert(io_info); + assert(mpi_size > 1); #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); @@ -3577,7 +3577,7 @@ H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chun } while (++i < coll_chunk_list_num_entries && chunk_entry->chunk_idx == curr_chunk_idx); /* We should never have more writers to a chunk than the number of MPI ranks */ - HDassert(num_writers <= mpi_size); + assert(num_writers <= mpi_size); /* Set all processed chunk entries' "new_owner" and "num_writers" fields */ for (; set_begin_index < i; set_begin_index++) { @@ -3772,13 +3772,13 @@ H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk FUNC_ENTER_PACKAGE - HDassert(chunk_list_num_entries); - HDassert(chunk_list || 0 == *chunk_list_num_entries); - HDassert(io_info); - HDassert(dset_info); - HDassert(mpi_size > 1); - HDassert(chunk_msg_bufs); - HDassert(chunk_msg_bufs_len); + assert(chunk_list_num_entries); + assert(chunk_list || 0 == *chunk_list_num_entries); + assert(io_info); + assert(dset_info); + assert(mpi_size > 1); + assert(chunk_msg_bufs); + assert(chunk_msg_bufs_len); #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); @@ -3990,7 +3990,7 @@ H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk if (msg_size <= 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "invalid chunk modification message size") - HDassert((num_recv_requests + 1) <= num_msgs_incoming); + assert((num_recv_requests + 1) <= num_msgs_incoming); if (NULL == (msg_recv_bufs[num_recv_requests] = H5MM_malloc((size_t)msg_size * sizeof(unsigned char)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, @@ -4176,8 +4176,8 @@ H5D__mpio_collective_filtered_chunk_common_io(H5D_filtered_collective_io_info_t FUNC_ENTER_PACKAGE - HDassert(chunk_list || 0 == chunk_list_num_entries); - HDassert(io_info); + assert(chunk_list || 0 == chunk_list_num_entries); + assert(io_info); /* Initialize temporary I/O info */ coll_io_info = *io_info; @@ -4198,7 +4198,7 @@ H5D__mpio_collective_filtered_chunk_common_io(H5D_filtered_collective_io_info_t */ if (io_info->op_type == H5D_IO_OP_READ) { for (i = 0, num_chunks = 0; i < chunk_list_num_entries; i++) { - HDassert(chunk_list[i].buf); + assert(chunk_list[i].buf); if (chunk_list[i].need_read) { if (!H5_addr_defined(base_read_offset)) @@ -4297,9 +4297,9 @@ H5D__mpio_collective_filtered_chunk_read(H5D_filtered_collective_io_info_t *chun FUNC_ENTER_PACKAGE - HDassert(chunk_list || 0 == chunk_list_num_entries); - HDassert(io_info); - HDassert(di); + assert(chunk_list || 0 == chunk_list_num_entries); + assert(io_info); + assert(di); #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); @@ -4342,7 +4342,7 @@ H5D__mpio_collective_filtered_chunk_read(H5D_filtered_collective_io_info_t *chun * chunk size would of course be bad. */ for (i = 0; i < chunk_list_num_entries; i++) { - HDassert(chunk_list[i].need_read); + assert(chunk_list[i].need_read); chunk_list[i].chunk_buf_size = MAX(chunk_list[i].chunk_current.length, file_chunk_size); @@ -4379,7 +4379,7 @@ H5D__mpio_collective_filtered_chunk_read(H5D_filtered_collective_io_info_t *chun if (!fb_info_init) { hsize_t chunk_dims[H5S_MAX_RANK]; - HDassert(di->dset->shared->ndims == di->dset->shared->layout.u.chunk.ndims - 1); + assert(di->dset->shared->ndims == di->dset->shared->layout.u.chunk.ndims - 1); for (size_t j = 0; j < di->dset->shared->layout.u.chunk.ndims - 1; j++) chunk_dims[j] = (hsize_t)di->dset->shared->layout.u.chunk.dim[j]; @@ -4400,7 +4400,7 @@ H5D__mpio_collective_filtered_chunk_read(H5D_filtered_collective_io_info_t *chun } /* Write fill value to memory buffer */ - HDassert(fb_info.fill_buf); + assert(fb_info.fill_buf); if (H5D__fill(fb_info.fill_buf, di->dset->shared->type, chunk_list[i].buf, di->type_info.mem_type, fill_space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "couldn't fill chunk buffer with fill value") @@ -4520,10 +4520,10 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch FUNC_ENTER_PACKAGE - HDassert(chunk_list || 0 == chunk_list_num_entries); - HDassert((chunk_msg_bufs && chunk_hash_table) || 0 == chunk_msg_bufs_len); - HDassert(io_info); - HDassert(di); + assert(chunk_list || 0 == chunk_list_num_entries); + assert((chunk_msg_bufs && chunk_hash_table) || 0 == chunk_msg_bufs_len); + assert(io_info); + assert(di); #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); @@ -4532,7 +4532,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch /* Set convenience pointers */ type_info = &(di->type_info); - HDassert(type_info); + assert(type_info); if (chunk_list_num_entries) { /* Retrieve filter settings from API context */ @@ -4570,7 +4570,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch * chunk size would of course be bad. */ for (i = 0; i < chunk_list_num_entries; i++) { - HDassert(mpi_rank == chunk_list[i].new_owner); + assert(mpi_rank == chunk_list[i].new_owner); chunk_list[i].chunk_buf_size = MAX(chunk_list[i].chunk_current.length, file_chunk_size); @@ -4619,7 +4619,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch if (!fb_info_init) { hsize_t chunk_dims[H5S_MAX_RANK]; - HDassert(di->dset->shared->ndims == di->dset->shared->layout.u.chunk.ndims - 1); + assert(di->dset->shared->ndims == di->dset->shared->layout.u.chunk.ndims - 1); for (size_t j = 0; j < di->dset->shared->layout.u.chunk.ndims - 1; j++) chunk_dims[j] = (hsize_t)di->dset->shared->layout.u.chunk.dim[j]; @@ -4642,7 +4642,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch } /* Write fill value to memory buffer */ - HDassert(fb_info.fill_buf); + assert(fb_info.fill_buf); if (H5D__fill(fb_info.fill_buf, di->dset->shared->type, chunk_list[i].buf, type_info->mem_type, fill_space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, @@ -4693,7 +4693,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch /* Process all chunks with data from the owning rank first */ for (i = 0; i < chunk_list_num_entries; i++) { - HDassert(mpi_rank == chunk_list[i].new_owner); + assert(mpi_rank == chunk_list[i].new_owner); chunk_info = chunk_list[i].chunk_info; @@ -4865,10 +4865,10 @@ H5D__mpio_collective_filtered_chunk_reallocate(H5D_filtered_collective_io_info_t FUNC_ENTER_PACKAGE - HDassert(chunk_list || 0 == chunk_list_num_entries); - HDassert(io_info); - HDassert(idx_info); - HDassert(idx_info->storage->idx_type != H5D_CHUNK_IDX_NONE); + assert(chunk_list || 0 == chunk_list_num_entries); + assert(io_info); + assert(idx_info); + assert(idx_info->storage->idx_type != H5D_CHUNK_IDX_NONE); #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); @@ -4964,8 +4964,8 @@ H5D__mpio_collective_filtered_chunk_reallocate(H5D_filtered_collective_io_info_t local_chunk = &chunk_list[num_local_chunks_processed]; /* Sanity check that this chunk is actually local */ - HDassert(mpi_rank == local_chunk->orig_owner); - HDassert(mpi_rank == local_chunk->new_owner); + assert(mpi_rank == local_chunk->orig_owner); + assert(mpi_rank == local_chunk->new_owner); local_chunk->chunk_new = coll_entry->chunk_new; local_chunk->index_info.need_insert = need_insert; @@ -4979,7 +4979,7 @@ H5D__mpio_collective_filtered_chunk_reallocate(H5D_filtered_collective_io_info_t haddr_t curr_chunk_offset = local_chunk->chunk_new.offset; haddr_t prev_chunk_offset = chunk_list[num_local_chunks_processed - 1].chunk_new.offset; - HDassert(H5_addr_defined(prev_chunk_offset) && H5_addr_defined(curr_chunk_offset)); + assert(H5_addr_defined(prev_chunk_offset) && H5_addr_defined(curr_chunk_offset)); if (curr_chunk_offset < prev_chunk_offset) need_sort = TRUE; } @@ -4988,7 +4988,7 @@ H5D__mpio_collective_filtered_chunk_reallocate(H5D_filtered_collective_io_info_t } } - HDassert(chunk_list_num_entries == num_local_chunks_processed); + assert(chunk_list_num_entries == num_local_chunks_processed); /* * Ensure this rank's local chunk list is sorted in @@ -5055,10 +5055,10 @@ H5D__mpio_collective_filtered_chunk_reinsert(H5D_filtered_collective_io_info_t * FUNC_ENTER_PACKAGE - HDassert(chunk_list || 0 == chunk_list_num_entries); - HDassert(io_info); - HDassert(di); - HDassert(idx_info); + assert(chunk_list || 0 == chunk_list_num_entries); + assert(io_info); + assert(di); + assert(idx_info); #ifdef H5Dmpio_DEBUG H5D_MPIO_TRACE_ENTER(mpi_rank); @@ -5193,8 +5193,8 @@ H5D__mpio_collective_filtered_chunk_reinsert(H5D_filtered_collective_io_info_t * hbool_t coords_match = !HDmemcmp(scaled_coords, chunk_list[dbg_idx].chunk_info->scaled, di->dset->shared->ndims * sizeof(hsize_t)); - HDassert(coords_match && "Calculated scaled coordinates for chunk didn't match " - "chunk's actual scaled coordinates!"); + assert(coords_match && "Calculated scaled coordinates for chunk didn't match " + "chunk's actual scaled coordinates!"); break; } } @@ -5266,10 +5266,10 @@ H5D__mpio_get_chunk_redistribute_info_types(MPI_Datatype *contig_type, hbool_t * FUNC_ENTER_PACKAGE - HDassert(contig_type); - HDassert(contig_type_derived); - HDassert(resized_type); - HDassert(resized_type_derived); + assert(contig_type); + assert(contig_type_derived); + assert(resized_type); + assert(resized_type_derived); *contig_type_derived = FALSE; *resized_type_derived = FALSE; @@ -5279,7 +5279,7 @@ H5D__mpio_get_chunk_redistribute_info_types(MPI_Datatype *contig_type, hbool_t * HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't create derived type for chunk file description") field_count = 5; - HDassert(field_count == (sizeof(types) / sizeof(MPI_Datatype))); + assert(field_count == (sizeof(types) / sizeof(MPI_Datatype))); /* * Create structure type to pack chunk H5F_block_t structure @@ -5407,10 +5407,10 @@ H5D__mpio_get_chunk_alloc_info_types(MPI_Datatype *contig_type, hbool_t *contig_ FUNC_ENTER_PACKAGE - HDassert(contig_type); - HDassert(contig_type_derived); - HDassert(resized_type); - HDassert(resized_type_derived); + assert(contig_type); + assert(contig_type_derived); + assert(resized_type); + assert(resized_type_derived); *contig_type_derived = FALSE; *resized_type_derived = FALSE; @@ -5420,7 +5420,7 @@ H5D__mpio_get_chunk_alloc_info_types(MPI_Datatype *contig_type, hbool_t *contig_ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't create derived type for chunk file description") field_count = 3; - HDassert(field_count == (sizeof(types) / sizeof(MPI_Datatype))); + assert(field_count == (sizeof(types) / sizeof(MPI_Datatype))); /* * Create structure type to pack both chunk H5F_block_t structures @@ -5538,10 +5538,10 @@ H5D__mpio_get_chunk_insert_info_types(MPI_Datatype *contig_type, hbool_t *contig FUNC_ENTER_PACKAGE - HDassert(contig_type); - HDassert(contig_type_derived); - HDassert(resized_type); - HDassert(resized_type_derived); + assert(contig_type); + assert(contig_type_derived); + assert(resized_type); + assert(resized_type_derived); *contig_type_derived = FALSE; *resized_type_derived = FALSE; @@ -5551,7 +5551,7 @@ H5D__mpio_get_chunk_insert_info_types(MPI_Datatype *contig_type, hbool_t *contig HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't create derived type for chunk file description") field_count = 4; - HDassert(field_count == (sizeof(types) / sizeof(MPI_Datatype))); + assert(field_count == (sizeof(types) / sizeof(MPI_Datatype))); /* * Create struct type to pack information into memory as follows: @@ -5664,11 +5664,11 @@ H5D__mpio_collective_filtered_io_type(H5D_filtered_collective_io_info_t *chunk_l FUNC_ENTER_PACKAGE - HDassert(chunk_list || 0 == num_entries); - HDassert(new_mem_type); - HDassert(mem_type_derived); - HDassert(new_file_type); - HDassert(file_type_derived); + assert(chunk_list || 0 == num_entries); + assert(new_mem_type); + assert(mem_type_derived); + assert(new_file_type); + assert(file_type_derived); *mem_type_derived = FALSE; *file_type_derived = FALSE; @@ -5768,7 +5768,7 @@ H5D__mpio_collective_filtered_io_type(H5D_filtered_collective_io_info_t *chunk_l * Set the current chunk entry's offset in the file, relative to * the first chunk entry */ - HDassert(H5_addr_defined(chunk_block->offset)); + assert(H5_addr_defined(chunk_block->offset)); file_offset_array[chunk_count] = (MPI_Aint)(chunk_block->offset - base_offset); /* @@ -5776,7 +5776,7 @@ H5D__mpio_collective_filtered_io_type(H5D_filtered_collective_io_info_t *chunk_l * offset in the file */ if (chunk_count) - HDassert(file_offset_array[chunk_count] > file_offset_array[chunk_count - 1]); + assert(file_offset_array[chunk_count] > file_offset_array[chunk_count - 1]); /* Set the current chunk entry's size for the I/O operation */ H5_CHECK_OVERFLOW(chunk_block->length, hsize_t, int); @@ -5837,9 +5837,9 @@ H5D__mpio_collective_filtered_io_type(H5D_filtered_collective_io_info_t *chunk_l HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) } else { - HDassert(file_offset_array); - HDassert(length_array); - HDassert(io_buf_array); + assert(file_offset_array); + assert(length_array); + assert(io_buf_array); /* Multiple chunks - use an hindexed type for both memory and file */ @@ -5907,7 +5907,7 @@ H5D__mpio_dump_collective_filtered_chunk_list(H5D_filtered_collective_io_info_t chunk_entry = &chunk_list[i]; - HDassert(chunk_entry->chunk_info); + assert(chunk_entry->chunk_info); chunk_rank = (unsigned)H5S_GET_EXTENT_NDIMS(chunk_entry->chunk_info->fspace); H5D_MPIO_DEBUG(mpi_rank, " {"); diff --git a/src/H5Dnone.c b/src/H5Dnone.c index eb2a137..0ece5b7 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -119,14 +119,14 @@ H5D__none_idx_create(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->pline->nused == 0); /* Shouldn't have filter defined on entering here */ - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(idx_info->layout->max_nchunks); - HDassert(!H5_addr_defined(idx_info->storage->idx_addr)); /* address of data shouldn't be defined */ + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->pline->nused == 0); /* Shouldn't have filter defined on entering here */ + assert(idx_info->layout); + assert(idx_info->storage); + assert(idx_info->layout->max_nchunks); + assert(!H5_addr_defined(idx_info->storage->idx_addr)); /* address of data shouldn't be defined */ /* Calculate size of max dataset chunks */ nbytes = idx_info->layout->max_nchunks * idx_info->layout->size; @@ -160,7 +160,7 @@ H5D__none_idx_is_space_alloc(const H5O_storage_chunk_t *storage) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) } /* end H5D__none_idx_is_space_alloc() */ @@ -183,14 +183,14 @@ H5D__none_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->pline->nused == 0); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(udata); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->pline->nused == 0); + assert(idx_info->layout); + assert(idx_info->storage); + assert(udata); + assert(H5_addr_defined(idx_info->storage->idx_addr)); /* Calculate the index of this chunk */ udata->chunk_idx = H5VM_array_offset_pre((idx_info->layout->ndims - 1), idx_info->layout->max_down_chunks, @@ -231,15 +231,15 @@ H5D__none_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t ch FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(!idx_info->pline->nused); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(chunk_cb); - HDassert(chunk_udata); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(!idx_info->pline->nused); + assert(idx_info->layout); + assert(idx_info->storage); + assert(chunk_cb); + assert(chunk_udata); + assert(H5_addr_defined(idx_info->storage->idx_addr)); /* Initialize generic chunk record */ HDmemset(&chunk_rec, 0, sizeof(chunk_rec)); @@ -247,7 +247,7 @@ H5D__none_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t ch chunk_rec.filter_mask = 0; ndims = idx_info->layout->ndims - 1; - HDassert(ndims > 0); + assert(ndims > 0); /* Iterate over all the chunks in the dataset's dataspace */ for (u = 0; u < idx_info->layout->nchunks && ret_value == H5_ITER_CONT; u++) { @@ -330,13 +330,13 @@ H5D__none_idx_delete(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(!idx_info->pline->nused); /* Shouldn't have filter defined on entering here */ - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); /* should be defined */ + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(!idx_info->pline->nused); /* Shouldn't have filter defined on entering here */ + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); /* should be defined */ /* chunk size * max # of chunks */ nbytes = idx_info->layout->max_nchunks * idx_info->layout->size; @@ -369,20 +369,20 @@ H5D__none_idx_copy_setup(const H5D_chk_idx_info_t H5_ATTR_NDEBUG_UNUSED *idx_inf FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info_src); - HDassert(idx_info_src->f); - HDassert(idx_info_src->pline); - HDassert(!idx_info_src->pline->nused); - HDassert(idx_info_src->layout); - HDassert(idx_info_src->storage); - HDassert(H5_addr_defined(idx_info_src->storage->idx_addr)); - - HDassert(idx_info_dst); - HDassert(idx_info_dst->f); - HDassert(idx_info_dst->pline); - HDassert(!idx_info_dst->pline->nused); - HDassert(idx_info_dst->layout); - HDassert(idx_info_dst->storage); + assert(idx_info_src); + assert(idx_info_src->f); + assert(idx_info_src->pline); + assert(!idx_info_src->pline->nused); + assert(idx_info_src->layout); + assert(idx_info_src->storage); + assert(H5_addr_defined(idx_info_src->storage->idx_addr)); + + assert(idx_info_dst); + assert(idx_info_dst->f); + assert(idx_info_dst->pline); + assert(!idx_info_dst->pline->nused); + assert(idx_info_dst->layout); + assert(idx_info_dst->storage); /* Set copied metadata tag */ H5_BEGIN_TAG(H5AC__COPIED_TAG) @@ -416,7 +416,7 @@ H5D__none_idx_size(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info, hsize_t *i FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(index_size); + assert(index_size); *index_size = 0; @@ -440,7 +440,7 @@ H5D__none_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); /* Reset index info */ if (reset_addr) @@ -466,8 +466,8 @@ H5D__none_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); - HDassert(stream); + assert(storage); + assert(stream); HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); diff --git a/src/H5Doh.c b/src/H5Doh.c index 1542d24..d9af6e5 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -129,7 +129,7 @@ H5O__dset_free_copy_file_udata(void *_udata) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(udata); + assert(udata); /* Release copy of dataset's dataspace extent, if it was set */ if (udata->src_space_extent) @@ -174,7 +174,7 @@ H5O__dset_isa(const H5O_t *oh) FUNC_ENTER_PACKAGE - HDassert(oh); + assert(oh); /* Datatype */ if ((exists = H5O_msg_exists_oh(oh, H5O_DTYPE_ID)) < 0) @@ -214,7 +214,7 @@ H5O__dset_open(const H5G_loc_t *obj_loc, H5I_type_t *opened_type) FUNC_ENTER_PACKAGE - HDassert(obj_loc); + assert(obj_loc); *opened_type = H5I_DATASET; @@ -278,9 +278,9 @@ H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(crt_info); - HDassert(obj_loc); + assert(f); + assert(crt_info); + assert(obj_loc); /* Create the dataset */ if (NULL == @@ -364,11 +364,11 @@ H5O__dset_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(oh); - HDassert(bh_info); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(oh); + assert(bh_info); /* Get the layout message from the object header */ if (NULL == H5O_msg_read_oh(loc->file, oh, H5O_LAYOUT_ID, &layout)) @@ -443,8 +443,8 @@ H5O__dset_flush(void *_obj_ptr) FUNC_ENTER_PACKAGE - HDassert(dset); - HDassert(&dset->oloc); + assert(dset); + assert(&dset->oloc); /* Check that the object found is the correct type */ if (H5O_obj_type(&dset->oloc, &obj_type) < 0) 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; diff --git a/src/H5Dselect.c b/src/H5Dselect.c index a5ba23d..79f4269 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -100,10 +100,10 @@ H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info FUNC_ENTER_PACKAGE /* Check args */ - HDassert(io_info); - HDassert(dset_info->dset); - HDassert(dset_info->store); - HDassert(dset_info->buf.vp); + assert(io_info); + assert(dset_info->dset); + assert(dset_info->store); + assert(dset_info->buf.vp); if (elmt_size == 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid elmt_size of 0") @@ -139,7 +139,7 @@ H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") } /* end if */ else { - HDassert(io_info->op_type == H5D_IO_OP_WRITE); + assert(io_info->op_type == H5D_IO_OP_WRITE); if ((tmp_file_len = (*dset_info->layout_ops.writevv)( io_info, dset_info, file_nseq, &curr_file_seq, &single_file_len, &single_file_off, mem_nseq, &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0) @@ -147,7 +147,7 @@ H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info } /* end else */ /* Decrement number of elements left to process */ - HDassert(((size_t)tmp_file_len % elmt_size) == 0); + assert(((size_t)tmp_file_len % elmt_size) == 0); } /* end if */ else { size_t mem_nelem; /* Number of elements used in memory sequences */ @@ -224,7 +224,7 @@ H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") } /* end if */ else { - HDassert(io_info->op_type == H5D_IO_OP_WRITE); + assert(io_info->op_type == H5D_IO_OP_WRITE); if ((tmp_file_len = (*dset_info->layout_ops.writevv)( io_info, dset_info, file_nseq, &curr_file_seq, file_len, file_off, mem_nseq, &curr_mem_seq, mem_len, mem_off)) < 0) @@ -232,7 +232,7 @@ H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info } /* end else */ /* Decrement number of elements left to process */ - HDassert(((size_t)tmp_file_len % elmt_size) == 0); + assert(((size_t)tmp_file_len % elmt_size) == 0); nelmts -= ((size_t)tmp_file_len / elmt_size); } /* end while */ } /* end else */ @@ -300,10 +300,10 @@ H5D_select_io_mem(void *dst_buf, H5S_t *dst_space, const void *src_buf, H5S_t *s FUNC_ENTER_NOAPI(FAIL) - HDassert(dst_buf); - HDassert(dst_space); - HDassert(src_buf); - HDassert(src_space); + assert(dst_buf); + assert(dst_space); + assert(src_buf); + assert(src_space); if (elmt_size == 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "invalid elmt_size of 0") @@ -334,7 +334,7 @@ H5D_select_io_mem(void *dst_buf, H5S_t *dst_space, const void *src_buf, H5S_t *s src_nseq, &curr_src_seq, &single_src_len, &single_src_off)) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") - HDassert(((size_t)bytes_copied % elmt_size) == 0); + assert(((size_t)bytes_copied % elmt_size) == 0); } else { unsigned sel_iter_flags = H5S_SEL_ITER_GET_SEQ_LIST_SORTED | H5S_SEL_ITER_SHARE_WITH_DATASPACE; @@ -410,7 +410,7 @@ H5D_select_io_mem(void *dst_buf, H5S_t *dst_space, const void *src_buf, H5S_t *s HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") /* Decrement number of elements left to process */ - HDassert(((size_t)bytes_copied % elmt_size) == 0); + assert(((size_t)bytes_copied % elmt_size) == 0); nelmts -= ((size_t)bytes_copied / elmt_size); } } diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index 9566a5c..2ddd6cf 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -118,11 +118,11 @@ H5D__single_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t H5_ATTR_UNU FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); if (idx_info->pline->nused) { idx_info->layout->flags |= H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER; @@ -156,19 +156,19 @@ H5D__single_idx_create(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(idx_info->layout->max_nchunks == idx_info->layout->nchunks); - HDassert(idx_info->layout->nchunks == 1); - HDassert(!H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(idx_info->layout->max_nchunks == idx_info->layout->nchunks); + assert(idx_info->layout->nchunks == 1); + assert(!H5_addr_defined(idx_info->storage->idx_addr)); if (idx_info->pline->nused) - HDassert(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER); + assert(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER); else - HDassert(!(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER)); + assert(!(idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER)); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D__single_idx_create() */ @@ -190,7 +190,7 @@ H5D__single_idx_is_space_alloc(const H5O_storage_chunk_t *storage) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); FUNC_LEAVE_NOAPI((hbool_t)H5_addr_defined(storage->idx_addr)) } /* end H5D__single_idx_is_space_alloc() */ @@ -214,17 +214,17 @@ H5D__single_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(idx_info->layout->nchunks == 1); - HDassert(idx_info->layout->max_nchunks == 1); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(idx_info->layout->nchunks == 1); + assert(idx_info->layout->max_nchunks == 1); + assert(udata); /* Set the address for the chunk */ - HDassert(H5_addr_defined(udata->chunk_block.offset)); + assert(H5_addr_defined(udata->chunk_block.offset)); idx_info->storage->idx_addr = udata->chunk_block.offset; if (idx_info->pline->nused > 0) { @@ -260,14 +260,14 @@ H5D__single_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(idx_info->layout->nchunks == 1); - HDassert(idx_info->layout->max_nchunks == 1); - HDassert(udata); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(idx_info->layout->nchunks == 1); + assert(idx_info->layout->max_nchunks == 1); + assert(udata); udata->chunk_block.offset = idx_info->storage->idx_addr; if (idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER) { @@ -304,14 +304,14 @@ H5D__single_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(chunk_cb); - HDassert(chunk_udata); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(chunk_cb); + assert(chunk_udata); + assert(H5_addr_defined(idx_info->storage->idx_addr)); /* Initialize generic chunk record */ HDmemset(&chunk_rec, 0, sizeof(chunk_rec)); @@ -353,12 +353,12 @@ H5D__single_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); - HDassert(H5_addr_defined(idx_info->storage->idx_addr)); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); + assert(H5_addr_defined(idx_info->storage->idx_addr)); if (idx_info->layout->flags & H5O_LAYOUT_CHUNK_SINGLE_INDEX_WITH_FILTER) nbytes = idx_info->storage->u.single.nbytes; @@ -394,16 +394,16 @@ H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->pline); - HDassert(idx_info->layout); - HDassert(idx_info->storage); + assert(idx_info); + assert(idx_info->f); + assert(idx_info->pline); + assert(idx_info->layout); + assert(idx_info->storage); if (H5_addr_defined(idx_info->storage->idx_addr)) ret_value = H5D__single_idx_remove(idx_info, NULL); else - HDassert(!H5_addr_defined(idx_info->storage->idx_addr)); + assert(!H5_addr_defined(idx_info->storage->idx_addr)); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__single_idx_delete() */ @@ -428,18 +428,18 @@ H5D__single_idx_copy_setup(const H5D_chk_idx_info_t H5_ATTR_NDEBUG_UNUSED *idx_i FUNC_ENTER_PACKAGE /* Check args */ - HDassert(idx_info_src); - HDassert(idx_info_src->f); - HDassert(idx_info_src->pline); - HDassert(idx_info_src->layout); - HDassert(idx_info_src->storage); - HDassert(H5_addr_defined(idx_info_src->storage->idx_addr)); - - HDassert(idx_info_dst); - HDassert(idx_info_dst->f); - HDassert(idx_info_dst->pline); - HDassert(idx_info_dst->layout); - HDassert(idx_info_dst->storage); + assert(idx_info_src); + assert(idx_info_src->f); + assert(idx_info_src->pline); + assert(idx_info_src->layout); + assert(idx_info_src->storage); + assert(H5_addr_defined(idx_info_src->storage->idx_addr)); + + assert(idx_info_dst); + assert(idx_info_dst->f); + assert(idx_info_dst->pline); + assert(idx_info_dst->layout); + assert(idx_info_dst->storage); /* Set copied metadata tag */ H5_BEGIN_TAG(H5AC__COPIED_TAG) @@ -473,7 +473,7 @@ H5D__single_idx_size(const H5D_chk_idx_info_t H5_ATTR_UNUSED *idx_info, hsize_t FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(index_size); + assert(index_size); *index_size = 0; @@ -497,7 +497,7 @@ H5D__single_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); + assert(storage); /* Reset index info */ if (reset_addr) @@ -523,8 +523,8 @@ H5D__single_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(storage); - HDassert(stream); + assert(storage); + assert(stream); HDfprintf(stream, " Address: %" PRIuHADDR "\n", storage->idx_addr); diff --git a/src/H5Dtest.c b/src/H5Dtest.c index 1d9d2ca..d6e57c1 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -122,7 +122,7 @@ H5D__layout_contig_size_test(hid_t did, hsize_t *size) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") if (size) { - HDassert(dset->shared->layout.type == H5D_CONTIGUOUS); + assert(dset->shared->layout.type == H5D_CONTIGUOUS); *size = dset->shared->layout.storage.u.contig.size; } /* end if */ @@ -162,7 +162,7 @@ H5D__layout_compact_dirty_test(hid_t did, hbool_t *dirty) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") if (dirty) { - HDassert(dset->shared->layout.type == H5D_COMPACT); + assert(dset->shared->layout.type == H5D_COMPACT); *dirty = dset->shared->layout.storage.u.compact.dirty; } /* end if */ @@ -197,7 +197,7 @@ H5D__layout_type_test(hid_t did, H5D_layout_t *layout_type) FUNC_ENTER_PACKAGE - HDassert(layout_type); + assert(layout_type); /* Check args */ if (NULL == (dset = (H5D_t *)H5VL_object_verify(did, H5I_DATASET))) @@ -282,12 +282,12 @@ H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") if (nbytes_used) { - HDassert(dset->shared->layout.type == H5D_CHUNKED); + assert(dset->shared->layout.type == H5D_CHUNKED); *nbytes_used = dset->shared->cache.chunk.nbytes_used; } /* end if */ if (nused) { - HDassert(dset->shared->layout.type == H5D_CHUNKED); + assert(dset->shared->layout.type == H5D_CHUNKED); *nused = dset->shared->cache.chunk.nused; } /* end if */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index f850e1c..18596b9 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -320,9 +320,9 @@ H5D_virtual_update_min_dims(H5O_layout_t *layout, size_t idx) FUNC_ENTER_NOAPI(FAIL) - HDassert(layout); - HDassert(layout->type == H5D_VIRTUAL); - HDassert(idx < virt->list_nalloc); + assert(layout); + assert(layout->type == H5D_VIRTUAL); + assert(idx < virt->list_nalloc); /* Get type of selection */ if (H5S_SEL_ERROR == (sel_type = H5S_GET_SELECT_TYPE(ent->source_dset.virtual_select))) @@ -373,9 +373,9 @@ H5D_virtual_check_min_dims(const H5D_t *dset) FUNC_ENTER_NOAPI(FAIL) - HDassert(dset); - HDassert(dset->shared); - HDassert(dset->shared->layout.type == H5D_VIRTUAL); + assert(dset); + assert(dset->shared); + assert(dset->shared->layout.type == H5D_VIRTUAL); /* Get rank of dataspace */ if ((rank = H5S_GET_EXTENT_NDIMS(dset->shared->space)) < 0) @@ -429,9 +429,9 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) FUNC_ENTER_PACKAGE /* Sanity checking */ - HDassert(f); - HDassert(layout); - HDassert(virt->serial_list_hobjid.addr == HADDR_UNDEF); + assert(f); + assert(layout); + assert(virt->serial_list_hobjid.addr == HADDR_UNDEF); /* Create block if # of used entries > 0 */ if (virt->list_nused > 0) { @@ -455,10 +455,10 @@ H5D__virtual_store_layout(H5F_t *f, H5O_layout_t *layout) H5O_storage_virtual_ent_t *ent = &virt->list[i]; hssize_t select_serial_size; /* Size of serialized selection */ - HDassert(ent->source_file_name); - HDassert(ent->source_dset_name); - HDassert(ent->source_select); - HDassert(ent->source_dset.virtual_select); + assert(ent->source_file_name); + assert(ent->source_dset_name); + assert(ent->source_select); + assert(ent->source_dset.virtual_select); /* Source file name */ str_size[2 * i] = HDstrlen(ent->source_file_name) + (size_t)1; @@ -562,8 +562,8 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) FUNC_ENTER_PACKAGE - HDassert(layout); - HDassert(layout->type == H5D_VIRTUAL); + assert(layout); + assert(layout->type == H5D_VIRTUAL); /* Save original entry list and top-level property lists and reset in layout * so the originals aren't closed on error */ @@ -576,7 +576,7 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) /* Copy entry list */ if (virt->list_nused > 0) { - HDassert(orig_list); + assert(orig_list); /* Allocate memory for the list */ if (NULL == (virt->list = H5MM_calloc(virt->list_nused * sizeof(virt->list[0])))) @@ -630,8 +630,8 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) else if (orig_list[i].parsed_source_file_name && (orig_list[i].source_dset.file_name != orig_list[i].parsed_source_file_name->name_segment)) { - HDassert(ent->parsed_source_file_name); - HDassert(ent->parsed_source_file_name->name_segment); + assert(ent->parsed_source_file_name); + assert(ent->parsed_source_file_name->name_segment); ent->source_dset.file_name = ent->parsed_source_file_name->name_segment; } /* end if */ else if (NULL == @@ -644,8 +644,8 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) else if (orig_list[i].parsed_source_dset_name && (orig_list[i].source_dset.dset_name != orig_list[i].parsed_source_dset_name->name_segment)) { - HDassert(ent->parsed_source_dset_name); - HDassert(ent->parsed_source_dset_name->name_segment); + assert(ent->parsed_source_dset_name); + assert(ent->parsed_source_dset_name->name_segment); ent->source_dset.dset_name = ent->parsed_source_dset_name->name_segment; } /* end if */ else if (NULL == @@ -721,8 +721,8 @@ H5D__virtual_reset_layout(H5O_layout_t *layout) FUNC_ENTER_PACKAGE - HDassert(layout); - HDassert(layout->type == H5D_VIRTUAL); + assert(layout); + assert(layout->type == H5D_VIRTUAL); /* Free the list entries. Note we always attempt to free everything even in * the case of a failure. Because of this, and because we free the list @@ -846,9 +846,9 @@ H5D__virtual_delete(H5F_t *f, H5O_storage_t *storage) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(storage); - HDassert(storage->type == H5D_VIRTUAL); + assert(f); + assert(storage); + assert(storage->type == H5D_VIRTUAL); /* Check for global heap block */ if (storage->u.virt.serial_list_hobjid.addr != HADDR_UNDEF) { @@ -894,11 +894,11 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, H5O_storage_virtual_ent_t *vir FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(vdset); - HDassert(source_dset); - HDassert(!source_dset->dset); - HDassert(source_dset->file_name); - HDassert(source_dset->dset_name); + assert(vdset); + assert(source_dset); + assert(!source_dset->dset); + assert(source_dset->file_name); + assert(source_dset->dset_name); /* Check if we need to open the source file */ if (HDstrcmp(source_dset->file_name, ".") != 0) { @@ -986,7 +986,7 @@ H5D__virtual_reset_source_dset(H5O_storage_virtual_ent_t *virtual_ent, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(source_dset); + assert(source_dset); /* Free dataset */ if (source_dset->dset) { @@ -1000,20 +1000,20 @@ H5D__virtual_reset_source_dset(H5O_storage_virtual_ent_t *virtual_ent, (source_dset->file_name != virtual_ent->parsed_source_file_name->name_segment)) source_dset->file_name = (char *)H5MM_xfree(source_dset->file_name); else - HDassert((source_dset->file_name == virtual_ent->source_file_name) || - (virtual_ent->parsed_source_file_name && - (source_dset->file_name == virtual_ent->parsed_source_file_name->name_segment)) || - !source_dset->file_name); + assert((source_dset->file_name == virtual_ent->source_file_name) || + (virtual_ent->parsed_source_file_name && + (source_dset->file_name == virtual_ent->parsed_source_file_name->name_segment)) || + !source_dset->file_name); /* Free dataset name */ if (virtual_ent->parsed_source_dset_name && (source_dset->dset_name != virtual_ent->parsed_source_dset_name->name_segment)) source_dset->dset_name = (char *)H5MM_xfree(source_dset->dset_name); else - HDassert((source_dset->dset_name == virtual_ent->source_dset_name) || - (virtual_ent->parsed_source_dset_name && - (source_dset->dset_name == virtual_ent->parsed_source_dset_name->name_segment)) || - !source_dset->dset_name); + assert((source_dset->dset_name == virtual_ent->source_dset_name) || + (virtual_ent->parsed_source_dset_name && + (source_dset->dset_name == virtual_ent->parsed_source_dset_name->name_segment)) || + !source_dset->dset_name); /* Free clipped virtual selection */ if (source_dset->clipped_virtual_select) { @@ -1040,7 +1040,7 @@ H5D__virtual_reset_source_dset(H5O_storage_virtual_ent_t *virtual_ent, /* The projected memory space should never exist when this function is * called */ - HDassert(!source_dset->projected_mem_space); + assert(!source_dset->projected_mem_space); /* Note the lack of a done: label. This is because there are no HGOTO_ERROR * calls. If one is added, a done: label must also be added */ @@ -1068,17 +1068,17 @@ H5D__virtual_str_append(const char *src, size_t src_len, char **p, char **buf, s FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(src); - HDassert(src_len > 0); - HDassert(p); - HDassert(buf); - HDassert(*p >= *buf); - HDassert(buf_size); + assert(src); + assert(src_len > 0); + assert(p); + assert(buf); + assert(*p >= *buf); + assert(buf_size); /* Allocate or extend buffer if necessary */ if (!*buf) { - HDassert(!*p); - HDassert(*buf_size == 0); + assert(!*p); + assert(*buf_size == 0); /* Allocate buffer */ if (NULL == (*buf = (char *)H5MM_malloc(src_len + (size_t)1))) @@ -1150,10 +1150,10 @@ H5D_virtual_parse_source_name(const char *source_name, H5O_storage_virtual_name_ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(source_name); - HDassert(parsed_name); - HDassert(static_strlen); - HDassert(nsubs); + assert(source_name); + assert(parsed_name); + assert(static_strlen); + assert(nsubs); /* Initialize p and tmp_static_strlen */ p = source_name; @@ -1163,7 +1163,7 @@ H5D_virtual_parse_source_name(const char *source_name, H5O_storage_virtual_name_ /* Note this will not work with UTF-8! We should support this eventually * -NAF 5/18/2015 */ while ((pct = HDstrchr(p, '%'))) { - HDassert(pct >= p); + assert(pct >= p); /* Allocate name segment struct if necessary */ if (!*tmp_parsed_name_p) @@ -1204,11 +1204,11 @@ H5D_virtual_parse_source_name(const char *source_name, H5O_storage_virtual_name_ /* Copy last segment of name, if any, unless the parsed name was not * allocated */ if (tmp_parsed_name) { - HDassert(p >= source_name); + assert(p >= source_name); if (*p == '\0') - HDassert((size_t)(p - source_name) == tmp_strlen); + assert((size_t)(p - source_name) == tmp_strlen); else { - HDassert((size_t)(p - source_name) < tmp_strlen); + assert((size_t)(p - source_name) < tmp_strlen); /* Allocate name segment struct if necessary */ if (!*tmp_parsed_name_p) @@ -1230,7 +1230,7 @@ H5D_virtual_parse_source_name(const char *source_name, H5O_storage_virtual_name_ done: if (tmp_parsed_name) { - HDassert(ret_value < 0); + assert(ret_value < 0); H5D_virtual_free_parsed_name(tmp_parsed_name); } /* end if */ @@ -1260,7 +1260,7 @@ H5D__virtual_copy_parsed_name(H5O_storage_virtual_name_seg_t **dst, H5O_storage_ FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dst); + assert(dst); /* Walk over parsed name, duplicating it */ while (p_src) { @@ -1285,7 +1285,7 @@ H5D__virtual_copy_parsed_name(H5O_storage_virtual_name_seg_t **dst, H5O_storage_ done: if (tmp_dst) { - HDassert(ret_value < 0); + assert(ret_value < 0); H5D_virtual_free_parsed_name(tmp_dst); } /* end if */ @@ -1345,8 +1345,8 @@ H5D__virtual_build_source_name(char *source_name, const H5O_storage_virtual_name FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(source_name); - HDassert(built_name); + assert(source_name); + assert(built_name); /* Check for static name */ if (nsubs == 0) { @@ -1365,7 +1365,7 @@ H5D__virtual_build_source_name(char *source_name, const H5O_storage_virtual_name size_t seg_len; size_t nsubs_rem = nsubs; - HDassert(parsed_name); + assert(parsed_name); /* Calculate length of printed block number */ do { @@ -1388,8 +1388,8 @@ H5D__virtual_build_source_name(char *source_name, const H5O_storage_virtual_name /* Add name segment */ if (name_seg->name_segment) { seg_len = HDstrlen(name_seg->name_segment); - HDassert(seg_len > 0); - HDassert(seg_len < name_len_rem); + assert(seg_len > 0); + assert(seg_len < name_len_rem); HDstrncpy(p, name_seg->name_segment, name_len_rem); name_len_rem -= seg_len; p += seg_len; @@ -1397,7 +1397,7 @@ H5D__virtual_build_source_name(char *source_name, const H5O_storage_virtual_name /* Add block number */ if (nsubs_rem > 0) { - HDassert(blockno_len < name_len_rem); + assert(blockno_len < name_len_rem); if (HDsnprintf(p, name_len_rem, "%llu", (long long unsigned)blockno) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write block number to string") name_len_rem -= blockno_len; @@ -1416,7 +1416,7 @@ H5D__virtual_build_source_name(char *source_name, const H5O_storage_virtual_name done: if (tmp_name) { - HDassert(ret_value < 0); + assert(ret_value < 0); H5MM_free(tmp_name); } /* end if */ @@ -1453,10 +1453,10 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); - HDassert(dset->shared->layout.storage.type == H5D_VIRTUAL); + assert(dset); + assert(dset->shared->layout.storage.type == H5D_VIRTUAL); storage = &dset->shared->layout.storage.u.virt; - HDassert((storage->view == H5D_VDS_FIRST_MISSING) || (storage->view == H5D_VDS_LAST_AVAILABLE)); + assert((storage->view == H5D_VDS_FIRST_MISSING) || (storage->view == H5D_VDS_LAST_AVAILABLE)); /* Get rank of VDS */ if ((rank = H5S_GET_EXTENT_NDIMS(dset->shared->space)) < 0) @@ -1518,8 +1518,8 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) /* Close previous clipped virtual selection, if * any */ if (storage->list[i].source_dset.clipped_virtual_select) { - HDassert(storage->list[i].source_dset.clipped_virtual_select != - storage->list[i].source_dset.virtual_select); + assert(storage->list[i].source_dset.clipped_virtual_select != + storage->list[i].source_dset.virtual_select); if (H5S_close(storage->list[i].source_dset.clipped_virtual_select) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release clipped virtual dataspace") @@ -1541,8 +1541,8 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) /* Close previous clipped source selection, if any */ if (storage->list[i].source_dset.clipped_source_select) { - HDassert(storage->list[i].source_dset.clipped_source_select != - storage->list[i].source_select); + assert(storage->list[i].source_dset.clipped_source_select != + storage->list[i].source_select); if (H5S_close(storage->list[i].source_dset.clipped_source_select) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release clipped source dataspace") @@ -1576,7 +1576,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) 0; /* First missing dataset in the current block of missing datasets */ /* Search for source datasets */ - HDassert(storage->printf_gap != HSIZE_UNDEF); + assert(storage->printf_gap != HSIZE_UNDEF); for (j = 0; j <= (storage->printf_gap + first_missing); j++) { /* Check for running out of space in sub_dset array */ if (j >= (hsize_t)storage->list[i].sub_dset_nalloc) { @@ -1766,8 +1766,8 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) /* Non-printf mapping */ /* Close previous clipped virtual selection, if any */ if (storage->list[i].source_dset.clipped_virtual_select) { - HDassert(storage->list[i].source_dset.clipped_virtual_select != - storage->list[i].source_dset.virtual_select); + assert(storage->list[i].source_dset.clipped_virtual_select != + storage->list[i].source_dset.virtual_select); if (H5S_close(storage->list[i].source_dset.clipped_virtual_select) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release clipped virtual dataspace") @@ -1793,8 +1793,8 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) if (clip_size != storage->list[i].clip_size_source) { /* Close previous clipped source selection, if any */ if (storage->list[i].source_dset.clipped_source_select) { - HDassert(storage->list[i].source_dset.clipped_source_select != - storage->list[i].source_select); + assert(storage->list[i].source_dset.clipped_source_select != + storage->list[i].source_select); if (H5S_close(storage->list[i].source_dset.clipped_source_select) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release clipped source dataspace") @@ -1896,7 +1896,7 @@ H5D__virtual_set_extent_unlim(const H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace") } /* end if */ else - HDassert(!storage->list[i].sub_dset[j].clipped_virtual_select); + assert(!storage->list[i].sub_dset[j].clipped_virtual_select); } /* end for */ } /* end if */ @@ -1935,10 +1935,10 @@ H5D__virtual_init_all(const H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); - HDassert(dset->shared->layout.storage.type == H5D_VIRTUAL); + assert(dset); + assert(dset->shared->layout.storage.type == H5D_VIRTUAL); storage = &dset->shared->layout.storage.u.virt; - HDassert((storage->view == H5D_VDS_FIRST_MISSING) || (storage->view == H5D_VDS_LAST_AVAILABLE)); + assert((storage->view == H5D_VDS_FIRST_MISSING) || (storage->view == H5D_VDS_LAST_AVAILABLE)); /* Get current VDS dimensions */ if (H5S_get_simple_extent_dims(dset->shared->space, virtual_dims, NULL) < 0) @@ -1977,8 +1977,8 @@ H5D__virtual_init_all(const H5D_t *dset) /* Close previous clipped virtual selection, if any */ if (storage->list[i].source_dset.clipped_virtual_select) { - HDassert(storage->list[i].source_dset.clipped_virtual_select != - storage->list[i].source_dset.virtual_select); + assert(storage->list[i].source_dset.clipped_virtual_select != + storage->list[i].source_dset.virtual_select); if (H5S_close(storage->list[i].source_dset.clipped_virtual_select) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release clipped virtual dataspace") @@ -1991,8 +1991,8 @@ H5D__virtual_init_all(const H5D_t *dset) /* Close previous clipped source selection, if any */ if (storage->list[i].source_dset.clipped_source_select) { - HDassert(storage->list[i].source_dset.clipped_source_select != - storage->list[i].source_select); + assert(storage->list[i].source_dset.clipped_source_select != + storage->list[i].source_select); if (H5S_close(storage->list[i].source_dset.clipped_source_select) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release clipped source dataspace") @@ -2036,8 +2036,8 @@ H5D__virtual_init_all(const H5D_t *dset) } /* end else */ } /* end if */ else { - HDassert(!storage->list[i].source_dset.clipped_virtual_select); - HDassert(!storage->list[i].source_dset.clipped_source_select); + assert(!storage->list[i].source_dset.clipped_virtual_select); + assert(!storage->list[i].source_dset.clipped_source_select); } /* end else */ } /* end if */ else { @@ -2153,8 +2153,8 @@ H5D__virtual_init_all(const H5D_t *dset) else { /* Limited mapping, just make sure the clipped selections were * already set. Again, no need to open the source file. */ - HDassert(storage->list[i].source_dset.clipped_virtual_select); - HDassert(storage->list[i].source_dset.clipped_source_select); + assert(storage->list[i].source_dset.clipped_virtual_select); + assert(storage->list[i].source_dset.clipped_source_select); } /* end else */ /* Mark layout as fully initialized */ @@ -2189,9 +2189,9 @@ H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); + assert(dset); storage = &dset->shared->layout.storage.u.virt; - HDassert(storage->list || (storage->list_nused == 0)); + assert(storage->list || (storage->list_nused == 0)); /* Check that the dimensions of the VDS are large enough */ if (H5D_virtual_check_min_dims(dset) < 0) @@ -2208,7 +2208,7 @@ H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) * source_space_status and virtual_space_status because others will be based * on these and should therefore already have been normalized. */ for (i = 0; i < storage->list_nused; i++) { - HDassert(storage->list[i].sub_dset_nalloc == 0); + assert(storage->list[i].sub_dset_nalloc == 0); /* Patch extent */ if (H5S_extent_copy(storage->list[i].source_dset.virtual_select, dset->shared->space) < 0) @@ -2270,7 +2270,7 @@ H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) if (H5P_get(source_fapl, H5F_ACS_CLOSE_DEGREE_NAME, &close_degree) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file close degree") - HDassert(close_degree == H5F_CLOSE_WEAK); + assert(close_degree == H5F_CLOSE_WEAK); } /* end else */ #endif /* NDEBUG */ @@ -2340,7 +2340,7 @@ H5D__virtual_is_data_cached(const H5D_shared_t *shared_dset) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(shared_dset); + assert(shared_dset); storage = &shared_dset->layout.storage.u.virt; /* Iterate over mappings */ @@ -2421,10 +2421,10 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(storage); - HDassert(mem_space); - HDassert(file_space); - HDassert(tot_nelmts); + assert(storage); + assert(mem_space); + assert(file_space); + assert(tot_nelmts); /* Initialize layout if necessary */ if (!storage->init) @@ -2437,13 +2437,13 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag /* Iterate over mappings */ for (i = 0; i < storage->list_nused; i++) { /* Sanity check that the virtual space has been patched by now */ - HDassert(storage->list[i].virtual_space_status == H5O_VIRTUAL_STATUS_CORRECT); + assert(storage->list[i].virtual_space_status == H5O_VIRTUAL_STATUS_CORRECT); /* Check for "printf" source dataset resolution */ if (storage->list[i].psfn_nsubs || storage->list[i].psdn_nsubs) { hbool_t partial_block; - HDassert(storage->list[i].unlim_dim_virtual >= 0); + assert(storage->list[i].unlim_dim_virtual >= 0); /* Get selection bounds if necessary */ if (!bounds_init) { @@ -2484,12 +2484,12 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag if (!storage->list[i].sub_dset[j].clipped_virtual_select) { hsize_t start[H5S_MAX_RANK]; /* This should only be NULL if this is a partial block */ - HDassert((j == (storage->list[i].sub_dset_io_end - 1)) && partial_block); + assert((j == (storage->list[i].sub_dset_io_end - 1)) && partial_block); /* If the source space status is not correct, we must try to * open the source dataset to patch it */ if (storage->list[i].source_space_status != H5O_VIRTUAL_STATUS_CORRECT) { - HDassert(!storage->list[i].sub_dset[j].dset); + assert(!storage->list[i].sub_dset[j].dset); if (H5D__virtual_open_source_dset(dset, &storage->list[i], &storage->list[i].sub_dset[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open source dataset") @@ -2509,7 +2509,7 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag vbounds_end) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to get selection bounds") - HDassert(bounds_init); + assert(bounds_init); /* Convert bounds to extent (add 1) */ for (k = 0; k < (size_t)rank; k++) @@ -2646,8 +2646,8 @@ H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storag * H5Dget_space(). Do not attempt to open it as this might * affect the extent and we are not going to recalculate it * here. */ - HDassert(storage->list[i].unlim_dim_virtual >= 0); - HDassert(!storage->list[i].source_dset.dset); + assert(storage->list[i].unlim_dim_virtual >= 0); + assert(!storage->list[i].source_dset.dset); } /* end else */ } /* end else */ } /* end for */ @@ -2677,7 +2677,7 @@ H5D__virtual_post_io(H5O_storage_virtual_t *storage) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(storage); + assert(storage); /* Iterate over mappings */ for (i = 0; i < storage->list_nused; i++) @@ -2726,14 +2726,14 @@ H5D__virtual_read_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdset FUNC_ENTER_PACKAGE - HDassert(source_dset); + assert(source_dset); /* Only perform I/O if there is a projected memory space, otherwise there * were no elements in the projection or the source dataset could not be * opened */ if (source_dset->projected_mem_space) { - HDassert(source_dset->dset); - HDassert(source_dset->clipped_source_select); + assert(source_dset->dset); + assert(source_dset->clipped_source_select); /* Project intersection of file space and mapping virtual space onto * mapping source space */ @@ -2765,7 +2765,7 @@ H5D__virtual_read_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdset done: /* Release allocated resources */ if (projected_src_space) { - HDassert(ret_value < 0); + assert(ret_value < 0); if (H5S_close(projected_src_space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected source space") } /* end if */ @@ -2798,14 +2798,14 @@ H5D__virtual_read(H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, H5D_dset_io_info FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->buf.vp); - HDassert(dset_info->mem_space); - HDassert(dset_info->file_space); + assert(io_info); + assert(dset_info); + assert(dset_info->buf.vp); + assert(dset_info->mem_space); + assert(dset_info->file_space); storage = &(dset_info->dset->shared->layout.storage.u.virt); - HDassert((storage->view == H5D_VDS_FIRST_MISSING) || (storage->view == H5D_VDS_LAST_AVAILABLE)); + assert((storage->view == H5D_VDS_FIRST_MISSING) || (storage->view == H5D_VDS_LAST_AVAILABLE)); /* Initialize nelmts */ nelmts = H5S_GET_SELECT_NPOINTS(dset_info->file_space); @@ -2823,7 +2823,7 @@ H5D__virtual_read(H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, H5D_dset_io_info /* Iterate over mappings */ for (i = 0; i < storage->list_nused; i++) { /* Sanity check that the virtual space has been patched by now */ - HDassert(storage->list[i].virtual_space_status == H5O_VIRTUAL_STATUS_CORRECT); + assert(storage->list[i].virtual_space_status == H5O_VIRTUAL_STATUS_CORRECT); /* Check for "printf" source dataset resolution */ if (storage->list[i].psfn_nsubs || storage->list[i].psdn_nsubs) { @@ -2887,7 +2887,7 @@ H5D__virtual_read(H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, H5D_dset_io_info /* Verify number of elements is correct. Note that since we * don't check for overlap we can't assert that these are equal */ - HDassert((tot_nelmts + (hsize_t)select_nelmts) >= nelmts); + assert((tot_nelmts + (hsize_t)select_nelmts) >= nelmts); } /* end block */ #endif /* NDEBUG */ } /* end if */ @@ -2927,13 +2927,13 @@ H5D__virtual_write_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdse FUNC_ENTER_PACKAGE - HDassert(source_dset); + assert(source_dset); /* Only perform I/O if there is a projected memory space, otherwise there * were no elements in the projection */ if (source_dset->projected_mem_space) { - HDassert(source_dset->dset); - HDassert(source_dset->clipped_source_select); + assert(source_dset->dset); + assert(source_dset->clipped_source_select); /* In the future we may wish to extent this implementation to extend * source datasets if a write to a virtual dataset goes past the current @@ -2968,7 +2968,7 @@ H5D__virtual_write_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdse done: /* Release allocated resources */ if (projected_src_space) { - HDassert(ret_value < 0); + assert(ret_value < 0); if (H5S_close(projected_src_space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "can't close projected source space") } /* end if */ @@ -3000,14 +3000,14 @@ H5D__virtual_write(H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, H5D_dset_io_inf FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(io_info); - HDassert(dset_info); - HDassert(dset_info->buf.cvp); - HDassert(dset_info->mem_space); - HDassert(dset_info->file_space); + assert(io_info); + assert(dset_info); + assert(dset_info->buf.cvp); + assert(dset_info->mem_space); + assert(dset_info->file_space); storage = &(dset_info->dset->shared->layout.storage.u.virt); - HDassert((storage->view == H5D_VDS_FIRST_MISSING) || (storage->view == H5D_VDS_LAST_AVAILABLE)); + assert((storage->view == H5D_VDS_FIRST_MISSING) || (storage->view == H5D_VDS_LAST_AVAILABLE)); /* Initialize nelmts */ nelmts = H5S_GET_SELECT_NPOINTS(dset_info->file_space); @@ -3031,7 +3031,7 @@ H5D__virtual_write(H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, H5D_dset_io_inf /* Iterate over mappings */ for (i = 0; i < storage->list_nused; i++) { /* Sanity check that virtual space has been patched by now */ - HDassert(storage->list[i].virtual_space_status == H5O_VIRTUAL_STATUS_CORRECT); + assert(storage->list[i].virtual_space_status == H5O_VIRTUAL_STATUS_CORRECT); /* Check for "printf" source dataset resolution */ if (storage->list[i].psfn_nsubs || storage->list[i].psdn_nsubs) { @@ -3076,7 +3076,7 @@ H5D__virtual_flush(H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); + assert(dset); storage = &dset->shared->layout.storage.u.virt; @@ -3123,8 +3123,8 @@ H5D__virtual_hold_source_dset_files(const H5D_t *dset, H5D_virtual_held_file_t * FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); - HDassert(head && NULL == *head); + assert(dset); + assert(head && NULL == *head); /* Set the convenience pointer */ storage = &dset->shared->layout.storage.u.virt; @@ -3196,7 +3196,7 @@ H5D__virtual_refresh_source_dset(H5D_t **dset) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset && *dset); + assert(dset && *dset); /* Get a temporary identifier for this source dataset */ if ((temp_id = H5VL_wrap_register(H5I_DATASET, *dset, FALSE)) < 0) @@ -3242,7 +3242,7 @@ H5D__virtual_refresh_source_dsets(H5D_t *dset) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dset); + assert(dset); /* Set convenience pointer */ storage = &dset->shared->layout.storage.u.virt; diff --git a/src/H5E.c b/src/H5E.c index c2a65ed..ca7da2c 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -169,7 +169,7 @@ H5E_init(void) #endif /* H5_HAVE_THREADSAFE */ /* Allocate the HDF5 error class */ - HDassert(H5E_ERR_CLS_g == (-1)); + assert(H5E_ERR_CLS_g == (-1)); HDsnprintf(lib_vers, sizeof(lib_vers), "%u.%u.%u%s", H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE, (HDstrlen(H5_VERS_SUBRELEASE) > 0 ? "-" H5_VERS_SUBRELEASE : "")); if (NULL == (cls = H5E__register_class(H5E_CLS_NAME, H5E_CLS_LIB_NAME, lib_vers))) @@ -338,7 +338,7 @@ H5E__get_stack(void) */ estack = (H5E_t *)HDmalloc(sizeof(H5E_t)); #endif /* H5_HAVE_WIN_THREADS */ - HDassert(estack); + assert(estack); /* Set the thread-specific info */ estack->nused = 0; @@ -374,7 +374,7 @@ H5E__free_class(H5E_cls_t *cls) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(cls); + assert(cls); /* Free error class structure */ cls->cls_name = (char *)H5MM_xfree((void *)cls->cls_name); @@ -445,9 +445,9 @@ H5E__register_class(const char *cls_name, const char *lib_name, const char *vers FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(cls_name); - HDassert(lib_name); - HDassert(version); + assert(cls_name); + assert(lib_name); + assert(version); /* Allocate space for new error class */ if (NULL == (cls = H5FL_CALLOC(H5E_cls_t))) @@ -527,7 +527,7 @@ H5E__unregister_class(H5E_cls_t *cls, void H5_ATTR_UNUSED **request) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(cls); + assert(cls); /* Iterate over all the messages and delete those in this error class */ if (H5I_iterate(H5I_ERROR_MSG, H5E__close_msg_cb, cls, FALSE) < 0) @@ -596,7 +596,7 @@ H5E__get_class_name(const H5E_cls_t *cls, char *name, size_t size) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(cls); + assert(cls); /* Get the class's name */ len = (ssize_t)HDstrlen(cls->cls_name); @@ -636,7 +636,7 @@ H5E__close_msg_cb(void *obj_ptr, hid_t obj_id, void *udata) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(err_msg); + assert(err_msg); /* Close the message if it is in the class being closed */ if (err_msg->cls == cls) { @@ -700,7 +700,7 @@ H5E__close_msg(H5E_msg_t *err, void H5_ATTR_UNUSED **request) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(err); + assert(err); /* Release message */ err->msg = (char *)H5MM_xfree((void *)err->msg); @@ -777,9 +777,9 @@ H5E__create_msg(H5E_cls_t *cls, H5E_type_t msg_type, const char *msg_str) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(cls); - HDassert(msg_type == H5E_MAJOR || msg_type == H5E_MINOR); - HDassert(msg_str); + assert(cls); + assert(msg_type == H5E_MAJOR || msg_type == H5E_MINOR); + assert(msg_str); /* Allocate new message object */ if (NULL == (msg = H5FL_MALLOC(H5E_msg_t))) @@ -1052,7 +1052,7 @@ H5E__set_current_stack(H5E_t *estack) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(estack); + assert(estack); /* Get a pointer to the current error stack */ if (NULL == (current_stack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' @@ -1150,7 +1150,7 @@ H5E__close_stack(H5E_t *estack, void H5_ATTR_UNUSED **request) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(estack); + assert(estack); /* Release the stack's error information */ H5E_clear_stack(estack); @@ -1225,7 +1225,7 @@ H5E__get_num(const H5E_t *estack) { FUNC_ENTER_PACKAGE_NOERR - HDassert(estack); + assert(estack); FUNC_LEAVE_NOAPI((ssize_t)estack->nused) } /* end H5E__get_num() */ @@ -1757,8 +1757,8 @@ H5E__append_stack(H5E_t *dst_stack, const H5E_t *src_stack) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dst_stack); - HDassert(src_stack); + assert(dst_stack); + assert(src_stack); /* Copy the errors from the source stack to the destination stack */ for (u = 0; u < src_stack->nused; u++) { diff --git a/src/H5EA.c b/src/H5EA.c index d29f9ce..5990353 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -122,8 +122,8 @@ H5EA__new(H5F_t *f, haddr_t ea_addr, hbool_t from_open, void *ctx_udata) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(ea_addr)); + assert(f); + assert(H5_addr_defined(ea_addr)); /* Allocate extensible array wrapper */ if (NULL == (ea = H5FL_CALLOC(H5EA_t))) @@ -187,8 +187,8 @@ H5EA_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata) FUNC_ENTER_NOAPI(NULL) /* Check arguments */ - HDassert(f); - HDassert(cparam); + assert(f); + assert(cparam); /* H5EA interface sanity check */ HDcompile_assert(H5EA_NUM_CLS_ID == NELMTS(H5EA_client_class_g)); @@ -235,8 +235,8 @@ H5EA_open(H5F_t *f, haddr_t ea_addr, void *ctx_udata) FUNC_ENTER_NOAPI(NULL) /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(ea_addr)); + assert(f); + assert(H5_addr_defined(ea_addr)); /* Allocate and initialize new extensible array wrapper */ if (NULL == (ea = H5EA__new(f, ea_addr, TRUE, ctx_udata))) @@ -272,8 +272,8 @@ H5EA_get_nelmts(const H5EA_t *ea, hsize_t *nelmts) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(ea); - HDassert(nelmts); + assert(ea); + assert(nelmts); /* Retrieve the max. index set */ *nelmts = ea->hdr->stats.stored.max_idx_set; @@ -299,9 +299,9 @@ H5EA_get_addr(const H5EA_t *ea, haddr_t *addr) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(ea); - HDassert(ea->hdr); - HDassert(addr); + assert(ea); + assert(ea->hdr); + assert(addr); /* Retrieve the address of the extensible array's header */ *addr = ea->hdr->addr; @@ -341,14 +341,14 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(ea); - HDassert(hdr); - HDassert(thing); - HDassert(thing_elmt_buf); - HDassert(thing_unprot_func); + assert(ea); + assert(hdr); + assert(thing); + assert(thing_elmt_buf); + assert(thing_unprot_func); /* only the H5AC__READ_ONLY_FLAG may be set in thing_acc */ - HDassert((thing_acc & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((thing_acc & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set the shared array header's file context for this operation */ hdr->f = ea->f; @@ -403,7 +403,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t /* Compute the data block index in index block */ dblk_idx = (size_t)(hdr->sblk_info[sblk_idx].start_dblk + (elmt_idx / hdr->sblk_info[sblk_idx].dblk_nelmts)); - HDassert(dblk_idx < iblock->ndblk_addrs); + assert(dblk_idx < iblock->ndblk_addrs); /* Check if the data block has been allocated on disk yet */ if (!H5_addr_defined(iblock->dblk_addrs[dblk_idx])) { @@ -490,7 +490,7 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t /* Compute the data block index in super block */ dblk_idx = (size_t)(elmt_idx / sblock->dblk_nelmts); - HDassert(dblk_idx < sblock->ndblks); + assert(dblk_idx < sblock->ndblks); /* Check if the data block has been allocated on disk yet */ if (!H5_addr_defined(sblock->dblk_addrs[dblk_idx])) { @@ -616,8 +616,8 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t } /* end else */ /* Sanity checks */ - HDassert(*thing != NULL); - HDassert(*thing_unprot_func != NULL); + assert(*thing != NULL); + assert(*thing_unprot_func != NULL); done: /* Reset 'thing' info on error */ @@ -679,8 +679,8 @@ H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(ea); - HDassert(hdr); + assert(ea); + assert(hdr); /* Set the shared array header's file context for this operation */ hdr->f = ea->f; @@ -692,9 +692,9 @@ H5EA_set(const H5EA_t *ea, hsize_t idx, const void *elmt) HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL, "unable to protect array metadata") /* Sanity check */ - HDassert(thing); - HDassert(thing_elmt_buf); - HDassert(thing_unprot_func); + assert(thing); + assert(thing_elmt_buf); + assert(thing_unprot_func); /* Set element in thing's element buffer */ H5MM_memcpy(thing_elmt_buf + (hdr->cparam.cls->nat_elmt_size * thing_elmt_idx), elmt, @@ -742,8 +742,8 @@ H5EA_get(const H5EA_t *ea, hsize_t idx, void *elmt) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(ea); - HDassert(hdr); + assert(ea); + assert(hdr); /* Check for element beyond max. element in array */ if (idx >= hdr->stats.stored.max_idx_set) { @@ -805,9 +805,9 @@ H5EA_depend(H5EA_t *ea, H5AC_proxy_entry_t *parent) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(ea); - HDassert(hdr); - HDassert(parent); + assert(ea); + assert(hdr); + assert(parent); /* * Check to see if a flush dependency between the extensible array @@ -816,7 +816,7 @@ H5EA_depend(H5EA_t *ea, H5AC_proxy_entry_t *parent) */ if (NULL == hdr->parent) { /* Sanity check */ - HDassert(hdr->top_proxy); + assert(hdr->top_proxy); /* Set the shared array header's file context for this operation */ hdr->f = ea->f; @@ -853,7 +853,7 @@ H5EA_close(H5EA_t *ea) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(ea); + assert(ea); /* Close the header, if it was set */ if (ea->hdr) { @@ -889,9 +889,9 @@ H5EA_close(H5EA_t *ea) "unable to check metadata cache status for extensible array header") /* Sanity checks on header */ - HDassert(hdr_status & H5AC_ES__IN_CACHE); - HDassert(hdr_status & H5AC_ES__IS_PINNED); - HDassert(!(hdr_status & H5AC_ES__IS_PROTECTED)); + assert(hdr_status & H5AC_ES__IN_CACHE); + assert(hdr_status & H5AC_ES__IS_PINNED); + assert(!(hdr_status & H5AC_ES__IS_PROTECTED)); } #endif /* NDEBUG */ @@ -954,8 +954,8 @@ H5EA_delete(H5F_t *f, haddr_t ea_addr, void *ctx_udata) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(ea_addr)); + assert(f); + assert(H5_addr_defined(ea_addr)); /* Lock the array header into memory */ if (NULL == (hdr = H5EA__hdr_protect(f, ea_addr, ctx_udata, H5AC__NO_FLAGS_SET))) @@ -1005,9 +1005,9 @@ H5EA_iterate(H5EA_t *ea, H5EA_operator_t op, void *udata) FUNC_ENTER_NOAPI(H5_ITER_ERROR) /* Check arguments */ - HDassert(ea); - HDassert(op); - HDassert(udata); + assert(ea); + assert(op); + assert(udata); /* Allocate space for a native array element */ if (NULL == (elmt = H5FL_BLK_MALLOC(ea_native_elmt, ea->hdr->cparam.cls->nat_elmt_size))) @@ -1052,8 +1052,8 @@ H5EA_patch_file(H5EA_t *ea, H5F_t *f) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(ea); - HDassert(f); + assert(ea); + assert(f); if (ea->f != f || ea->hdr->f != f) ea->f = ea->hdr->f = f; diff --git a/src/H5EAcache.c b/src/H5EAcache.c index b006ecb..d126e7c 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -228,9 +228,9 @@ H5EA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->f); - HDassert(image_len); + assert(udata); + assert(udata->f); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5EA_HEADER_SIZE_FILE(udata->f); @@ -262,7 +262,7 @@ H5EA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -299,10 +299,10 @@ H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_ FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(udata); - HDassert(udata->f); - HDassert(H5_addr_defined(udata->addr)); + assert(image); + assert(udata); + assert(udata->f); + assert(H5_addr_defined(udata->addr)); /* Allocate space for the extensible array data structure */ if (NULL == (hdr = H5EA__hdr_alloc(udata->f))) @@ -373,7 +373,7 @@ H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_ /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* checksum verification already done in verify_chksum cb */ @@ -381,12 +381,12 @@ H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_ UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == len); + assert((size_t)(image - (const uint8_t *)_image) == len); /* Finish initializing extensible array header */ if (H5EA__hdr_init(hdr, udata->ctx_udata) < 0) HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL, "initialization failed for extensible array header") - HDassert(hdr->size == len); + assert(hdr->size == len); /* Set return value */ ret_value = hdr; @@ -420,8 +420,8 @@ H5EA__cache_hdr_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(hdr); - HDassert(image_len); + assert(hdr); + assert(image_len); /* Set the image length size */ *image_len = hdr->size; @@ -451,9 +451,9 @@ H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le FUNC_ENTER_PACKAGE_NOERR /* check arguments */ - HDassert(f); - HDassert(image); - HDassert(hdr); + assert(f); + assert(image); + assert(hdr); /* Magic number */ H5MM_memcpy(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -463,7 +463,7 @@ H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le *image++ = H5EA_HDR_VERSION; /* Extensible array type */ - HDassert(hdr->cparam.cls->id <= 255); + assert(hdr->cparam.cls->id <= 255); *image++ = (uint8_t)hdr->cparam.cls->id; /* General array creation/configuration information */ @@ -495,7 +495,7 @@ H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5EA__cache_hdr_serialize() */ @@ -521,7 +521,7 @@ H5EA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Check if the file was opened with SWMR-write access */ if (hdr->swmr_write) { @@ -545,7 +545,7 @@ H5EA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) */ if (hdr->parent) { /* Sanity check */ - HDassert(hdr->top_proxy); + assert(hdr->top_proxy); /* Destroy flush dependency on object header proxy */ if (H5AC_proxy_entry_remove_child((H5AC_proxy_entry_t *)hdr->parent, @@ -569,12 +569,12 @@ H5EA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ } /* end if */ else - HDassert(NULL == hdr->parent); + assert(NULL == hdr->parent); done: FUNC_LEAVE_NOAPI(ret_value) @@ -601,7 +601,7 @@ H5EA__cache_hdr_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Release the extensible array header */ if (H5EA__hdr_dest((H5EA_hdr_t *)thing) < 0) @@ -632,8 +632,8 @@ H5EA__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(hdr); - HDassert(image_len); + assert(hdr); + assert(image_len); /* Set up fake index block for computing size on disk */ HDmemset(&iblock, 0, sizeof(iblock)); @@ -672,7 +672,7 @@ H5EA__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -710,8 +710,8 @@ H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, hbo FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(hdr); + assert(image); + assert(hdr); /* Allocate the extensible array index block */ if (NULL == (iblock = H5EA__iblock_alloc(hdr))) @@ -766,7 +766,7 @@ H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, hbo /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* Save the index block's size */ iblock->size = len; @@ -777,7 +777,7 @@ H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, hbo UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == iblock->size); + assert((size_t)(image - (const uint8_t *)_image) == iblock->size); /* Set return value */ ret_value = iblock; @@ -811,8 +811,8 @@ H5EA__cache_iblock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(iblock); - HDassert(image_len); + assert(iblock); + assert(image_len); /* Set the image length size */ *image_len = iblock->size; @@ -843,10 +843,10 @@ H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f); - HDassert(image); - HDassert(iblock); - HDassert(iblock->hdr); + assert(f); + assert(image); + assert(iblock); + assert(iblock->hdr); /* Get temporary pointer to serialized info */ @@ -858,7 +858,7 @@ H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5EA_IBLOCK_VERSION; /* Extensible array type */ - HDassert(iblock->hdr->cparam.cls->id <= 255); + assert(iblock->hdr->cparam.cls->id <= 255); *image++ = (uint8_t)iblock->hdr->cparam.cls->id; /* Address of array header for array which owns this block */ @@ -900,7 +900,7 @@ H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -927,7 +927,7 @@ H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(iblock); + assert(iblock); /* Determine which action to take */ switch (action) { @@ -973,7 +973,7 @@ H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ @@ -1002,7 +1002,7 @@ H5EA__cache_iblock_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Release the extensible array index block */ if (H5EA__iblock_dest((H5EA_iblock_t *)thing) < 0) @@ -1033,11 +1033,11 @@ H5EA__cache_sblock_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(udata->sblk_idx > 0); - HDassert(H5_addr_defined(udata->sblk_addr)); - HDassert(image_len); + assert(udata); + assert(udata->hdr); + assert(udata->sblk_idx > 0); + assert(H5_addr_defined(udata->sblk_addr)); + assert(image_len); /* Set up fake super block for computing size on disk */ /* (Note: extracted from H5EA__sblock_alloc) */ @@ -1052,14 +1052,14 @@ H5EA__cache_sblock_get_initial_load_size(void *_udata, size_t *image_len) sblock.dblk_npages = sblock.dblk_nelmts / udata->hdr->dblk_page_nelmts; /* Sanity check that we have at least 2 pages in data block */ - HDassert(sblock.dblk_npages > 1); + assert(sblock.dblk_npages > 1); /* Sanity check for integer truncation */ - HDassert((sblock.dblk_npages * udata->hdr->dblk_page_nelmts) == sblock.dblk_nelmts); + assert((sblock.dblk_npages * udata->hdr->dblk_page_nelmts) == sblock.dblk_nelmts); /* Compute size of buffer for each data block's 'page init' bitmask */ sblock.dblk_page_init_size = ((sblock.dblk_npages) + 7) / 8; - HDassert(sblock.dblk_page_init_size > 0); + assert(sblock.dblk_page_init_size > 0); } /* end if */ /* Set the image length size */ @@ -1092,7 +1092,7 @@ H5EA__cache_sblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -1130,11 +1130,11 @@ H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata, hbo FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(udata->parent); - HDassert(udata->sblk_idx > 0); - HDassert(H5_addr_defined(udata->sblk_addr)); + assert(udata); + assert(udata->hdr); + assert(udata->parent); + assert(udata->sblk_idx > 0); + assert(H5_addr_defined(udata->sblk_addr)); /* Allocate the extensible array super block */ if (NULL == (sblock = H5EA__sblock_alloc(udata->hdr, udata->parent, udata->sblk_idx))) @@ -1183,7 +1183,7 @@ H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata, hbo /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* Save the super block's size */ sblock->size = len; @@ -1194,7 +1194,7 @@ H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata, hbo UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == sblock->size); + assert((size_t)(image - (const uint8_t *)_image) == sblock->size); /* Set return value */ ret_value = sblock; @@ -1228,8 +1228,8 @@ H5EA__cache_sblock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(sblock); - HDassert(image_len); + assert(sblock); + assert(image_len); /* Set the image length size */ *image_len = sblock->size; @@ -1260,10 +1260,10 @@ H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED FUNC_ENTER_PACKAGE_NOERR /* check arguments */ - HDassert(f); - HDassert(image); - HDassert(sblock); - HDassert(sblock->hdr); + assert(f); + assert(image); + assert(sblock); + assert(sblock->hdr); /* Magic number */ H5MM_memcpy(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -1273,7 +1273,7 @@ H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5EA_SBLOCK_VERSION; /* Extensible array type */ - HDassert(sblock->hdr->cparam.cls->id <= 255); + assert(sblock->hdr->cparam.cls->id <= 255); *image++ = (uint8_t)sblock->hdr->cparam.cls->id; /* Address of array header for array which owns this block */ @@ -1305,7 +1305,7 @@ H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5EA__cache_sblock_serialize() */ @@ -1331,7 +1331,7 @@ H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(sblock); + assert(sblock); /* Determine which action to take */ switch (action) { @@ -1398,7 +1398,7 @@ H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ @@ -1427,7 +1427,7 @@ H5EA__cache_sblock_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Release the extensible array super block */ if (H5EA__sblock_dest((H5EA_sblock_t *)thing) < 0) @@ -1458,10 +1458,10 @@ H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(udata->nelmts > 0); - HDassert(image_len); + assert(udata); + assert(udata->hdr); + assert(udata->nelmts > 0); + assert(image_len); /* Set up fake data block for computing size on disk */ /* (Note: extracted from H5EA__dblock_alloc) */ @@ -1482,7 +1482,7 @@ H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) if (udata->nelmts > udata->hdr->dblk_page_nelmts) { /* Set the # of pages in the direct block */ dblock.npages = udata->nelmts / udata->hdr->dblk_page_nelmts; - HDassert(udata->nelmts == (dblock.npages * udata->hdr->dblk_page_nelmts)); + assert(udata->nelmts == (dblock.npages * udata->hdr->dblk_page_nelmts)); } /* end if */ /* Set the image length size */ @@ -1518,7 +1518,7 @@ H5EA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -1556,19 +1556,19 @@ H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(udata->parent); - HDassert(udata->nelmts > 0); - HDassert(H5_addr_defined(udata->dblk_addr)); + assert(udata); + assert(udata->hdr); + assert(udata->parent); + assert(udata->nelmts > 0); + assert(H5_addr_defined(udata->dblk_addr)); /* Allocate the extensible array data block */ if (NULL == (dblock = H5EA__dblock_alloc(udata->hdr, udata->parent, udata->nelmts))) HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for extensible array data block") - HDassert(((!dblock->npages) && (len == H5EA_DBLOCK_SIZE(dblock))) || - (len == H5EA_DBLOCK_PREFIX_SIZE(dblock))); + assert(((!dblock->npages) && (len == H5EA_DBLOCK_SIZE(dblock))) || + (len == H5EA_DBLOCK_PREFIX_SIZE(dblock))); /* Set the extensible array data block's information */ dblock->addr = udata->dblk_addr; @@ -1607,7 +1607,7 @@ H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* Set the data block's size */ /* (Note: This is not the same as the image length, for paged data blocks) */ @@ -1619,7 +1619,7 @@ H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == len); + assert((size_t)(image - (const uint8_t *)_image) == len); /* Set return value */ ret_value = dblock; @@ -1654,8 +1654,8 @@ H5EA__cache_dblock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblock); - HDassert(image_len); + assert(dblock); + assert(image_len); /* Set the image length size */ if (!dblock->npages) @@ -1689,10 +1689,10 @@ H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f); - HDassert(image); - HDassert(dblock); - HDassert(dblock->hdr); + assert(f); + assert(image); + assert(dblock); + assert(dblock->hdr); /* Magic number */ H5MM_memcpy(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -1702,7 +1702,7 @@ H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5EA_DBLOCK_VERSION; /* Extensible array type */ - HDassert(dblock->hdr->cparam.cls->id <= 255); + assert(dblock->hdr->cparam.cls->id <= 255); *image++ = (uint8_t)dblock->hdr->cparam.cls->id; /* Address of array header for array which owns this block */ @@ -1730,7 +1730,7 @@ H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1757,7 +1757,7 @@ H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(dblock); + assert(dblock); /* Determine which action to take */ switch (action) { @@ -1823,7 +1823,7 @@ H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ @@ -1852,7 +1852,7 @@ H5EA__cache_dblock_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Release the extensible array data block */ if (H5EA__dblock_dest((H5EA_dblock_t *)thing) < 0) @@ -1899,9 +1899,9 @@ H5EA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblock); - HDassert(dblock->cache_info.type == H5AC_EARRAY_DBLOCK); - HDassert(fsf_size); + assert(dblock); + assert(dblock->cache_info.type == H5AC_EARRAY_DBLOCK); + assert(fsf_size); *fsf_size = dblock->size; @@ -1928,9 +1928,9 @@ H5EA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(image_len); + assert(udata); + assert(udata->hdr); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5EA_DBLK_PAGE_SIZE(udata->hdr); @@ -1962,7 +1962,7 @@ H5EA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -1999,10 +1999,10 @@ H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(udata->parent); - HDassert(H5_addr_defined(udata->dblk_page_addr)); + assert(udata); + assert(udata->hdr); + assert(udata->parent); + assert(H5_addr_defined(udata->dblk_page_addr)); /* Allocate the extensible array data block page */ if (NULL == (dblk_page = H5EA__dblk_page_alloc(udata->hdr, udata->parent))) @@ -2023,7 +2023,7 @@ H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5EA_SIZEOF_CHKSUM)); /* Set the data block page's size */ dblk_page->size = len; @@ -2034,7 +2034,7 @@ H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == dblk_page->size); + assert((size_t)(image - (const uint8_t *)_image) == dblk_page->size); /* Set return value */ ret_value = dblk_page; @@ -2067,8 +2067,8 @@ H5EA__cache_dblk_page_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblk_page); - HDassert(image_len); + assert(dblk_page); + assert(image_len); /* Set the image length size */ *image_len = dblk_page->size; @@ -2100,10 +2100,10 @@ H5EA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_ima FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(dblk_page); - HDassert(dblk_page->hdr); + assert(f); + assert(image); + assert(dblk_page); + assert(dblk_page->hdr); /* Internal information */ @@ -2122,7 +2122,7 @@ H5EA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_ima UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2149,7 +2149,7 @@ H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblk_page); + assert(dblk_page); /* Determine which action to take */ switch (action) { @@ -2216,7 +2216,7 @@ H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ @@ -2245,7 +2245,7 @@ H5EA__cache_dblk_page_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Release the extensible array data block page */ if (H5EA__dblk_page_dest((H5EA_dblk_page_t *)thing) < 0) diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index 1a7b61a..218558e 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -90,13 +90,13 @@ H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, co FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(H5_addr_defined(obj_addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(cls); + assert(f); + assert(H5_addr_defined(addr)); + assert(H5_addr_defined(obj_addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(cls); /* Check for debugging context callback available */ if (cls->crt_dbg_ctx) @@ -173,14 +173,14 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(cls); - HDassert(H5_addr_defined(hdr_addr)); - HDassert(H5_addr_defined(obj_addr)); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(cls); + assert(H5_addr_defined(hdr_addr)); + assert(H5_addr_defined(obj_addr)); /* Check for debugging context callback available */ if (cls->crt_dbg_ctx) @@ -193,7 +193,7 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde HGOTO_ERROR(H5E_EARRAY, H5E_CANTPROTECT, FAIL, "unable to load extensible array header") /* Sanity check */ - HDassert(H5_addr_eq(hdr->idx_blk_addr, addr)); + assert(H5_addr_eq(hdr->idx_blk_addr, addr)); /* Protect index block */ if (NULL == (iblock = H5EA__iblock_protect(hdr, H5AC__READ_ONLY_FLAG))) @@ -293,14 +293,14 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(cls); - HDassert(H5_addr_defined(hdr_addr)); - HDassert(H5_addr_defined(obj_addr)); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(cls); + assert(H5_addr_defined(hdr_addr)); + assert(H5_addr_defined(obj_addr)); /* Check for debugging context callback available */ if (cls->crt_dbg_ctx) @@ -383,15 +383,15 @@ H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(cls); - HDassert(H5_addr_defined(hdr_addr)); - HDassert(H5_addr_defined(obj_addr)); - HDassert(dblk_nelmts > 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(cls); + assert(H5_addr_defined(hdr_addr)); + assert(H5_addr_defined(obj_addr)); + assert(dblk_nelmts > 0); /* Check for debugging context callback available */ if (cls->crt_dbg_ctx) diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index 0f1a847..4d73e7c 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -92,7 +92,7 @@ H5EA__dblk_page_alloc(H5EA_hdr_t *hdr, H5EA_sblock_t *parent) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); + assert(hdr); /* Allocate memory for the data block */ if (NULL == (dblk_page = H5FL_CALLOC(H5EA_dblk_page_t))) @@ -145,7 +145,7 @@ H5EA__dblk_page_create(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t addr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Allocate the data block page */ if (NULL == (dblk_page = H5EA__dblk_page_alloc(hdr, parent))) @@ -215,11 +215,11 @@ H5EA__dblk_page_protect(H5EA_hdr_t *hdr, H5EA_sblock_t *parent, haddr_t dblk_pag FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(H5_addr_defined(dblk_page_addr)); + assert(hdr); + assert(H5_addr_defined(dblk_page_addr)); /* only the H5AC__READ_ONLY_FLAG may be set */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data */ udata.hdr = hdr; @@ -279,7 +279,7 @@ H5EA__dblk_page_unprotect(H5EA_dblk_page_t *dblk_page, unsigned cache_flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblk_page); + assert(dblk_page); /* Unprotect the data block page */ if (H5AC_unprotect(dblk_page->hdr->f, H5AC_EARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) @@ -311,8 +311,8 @@ H5EA__dblk_page_dest(H5EA_dblk_page_t *dblk_page) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblk_page); - HDassert(!dblk_page->has_hdr_depend); + assert(dblk_page); + assert(!dblk_page->has_hdr_depend); /* Check if header field has been initialized */ if (dblk_page->hdr) { @@ -333,7 +333,7 @@ H5EA__dblk_page_dest(H5EA_dblk_page_t *dblk_page) } /* end if */ /* Sanity check */ - HDassert(NULL == dblk_page->top_proxy); + assert(NULL == dblk_page->top_proxy); /* Free the data block page itself */ dblk_page = H5FL_FREE(H5EA_dblk_page_t, dblk_page); diff --git a/src/H5EAdblock.c b/src/H5EAdblock.c index 608b179..a672dbc 100644 --- a/src/H5EAdblock.c +++ b/src/H5EAdblock.c @@ -93,9 +93,9 @@ H5EA__dblock_alloc(H5EA_hdr_t *hdr, void *parent, size_t nelmts) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); - HDassert(parent); - HDassert(nelmts > 0); + assert(hdr); + assert(parent); + assert(nelmts > 0); /* Allocate memory for the data block */ if (NULL == (dblock = H5FL_CALLOC(H5EA_dblock_t))) @@ -115,7 +115,7 @@ H5EA__dblock_alloc(H5EA_hdr_t *hdr, void *parent, size_t nelmts) if (nelmts > hdr->dblk_page_nelmts) { /* Set the # of pages in the direct block */ dblock->npages = nelmts / hdr->dblk_page_nelmts; - HDassert(nelmts == (dblock->npages * hdr->dblk_page_nelmts)); + assert(nelmts == (dblock->npages * hdr->dblk_page_nelmts)); } /* end if */ else { /* Allocate buffer for elements in data block */ @@ -158,9 +158,9 @@ H5EA__dblock_create(H5EA_hdr_t *hdr, void *parent, hbool_t *stats_changed, hsize FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(stats_changed); - HDassert(nelmts > 0); + assert(hdr); + assert(stats_changed); + assert(nelmts > 0); /* Allocate the data block */ if (NULL == (dblock = H5EA__dblock_alloc(hdr, parent, nelmts))) @@ -257,8 +257,8 @@ H5EA__dblock_sblk_idx(const H5EA_hdr_t *hdr, hsize_t idx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(hdr); - HDassert(idx >= hdr->cparam.idx_blk_elmts); + assert(hdr); + assert(idx >= hdr->cparam.idx_blk_elmts); /* Adjust index for elements in index block */ idx -= hdr->cparam.idx_blk_elmts; @@ -292,12 +292,12 @@ H5EA__dblock_protect(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, size_t db FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(H5_addr_defined(dblk_addr)); - HDassert(dblk_nelmts); + assert(hdr); + assert(H5_addr_defined(dblk_addr)); + assert(dblk_nelmts); /* only the H5AC__READ_ONLY_FLAG may be set */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data */ udata.hdr = hdr; @@ -359,7 +359,7 @@ H5EA__dblock_unprotect(H5EA_dblock_t *dblock, unsigned cache_flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblock); + assert(dblock); /* Unprotect the data block */ if (H5AC_unprotect(dblock->hdr->f, H5AC_EARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) @@ -393,10 +393,10 @@ H5EA__dblock_delete(H5EA_hdr_t *hdr, void *parent, haddr_t dblk_addr, size_t dbl FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(parent); - HDassert(H5_addr_defined(dblk_addr)); - HDassert(dblk_nelmts > 0); + assert(hdr); + assert(parent); + assert(H5_addr_defined(dblk_addr)); + assert(dblk_nelmts > 0); /* Protect data block */ if (NULL == (dblock = H5EA__dblock_protect(hdr, parent, dblk_addr, dblk_nelmts, H5AC__NO_FLAGS_SET))) @@ -457,15 +457,15 @@ H5EA__dblock_dest(H5EA_dblock_t *dblock) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblock); - HDassert(!dblock->has_hdr_depend); + assert(dblock); + assert(!dblock->has_hdr_depend); /* Check if shared header field has been initialized */ if (dblock->hdr) { /* Check if we've got elements in the data block */ if (dblock->elmts && !dblock->npages) { /* Free buffer for data block elements */ - HDassert(dblock->nelmts > 0); + assert(dblock->nelmts > 0); if (H5EA__hdr_free_elmts(dblock->hdr, dblock->nelmts, dblock->elmts) < 0) HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "unable to free extensible array data block element buffer") @@ -481,7 +481,7 @@ H5EA__dblock_dest(H5EA_dblock_t *dblock) } /* end if */ /* Sanity check */ - HDassert(NULL == dblock->top_proxy); + assert(NULL == dblock->top_proxy); /* Free the data block itself */ dblock = H5FL_FREE(H5EA_dblock_t, dblock); diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 3f7ceea..0675b08 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -110,7 +110,7 @@ H5EA__hdr_alloc(H5F_t *f) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); + assert(f); /* Allocate space for the shared information */ if (NULL == (hdr = H5FL_CALLOC(H5EA_hdr_t))) @@ -183,10 +183,10 @@ H5EA__hdr_init(H5EA_hdr_t *hdr, void *ctx_udata) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(hdr->cparam.max_nelmts_bits); - HDassert(hdr->cparam.data_blk_min_elmts); - HDassert(hdr->cparam.sup_blk_min_data_ptrs); + assert(hdr); + assert(hdr->cparam.max_nelmts_bits); + assert(hdr->cparam.data_blk_min_elmts); + assert(hdr->cparam.sup_blk_min_data_ptrs); /* Compute general information */ hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5VM_log2_of2(hdr->cparam.data_blk_min_elmts)); @@ -247,8 +247,8 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); - HDassert(nelmts > 0); + assert(hdr); + assert(nelmts > 0); /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/ size_t, /*To:*/ uint32_t); @@ -316,17 +316,17 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(hdr); - HDassert(nelmts > 0); - HDassert(elmts); + assert(hdr); + assert(nelmts > 0); + assert(elmts); /* Compute the index of the element buffer factory */ H5_CHECK_OVERFLOW(nelmts, /*From:*/ size_t, /*To:*/ uint32_t); idx = H5VM_log2_of2((uint32_t)nelmts) - H5VM_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts); /* Free buffer for elements in index block */ - HDassert(idx < hdr->elmt_fac.nalloc); - HDassert(hdr->elmt_fac.fac[idx]); + assert(idx < hdr->elmt_fac.nalloc); + assert(hdr->elmt_fac.fac[idx]); elmts = H5FL_FAC_FREE(hdr->elmt_fac.fac[idx], elmts); FUNC_LEAVE_NOAPI(SUCCEED) @@ -355,8 +355,8 @@ H5EA__hdr_create(H5F_t *f, const H5EA_create_t *cparam, void *ctx_udata) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(cparam); + assert(f); + assert(cparam); #ifndef NDEBUG { @@ -484,7 +484,7 @@ H5EA__hdr_incr(H5EA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Mark header as un-evictable when something is depending on it */ if (hdr->rc == 0) @@ -518,15 +518,15 @@ H5EA__hdr_decr(H5EA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(hdr->rc); + assert(hdr); + assert(hdr->rc); /* Decrement reference count on shared header */ hdr->rc--; /* Mark header as evictable again when nothing depend on it */ if (hdr->rc == 0) { - HDassert(hdr->file_rc == 0); + assert(hdr->file_rc == 0); if (H5AC_unpin_entry(hdr) < 0) HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNPIN, FAIL, "unable to unpin extensible array header") } @@ -553,7 +553,7 @@ H5EA__hdr_fuse_incr(H5EA_hdr_t *hdr) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Increment file reference count on shared header */ hdr->file_rc++; @@ -582,8 +582,8 @@ H5EA__hdr_fuse_decr(H5EA_hdr_t *hdr) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(hdr); - HDassert(hdr->file_rc); + assert(hdr); + assert(hdr->file_rc); /* Decrement file reference count on shared header */ hdr->file_rc--; @@ -614,8 +614,8 @@ H5EA__hdr_modified(H5EA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(hdr->f); + assert(hdr); + assert(hdr->f); /* Mark header as dirty in cache */ if (H5AC_mark_entry_dirty(hdr) < 0) @@ -647,11 +647,11 @@ H5EA__hdr_protect(H5F_t *f, haddr_t ea_addr, void *ctx_udata, unsigned flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(H5_addr_defined(ea_addr)); + assert(f); + assert(H5_addr_defined(ea_addr)); /* only the H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data for cache callbacks */ udata.f = f; @@ -703,7 +703,7 @@ H5EA__hdr_unprotect(H5EA_hdr_t *hdr, unsigned cache_flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Unprotect the header */ if (H5AC_unprotect(hdr->f, H5AC_EARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) @@ -735,8 +735,8 @@ H5EA__hdr_delete(H5EA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(!hdr->file_rc); + assert(hdr); + assert(!hdr->file_rc); #ifndef NDEBUG unsigned hdr_status = 0; /* Array header's status in the metadata cache */ @@ -746,8 +746,8 @@ H5EA__hdr_delete(H5EA_hdr_t *hdr) HGOTO_ERROR(H5E_EARRAY, H5E_CANTGET, FAIL, "unable to check metadata cache status for array header") /* Sanity checks on array header */ - HDassert(hdr_status & H5AC_ES__IN_CACHE); - HDassert(hdr_status & H5AC_ES__IS_PROTECTED); + assert(hdr_status & H5AC_ES__IN_CACHE); + assert(hdr_status & H5AC_ES__IS_PROTECTED); #endif /* NDEBUG */ /* Check for index block */ @@ -789,8 +789,8 @@ H5EA__hdr_dest(H5EA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); - HDassert(hdr->rc == 0); + assert(hdr); + assert(hdr->rc == 0); /* Destroy the callback context */ if (hdr->cb_ctx) { @@ -805,7 +805,7 @@ H5EA__hdr_dest(H5EA_hdr_t *hdr) unsigned u; /* Local index variable */ /* Sanity check */ - HDassert(hdr->elmt_fac.nalloc > 0); + assert(hdr->elmt_fac.nalloc > 0); /* Iterate over factories, shutting them down */ for (u = 0; u < hdr->elmt_fac.nalloc; u++) { diff --git a/src/H5EAiblock.c b/src/H5EAiblock.c index 18e56f3..faa0a20 100644 --- a/src/H5EAiblock.c +++ b/src/H5EAiblock.c @@ -99,7 +99,7 @@ H5EA__iblock_alloc(H5EA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); + assert(hdr); /* Allocate memory for the index block */ if (NULL == (iblock = H5FL_CALLOC(H5EA_iblock_t))) @@ -172,8 +172,8 @@ H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(stats_changed); + assert(hdr); + assert(stats_changed); /* Allocate the index block */ if (NULL == (iblock = H5EA__iblock_alloc(hdr))) @@ -228,8 +228,8 @@ H5EA__iblock_create(H5EA_hdr_t *hdr, hbool_t *stats_changed) } /* end if */ /* Update extensible array index block statistics */ - HDassert(0 == hdr->stats.computed.nindex_blks); - HDassert(0 == hdr->stats.computed.index_blk_size); + assert(0 == hdr->stats.computed.nindex_blks); + assert(0 == hdr->stats.computed.index_blk_size); hdr->stats.computed.nindex_blks = 1; hdr->stats.computed.index_blk_size = iblock->size; @@ -287,10 +287,10 @@ H5EA__iblock_protect(H5EA_hdr_t *hdr, unsigned flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* only the H5AC__READ_ONLY_FLAG may be set */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Protect the index block */ if (NULL == @@ -345,7 +345,7 @@ H5EA__iblock_unprotect(H5EA_iblock_t *iblock, unsigned cache_flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(iblock); + assert(iblock); /* Unprotect the index block */ if (H5AC_unprotect(iblock->hdr->f, H5AC_EARRAY_IBLOCK, iblock->addr, iblock, cache_flags) < 0) @@ -378,8 +378,8 @@ H5EA__iblock_delete(H5EA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(H5_addr_defined(hdr->idx_blk_addr)); + assert(hdr); + assert(H5_addr_defined(hdr->idx_blk_addr)); /* Protect index block */ if (NULL == (iblock = H5EA__iblock_protect(hdr, H5AC__NO_FLAGS_SET))) @@ -464,21 +464,21 @@ H5EA__iblock_dest(H5EA_iblock_t *iblock) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(iblock); + assert(iblock); /* Check if shared header field has been initialized */ if (iblock->hdr) { /* Check if we've got elements in the index block */ if (iblock->elmts) { /* Free buffer for index block elements */ - HDassert(iblock->hdr->cparam.idx_blk_elmts > 0); + assert(iblock->hdr->cparam.idx_blk_elmts > 0); iblock->elmts = H5FL_BLK_FREE(idx_blk_elmt_buf, iblock->elmts); } /* end if */ /* Check if we've got data block addresses in the index block */ if (iblock->dblk_addrs) { /* Free buffer for index block data block addresses */ - HDassert(iblock->ndblk_addrs > 0); + assert(iblock->ndblk_addrs > 0); iblock->dblk_addrs = H5FL_SEQ_FREE(haddr_t, iblock->dblk_addrs); iblock->ndblk_addrs = 0; } /* end if */ @@ -486,7 +486,7 @@ H5EA__iblock_dest(H5EA_iblock_t *iblock) /* Check if we've got super block addresses in the index block */ if (iblock->sblk_addrs) { /* Free buffer for index block super block addresses */ - HDassert(iblock->nsblk_addrs > 0); + assert(iblock->nsblk_addrs > 0); iblock->sblk_addrs = H5FL_SEQ_FREE(haddr_t, iblock->sblk_addrs); iblock->nsblk_addrs = 0; } /* end if */ @@ -499,7 +499,7 @@ H5EA__iblock_dest(H5EA_iblock_t *iblock) } /* end if */ /* Sanity check */ - HDassert(NULL == iblock->top_proxy); + assert(NULL == iblock->top_proxy); /* Free the index block itself */ iblock = H5FL_FREE(H5EA_iblock_t, iblock); diff --git a/src/H5EAint.c b/src/H5EAint.c index 6dabeeb..73b1158 100644 --- a/src/H5EAint.c +++ b/src/H5EAint.c @@ -86,8 +86,8 @@ H5EA__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(parent_entry); - HDassert(child_entry); + assert(parent_entry); + assert(child_entry); /* Create a flush dependency between parent and child entry */ if (H5AC_create_flush_dependency(parent_entry, child_entry) < 0) @@ -117,8 +117,8 @@ H5EA__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(parent_entry); - HDassert(child_entry); + assert(parent_entry); + assert(child_entry); /* Destroy a flush dependency between parent and child entry */ if (H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) diff --git a/src/H5EAsblock.c b/src/H5EAsblock.c index e342b64..69c8248 100644 --- a/src/H5EAsblock.c +++ b/src/H5EAsblock.c @@ -99,7 +99,7 @@ H5EA__sblock_alloc(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, unsigned sblk_idx) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); + assert(hdr); /* Allocate memory for the index block */ if (NULL == (sblock = H5FL_CALLOC(H5EA_sblock_t))) @@ -118,7 +118,7 @@ H5EA__sblock_alloc(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, unsigned sblk_idx) /* Compute/cache information */ sblock->idx = sblk_idx; sblock->ndblks = hdr->sblk_info[sblk_idx].ndblks; - HDassert(sblock->ndblks); + assert(sblock->ndblks); sblock->dblk_nelmts = hdr->sblk_info[sblk_idx].dblk_nelmts; /* Allocate buffer for data block addresses in super block */ @@ -132,14 +132,14 @@ H5EA__sblock_alloc(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, unsigned sblk_idx) sblock->dblk_npages = sblock->dblk_nelmts / hdr->dblk_page_nelmts; /* Sanity check that we have at least 2 pages in data block */ - HDassert(sblock->dblk_npages > 1); + assert(sblock->dblk_npages > 1); /* Sanity check for integer truncation */ - HDassert((sblock->dblk_npages * hdr->dblk_page_nelmts) == sblock->dblk_nelmts); + assert((sblock->dblk_npages * hdr->dblk_page_nelmts) == sblock->dblk_nelmts); /* Compute size of buffer for each data block's 'page init' bitmask */ sblock->dblk_page_init_size = ((sblock->dblk_npages) + 7) / 8; - HDassert(sblock->dblk_page_init_size > 0); + assert(sblock->dblk_page_init_size > 0); /* Allocate buffer for all 'page init' bitmasks in super block */ if (NULL == @@ -186,8 +186,8 @@ H5EA__sblock_create(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, hbool_t *stats_chang FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(stats_changed); + assert(hdr); + assert(stats_changed); /* Allocate the super block */ if (NULL == (sblock = H5EA__sblock_alloc(hdr, parent, sblk_idx))) @@ -280,11 +280,11 @@ H5EA__sblock_protect(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(H5_addr_defined(sblk_addr)); + assert(hdr); + assert(H5_addr_defined(sblk_addr)); /* only the H5AC__READ_ONLY_FLAG may be set */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data */ udata.hdr = hdr; @@ -345,7 +345,7 @@ H5EA__sblock_unprotect(H5EA_sblock_t *sblock, unsigned cache_flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(sblock); + assert(sblock); /* Unprotect the super block */ if (H5AC_unprotect(sblock->hdr->f, H5AC_EARRAY_SBLOCK, sblock->addr, sblock, cache_flags) < 0) @@ -379,8 +379,8 @@ H5EA__sblock_delete(H5EA_hdr_t *hdr, H5EA_iblock_t *parent, haddr_t sblk_addr, u FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(H5_addr_defined(sblk_addr)); + assert(hdr); + assert(H5_addr_defined(sblk_addr)); /* Protect super block */ if (NULL == (sblock = H5EA__sblock_protect(hdr, parent, sblk_addr, sblk_idx, H5AC__NO_FLAGS_SET))) @@ -428,8 +428,8 @@ H5EA__sblock_dest(H5EA_sblock_t *sblock) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(sblock); - HDassert(!sblock->has_hdr_depend); + assert(sblock); + assert(!sblock->has_hdr_depend); /* Check if shared header field has been initialized */ if (sblock->hdr) { @@ -439,7 +439,7 @@ H5EA__sblock_dest(H5EA_sblock_t *sblock) /* Free buffer for super block 'page init' bitmask, if there is one */ if (sblock->page_init) { - HDassert(sblock->dblk_npages > 0); + assert(sblock->dblk_npages > 0); sblock->page_init = H5FL_BLK_FREE(page_init, sblock->page_init); } /* end if */ @@ -451,7 +451,7 @@ H5EA__sblock_dest(H5EA_sblock_t *sblock) } /* end if */ /* Sanity check */ - HDassert(NULL == sblock->top_proxy); + assert(NULL == sblock->top_proxy); /* Free the super block itself */ sblock = H5FL_FREE(H5EA_sblock_t, sblock); diff --git a/src/H5EAstat.c b/src/H5EAstat.c index 2f955ff..7c8ef1f 100644 --- a/src/H5EAstat.c +++ b/src/H5EAstat.c @@ -85,8 +85,8 @@ H5EA_get_stats(const H5EA_t *ea, H5EA_stat_t *stats) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(ea); - HDassert(stats); + assert(ea); + assert(stats); /* Copy extensible array statistics */ H5MM_memcpy(stats, &ea->hdr->stats, sizeof(ea->hdr->stats)); diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 474e925..7e02ed7 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -164,7 +164,7 @@ H5EA__test_dst_context(void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(H5EA__TEST_BOGUS_VAL == ctx->bogus); + assert(H5EA__TEST_BOGUS_VAL == ctx->bogus); /* Release context structure */ ctx = H5FL_FREE(H5EA__test_ctx_t, ctx); @@ -193,8 +193,8 @@ H5EA__test_fill(void *nat_blk, size_t nelmts) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(nat_blk); - HDassert(nelmts); + assert(nat_blk); + assert(nelmts); H5VM_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts); @@ -224,10 +224,10 @@ H5EA__test_encode(void *raw, const void *_elmt, size_t nelmts, void *_ctx) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); - HDassert(H5EA__TEST_BOGUS_VAL == ctx->bogus); + assert(raw); + assert(elmt); + assert(nelmts); + assert(H5EA__TEST_BOGUS_VAL == ctx->bogus); /* Check for callback action */ if (ctx->cb) { @@ -276,10 +276,10 @@ H5EA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_NDE FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); - HDassert(H5EA__TEST_BOGUS_VAL == ctx->bogus); + assert(raw); + assert(elmt); + assert(nelmts); + assert(H5EA__TEST_BOGUS_VAL == ctx->bogus); /* Decode raw elements into native elements */ while (nelmts) { @@ -317,8 +317,8 @@ H5EA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void * FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(stream); - HDassert(elmt); + assert(stream); + assert(elmt); /* Print element */ HDsnprintf(temp_str, sizeof(temp_str), "Element #%llu:", (unsigned long long)idx); @@ -379,7 +379,7 @@ H5EA__test_dst_dbg_context(void *_ctx) FUNC_ENTER_PACKAGE_NOERR - HDassert(_ctx); + assert(_ctx); /* Release context structure */ ctx = H5FL_FREE(H5EA__ctx_cb_t, ctx); @@ -406,8 +406,8 @@ H5EA__get_cparam_test(const H5EA_t *ea, H5EA_create_t *cparam) FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(ea); - HDassert(cparam); + assert(ea); + assert(cparam); /* Get extensible array creation parameters */ cparam->raw_elmt_size = ea->hdr->cparam.raw_elmt_size; @@ -441,8 +441,8 @@ H5EA__cmp_cparam_test(const H5EA_create_t *cparam1, const H5EA_create_t *cparam2 FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(cparam1); - HDassert(cparam2); + assert(cparam1); + assert(cparam2); /* Compare creation parameters for array */ if (cparam1->raw_elmt_size < cparam2->raw_elmt_size) diff --git a/src/H5ESevent.c b/src/H5ESevent.c index 2edb61d..052b141 100644 --- a/src/H5ESevent.c +++ b/src/H5ESevent.c @@ -93,8 +93,8 @@ H5ES__event_new(H5VL_t *connector, void *token) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(connector); - HDassert(token); + assert(connector); + assert(token); /* Create vol object for token */ if (NULL == (request = H5VL_create_object(token, connector))) { @@ -137,7 +137,7 @@ H5ES__event_free(H5ES_event_t *ev) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ev); + assert(ev); /* The 'app_func_name', 'app_file_name', and 'api_name' strings are statically allocated (by the compiler) * and are not allocated, so there's no need to free them. @@ -183,7 +183,7 @@ H5ES__event_completed(H5ES_event_t *ev, H5ES_event_list_t *el) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ev); + assert(ev); /* Remove the event from the event list */ H5ES__list_remove(el, ev); diff --git a/src/H5ESint.c b/src/H5ESint.c index 6e5eab2..192db85 100644 --- a/src/H5ESint.c +++ b/src/H5ESint.c @@ -195,7 +195,7 @@ H5ES__close_cb(void *_es, void H5_ATTR_UNUSED **rt) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(es); + assert(es); /* Close the event set object */ if (H5ES__close(es) < 0) @@ -264,7 +264,7 @@ H5ES__insert(H5ES_t *es, H5VL_t *connector, void *request_token, const char *app FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(es); + assert(es); /* Create new event */ if (NULL == (ev = H5ES__event_new(connector, request_token))) @@ -291,7 +291,7 @@ H5ES__insert(H5ES_t *es, H5VL_t *connector, void *request_token, const char *app * there's no need to duplicate it. */ ev->op_info.api_name = caller; - HDassert(ev->op_info.api_args == NULL); + assert(ev->op_info.api_args == NULL); if (api_args && NULL == (ev->op_info.api_args = H5MM_xstrdup(api_args))) HGOTO_ERROR(H5E_EVENTSET, H5E_CANTALLOC, FAIL, "can't copy API routine arguments") @@ -345,10 +345,10 @@ H5ES_insert(hid_t es_id, H5VL_t *connector, void *token, const char *caller, con FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(connector); - HDassert(token); - HDassert(caller); - HDassert(caller_args); + assert(connector); + assert(token); + assert(caller); + assert(caller_args); /* Get event set */ if (NULL == (es = (H5ES_t *)H5I_object_verify(es_id, H5I_EVENTSET))) @@ -376,7 +376,7 @@ H5ES_insert(hid_t es_id, H5VL_t *connector, void *token, const char *caller, con /* Copy the string for the API routine's arguments */ /* (skip the six characters from the app's file, function and line # arguments) */ - HDassert(0 == HDstrncmp(caller_args, "*s*sIu", 6)); + assert(0 == HDstrncmp(caller_args, "*s*sIu", 6)); if (H5_trace_args(rs, caller_args + 6, ap) < 0) HGOTO_ERROR(H5E_EVENTSET, H5E_CANTSET, FAIL, "can't create formatted API arguments") if (NULL == (api_args = H5RS_get_str(rs))) @@ -416,9 +416,9 @@ H5ES__insert_request(H5ES_t *es, H5VL_t *connector, void *token) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(es); - HDassert(connector); - HDassert(token); + assert(es); + assert(connector); + assert(token); /* Insert an 'anonymous' operation into the event set */ if (H5ES__insert(es, connector, token, NULL, NULL, 0, NULL, NULL) < 0) @@ -450,9 +450,9 @@ H5ES__get_requests_cb(H5ES_event_t *ev, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ev); - HDassert(ctx); - HDassert(ctx->i < ctx->array_len); + assert(ev); + assert(ctx); + assert(ctx->i < ctx->array_len); /* Get the connector ID for the event */ if (ctx->connector_ids) @@ -490,9 +490,9 @@ H5ES__get_requests(H5ES_t *es, H5_iter_order_t order, hid_t *connector_ids, void FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(es); - HDassert(array_len > 0); - HDassert(requests || connector_ids); + assert(es); + assert(array_len > 0); + assert(requests || connector_ids); /* Set up context for iterator callbacks */ ctx.connector_ids = connector_ids; @@ -526,9 +526,9 @@ H5ES__handle_fail(H5ES_t *es, H5ES_event_t *ev) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(es); - HDassert(es->active.head); - HDassert(ev); + assert(es); + assert(es->active.head); + assert(ev); /* Set error flag for event set */ es->err_occurred = TRUE; @@ -564,10 +564,10 @@ H5ES__op_complete(H5ES_t *es, H5ES_event_t *ev, H5VL_request_status_t ev_status) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(es); - HDassert(ev); - HDassert(H5VL_REQUEST_STATUS_SUCCEED == ev_status || H5VL_REQUEST_STATUS_FAIL == ev_status || - H5VL_REQUEST_STATUS_CANCELED == ev_status); + assert(es); + assert(ev); + assert(H5VL_REQUEST_STATUS_SUCCEED == ev_status || H5VL_REQUEST_STATUS_FAIL == ev_status || + H5VL_REQUEST_STATUS_CANCELED == ev_status); /* Handle each form of event completion */ if (H5VL_REQUEST_STATUS_SUCCEED == ev_status || H5VL_REQUEST_STATUS_CANCELED == ev_status) { @@ -660,8 +660,8 @@ H5ES__wait_cb(H5ES_event_t *ev, void *_ctx) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ev); - HDassert(ctx); + assert(ev); + assert(ctx); /* Wait on the request */ if (ctx->timeout != H5ES_WAIT_NONE && ctx->timeout != H5ES_WAIT_FOREVER) @@ -694,7 +694,7 @@ H5ES__wait_cb(H5ES_event_t *ev, void *_ctx) "received \"can't cancel\" status for operation") else { /* Sanity check */ - HDassert(ev_status == H5VL_REQUEST_STATUS_IN_PROGRESS); + assert(ev_status == H5VL_REQUEST_STATUS_IN_PROGRESS); /* Increment "in progress operation" counter */ (*ctx->num_in_progress)++; @@ -736,9 +736,9 @@ H5ES__wait(H5ES_t *es, uint64_t timeout, size_t *num_in_progress, hbool_t *op_fa FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(es); - HDassert(num_in_progress); - HDassert(op_failed); + assert(es); + assert(num_in_progress); + assert(op_failed); /* Set user's parameters to known values */ *num_in_progress = 0; @@ -780,8 +780,8 @@ H5ES__cancel_cb(H5ES_event_t *ev, void *_ctx) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ev); - HDassert(ctx); + assert(ev); + assert(ctx); /* Attempt to cancel the request */ if (H5VL_request_cancel(ev->request, &ev_status) < 0) @@ -813,7 +813,7 @@ H5ES__cancel_cb(H5ES_event_t *ev, void *_ctx) } /* end else-if */ else { /* Sanity check */ - HDassert(ev_status == H5VL_REQUEST_STATUS_CANCELED); + assert(ev_status == H5VL_REQUEST_STATUS_CANCELED); /* Handle event completion */ if (H5ES__op_complete(ctx->es, ev, ev_status) < 0) @@ -845,9 +845,9 @@ H5ES__cancel(H5ES_t *es, size_t *num_not_canceled, hbool_t *op_failed) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(es); - HDassert(num_not_canceled); - HDassert(op_failed); + assert(es); + assert(num_not_canceled); + assert(op_failed); /* Set user's parameters to known values */ *num_not_canceled = 0; @@ -888,8 +888,8 @@ H5ES__get_err_info_cb(H5ES_event_t *ev, void *_ctx) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ev); - HDassert(ctx); + assert(ev); + assert(ctx); /* Copy operation info for event */ /* The 'app_func_name', 'app_file_name', and 'api_name' strings are statically allocated (by the compiler) @@ -961,10 +961,10 @@ H5ES__get_err_info(H5ES_t *es, size_t num_err_info, H5ES_err_info_t err_info[], FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(es); - HDassert(num_err_info); - HDassert(err_info); - HDassert(num_cleared); + assert(es); + assert(num_err_info); + assert(err_info); + assert(num_cleared); /* Set up context for iterator callbacks */ ctx.es = es; @@ -1004,8 +1004,8 @@ H5ES__close_failed_cb(H5ES_event_t *ev, void *_ctx) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ev); - HDassert(es); + assert(ev); + assert(es); /* Remove event from event set's failed list */ H5ES__list_remove(&es->failed, ev); @@ -1038,7 +1038,7 @@ H5ES__close(H5ES_t *es) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(es); + assert(es); /* Fail if active operations still present */ if (H5ES__list_count(&es->active) > 0) diff --git a/src/H5ESlist.c b/src/H5ESlist.c index 61a9dd1..e9cedbf 100644 --- a/src/H5ESlist.c +++ b/src/H5ESlist.c @@ -85,8 +85,8 @@ H5ES__list_append(H5ES_event_list_t *el, H5ES_event_t *ev) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(el); - HDassert(ev); + assert(el); + assert(ev); ev->next = NULL; @@ -123,7 +123,7 @@ H5ES__list_count(const H5ES_event_list_t *el) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(el); + assert(el); FUNC_LEAVE_NOAPI(el->count) } /* end H5ES__list_count() */ @@ -156,8 +156,8 @@ H5ES__list_iterate(H5ES_event_list_t *el, H5_iter_order_t order, H5ES_list_iter_ FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(el); - HDassert(cb); + assert(el); + assert(cb); /* Iterate over events in list */ ev = (order == H5_ITER_DEC) ? el->tail : el->head; @@ -199,9 +199,9 @@ H5ES__list_remove(H5ES_event_list_t *el, const H5ES_event_t *ev) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(el); - HDassert(el->head); - HDassert(ev); + assert(el); + assert(el->head); + assert(ev); /* Stitch event out of list */ if (ev == el->head) diff --git a/src/H5Eint.c b/src/H5Eint.c index 759dfbc..64292f3 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -121,7 +121,7 @@ H5E__get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(msg); + assert(msg); /* Get the length of the message string */ len = (ssize_t)HDstrlen(msg->msg); @@ -192,7 +192,7 @@ H5E__walk1_cb(int n, H5E_error1_t *err_desc, void *client_data) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(err_desc); + assert(err_desc); /* If no client data was passed, output to stderr */ if (!client_data) @@ -315,7 +315,7 @@ H5E__walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(err_desc); + assert(err_desc); /* If no client data was passed, output to stderr */ if (!client_data) @@ -421,7 +421,7 @@ H5E__print(const H5E_t *estack, FILE *stream, hbool_t bk_compatible) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(estack); + assert(estack); /* If no stream was given, use stderr */ if (!stream) @@ -440,7 +440,7 @@ H5E__print(const H5E_t *estack, FILE *stream, hbool_t bk_compatible) if (H5E__walk(estack, H5E_WALK_DOWNWARD, &walk_op, (void *)&eprint) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") #else /* H5_NO_DEPRECATED_SYMBOLS */ - HDassert(0 && "version 1 error stack print without deprecated symbols!"); + assert(0 && "version 1 error stack print without deprecated symbols!"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end if */ else { @@ -493,8 +493,8 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(estack); - HDassert(op); + assert(estack); + assert(op); /* check args, but rather than failing use some default value */ if (direction != H5E_WALK_UPWARD && direction != H5E_WALK_DOWNWARD) @@ -539,11 +539,11 @@ H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *o HERROR(H5E_ERROR, H5E_CANTLIST, "can't walk error stack"); } /* end if */ #else /* H5_NO_DEPRECATED_SYMBOLS */ - HDassert(0 && "version 1 error stack walk without deprecated symbols!"); + assert(0 && "version 1 error stack walk without deprecated symbols!"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end if */ else { - HDassert(op->vers == 2); + assert(op->vers == 2); if (op->u.func2) { ret_value = SUCCEED; if (H5E_WALK_UPWARD == direction) { @@ -585,7 +585,7 @@ H5E__get_auto(const H5E_t *estack, H5E_auto_op_t *op, void **client_data) { FUNC_ENTER_PACKAGE_NOERR - HDassert(estack); + assert(estack); /* Retrieve the requested information */ if (op) @@ -624,7 +624,7 @@ H5E__set_auto(H5E_t *estack, const H5E_auto_op_t *op, void *client_data) { FUNC_ENTER_PACKAGE_NOERR - HDassert(estack); + assert(estack); /* Set the automatic error reporting info */ estack->auto_op = *op; @@ -664,10 +664,10 @@ H5E_printf_stack(H5E_t *estack, const char *file, const char *func, unsigned lin FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(cls_id > 0); - HDassert(maj_id > 0); - HDassert(min_id > 0); - HDassert(fmt); + assert(cls_id > 0); + assert(maj_id > 0); + assert(min_id > 0); + assert(fmt); /* Note that the variable-argument parsing for the format is identical in * the H5Epush2() routine - correct errors and make changes in both @@ -734,9 +734,9 @@ H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(cls_id > 0); - HDassert(maj_id > 0); - HDassert(min_id > 0); + assert(cls_id > 0); + assert(maj_id > 0); + assert(min_id > 0); /* Check for 'default' error stack */ if (estack == NULL) @@ -758,7 +758,7 @@ H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line /* * Push the error if there's room. Otherwise just forget it. */ - HDassert(estack); + assert(estack); if (estack->nused < H5E_NSLOTS) { /* Increment the IDs to indicate that they are used in this stack */ @@ -809,8 +809,8 @@ H5E__clear_entries(H5E_t *estack, size_t nentries) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(estack); - HDassert(estack->nused >= nentries); + assert(estack); + assert(estack->nused >= nentries); /* Empty the error stack from the top down */ for (u = 0; nentries > 0; nentries--, u++) { @@ -869,7 +869,7 @@ H5E_clear_stack(H5E_t *estack) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") /* Empty the error stack */ - HDassert(estack); + assert(estack); if (estack->nused) if (H5E__clear_entries(estack, estack->nused) < 0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't clear error stack") @@ -899,8 +899,8 @@ H5E__pop(H5E_t *estack, size_t count) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(estack); - HDassert(estack->nused >= count); + assert(estack); + assert(estack->nused >= count); /* Remove the entries from the error stack */ if (H5E__clear_entries(estack, count) < 0) @@ -935,7 +935,7 @@ H5E_dump_api_stack(hbool_t is_api) if (is_api) { H5E_t *estack = H5E__get_my_stack(); - HDassert(estack); + assert(estack); #ifdef H5_NO_DEPRECATED_SYMBOLS if (estack->auto_op.func2) diff --git a/src/H5F.c b/src/H5F.c index f533a8d..7b88519 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1259,7 +1259,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "can't create VOL object for root group") } /* end if */ else { - HDassert(H5I_GROUP == loc_type); + assert(H5I_GROUP == loc_type); if (NULL == (loc_vol_obj = (H5VL_object_t *)H5I_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object") } /* end else */ @@ -1292,7 +1292,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) done: /* Clean up if we temporarily opened the root group for a file */ if (grp) { - HDassert(loc_vol_obj); + assert(loc_vol_obj); if (H5VL_group_close(loc_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "unable to release group") if (H5VL_free_object(loc_vol_obj) < 0) @@ -1369,7 +1369,7 @@ H5Funmount(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "can't create VOL object for root group") } /* end if */ else { - HDassert(H5I_GROUP == loc_type); + assert(H5I_GROUP == loc_type); if (NULL == (loc_vol_obj = (H5VL_object_t *)H5I_object(loc_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "could not get location object") } /* end else */ @@ -1388,7 +1388,7 @@ H5Funmount(hid_t loc_id, const char *name) done: /* Clean up if we temporarily opened the root group for a file */ if (grp) { - HDassert(loc_vol_obj); + assert(loc_vol_obj); if (H5VL_group_close(loc_vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "unable to release group") if (H5VL_free_object(loc_vol_obj) < 0) diff --git a/src/H5FA.c b/src/H5FA.c index 54bc00f..bd66b7d 100644 --- a/src/H5FA.c +++ b/src/H5FA.c @@ -111,8 +111,8 @@ H5FA__new(H5F_t *f, haddr_t fa_addr, hbool_t from_open, void *ctx_udata) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(fa_addr)); + assert(f); + assert(H5_addr_defined(fa_addr)); /* Allocate fixed array wrapper */ if (NULL == (fa = H5FL_CALLOC(H5FA_t))) @@ -175,8 +175,8 @@ H5FA_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata) FUNC_ENTER_NOAPI(NULL) /* Check arguments */ - HDassert(f); - HDassert(cparam); + assert(f); + assert(cparam); /* H5FA interface sanity check */ HDcompile_assert(H5FA_NUM_CLS_ID == NELMTS(H5FA_client_class_g)); @@ -223,8 +223,8 @@ H5FA_open(H5F_t *f, haddr_t fa_addr, void *ctx_udata) FUNC_ENTER_NOAPI(NULL) /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(fa_addr)); + assert(f); + assert(H5_addr_defined(fa_addr)); /* Allocate and initialize new fixed array wrapper */ if (NULL == (fa = H5FA__new(f, fa_addr, TRUE, ctx_udata))) @@ -260,8 +260,8 @@ H5FA_get_nelmts(const H5FA_t *fa, hsize_t *nelmts) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(fa); - HDassert(nelmts); + assert(fa); + assert(nelmts); /* Retrieve the current number of elements in the fixed array */ *nelmts = fa->hdr->stats.nelmts; @@ -287,9 +287,9 @@ H5FA_get_addr(const H5FA_t *fa, haddr_t *addr) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(fa); - HDassert(fa->hdr); - HDassert(addr); + assert(fa); + assert(fa->hdr); + assert(addr); /* Retrieve the address of the fixed array's header */ *addr = fa->hdr->addr; @@ -324,8 +324,8 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(fa); - HDassert(fa->hdr); + assert(fa); + assert(fa->hdr); /* Set the shared array header's file context for this operation */ hdr->f = fa->f; @@ -338,7 +338,7 @@ H5FA_set(const H5FA_t *fa, hsize_t idx, const void *elmt) HGOTO_ERROR(H5E_FARRAY, H5E_CANTCREATE, FAIL, "unable to create fixed array data block") } - HDassert(idx < hdr->cparam.nelmts); + assert(idx < hdr->cparam.nelmts); /* Protect data block */ if (NULL == (dblock = H5FA__dblock_protect(hdr, hdr->dblk_addr, H5AC__NO_FLAGS_SET))) @@ -435,8 +435,8 @@ H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(fa); - HDassert(fa->hdr); + assert(fa); + assert(fa->hdr); /* Set the shared array header's file context for this operation */ hdr->f = fa->f; @@ -449,7 +449,7 @@ H5FA_get(const H5FA_t *fa, hsize_t idx, void *elmt) } /* end if */ else { /* Get the data block */ - HDassert(H5_addr_defined(hdr->dblk_addr)); + assert(H5_addr_defined(hdr->dblk_addr)); if (NULL == (dblock = H5FA__dblock_protect(hdr, hdr->dblk_addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_FARRAY, H5E_CANTPROTECT, FAIL, "unable to protect fixed array data block, address = %llu", @@ -538,7 +538,7 @@ H5FA_close(H5FA_t *fa) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(fa); + assert(fa); /* Close the header if it was set */ if (fa->hdr) { @@ -574,9 +574,9 @@ H5FA_close(H5FA_t *fa) "unable to check metadata cache status for fixed array header") /* Sanity checks on header */ - HDassert(hdr_status & H5AC_ES__IN_CACHE); - HDassert(hdr_status & H5AC_ES__IS_PINNED); - HDassert(!(hdr_status & H5AC_ES__IS_PROTECTED)); + assert(hdr_status & H5AC_ES__IN_CACHE); + assert(hdr_status & H5AC_ES__IS_PINNED); + assert(!(hdr_status & H5AC_ES__IS_PROTECTED)); } #endif /* NDEBUG */ @@ -639,8 +639,8 @@ H5FA_delete(H5F_t *f, haddr_t fa_addr, void *ctx_udata) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(fa_addr)); + assert(f); + assert(H5_addr_defined(fa_addr)); /* Lock the array header into memory */ if (NULL == (hdr = H5FA__hdr_protect(f, fa_addr, ctx_udata, H5AC__NO_FLAGS_SET))) @@ -693,9 +693,9 @@ H5FA_iterate(H5FA_t *fa, H5FA_operator_t op, void *udata) FUNC_ENTER_NOAPI(H5_ITER_ERROR) /* Check arguments */ - HDassert(fa); - HDassert(op); - HDassert(udata); + assert(fa); + assert(op); + assert(udata); /* Allocate space for a native array element */ if (NULL == (elmt = H5FL_BLK_MALLOC(fa_native_elmt, fa->hdr->cparam.cls->nat_elmt_size))) @@ -744,9 +744,9 @@ H5FA_depend(H5FA_t *fa, H5AC_proxy_entry_t *parent) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(fa); - HDassert(hdr); - HDassert(parent); + assert(fa); + assert(hdr); + assert(parent); /* * Check to see if a flush dependency between the fixed array @@ -755,7 +755,7 @@ H5FA_depend(H5FA_t *fa, H5AC_proxy_entry_t *parent) */ if (NULL == hdr->parent) { /* Sanity check */ - HDassert(hdr->top_proxy); + assert(hdr->top_proxy); /* Set the shared array header's file context for this operation */ hdr->f = fa->f; @@ -788,8 +788,8 @@ H5FA_patch_file(H5FA_t *fa, H5F_t *f) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(fa); - HDassert(f); + assert(fa); + assert(f); if (fa->f != f || fa->hdr->f != f) fa->f = fa->hdr->f = f; diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 119bbc8..9a89bba 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -174,9 +174,9 @@ H5FA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->f); - HDassert(image_len); + assert(udata); + assert(udata->f); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5FA_HEADER_SIZE_FILE(udata->f); @@ -208,7 +208,7 @@ H5FA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -246,9 +246,9 @@ H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(udata); - HDassert(udata->f); - HDassert(H5_addr_defined(udata->addr)); + assert(udata); + assert(udata->f); + assert(H5_addr_defined(udata->addr)); /* Allocate space for the fixed array data structure */ if (NULL == (hdr = H5FA__hdr_alloc(udata->f))) @@ -305,7 +305,7 @@ H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); /* checksum verification already done in verify_chksum cb */ @@ -313,12 +313,12 @@ H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == len); + assert((size_t)(image - (const uint8_t *)_image) == len); /* Finish initializing fixed array header */ if (H5FA__hdr_init(hdr, udata->ctx_udata) < 0) HGOTO_ERROR(H5E_FARRAY, H5E_CANTINIT, NULL, "initialization failed for fixed array header") - HDassert(hdr->size == len); + assert(hdr->size == len); /* Set return value */ ret_value = hdr; @@ -352,8 +352,8 @@ H5FA__cache_hdr_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(hdr); - HDassert(image_len); + assert(hdr); + assert(image_len); /* Set the image length size */ *image_len = hdr->size; @@ -383,9 +383,9 @@ H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(hdr); + assert(f); + assert(image); + assert(hdr); /* Magic number */ H5MM_memcpy(image, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -395,7 +395,7 @@ H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le *image++ = H5FA_HDR_VERSION; /* Fixed array type */ - HDassert(hdr->cparam.cls->id <= 255); + assert(hdr->cparam.cls->id <= 255); *image++ = (uint8_t)hdr->cparam.cls->id; /* General array creation/configuration information */ @@ -417,7 +417,7 @@ H5FA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED le UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FA__cache_hdr_serialize() */ @@ -443,7 +443,7 @@ H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Check if the file was opened with SWMR-write access */ if (hdr->swmr_write) { @@ -467,7 +467,7 @@ H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) */ if (hdr->parent) { /* Sanity check */ - HDassert(hdr->top_proxy); + assert(hdr->top_proxy); /* Destroy flush dependency on object header proxy */ if (H5AC_proxy_entry_remove_child((H5AC_proxy_entry_t *)hdr->parent, @@ -491,12 +491,12 @@ H5FA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ } /* end if */ else - HDassert(NULL == hdr->parent); + assert(NULL == hdr->parent); done: @@ -524,7 +524,7 @@ H5FA__cache_hdr_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Release the extensible array header */ if (H5FA__hdr_dest((H5FA_hdr_t *)thing) < 0) @@ -556,9 +556,9 @@ H5FA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(image_len); + assert(udata); + assert(udata->hdr); + assert(image_len); /* Set up fake data block for computing size on disk */ /* (Note: extracted from H5FA__dblock_alloc) */ @@ -610,7 +610,7 @@ H5FA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -648,15 +648,15 @@ H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(udata); - HDassert(udata->hdr); + assert(udata); + assert(udata->hdr); /* Allocate the fixed array data block */ if (NULL == (dblock = H5FA__dblock_alloc(udata->hdr))) HGOTO_ERROR(H5E_FARRAY, H5E_CANTALLOC, NULL, "memory allocation failed for fixed array data block") - HDassert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) || - (len == (size_t)H5FA_DBLOCK_PREFIX_SIZE(dblock))); + assert(((!dblock->npages) && (len == (size_t)H5FA_DBLOCK_SIZE(dblock))) || + (len == (size_t)H5FA_DBLOCK_PREFIX_SIZE(dblock))); /* Set the fixed array data block's information */ dblock->addr = udata->dblk_addr; @@ -697,7 +697,7 @@ H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); /* Set the data block's size */ dblock->size = H5FA_DBLOCK_SIZE(dblock); @@ -708,7 +708,7 @@ H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == len); + assert((size_t)(image - (const uint8_t *)_image) == len); /* Set return value */ ret_value = dblock; @@ -742,8 +742,8 @@ H5FA__cache_dblock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblock); - HDassert(image_len); + assert(dblock); + assert(image_len); /* Set the image length size */ if (!dblock->npages) @@ -777,10 +777,10 @@ H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(dblock); - HDassert(dblock->hdr); + assert(f); + assert(image); + assert(dblock); + assert(dblock->hdr); /* Magic number */ H5MM_memcpy(image, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -790,7 +790,7 @@ H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED *image++ = H5FA_DBLOCK_VERSION; /* Fixed array type */ - HDassert(dblock->hdr->cparam.cls->id <= 255); + assert(dblock->hdr->cparam.cls->id <= 255); *image++ = (uint8_t)dblock->hdr->cparam.cls->id; /* Address of array header for array which owns this block */ @@ -822,7 +822,7 @@ H5FA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -849,7 +849,7 @@ H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblock); + assert(dblock); /* Check if the file was opened with SWMR-write access */ if (dblock->hdr->swmr_write) { @@ -893,7 +893,7 @@ H5FA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif } /* end switch */ } /* end if */ @@ -924,7 +924,7 @@ H5FA__cache_dblock_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(dblock); + assert(dblock); /* Release the fixed array data block */ if (H5FA__dblock_dest(dblock) < 0) @@ -971,9 +971,9 @@ H5FA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblock); - HDassert(dblock->cache_info.type == H5AC_FARRAY_DBLOCK); - HDassert(fsf_size); + assert(dblock); + assert(dblock->cache_info.type == H5AC_FARRAY_DBLOCK); + assert(fsf_size); *fsf_size = dblock->size; @@ -1000,10 +1000,10 @@ H5FA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->hdr); - HDassert(udata->nelmts > 0); - HDassert(image_len); + assert(udata); + assert(udata->hdr); + assert(udata->nelmts > 0); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5FA_DBLK_PAGE_SIZE(udata->hdr, udata->nelmts); @@ -1035,7 +1035,7 @@ H5FA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -1072,10 +1072,10 @@ H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, /* Sanity check */ FUNC_ENTER_PACKAGE - HDassert(udata); - HDassert(udata->hdr); - HDassert(udata->nelmts > 0); - HDassert(H5_addr_defined(udata->dblk_page_addr)); + assert(udata); + assert(udata->hdr); + assert(udata->nelmts > 0); + assert(H5_addr_defined(udata->dblk_page_addr)); /* Allocate the fixed array data block page */ if (NULL == (dblk_page = H5FA__dblk_page_alloc(udata->hdr, udata->nelmts))) @@ -1095,7 +1095,7 @@ H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (len - H5FA_SIZEOF_CHKSUM)); /* Set the data block page's size */ dblk_page->size = len; @@ -1106,7 +1106,7 @@ H5FA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == dblk_page->size); + assert((size_t)(image - (const uint8_t *)_image) == dblk_page->size); /* Set return value */ ret_value = dblk_page; @@ -1141,8 +1141,8 @@ H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblk_page); - HDassert(image_len); + assert(dblk_page); + assert(image_len); /* Set the image length size */ *image_len = dblk_page->size; @@ -1174,10 +1174,10 @@ H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_ima FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(image); - HDassert(dblk_page); - HDassert(dblk_page->hdr); + assert(f); + assert(image); + assert(dblk_page); + assert(dblk_page->hdr); /* Internal information */ @@ -1196,7 +1196,7 @@ H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_ima UINT32ENCODE(image, metadata_chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1223,7 +1223,7 @@ H5FA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblk_page); + assert(dblk_page); /* Determine which action to take */ switch (action) { @@ -1257,7 +1257,7 @@ H5FA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_FARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ @@ -1286,7 +1286,7 @@ H5FA__cache_dblk_page_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(thing); + assert(thing); /* Release the fixed array data block page */ if (H5FA__dblk_page_dest((H5FA_dblk_page_t *)thing) < 0) diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index e029c67..3ae1aa1 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -90,13 +90,13 @@ H5FA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, co FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(H5_addr_defined(obj_addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(cls); + assert(f); + assert(H5_addr_defined(addr)); + assert(H5_addr_defined(obj_addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(cls); /* Check for debugging context callback available */ if (cls->crt_dbg_ctx) @@ -163,14 +163,14 @@ H5FA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(cls); - HDassert(H5_addr_defined(hdr_addr)); - HDassert(H5_addr_defined(obj_addr)); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(cls); + assert(H5_addr_defined(hdr_addr)); + assert(H5_addr_defined(obj_addr)); /* Check for debugging context callback available */ if (cls->crt_dbg_ctx) diff --git a/src/H5FAdblkpage.c b/src/H5FAdblkpage.c index 06722f7..04931c9 100644 --- a/src/H5FAdblkpage.c +++ b/src/H5FAdblkpage.c @@ -92,7 +92,7 @@ H5FA__dblk_page_alloc(H5FA_hdr_t *hdr, size_t nelmts) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); + assert(hdr); /* Allocate memory for the data block */ if (NULL == (dblk_page = H5FL_CALLOC(H5FA_dblk_page_t))) @@ -150,7 +150,7 @@ H5FA__dblk_page_create(H5FA_hdr_t *hdr, haddr_t addr, size_t nelmts) #endif /* H5FA_DEBUG */ /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Allocate the data block page */ if (NULL == (dblk_page = H5FA__dblk_page_alloc(hdr, nelmts))) @@ -226,11 +226,11 @@ H5FA__dblk_page_protect(H5FA_hdr_t *hdr, haddr_t dblk_page_addr, size_t dblk_pag #endif /* H5FA_DEBUG */ /* Sanity check */ - HDassert(hdr); - HDassert(H5_addr_defined(dblk_page_addr)); + assert(hdr); + assert(H5_addr_defined(dblk_page_addr)); /* only the H5AC__READ_ONLY_FLAG is permitted */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data */ udata.hdr = hdr; @@ -296,7 +296,7 @@ H5FA__dblk_page_unprotect(H5FA_dblk_page_t *dblk_page, unsigned cache_flags) #endif /* H5FA_DEBUG */ /* Sanity check */ - HDassert(dblk_page); + assert(dblk_page); /* Unprotect the data block page */ if (H5AC_unprotect(dblk_page->hdr->f, H5AC_FARRAY_DBLK_PAGE, dblk_page->addr, dblk_page, cache_flags) < 0) @@ -328,7 +328,7 @@ H5FA__dblk_page_dest(H5FA_dblk_page_t *dblk_page) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblk_page); + assert(dblk_page); /* Check if header field has been initialized */ if (dblk_page->hdr) { @@ -346,7 +346,7 @@ H5FA__dblk_page_dest(H5FA_dblk_page_t *dblk_page) } /* end if */ /* Sanity check */ - HDassert(NULL == dblk_page->top_proxy); + assert(NULL == dblk_page->top_proxy); /* Free the data block page itself */ dblk_page = H5FL_FREE(H5FA_dblk_page_t, dblk_page); diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index 06001cd..90c4ece 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -96,8 +96,8 @@ H5FA__dblock_alloc(H5FA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); - HDassert(hdr->cparam.nelmts > 0); + assert(hdr); + assert(hdr->cparam.nelmts > 0); /* Allocate memory for the data block */ if (NULL == (dblock = H5FL_CALLOC(H5FA_dblock_t))) @@ -120,11 +120,11 @@ H5FA__dblock_alloc(H5FA_hdr_t *hdr) H5_CHECKED_ASSIGN(dblock->npages, size_t, npages, hsize_t); /* Sanity check that we have at least 1 page */ - HDassert(dblock->npages > 0); + assert(dblock->npages > 0); /* Compute size of 'page init' flag array, in bytes */ dblock->dblk_page_init_size = (dblock->npages + 7) / 8; - HDassert(dblock->dblk_page_init_size > 0); + assert(dblock->dblk_page_init_size > 0); /* Allocate space for 'page init' flags */ if (NULL == (dblock->dblk_page_init = H5FL_BLK_CALLOC(fa_page_init, dblock->dblk_page_init_size))) @@ -183,8 +183,8 @@ H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(hdr_dirty); + assert(hdr); + assert(hdr_dirty); /* Allocate the data block */ if (NULL == (dblock = H5FA__dblock_alloc(hdr))) @@ -271,11 +271,11 @@ H5FA__dblock_protect(H5FA_hdr_t *hdr, haddr_t dblk_addr, unsigned flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(H5_addr_defined(dblk_addr)); + assert(hdr); + assert(H5_addr_defined(dblk_addr)); /* only the H5AC__READ_ONLY_FLAG flag is permitted */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data */ udata.hdr = hdr; @@ -332,7 +332,7 @@ H5FA__dblock_unprotect(H5FA_dblock_t *dblock, unsigned cache_flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblock); + assert(dblock); /* Unprotect the data block */ if (H5AC_unprotect(dblock->hdr->f, H5AC_FARRAY_DBLOCK, dblock->addr, dblock, cache_flags) < 0) @@ -365,8 +365,8 @@ H5FA__dblock_delete(H5FA_hdr_t *hdr, haddr_t dblk_addr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(H5_addr_defined(dblk_addr)); + assert(hdr); + assert(H5_addr_defined(dblk_addr)); /* Protect data block */ if (NULL == (dblock = H5FA__dblock_protect(hdr, dblk_addr, H5AC__NO_FLAGS_SET))) @@ -423,21 +423,21 @@ H5FA__dblock_dest(H5FA_dblock_t *dblock) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblock); + assert(dblock); /* Check if shared header field has been initialized */ if (dblock->hdr) { /* Check if we've got elements in the data block */ if (dblock->elmts && !dblock->npages) { /* Free buffer for data block elements */ - HDassert(dblock->hdr->cparam.nelmts > 0); + assert(dblock->hdr->cparam.nelmts > 0); dblock->elmts = H5FL_BLK_FREE(chunk_elmts, dblock->elmts); } /* end if */ /* Check if data block is paged */ if (dblock->npages) { /* Free buffer for 'page init' bitmask, if there is one */ - HDassert(dblock->dblk_page_init_size > 0); + assert(dblock->dblk_page_init_size > 0); if (dblock->dblk_page_init) dblock->dblk_page_init = H5FL_BLK_FREE(fa_page_init, dblock->dblk_page_init); } /* end if */ @@ -450,7 +450,7 @@ H5FA__dblock_dest(H5FA_dblock_t *dblock) } /* end if */ /* Sanity check */ - HDassert(NULL == dblock->top_proxy); + assert(NULL == dblock->top_proxy); /* Free the data block itself */ dblock = H5FL_FREE(H5FA_dblock_t, dblock); diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index 9d5ce3b..0bf9da1 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -90,7 +90,7 @@ H5FA__hdr_alloc(H5F_t *f) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); + assert(f); /* Allocate space for the shared information */ if (NULL == (hdr = H5FL_CALLOC(H5FA_hdr_t))) @@ -135,7 +135,7 @@ H5FA__hdr_init(H5FA_hdr_t *hdr, void *ctx_udata) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); + assert(hdr); /* Set size of header on disk (locally and in statistics) */ hdr->stats.hdr_size = hdr->size = H5FA_HEADER_SIZE_HDR(hdr); @@ -176,8 +176,8 @@ H5FA__hdr_create(H5F_t *f, const H5FA_create_t *cparam, void *ctx_udata) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(cparam); + assert(f); + assert(cparam); #ifndef NDEBUG { @@ -271,7 +271,7 @@ H5FA__hdr_incr(H5FA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Mark header as un-evictable when something is depending on it */ if (hdr->rc == 0) @@ -305,15 +305,15 @@ H5FA__hdr_decr(H5FA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(hdr->rc); + assert(hdr); + assert(hdr->rc); /* Decrement reference count on shared header */ hdr->rc--; /* Mark header as evictable again when nothing depend on it */ if (hdr->rc == 0) { - HDassert(hdr->file_rc == 0); + assert(hdr->file_rc == 0); if (H5AC_unpin_entry(hdr) < 0) HGOTO_ERROR(H5E_FARRAY, H5E_CANTUNPIN, FAIL, "unable to unpin fixed array header") } @@ -340,7 +340,7 @@ H5FA__hdr_fuse_incr(H5FA_hdr_t *hdr) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Increment file reference count on shared header */ hdr->file_rc++; @@ -369,8 +369,8 @@ H5FA__hdr_fuse_decr(H5FA_hdr_t *hdr) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(hdr); - HDassert(hdr->file_rc); + assert(hdr); + assert(hdr->file_rc); /* Decrement file reference count on shared header */ hdr->file_rc--; @@ -401,7 +401,7 @@ H5FA__hdr_modified(H5FA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Mark header as dirty in cache */ if (H5AC_mark_entry_dirty(hdr) < 0) @@ -433,11 +433,11 @@ H5FA__hdr_protect(H5F_t *f, haddr_t fa_addr, void *ctx_udata, unsigned flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(H5_addr_defined(fa_addr)); + assert(f); + assert(H5_addr_defined(fa_addr)); /* only the H5AC__READ_ONLY_FLAG is permitted */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up user data for cache callbacks */ udata.f = f; @@ -489,7 +489,7 @@ H5FA__hdr_unprotect(H5FA_hdr_t *hdr, unsigned cache_flags) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Unprotect the header */ if (H5AC_unprotect(hdr->f, H5AC_FARRAY_HDR, hdr->addr, hdr, cache_flags) < 0) @@ -521,8 +521,8 @@ H5FA__hdr_delete(H5FA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(!hdr->file_rc); + assert(hdr); + assert(!hdr->file_rc); #ifndef NDEBUG @@ -533,8 +533,8 @@ H5FA__hdr_delete(H5FA_hdr_t *hdr) HGOTO_ERROR(H5E_FARRAY, H5E_CANTGET, FAIL, "unable to check metadata cache status for array header") /* Sanity checks on array header */ - HDassert(hdr_status & H5AC_ES__IN_CACHE); - HDassert(hdr_status & H5AC_ES__IS_PROTECTED); + assert(hdr_status & H5AC_ES__IN_CACHE); + assert(hdr_status & H5AC_ES__IS_PROTECTED); #endif /* NDEBUG */ @@ -576,8 +576,8 @@ H5FA__hdr_dest(H5FA_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(hdr); - HDassert(hdr->rc == 0); + assert(hdr); + assert(hdr->rc == 0); /* Destroy the callback context */ if (hdr->cb_ctx) { diff --git a/src/H5FAint.c b/src/H5FAint.c index 1a5ab75..0c12f38 100644 --- a/src/H5FAint.c +++ b/src/H5FAint.c @@ -86,8 +86,8 @@ H5FA__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(parent_entry); - HDassert(child_entry); + assert(parent_entry); + assert(child_entry); /* Create a flush dependency between parent and child entry */ if (H5AC_create_flush_dependency(parent_entry, child_entry) < 0) @@ -117,8 +117,8 @@ H5FA__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(parent_entry); - HDassert(child_entry); + assert(parent_entry); + assert(child_entry); /* Destroy a flush dependency between parent and child entry */ if (H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) diff --git a/src/H5FAstat.c b/src/H5FAstat.c index 8238c19..a052b79 100644 --- a/src/H5FAstat.c +++ b/src/H5FAstat.c @@ -87,8 +87,8 @@ H5FA_get_stats(const H5FA_t *fa, H5FA_stat_t *stats) #endif /* H5FA_DEBUG */ /* Check arguments */ - HDassert(fa); - HDassert(stats); + assert(fa); + assert(stats); /* Copy fixed array statistics */ H5MM_memcpy(stats, &fa->hdr->stats, sizeof(fa->hdr->stats)); diff --git a/src/H5FAtest.c b/src/H5FAtest.c index d841b32..bf723a2 100644 --- a/src/H5FAtest.c +++ b/src/H5FAtest.c @@ -153,7 +153,7 @@ H5FA__test_dst_context(void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(H5FA__TEST_BOGUS_VAL == ctx->bogus); + assert(H5FA__TEST_BOGUS_VAL == ctx->bogus); /* Release context structure */ ctx = H5FL_FREE(H5FA__test_ctx_t, ctx); @@ -181,8 +181,8 @@ H5FA__test_fill(void *nat_blk, size_t nelmts) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(nat_blk); - HDassert(nelmts); + assert(nat_blk); + assert(nelmts); H5VM_array_fill(nat_blk, &fill_val, sizeof(uint64_t), nelmts); @@ -212,10 +212,10 @@ H5FA__test_encode(void *raw, const void *_elmt, size_t nelmts, void H5_ATTR_UNUS FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); - HDassert(H5FA__TEST_BOGUS_VAL == ctx->bogus); + assert(raw); + assert(elmt); + assert(nelmts); + assert(H5FA__TEST_BOGUS_VAL == ctx->bogus); /* Encode native elements into raw elements */ while (nelmts) { @@ -257,10 +257,10 @@ H5FA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_UNU FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(raw); - HDassert(elmt); - HDassert(nelmts); - HDassert(H5FA__TEST_BOGUS_VAL == ctx->bogus); + assert(raw); + assert(elmt); + assert(nelmts); + assert(H5FA__TEST_BOGUS_VAL == ctx->bogus); /* Decode raw elements into native elements */ while (nelmts) { @@ -298,8 +298,8 @@ H5FA__test_debug(FILE *stream, int indent, int fwidth, hsize_t idx, const void * FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(stream); - HDassert(elmt); + assert(stream); + assert(elmt); /* Print element */ HDsnprintf(temp_str, sizeof(temp_str), "Element #%llu:", (unsigned long long)idx); @@ -362,8 +362,8 @@ H5FA__get_cparam_test(const H5FA_t *fa, H5FA_create_t *cparam) FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(fa); - HDassert(cparam); + assert(fa); + assert(cparam); /* Get fixed array creation parameters */ cparam->raw_elmt_size = fa->hdr->cparam.raw_elmt_size; @@ -392,8 +392,8 @@ H5FA__cmp_cparam_test(const H5FA_create_t *cparam1, const H5FA_create_t *cparam2 FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(cparam1); - HDassert(cparam2); + assert(cparam1); + assert(cparam2); /* Compare creation parameters for array */ if (cparam1->raw_elmt_size < cparam2->raw_elmt_size) diff --git a/src/H5FD.c b/src/H5FD.c index dee74ee..b7612ef 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -169,7 +169,7 @@ H5FD__free_cls(H5FD_class_t *cls, void H5_ATTR_UNUSED **request) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(cls); + assert(cls); /* If the file driver has a terminate callback, call it to give the file * driver a chance to free singletons or other resources which will become @@ -265,13 +265,13 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref) FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Sanity checks */ - HDassert(cls); - HDassert(cls->open && cls->close); - HDassert(cls->get_eoa && cls->set_eoa); - HDassert(cls->get_eof); - HDassert(cls->read && cls->write); + assert(cls); + assert(cls->open && cls->close); + assert(cls->get_eoa && cls->set_eoa); + assert(cls->get_eof); + assert(cls->read && cls->write); for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; type++) { - HDassert(cls->fl_map[type] >= H5FD_MEM_NOLIST && cls->fl_map[type] < H5FD_MEM_NTYPES); + assert(cls->fl_map[type] >= H5FD_MEM_NOLIST && cls->fl_map[type] < H5FD_MEM_NTYPES); } /* Copy the class structure so the caller can reuse or free it */ @@ -449,8 +449,8 @@ H5FD_sb_size(H5FD_t *file) FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Dispatch to driver */ if (file->cls->sb_size) @@ -481,8 +481,8 @@ H5FD_sb_encode(H5FD_t *file, char *name /*out*/, uint8_t *buf) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Dispatch to driver */ if (file->cls->sb_encode && (file->cls->sb_encode)(file, name /*out*/, buf /*out*/) < 0) @@ -509,8 +509,8 @@ H5FD__sb_decode(H5FD_t *file, const char *name, const uint8_t *buf) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Dispatch to driver */ if (file->cls->sb_decode && (file->cls->sb_decode)(file, name, buf) < 0) @@ -537,8 +537,8 @@ H5FD_sb_load(H5FD_t *file, const char *name, const uint8_t *buf) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Check if driver matches driver information saved. Unfortunately, we can't push this * function to each specific driver because we're checking if the driver is correct. @@ -586,8 +586,8 @@ H5FD_fapl_get(H5FD_t *file) FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Dispatch to driver */ if (file->cls->fapl_get) @@ -757,8 +757,8 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file image info") /* If an image is provided, make sure the driver supports this feature */ - HDassert(((file_image_info.buffer != NULL) && (file_image_info.size > 0)) || - ((file_image_info.buffer == NULL) && (file_image_info.size == 0))); + assert(((file_image_info.buffer != NULL) && (file_image_info.size > 0)) || + ((file_image_info.buffer == NULL) && (file_image_info.size == 0))); if ((file_image_info.buffer != NULL) && !(driver_flags & H5FD_FEAT_ALLOW_FILE_IMAGE)) HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file image set, but not supported.") @@ -860,8 +860,8 @@ H5FD_close(H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Prepare to close file by clearing all public fields */ driver = file->cls; @@ -871,7 +871,7 @@ H5FD_close(H5FD_t *file) /* Dispatch to the driver for actual close. If the driver fails to * close the file then the file will be in an unusable state. */ - HDassert(driver->close); + assert(driver->close); if ((driver->close)(file) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "close failed") @@ -1009,9 +1009,9 @@ H5FD__query(const H5FD_t *file, unsigned long *flags /*out*/) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert(flags); + assert(file); + assert(file->cls); + assert(flags); /* Dispatch to driver (if available) */ if (file->cls->query) { @@ -1293,7 +1293,7 @@ H5FD_get_maxaddr(const H5FD_t *file) FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(file); + assert(file); /* Set return value */ ret_value = file->maxaddr; @@ -1316,8 +1316,8 @@ H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(file); - HDassert(feature_flags); + assert(file); + assert(feature_flags); /* Set feature flags to return */ *feature_flags = file->feature_flags; @@ -1340,7 +1340,7 @@ H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(file); + assert(file); /* Set the file's feature flags */ file->feature_flags = feature_flags; @@ -1365,9 +1365,9 @@ H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert(type_map); + assert(file); + assert(file->cls); + assert(type_map); /* Check for VFD class providing a type map retrieval routine */ if (file->cls->get_type_map) { @@ -1893,8 +1893,8 @@ H5FD_flush(H5FD_t *file, hbool_t closing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Dispatch to driver */ if (file->cls->flush && (file->cls->flush)(file, H5CX_get_dxpl(), closing) < 0) @@ -1959,8 +1959,8 @@ H5FD_truncate(H5FD_t *file, hbool_t closing) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Dispatch to driver */ if (file->cls->truncate && (file->cls->truncate)(file, H5CX_get_dxpl(), closing) < 0) @@ -2018,8 +2018,8 @@ H5FD_lock(H5FD_t *file, hbool_t rw) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Dispatch to driver */ if (file->cls->lock && (file->cls->lock)(file, rw) < 0) @@ -2077,8 +2077,8 @@ H5FD_unlock(H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Dispatch to driver */ if (file->cls->unlock && (file->cls->unlock)(file) < 0) @@ -2166,8 +2166,8 @@ H5FD_ctl(H5FD_t *file, uint64_t op_code, uint64_t flags, const void *input, void FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); + assert(file); + assert(file->cls); /* Dispatch to driver if the ctl function exists. * @@ -2210,8 +2210,8 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(file); - HDassert(filenum); + assert(file); + assert(filenum); /* Retrieve the file's serial number */ *filenum = file->fileno; @@ -2277,9 +2277,9 @@ H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert(file_handle); + assert(file); + assert(file->cls); + assert(file_handle); /* Dispatch to driver */ if (NULL == file->cls->get_handle) @@ -2306,8 +2306,8 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(file); - HDassert(H5_addr_defined(base_addr)); + assert(file); + assert(H5_addr_defined(base_addr)); /* Set the file's base address */ file->base_addr = base_addr; @@ -2331,7 +2331,7 @@ H5FD_get_base_addr(const H5FD_t *file) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(file); + assert(file); /* Return the file's base address */ FUNC_LEAVE_NOAPI(file->base_addr) @@ -2352,7 +2352,7 @@ H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(file); + assert(file); /* Indicate whether paged aggregation for handling file space is enabled or not */ file->paged_aggr = paged; diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 8676ef1..f8d74c8 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -224,9 +224,9 @@ H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end) FUNC_ENTER_PACKAGE - HDassert(file); - HDassert(file->dirty_list); - HDassert(start <= end); + assert(file); + assert(file->dirty_list); + assert(start <= end); /* Adjust the dirty region to the nearest block boundaries */ if (start % file->bstore_page_size != 0) @@ -323,7 +323,7 @@ H5FD__core_destroy_dirty_list(H5FD_core_t *file) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); /* Destroy the list, including any remaining list elements */ if (file->dirty_list) { @@ -361,7 +361,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); #ifndef H5_HAVE_PREADWRITE /* Seek to the correct location (if we don't have pwrite) */ @@ -407,8 +407,8 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ - HDassert(bytes_wrote > 0); - HDassert((size_t)bytes_wrote <= size); + assert(bytes_wrote > 0); + assert((size_t)bytes_wrote <= size); size -= (size_t)bytes_wrote; ptr = (unsigned char *)ptr + bytes_wrote; @@ -757,7 +757,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") if (ADDR_OVERFLOW(maxaddr)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, NULL, "maxaddr overflow") - HDassert(H5P_DEFAULT != fapl_id); + assert(H5P_DEFAULT != fapl_id); if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") if (NULL == (fa = (const H5FD_core_fapl_t *)H5P_peek_driver_info(plist))) @@ -777,8 +777,8 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get initial file image info") /* If the file image exists and this is an open, make sure the file doesn't exist */ - HDassert(((file_image_info.buffer != NULL) && (file_image_info.size > 0)) || - ((file_image_info.buffer == NULL) && (file_image_info.size == 0))); + assert(((file_image_info.buffer != NULL) && (file_image_info.size > 0)) || + ((file_image_info.buffer == NULL) && (file_image_info.size == 0))); HDmemset(&sb, 0, sizeof(sb)); if ((file_image_info.buffer != NULL) && !(H5F_ACC_CREAT & flags)) { if (HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW) >= 0) @@ -937,8 +937,8 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ - HDassert(bytes_read >= 0); - HDassert((size_t)bytes_read <= size); + assert(bytes_read >= 0); + assert((size_t)bytes_read <= size); mem += bytes_read; size -= (size_t)bytes_read; @@ -1333,8 +1333,8 @@ H5FD__core_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU FUNC_ENTER_PACKAGE - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Check for overflow conditions */ if (HADDR_UNDEF == addr) @@ -1392,8 +1392,8 @@ H5FD__core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN FUNC_ENTER_PACKAGE - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Check for overflow conditions */ if (REGION_OVERFLOW(addr, size)) @@ -1561,7 +1561,7 @@ H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); /* if we are closing and not using backing store, do nothing */ if (!closing || file->backing_store) { @@ -1662,7 +1662,7 @@ H5FD__core_lock(H5FD_t *_file, hbool_t rw) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); /* Only set the lock if there is a file descriptor. If no file * descriptor, this is a no-op. @@ -1707,7 +1707,7 @@ H5FD__core_unlock(H5FD_t *_file) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); if (file->fd >= 0) if (HDflock(file->fd, LOCK_UN) < 0) { @@ -1743,7 +1743,7 @@ H5FD__core_delete(const char *filename, hid_t fapl_id) FUNC_ENTER_PACKAGE - HDassert(filename); + assert(filename); if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index ccb8c85..d2896e6 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -349,7 +349,7 @@ H5FD__direct_populate_config(size_t boundary, size_t block_size, size_t cbuf_siz FUNC_ENTER_PACKAGE - HDassert(fa_out); + assert(fa_out); HDmemset(fa_out, 0, sizeof(H5FD_direct_fapl_t)); @@ -432,7 +432,7 @@ H5FD__direct_fapl_copy(const void *_old_fa) FUNC_ENTER_PACKAGE_NOERR - HDassert(new_fa); + assert(new_fa); /* Copy the general information */ H5MM_memcpy(new_fa, old_fa, sizeof(H5FD_direct_fapl_t)); @@ -476,7 +476,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad FUNC_ENTER_PACKAGE /* Sanity check on file offsets */ - HDassert(sizeof(HDoff_t) >= sizeof(size_t)); + assert(sizeof(HDoff_t) >= sizeof(size_t)); /* Check arguments */ if (!name || !*name) @@ -882,8 +882,8 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U FUNC_ENTER_PACKAGE - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Check for overflow conditions */ if (HADDR_UNDEF == addr) @@ -924,8 +924,8 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U HDmemset(buf, 0, size); break; } - HDassert(nbytes >= 0); - HDassert((size_t)nbytes <= size); + assert(nbytes >= 0); + assert((size_t)nbytes <= size); H5_CHECK_OVERFLOW(nbytes, ssize_t, size_t); size -= (size_t)nbytes; H5_CHECK_OVERFLOW(nbytes, ssize_t, haddr_t); @@ -943,12 +943,12 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U alloc_size = ((copy_offset + size - 1) / _fbsize + 1) * _fbsize; if (alloc_size > _cbsize) alloc_size = _cbsize; - HDassert(!(alloc_size % _fbsize)); + assert(!(alloc_size % _fbsize)); if (HDposix_memalign(©_buf, _boundary, alloc_size) != 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "HDposix_memalign failed") /* look for the aligned position for reading the data */ - HDassert(!(((addr / _fbsize) * _fbsize) % _fbsize)); + assert(!(((addr / _fbsize) * _fbsize) % _fbsize)); if (HDlseek(file->fd, (HDoff_t)((addr / _fbsize) * _fbsize), SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") @@ -972,7 +972,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U else read_size = alloc_size; - HDassert(!(read_size % _fbsize)); + assert(!(read_size % _fbsize)); do { nbytes = HDread(file->fd, copy_buf, read_size); } while (-1 == nbytes && EINTR == errno); @@ -1065,8 +1065,8 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ FUNC_ENTER_PACKAGE - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Check for overflow conditions */ if (HADDR_UNDEF == addr) @@ -1101,8 +1101,8 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ } while (-1 == nbytes && EINTR == errno); if (-1 == nbytes) /* error */ HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") - HDassert(nbytes > 0); - HDassert((size_t)nbytes <= size); + assert(nbytes > 0); + assert((size_t)nbytes <= size); H5_CHECK_OVERFLOW(nbytes, ssize_t, size_t); size -= (size_t)nbytes; H5_CHECK_OVERFLOW(nbytes, ssize_t, haddr_t); @@ -1123,7 +1123,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ alloc_size = ((copy_offset + size - 1) / _fbsize + 1) * _fbsize; if (alloc_size > _cbsize) alloc_size = _cbsize; - HDassert(!(alloc_size % _fbsize)); + assert(!(alloc_size % _fbsize)); if (HDposix_memalign(©_buf, _boundary, alloc_size) != 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "HDposix_memalign failed") @@ -1154,7 +1154,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ if (copy_offset > 0) { if ((write_addr + write_size) > (addr + size)) { - HDassert((write_addr + write_size) - (addr + size) < _fbsize); + assert((write_addr + write_size) - (addr + size) < _fbsize); read_size = write_size; p1 = copy_buf; } /* end if */ @@ -1164,12 +1164,12 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ } /* end else */ } /* end if */ else if ((write_addr + write_size) > (addr + size)) { - HDassert((write_addr + write_size) - (addr + size) < _fbsize); + assert((write_addr + write_size) - (addr + size) < _fbsize); read_size = _fbsize; p1 = (unsigned char *)copy_buf + write_size - _fbsize; /* Seek to the last block, for reading */ - HDassert(!((write_addr + write_size - _fbsize) % _fbsize)); + assert(!((write_addr + write_size - _fbsize) % _fbsize)); if (HDlseek(file->fd, (HDoff_t)(write_addr + write_size - _fbsize), SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") } /* end if */ @@ -1177,7 +1177,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ p1 = NULL; if (p1) { - HDassert(!(read_size % _fbsize)); + assert(!(read_size % _fbsize)); do { nbytes = HDread(file->fd, p1, read_size); } while (-1 == nbytes && EINTR == errno); @@ -1205,7 +1205,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ } /* end else */ /*look for the aligned position for writing the data*/ - HDassert(!(write_addr % _fbsize)); + assert(!(write_addr % _fbsize)); if (HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") @@ -1213,7 +1213,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ * Write the data. It doesn't truncate the extra data introduced by * alignment because that step is done in H5FD_direct_flush. */ - HDassert(!(write_size % _fbsize)); + assert(!(write_size % _fbsize)); do { nbytes = HDwrite(file->fd, copy_buf, write_size); } while (-1 == nbytes && EINTR == errno); @@ -1279,7 +1279,7 @@ H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_AT FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); /* Extend the file to make sure it's large enough */ if (file->eoa != file->eof) { @@ -1343,7 +1343,7 @@ H5FD__direct_lock(H5FD_t *_file, hbool_t rw) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); /* Set exclusive or shared lock based on rw status */ lock_flags = rw ? LOCK_EX : LOCK_SH; @@ -1383,7 +1383,7 @@ H5FD__direct_unlock(H5FD_t *_file) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); if (HDflock(file->fd, LOCK_UN) < 0) { if (file->ignore_disabled_file_locks && ENOSYS == errno) { @@ -1416,7 +1416,7 @@ H5FD__direct_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id) FUNC_ENTER_PACKAGE - HDassert(filename); + assert(filename); if (HDremove(filename) < 0) HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file") diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 9a01e7f..01a4511 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -172,7 +172,7 @@ H5FD__family_get_default_config(H5FD_family_fapl_t *fa_out) FUNC_ENTER_PACKAGE - HDassert(fa_out); + assert(fa_out); fa_out->memb_size = H5FD_FAM_DEF_MEM_SIZE; @@ -226,7 +226,7 @@ H5FD__family_get_default_printf_filename(const char *old_filename) FUNC_ENTER_PACKAGE - HDassert(old_filename); + assert(old_filename); old_filename_len = HDstrlen(old_filename); if (0 == old_filename_len) @@ -796,7 +796,7 @@ H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad unsigned n = MAX(64, 2 * file->amembs); H5FD_t **x; - HDassert(n > 0); + assert(n > 0); if (NULL == (x = (H5FD_t **)H5MM_realloc(file->memb, n * sizeof(H5FD_t *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to reallocate members") file->amembs = n; @@ -942,8 +942,8 @@ H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) FUNC_ENTER_PACKAGE_NOERR - HDassert(f1->nmembs >= 1 && f1->memb[0]); - HDassert(f2->nmembs >= 1 && f2->memb[0]); + assert(f1->nmembs >= 1 && f1->memb[0]); + assert(f2->nmembs >= 1 && f2->memb[0]); ret_value = H5FDcmp(f1->memb[0], f2->memb[0]); @@ -1137,7 +1137,7 @@ H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type) * with `i' equal to that member. If all members have zero EOF then exit * loop with i==0. */ - HDassert(file->nmembs > 0); + assert(file->nmembs > 0); for (i = (int)file->nmembs - 1; i >= 0; --i) { if ((eof = H5FD_get_eof(file->memb[i], type)) != 0) break; @@ -1252,7 +1252,7 @@ H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s tempreq = SIZE_MAX; req = MIN(size, (size_t)tempreq); - HDassert(u < file->nmembs); + assert(u < file->nmembs); if (H5FDread(file->memb[u], type, dxpl_id, sub, req, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "member file read failed") @@ -1317,7 +1317,7 @@ H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, tempreq = SIZE_MAX; req = MIN(size, (size_t)tempreq); - HDassert(u < file->nmembs); + assert(u < file->nmembs); if (H5FDwrite(file->memb[u], type, dxpl_id, sub, req, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "member file write failed") @@ -1500,7 +1500,7 @@ H5FD__family_delete(const char *filename, hid_t fapl_id) FUNC_ENTER_PACKAGE - HDassert(filename); + assert(filename); /* Get the driver info (for the member fapl) * The family_open call accepts H5P_DEFAULT, so we'll accept that here, too. diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 4b1a64f..b461bd4 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -469,7 +469,7 @@ H5FD__hdfs_handle_open(const char *path, const char *namenode_name, const int32_ done: if (ret_value == NULL && handle != NULL) { /* error; clean up */ - HDassert(handle->magic == HDFS_HDFST_MAGIC); + assert(handle->magic == HDFS_HDFST_MAGIC); handle->magic++; if (handle->file != NULL) if (FAIL == (hdfsCloseFile(handle->filesystem, handle->file))) @@ -558,7 +558,7 @@ H5FD__hdfs_validate_config(const H5FD_hdfs_fapl_t *fa) FUNC_ENTER_PACKAGE - HDassert(fa != NULL); + assert(fa != NULL); if (fa->version != H5FD__CURR_HDFS_FAPL_T_VERSION) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_hdfs_fapl_t version"); @@ -595,7 +595,7 @@ H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*#", fapl_id, fa); - HDassert(fa != NULL); + assert(fa != NULL); #if HDFS_DEBUG HDfprintf(stdout, "called %s.\n", __func__); @@ -758,7 +758,7 @@ H5FD__hdfs_fapl_free(void *_fa) FUNC_ENTER_PACKAGE_NOERR - HDassert(fa != NULL); /* sanity check */ + assert(fa != NULL); /* sanity check */ H5MM_xfree(fa); @@ -879,7 +879,7 @@ H5FD__hdfs_open(const char *path, unsigned flags, hid_t fapl_id, haddr_t maxaddr if (handle == NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, NULL, "could not open") - HDassert(handle->magic == HDFS_HDFST_MAGIC); + assert(handle->magic == HDFS_HDFST_MAGIC); /* Create new file struct */ file = H5FL_CALLOC(H5FD_hdfs_t); @@ -1045,7 +1045,7 @@ hdfs__fprint_stats(FILE *stream, const H5FD_hdfs_t *file) re_dub = (double)min_meta; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); } @@ -1055,7 +1055,7 @@ hdfs__fprint_stats(FILE *stream, const H5FD_hdfs_t *file) re_dub = (double)min_raw; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); } @@ -1063,26 +1063,26 @@ hdfs__fprint_stats(FILE *stream, const H5FD_hdfs_t *file) re_dub = (double)average_meta; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)average_raw; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); HDfprintf(stream, " max "); re_dub = (double)max_meta; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)max_raw; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); /****************************** @@ -1122,33 +1122,33 @@ hdfs__fprint_stats(FILE *stream, const H5FD_hdfs_t *file) bm_val = (double)m->bytes; for (suffix_i = 0; bm_val >= 1024.0; suffix_i++) bm_val /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); bm_suffix = suffixes[suffix_i]; br_val = (double)r->bytes; for (suffix_i = 0; br_val >= 1024.0; suffix_i++) br_val /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); br_suffix = suffixes[suffix_i]; if (m->count > 0) am_val = (double)(m->bytes) / (double)(m->count); for (suffix_i = 0; am_val >= 1024.0; suffix_i++) am_val /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); am_suffix = suffixes[suffix_i]; if (r->count > 0) ar_val = (double)(r->bytes) / (double)(r->count); for (suffix_i = 0; ar_val >= 1024.0; suffix_i++) ar_val /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); ar_suffix = suffixes[suffix_i]; re_dub = (double)range_end; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub, suffixes[suffix_i], /* bin ceiling */ @@ -1196,9 +1196,9 @@ H5FD__hdfs_close(H5FD_t *_file) #endif /* Sanity checks */ - HDassert(file != NULL); - HDassert(file->hdfs_handle != NULL); - HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); + assert(file != NULL); + assert(file->hdfs_handle != NULL); + assert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); /* Close the underlying request handle */ if (file->hdfs_handle != NULL) @@ -1251,15 +1251,15 @@ H5FD__hdfs_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HDfprintf(stdout, "called %s.\n", __func__); #endif /* HDFS_DEBUG */ - HDassert(f1->hdfs_handle != NULL); - HDassert(f2->hdfs_handle != NULL); - HDassert(f1->hdfs_handle->magic == HDFS_HDFST_MAGIC); - HDassert(f2->hdfs_handle->magic == HDFS_HDFST_MAGIC); + assert(f1->hdfs_handle != NULL); + assert(f2->hdfs_handle != NULL); + assert(f1->hdfs_handle->magic == HDFS_HDFST_MAGIC); + assert(f2->hdfs_handle->magic == HDFS_HDFST_MAGIC); finfo1 = f1->hdfs_handle->fileinfo; finfo2 = f2->hdfs_handle->fileinfo; - HDassert(finfo1 != NULL); - HDassert(finfo2 != NULL); + assert(finfo1 != NULL); + assert(finfo2 != NULL); if (finfo1->mKind != finfo2->mKind) { HGOTO_DONE(-1); @@ -1427,8 +1427,8 @@ H5FD__hdfs_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) HDfprintf(stdout, "called %s.\n", __func__); #endif - HDassert(file->hdfs_handle != NULL); - HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); + assert(file->hdfs_handle != NULL); + assert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); FUNC_LEAVE_NOAPI((size_t)file->hdfs_handle->fileinfo->mSize) } /* end H5FD__hdfs_get_eof() */ @@ -1512,10 +1512,10 @@ H5FD__hdfs_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU HDfprintf(stdout, "called %s.\n", __func__); #endif /* HDFS_DEBUG */ - HDassert(file != NULL); - HDassert(file->hdfs_handle != NULL); - HDassert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); - HDassert(buf != NULL); + assert(file != NULL); + assert(file->hdfs_handle != NULL); + assert(file->hdfs_handle->magic == HDFS_HDFST_MAGIC); + assert(buf != NULL); filesize = (size_t)file->hdfs_handle->fileinfo->mSize; diff --git a/src/H5FDint.c b/src/H5FDint.c index b0fe040..b10c386 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -156,8 +156,8 @@ H5FD_locate_signature(H5FD_t *file, haddr_t *sig_addr) FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ - HDassert(file); - HDassert(sig_addr); + assert(file); + assert(sig_addr); /* Find the least N such that 2^N is larger than the file size */ eof = H5FD_get_eof(file, H5FD_MEM_SUPER); @@ -216,9 +216,9 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, void *buf /* FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert(buf); + assert(file); + assert(file->cls); + assert(buf); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); @@ -278,9 +278,9 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, haddr_t addr, size_t size, const void FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert(buf); + assert(file); + assert(file->cls); + assert(buf); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); @@ -365,18 +365,18 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert((types) || (count == 0)); - HDassert((addrs) || (count == 0)); - HDassert((sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(file->cls); + assert((types) || (count == 0)); + assert((addrs) || (count == 0)); + assert((sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* verify that the first elements of the sizes and types arrays are * valid. */ - HDassert((count == 0) || (sizes[0] != 0)); - HDassert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); + assert((count == 0) || (sizes[0] != 0)); + assert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); @@ -518,7 +518,7 @@ done: /* undo the base addr offset to the addrs array if necessary */ if (addrs_cooked) { - HDassert(file->base_addr > 0); + assert(file->base_addr > 0); for (i = 0; i < count; i++) { @@ -582,18 +582,18 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert((types) || (count == 0)); - HDassert((addrs) || (count == 0)); - HDassert((sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(file->cls); + assert((types) || (count == 0)); + assert((addrs) || (count == 0)); + assert((sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* verify that the first elements of the sizes and types arrays are * valid. */ - HDassert((count == 0) || (sizes[0] != 0)); - HDassert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); + assert((count == 0) || (sizes[0] != 0)); + assert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); @@ -724,7 +724,7 @@ done: /* undo the base addr offset to the addrs array if necessary */ if (addrs_cooked) { - HDassert(file->base_addr > 0); + assert(file->base_addr > 0); for (i = 0; i < count; i++) { @@ -794,13 +794,13 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert((mem_spaces) || (count == 0)); - HDassert((file_spaces) || (count == 0)); - HDassert((offsets) || (count == 0)); - HDassert((element_sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(file->cls); + assert((mem_spaces) || (count == 0)); + assert((file_spaces) || (count == 0)); + assert((offsets) || (count == 0)); + assert((element_sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* Check if we're using vector I/O */ use_vector = file->cls->read_vector != NULL; @@ -808,8 +808,8 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin if (count > 0) { /* Verify that the first elements of the element_sizes and bufs arrays are * valid. */ - HDassert(element_sizes[0] != 0); - HDassert(bufs[0] != NULL); + assert(element_sizes[0] != 0); + assert(bufs[0] != NULL); /* Allocate sequence lists for memory and file spaces */ if (NULL == (file_iter = H5FL_MALLOC(H5S_sel_iter_t))) @@ -868,7 +868,7 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin { if ((hss_nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(mem_spaces[i])) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCOUNT, FAIL, "can't get number of elements selected") - HDassert((hssize_t)nelmts == hss_nelmts); + assert((hssize_t)nelmts == hss_nelmts); } #endif /* NDEBUG */ @@ -886,23 +886,23 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin if (H5S_SELECT_ITER_GET_SEQ_LIST(file_iter, H5FD_SEQ_LIST_LEN, SIZE_MAX, &file_nseq, &seq_nelem, file_off, file_len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") - HDassert(file_nseq > 0); + assert(file_nseq > 0); nelmts -= seq_nelem; file_seq_i = 0; } - HDassert(file_seq_i < file_nseq); + assert(file_seq_i < file_nseq); /* Fill/refill memory sequence list if necessary */ if (mem_seq_i == H5FD_SEQ_LIST_LEN) { if (H5S_SELECT_ITER_GET_SEQ_LIST(mem_iter, H5FD_SEQ_LIST_LEN, SIZE_MAX, &mem_nseq, &seq_nelem, mem_off, mem_len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") - HDassert(mem_nseq > 0); + assert(mem_nseq > 0); mem_seq_i = 0; } - HDassert(mem_seq_i < mem_nseq); + assert(mem_seq_i < mem_nseq); /* Calculate length of this IO */ io_len = MIN(file_len[file_seq_i], mem_len[mem_seq_i]); @@ -913,8 +913,8 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin if (vec_arr_nused == vec_arr_nalloc) { /* Check if we're using the static arrays */ if (addrs == addrs_local) { - HDassert(sizes == sizes_local); - HDassert(vec_bufs == vec_bufs_local); + assert(sizes == sizes_local); + assert(vec_bufs == vec_bufs_local); /* Allocate dynamic arrays */ if (NULL == (addrs = H5MM_malloc(sizeof(addrs_local) * 2))) @@ -1037,9 +1037,9 @@ done: } /* Make sure we cleaned up */ - HDassert(!addrs || addrs == addrs_local); - HDassert(!sizes || sizes == sizes_local); - HDassert(!vec_bufs || vec_bufs == vec_bufs_local); + assert(!addrs || addrs == addrs_local); + assert(!sizes || sizes == sizes_local); + assert(!vec_bufs || vec_bufs == vec_bufs_local); FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__read_selection_translate() */ @@ -1100,18 +1100,18 @@ H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_s FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert((mem_spaces) || (count == 0)); - HDassert((file_spaces) || (count == 0)); - HDassert((offsets) || (count == 0)); - HDassert((element_sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(file->cls); + assert((mem_spaces) || (count == 0)); + assert((file_spaces) || (count == 0)); + assert((offsets) || (count == 0)); + assert((element_sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* Verify that the first elements of the element_sizes and bufs arrays are * valid. */ - HDassert((count == 0) || (element_sizes[0] != 0)); - HDassert((count == 0) || (bufs[0] != NULL)); + assert((count == 0) || (element_sizes[0] != 0)); + assert((count == 0) || (bufs[0] != NULL)); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); @@ -1204,7 +1204,7 @@ done: /* undo the base addr offset to the offsets array if necessary */ if (offsets_cooked) { - HDassert(file->base_addr > 0); + assert(file->base_addr > 0); for (i = 0; i < count; i++) { @@ -1264,18 +1264,18 @@ H5FD_read_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert((mem_space_ids) || (count == 0)); - HDassert((file_space_ids) || (count == 0)); - HDassert((offsets) || (count == 0)); - HDassert((element_sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(file->cls); + assert((mem_space_ids) || (count == 0)); + assert((file_space_ids) || (count == 0)); + assert((offsets) || (count == 0)); + assert((element_sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* Verify that the first elements of the element_sizes and bufs arrays are * valid. */ - HDassert((count == 0) || (element_sizes[0] != 0)); - HDassert((count == 0) || (bufs[0] != NULL)); + assert((count == 0) || (element_sizes[0] != 0)); + assert((count == 0) || (bufs[0] != NULL)); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); @@ -1366,7 +1366,7 @@ done: /* undo the base addr offset to the offsets array if necessary */ if (offsets_cooked) { - HDassert(file->base_addr > 0); + assert(file->base_addr > 0); for (i = 0; i < count; i++) { @@ -1441,13 +1441,13 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert((mem_spaces) || (count == 0)); - HDassert((file_spaces) || (count == 0)); - HDassert((offsets) || (count == 0)); - HDassert((element_sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(file->cls); + assert((mem_spaces) || (count == 0)); + assert((file_spaces) || (count == 0)); + assert((offsets) || (count == 0)); + assert((element_sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* Check if we're using vector I/O */ use_vector = file->cls->write_vector != NULL; @@ -1455,8 +1455,8 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui if (count > 0) { /* Verify that the first elements of the element_sizes and bufs arrays are * valid. */ - HDassert(element_sizes[0] != 0); - HDassert(bufs[0] != NULL); + assert(element_sizes[0] != 0); + assert(bufs[0] != NULL); /* Allocate sequence lists for memory and file spaces */ if (NULL == (file_iter = H5FL_MALLOC(H5S_sel_iter_t))) @@ -1515,7 +1515,7 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui { if ((hss_nelmts = (hssize_t)H5S_GET_SELECT_NPOINTS(mem_spaces[i])) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTCOUNT, FAIL, "can't get number of elements selected") - HDassert((hssize_t)nelmts == hss_nelmts); + assert((hssize_t)nelmts == hss_nelmts); } #endif /* NDEBUG */ @@ -1533,23 +1533,23 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui if (H5S_SELECT_ITER_GET_SEQ_LIST(file_iter, H5FD_SEQ_LIST_LEN, SIZE_MAX, &file_nseq, &seq_nelem, file_off, file_len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") - HDassert(file_nseq > 0); + assert(file_nseq > 0); nelmts -= seq_nelem; file_seq_i = 0; } - HDassert(file_seq_i < file_nseq); + assert(file_seq_i < file_nseq); /* Fill/refill memory sequence list if necessary */ if (mem_seq_i == H5FD_SEQ_LIST_LEN) { if (H5S_SELECT_ITER_GET_SEQ_LIST(mem_iter, H5FD_SEQ_LIST_LEN, SIZE_MAX, &mem_nseq, &seq_nelem, mem_off, mem_len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") - HDassert(mem_nseq > 0); + assert(mem_nseq > 0); mem_seq_i = 0; } - HDassert(mem_seq_i < mem_nseq); + assert(mem_seq_i < mem_nseq); /* Calculate length of this IO */ io_len = MIN(file_len[file_seq_i], mem_len[mem_seq_i]); @@ -1560,8 +1560,8 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui if (vec_arr_nused == vec_arr_nalloc) { /* Check if we're using the static arrays */ if (addrs == addrs_local) { - HDassert(sizes == sizes_local); - HDassert(vec_bufs == vec_bufs_local); + assert(sizes == sizes_local); + assert(vec_bufs == vec_bufs_local); /* Allocate dynamic arrays */ if (NULL == (addrs = H5MM_malloc(sizeof(addrs_local) * 2))) @@ -1684,9 +1684,9 @@ done: } /* Make sure we cleaned up */ - HDassert(!addrs || addrs == addrs_local); - HDassert(!sizes || sizes == sizes_local); - HDassert(!vec_bufs || vec_bufs == vec_bufs_local); + assert(!addrs || addrs == addrs_local); + assert(!sizes || sizes == sizes_local); + assert(!vec_bufs || vec_bufs == vec_bufs_local); FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__write_selection_translate() */ @@ -1745,18 +1745,18 @@ H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, H5S_t **mem_ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert((mem_spaces) || (count == 0)); - HDassert((file_spaces) || (count == 0)); - HDassert((offsets) || (count == 0)); - HDassert((element_sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(file->cls); + assert((mem_spaces) || (count == 0)); + assert((file_spaces) || (count == 0)); + assert((offsets) || (count == 0)); + assert((element_sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* Verify that the first elements of the element_sizes and bufs arrays are * valid. */ - HDassert((count == 0) || (element_sizes[0] != 0)); - HDassert((count == 0) || (bufs[0] != NULL)); + assert((count == 0) || (element_sizes[0] != 0)); + assert((count == 0) || (bufs[0] != NULL)); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); @@ -1843,7 +1843,7 @@ done: /* undo the base addr offset to the offsets array if necessary */ if (offsets_cooked) { - HDassert(file->base_addr > 0); + assert(file->base_addr > 0); for (i = 0; i < count; i++) { @@ -1900,18 +1900,18 @@ H5FD_write_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(file->cls); - HDassert((mem_space_ids) || (count == 0)); - HDassert((file_space_ids) || (count == 0)); - HDassert((offsets) || (count == 0)); - HDassert((element_sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(file->cls); + assert((mem_space_ids) || (count == 0)); + assert((file_space_ids) || (count == 0)); + assert((offsets) || (count == 0)); + assert((element_sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* Verify that the first elements of the element_sizes and bufs arrays are * valid. */ - HDassert((count == 0) || (element_sizes[0] != 0)); - HDassert((count == 0) || (bufs[0] != NULL)); + assert((count == 0) || (element_sizes[0] != 0)); + assert((count == 0) || (bufs[0] != NULL)); /* Get proper DXPL for I/O */ dxpl_id = H5CX_get_dxpl(); @@ -1996,7 +1996,7 @@ done: /* undo the base addr offset to the offsets array if necessary */ if (offsets_cooked) { - HDassert(file->base_addr > 0); + assert(file->base_addr > 0); for (i = 0; i < count; i++) { @@ -2034,8 +2034,8 @@ H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr) FUNC_ENTER_NOAPI(FAIL) - HDassert(file && file->cls); - HDassert(H5_addr_defined(addr) && addr <= file->maxaddr); + assert(file && file->cls); + assert(H5_addr_defined(addr) && addr <= file->maxaddr); /* Dispatch to driver, convert to absolute address */ if ((file->cls->set_eoa)(file, type, addr + file->base_addr) < 0) @@ -2068,7 +2068,7 @@ H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type) FUNC_ENTER_NOAPI(HADDR_UNDEF) - HDassert(file && file->cls); + assert(file && file->cls); /* Dispatch to driver */ if (HADDR_UNDEF == (ret_value = (file->cls->get_eoa)(file, type))) @@ -2104,7 +2104,7 @@ H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type) FUNC_ENTER_NOAPI(HADDR_UNDEF) - HDassert(file && file->cls); + assert(file && file->cls); /* Dispatch to driver */ if (file->cls->get_eof) { @@ -2140,8 +2140,8 @@ H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags /*out*/) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(driver); - HDassert(flags); + assert(driver); + assert(flags); /* Check for the driver to query and then query it */ if (driver->query) @@ -2194,8 +2194,8 @@ H5FD__vsrt_tmp_cmp(const void *element_1, const void *element_2) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(H5_addr_defined(addr_1)); - HDassert(H5_addr_defined(addr_2)); + assert(H5_addr_defined(addr_1)); + assert(H5_addr_defined(addr_2)); /* Compare the addresses */ if (H5_addr_gt(addr_1, addr_2)) @@ -2220,27 +2220,27 @@ H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t /* Sanity checks */ - HDassert(vector_was_sorted); + assert(vector_was_sorted); - HDassert((types) || (count == 0)); - HDassert((addrs) || (count == 0)); - HDassert((sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert((types) || (count == 0)); + assert((addrs) || (count == 0)); + assert((sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* verify that the first elements of the sizes and types arrays are * valid. */ - HDassert((count == 0) || (sizes[0] != 0)); - HDassert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); + assert((count == 0) || (sizes[0] != 0)); + assert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); - HDassert((count == 0) || ((s_types_ptr) && (NULL == *s_types_ptr))); - HDassert((count == 0) || ((s_addrs_ptr) && (NULL == *s_addrs_ptr))); - HDassert((count == 0) || ((s_sizes_ptr) && (NULL == *s_sizes_ptr))); - HDassert((count == 0) || ((s_bufs_ptr) && (NULL == *s_bufs_ptr))); + assert((count == 0) || ((s_types_ptr) && (NULL == *s_types_ptr))); + assert((count == 0) || ((s_addrs_ptr) && (NULL == *s_addrs_ptr))); + assert((count == 0) || ((s_sizes_ptr) && (NULL == *s_sizes_ptr))); + assert((count == 0) || ((s_bufs_ptr) && (NULL == *s_bufs_ptr))); /* scan the addrs array to see if it is sorted */ for (i = 1; i < count; i++) { - HDassert(H5_addr_defined(addrs[i - 1])); + assert(H5_addr_defined(addrs[i - 1])); if (H5_addr_gt(addrs[i - 1], addrs[i])) break; @@ -2299,7 +2299,7 @@ H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t i = 1; for (i = 1; i < count; i++) { - HDassert(H5_addr_lt(srt_tmp[i - 1].addr, srt_tmp[i].addr)); + assert(H5_addr_lt(srt_tmp[i - 1].addr, srt_tmp[i].addr)); if (H5_addr_eq(addrs[i - 1], addrs[i])) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "duplicate addr in vector") @@ -2314,8 +2314,8 @@ H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sorted vector(s)") } - HDassert(sizes[0] != 0); - HDassert(types[0] != H5FD_MEM_NOLIST); + assert(sizes[0] != 0); + assert(types[0] != H5FD_MEM_NOLIST); /* Scan the sizes and types vectors to determine if the fixed size / type * optimization is in use, and if so, to determine the index of the last @@ -2330,8 +2330,8 @@ H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t fixed_type_index = i - 1; } - HDassert(fixed_size_index <= count); - HDassert(fixed_type_index <= count); + assert(fixed_size_index <= count); + assert(fixed_type_index <= count); /* Populate the sorted vectors. Note that the index stored in srt_tmp * refers to the index in the unsorted array, while the position of @@ -2413,7 +2413,7 @@ H5FD_delete(const char *filename, hid_t fapl_id) /* Sanity checks */ - HDassert(filename); + assert(filename); /* Get file access property list */ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -2462,9 +2462,9 @@ H5FD_check_plugin_load(const H5FD_class_t *cls, const H5PL_key_t *key, hbool_t * FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(cls); - HDassert(key); - HDassert(success); + assert(cls); + assert(key); + assert(success); /* Which kind of key are we looking for? */ if (key->vfd.kind == H5FD_GET_DRIVER_BY_NAME) { @@ -2474,7 +2474,7 @@ H5FD_check_plugin_load(const H5FD_class_t *cls, const H5PL_key_t *key, hbool_t * } else { /* Sanity check */ - HDassert(key->vfd.kind == H5FD_GET_DRIVER_BY_VALUE); + assert(key->vfd.kind == H5FD_GET_DRIVER_BY_VALUE); /* Check if plugin value matches VFD class value */ if (cls->value == key->vfd.u.value) @@ -2511,7 +2511,7 @@ H5FD__get_driver_cb(void *obj, hid_t id, void *_op_data) } /* end if */ } /* end if */ else { - HDassert(H5FD_GET_DRIVER_BY_VALUE == op_data->key.kind); + assert(H5FD_GET_DRIVER_BY_VALUE == op_data->key.kind); if (cls->value == op_data->key.u.value) { op_data->found_id = id; ret_value = H5_ITER_STOP; @@ -2549,7 +2549,7 @@ H5FD_register_driver_by_name(const char *name, hbool_t app_ref) /* If driver is already registered, increment ref count on ID and return ID */ if (driver_is_registered) { - HDassert(driver_id >= 0); + assert(driver_id >= 0); if (H5I_inc_ref(driver_id, app_ref) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VFD") @@ -2603,7 +2603,7 @@ H5FD_register_driver_by_value(H5FD_class_value_t value, hbool_t app_ref) /* If driver is already registered, increment ref count on ID and return ID */ if (driver_is_registered) { - HDassert(driver_id >= 0); + assert(driver_id >= 0); if (H5I_inc_ref(driver_id, app_ref) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, H5I_INVALID_HID, "unable to increment ref count on VFD") diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 610b8b1..e7bde20 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -393,7 +393,7 @@ H5FD__log_fapl_copy(const void *_old_fa) FUNC_ENTER_PACKAGE - HDassert(old_fa); + assert(old_fa); /* Allocate the new FAPL info */ if (NULL == (new_fa = (H5FD_log_fapl_t *)H5MM_calloc(sizeof(H5FD_log_fapl_t)))) @@ -586,15 +586,15 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) file->iosize = fa->buf_size; if (file->fa.flags & H5FD_LOG_FILE_READ) { file->nread = (unsigned char *)H5MM_calloc(file->iosize); - HDassert(file->nread); + assert(file->nread); } if (file->fa.flags & H5FD_LOG_FILE_WRITE) { file->nwrite = (unsigned char *)H5MM_calloc(file->iosize); - HDassert(file->nwrite); + assert(file->nwrite); } if (file->fa.flags & H5FD_LOG_FLAVOR) { file->flavor = (unsigned char *)H5MM_calloc(file->iosize); - HDassert(file->flavor); + assert(file->flavor); } /* Set the log file pointer */ @@ -677,7 +677,7 @@ H5FD__log_close(H5FD_t *_file) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(file); + assert(file); /* Initialize timer */ H5_timer_init(&close_timer); @@ -950,7 +950,7 @@ H5FD__log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hs /* Retain the (first) flavor of the information written to the file */ if (file->fa.flags != 0) { if (file->fa.flags & H5FD_LOG_FLAVOR) { - HDassert(addr < file->iosize); + assert(addr < file->iosize); H5_CHECK_OVERFLOW(size, hsize_t, size_t); HDmemset(&file->flavor[addr], (int)type, (size_t)size); } @@ -989,7 +989,7 @@ H5FD__log_free(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had if (file->fa.flags != 0) { /* Reset the flavor of the information in the file */ if (file->fa.flags & H5FD_LOG_FLAVOR) { - HDassert(addr < file->iosize); + assert(addr < file->iosize); H5_CHECK_OVERFLOW(size, hsize_t, size_t); HDmemset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size); } @@ -1056,7 +1056,7 @@ H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) /* Retain the flavor of the space allocated by the extension */ if (file->fa.flags & H5FD_LOG_FLAVOR) { - HDassert(addr < file->iosize); + assert(addr < file->iosize); H5_CHECK_OVERFLOW(size, hsize_t, size_t); HDmemset(&file->flavor[file->eoa], (int)type, (size_t)size); } @@ -1074,7 +1074,7 @@ H5FD__log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) /* Reset the flavor of the space freed by the shrink */ if (file->fa.flags & H5FD_LOG_FLAVOR) { - HDassert((addr + size) < file->iosize); + assert((addr + size) < file->iosize); H5_CHECK_OVERFLOW(size, hsize_t, size_t); HDmemset(&file->flavor[addr], H5FD_MEM_DEFAULT, (size_t)size); } @@ -1178,8 +1178,8 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had FUNC_ENTER_PACKAGE - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Initialize timer */ H5_timer_init(&read_timer); @@ -1197,7 +1197,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had /* Log information about the number of times these locations are read */ if (file->fa.flags & H5FD_LOG_FILE_READ) { - HDassert((addr + size) < file->iosize); + assert((addr + size) < file->iosize); while (tmp_size-- > 0) file->nread[tmp_addr++]++; } @@ -1304,8 +1304,8 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had break; } - HDassert(bytes_read >= 0); - HDassert((size_t)bytes_read <= size); + assert(bytes_read >= 0); + assert((size_t)bytes_read <= size); size -= (size_t)bytes_read; addr += (haddr_t)bytes_read; @@ -1333,11 +1333,11 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had /* Verify that we are reading in the type of data we allocated in this location */ if (file->flavor) { - HDassert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[orig_addr] || - (H5FD_mem_t)file->flavor[orig_addr] == H5FD_MEM_DEFAULT); - HDassert(type == H5FD_MEM_DEFAULT || - type == (H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] || - (H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] == H5FD_MEM_DEFAULT); + assert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[orig_addr] || + (H5FD_mem_t)file->flavor[orig_addr] == H5FD_MEM_DEFAULT); + assert(type == H5FD_MEM_DEFAULT || + type == (H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] || + (H5FD_mem_t)file->flavor[(orig_addr + orig_size) - 1] == H5FD_MEM_DEFAULT); } /* Add the read time, if we're tracking that. @@ -1392,19 +1392,19 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha FUNC_ENTER_PACKAGE - HDassert(file && file->pub.cls); - HDassert(size > 0); - HDassert(buf); + assert(file && file->pub.cls); + assert(size > 0); + assert(buf); /* Initialize timer */ H5_timer_init(&write_timer); /* Verify that we are writing out the type of data we allocated in this location */ if (file->flavor) { - HDassert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[addr] || - (H5FD_mem_t)file->flavor[addr] == H5FD_MEM_DEFAULT); - HDassert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[(addr + size) - 1] || - (H5FD_mem_t)file->flavor[(addr + size) - 1] == H5FD_MEM_DEFAULT); + assert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[addr] || + (H5FD_mem_t)file->flavor[addr] == H5FD_MEM_DEFAULT); + assert(type == H5FD_MEM_DEFAULT || type == (H5FD_mem_t)file->flavor[(addr + size) - 1] || + (H5FD_mem_t)file->flavor[(addr + size) - 1] == H5FD_MEM_DEFAULT); } /* Check for overflow conditions */ @@ -1420,7 +1420,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha haddr_t tmp_addr = addr; /* Log information about the number of times these locations are read */ - HDassert((addr + size) < file->iosize); + assert((addr + size) < file->iosize); while (tmp_size-- > 0) file->nwrite[tmp_addr++]++; } @@ -1520,8 +1520,8 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ - HDassert(bytes_wrote > 0); - HDassert((size_t)bytes_wrote <= size); + assert(bytes_wrote > 0); + assert((size_t)bytes_wrote <= size); size -= (size_t)bytes_wrote; addr += (haddr_t)bytes_wrote; @@ -1603,7 +1603,7 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); /* Extend the file to make sure it's large enough */ if (!H5_addr_eq(file->eoa, file->eof)) { @@ -1712,7 +1712,7 @@ H5FD__log_lock(H5FD_t *_file, hbool_t rw) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(file); + assert(file); /* Set exclusive or shared lock based on rw status */ lock_flags = rw ? LOCK_EX : LOCK_SH; @@ -1752,7 +1752,7 @@ H5FD__log_unlock(H5FD_t *_file) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); if (HDflock(file->fd, LOCK_UN) < 0) { if (file->ignore_disabled_file_locks && ENOSYS == errno) { @@ -1785,7 +1785,7 @@ H5FD__log_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id) FUNC_ENTER_PACKAGE - HDassert(filename); + assert(filename); if (HDremove(filename) < 0) HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file") diff --git a/src/H5FDmirror.c b/src/H5FDmirror.c index 4df0d43..25992e8 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -282,7 +282,7 @@ H5FD__mirror_xmit_decode_uint16(uint16_t *out, const unsigned char *_buf) LOG_OP_CALL(__func__); - HDassert(_buf && out); + assert(_buf && out); H5MM_memcpy(&n, _buf, sizeof(n)); *out = (uint16_t)ntohs(n); @@ -310,7 +310,7 @@ H5FD__mirror_xmit_decode_uint32(uint32_t *out, const unsigned char *_buf) LOG_OP_CALL(__func__); - HDassert(_buf && out); + assert(_buf && out); H5MM_memcpy(&n, _buf, sizeof(n)); *out = (uint32_t)ntohl(n); @@ -369,7 +369,7 @@ H5FD__mirror_xmit_decode_uint64(uint64_t *out, const unsigned char *_buf) LOG_OP_CALL(__func__); - HDassert(_buf && out); + assert(_buf && out); H5MM_memcpy(&n, _buf, sizeof(n)); if (TRUE == is_host_little_endian()) @@ -396,7 +396,7 @@ H5FD__mirror_xmit_decode_uint8(uint8_t *out, const unsigned char *_buf) { LOG_OP_CALL(__func__); - HDassert(_buf && out); + assert(_buf && out); H5MM_memcpy(out, _buf, sizeof(uint8_t)); @@ -422,7 +422,7 @@ H5FD__mirror_xmit_encode_uint16(unsigned char *_dest, uint16_t v) LOG_OP_CALL(__func__); - HDassert(_dest); + assert(_dest); n = (uint16_t)htons(v); H5MM_memcpy(_dest, &n, sizeof(n)); @@ -449,7 +449,7 @@ H5FD__mirror_xmit_encode_uint32(unsigned char *_dest, uint32_t v) LOG_OP_CALL(__func__); - HDassert(_dest); + assert(_dest); n = (uint32_t)htonl(v); H5MM_memcpy(_dest, &n, sizeof(n)); @@ -476,7 +476,7 @@ H5FD__mirror_xmit_encode_uint64(unsigned char *_dest, uint64_t v) LOG_OP_CALL(__func__); - HDassert(_dest); + assert(_dest); if (TRUE == is_host_little_endian()) n = BSWAP_64(v); @@ -503,7 +503,7 @@ H5FD__mirror_xmit_encode_uint8(unsigned char *dest, uint8_t v) { LOG_OP_CALL(__func__); - HDassert(dest); + assert(dest); H5MM_memcpy(dest, &v, sizeof(v)); @@ -536,14 +536,14 @@ H5FD_mirror_xmit_decode_header(H5FD_mirror_xmit_t *out, const unsigned char *buf LOG_OP_CALL(__func__); - HDassert(out && buf); + assert(out && buf); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->magic), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->version), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->session_token), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->xmit_count), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->op), &buf[n_eaten]); - HDassert(n_eaten == H5FD_MIRROR_XMIT_HEADER_SIZE); + assert(n_eaten == H5FD_MIRROR_XMIT_HEADER_SIZE); return n_eaten; } /* end H5FD_mirror_xmit_decode_header() */ @@ -574,11 +574,11 @@ H5FD_mirror_xmit_decode_lock(H5FD_mirror_xmit_lock_t *out, const unsigned char * LOG_OP_CALL(__func__); - HDassert(out && buf); + assert(out && buf); n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->rw), &buf[n_eaten]); - HDassert(n_eaten == H5FD_MIRROR_XMIT_LOCK_SIZE); + assert(n_eaten == H5FD_MIRROR_XMIT_LOCK_SIZE); return n_eaten; } /* end H5FD_mirror_xmit_decode_lock() */ @@ -610,13 +610,13 @@ H5FD_mirror_xmit_decode_open(H5FD_mirror_xmit_open_t *out, const unsigned char * LOG_OP_CALL(__func__); - HDassert(out && buf); + assert(out && buf); n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->flags), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->maxaddr), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->size_t_blob), &buf[n_eaten]); - HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_eaten); + assert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_eaten); HDstrncpy(out->filename, (const char *)&buf[n_eaten], H5FD_MIRROR_XMIT_FILEPATH_MAX - 1); out->filename[H5FD_MIRROR_XMIT_FILEPATH_MAX - 1] = 0; /* force final NULL */ @@ -650,11 +650,11 @@ H5FD_mirror_xmit_decode_reply(H5FD_mirror_xmit_reply_t *out, const unsigned char LOG_OP_CALL(__func__); - HDassert(out && buf); + assert(out && buf); n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint32(&(out->status), &buf[n_eaten]); - HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_eaten); + assert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_eaten); HDstrncpy(out->message, (const char *)&buf[n_eaten], H5FD_MIRROR_STATUS_MESSAGE_MAX - 1); out->message[H5FD_MIRROR_STATUS_MESSAGE_MAX - 1] = 0; /* force NULL term */ @@ -687,12 +687,12 @@ H5FD_mirror_xmit_decode_set_eoa(H5FD_mirror_xmit_eoa_t *out, const unsigned char LOG_OP_CALL(__func__); - HDassert(out && buf); + assert(out && buf); n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->eoa_addr), &buf[n_eaten]); - HDassert(n_eaten == H5FD_MIRROR_XMIT_EOA_SIZE); + assert(n_eaten == H5FD_MIRROR_XMIT_EOA_SIZE); return n_eaten; } /* end H5FD_mirror_xmit_decode_set_eoa() */ @@ -723,13 +723,13 @@ H5FD_mirror_xmit_decode_write(H5FD_mirror_xmit_write_t *out, const unsigned char LOG_OP_CALL(__func__); - HDassert(out && buf); + assert(out && buf); n_eaten += H5FD_mirror_xmit_decode_header(&(out->pub), buf); n_eaten += H5FD__mirror_xmit_decode_uint8(&(out->type), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->offset), &buf[n_eaten]); n_eaten += H5FD__mirror_xmit_decode_uint64(&(out->size), &buf[n_eaten]); - HDassert(n_eaten == H5FD_MIRROR_XMIT_WRITE_SIZE); + assert(n_eaten == H5FD_MIRROR_XMIT_WRITE_SIZE); return n_eaten; } /* end H5FD_mirror_xmit_decode_write() */ @@ -755,14 +755,14 @@ H5FD_mirror_xmit_encode_header(unsigned char *dest, const H5FD_mirror_xmit_t *x) LOG_OP_CALL(__func__); - HDassert(dest && x); + assert(dest && x); n_writ += H5FD__mirror_xmit_encode_uint32((dest + n_writ), x->magic); n_writ += H5FD__mirror_xmit_encode_uint8((dest + n_writ), x->version); n_writ += H5FD__mirror_xmit_encode_uint32((dest + n_writ), x->session_token); n_writ += H5FD__mirror_xmit_encode_uint32((dest + n_writ), x->xmit_count); n_writ += H5FD__mirror_xmit_encode_uint8((dest + n_writ), x->op); - HDassert(n_writ == H5FD_MIRROR_XMIT_HEADER_SIZE); + assert(n_writ == H5FD_MIRROR_XMIT_HEADER_SIZE); return n_writ; } /* end H5FD_mirror_xmit_encode_header() */ @@ -787,11 +787,11 @@ H5FD_mirror_xmit_encode_lock(unsigned char *dest, const H5FD_mirror_xmit_lock_t LOG_OP_CALL(__func__); - HDassert(dest && x); + assert(dest && x); n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->rw); - HDassert(n_writ == H5FD_MIRROR_XMIT_LOCK_SIZE); + assert(n_writ == H5FD_MIRROR_XMIT_LOCK_SIZE); return n_writ; } /* end H5FD_mirror_xmit_encode_lock() */ @@ -817,7 +817,7 @@ H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t LOG_OP_CALL(__func__); - HDassert(dest && x); + assert(dest && x); /* clear entire structure, but especially its filepath string area */ HDmemset(dest, 0, H5FD_MIRROR_XMIT_OPEN_SIZE); @@ -826,7 +826,7 @@ H5FD_mirror_xmit_encode_open(unsigned char *dest, const H5FD_mirror_xmit_open_t n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->flags); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->maxaddr); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size_t_blob); - HDassert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_writ); + assert((H5FD_MIRROR_XMIT_OPEN_SIZE - H5FD_MIRROR_XMIT_FILEPATH_MAX) == n_writ); HDstrncpy((char *)&dest[n_writ], x->filename, H5FD_MIRROR_XMIT_FILEPATH_MAX); return H5FD_MIRROR_XMIT_OPEN_SIZE; @@ -854,14 +854,14 @@ H5FD_mirror_xmit_encode_reply(unsigned char *dest, const H5FD_mirror_xmit_reply_ LOG_OP_CALL(__func__); - HDassert(dest && x); + assert(dest && x); /* clear entire structure, but especially its message string area */ HDmemset(dest, 0, H5FD_MIRROR_XMIT_REPLY_SIZE); n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint32(&dest[n_writ], x->status); - HDassert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_writ); + assert((H5FD_MIRROR_XMIT_REPLY_SIZE - H5FD_MIRROR_STATUS_MESSAGE_MAX) == n_writ); HDstrncpy((char *)&dest[n_writ], x->message, H5FD_MIRROR_STATUS_MESSAGE_MAX); return H5FD_MIRROR_XMIT_REPLY_SIZE; @@ -888,12 +888,12 @@ H5FD_mirror_xmit_encode_set_eoa(unsigned char *dest, const H5FD_mirror_xmit_eoa_ LOG_OP_CALL(__func__); - HDassert(dest && x); + assert(dest && x); n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->eoa_addr); - HDassert(n_writ == H5FD_MIRROR_XMIT_EOA_SIZE); + assert(n_writ == H5FD_MIRROR_XMIT_EOA_SIZE); return n_writ; } /* end H5FD_mirror_xmit_encode_set_eoa() */ @@ -919,13 +919,13 @@ H5FD_mirror_xmit_encode_write(unsigned char *dest, const H5FD_mirror_xmit_write_ LOG_OP_CALL(__func__); - HDassert(dest && x); + assert(dest && x); n_writ += H5FD_mirror_xmit_encode_header(dest, (const H5FD_mirror_xmit_t *)&(x->pub)); n_writ += H5FD__mirror_xmit_encode_uint8(&dest[n_writ], x->type); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->offset); n_writ += H5FD__mirror_xmit_encode_uint64(&dest[n_writ], x->size); - HDassert(n_writ == H5FD_MIRROR_XMIT_WRITE_SIZE); + assert(n_writ == H5FD_MIRROR_XMIT_WRITE_SIZE); return n_writ; } /* end H5FD_mirror_xmit_encode_write() */ @@ -945,7 +945,7 @@ H5FD_mirror_xmit_is_close(const H5FD_mirror_xmit_t *xmit) { LOG_OP_CALL(__func__); - HDassert(xmit); + assert(xmit); if ((TRUE == H5FD_mirror_xmit_is_xmit(xmit)) && (H5FD_MIRROR_OP_CLOSE == xmit->op)) return TRUE; @@ -968,7 +968,7 @@ H5FD_mirror_xmit_is_lock(const H5FD_mirror_xmit_lock_t *xmit) { LOG_OP_CALL(__func__); - HDassert(xmit); + assert(xmit); if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_LOCK == xmit->pub.op)) return TRUE; @@ -991,7 +991,7 @@ H5FD_mirror_xmit_is_open(const H5FD_mirror_xmit_open_t *xmit) { LOG_OP_CALL(__func__); - HDassert(xmit); + assert(xmit); if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_OPEN == xmit->pub.op)) @@ -1015,7 +1015,7 @@ H5FD_mirror_xmit_is_set_eoa(const H5FD_mirror_xmit_eoa_t *xmit) { LOG_OP_CALL(__func__); - HDassert(xmit); + assert(xmit); if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_SET_EOA == xmit->pub.op)) return TRUE; @@ -1038,7 +1038,7 @@ H5FD_mirror_xmit_is_reply(const H5FD_mirror_xmit_reply_t *xmit) { LOG_OP_CALL(__func__); - HDassert(xmit); + assert(xmit); if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_REPLY == xmit->pub.op)) return TRUE; @@ -1061,7 +1061,7 @@ H5FD_mirror_xmit_is_write(const H5FD_mirror_xmit_write_t *xmit) { LOG_OP_CALL(__func__); - HDassert(xmit); + assert(xmit); if ((TRUE == H5FD_mirror_xmit_is_xmit(&(xmit->pub))) && (H5FD_MIRROR_OP_WRITE == xmit->pub.op)) return TRUE; @@ -1084,7 +1084,7 @@ H5FD_mirror_xmit_is_xmit(const H5FD_mirror_xmit_t *xmit) { LOG_OP_CALL(__func__); - HDassert(xmit); + assert(xmit); if ((H5FD_MIRROR_XMIT_MAGIC != xmit->magic) || (H5FD_MIRROR_XMIT_CURR_VERSION != xmit->version)) return FALSE; @@ -1115,7 +1115,7 @@ H5FD__mirror_verify_reply(H5FD_mirror_t *file) LOG_OP_CALL(__func__); - HDassert(file && file->sock_fd); + assert(file && file->sock_fd); xmit_buf = H5FL_BLK_MALLOC(xmit, H5FD_MIRROR_XMIT_BUFFER_MAX); if (NULL == xmit_buf) @@ -1239,8 +1239,8 @@ H5FD__mirror_fapl_free(void *_fa) LOG_OP_CALL(__func__); /* sanity check */ - HDassert(fa != NULL); - HDassert(fa->magic == H5FD_MIRROR_FAPL_MAGIC); + assert(fa != NULL); + assert(fa->magic == H5FD_MIRROR_FAPL_MAGIC); fa->magic += 1; /* invalidate */ H5MM_xfree(fa); @@ -1282,7 +1282,7 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_dst /*out*/) if (NULL == fa_src) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info"); - HDassert(fa_src->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */ + assert(fa_src->magic == H5FD_MIRROR_FAPL_MAGIC); /* sanity check */ H5MM_memcpy(fa_dst, fa_src, sizeof(H5FD_mirror_fapl_t)); @@ -1482,8 +1482,8 @@ H5FD__mirror_close(H5FD_t *_file) LOG_OP_CALL(__func__); /* Sanity check */ - HDassert(file); - HDassert(file->sock_fd >= 0); + assert(file); + assert(file->sock_fd >= 0); file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_CLOSE; @@ -1590,7 +1590,7 @@ H5FD__mirror_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) LOG_OP_CALL(__func__); - HDassert(file); + assert(file); FUNC_LEAVE_NOAPI(file->eoa) } /* end H5FD__mirror_get_eoa() */ @@ -1617,7 +1617,7 @@ H5FD__mirror_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) LOG_OP_CALL(__func__); - HDassert(file); + assert(file); file->eoa = addr; /* local copy */ @@ -1672,7 +1672,7 @@ H5FD__mirror_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) LOG_OP_CALL(__func__); - HDassert(file); + assert(file); FUNC_LEAVE_NOAPI(file->eof) } /* end H5FD__mirror_get_eof() */ @@ -1726,8 +1726,8 @@ H5FD__mirror_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, LOG_OP_CALL(__func__); - HDassert(file); - HDassert(buf); + assert(file); + assert(buf); file->xmit.xmit_count = (file->xmit_i)++; file->xmit.op = H5FD_MIRROR_OP_WRITE; diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index b7b7489..0835110 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -53,16 +53,16 @@ H5FD_mpi_get_rank(H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) - HDassert(file); + assert(file); cls = (const H5FD_class_t *)(file->cls); - HDassert(cls); - HDassert(cls->ctl); /* All MPI drivers must implement this */ + assert(cls); + assert(cls->ctl); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((cls->ctl)(file, H5FD_CTL_GET_MPI_RANK_OPCODE, flags, NULL, &rank_ptr) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed") - HDassert(rank >= 0); + assert(rank >= 0); ret_value = rank; @@ -95,10 +95,10 @@ H5FD_mpi_get_size(H5FD_t *file) FUNC_ENTER_NOAPI(FAIL) - HDassert(file); + assert(file); cls = (const H5FD_class_t *)(file->cls); - HDassert(cls); - HDassert(cls->ctl); /* All MPI drivers must implement this */ + assert(cls); + assert(cls->ctl); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((cls->ctl)(file, H5FD_CTL_GET_MPI_SIZE_OPCODE, flags, NULL, &size_ptr) < 0) @@ -138,10 +138,10 @@ H5FD_mpi_get_comm(H5FD_t *file) FUNC_ENTER_NOAPI(MPI_COMM_NULL) - HDassert(file); + assert(file); cls = (const H5FD_class_t *)(file->cls); - HDassert(cls); - HDassert(cls->ctl); /* All MPI drivers must implement this */ + assert(cls); + assert(cls->ctl); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((cls->ctl)(file, H5FD_CTL_GET_MPI_COMMUNICATOR_OPCODE, flags, NULL, &comm_ptr) < 0) @@ -208,7 +208,7 @@ H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off /*out*/) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(mpi_off); + assert(mpi_off); /* Convert the HDF5 address into an MPI offset */ *mpi_off = (MPI_Offset)addr; @@ -245,10 +245,10 @@ H5FD_mpi_get_file_sync_required(H5FD_t *file, hbool_t *file_sync_required) FUNC_ENTER_NOAPI(FAIL) - HDassert(file); + assert(file); cls = (const H5FD_class_t *)(file->cls); - HDassert(cls); - HDassert(cls->ctl); /* All MPI drivers must implement this */ + assert(cls); + assert(cls->ctl); /* All MPI drivers must implement this */ /* Dispatch to driver */ if ((cls->ctl)(file, H5FD_CTL_GET_MPI_FILE_SYNC_OPCODE, flags, NULL, file_sync_required_ptr) < 0) @@ -294,8 +294,8 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file) FUNC_ENTER_NOAPI(FAIL) - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); /* Portably initialize MPI status variable */ HDmemset(&rcvstat, 0, sizeof(MPI_Status)); @@ -344,8 +344,8 @@ H5FD_mpio_signal_right_neighbor(H5FD_t *_file) FUNC_ENTER_NOAPI(FAIL) - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); if (file->mpi_rank != (file->mpi_size - 1)) if (MPI_SUCCESS != diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 449dd46..46fc971 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -192,7 +192,7 @@ H5FD__mpio_parse_debug_str(const char *s) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(s); + assert(s); /* Set debug mask */ while (*s) { @@ -1054,8 +1054,8 @@ H5FD__mpio_close(H5FD_t *_file) #endif /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); /* MPI_File_close sets argument to MPI_FILE_NULL */ if (MPI_SUCCESS != (mpi_code = MPI_File_close(&(file->f)))) @@ -1129,8 +1129,8 @@ H5FD__mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); FUNC_LEAVE_NOAPI(file->eoa) } /* end H5FD__mpio_get_eoa() */ @@ -1157,8 +1157,8 @@ H5FD__mpio_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); file->eoa = addr; @@ -1199,8 +1199,8 @@ H5FD__mpio_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); FUNC_LEAVE_NOAPI(file->eof) } /* end H5FD__mpio_get_eof() */ @@ -1293,9 +1293,9 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU #endif /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); - HDassert(buf); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); + assert(buf); /* Portably initialize MPI status variable */ HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); @@ -1563,12 +1563,12 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h #endif /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); - HDassert(buf); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); + assert(buf); /* Verify that no data is written when between MPI_Barrier()s during file flush */ - HDassert(!H5CX_get_mpi_file_flushing()); + assert(!H5CX_get_mpi_file_flushing()); /* Portably initialize MPI status variable */ HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); @@ -1779,20 +1779,20 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(s_sizes); - HDassert(s_bufs); - HDassert(vector_was_sorted); - HDassert(*vector_was_sorted); - HDassert(mpi_off); - HDassert(mpi_bufs_base); - HDassert(size_i); - HDassert(buf_type); - HDassert(buf_type_created); - HDassert(!*buf_type_created); - HDassert(file_type); - HDassert(file_type_created); - HDassert(!*file_type_created); - HDassert(unused); + assert(s_sizes); + assert(s_bufs); + assert(vector_was_sorted); + assert(*vector_was_sorted); + assert(mpi_off); + assert(mpi_bufs_base); + assert(size_i); + assert(buf_type); + assert(buf_type_created); + assert(!*buf_type_created); + assert(file_type); + assert(file_type_created); + assert(!*file_type_created); + assert(unused); /* Get bio I/O transition point (may be lower than 2G for testing) */ bigio_count = H5_mpi_get_bigio_count(); @@ -1888,7 +1888,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ /* Determine size of this vector element */ if (!fixed_size) { if ((*s_sizes)[i] == 0) { - HDassert(vector_was_sorted); + assert(vector_was_sorted); fixed_size = TRUE; size = sizes[i - 1]; } @@ -1922,7 +1922,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ /* Allocate arrays to keep track of types and whether they were created, if * necessary */ if (!sub_types) { - HDassert(!sub_types_created); + assert(!sub_types_created); if (NULL == (sub_types = HDmalloc((size_t)count * sizeof(MPI_Datatype)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sub types array") @@ -1936,7 +1936,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ for (j = 0; j < (int)count; j++) sub_types[j] = MPI_BYTE; } - HDassert(sub_types_created); + assert(sub_types_created); /* Create type for large block */ if (H5_mpio_create_large_type(size, 0, MPI_BYTE, &sub_types[i]) < 0) @@ -1947,7 +1947,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ mpi_block_lengths[i] = 1; } else - HDassert(size == (size_t)mpi_block_lengths[i]); + assert(size == (size_t)mpi_block_lengths[i]); } /* create the memory MPI derived types */ @@ -1983,20 +1983,20 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit for file_type failed", mpi_code) /* Free up memory used to build types */ - HDassert(mpi_block_lengths); + assert(mpi_block_lengths); HDfree(mpi_block_lengths); mpi_block_lengths = NULL; - HDassert(mpi_displacements); + assert(mpi_displacements); HDfree(mpi_displacements); mpi_displacements = NULL; - HDassert(mpi_bufs); + assert(mpi_bufs); HDfree(mpi_bufs); mpi_bufs = NULL; if (sub_types) { - HDassert(sub_types); + assert(sub_types); for (i = 0; i < (int)count; i++) if (sub_types_created[i]) @@ -2054,7 +2054,7 @@ done: } if (sub_types) { - HDassert(sub_types_created); + assert(sub_types_created); for (i = 0; i < (int)count; i++) if (sub_types_created[i]) @@ -2068,11 +2068,11 @@ done: } /* Make sure we cleaned up */ - HDassert(!mpi_block_lengths); - HDassert(!mpi_displacements); - HDassert(!mpi_bufs); - HDassert(!sub_types); - HDassert(!sub_types_created); + assert(!mpi_block_lengths); + assert(!mpi_displacements); + assert(!mpi_bufs); + assert(!sub_types); + assert(!sub_types_created); FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__mpio_vector_build_types() */ @@ -2162,18 +2162,18 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou #endif /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); - HDassert((types) || (count == 0)); - HDassert((addrs) || (count == 0)); - HDassert((sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); + assert((types) || (count == 0)); + assert((addrs) || (count == 0)); + assert((sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* verify that the first elements of the sizes and types arrays are * valid. */ - HDassert((count == 0) || (sizes[0] != 0)); - HDassert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); + assert((count == 0) || (sizes[0] != 0)); + assert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); /* Get the transfer mode from the API context * @@ -2324,7 +2324,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou /* Iterate over sorted array in reverse, filling in zeroes to * sections of the buffers that were not read to */ do { - HDassert(i >= 0); + assert(i >= 0); #if MPI_VERSION >= 3 io_size = MIN(n, (MPI_Count)s_sizes[i]); @@ -2333,7 +2333,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou io_size = MIN(n, (int)s_sizes[i]); bytes_read = (int)s_sizes[i] - io_size; #endif - HDassert(bytes_read >= 0); + assert(bytes_read >= 0); HDmemset((char *)s_bufs[i] + bytes_read, 0, (size_t)io_size); @@ -2554,22 +2554,22 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co #endif /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); - HDassert((types) || (count == 0)); - HDassert((addrs) || (count == 0)); - HDassert((sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); + assert((types) || (count == 0)); + assert((addrs) || (count == 0)); + assert((sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* verify that the first elements of the sizes and types arrays are * valid. */ - HDassert((count == 0) || (sizes[0] != 0)); - HDassert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); + assert((count == 0) || (sizes[0] != 0)); + assert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); /* Verify that no data is written when between MPI_Barrier()s during file flush */ - HDassert(!H5CX_get_mpi_file_flushing()); + assert(!H5CX_get_mpi_file_flushing()); /* Get the transfer mode from the API context * @@ -2776,9 +2776,9 @@ done: } /* Make sure we cleaned up */ - HDassert(vector_was_sorted || !s_addrs); - HDassert(vector_was_sorted || !s_sizes); - HDassert(vector_was_sorted || !s_bufs); + assert(vector_was_sorted || !s_addrs); + assert(vector_was_sorted || !s_sizes); + assert(vector_was_sorted || !s_bufs); #ifdef H5FDmpio_DEBUG if (H5FD_mpio_debug_t_flag) @@ -2818,8 +2818,8 @@ H5FD__mpio_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) #endif /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); /* Only sync the file if we are not going to immediately close it */ if (!closing) @@ -2875,8 +2875,8 @@ H5FD__mpio_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR #endif /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); if (!H5_addr_eq(file->eoa, file->last_eoa)) { int mpi_code; /* mpi return code */ @@ -2969,11 +2969,11 @@ H5FD__mpio_delete(const char *filename, hid_t fapl_id) FUNC_ENTER_PACKAGE - HDassert(filename); + assert(filename); if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - HDassert(H5FD_MPIO == H5P_peek_driver(plist)); + assert(H5FD_MPIO == H5P_peek_driver(plist)); if (H5FD_mpi_self_initialized) { comm = MPI_COMM_WORLD; @@ -3057,32 +3057,32 @@ H5FD__mpio_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void H5_AT FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file); - HDassert(H5FD_MPIO == file->pub.driver_id); + assert(file); + assert(H5FD_MPIO == file->pub.driver_id); switch (op_code) { case H5FD_CTL_GET_MPI_COMMUNICATOR_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); **((MPI_Comm **)output) = file->comm; break; case H5FD_CTL_GET_MPI_RANK_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); **((int **)output) = file->mpi_rank; break; case H5FD_CTL_GET_MPI_SIZE_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); **((int **)output) = file->mpi_size; break; case H5FD_CTL_GET_MPI_FILE_SYNC_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); **((hbool_t **)output) = file->mpi_file_sync_required; break; diff --git a/src/H5FDonion.c b/src/H5FDonion.c index c4ffe4c..af96f81 100644 --- a/src/H5FDonion.c +++ b/src/H5FDonion.c @@ -377,8 +377,8 @@ H5FD__onion_sb_size(H5FD_t *_file) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(file); - HDassert(file->original_file); + assert(file); + assert(file->original_file); if (file->original_file) ret_value = H5FD_sb_size(file->original_file); @@ -403,8 +403,8 @@ H5FD__onion_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf /*ou FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(file); - HDassert(file->original_file); + assert(file); + assert(file->original_file); if (file->original_file && H5FD_sb_encode(file->original_file, name, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTENCODE, FAIL, "unable to encode the superblock in R/W file") @@ -430,8 +430,8 @@ H5FD__onion_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(file); - HDassert(file->original_file); + assert(file); + assert(file->original_file); if (H5FD_sb_load(file->original_file, name, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDECODE, FAIL, "unable to decode the superblock in R/W file") @@ -494,7 +494,7 @@ H5FD__onion_commit_new_revision_record(H5FD_onion_t *file) if (history->n_revisions == 0) { unsigned char *ptr = buf; /* re-use buffer space to compute checksum */ - HDassert(history->record_locs == NULL); + assert(history->record_locs == NULL); history->n_revisions = 1; if (NULL == (history->record_locs = H5MM_calloc(sizeof(H5FD_onion_record_loc_t)))) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "can't allocate temporary record pointer list") @@ -510,7 +510,7 @@ H5FD__onion_commit_new_revision_record(H5FD_onion_t *file) else { unsigned char *ptr = buf; /* re-use buffer space to compute checksum */ - HDassert(history->record_locs != NULL); + assert(history->record_locs != NULL); if (NULL == (new_list = H5MM_calloc((history->n_revisions + 1) * sizeof(H5FD_onion_record_loc_t)))) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "unable to resize record pointer list") @@ -554,15 +554,15 @@ H5FD__onion_close(H5FD_t *_file) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); if (H5FD_ONION_STORE_TARGET_ONION == file->fa.store_target) { - HDassert(file->onion_file); + assert(file->onion_file); if (file->is_open_rw) { - HDassert(file->recovery_file); + assert(file->recovery_file); if (H5FD__onion_commit_new_revision_record(file) < 0) HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "Can't write revision record to backing store") @@ -695,7 +695,7 @@ H5FD__onion_create_truncate_onion(H5FD_onion_t *file, const char *filename, cons FUNC_ENTER_PACKAGE - HDassert(file != NULL); + assert(file != NULL); hdr = &file->header; history = &file->history; @@ -925,7 +925,7 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid file name") if (0 == maxaddr || HADDR_UNDEF == maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") - HDassert(H5P_DEFAULT != fapl_id); + assert(H5P_DEFAULT != fapl_id); if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") @@ -1042,7 +1042,7 @@ H5FD__onion_open(const char *filename, unsigned flags, hid_t fapl_id, haddr_t ma size_t size = 0; size_t saved_size = 0; - HDassert(file != NULL); + assert(file != NULL); hdr = &file->header; history = &file->history; @@ -1347,8 +1347,8 @@ H5FD__onion_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h FUNC_ENTER_PACKAGE - HDassert(file != NULL); - HDassert(buf_out != NULL); + assert(file != NULL); + assert(buf_out != NULL); if ((uint64_t)(offset + len) > file->logical_eoa) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Read extends beyond addressed space") @@ -1421,7 +1421,7 @@ H5FD__onion_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h bytes_to_read -= page_readsize; } /* end for each page in range */ - HDassert(0 == bytes_to_read); + assert(0 == bytes_to_read); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1471,10 +1471,10 @@ H5FD__onion_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, FUNC_ENTER_PACKAGE - HDassert(file != NULL); - HDassert(buf != NULL); - HDassert(file->rev_index != NULL); - HDassert((uint64_t)(offset + len) <= file->logical_eoa); + assert(file != NULL); + assert(buf != NULL); + assert(file->rev_index != NULL); + assert((uint64_t)(offset + len) <= file->logical_eoa); if (FALSE == file->is_open_rw) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Write not allowed if file not opened in write mode") @@ -1569,7 +1569,7 @@ H5FD__onion_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, } /* end if page exists in neither index */ /* Copy input buffer to temporary page buffer */ - HDassert((page_size - page_gap_head) >= page_n_used); + assert((page_size - page_gap_head) >= page_n_used); HDmemcpy(page_buf + page_gap_head, buf, page_n_used); write_buf = page_buf; @@ -1593,7 +1593,7 @@ H5FD__onion_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, } /* end for each page to write */ - HDassert(0 == bytes_to_write); + assert(0 == bytes_to_write); file->logical_eof = MAX(file->logical_eof, (offset + len)); @@ -1630,7 +1630,7 @@ H5FD__onion_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void H5_A FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(file); + assert(file); switch (op_code) { case H5FD_CTL_GET_NUM_REVISIONS: @@ -1713,8 +1713,8 @@ H5FD__get_onion_revision_count(H5FD_t *file, uint64_t *revision_count) FUNC_ENTER_PACKAGE - HDassert(file); - HDassert(revision_count); + assert(file); + assert(revision_count); op_code = H5FD_CTL_GET_NUM_REVISIONS; flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG; diff --git a/src/H5FDonion_header.c b/src/H5FDonion_header.c index 3b087fa..6feded4 100644 --- a/src/H5FDonion_header.c +++ b/src/H5FDonion_header.c @@ -130,9 +130,9 @@ H5FD__onion_header_decode(unsigned char *buf, H5FD_onion_header_t *header) FUNC_ENTER_PACKAGE - HDassert(buf != NULL); - HDassert(header != NULL); - HDassert(H5FD_ONION_HEADER_VERSION_CURR == header->version); + assert(buf != NULL); + assert(header != NULL); + assert(H5FD_ONION_HEADER_VERSION_CURR == header->version); if (HDstrncmp((const char *)buf, H5FD_ONION_HEADER_SIGNATURE, 4)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid header signature") @@ -208,11 +208,11 @@ H5FD__onion_header_encode(H5FD_onion_header_t *header, unsigned char *buf, uint3 FUNC_ENTER_PACKAGE_NOERR - HDassert(buf != NULL); - HDassert(checksum != NULL); - HDassert(header != NULL); - HDassert(H5FD_ONION_HEADER_VERSION_CURR == header->version); - HDassert(0 == (header->flags & 0xFF000000)); /* max three bits long */ + assert(buf != NULL); + assert(checksum != NULL); + assert(header != NULL); + assert(H5FD_ONION_HEADER_VERSION_CURR == header->version); + assert(0 == (header->flags & 0xFF000000)); /* max three bits long */ HDmemcpy(ptr, H5FD_ONION_HEADER_SIGNATURE, 4); ptr += 4; diff --git a/src/H5FDonion_history.c b/src/H5FDonion_history.c index 567ac07..33a16ab 100644 --- a/src/H5FDonion_history.c +++ b/src/H5FDonion_history.c @@ -45,8 +45,8 @@ H5FD__onion_ingest_history(H5FD_onion_history_t *history_out, H5FD_t *raw_file, FUNC_ENTER_PACKAGE - HDassert(history_out); - HDassert(raw_file); + assert(history_out); + assert(raw_file); /* Set early so we can clean up properly on errors */ history_out->record_locs = NULL; @@ -168,9 +168,9 @@ H5FD__onion_history_decode(unsigned char *buf, H5FD_onion_history_t *history) FUNC_ENTER_PACKAGE - HDassert(buf != NULL); - HDassert(history != NULL); - HDassert(H5FD_ONION_HISTORY_VERSION_CURR == history->version); + assert(buf != NULL); + assert(history != NULL); + assert(H5FD_ONION_HISTORY_VERSION_CURR == history->version); if (HDstrncmp((const char *)buf, H5FD_ONION_HISTORY_SIGNATURE, 4)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid signature") @@ -270,17 +270,17 @@ H5FD__onion_history_encode(H5FD_onion_history_t *history, unsigned char *buf, ui FUNC_ENTER_PACKAGE_NOERR - HDassert(history != NULL); - HDassert(H5FD_ONION_HISTORY_VERSION_CURR == history->version); - HDassert(buf != NULL); - HDassert(checksum != NULL); + assert(history != NULL); + assert(H5FD_ONION_HISTORY_VERSION_CURR == history->version); + assert(buf != NULL); + assert(checksum != NULL); HDmemcpy(ptr, H5FD_ONION_HISTORY_SIGNATURE, 4); ptr += 4; UINT32ENCODE(ptr, vers_u32); UINT64ENCODE(ptr, history->n_revisions); if (history->n_revisions > 0) { - HDassert(history->record_locs != NULL); + assert(history->record_locs != NULL); for (uint64_t i = 0; i < history->n_revisions; i++) { H5FD_onion_record_loc_t *rloc = &history->record_locs[i]; diff --git a/src/H5FDonion_index.c b/src/H5FDonion_index.c index aca0780..6adf38c 100644 --- a/src/H5FDonion_index.c +++ b/src/H5FDonion_index.c @@ -54,11 +54,11 @@ H5FD__onion_ingest_revision_record(H5FD_onion_revision_record_t *r_out, H5FD_t * FUNC_ENTER_PACKAGE - HDassert(r_out); - HDassert(raw_file); - HDassert(history); - HDassert(history->record_locs); - HDassert(history->n_revisions > 0); + assert(r_out); + assert(raw_file); + assert(history); + assert(history->record_locs); + assert(history->n_revisions > 0); high = history->n_revisions - 1; range = high; @@ -186,7 +186,7 @@ H5FD__onion_archival_index_is_valid(const H5FD_onion_archival_index_t *aix) FUNC_ENTER_PACKAGE_NOERR - HDassert(aix); + assert(aix); if (H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR != aix->version) HGOTO_DONE(FALSE) @@ -230,11 +230,11 @@ H5FD__onion_archival_index_find(const H5FD_onion_archival_index_t *aix, uint64_t FUNC_ENTER_PACKAGE_NOERR - HDassert(aix); - HDassert(H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR == aix->version); - HDassert(entry_out); + assert(aix); + assert(H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR == aix->version); + assert(entry_out); if (aix->n_entries != 0) - HDassert(aix->list); + assert(aix->list); high = aix->n_entries - 1; range = high; @@ -250,7 +250,7 @@ H5FD__onion_archival_index_find(const H5FD_onion_archival_index_t *aix, uint64_t /* Winnow down to first of found or one element */ while (range > 0) { - HDassert(high < aix->n_entries); + assert(high < aix->n_entries); n = low + (range / 2); x = &(aix->list[n]); if (x->logical_page == logical_page) { @@ -267,7 +267,7 @@ H5FD__onion_archival_index_find(const H5FD_onion_archival_index_t *aix, uint64_t range = high - low; } - HDassert(high == low); /* one element */ + assert(high == low); /* one element */ /* n == low/high check because we may have tested it already above */ if ((n != low || n != high) && (aix->list[low].logical_page == logical_page)) { @@ -294,8 +294,8 @@ H5FD__onion_revision_index_destroy(H5FD_onion_revision_index_t *rix) FUNC_ENTER_PACKAGE_NOERR - HDassert(rix); - HDassert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); + assert(rix); + assert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); for (size_t i = 0; 0 < rix->_hash_table_n_keys_populated && i < rix->_hash_table_size; i++) { H5FD_onion_revision_index_hash_chain_node_t *next = NULL; @@ -305,7 +305,7 @@ H5FD__onion_revision_index_destroy(H5FD_onion_revision_index_t *rix) rix->_hash_table_n_keys_populated -= 1; while (node != NULL) { - HDassert(H5FD_ONION_REVISION_INDEX_HASH_CHAIN_NODE_VERSION_CURR == node->version); + assert(H5FD_ONION_REVISION_INDEX_HASH_CHAIN_NODE_VERSION_CURR == node->version); next = node->next; H5MM_xfree(node); @@ -338,8 +338,8 @@ H5FD__onion_revision_index_init(uint32_t page_size) FUNC_ENTER_PACKAGE - HDassert(0 != page_size); - HDassert(POWER_OF_TWO(page_size)); + assert(0 != page_size); + assert(POWER_OF_TWO(page_size)); if (NULL == (rix = H5MM_calloc(sizeof(H5FD_onion_revision_index_t)))) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "cannot allocate index") @@ -392,9 +392,9 @@ H5FD__onion_revision_index_resize(H5FD_onion_revision_index_t *rix) FUNC_ENTER_PACKAGE - HDassert(rix); - HDassert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); - HDassert(rix->_hash_table); + assert(rix); + assert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); + assert(rix->_hash_table); if (NULL == (new_table = H5MM_calloc(new_size * sizeof(H5FD_onion_revision_index_hash_chain_node_t *)))) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "cannot allocate new hash table") @@ -454,9 +454,9 @@ H5FD__onion_revision_index_insert(H5FD_onion_revision_index_t *rix, const H5FD_o FUNC_ENTER_PACKAGE - HDassert(rix); - HDassert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); - HDassert(entry); + assert(rix); + assert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); + assert(entry); /* Resize and re-hash table if necessary */ if (rix->n_entries >= (rix->_hash_table_size * 2) || @@ -466,7 +466,7 @@ H5FD__onion_revision_index_insert(H5FD_onion_revision_index_t *rix, const H5FD_o } key = entry->logical_page & (rix->_hash_table_size - 1); - HDassert(key < rix->_hash_table_size); + assert(key < rix->_hash_table_size); if (NULL == rix->_hash_table[key]) { /* Key maps to empty bucket */ @@ -527,13 +527,13 @@ H5FD__onion_revision_index_find(const H5FD_onion_revision_index_t *rix, uint64_t FUNC_ENTER_PACKAGE_NOERR - HDassert(rix); - HDassert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); - HDassert(rix->_hash_table); - HDassert(entry_out); + assert(rix); + assert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); + assert(rix->_hash_table); + assert(entry_out); key = logical_page & (rix->_hash_table_size - 1); - HDassert(key < rix->_hash_table_size); + assert(key < rix->_hash_table_size); if (rix->_hash_table[key] != NULL) { H5FD_onion_revision_index_hash_chain_node_t *node = NULL; @@ -599,10 +599,10 @@ H5FD__onion_revision_record_decode(unsigned char *buf, H5FD_onion_revision_recor FUNC_ENTER_PACKAGE - HDassert(buf != NULL); - HDassert(record != NULL); - HDassert(H5FD_ONION_REVISION_RECORD_VERSION_CURR == record->version); - HDassert(H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR == record->archival_index.version); + assert(buf != NULL); + assert(record != NULL); + assert(H5FD_ONION_REVISION_RECORD_VERSION_CURR == record->version); + assert(H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR == record->archival_index.version); if (HDstrncmp((const char *)buf, H5FD_ONION_REVISION_RECORD_SIGNATURE, 4)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid signature") @@ -756,12 +756,12 @@ H5FD__onion_revision_record_encode(H5FD_onion_revision_record_t *record, unsigne FUNC_ENTER_PACKAGE_NOERR - HDassert(checksum != NULL); - HDassert(buf != NULL); - HDassert(record != NULL); - HDassert(vers_u32 < 0x100); - HDassert(H5FD_ONION_REVISION_RECORD_VERSION_CURR == record->version); - HDassert(H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR == record->archival_index.version); + assert(checksum != NULL); + assert(buf != NULL); + assert(record != NULL); + assert(vers_u32 < 0x100); + assert(H5FD_ONION_REVISION_RECORD_VERSION_CURR == record->version); + assert(H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR == record->archival_index.version); page_size = (uint32_t)(1 << record->archival_index.page_size_log2); @@ -780,7 +780,7 @@ H5FD__onion_revision_record_encode(H5FD_onion_revision_record_t *record, unsigne if (record->archival_index.n_entries > 0) { uint64_t page_size_log2 = record->archival_index.page_size_log2; - HDassert(record->archival_index.list != NULL); + assert(record->archival_index.list != NULL); for (uint64_t i = 0; i < record->archival_index.n_entries; i++) { uint32_t sum = 0; H5FD_onion_index_entry_t *entry = NULL; @@ -797,7 +797,7 @@ H5FD__onion_revision_record_encode(H5FD_onion_revision_record_t *record, unsigne } if (record->comment_size > 0) { - HDassert(record->comment != NULL && *record->comment != '\0'); + assert(record->comment != NULL && *record->comment != '\0'); HDmemcpy(ptr, record->comment, record->comment_size); ptr += record->comment_size; } @@ -856,11 +856,11 @@ H5FD__onion_merge_revision_index_into_archival_index(const H5FD_onion_revision_i FUNC_ENTER_PACKAGE - HDassert(rix); - HDassert(aix); - HDassert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); - HDassert(H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR == aix->version); - HDassert(aix->page_size_log2 == rix->page_size_log2); + assert(rix); + assert(aix); + assert(H5FD_ONION_REVISION_INDEX_VERSION_CURR == rix->version); + assert(H5FD_ONION_ARCHIVAL_INDEX_VERSION_CURR == aix->version); + assert(aix->page_size_log2 == rix->page_size_log2); /* If the revision index is empty there is nothing to archive */ if (rix->n_entries == 0) diff --git a/src/H5FDros3.c b/src/H5FDros3.c index 465117f..a0c7203 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -383,7 +383,7 @@ H5Pset_fapl_ros3(hid_t fapl_id, const H5FD_ros3_fapl_t *fa) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*#", fapl_id, fa); - HDassert(fa != NULL); + assert(fa != NULL); #if ROS3_DEBUG HDfprintf(stdout, "H5Pset_fapl_ros3() called.\n"); @@ -429,7 +429,7 @@ H5FD__ros3_validate_config(const H5FD_ros3_fapl_t *fa) FUNC_ENTER_PACKAGE - HDassert(fa != NULL); + assert(fa != NULL); if (fa->version != H5FD_CURR_ROS3_FAPL_T_VERSION) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ros3_fapl_t version"); @@ -592,7 +592,7 @@ H5FD__ros3_fapl_free(void *_fa) FUNC_ENTER_PACKAGE_NOERR - HDassert(fa != NULL); /* sanity check */ + assert(fa != NULL); /* sanity check */ H5MM_xfree(fa); @@ -729,7 +729,7 @@ H5FD__ros3_open(const char *url, unsigned flags, hid_t fapl_id, haddr_t maxaddr) * find way to re-use/share */ now = gmnow(); - HDassert(now != NULL); + assert(now != NULL); if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "problem while writing iso8601 timestamp") if (FAIL == H5FD_s3comms_signing_key(signing_key, (const char *)fa.secret_key, @@ -934,7 +934,7 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) re_dub = (double)min_meta; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); } @@ -944,7 +944,7 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) re_dub = (double)min_raw; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); } @@ -952,26 +952,26 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) re_dub = (double)average_meta; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)average_raw; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); HDfprintf(stream, " max "); re_dub = (double)max_meta; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c ", re_dub, suffixes[suffix_i]); re_dub = (double)max_raw; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, "%8.3lf%c\n", re_dub, suffixes[suffix_i]); /****************************** @@ -1011,33 +1011,33 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) bm_val = (double)m->bytes; for (suffix_i = 0; bm_val >= 1024.0; suffix_i++) bm_val /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); bm_suffix = suffixes[suffix_i]; br_val = (double)r->bytes; for (suffix_i = 0; br_val >= 1024.0; suffix_i++) br_val /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); br_suffix = suffixes[suffix_i]; if (m->count > 0) am_val = (double)(m->bytes) / (double)(m->count); for (suffix_i = 0; am_val >= 1024.0; suffix_i++) am_val /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); am_suffix = suffixes[suffix_i]; if (r->count > 0) ar_val = (double)(r->bytes) / (double)(r->count); for (suffix_i = 0; ar_val >= 1024.0; suffix_i++) ar_val /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); ar_suffix = suffixes[suffix_i]; re_dub = (double)range_end; for (suffix_i = 0; re_dub >= 1024.0; suffix_i++) re_dub /= 1024.0; - HDassert(suffix_i < sizeof(suffixes)); + assert(suffix_i < sizeof(suffixes)); HDfprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub, suffixes[suffix_i], /* bin ceiling */ @@ -1087,8 +1087,8 @@ H5FD__ros3_close(H5FD_t H5_ATTR_UNUSED *_file) #endif /* Sanity checks */ - HDassert(file != NULL); - HDassert(file->s3r_handle != NULL); + assert(file != NULL); + assert(file->s3r_handle != NULL); /* Close the underlying request handle */ @@ -1155,17 +1155,17 @@ H5FD__ros3_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HDfprintf(stdout, "H5FD__ros3_cmp() called.\n"); #endif - HDassert(f1->s3r_handle != NULL); - HDassert(f2->s3r_handle != NULL); + assert(f1->s3r_handle != NULL); + assert(f2->s3r_handle != NULL); purl1 = (const parsed_url_t *)f1->s3r_handle->purl; purl2 = (const parsed_url_t *)f2->s3r_handle->purl; - HDassert(purl1 != NULL); - HDassert(purl2 != NULL); - HDassert(purl1->scheme != NULL); - HDassert(purl2->scheme != NULL); - HDassert(purl1->host != NULL); - HDassert(purl2->host != NULL); + assert(purl1 != NULL); + assert(purl2 != NULL); + assert(purl1->scheme != NULL); + assert(purl2->scheme != NULL); + assert(purl1->host != NULL); + assert(purl2->host != NULL); /* URL: SCHEME */ if (HDstrcmp(purl1->scheme, purl2->scheme)) @@ -1454,9 +1454,9 @@ H5FD__ros3_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU HDfprintf(stdout, "H5FD__ros3_read() called.\n"); #endif - HDassert(file != NULL); - HDassert(file->s3r_handle != NULL); - HDassert(buf != NULL); + assert(file != NULL); + assert(file->s3r_handle != NULL); + assert(buf != NULL); filesize = H5FD_s3comms_s3r_get_filesize(file->s3r_handle); diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index d61b6f4..0d6f202 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -276,7 +276,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) ret = HDsnprintf(nvcat, catwrite, "%s: %s", name, value); if (ret < 0 || (size_t)ret > catlen) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot concatenate `%s: %s", name, value); - HDassert(catlen == HDstrlen(nvcat)); + assert(catlen == HDstrlen(nvcat)); /* create new_node, should we need it */ @@ -320,8 +320,8 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) /* sanity-check pointer passed in */ - HDassert((*L) != NULL); - HDassert((*L)->magic == S3COMMS_HRB_NODE_MAGIC); + assert((*L) != NULL); + assert((*L)->magic == S3COMMS_HRB_NODE_MAGIC); node_ptr = (*L); /* Check whether to modify/remove first node in list @@ -365,7 +365,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) HDprintf("MAGIC OK? %s\n", (node_ptr->magic == S3COMMS_HRB_NODE_MAGIC) ? "YES" : "NO"); HDfflush(stdout); #endif - HDassert(node_ptr->magic == S3COMMS_HRB_NODE_MAGIC); + assert(node_ptr->magic == S3COMMS_HRB_NODE_MAGIC); node_ptr->magic += 1ul; #if S3COMMS_DEBUG HDprintf("FREEING POINTER\n"); @@ -448,7 +448,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) * APPEND NEW NODE * *******************/ - HDassert(HDstrcmp(lowername, node_ptr->lowername) > 0); + assert(HDstrcmp(lowername, node_ptr->lowername) > 0); new_node->name = namecpy; new_node->value = valuecpy; new_node->lowername = lowername; @@ -471,7 +471,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) * INSERT NEW NODE * *******************/ - HDassert(HDstrcmp(lowername, node_ptr->lowername) > 0); + assert(HDstrcmp(lowername, node_ptr->lowername) > 0); new_node->name = namecpy; new_node->value = valuecpy; new_node->lowername = lowername; @@ -501,7 +501,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) H5MM_xfree(tmp->name); H5MM_xfree(tmp->value); - HDassert(tmp->magic == S3COMMS_HRB_NODE_MAGIC); + assert(tmp->magic == S3COMMS_HRB_NODE_MAGIC); tmp->magic += 1ul; H5MM_xfree(tmp); @@ -522,7 +522,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) H5MM_xfree(node_ptr->value); H5MM_xfree(node_ptr->cat); - HDassert(new_node->magic == S3COMMS_HRB_NODE_MAGIC); + assert(new_node->magic == S3COMMS_HRB_NODE_MAGIC); new_node->magic += 1ul; H5MM_xfree(new_node); H5MM_xfree(lowername); @@ -555,7 +555,7 @@ done: if (valuecpy != NULL) H5MM_xfree(valuecpy); if (new_node != NULL) { - HDassert(new_node->magic == S3COMMS_HRB_NODE_MAGIC); + assert(new_node->magic == S3COMMS_HRB_NODE_MAGIC); new_node->magic += 1ul; H5MM_xfree(new_node); } @@ -709,7 +709,7 @@ H5FD_s3comms_hrb_init_request(const char *_verb, const char *_resource, const ch HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, NULL, "no space for resource string"); *res = '/'; H5MM_memcpy((&res[1]), _resource, (reslen + 1)); - HDassert((reslen + 1) == HDstrlen(res)); + assert((reslen + 1) == HDstrlen(res)); } /* end if (else resource string not starting with '/') */ verblen = HDstrlen(_verb) + 1; @@ -794,7 +794,7 @@ H5FD_s3comms_s3r_close(s3r_t *handle) H5MM_xfree(handle->region); H5MM_xfree(handle->signing_key); - HDassert(handle->httpverb != NULL); + assert(handle->httpverb != NULL); H5MM_xfree(handle->httpverb); if (FAIL == H5FD_s3comms_free_purl(handle->purl)) @@ -906,7 +906,7 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_HEADERDATA, &sds)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while setting CURL option (CURLOPT_HEADERDATA)."); - HDassert(handle->httpverb == NULL); + assert(handle->httpverb == NULL); handle->httpverb = (char *)H5MM_malloc(sizeof(char) * 16); if (handle->httpverb == NULL) HGOTO_ERROR(H5E_ARGS, H5E_CANTALLOC, FAIL, "unable to allocate space for S3 request HTTP verb"); @@ -1044,8 +1044,8 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const /* probably a malformed url, but could be internal error */ HGOTO_ERROR(H5E_ARGS, H5E_CANTCREATE, NULL, "unable to create parsed url structure"); - HDassert(purl != NULL); /* if above passes, this must be true */ - HDassert(purl->magic == S3COMMS_PARSED_URL_MAGIC); + assert(purl != NULL); /* if above passes, this must be true */ + assert(purl->magic == S3COMMS_PARSED_URL_MAGIC); handle = (s3r_t *)H5MM_malloc(sizeof(s3r_t)); if (handle == NULL) @@ -1137,7 +1137,7 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const * FINAL PREPARATION * *********************/ - HDassert(handle->httpverb != NULL); + assert(handle->httpverb != NULL); H5MM_memcpy(handle->httpverb, "GET", 4); ret_value = handle; @@ -1236,7 +1236,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) curlhandle.") if (handle->purl == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "handle has bad (null) url.") - HDassert(handle->purl->magic == S3COMMS_PARSED_URL_MAGIC); + assert(handle->purl->magic == S3COMMS_PARSED_URL_MAGIC); if (offset > handle->filesize || (len + offset) > handle->filesize) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to read past EoF") @@ -1297,9 +1297,9 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) char *bytesrange_ptr = NULL; /* pointer past "bytes=" portion */ bytesrange_ptr = HDstrchr(rangebytesstr, '='); - HDassert(bytesrange_ptr != NULL); + assert(bytesrange_ptr != NULL); bytesrange_ptr++; /* move to first char past '=' */ - HDassert(*bytesrange_ptr != '\0'); + assert(*bytesrange_ptr != '\0'); if (CURLE_OK != curl_easy_setopt(curlh, CURLOPT_RANGE, bytesrange_ptr)) HGOTO_ERROR(H5E_VFL, H5E_UNINITIALIZED, FAIL, @@ -1356,7 +1356,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) (const char *)handle->purl->path, "HTTP/1.1"); if (request == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not allocate hrb_t request."); - HDassert(request->magic == S3COMMS_HRB_MAGIC); + assert(request->magic == S3COMMS_HRB_MAGIC); now = gmnow(); if (ISO8601NOW(iso8601now, now) != (ISO8601_SIZE - 1)) @@ -1366,27 +1366,27 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-date header") if (headers == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); - HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC); + assert(headers->magic == S3COMMS_HRB_NODE_MAGIC); if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "x-amz-content-sha256", (const char *)EMPTY_SHA256)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set x-amz-content-sha256 header") if (headers == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); - HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC); + assert(headers->magic == S3COMMS_HRB_NODE_MAGIC); if (rangebytesstr != NULL) { if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Range", rangebytesstr)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set range header") if (headers == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); - HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC); + assert(headers->magic == S3COMMS_HRB_NODE_MAGIC); } if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Host", handle->purl->host)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set host header") if (headers == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "problem building headers list."); - HDassert(headers->magic == S3COMMS_HRB_NODE_MAGIC); + assert(headers->magic == S3COMMS_HRB_NODE_MAGIC); request->first_header = headers; @@ -1426,7 +1426,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) node = request->first_header; while (node != NULL) { - HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC); + assert(node->magic == S3COMMS_HRB_NODE_MAGIC); curlheaders = curl_slist_append(curlheaders, (const char *)node->cat); if (curlheaders == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not append header to curl slist."); @@ -1515,10 +1515,10 @@ done: while (headers != NULL) if (FAIL == H5FD_s3comms_hrb_node_set(&headers, headers->name, NULL)) HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header node") - HDassert(NULL == headers); + assert(NULL == headers); if (FAIL == H5FD_s3comms_hrb_destroy(&request)) HDONE_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "cannot release header request structure") - HDassert(NULL == request); + assert(NULL == request); } if (curlh != NULL) { @@ -1567,7 +1567,7 @@ gmnow(void) if ((time_t)(-1) != HDtime(now_ptr)) ret_value = HDgmtime(now_ptr); - HDassert(ret_value != NULL); + assert(ret_value != NULL); return ret_value; } /* end gmnow() */ @@ -1644,7 +1644,7 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c if (http_request == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "hrb object cannot be null."); - HDassert(http_request->magic == S3COMMS_HRB_MAGIC); + assert(http_request->magic == S3COMMS_HRB_MAGIC); if (canonical_request_dest == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "canonical request destination cannot be null."); @@ -1667,7 +1667,7 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c node = http_request->first_header; /* assumed sorted */ while (node != NULL) { - HDassert(node->magic == S3COMMS_HRB_NODE_MAGIC); + assert(node->magic == S3COMMS_HRB_NODE_MAGIC); ret = HDsnprintf(tmpstr, 256, "%s:%s\n", node->lowername, node->value); if (ret < 0 || ret >= 256) @@ -1794,7 +1794,7 @@ H5FD_s3comms_free_purl(parsed_url_t *purl) #endif if (purl != NULL) { - HDassert(purl->magic == S3COMMS_PARSED_URL_MAGIC); + assert(purl->magic == S3COMMS_PARSED_URL_MAGIC); if (purl->scheme != NULL) H5MM_xfree(purl->scheme); if (purl->host != NULL) @@ -2237,7 +2237,7 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl) if (tmpstr == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid SCHEME construction: probably not URL"); len = tmpstr - curstr; - HDassert((0 <= len) && (len < urllen)); + assert((0 <= len) && (len < urllen)); /* check for restrictions */ for (i = 0; i < len; i++) { diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 9f7abcb..b8757f1 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -435,7 +435,7 @@ H5FD__sec2_close(H5FD_t *_file) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(file); + assert(file); /* Close the underlying file */ if (HDclose(file->fd) < 0) @@ -691,8 +691,8 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU FUNC_ENTER_PACKAGE - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Check for overflow conditions */ if (!H5_addr_defined(addr)) @@ -753,8 +753,8 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU break; } /* end if */ - HDassert(bytes_read >= 0); - HDassert((size_t)bytes_read <= size); + assert(bytes_read >= 0); + assert((size_t)bytes_read <= size); size -= (size_t)bytes_read; addr += (haddr_t)bytes_read; @@ -799,8 +799,8 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN FUNC_ENTER_PACKAGE - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Check for overflow conditions */ if (!H5_addr_defined(addr)) @@ -856,8 +856,8 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ - HDassert(bytes_wrote > 0); - HDassert((size_t)bytes_wrote <= size); + assert(bytes_wrote > 0); + assert((size_t)bytes_wrote <= size); size -= (size_t)bytes_wrote; addr += (haddr_t)bytes_wrote; @@ -901,7 +901,7 @@ H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); /* Extend the file to make sure it's large enough */ if (!H5_addr_eq(file->eoa, file->eof)) { @@ -971,7 +971,7 @@ H5FD__sec2_lock(H5FD_t *_file, hbool_t rw) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); /* Set exclusive or shared lock based on rw status */ lock_flags = rw ? LOCK_EX : LOCK_SH; @@ -1011,7 +1011,7 @@ H5FD__sec2_unlock(H5FD_t *_file) FUNC_ENTER_PACKAGE - HDassert(file); + assert(file); if (HDflock(file->fd, LOCK_UN) < 0) { if (file->ignore_disabled_file_locks && ENOSYS == errno) { @@ -1044,7 +1044,7 @@ H5FD__sec2_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id) FUNC_ENTER_PACKAGE - HDassert(filename); + assert(filename); if (HDremove(filename) < 0) HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file") diff --git a/src/H5FDspace.c b/src/H5FDspace.c index cdc1944..8b75292 100644 --- a/src/H5FDspace.c +++ b/src/H5FDspace.c @@ -96,10 +96,10 @@ H5FD__extend(H5FD_t *file, H5FD_mem_t type, hsize_t size) FUNC_ENTER_PACKAGE /* check args */ - HDassert(file); - HDassert(file->cls); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(size > 0); + assert(file); + assert(file->cls); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(size > 0); /* Get current end-of-allocated space address */ eoa = file->cls->get_eoa(file, type); @@ -151,10 +151,10 @@ H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr #endif /* H5FD_ALLOC_DEBUG */ /* check args */ - HDassert(file); - HDassert(file->cls); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(size > 0); + assert(file); + assert(file->cls); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(size > 0); /* Check for query driver and call it */ if (file->cls->query) @@ -203,7 +203,7 @@ H5FD__alloc_real(H5FD_t *file, H5FD_mem_t type, hsize_t size, haddr_t *frag_addr /* Post-condition sanity check */ if (!file->paged_aggr && file->alignment > 1 && orig_size >= file->threshold) - HDassert(!(ret_value % file->alignment)); + assert(!(ret_value % file->alignment)); /* Convert absolute file offset to relative address */ ret_value -= file->base_addr; @@ -241,10 +241,10 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, H5F_t *f, hsize_t size, haddr_t *frag_ FUNC_ENTER_NOAPI(HADDR_UNDEF) /* check args */ - HDassert(file); - HDassert(file->cls); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(size > 0); + assert(file); + assert(file->cls); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(size > 0); /* Call the real 'alloc' routine */ ret_value = H5FD__alloc_real(file, type, size, frag_addr, frag_size); @@ -280,10 +280,10 @@ H5FD__free_real(H5FD_t *file, H5FD_mem_t type, haddr_t addr, hsize_t size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(file); - HDassert(file->cls); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(size > 0); + assert(file); + assert(file->cls); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(size > 0); #ifdef H5FD_ALLOC_DEBUG HDfprintf(stderr, "%s: type = %u, addr = %" PRIuHADDR ", size = %" PRIuHSIZE "\n", __func__, @@ -365,10 +365,10 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t addr, hsize_t size) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(file); - HDassert(file->cls); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(size > 0); + assert(file); + assert(file->cls); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(size > 0); /* Call the real 'free' routine */ if (H5FD__free_real(file, type, addr, size) < 0) @@ -409,11 +409,11 @@ H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, H5F_t *f, haddr_t blk_end, hsize_ FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(file); - HDassert(file->cls); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(extra_requested > 0); - HDassert(f); + assert(file); + assert(file->cls); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(extra_requested > 0); + assert(f); /* Retrieve the end of the address space */ if (HADDR_UNDEF == (eoa = file->cls->get_eoa(file, type))) diff --git a/src/H5FDsplitter.c b/src/H5FDsplitter.c index e6f0969..1159694 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -253,7 +253,7 @@ H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr) H5FD_SPLITTER_LOG_CALL(__func__); - HDassert(id_out_ptr != NULL); + assert(id_out_ptr != NULL); if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "not a file access property list"); @@ -404,7 +404,7 @@ H5FD__splitter_populate_config(H5FD_splitter_vfd_config_t *vfd_config, H5FD_spli FUNC_ENTER_PACKAGE - HDassert(fapl_out); + assert(fapl_out); HDmemset(fapl_out, 0, sizeof(H5FD_splitter_fapl_t)); @@ -523,8 +523,8 @@ H5FD__splitter_get_default_wo_path(char *new_path, size_t new_path_len, const ch FUNC_ENTER_PACKAGE - HDassert(new_path); - HDassert(base_filename); + assert(new_path); + assert(base_filename); /* Check that output buffer can hold base filename + `_wo` suffix */ old_filename_len = HDstrlen(base_filename); @@ -612,8 +612,8 @@ H5FD__splitter_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR H5FD_SPLITTER_LOG_CALL(__func__); - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Check for overflow conditions */ if (!H5_addr_defined(addr)) @@ -713,7 +713,7 @@ H5FD__splitter_fapl_copy(const void *_old_fa) H5FD_SPLITTER_LOG_CALL(__func__); - HDassert(old_fa_ptr); + assert(old_fa_ptr); new_fa_ptr = H5FL_CALLOC(H5FD_splitter_fapl_t); if (NULL == new_fa_ptr) @@ -758,7 +758,7 @@ H5FD__splitter_fapl_free(void *_fapl) H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ - HDassert(fapl); + assert(fapl); if (H5I_dec_ref(fapl->rw_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close R/W FAPL ID") @@ -908,7 +908,7 @@ H5FD__splitter_close(H5FD_t *_file) H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); + assert(file); if (H5I_dec_ref(file->fa.rw_fapl_id) < 0) HGOTO_ERROR(H5E_VFL, H5E_ARGS, FAIL, "can't close R/W FAPL") @@ -959,8 +959,8 @@ H5FD__splitter_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); if ((ret_value = H5FD_get_eoa(file->rw_file, type)) == HADDR_UNDEF) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, HADDR_UNDEF, "unable to get eoa") @@ -990,9 +990,9 @@ H5FD__splitter_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t ad H5FD_SPLITTER_LOG_CALL(__func__) /* Sanity check */ - HDassert(file); - HDassert(file->rw_file); - HDassert(file->wo_file); + assert(file); + assert(file->rw_file); + assert(file->wo_file); if (H5FD_set_eoa(file->rw_file, type, addr) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTSET, FAIL, "H5FDset_eoa failed for R/W file") @@ -1027,8 +1027,8 @@ H5FD__splitter_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); if (HADDR_UNDEF == (ret_value = H5FD_get_eof(file->rw_file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "unable to get eof") @@ -1055,9 +1055,9 @@ H5FD__splitter_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) H5FD_SPLITTER_LOG_CALL(__func__); - HDassert(file); - HDassert(file->rw_file); - HDassert(file->wo_file); + assert(file); + assert(file->rw_file); + assert(file->wo_file); if (H5FDtruncate(file->rw_file, dxpl_id, closing) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTUPDATE, FAIL, "unable to truncate R/W file") @@ -1094,8 +1094,8 @@ H5FD__splitter_sb_size(H5FD_t *_file) H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); if (file->rw_file) ret_value = H5FD_sb_size(file->rw_file); @@ -1122,8 +1122,8 @@ H5FD__splitter_sb_encode(H5FD_t *_file, char *name /*out*/, unsigned char *buf / H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); if (file->rw_file && H5FD_sb_encode(file->rw_file, name, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTENCODE, FAIL, "unable to encode the superblock in R/W file") @@ -1153,8 +1153,8 @@ H5FD__splitter_sb_decode(H5FD_t *_file, const char *name, const unsigned char *b H5FD_SPLITTER_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); if (H5FD_sb_load(file->rw_file, name, buf) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTDECODE, FAIL, "unable to decode the superblock in R/W file") @@ -1183,8 +1183,8 @@ H5FD__splitter_cmp(const H5FD_t *_f1, const H5FD_t *_f2) H5FD_SPLITTER_LOG_CALL(__func__); - HDassert(f1); - HDassert(f2); + assert(f1); + assert(f2); ret_value = H5FD_cmp(f1->rw_file, f2->rw_file); @@ -1211,9 +1211,9 @@ H5FD__splitter_get_handle(H5FD_t *_file, hid_t H5_ATTR_UNUSED fapl, void **file_ H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ - HDassert(file); - HDassert(file->rw_file); - HDassert(file_handle); + assert(file); + assert(file->rw_file); + assert(file_handle); /* Only do for R/W channel */ if (H5FD_get_vfd_handle(file->rw_file, file->fa.rw_fapl_id, file_handle) < 0) @@ -1241,8 +1241,8 @@ H5FD__splitter_lock(H5FD_t *_file, hbool_t rw) H5FD_SPLITTER_LOG_CALL(__func__); - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); /* Place the lock on each file */ if (H5FD_lock(file->rw_file, rw) < 0) @@ -1275,8 +1275,8 @@ H5FD__splitter_unlock(H5FD_t *_file) H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); /* Remove the lock on each file */ if (H5FD_unlock(file->rw_file) < 0) @@ -1320,7 +1320,7 @@ H5FD__splitter_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void * FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(file); + assert(file); switch (op_code) { /* Unknown op code */ @@ -1366,8 +1366,8 @@ H5FD__splitter_query(const H5FD_t *_file, unsigned long *flags /* out */) H5FD_SPLITTER_LOG_CALL(__func__); if (file) { - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); if (H5FDquery(file->rw_file, flags) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTLOCK, FAIL, "unable to query R/W file"); @@ -1403,8 +1403,8 @@ H5FD__splitter_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); /* Allocate memory for each file, only return the return value for R/W file. */ if ((ret_value = H5FDalloc(file->rw_file, type, dxpl_id, size)) == HADDR_UNDEF) @@ -1437,8 +1437,8 @@ H5FD__splitter_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); /* Retrieve memory type mapping for R/W channel only */ if (H5FD_get_fs_type_map(file->rw_file, type_map) < 0) @@ -1467,8 +1467,8 @@ H5FD__splitter_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ - HDassert(file); - HDassert(file->rw_file); + assert(file); + assert(file->rw_file); if (H5FDfree(file->rw_file, type, dxpl_id, addr, size) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free for R/W file") @@ -1499,7 +1499,7 @@ H5FD__splitter_delete(const char *filename, hid_t fapl_id) FUNC_ENTER_PACKAGE - HDassert(filename); + assert(filename); /* Get the driver info */ if (H5P_FILE_ACCESS_DEFAULT == fapl_id) { @@ -1566,9 +1566,9 @@ H5FD__splitter_log_error(const H5FD_splitter_t *file, const char *atfunc, const H5FD_SPLITTER_LOG_CALL(__func__); /* Check arguments */ - HDassert(file); - HDassert(atfunc && *atfunc); - HDassert(msg && *msg); + assert(file); + assert(atfunc && *atfunc); + assert(msg && *msg); if (file->logfp != NULL) { size_t size; diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index d403e3c..2211e6e 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -422,7 +422,7 @@ H5FD__ioc_get_default_config(H5FD_ioc_config_t *config_out) { herr_t ret_value = SUCCEED; - HDassert(config_out); + assert(config_out); HDmemset(config_out, 0, sizeof(*config_out)); @@ -455,7 +455,7 @@ H5FD__ioc_validate_config(const H5FD_ioc_config_t *fa) { herr_t ret_value = SUCCEED; - HDassert(fa != NULL); + assert(fa != NULL); if (fa->version != H5FD_IOC_CURR_FAPL_VERSION) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ioc_config_t version"); @@ -660,7 +660,7 @@ H5FD__ioc_fapl_copy(const void *_old_fa) H5FD_IOC_LOG_CALL(__func__); - HDassert(old_fa_ptr); + assert(old_fa_ptr); new_fa_ptr = H5FL_CALLOC(H5FD_ioc_config_t); if (NULL == new_fa_ptr) @@ -695,7 +695,7 @@ H5FD__ioc_fapl_free(void *_fapl) H5FD_IOC_LOG_CALL(__func__); /* Check arguments */ - HDassert(fapl); + assert(fapl); /* Free the property list */ fapl = H5FL_FREE(H5FD_ioc_config_t, fapl); @@ -904,7 +904,7 @@ H5FD__ioc_close_int(H5FD_ioc_t *file_ptr) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(file_ptr); + assert(file_ptr); if (MPI_SUCCESS != (mpi_code = MPI_Finalized(&mpi_finalized))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Finalized failed", mpi_code); @@ -990,8 +990,8 @@ H5FD__ioc_cmp(const H5FD_t *_f1, const H5FD_t *_f2) H5FD_IOC_LOG_CALL(__func__); - HDassert(f1); - HDassert(f2); + assert(f1); + assert(f2); ret_value = (f1->file_id > f2->file_id) - (f1->file_id < f2->file_id); @@ -1108,7 +1108,7 @@ H5FD__ioc_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) H5FD_IOC_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); + assert(file); ret_value = file->eoa; @@ -1134,7 +1134,7 @@ H5FD__ioc_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) H5FD_IOC_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); + assert(file); file->eoa = addr; @@ -1163,7 +1163,7 @@ H5FD__ioc_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) H5FD_IOC_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); + assert(file); sf_context = H5_get_subfiling_object(file->context_id); if (sf_context) { @@ -1222,8 +1222,8 @@ H5FD__ioc_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS H5FD_IOC_LOG_CALL(__func__); - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Check for overflow conditions */ if (!H5_addr_defined(addr)) @@ -1382,7 +1382,7 @@ H5FD__ioc_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ H5FD_IOC_LOG_CALL(__func__); - HDassert(file); + assert(file); /* TODO: placeholder for now since Subfiling does the truncation */ if (!H5_addr_eq(file->eoa, file->last_eoa)) { @@ -1454,7 +1454,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS))) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - HDassert(H5FD_IOC == H5P_peek_driver(plist)); + assert(H5FD_IOC == H5P_peek_driver(plist)); if (H5FD_mpi_self_initialized) { comm = MPI_COMM_WORLD; @@ -1610,10 +1610,10 @@ H5FD__ioc_write_vector_internal(H5FD_t *_file, uint32_t count, H5FD_mem_t H5_ATT int64_t sf_context_id = -1; herr_t ret_value = SUCCEED; - HDassert(_file); - HDassert(addrs); - HDassert(sizes); - HDassert(bufs); + assert(_file); + assert(addrs); + assert(sizes); + assert(bufs); if (count == 0) H5_SUBFILING_GOTO_DONE(SUCCEED); @@ -1622,7 +1622,7 @@ H5FD__ioc_write_vector_internal(H5FD_t *_file, uint32_t count, H5FD_mem_t H5_ATT if (NULL == (sf_context = H5_get_subfiling_object(sf_context_id))) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "can't get subfiling context from ID"); - HDassert(sf_context->topology); + assert(sf_context->topology); /* * Allocate an array of I/O requests and an array twice that size for @@ -1691,10 +1691,10 @@ H5FD__ioc_read_vector_internal(H5FD_t *_file, uint32_t count, haddr_t addrs[], s int64_t sf_context_id = -1; herr_t ret_value = SUCCEED; - HDassert(_file); - HDassert(addrs); - HDassert(sizes); - HDassert(bufs); + assert(_file); + assert(addrs); + assert(sizes); + assert(bufs); if (count == 0) H5_SUBFILING_GOTO_DONE(SUCCEED); @@ -1703,7 +1703,7 @@ H5FD__ioc_read_vector_internal(H5FD_t *_file, uint32_t count, haddr_t addrs[], s if (NULL == (sf_context = H5_get_subfiling_object(sf_context_id))) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "can't get subfiling context from ID"); - HDassert(sf_context->topology); + assert(sf_context->topology); /* * Allocate an array of I/O requests and an array for MPI_Request diff --git a/src/H5FDsubfiling/H5FDioc_int.c b/src/H5FDsubfiling/H5FDioc_int.c index ce5a000..afe6b16 100644 --- a/src/H5FDsubfiling/H5FDioc_int.c +++ b/src/H5FDsubfiling/H5FDioc_int.c @@ -32,12 +32,12 @@ calculate_target_ioc(int64_t file_offset, int64_t stripe_size, int num_io_concen int64_t subfile_row; int64_t subfile_idx; - HDassert(stripe_size > 0); - HDassert(num_io_concentrators > 0); - HDassert(num_subfiles > 0); - HDassert(target_ioc); - HDassert(ioc_file_offset); - HDassert(ioc_subfile_idx); + assert(stripe_size > 0); + assert(num_io_concentrators > 0); + assert(num_subfiles > 0); + assert(target_ioc); + assert(ioc_file_offset); + assert(ioc_subfile_idx); stripe_idx = file_offset / stripe_size; subfile_row = stripe_idx / num_subfiles; @@ -111,12 +111,12 @@ ioc__write_independent_async(int64_t context_id, int64_t offset, int64_t element int mpi_code; herr_t ret_value = SUCCEED; - HDassert(io_req); + assert(io_req); if (NULL == (sf_context = H5_get_subfiling_object(context_id))) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't get subfiling context from ID"); - HDassert(sf_context->topology); - HDassert(sf_context->topology->io_concentrators); + assert(sf_context->topology); + assert(sf_context->topology->io_concentrators); io_concentrators = sf_context->topology->io_concentrators; num_io_concentrators = sf_context->topology->n_io_concentrators; @@ -283,14 +283,14 @@ ioc__read_independent_async(int64_t context_id, int64_t offset, int64_t elements int mpi_code; herr_t ret_value = SUCCEED; - HDassert(io_req); + assert(io_req); H5_CHECK_OVERFLOW(elements, int64_t, int); if (NULL == (sf_context = H5_get_subfiling_object(context_id))) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't get subfiling context from ID"); - HDassert(sf_context->topology); - HDassert(sf_context->topology->io_concentrators); + assert(sf_context->topology); + assert(sf_context->topology->io_concentrators); io_concentrators = sf_context->topology->io_concentrators; num_io_concentrators = sf_context->topology->n_io_concentrators; @@ -426,7 +426,7 @@ ioc__async_completion(MPI_Request *mpi_reqs, size_t num_reqs) herr_t ret_value = SUCCEED; int mpi_code; - HDassert(mpi_reqs); + assert(mpi_reqs); H5_CHECK_OVERFLOW(num_reqs, size_t, int); if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int)num_reqs, mpi_reqs, MPI_STATUSES_IGNORE))) diff --git a/src/H5FDsubfiling/H5FDioc_priv.h b/src/H5FDsubfiling/H5FDioc_priv.h index 8dec1a8..cac2806 100644 --- a/src/H5FDsubfiling/H5FDioc_priv.h +++ b/src/H5FDsubfiling/H5FDioc_priv.h @@ -79,15 +79,15 @@ #define H5FD_IOC__Q_APPEND(q_ptr, entry_ptr) \ do { \ - HDassert(q_ptr); \ - HDassert((q_ptr)->magic == H5FD_IOC__IO_Q_MAGIC); \ - HDassert((((q_ptr)->q_len == 0) && ((q_ptr)->q_head == NULL) && ((q_ptr)->q_tail == NULL)) || \ + assert(q_ptr); \ + assert((q_ptr)->magic == H5FD_IOC__IO_Q_MAGIC); \ + assert((((q_ptr)->q_len == 0) && ((q_ptr)->q_head == NULL) && ((q_ptr)->q_tail == NULL)) || \ (((q_ptr)->q_len > 0) && ((q_ptr)->q_head != NULL) && ((q_ptr)->q_tail != NULL))); \ - HDassert(entry_ptr); \ - HDassert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ - HDassert((entry_ptr)->next == NULL); \ - HDassert((entry_ptr)->prev == NULL); \ - HDassert((entry_ptr)->in_progress == FALSE); \ + assert(entry_ptr); \ + assert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ + assert((entry_ptr)->next == NULL); \ + assert((entry_ptr)->prev == NULL); \ + assert((entry_ptr)->in_progress == FALSE); \ \ if ( ((q_ptr)->q_head) == NULL ) \ { \ @@ -105,15 +105,15 @@ do { #define H5FD_IOC__Q_REMOVE(q_ptr, entry_ptr) \ do { \ - HDassert(q_ptr); \ - HDassert((q_ptr)->magic == H5FD_IOC__IO_Q_MAGIC); \ - HDassert((((q_ptr)->q_len == 1) && ((q_ptr)->q_head ==((q_ptr)->q_tail)) && ((q_ptr)->q_head == (entry_ptr))) || \ + assert(q_ptr); \ + assert((q_ptr)->magic == H5FD_IOC__IO_Q_MAGIC); \ + assert((((q_ptr)->q_len == 1) && ((q_ptr)->q_head ==((q_ptr)->q_tail)) && ((q_ptr)->q_head == (entry_ptr))) || \ (((q_ptr)->q_len > 0) && ((q_ptr)->q_head != NULL) && ((q_ptr)->q_tail != NULL))); \ - HDassert(entry_ptr); \ - HDassert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ - HDassert((((q_ptr)->q_len == 1) && ((entry_ptr)->next == NULL) && ((entry_ptr)->prev == NULL)) || \ + assert(entry_ptr); \ + assert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ + assert((((q_ptr)->q_len == 1) && ((entry_ptr)->next == NULL) && ((entry_ptr)->prev == NULL)) || \ (((q_ptr)->q_len > 1) && (((entry_ptr)->next != NULL) || ((entry_ptr)->prev != NULL)))); \ - HDassert((entry_ptr)->in_progress == TRUE); \ + assert((entry_ptr)->in_progress == TRUE); \ \ { \ if ( (((q_ptr)->q_head)) == (entry_ptr) ) \ diff --git a/src/H5FDsubfiling/H5FDioc_threads.c b/src/H5FDsubfiling/H5FDioc_threads.c index abf816d..579b686 100644 --- a/src/H5FDsubfiling/H5FDioc_threads.c +++ b/src/H5FDsubfiling/H5FDioc_threads.c @@ -119,7 +119,7 @@ initialize_ioc_threads(void *_sf_context) double t_start = 0.0, t_end = 0.0; #endif - HDassert(sf_context); + assert(sf_context); /* * Allocate and initialize IOC data that will be passed @@ -213,12 +213,12 @@ finalize_ioc_threads(void *_sf_context) ioc_data_t *ioc_data = NULL; int ret_value = 0; - HDassert(sf_context); - HDassert(sf_context->topology->rank_is_ioc); + assert(sf_context); + assert(sf_context->topology->rank_is_ioc); ioc_data = sf_context->ioc_data; if (ioc_data) { - HDassert(0 == atomic_load(&ioc_data->sf_shutdown_flag)); + assert(0 == atomic_load(&ioc_data->sf_shutdown_flag)); /* Shutdown the main IOC thread */ atomic_store(&ioc_data->sf_shutdown_flag, 1); @@ -229,7 +229,7 @@ finalize_ioc_threads(void *_sf_context) } while (0 != atomic_load(&ioc_data->sf_shutdown_flag)); /* Tear down IOC worker thread pool */ - HDassert(0 == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(0 == atomic_load(&ioc_data->sf_io_ops_pending)); hg_thread_pool_destroy(ioc_data->io_thread_pool); hg_thread_mutex_destroy(&ioc_data->io_queue.q_mutex); @@ -345,10 +345,10 @@ ioc_main(ioc_data_t *ioc_data) int shutdown_requested; int ret_value = 0; - HDassert(ioc_data); + assert(ioc_data); context = H5_get_subfiling_object(ioc_data->sf_context_id); - HDassert(context); + assert(context); /* We can't have opened any files at this point.. * The file open approach has changed so that the normal @@ -416,7 +416,7 @@ ioc_main(ioc_data_t *ioc_data) ioc_io_queue_add_entry(ioc_data, &wk_req); - HDassert(atomic_load(&ioc_data->sf_io_ops_pending) >= 0); + assert(atomic_load(&ioc_data->sf_io_ops_pending) >= 0); } else { struct timespec sleep_spec = {0, IOC_MAIN_SLEEP_DELAY}; @@ -501,15 +501,15 @@ handle_work_request(void *arg) int op_ret; hg_thread_ret_t ret_value = 0; - HDassert(q_entry_ptr); - HDassert(q_entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); - HDassert(q_entry_ptr->in_progress); + assert(q_entry_ptr); + assert(q_entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(q_entry_ptr->in_progress); sf_context = H5_get_subfiling_object(file_context_id); - HDassert(sf_context); + assert(sf_context); ioc_data = sf_context->ioc_data; - HDassert(ioc_data); + assert(ioc_data); atomic_fetch_add(&ioc_data->sf_work_pending, 1); @@ -559,14 +559,14 @@ handle_work_request(void *arg) #ifdef H5FD_IOC_DEBUG { int curr_io_ops_pending = atomic_load(&ioc_data->sf_io_ops_pending); - HDassert(curr_io_ops_pending > 0); + assert(curr_io_ops_pending > 0); } #endif /* complete the I/O request */ ioc_io_queue_complete_entry(ioc_data, q_entry_ptr); - HDassert(atomic_load(&ioc_data->sf_io_ops_pending) >= 0); + assert(atomic_load(&ioc_data->sf_io_ops_pending) >= 0); /* Check the I/O Queue to see if there are any dispatchable entries */ ioc_io_queue_dispatch_eligible_entries(ioc_data, 1); @@ -617,7 +617,7 @@ send_ack_to_client(int ack_val, int dest_rank, int source_rank, int msg_tag, MPI int mpi_code; herr_t ret_value = SUCCEED; - HDassert(ack_val > 0); + assert(ack_val > 0); (void)source_rank; @@ -697,7 +697,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ int mpi_code; int ret_value = 0; - HDassert(msg); + assert(msg); file_context_id = msg->context_id; @@ -712,7 +712,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ } sf_context = H5_get_subfiling_object(file_context_id); - HDassert(sf_context); + assert(sf_context); stripe_id = file_offset + data_size; sf_eof = (haddr_t)(stripe_id % sf_context->sf_stripe_size); @@ -751,7 +751,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ * allows us to distinguish between multiple concurrent * writes from a single rank. */ - HDassert(H5FD_IOC_tag_ub_val_ptr && (*H5FD_IOC_tag_ub_val_ptr >= IO_TAG_BASE)); + assert(H5FD_IOC_tag_ub_val_ptr && (*H5FD_IOC_tag_ub_val_ptr >= IO_TAG_BASE)); rcv_tag = (int)(counter % (INT_MAX - IO_TAG_BASE)); rcv_tag %= (*H5FD_IOC_tag_ub_val_ptr - IO_TAG_BASE); rcv_tag += IO_TAG_BASE; @@ -787,7 +787,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ #endif - HDassert(subfile_idx < sf_context->sf_num_fids); + assert(subfile_idx < sf_context->sf_num_fids); sf_fid = sf_context->sf_fids[subfile_idx]; #ifdef H5_SUBFILING_DEBUG @@ -883,12 +883,12 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C int mpi_code; int ret_value = 0; - HDassert(msg); + assert(msg); file_context_id = msg->context_id; sf_context = H5_get_subfiling_object(file_context_id); - HDassert(sf_context); + assert(sf_context); /* * If we are using 1 subfile per IOC, we can optimize reads @@ -952,7 +952,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C * reads from a single rank, which can happen when a rank * owns multiple subfiles. */ - HDassert(H5FD_IOC_tag_ub_val_ptr && (*H5FD_IOC_tag_ub_val_ptr >= IO_TAG_BASE)); + assert(H5FD_IOC_tag_ub_val_ptr && (*H5FD_IOC_tag_ub_val_ptr >= IO_TAG_BASE)); send_tag = (int)(counter % (INT_MAX - IO_TAG_BASE)); send_tag %= (*H5FD_IOC_tag_ub_val_ptr - IO_TAG_BASE); send_tag += IO_TAG_BASE; @@ -964,7 +964,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C } /* Read data from the subfile */ - HDassert(subfile_idx < sf_context->sf_num_fids); + assert(subfile_idx < sf_context->sf_num_fids); sf_fid = sf_context->sf_fids[subfile_idx]; if (sf_fid < 0) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_BADVALUE, -1, "subfile file descriptor %d is invalid", sf_fid); @@ -1107,7 +1107,7 @@ ioc_file_read_data(int fd, int64_t file_offset, void *data_buffer, int64_t data_ file_offset += bytes_read; } else if (bytes_read == 0) { - HDassert(bytes_remaining > 0); + assert(bytes_remaining > 0); /* end of file but not end of format address space */ HDmemset(this_buffer, 0, (size_t)bytes_remaining); @@ -1145,7 +1145,7 @@ ioc_file_truncate(sf_work_request_t *msg) int mpi_code; int ret_value = 0; - HDassert(msg); + assert(msg); file_context_id = msg->context_id; ioc_idx = msg->ioc_idx; @@ -1160,7 +1160,7 @@ ioc_file_truncate(sf_work_request_t *msg) if (NULL == (sf_context = H5_get_subfiling_object(file_context_id))) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_CANTGET, -1, "couldn't retrieve subfiling context"); - HDassert(subfile_idx < sf_context->sf_num_fids); + assert(subfile_idx < sf_context->sf_num_fids); fd = sf_context->sf_fids[subfile_idx]; @@ -1219,7 +1219,7 @@ ioc_file_report_eof(sf_work_request_t *msg, MPI_Comm comm) int mpi_code; int ret_value = 0; - HDassert(msg); + assert(msg); file_context_id = msg->context_id; source = msg->source; @@ -1230,7 +1230,7 @@ ioc_file_report_eof(sf_work_request_t *msg, MPI_Comm comm) if (NULL == (sf_context = H5_get_subfiling_object(file_context_id))) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_CANTGET, -1, "couldn't retrieve subfiling context"); - HDassert(subfile_idx < sf_context->sf_num_fids); + assert(subfile_idx < sf_context->sf_num_fids); fd = sf_context->sf_fids[subfile_idx]; @@ -1326,21 +1326,21 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr) { ioc_io_queue_entry_t *entry_ptr = NULL; - HDassert(ioc_data); - HDassert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); - HDassert(wk_req_ptr); + assert(ioc_data); + assert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); + assert(wk_req_ptr); entry_ptr = ioc_io_queue_alloc_entry(); - HDassert(entry_ptr); - HDassert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(entry_ptr); + assert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); HDmemcpy((void *)(&(entry_ptr->wk_req)), (const void *)wk_req_ptr, sizeof(sf_work_request_t)); /* must obtain io_queue mutex before appending */ hg_thread_mutex_lock(&ioc_data->io_queue.q_mutex); - HDassert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); entry_ptr->counter = ioc_data->io_queue.req_counter++; @@ -1360,7 +1360,7 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr) atomic_load(&ioc_data->sf_io_ops_pending)); #endif - HDassert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); + assert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); #ifdef H5FD_IOC_COLLECT_STATS entry_ptr->q_time = H5_now_usec(); @@ -1398,7 +1398,7 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr) } #endif - HDassert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); hg_thread_mutex_unlock(&ioc_data->io_queue.q_mutex); @@ -1457,8 +1457,8 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) ioc_io_queue_entry_t *entry_ptr = NULL; ioc_io_queue_entry_t *scan_ptr = NULL; - HDassert(ioc_data); - HDassert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); + assert(ioc_data); + assert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); if (try_lock) { if (hg_thread_mutex_try_lock(&ioc_data->io_queue.q_mutex) < 0) @@ -1470,11 +1470,11 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) entry_ptr = ioc_data->io_queue.q_head; /* sanity check on first element in the I/O queue */ - HDassert((entry_ptr == NULL) || (entry_ptr->prev == NULL)); + assert((entry_ptr == NULL) || (entry_ptr->prev == NULL)); while ((entry_ptr) && (ioc_data->io_queue.num_pending > 0)) { - HDassert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); /* Check for a get EOF or truncate operation at head of queue */ if (ioc_data->io_queue.q_head->in_progress) { @@ -1499,7 +1499,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) scan_ptr = entry_ptr->prev; - HDassert((scan_ptr == NULL) || (scan_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC)); + assert((scan_ptr == NULL) || (scan_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC)); if ((entry_ptr->wk_req.tag == TRUNC_OP) || (entry_ptr->wk_req.tag == GET_EOF_OP)) { @@ -1539,18 +1539,18 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) if (!conflict_detected) { /* dispatch I/O request */ - HDassert(scan_ptr == NULL); - HDassert(!entry_ptr->in_progress); + assert(scan_ptr == NULL); + assert(!entry_ptr->in_progress); entry_ptr->in_progress = TRUE; - HDassert(ioc_data->io_queue.num_pending > 0); + assert(ioc_data->io_queue.num_pending > 0); ioc_data->io_queue.num_pending--; ioc_data->io_queue.num_in_progress++; - HDassert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == - ioc_data->io_queue.q_len); + assert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == + ioc_data->io_queue.q_len); entry_ptr->thread_wk.func = handle_work_request; entry_ptr->thread_wk.args = entry_ptr; @@ -1583,7 +1583,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) entry_ptr = entry_ptr->next; } - HDassert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); hg_thread_mutex_unlock(&ioc_data->io_queue.q_mutex); } /* ioc_io_queue_dispatch_eligible_entries() */ @@ -1616,16 +1616,16 @@ ioc_io_queue_complete_entry(ioc_data_t *ioc_data, ioc_io_queue_entry_t *entry_pt uint64_t execution_time; #endif - HDassert(ioc_data); - HDassert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); - HDassert(entry_ptr); - HDassert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(ioc_data); + assert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); + assert(entry_ptr); + assert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); /* must obtain io_queue mutex before deleting and updating stats */ hg_thread_mutex_lock(&ioc_data->io_queue.q_mutex); - HDassert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); - HDassert(ioc_data->io_queue.num_in_progress > 0); + assert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); + assert(ioc_data->io_queue.num_in_progress > 0); if (entry_ptr->wk_ret < 0) ioc_data->io_queue.num_failed++; @@ -1634,7 +1634,7 @@ ioc_io_queue_complete_entry(ioc_data_t *ioc_data, ioc_io_queue_entry_t *entry_pt ioc_data->io_queue.num_in_progress--; - HDassert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); + assert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); atomic_fetch_sub(&ioc_data->sf_io_ops_pending, 1); @@ -1652,10 +1652,10 @@ ioc_io_queue_complete_entry(ioc_data_t *ioc_data, ioc_io_queue_entry_t *entry_pt * there aren't other operations in progress */ if ((entry_ptr->wk_req.tag == GET_EOF_OP) || (entry_ptr->wk_req.tag == TRUNC_OP)) - HDassert(ioc_data->io_queue.num_in_progress == 0); + assert(ioc_data->io_queue.num_in_progress == 0); #endif - HDassert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); #ifdef H5FD_IOC_COLLECT_STATS /* Compute the queued and execution time */ @@ -1696,10 +1696,10 @@ static void ioc_io_queue_free_entry(ioc_io_queue_entry_t *q_entry_ptr) { /* use assertions for error checking, since the following should never fail. */ - HDassert(q_entry_ptr); - HDassert(q_entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); - HDassert(q_entry_ptr->next == NULL); - HDassert(q_entry_ptr->prev == NULL); + assert(q_entry_ptr); + assert(q_entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(q_entry_ptr->next == NULL); + assert(q_entry_ptr->prev == NULL); q_entry_ptr->magic = 0; diff --git a/src/H5FDsubfiling/H5FDsubfile_int.c b/src/H5FDsubfiling/H5FDsubfile_int.c index 4c583e8..3a60af1 100644 --- a/src/H5FDsubfiling/H5FDsubfile_int.c +++ b/src/H5FDsubfiling/H5FDsubfile_int.c @@ -175,7 +175,7 @@ H5FD__subfiling__truncate_sub_files(hid_t context_id, int64_t logical_file_eof, } } - HDassert(test_file_eof == logical_file_eof); + assert(test_file_eof == logical_file_eof); } #endif /* NDEBUG */ } @@ -295,18 +295,18 @@ H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_eof_ptr) int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; /* Return value */ - HDassert(logical_eof_ptr); + assert(logical_eof_ptr); if (NULL == (sf_context = (subfiling_context_t *)H5_get_subfiling_object(context_id))) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "can't get subfile context"); - HDassert(sf_context->topology); + assert(sf_context->topology); n_io_concentrators = sf_context->topology->n_io_concentrators; num_subfiles = sf_context->sf_num_subfiles; - HDassert(n_io_concentrators > 0); - HDassert(num_subfiles >= n_io_concentrators); + assert(n_io_concentrators > 0); + assert(num_subfiles >= n_io_concentrators); if (NULL == (sf_eofs = HDmalloc((size_t)num_subfiles * sizeof(int64_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile EOFs array"); @@ -352,9 +352,9 @@ H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_eof_ptr) for (int i = 0; i < num_subfiles; i++) { int ioc_rank = (int)recv_msg[3 * i]; - HDassert(ioc_rank >= 0); - HDassert(ioc_rank < n_io_concentrators); - HDassert(sf_eofs[i] == -1); + assert(ioc_rank >= 0); + assert(ioc_rank < n_io_concentrators); + assert(sf_eofs[i] == -1); sf_eofs[i] = recv_msg[(3 * i) + 1]; } diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index 98a921b..e75b2f4 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -585,7 +585,7 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi char *h5_require_ioc; herr_t ret_value = SUCCEED; - HDassert(config_out); + assert(config_out); HDmemset(config_out, 0, sizeof(*config_out)); @@ -668,7 +668,7 @@ H5FD__subfiling_validate_config(const H5FD_subfiling_config_t *fa) { herr_t ret_value = SUCCEED; - HDassert(fa != NULL); + assert(fa != NULL); if (fa->version != H5FD_SUBFILING_CURR_FAPL_VERSION) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown H5FD_subfiling_config_t version"); @@ -706,7 +706,7 @@ H5FD__subfiling_sb_size(H5FD_t *_file) H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; hsize_t ret_value = 0; - HDassert(file); + assert(file); /* Configuration structure magic number */ ret_value += sizeof(uint32_t); @@ -1012,7 +1012,7 @@ H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr) int ret_value = 0; H5P_genplist_t *plist_ptr = NULL; - HDassert(id_out_ptr != NULL); + assert(id_out_ptr != NULL); if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "not a file access property list"); @@ -1091,7 +1091,7 @@ H5FD__subfiling_fapl_free(void *_fa) H5FD_subfiling_config_t *fa = (H5FD_subfiling_config_t *)_fa; herr_t ret_value = SUCCEED; - HDassert(fa != NULL); /* sanity check */ + assert(fa != NULL); /* sanity check */ if (fa->ioc_fapl_id >= 0 && H5I_dec_ref(fa->ioc_fapl_id) < 0) H5_SUBFILING_DONE_ERROR(H5E_PLIST, H5E_CANTDEC, FAIL, "can't close IOC FAPL"); @@ -1318,7 +1318,7 @@ H5FD__subfiling_close_int(H5FD_subfiling_t *file_ptr) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(file_ptr); + assert(file_ptr); if (MPI_SUCCESS != (mpi_code = MPI_Finalized(&mpi_finalized))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Finalized failed", mpi_code); @@ -1404,8 +1404,8 @@ H5FD__subfiling_cmp(const H5FD_t *_f1, const H5FD_t *_f2) const H5FD_subfiling_t *f2 = (const H5FD_subfiling_t *)_f2; int ret_value = 0; - HDassert(f1); - HDassert(f2); + assert(f1); + assert(f2); ret_value = H5FD_cmp(f1->sf_file, f2->sf_file); @@ -1585,8 +1585,8 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i int num_subfiles; herr_t ret_value = SUCCEED; - HDassert(file_ptr && file_ptr->pub.cls); - HDassert(buf); + assert(file_ptr && file_ptr->pub.cls); + assert(buf); /* Check for overflow conditions */ if (!H5_addr_defined(addr)) @@ -1636,8 +1636,8 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i * underlying I/O operations. */ sf_context = (subfiling_context_t *)H5_get_subfiling_object(file_ptr->context_id); - HDassert(sf_context); - HDassert(sf_context->topology); + assert(sf_context); + assert(sf_context->topology); num_subfiles = sf_context->sf_num_subfiles; @@ -1820,8 +1820,8 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ int num_subfiles; herr_t ret_value = SUCCEED; - HDassert(file_ptr && file_ptr->pub.cls); - HDassert(buf); + assert(file_ptr && file_ptr->pub.cls); + assert(buf); /* Check for overflow conditions */ if (!H5_addr_defined(addr)) @@ -1868,8 +1868,8 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ * underlying I/O operations. */ sf_context = (subfiling_context_t *)H5_get_subfiling_object(file_ptr->context_id); - HDassert(sf_context); - HDassert(sf_context->topology); + assert(sf_context); + assert(sf_context->topology); num_subfiles = sf_context->sf_num_subfiles; @@ -2137,8 +2137,8 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m H5FD_mem_t type; haddr_t eoa; - HDassert((count == 0) || (sizes[0] != 0)); - HDassert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); + assert((count == 0) || (sizes[0] != 0)); + assert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); if (H5CX_get_io_xfer_mode(&xfer_mode) < 0) H5_SUBFILING_GOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, @@ -2254,7 +2254,7 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_INDEPENDENT; herr_t ret_value = SUCCEED; /* Return value */ - HDassert(file_ptr != NULL); /* sanity check */ + assert(file_ptr != NULL); /* sanity check */ /* Check arguments * RAW - Do we really need to check arguments once again? @@ -2297,8 +2297,8 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ H5FD_mem_t type; haddr_t eoa; - HDassert((count == 0) || (sizes[0] != 0)); - HDassert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); + assert((count == 0) || (sizes[0] != 0)); + assert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); if (H5CX_get_io_xfer_mode(&xfer_mode) < 0) H5_SUBFILING_GOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, @@ -2390,7 +2390,7 @@ H5FD__subfiling_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5 H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - HDassert(file); + assert(file); /* Extend the file to make sure it's large enough */ if (!H5_addr_eq(file->eoa, file->last_eoa)) { @@ -2469,7 +2469,7 @@ H5FD__subfiling_lock(H5FD_t *_file, hbool_t rw) H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - HDassert(file); + assert(file); if (file->fa.require_ioc) { #ifdef VERBOSE @@ -2502,7 +2502,7 @@ H5FD__subfiling_unlock(H5FD_t *_file) H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - HDassert(file); + assert(file); if (H5FD_unlock(file->sf_file) < 0) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file"); @@ -2581,14 +2581,14 @@ H5FD__subfiling_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void herr_t ret_value = SUCCEED; /* Return value */ /* Sanity checks */ - HDassert(file); - HDassert(H5FD_SUBFILING == file->pub.driver_id); + assert(file); + assert(H5FD_SUBFILING == file->pub.driver_id); switch (op_code) { case H5FD_CTL_GET_MPI_COMMUNICATOR_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); /* * Return a separate MPI communicator to the caller so @@ -2603,14 +2603,14 @@ H5FD__subfiling_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void break; case H5FD_CTL_GET_MPI_RANK_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); **((int **)output) = file->mpi_rank; break; case H5FD_CTL_GET_MPI_SIZE_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); **((int **)output) = file->mpi_size; break; @@ -2740,17 +2740,17 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne int num_subfiles = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(sf_context->sf_stripe_size > 0); - HDassert(sf_context->sf_blocksize_per_stripe > 0); - HDassert(sf_context->sf_num_subfiles > 0); - HDassert(sf_context->topology); - HDassert(mem_buf_offset); - HDassert(target_file_offset); - HDassert(io_block_len); - HDassert(first_subfile_index); - HDassert(n_subfiles_used); - HDassert(max_io_req_per_subfile); + assert(sf_context); + assert(sf_context->sf_stripe_size > 0); + assert(sf_context->sf_blocksize_per_stripe > 0); + assert(sf_context->sf_num_subfiles > 0); + assert(sf_context->topology); + assert(mem_buf_offset); + assert(target_file_offset); + assert(io_block_len); + assert(first_subfile_index); + assert(n_subfiles_used); + assert(max_io_req_per_subfile); *first_subfile_index = 0; *n_subfiles_used = 0; @@ -2808,8 +2808,8 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne /* Determine the size of data written to the first and last stripes */ start_length = MIN(data_size, (stripe_size - offset_in_stripe)); final_length = (start_length == data_size ? 0 : final_offset % stripe_size); - HDassert(start_length <= stripe_size); - HDassert(final_length <= stripe_size); + assert(start_length <= stripe_size); + assert(final_length <= stripe_size); /* * Determine which subfile the I/O request begins in and which @@ -2960,8 +2960,8 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne } if (thin_uniform_section) { - HDassert(iovec_depth > 1); - HDassert(num_full_stripes > 1); + assert(iovec_depth > 1); + assert(num_full_stripes > 1); iovec_depth--; num_full_stripes--; @@ -3033,7 +3033,7 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne row_offset += block_size; } - HDassert(offset_in_block <= block_size); + assert(offset_in_block <= block_size); } if (total_bytes != data_size) @@ -3077,11 +3077,11 @@ iovec_fill_first(subfiling_context_t *sf_context, int64_t iovec_depth, int64_t t int64_t total_bytes = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(mem_offset_out); - HDassert(target_file_offset_out); - HDassert(io_block_len_out); - HDassert(iovec_depth > 0); + assert(sf_context); + assert(mem_offset_out); + assert(target_file_offset_out); + assert(io_block_len_out); + assert(iovec_depth > 0); stripe_size = sf_context->sf_stripe_size; block_size = sf_context->sf_blocksize_per_stripe; @@ -3176,11 +3176,11 @@ iovec_fill_last(subfiling_context_t *sf_context, int64_t iovec_depth, int64_t ta int64_t total_bytes = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(mem_offset_out); - HDassert(target_file_offset_out); - HDassert(io_block_len_out); - HDassert(iovec_depth > 0); + assert(sf_context); + assert(mem_offset_out); + assert(target_file_offset_out); + assert(io_block_len_out); + assert(iovec_depth > 0); stripe_size = sf_context->sf_stripe_size; block_size = sf_context->sf_blocksize_per_stripe; @@ -3308,11 +3308,11 @@ iovec_fill_first_last(subfiling_context_t *sf_context, int64_t iovec_depth, int6 int64_t total_bytes = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(mem_offset_out); - HDassert(target_file_offset_out); - HDassert(io_block_len_out); - HDassert(iovec_depth > 0); + assert(sf_context); + assert(mem_offset_out); + assert(target_file_offset_out); + assert(io_block_len_out); + assert(iovec_depth > 0); stripe_size = sf_context->sf_stripe_size; block_size = sf_context->sf_blocksize_per_stripe; @@ -3418,11 +3418,11 @@ iovec_fill_uniform(subfiling_context_t *sf_context, int64_t iovec_depth, int64_t int64_t total_bytes = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(mem_offset_out); - HDassert(target_file_offset_out); - HDassert(io_block_len_out); - HDassert((iovec_depth > 0) || (target_datasize == 0)); + assert(sf_context); + assert(mem_offset_out); + assert(target_file_offset_out); + assert(io_block_len_out); + assert((iovec_depth > 0) || (target_datasize == 0)); stripe_size = sf_context->sf_stripe_size; block_size = sf_context->sf_blocksize_per_stripe; diff --git a/src/H5FDsubfiling/H5subfiling_common.c b/src/H5FDsubfiling/H5subfiling_common.c index 7dac2db..2874e64 100644 --- a/src/H5FDsubfiling/H5subfiling_common.c +++ b/src/H5FDsubfiling/H5subfiling_common.c @@ -186,7 +186,7 @@ H5_get_subfiling_object(int64_t object_id) * If we had to make more space, the given object index * should always fall within range after a single re-allocation */ - HDassert((size_t)obj_index < sf_context_cache_size); + assert((size_t)obj_index < sf_context_cache_size); } /* @@ -194,11 +194,11 @@ H5_get_subfiling_object(int64_t object_id) * application exit, context entry indices should just be * consecutive */ - HDassert((size_t)obj_index <= sf_context_cache_num_entries); + assert((size_t)obj_index <= sf_context_cache_num_entries); if ((size_t)obj_index < sf_context_cache_num_entries) ret_value = sf_context_cache[obj_index]; else { - HDassert(!sf_context_cache[sf_context_cache_num_entries]); + assert(!sf_context_cache[sf_context_cache_num_entries]); /* Allocate a new subfiling context object */ if (NULL == (ret_value = HDcalloc(1, sizeof(subfiling_context_t)))) @@ -244,7 +244,7 @@ H5_get_subfiling_object(int64_t object_id) * If we had to make more space, the given object index * should always fall within range after a single re-allocation */ - HDassert((size_t)obj_index < sf_topology_cache_size); + assert((size_t)obj_index < sf_topology_cache_size); } /* @@ -252,11 +252,11 @@ H5_get_subfiling_object(int64_t object_id) * application exit, topology entry indices should just be * consecutive */ - HDassert((size_t)obj_index <= sf_topology_cache_num_entries); + assert((size_t)obj_index <= sf_topology_cache_num_entries); if ((size_t)obj_index < sf_topology_cache_num_entries) ret_value = sf_topology_cache[obj_index]; else { - HDassert(!sf_topology_cache[sf_topology_cache_num_entries]); + assert(!sf_topology_cache[sf_topology_cache_num_entries]); /* Allocate a new subfiling topology object */ if (NULL == (ret_value = HDmalloc(sizeof(sf_topology_t)))) @@ -308,15 +308,15 @@ H5_free_subfiling_object(int64_t object_id) if (H5_free_subfiling_object_int(sf_context) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "couldn't free subfiling object"); - HDassert(sf_context_cache_num_entries > 0); - HDassert(sf_context == sf_context_cache[sf_context_cache_num_entries - 1]); + assert(sf_context_cache_num_entries > 0); + assert(sf_context == sf_context_cache[sf_context_cache_num_entries - 1]); sf_context_cache[sf_context_cache_num_entries - 1] = NULL; sf_context_cache_num_entries--; } else { sf_topology_t *sf_topology; - HDassert(obj_type == SF_TOPOLOGY); + assert(obj_type == SF_TOPOLOGY); if (NULL == (sf_topology = H5_get_subfiling_object(object_id))) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, @@ -325,8 +325,8 @@ H5_free_subfiling_object(int64_t object_id) if (H5_free_subfiling_topology(sf_topology) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "couldn't free subfiling topology"); - HDassert(sf_topology_cache_num_entries > 0); - HDassert(sf_topology == sf_topology_cache[sf_topology_cache_num_entries - 1]); + assert(sf_topology_cache_num_entries > 0); + assert(sf_topology == sf_topology_cache[sf_topology_cache_num_entries - 1]); sf_topology_cache[sf_topology_cache_num_entries - 1] = NULL; sf_topology_cache_num_entries--; } @@ -342,7 +342,7 @@ H5_free_subfiling_object_int(subfiling_context_t *sf_context) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(sf_context); + assert(sf_context); if (MPI_SUCCESS != (mpi_code = MPI_Finalized(&mpi_finalized))) { /* Assume MPI is finalized or worse, and try to clean up what we can */ @@ -432,7 +432,7 @@ H5_free_subfiling_topology(sf_topology_t *topology) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(topology); + assert(topology); if (MPI_SUCCESS != (mpi_code = MPI_Finalized(&mpi_finalized))) { /* Assume MPI is finalized or worse, but clean up what we can */ @@ -448,7 +448,7 @@ H5_free_subfiling_topology(sf_topology_t *topology) for (size_t i = 0; i < sf_topology_cache_num_entries; i++) if (topology == sf_topology_cache[i]) topology_cached = TRUE; - HDassert(topology_cached); + assert(topology_cached); } #endif @@ -758,7 +758,7 @@ init_subfiling(const char *base_filename, uint64_t file_id, H5FD_subfiling_param int mpi_code; herr_t ret_value = SUCCEED; - HDassert(context_id_out); + assert(context_id_out); if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mpi_code); @@ -960,11 +960,11 @@ init_app_topology(H5FD_subfiling_params_t *subfiling_config, MPI_Comm comm, MPI_ int mpi_code; herr_t ret_value = SUCCEED; - HDassert(subfiling_config); - HDassert(MPI_COMM_NULL != comm); - HDassert(MPI_COMM_NULL != node_comm); - HDassert(app_topology_out); - HDassert(!*app_topology_out); + assert(subfiling_config); + assert(MPI_COMM_NULL != comm); + assert(MPI_COMM_NULL != node_comm); + assert(app_topology_out); + assert(!*app_topology_out); if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &comm_rank))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mpi_code); @@ -1098,7 +1098,7 @@ init_app_topology(H5FD_subfiling_params_t *subfiling_config, MPI_Comm comm, MPI_ if (find_cached_topology_info(comm, subfiling_config, iocs_per_node, &app_topology) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't check for cached subfiling topology object"); - HDassert(!app_topology || (app_topology->selection_type == ioc_selection_type)); + assert(!app_topology || (app_topology->selection_type == ioc_selection_type)); if (!app_topology) { /* Generate an ID for the application topology object */ @@ -1121,10 +1121,10 @@ init_app_topology(H5FD_subfiling_params_t *subfiling_config, MPI_Comm comm, MPI_ if (init_app_layout(app_topology, comm, node_comm) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "couldn't initialize application layout"); - HDassert(app_topology->app_layout); - HDassert(app_topology->app_layout->layout); - HDassert(app_topology->app_layout->node_ranks); - HDassert(app_topology->app_layout->node_count > 0); + assert(app_topology->app_layout); + assert(app_topology->app_layout->layout); + assert(app_topology->app_layout->node_ranks); + assert(app_topology->app_layout->node_count > 0); /* * Now that the application node count has been determined, adjust the @@ -1186,8 +1186,8 @@ get_ioc_selection_criteria_from_env(H5FD_subfiling_ioc_select_t *ioc_selection_t char *env_value = HDgetenv(H5FD_SUBFILING_IOC_SELECTION_CRITERIA); herr_t ret_value = SUCCEED; - HDassert(ioc_selection_type); - HDassert(ioc_sel_info_str); + assert(ioc_selection_type); + assert(ioc_sel_info_str); *ioc_sel_info_str = NULL; @@ -1259,7 +1259,7 @@ find_cached_topology_info(MPI_Comm comm, H5FD_subfiling_params_t *subf_config, l int32_t stripe_count; herr_t ret_value = SUCCEED; - HDassert(subf_config); + assert(subf_config); ioc_selection_type = subf_config->ioc_selection; stripe_count = subf_config->stripe_count; @@ -1269,7 +1269,7 @@ find_cached_topology_info(MPI_Comm comm, H5FD_subfiling_params_t *subf_config, l int result; int mpi_code; - HDassert(cached_topology); + assert(cached_topology); /* * If the selection types differ, just reject the cached topology @@ -1289,8 +1289,8 @@ find_cached_topology_info(MPI_Comm comm, H5FD_subfiling_params_t *subf_config, l } if (cached_topology->selection_type == SELECT_IOC_ONE_PER_NODE) { - HDassert(iocs_per_node >= 1); - HDassert(cached_topology->app_layout->node_count > 0); + assert(iocs_per_node >= 1); + assert(cached_topology->app_layout->node_count > 0); /* * If a IOCs-per-node setting was set in the environment and would @@ -1332,10 +1332,10 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(app_topology); - HDassert(!app_topology->app_layout); - HDassert(MPI_COMM_NULL != comm); - HDassert(MPI_COMM_NULL != node_comm); + assert(app_topology); + assert(!app_topology->app_layout); + assert(MPI_COMM_NULL != comm); + assert(MPI_COMM_NULL != node_comm); if (NULL == (app_layout = HDcalloc(1, sizeof(*app_layout)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, @@ -1370,7 +1370,7 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) if (app_layout->layout[i].node_local_rank == 0) app_layout->node_count++; - HDassert(app_layout->node_count > 0); + assert(app_layout->node_count > 0); if (NULL == (app_layout->node_ranks = HDmalloc((size_t)app_layout->node_count * sizeof(*app_layout->node_ranks)))) @@ -1383,7 +1383,7 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) */ for (size_t i = 0, node_rank_index = 0; i < (size_t)app_layout->world_size; i++) { if (app_layout->layout[i].node_local_rank == 0) { - HDassert(node_rank_index < (size_t)app_layout->node_count); + assert(node_rank_index < (size_t)app_layout->node_count); app_layout->node_ranks[node_rank_index++] = app_layout->layout[i].rank; } } @@ -1428,9 +1428,9 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com int mpi_code; herr_t ret_value = SUCCEED; - HDassert(app_layout); - HDassert(app_layout->layout); - HDassert(MPI_COMM_NULL != comm); + assert(app_layout); + assert(app_layout->layout); + assert(MPI_COMM_NULL != comm); sf_world_rank = app_layout->world_rank; sf_world_size = app_layout->world_size; @@ -1481,7 +1481,7 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com #else int aggr_comm_size = 0; - HDassert(MPI_COMM_NULL != intra_comm); + assert(MPI_COMM_NULL != intra_comm); /* Split the file communicator into a sub-group of one rank per node */ if (MPI_SUCCESS != (mpi_code = MPI_Comm_split(comm, node_local_rank, sf_world_rank, &aggr_comm))) @@ -1612,12 +1612,12 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) int max_iocs = 0; herr_t ret_value = SUCCEED; - HDassert(app_topology); - HDassert(!app_topology->io_concentrators); - HDassert(app_topology->n_io_concentrators > 0); - HDassert(app_topology->app_layout); - HDassert(app_topology->app_layout->layout); - HDassert(app_topology->app_layout->node_count > 0); + assert(app_topology); + assert(!app_topology->io_concentrators); + assert(app_topology->n_io_concentrators > 0); + assert(app_topology->app_layout); + assert(app_topology->app_layout->layout); + assert(app_topology->app_layout->node_count > 0); app_layout = app_topology->app_layout; @@ -1638,13 +1638,13 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) if (app_topology->n_io_concentrators > app_layout->node_count) iocs_per_node = app_topology->n_io_concentrators / app_layout->node_count; - HDassert(app_layout->node_ranks); + assert(app_layout->node_ranks); for (size_t i = 0; i < (size_t)app_layout->node_count; i++) { int node_index = app_layout->node_ranks[i]; int local_size = app_layout->layout[node_index].node_local_size; - HDassert(total_ioc_count < app_topology->n_io_concentrators); + assert(total_ioc_count < app_topology->n_io_concentrators); io_concentrators[total_ioc_count] = app_layout->layout[node_index++].rank; if (app_layout->world_rank == io_concentrators[total_ioc_count]) { @@ -1660,7 +1660,7 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) if (j >= (size_t)local_size) break; - HDassert(total_ioc_count < app_topology->n_io_concentrators); + assert(total_ioc_count < app_topology->n_io_concentrators); io_concentrators[total_ioc_count] = app_layout->layout[node_index++].rank; if (app_layout->world_rank == io_concentrators[total_ioc_count]) { @@ -1686,7 +1686,7 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) int num_iocs_assigned = 0; int world_size = app_layout->world_size; - HDassert(rank_stride > 0); + assert(rank_stride > 0); for (int i = 0; num_iocs_assigned < max_iocs; num_iocs_assigned++) { int ioc_index = rank_stride * i++; @@ -1749,15 +1749,15 @@ init_subfiling_context(subfiling_context_t *sf_context, const char *base_filenam int mpi_code; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(sf_context->topology == NULL); - HDassert(sf_context->sf_context_id >= 0); - HDassert(base_filename); - HDassert(file_id != UINT64_MAX); - HDassert(subfiling_config); - HDassert(app_topology); - HDassert(app_topology->n_io_concentrators > 0); - HDassert(MPI_COMM_NULL != file_comm); + assert(sf_context); + assert(sf_context->topology == NULL); + assert(sf_context->sf_context_id >= 0); + assert(base_filename); + assert(file_id != UINT64_MAX); + assert(subfiling_config); + assert(app_topology); + assert(app_topology->n_io_concentrators > 0); + assert(MPI_COMM_NULL != file_comm); sf_context->h5_file_id = file_id; sf_context->sf_fids = NULL; @@ -1888,7 +1888,7 @@ init_subfiling_context(subfiling_context_t *sf_context, const char *base_filenam H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid subfiling stripe count (%d)", sf_context->sf_num_subfiles); - HDassert(sf_context->sf_num_subfiles >= app_topology->n_io_concentrators); + assert(sf_context->sf_num_subfiles >= app_topology->n_io_concentrators); done: H5_SUBFILING_FUNC_LEAVE; @@ -1932,8 +1932,8 @@ open_subfile_with_context(subfiling_context_t *sf_context, int file_acc_flags) { herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(sf_context->h5_file_id != UINT64_MAX); + assert(sf_context); + assert(sf_context->h5_file_id != UINT64_MAX); /* * Save the HDF5 file ID (e.g., inode) to subfile context mapping. @@ -2131,13 +2131,13 @@ ioc_open_files(int64_t file_context_id, int file_acc_flags) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "couldn't get subfiling object from context ID"); - HDassert(sf_context->h5_file_id != UINT64_MAX); - HDassert(sf_context->h5_filename); - HDassert(sf_context->sf_fids); - HDassert(sf_context->sf_num_subfiles > 0); - HDassert(sf_context->sf_num_fids > 0); - HDassert(sf_context->topology); - HDassert(sf_context->topology->ioc_idx >= 0); /* Only IOC ranks should be here */ + assert(sf_context->h5_file_id != UINT64_MAX); + assert(sf_context->h5_filename); + assert(sf_context->sf_fids); + assert(sf_context->sf_num_subfiles > 0); + assert(sf_context->sf_num_fids > 0); + assert(sf_context->topology); + assert(sf_context->topology->ioc_idx >= 0); /* Only IOC ranks should be here */ /* Get the basename of the full HDF5 filename */ if (H5_basename(sf_context->h5_filename, &base) < 0) @@ -2264,10 +2264,10 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c int ret = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(base_filename); - HDassert(config_dir); - HDassert(subfile_dir); + assert(sf_context); + assert(base_filename); + assert(config_dir); + assert(subfile_dir); if (sf_context->h5_file_id == UINT64_MAX) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "invalid HDF5 file ID %" PRIu64, @@ -2394,11 +2394,11 @@ open_config_file(const char *base_filename, const char *config_dir, uint64_t fil int ret = 0; herr_t ret_value = SUCCEED; - HDassert(base_filename); - HDassert(config_dir); - HDassert(file_id != UINT64_MAX); - HDassert(mode); - HDassert(config_file_out); + assert(base_filename); + assert(config_dir); + assert(file_id != UINT64_MAX); + assert(mode); + assert(config_file_out); *config_file_out = NULL; @@ -2466,7 +2466,7 @@ H5_get_subfiling_config_from_file(FILE *config_file, int64_t *stripe_size, int64 long config_file_len = 0; herr_t ret_value = SUCCEED; - HDassert(config_file); + assert(config_file); if (HDfseek(config_file, 0, SEEK_END) < 0) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_SEEKERROR, FAIL, @@ -2561,8 +2561,8 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat int mpi_code; herr_t ret_value = SUCCEED; - HDassert(filepath); - HDassert(resolved_filepath); + assert(filepath); + assert(resolved_filepath); if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mpi_code); diff --git a/src/H5FL.c b/src/H5FL.c index e68f33e..ee68273 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -319,8 +319,8 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj) FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ - HDassert(head); - HDassert(obj); + assert(head); + assert(obj); #ifdef H5FL_TRACK { @@ -353,7 +353,7 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj) #endif /* H5FL_DEBUG */ /* Make certain that the free list is initialized */ - HDassert(head->init); + assert(head->init); /* Link into the free list */ ((H5FL_reg_node_t *)obj)->next = head->list; @@ -403,7 +403,7 @@ H5FL_reg_malloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ - HDassert(head); + assert(head); /* Make certain the list is initialized first */ if (!head->init) @@ -436,7 +436,7 @@ H5FL_reg_malloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) #ifdef H5FL_TRACK /* Copy allocation location information */ ((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack(); - HDassert(((H5FL_track_t *)ret_value)->stack); + assert(((H5FL_track_t *)ret_value)->stack); /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler) * there's no need to duplicate them. */ @@ -480,7 +480,7 @@ H5FL_reg_calloc(H5FL_reg_head_t *head H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ - HDassert(head); + assert(head); /* Allocate the block */ if (NULL == (ret_value = H5FL_reg_malloc(head H5FL_TRACK_INFO_INT))) @@ -575,7 +575,7 @@ H5FL__reg_gc(void) } /* end while */ /* Double check that all the memory on the free lists is recycled */ - HDassert(H5FL_reg_gc_head.mem_freed == 0); + assert(H5FL_reg_gc_head.mem_freed == 0); done: FUNC_LEAVE_NOAPI(ret_value) @@ -814,7 +814,7 @@ H5FL_blk_free_block_avail(H5FL_blk_head_t *head, size_t size) FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ - HDassert(head); + assert(head); /* check if there is a free list for blocks of this size */ /* and if there are any blocks available on the list */ @@ -852,8 +852,8 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ - HDassert(head); - HDassert(size); + assert(head); + assert(size); /* Make certain the list is initialized first */ if (!head->init) @@ -881,7 +881,7 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) if (NULL == free_list) /* Create a new list node and insert it to the queue */ free_list = H5FL__blk_create_list(&(head->head), size); - HDassert(free_list); + assert(free_list); /* Allocate new node, with room for the page info header and the actual page data */ if (NULL == @@ -904,7 +904,7 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) #ifdef H5FL_TRACK /* Copy allocation location information */ ((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack(); - HDassert(((H5FL_track_t *)ret_value)->stack); + assert(((H5FL_track_t *)ret_value)->stack); /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler) * there's no need to duplicate them. */ @@ -952,8 +952,8 @@ H5FL_blk_calloc(H5FL_blk_head_t *head, size_t size H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ - HDassert(head); - HDassert(size); + assert(head); + assert(size); /* Allocate the block */ if (NULL == (ret_value = H5FL_blk_malloc(head, size H5FL_TRACK_INFO_INT))) @@ -995,8 +995,8 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block) FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ - HDassert(head); - HDassert(block); + assert(head); + assert(block); #ifdef H5FL_TRACK { @@ -1099,8 +1099,8 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_ FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ - HDassert(head); - HDassert(new_size); + assert(head); + assert(new_size); /* Check if we are actually re-allocating a block */ if (block != NULL) { @@ -1140,7 +1140,7 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_ /* Store new tracking information */ trk.stack = H5CS_copy_stack(); - HDassert(trk.stack); + assert(trk.stack); /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler) * there's no need to duplicate them. */ @@ -1189,7 +1189,7 @@ H5FL__blk_gc_list(H5FL_blk_head_t *head) H5FL_blk_list_t *list; /* The free list of native nodes of a particular size */ /* Sanity check */ - HDassert((blk_head->onlist && blk_head->list) || (0 == blk_head->onlist && NULL == blk_head->list)); + assert((blk_head->onlist && blk_head->list) || (0 == blk_head->onlist && NULL == blk_head->list)); /* Loop through all the blocks in the free list, freeing them */ list = blk_head->list; @@ -1245,7 +1245,7 @@ H5FL__blk_gc_list(H5FL_blk_head_t *head) head->onlist = 0; /* Double check that all the memory on this list is recycled */ - HDassert(0 == head->list_mem); + assert(0 == head->list_mem); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FL__blk_gc_list() */ @@ -1283,7 +1283,7 @@ H5FL__blk_gc(void) } /* end while */ /* Double check that all the memory on the free lists are recycled */ - HDassert(H5FL_blk_gc_head.mem_freed == 0); + assert(H5FL_blk_gc_head.mem_freed == 0); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1431,10 +1431,10 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj) HGOTO_DONE(NULL) /* Double check parameters */ - HDassert(head); + assert(head); /* Make certain that the free list is initialized */ - HDassert(head->init); + assert(head->init); #ifdef H5FL_TRACK { @@ -1477,7 +1477,7 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj) free_nelem = temp->nelem; /* Double-check that there is enough room for arrays of this size */ - HDassert((int)free_nelem <= head->maxelem); + assert((int)free_nelem <= head->maxelem); /* Link into the free list */ temp->next = head->list_arr[free_nelem].list; @@ -1533,8 +1533,8 @@ H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ - HDassert(head); - HDassert(elem); + assert(head); + assert(elem); /* Make certain the list is initialized first */ if (!head->init) @@ -1542,7 +1542,7 @@ H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem H5FL_TRACK_PARAMS) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, NULL, "can't initialize 'array' blocks") /* Sanity check that the number of elements is supported */ - HDassert(elem <= (unsigned)head->maxelem); + assert(elem <= (unsigned)head->maxelem); /* Get the set of the memory block */ mem_size = head->list_arr[elem].size; @@ -1585,7 +1585,7 @@ H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem H5FL_TRACK_PARAMS) #ifdef H5FL_TRACK /* Copy allocation location information */ ((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack(); - HDassert(((H5FL_track_t *)ret_value)->stack); + assert(((H5FL_track_t *)ret_value)->stack); /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler) * there's no need to duplicate them. */ @@ -1629,8 +1629,8 @@ H5FL_arr_calloc(H5FL_arr_head_t *head, size_t elem H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI(NULL) /* Double check parameters */ - HDassert(head); - HDassert(elem); + assert(head); + assert(elem); /* Allocate the array */ if (NULL == (ret_value = H5FL_arr_malloc(head, elem H5FL_TRACK_INFO_INT))) @@ -1664,8 +1664,8 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void *obj, size_t new_elem H5FL_TRACK_PA FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ - HDassert(head); - HDassert(new_elem); + assert(head); + assert(new_elem); /* Check if we are really allocating the object */ if (obj == NULL) @@ -1674,7 +1674,7 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void *obj, size_t new_elem H5FL_TRACK_PA H5FL_arr_list_t *temp; /* Temp. ptr to the new free list node allocated */ /* Sanity check that the number of elements is supported */ - HDassert((int)new_elem <= head->maxelem); + assert((int)new_elem <= head->maxelem); /* Get the pointer to the info header in front of the block to free */ temp = (H5FL_arr_list_t *)(( @@ -1713,7 +1713,7 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void *obj, size_t new_elem H5FL_TRACK_PA /* Store new tracking information */ trk.stack = H5CS_copy_stack(); - HDassert(trk.stack); + assert(trk.stack); /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler) * there's no need to duplicate them. */ @@ -1787,7 +1787,7 @@ H5FL__arr_gc_list(H5FL_arr_head_t *head) } /* end for */ /* Double check that all the memory on this list is recycled */ - HDassert(head->list_mem == 0); + assert(head->list_mem == 0); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FL__arr_gc_list() */ @@ -1825,7 +1825,7 @@ H5FL__arr_gc(void) } /* end while */ /* Double check that all the memory on the free lists are recycled */ - HDassert(H5FL_arr_gc_head.mem_freed == 0); + assert(H5FL_arr_gc_head.mem_freed == 0); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1916,11 +1916,11 @@ H5FL_seq_free(H5FL_seq_head_t *head, void *obj) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Double check parameters */ - HDassert(head); - HDassert(obj); + assert(head); + assert(obj); /* Make certain that the free list is initialized */ - HDassert(head->queue.init); + assert(head->queue.init); /* Use block routine */ H5FL_blk_free(&(head->queue), obj); @@ -1949,8 +1949,8 @@ H5FL_seq_malloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ - HDassert(head); - HDassert(elem); + assert(head); + assert(elem); /* Use block routine */ ret_value = H5FL_blk_malloc(&(head->queue), head->size * elem H5FL_TRACK_INFO_INT); @@ -1979,8 +1979,8 @@ H5FL_seq_calloc(H5FL_seq_head_t *head, size_t elem H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ - HDassert(head); - HDassert(elem); + assert(head); + assert(elem); /* Use block routine */ ret_value = H5FL_blk_calloc(&(head->queue), head->size * elem H5FL_TRACK_INFO_INT); @@ -2009,8 +2009,8 @@ H5FL_seq_realloc(H5FL_seq_head_t *head, void *obj, size_t new_elem H5FL_TRACK_PA FUNC_ENTER_NOAPI_NOERR /* Double check parameters */ - HDassert(head); - HDassert(new_elem); + assert(head); + assert(new_elem); /* Use block routine */ ret_value = H5FL_blk_realloc(&(head->queue), obj, head->size * new_elem H5FL_TRACK_INFO_INT); @@ -2041,7 +2041,7 @@ H5FL_fac_init(size_t size) FUNC_ENTER_NOAPI(NULL) /* Sanity check */ - HDassert(size > 0); + assert(size > 0); /* Allocate room for the new factory */ if (NULL == (factory = (H5FL_fac_head_t *)H5FL_CALLOC(H5FL_fac_head_t))) @@ -2111,8 +2111,8 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj) FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ - HDassert(head); - HDassert(obj); + assert(head); + assert(obj); #ifdef H5FL_TRACK { @@ -2145,7 +2145,7 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj) #endif /* H5FL_DEBUG */ /* Make certain that the free list is initialized */ - HDassert(head->init); + assert(head->init); /* Link into the free list */ ((H5FL_fac_node_t *)obj)->next = head->list; @@ -2196,8 +2196,8 @@ H5FL_fac_malloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ - HDassert(head); - HDassert(head->init); + assert(head); + assert(head->init); /* Check for nodes available on the free list first */ if (head->list != NULL) { @@ -2225,7 +2225,7 @@ H5FL_fac_malloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) #ifdef H5FL_TRACK /* Copy allocation location information */ ((H5FL_track_t *)ret_value)->stack = H5CS_copy_stack(); - HDassert(((H5FL_track_t *)ret_value)->stack); + assert(((H5FL_track_t *)ret_value)->stack); /* The 'call_func' & 'call_file' strings are statically allocated (by the compiler) * there's no need to duplicate them. */ @@ -2270,7 +2270,7 @@ H5FL_fac_calloc(H5FL_fac_head_t *head H5FL_TRACK_PARAMS) FUNC_ENTER_NOAPI_NOINIT /* Double check parameters */ - HDassert(head); + assert(head); /* Allocate the block */ if (NULL == (ret_value = H5FL_fac_malloc(head H5FL_TRACK_INFO_INT))) @@ -2365,7 +2365,7 @@ H5FL__fac_gc(void) } /* end while */ /* Double check that all the memory on the free lists is recycled */ - HDassert(H5FL_fac_gc_head.mem_freed == 0); + assert(H5FL_fac_gc_head.mem_freed == 0); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2394,7 +2394,7 @@ H5FL_fac_term(H5FL_fac_head_t *factory) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(factory); + assert(factory); /* Garbage collect all the blocks in the factory's free list */ if (H5FL__fac_gc_list(factory) < 0) @@ -2409,7 +2409,7 @@ H5FL_fac_term(H5FL_fac_head_t *factory) H5FL_fac_gc_node_t *last = factory->prev_gc; /* Garbage collection node before the one being removed */ - HDassert(last->next->list == factory); + assert(last->next->list == factory); tmp = last->next->next; last->next = H5FL_FREE(H5FL_fac_gc_node_t, last->next); last->next = tmp; @@ -2417,7 +2417,7 @@ H5FL_fac_term(H5FL_fac_head_t *factory) tmp->list->prev_gc = last; } else { - HDassert(H5FL_fac_gc_head.first->list == factory); + assert(H5FL_fac_gc_head.first->list == factory); tmp = H5FL_fac_gc_head.first->next; H5FL_fac_gc_head.first = H5FL_FREE(H5FL_fac_gc_node_t, H5FL_fac_gc_head.first); H5FL_fac_gc_head.first = tmp; @@ -2462,7 +2462,7 @@ H5FL__fac_term_all(void) #endif /* H5FL_DEBUG */ /* The list cannot have any allocations outstanding */ - HDassert(H5FL_fac_gc_head.first->list->allocated == 0); + assert(H5FL_fac_gc_head.first->list->allocated == 0); /* Reset the "initialized" flag, in case we restart this list somehow (I don't know how..) */ H5FL_fac_gc_head.first->list->init = FALSE; @@ -2610,7 +2610,7 @@ H5FL_get_free_list_sizes(size_t *reg_size, size_t *arr_size, size_t *blk_size, s H5FL_reg_head_t *reg_list = gc_node->list; /* Head of list */ /* Sanity check */ - HDassert(reg_list->init); + assert(reg_list->init); /* Add the amount of memory for this list */ *reg_size += (reg_list->size * reg_list->allocated); @@ -2631,7 +2631,7 @@ H5FL_get_free_list_sizes(size_t *reg_size, size_t *arr_size, size_t *blk_size, s H5FL_arr_head_t *head = gc_arr_node->list; /* Head of array list elements */ /* Sanity check */ - HDassert(head->init); + assert(head->init); /* Check for any allocated elements in this list */ if (head->allocated > 0) { diff --git a/src/H5FO.c b/src/H5FO.c index cb40254..5ebd8a9 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -73,8 +73,8 @@ H5FO_create(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Create container used to store open object info */ if ((f->shared->open_objs = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL) @@ -113,15 +113,15 @@ H5FO_opened(const H5F_t *f, haddr_t addr) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->open_objs); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->shared); + assert(f->shared->open_objs); + assert(H5_addr_defined(addr)); /* Get the object node from the container */ if (NULL != (open_obj = (H5FO_open_obj_t *)H5SL_search(f->shared->open_objs, &addr))) { ret_value = open_obj->obj; - HDassert(ret_value != NULL); + assert(ret_value != NULL); } /* end if */ else ret_value = NULL; @@ -159,11 +159,11 @@ H5FO_insert(const H5F_t *f, haddr_t addr, void *obj, hbool_t delete_flag) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->open_objs); - HDassert(H5_addr_defined(addr)); - HDassert(obj); + assert(f); + assert(f->shared); + assert(f->shared->open_objs); + assert(H5_addr_defined(addr)); + assert(obj); /* Allocate new opened object information structure */ if ((open_obj = H5FL_MALLOC(H5FO_open_obj_t)) == NULL) @@ -210,10 +210,10 @@ H5FO_delete(H5F_t *f, haddr_t addr) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->open_objs); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->shared); + assert(f->shared->open_objs); + assert(H5_addr_defined(addr)); /* Remove from container */ if (NULL == (open_obj = (H5FO_open_obj_t *)H5SL_remove(f->shared->open_objs, &addr))) @@ -260,10 +260,10 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->open_objs); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->shared); + assert(f->shared->open_objs); + assert(H5_addr_defined(addr)); /* Get the object node from the container */ if (NULL != (open_obj = (H5FO_open_obj_t *)H5SL_search(f->shared->open_objs, &addr))) @@ -303,10 +303,10 @@ H5FO_marked(const H5F_t *f, haddr_t addr) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->open_objs); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->shared); + assert(f->shared->open_objs); + assert(H5_addr_defined(addr)); /* Get the object node from the container */ if (NULL != (open_obj = (H5FO_open_obj_t *)H5SL_search(f->shared->open_objs, &addr))) @@ -341,9 +341,9 @@ H5FO_dest(const H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->open_objs); + assert(f); + assert(f->shared); + assert(f->shared->open_objs); /* Check if the object info set is empty */ if (H5SL_count(f->shared->open_objs) != 0) @@ -385,7 +385,7 @@ H5FO_top_create(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); + assert(f); /* Create container used to store open object info */ if ((f->obj_count = H5SL_create(H5SL_TYPE_HADDR, NULL)) == NULL) @@ -423,9 +423,9 @@ H5FO_top_incr(const H5F_t *f, haddr_t addr) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->obj_count); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->obj_count); + assert(H5_addr_defined(addr)); /* Get the object node from the container */ if (NULL != (obj_count = (H5FO_obj_count_t *)H5SL_search(f->obj_count, &addr))) { @@ -477,9 +477,9 @@ H5FO_top_decr(const H5F_t *f, haddr_t addr) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->obj_count); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->obj_count); + assert(H5_addr_defined(addr)); /* Get the object node from the container */ if (NULL != (obj_count = (H5FO_obj_count_t *)H5SL_search(f->obj_count, &addr))) { @@ -530,9 +530,9 @@ H5FO_top_count(const H5F_t *f, haddr_t addr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->obj_count); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->obj_count); + assert(H5_addr_defined(addr)); /* Get the object node from the container */ if (NULL != (obj_count = (H5FO_obj_count_t *)H5SL_search(f->obj_count, &addr))) @@ -569,8 +569,8 @@ H5FO_top_dest(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->obj_count); + assert(f); + assert(f->obj_count); /* Check if the object count set is empty */ if (H5SL_count(f->obj_count) != 0) diff --git a/src/H5FS.c b/src/H5FS.c index 4cea930..5e8c82f 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -100,10 +100,10 @@ H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_create, uint16_t #endif /* H5FS_DEBUG */ /* Check arguments. */ - HDassert(fs_create->shrink_percent); - HDassert(fs_create->shrink_percent < fs_create->expand_percent); - HDassert(fs_create->max_sect_size); - HDassert(nclasses == 0 || classes); + assert(fs_create->shrink_percent); + assert(fs_create->shrink_percent < fs_create->expand_percent); + assert(fs_create->max_sect_size); + assert(nclasses == 0 || classes); /* * Allocate free space structure @@ -185,9 +185,9 @@ H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class #endif /* H5FS_DEBUG */ /* Check arguments. */ - HDassert(H5_addr_defined(fs_addr)); - HDassert(nclasses); - HDassert(classes); + assert(H5_addr_defined(fs_addr)); + assert(nclasses); + assert(classes); /* Initialize user data for protecting the free space manager */ cache_udata.f = f; @@ -209,7 +209,7 @@ H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class #endif /* H5FS_DEBUG */ /* Increment the reference count on the free space manager header */ - HDassert(fspace->rc <= 1); + assert(fspace->rc <= 1); if (H5FS__incr(fspace) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINC, NULL, "unable to increment ref. count on free space header") @@ -252,8 +252,8 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr) #endif /* H5FS_DEBUG */ /* Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(fs_addr)); + assert(f); + assert(H5_addr_defined(fs_addr)); /* Initialize user data for protecting the free space manager */ /* (no class information necessary for delete) */ @@ -268,7 +268,7 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr) unsigned fspace_status = 0; /* Free space section info's status in the metadata cache */ /* Sanity check */ - HDassert(H5_addr_defined(fs_addr)); + assert(H5_addr_defined(fs_addr)); /* Check the free space section info's status in the metadata cache */ if (H5AC_get_entry_status(f, fs_addr, &fspace_status) < 0) @@ -314,7 +314,7 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr) HGOTO_ERROR(H5E_FSPACE, H5E_CANTPROTECT, FAIL, "unable to protect free space header") /* Sanity check */ - HDassert(fspace->sinfo == NULL); + assert(fspace->sinfo == NULL); /* Delete serialized section storage, if there are any */ #ifdef H5FS_DEBUG @@ -324,8 +324,8 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr) unsigned sinfo_status = 0; /* Free space section info's status in the metadata cache */ /* Sanity check */ - HDassert(H5_addr_defined(fspace->sect_addr)); - HDassert(fspace->alloc_sect_size > 0); + assert(H5_addr_defined(fspace->sect_addr)); + assert(fspace->alloc_sect_size > 0); /* Check the free space section info's status in the metadata cache */ if (H5AC_get_entry_status(f, fspace->sect_addr, &sinfo_status) < 0) @@ -335,8 +335,8 @@ H5FS_delete(H5F_t *f, haddr_t fs_addr) /* If the free space section info is in the cache, expunge it now */ if (sinfo_status & H5AC_ES__IN_CACHE) { /* Sanity checks on direct block */ - HDassert(!(sinfo_status & H5AC_ES__IS_PINNED)); - HDassert(!(sinfo_status & H5AC_ES__IS_PROTECTED)); + assert(!(sinfo_status & H5AC_ES__IS_PINNED)); + assert(!(sinfo_status & H5AC_ES__IS_PROTECTED)); #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Expunging free space section info from cache\n", __func__); @@ -401,8 +401,8 @@ H5FS_close(H5F_t *f, H5FS_t *fspace) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(f); - HDassert(fspace); + assert(f); + assert(fspace); #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Entering, fspace = %p, fspace->addr = %" PRIuHADDR ", fspace->sinfo = %p\n", __func__, (void *)fspace, fspace->addr, (void *)fspace->sinfo); @@ -430,7 +430,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace) /* Check if the section info is "floating" */ if (!H5_addr_defined(fspace->sect_addr)) { /* Sanity check */ - HDassert(fspace->sect_size > 0); + assert(fspace->sect_size > 0); /* Allocate space for the section info in file */ if (H5F_USE_TMP_SPACE(f)) { @@ -454,7 +454,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace) } /* end if */ else /* Sanity check that section info has address */ - HDassert(H5_addr_defined(fspace->sect_addr)); + assert(H5_addr_defined(fspace->sect_addr)); /* Cache the free space section info */ if (H5AC_insert_entry(f, H5AC_FSPACE_SINFO, fspace->sect_addr, fspace->sinfo, @@ -469,7 +469,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace) if (H5_addr_defined(fspace->sect_addr)) { /* Sanity check */ /* (section info should only be in the file if the header is */ - HDassert(H5_addr_defined(fspace->addr)); + assert(H5_addr_defined(fspace->addr)); #ifdef H5FS_DEBUG HDfprintf(stderr, "%s: Section info allocated though\n", __func__); @@ -567,7 +567,7 @@ H5FS_close(H5F_t *f, H5FS_t *fspace) /* Just sanity checks... */ if (fspace->serial_sect_count > 0) /* Sanity check that section info has address */ - HDassert(H5_addr_defined(fspace->sect_addr)); + assert(H5_addr_defined(fspace->sect_addr)); } /* end else */ /* Decrement the reference count on the free space manager header */ @@ -604,7 +604,7 @@ H5FS__new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(nclasses == 0 || (nclasses > 0 && classes)); + assert(nclasses == 0 || (nclasses > 0 && classes)); /* * Allocate free space structure @@ -622,7 +622,7 @@ H5FS__new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes /* Initialize the section classes for this free space list */ for (u = 0; u < nclasses; u++) { /* Make certain that section class type can be used as an array index into this array */ - HDassert(u == classes[u]->type); + assert(u == classes[u]->type); /* Copy the class information into the free space manager */ H5MM_memcpy(&fspace->sect_cls[u], classes[u], sizeof(H5FS_section_class_t)); @@ -681,8 +681,8 @@ H5FS_size(const H5FS_t *fspace, hsize_t *meta_size) /* * Check arguments. */ - HDassert(fspace); - HDassert(meta_size); + assert(fspace); + assert(meta_size); /* Get the free space size info */ *meta_size += fspace->hdr_size + (fspace->sinfo ? fspace->sect_size : fspace->alloc_sect_size); @@ -716,7 +716,7 @@ H5FS__incr(H5FS_t *fspace) /* * Check arguments. */ - HDassert(fspace); + assert(fspace); /* Check if we should pin the header in the cache */ if (fspace->rc == 0 && H5_addr_defined(fspace->addr)) @@ -756,7 +756,7 @@ H5FS__decr(H5FS_t *fspace) /* * Check arguments. */ - HDassert(fspace); + assert(fspace); /* Decrement reference count on header */ fspace->rc--; @@ -797,7 +797,7 @@ H5FS__dirty(H5FS_t *fspace) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(fspace); + assert(fspace); /* Check if the free space manager is persistent */ if (H5_addr_defined(fspace->addr)) @@ -829,8 +829,8 @@ H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(f); - HDassert(fspace); + assert(f); + assert(fspace); if (!H5_addr_defined(fspace->addr)) { /* Allocate space for the free space header */ @@ -869,8 +869,8 @@ H5FS_alloc_sect(H5F_t *f, H5FS_t *fspace) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(f); - HDassert(fspace); + assert(f); + assert(fspace); if (!H5_addr_defined(fspace->sect_addr) && fspace->sinfo && fspace->serial_sect_count > 0) { if (HADDR_UNDEF == (fspace->sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) @@ -918,8 +918,8 @@ H5FS_free(H5F_t *f, H5FS_t *fspace, hbool_t free_file_space) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(f); - HDassert(fspace); + assert(f); + assert(fspace); cache_flags = H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG; @@ -1033,7 +1033,7 @@ H5FS__hdr_dest(H5FS_t *fspace) /* * Check arguments. */ - HDassert(fspace); + assert(fspace); /* Terminate the section classes for this free space list */ for (u = 0; u < fspace->nclasses; u++) { @@ -1074,8 +1074,8 @@ H5FS__sinfo_free_sect_cb(void *_sect, void H5_ATTR_UNUSED *key, void *op_data) FUNC_ENTER_PACKAGE_NOERR - HDassert(sect); - HDassert(sinfo); + assert(sect); + assert(sinfo); /* Call the section's class 'free' method on the section */ (*sinfo->fspace->sect_cls[sect->type].free)(sect); @@ -1102,8 +1102,8 @@ H5FS__sinfo_free_node_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) FUNC_ENTER_PACKAGE_NOERR - HDassert(fspace_node); - HDassert(op_data); + assert(fspace_node); + assert(op_data); /* Release the skip list for sections of this size */ H5SL_destroy(fspace_node->sect_list, H5FS__sinfo_free_sect_cb, op_data); @@ -1137,9 +1137,9 @@ H5FS__sinfo_dest(H5FS_sinfo_t *sinfo) /* * Check arguments. */ - HDassert(sinfo); - HDassert(sinfo->fspace); - HDassert(sinfo->bins); + assert(sinfo); + assert(sinfo->fspace); + assert(sinfo->bins); /* Clear out lists of nodes */ for (u = 0; u < sinfo->nbins; u++) @@ -1180,8 +1180,8 @@ H5FS_get_sect_count(const H5FS_t *frsp, hsize_t *tot_sect_count) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(frsp); - HDassert(tot_sect_count); + assert(frsp); + assert(tot_sect_count); /* Report statistics for free space */ *tot_sect_count = frsp->serial_sect_count; @@ -1214,14 +1214,14 @@ H5FS__assert(const H5FS_t *fspace) H5FS__sect_assert(fspace); /* General assumptions about the section size counts */ - HDassert(fspace->sinfo->tot_size_count >= fspace->sinfo->serial_size_count); - HDassert(fspace->sinfo->tot_size_count >= fspace->sinfo->ghost_size_count); + assert(fspace->sinfo->tot_size_count >= fspace->sinfo->serial_size_count); + assert(fspace->sinfo->tot_size_count >= fspace->sinfo->ghost_size_count); } /* end if */ /* General assumptions about the section counts */ - HDassert(fspace->tot_sect_count >= fspace->serial_sect_count); - HDassert(fspace->tot_sect_count >= fspace->ghost_sect_count); - HDassert(fspace->tot_sect_count == (fspace->serial_sect_count + fspace->ghost_sect_count)); + assert(fspace->tot_sect_count >= fspace->serial_sect_count); + assert(fspace->tot_sect_count >= fspace->ghost_sect_count); + assert(fspace->tot_sect_count == (fspace->serial_sect_count + fspace->ghost_sect_count)); FUNC_LEAVE_NOAPI_VOID } /* end H5FS__assert() */ diff --git a/src/H5FScache.c b/src/H5FScache.c index ed04cb5..529c896 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -160,9 +160,9 @@ H5FS__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->f); - HDassert(image_len); + assert(udata); + assert(udata->f); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5FS_HEADER_SIZE(udata->f); @@ -194,7 +194,7 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -235,9 +235,9 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(udata); - HDassert(udata->f); + assert(image); + assert(udata); + assert(udata->f); /* Allocate a new free space manager */ if (NULL == (fspace = H5FS__new(udata->f, udata->nclasses, udata->classes, udata->cls_init_udata))) @@ -307,7 +307,7 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) <= len); + assert((size_t)(image - (const uint8_t *)_image) <= len); /* Set return value */ ret_value = fspace; @@ -342,9 +342,9 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(fspace); - HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); - HDassert(image_len); + assert(fspace); + assert(fspace->cache_info.type == H5AC_FSPACE_HDR); + assert(image_len); /* Set the image length size */ *image_len = fspace->hdr_size; @@ -391,13 +391,13 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(fspace); - HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); - HDassert(H5_addr_defined(addr)); - HDassert(new_addr); - HDassert(new_len); - HDassert(flags); + assert(f); + assert(fspace); + assert(fspace->cache_info.type == H5AC_FSPACE_HDR); + assert(H5_addr_defined(addr)); + assert(new_addr); + assert(new_len); + assert(flags); if (fspace->sinfo) { H5AC_ring_t ring; @@ -489,7 +489,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT */ if (fspace->serial_sect_count > 0 && H5_addr_defined(fspace->addr)) { /* Sanity check */ - HDassert(fspace->sect_size > 0); + assert(fspace->sect_size > 0); if (!H5_addr_defined(fspace->sect_addr)) { /* case 1 */ haddr_t tag = HADDR_UNDEF; @@ -538,7 +538,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT HGOTO_ERROR_TAG(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't add free space sections to cache") H5_END_TAG - HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); + assert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); /* the metadata cache is now managing the section info, * so set fspace->sinfo to NULL. @@ -556,8 +556,8 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT * be the case. If not, we will have to add code to resize * file space allocation for section info as well as moving it. */ - HDassert(fspace->sect_size > 0); - HDassert(fspace->alloc_sect_size == (size_t)fspace->sect_size); + assert(fspace->sect_size > 0); + assert(fspace->alloc_sect_size == (size_t)fspace->sect_size); /* Allocate space for the section info in file */ if (HADDR_UNDEF == @@ -566,7 +566,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT "file allocation failed for free space sections") fspace->alloc_sect_size = (size_t)fspace->sect_size; - HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); + assert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); /* Let the metadata cache know the section info moved */ if (H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr) < 0) @@ -579,15 +579,15 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT * be the case. If not, we will have to add code to resize * file space allocation for section info. */ - HDassert(fspace->sect_size > 0); - HDassert(fspace->alloc_sect_size == (size_t)fspace->sect_size); + assert(fspace->sect_size > 0); + assert(fspace->alloc_sect_size == (size_t)fspace->sect_size); } /* end else */ } /* end else */ else { /* for one reason or another (see comment above) there should * not be any file space allocated for the section info. */ - HDassert(!H5_addr_defined(fspace->sect_addr)); + assert(!H5_addr_defined(fspace->sect_addr)); } /* end else */ } /* end if */ else if (H5_addr_defined(fspace->sect_addr)) { @@ -599,8 +599,8 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT * a nonsense section info address. */ if (!H5F_POINT_OF_NO_RETURN(f)) { - HDassert(fspace->sect_size > 0); - HDassert(fspace->alloc_sect_size == (size_t)fspace->sect_size); + assert(fspace->sect_size > 0); + assert(fspace->alloc_sect_size == (size_t)fspace->sect_size); } /* end if */ if (H5F_IS_TMP_ADDR(f, fspace->sect_addr)) { @@ -618,9 +618,9 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT if (H5AC_get_entry_status(f, fspace->sect_addr, §_status) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info status") - HDassert(sect_status & H5AC_ES__IN_CACHE); - HDassert((sect_status & H5AC_ES__IS_PROTECTED) == 0); - HDassert((sect_status & H5AC_ES__IS_PINNED) == 0); + assert(sect_status & H5AC_ES__IN_CACHE); + assert((sect_status & H5AC_ES__IS_PROTECTED) == 0); + assert((sect_status & H5AC_ES__IS_PINNED) == 0); /* Allocate space for the section info in file */ if (HADDR_UNDEF == @@ -630,7 +630,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT fspace->alloc_sect_size = (size_t)fspace->sect_size; /* Sanity check */ - HDassert(!H5_addr_eq(fspace->sect_addr, new_sect_addr)); + assert(!H5_addr_eq(fspace->sect_addr, new_sect_addr)); /* Let the metadata cache know the section info moved */ if (H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, fspace->sect_addr, new_sect_addr) < 0) @@ -646,8 +646,8 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_AT } /* end else-if */ else { /* there is no section info at present */ /* do some sanity checks */ - HDassert(fspace->serial_sect_count == 0); - HDassert(fspace->tot_sect_count == fspace->ghost_sect_count); + assert(fspace->serial_sect_count == 0); + assert(fspace->tot_sect_count == fspace->ghost_sect_count); } /* end else */ /* what ever happened above, set *flags to 0 */ @@ -688,11 +688,11 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(fspace); - HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); - HDassert(fspace->hdr_size == len); + assert(f); + assert(image); + assert(fspace); + assert(fspace->cache_info.type == H5AC_FSPACE_HDR); + assert(fspace->hdr_size == len); /* The section information does not always exits, and if it does, * it is not always in the cache. To make matters more interesting, @@ -702,11 +702,11 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN * into real file space if necessary before this function was called. * The following asserts are a cursory check on this. */ - HDassert((!H5_addr_defined(fspace->sect_addr)) || (!H5F_IS_TMP_ADDR(f, fspace->sect_addr))); + assert((!H5_addr_defined(fspace->sect_addr)) || (!H5F_IS_TMP_ADDR(f, fspace->sect_addr))); if (!H5F_POINT_OF_NO_RETURN(f)) - HDassert((!H5_addr_defined(fspace->sect_addr)) || - ((fspace->sect_size > 0) && (fspace->alloc_sect_size == (size_t)fspace->sect_size))); + assert((!H5_addr_defined(fspace->sect_addr)) || + ((fspace->sect_size > 0) && (fspace->alloc_sect_size == (size_t)fspace->sect_size))); /* Magic number */ H5MM_memcpy(image, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -763,7 +763,7 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN UINT32ENCODE(image, metadata_chksum); /* sanity checks */ - HDassert((size_t)(image - (uint8_t *)_image) == fspace->hdr_size); + assert((size_t)(image - (uint8_t *)_image) == fspace->hdr_size); FUNC_LEAVE_NOAPI(ret_value) } /* H5FS__cache_hdr_serialize() */ @@ -789,7 +789,7 @@ H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(fspace); + assert(fspace); /* Determine which action to take */ switch (action) { @@ -817,7 +817,7 @@ H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ @@ -847,11 +847,11 @@ H5FS__cache_hdr_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(fspace); - HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); + assert(fspace); + assert(fspace->cache_info.type == H5AC_FSPACE_HDR); /* We should not still be holding on to the free space section info */ - HDassert(!fspace->sinfo); + assert(!fspace->sinfo); /* Destroy free space header */ if (H5FS__hdr_dest(fspace) < 0) @@ -884,11 +884,11 @@ H5FS__cache_sinfo_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(udata); + assert(udata); fspace = udata->fspace; - HDassert(fspace); - HDassert(fspace->sect_size > 0); - HDassert(image_len); + assert(fspace); + assert(fspace->sect_size > 0); + assert(image_len); /* Set the image length size */ *image_len = (size_t)(fspace->sect_size); @@ -920,7 +920,7 @@ H5FS__cache_sinfo_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -964,12 +964,12 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); fspace = udata->fspace; - HDassert(fspace); - HDassert(fspace->sect_size == len); - HDassert(dirty); + assert(fspace); + assert(fspace->sect_size == len); + assert(dirty); /* Allocate a new free space section info */ if (NULL == (sinfo = H5FS__sinfo_new(udata->f, fspace))) @@ -1022,11 +1022,11 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l /* The number of sections of this node's size */ UINT64DECODE_VAR(image, node_count, sect_cnt_size); - HDassert(node_count); + assert(node_count); /* The size of the sections for this node */ UINT64DECODE_VAR(image, sect_size, sinfo->sect_len_size); - HDassert(sect_size); + assert(sect_size); /* Loop over nodes of this size */ for (u = 0; u < node_count; u++) { @@ -1043,7 +1043,7 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l /* Call 'deserialize' callback for this section */ des_flags = 0; - HDassert(fspace->sect_cls[sect_type].deserialize); + assert(fspace->sect_cls[sect_type].deserialize); if (NULL == (new_sect = (*fspace->sect_cls[sect_type].deserialize)( &fspace->sect_cls[sect_type], image, sect_addr, sect_size, &des_flags))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTDECODE, NULL, "can't deserialize section") @@ -1064,12 +1064,12 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l } while (image < (((const uint8_t *)_image + old_sect_size) - H5FS_SIZEOF_CHKSUM)); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) <= (old_sect_size - H5FS_SIZEOF_CHKSUM)); - HDassert(old_sect_size == fspace->sect_size); - HDassert(old_tot_sect_count == fspace->tot_sect_count); - HDassert(old_serial_sect_count == fspace->serial_sect_count); - HDassert(old_ghost_sect_count == fspace->ghost_sect_count); - HDassert(old_tot_space == fspace->tot_space); + assert((size_t)(image - (const uint8_t *)_image) <= (old_sect_size - H5FS_SIZEOF_CHKSUM)); + assert(old_sect_size == fspace->sect_size); + assert(old_tot_sect_count == fspace->tot_sect_count); + assert(old_serial_sect_count == fspace->serial_sect_count); + assert(old_ghost_sect_count == fspace->ghost_sect_count); + assert(old_tot_space == fspace->tot_space); } /* end if */ /* checksum verification already done in verify_chksum cb */ @@ -1080,8 +1080,8 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l UINT32DECODE(chksum_image, stored_chksum); /* Sanity check */ - HDassert((image == chksum_image) || - ((size_t)((image - (const uint8_t *)_image) + (chksum_image - image)) == old_sect_size)); + assert((image == chksum_image) || + ((size_t)((image - (const uint8_t *)_image) + (chksum_image - image)) == old_sect_size)); /* Set return value */ ret_value = sinfo; @@ -1115,11 +1115,11 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(sinfo); - HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); - HDassert(sinfo->fspace); - HDassert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR); - HDassert(image_len); + assert(sinfo); + assert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); + assert(sinfo->fspace); + assert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR); + assert(image_len); /* Set the image length size */ H5_CHECKED_ASSIGN(*image_len, size_t, sinfo->fspace->alloc_sect_size, hsize_t); @@ -1155,26 +1155,26 @@ H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(sinfo); - HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); + assert(f); + assert(sinfo); + assert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); fspace = sinfo->fspace; - HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); - HDassert(fspace->cache_info.is_pinned); - HDassert(H5_addr_defined(addr)); - HDassert(H5_addr_eq(fspace->sect_addr, addr)); - HDassert(fspace->sect_size == len); - HDassert(new_addr); - HDassert(new_len); - HDassert(flags); + assert(fspace->cache_info.type == H5AC_FSPACE_HDR); + assert(fspace->cache_info.is_pinned); + assert(H5_addr_defined(addr)); + assert(H5_addr_eq(fspace->sect_addr, addr)); + assert(fspace->sect_size == len); + assert(new_addr); + assert(new_len); + assert(flags); sinfo_addr = addr; /* this will change if we relocate the section data */ /* Check for section info at temporary address */ if (H5F_IS_TMP_ADDR(f, fspace->sect_addr)) { /* Sanity check */ - HDassert(fspace->sect_size > 0); - HDassert(H5_addr_eq(fspace->sect_addr, addr)); + assert(fspace->sect_size > 0); + assert(H5_addr_eq(fspace->sect_addr, addr)); /* Allocate space for the section info in file */ if (HADDR_UNDEF == (sinfo_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FSPACE_SINFO, fspace->sect_size))) @@ -1183,7 +1183,7 @@ H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_ fspace->alloc_sect_size = (size_t)fspace->sect_size; /* Sanity check */ - HDassert(!H5_addr_eq(sinfo->fspace->sect_addr, sinfo_addr)); + assert(!H5_addr_eq(sinfo->fspace->sect_addr, sinfo_addr)); /* Let the metadata cache know the section info moved */ if (H5AC_move_entry((H5F_t *)f, H5AC_FSPACE_SINFO, sinfo->fspace->sect_addr, sinfo_addr) < 0) @@ -1238,14 +1238,14 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, void *_thi FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(image); - HDassert(sinfo); - HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); - HDassert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR); - HDassert(sinfo->fspace->cache_info.is_pinned); - HDassert(sinfo->fspace->sect_size == len); - HDassert(sinfo->fspace->sect_cls); + assert(f); + assert(image); + assert(sinfo); + assert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); + assert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR); + assert(sinfo->fspace->cache_info.is_pinned); + assert(sinfo->fspace->sect_size == len); + assert(sinfo->fspace->sect_cls); /* Magic number */ H5MM_memcpy(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -1279,9 +1279,9 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, void *_thi UINT32ENCODE(chksum_image, metadata_chksum); /* Sanity check */ - HDassert((chksum_image == image) || - ((size_t)((image - (uint8_t *)_image) + (chksum_image - image)) == sinfo->fspace->sect_size)); - HDassert(sinfo->fspace->sect_size <= sinfo->fspace->alloc_sect_size); + assert((chksum_image == image) || + ((size_t)((image - (uint8_t *)_image) + (chksum_image - image)) == sinfo->fspace->sect_size)); + assert(sinfo->fspace->sect_size <= sinfo->fspace->alloc_sect_size); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1308,7 +1308,7 @@ H5FS__cache_sinfo_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(sinfo); + assert(sinfo); /* Check if the file was opened with SWMR-write access */ if (sinfo->fspace->swmr_write) { @@ -1344,7 +1344,7 @@ H5FS__cache_sinfo_notify(H5AC_notify_action_t action, void *_thing) #ifdef NDEBUG HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, FAIL, "unknown action from metadata cache") #else /* NDEBUG */ - HDassert(0 && "Unknown action?!?"); + assert(0 && "Unknown action?!?"); #endif /* NDEBUG */ } /* end switch */ } /* end if */ @@ -1376,10 +1376,10 @@ H5FS__cache_sinfo_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(sinfo); - HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); - HDassert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR); - HDassert(sinfo->fspace->cache_info.is_pinned); + assert(sinfo); + assert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); + assert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR); + assert(sinfo->fspace->cache_info.is_pinned); /* Destroy free space info */ if (H5FS__sinfo_dest(sinfo) < 0) @@ -1413,9 +1413,9 @@ H5FS__sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udat FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect); - HDassert(udata->sinfo); - HDassert(udata->image); + assert(sect); + assert(udata->sinfo); + assert(udata->image); /* Get section's class */ sect_cls = &udata->sinfo->fspace->sect_cls[sect->type]; @@ -1437,7 +1437,7 @@ H5FS__sinfo_serialize_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udat (*udata->image) += sect_cls->serial_size; } /* end if */ else - HDassert(sect_cls->serial_size == 0); + assert(sect_cls->serial_size == 0); } /* end if */ done: @@ -1467,9 +1467,9 @@ H5FS__sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udat FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace_node); - HDassert(udata->sinfo); - HDassert(udata->image); + assert(fspace_node); + assert(udata->sinfo); + assert(udata->image); /* Check if this node has any serializable sections */ if (fspace_node->serial_count > 0) { @@ -1480,7 +1480,7 @@ H5FS__sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udat UINT64ENCODE_VAR(*udata->image, fspace_node->sect_size, udata->sinfo->sect_len_size); /* Iterate through all the sections of this size */ - HDassert(fspace_node->sect_list); + assert(fspace_node->sect_list); if (H5SL_iterate(fspace_node->sect_list, H5FS__sinfo_serialize_sect_cb, udata) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section nodes") } /* end if */ diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index 07a7f1e..b1cd0b2 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -90,11 +90,11 @@ H5FS_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Initialize user data for protecting the free space manager */ cache_udata.f = f; @@ -172,11 +172,11 @@ H5FS_sect_debug(const H5FS_t *fspace, const H5FS_section_info_t *sect, FILE *str /* * Check arguments. */ - HDassert(fspace); - HDassert(sect); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(fspace); + assert(sect); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Call the section's debugging routine */ if (fspace->sect_cls[sect->type].debug) @@ -213,13 +213,13 @@ H5FS_sects_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int indent /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(H5_addr_defined(fs_addr)); - HDassert(H5_addr_defined(client_addr)); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(H5_addr_defined(fs_addr)); + assert(H5_addr_defined(client_addr)); /* Initialize user data for protecting the free space manager */ cache_udata.f = f; diff --git a/src/H5FSint.c b/src/H5FSint.c index 9910a41..06c4f72 100644 --- a/src/H5FSint.c +++ b/src/H5FSint.c @@ -86,8 +86,8 @@ H5FS__create_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(parent_entry); - HDassert(child_entry); + assert(parent_entry); + assert(child_entry); /* Create a flush dependency between parent and child entry */ if (H5AC_create_flush_dependency(parent_entry, child_entry) < 0) @@ -117,8 +117,8 @@ H5FS__destroy_flush_depend(H5AC_info_t *parent_entry, H5AC_info_t *child_entry) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(parent_entry); - HDassert(child_entry); + assert(parent_entry); + assert(child_entry); /* Destroy a flush dependency between parent and child entry */ if (H5AC_destroy_flush_dependency(parent_entry, child_entry) < 0) diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 365daa0..920fe88 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -119,8 +119,8 @@ H5FS__sinfo_new(H5F_t *f, H5FS_t *fspace) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(f); - HDassert(fspace); + assert(f); + assert(fspace); #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: fspace->addr = %" PRIuHADDR "\n", __func__, fspace->addr); #endif /* H5FS_SINFO_DEBUG */ @@ -154,7 +154,7 @@ H5FS__sinfo_new(H5F_t *f, H5FS_t *fspace) /* Link free space manager to section info */ /* (for deserializing sections) */ - HDassert(fspace->sinfo == NULL); + assert(fspace->sinfo == NULL); fspace->sinfo = sinfo; /* Set return value */ @@ -208,11 +208,11 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) #endif /* H5FS_SINFO_DEBUG */ /* Check arguments. */ - HDassert(f); - HDassert(fspace); + assert(f); + assert(fspace); /* only H5AC__READ_ONLY_FLAG may appear in accmode */ - HDassert((accmode & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((accmode & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* If the free space header doesn't already "own" the section info, load * section info or create it @@ -221,7 +221,7 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) /* Check if the section info was protected & we want a different access mode */ /* only H5AC__READ_ONLY_FLAG may appear in fspace->sinfo_accmode */ - HDassert(((fspace->sinfo_accmode) & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert(((fspace->sinfo_accmode) & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); if (fspace->sinfo_protected && accmode != fspace->sinfo_accmode) { /* Check if we need to switch from read-only access to read-write */ @@ -248,8 +248,8 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) /* If the section address is defined, load it from the file */ if (H5_addr_defined(fspace->sect_addr)) { /* Sanity check */ - HDassert(fspace->sinfo_protected == FALSE); - HDassert(H5_addr_defined(fspace->addr)); + assert(fspace->sinfo_protected == FALSE); + assert(H5_addr_defined(fspace->addr)); #ifdef H5FS_SINFO_DEBUG HDfprintf(stderr, "%s: Reading in existing sections, fspace->sect_addr = %" PRIuHADDR "\n", @@ -271,9 +271,9 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) HDfprintf(stderr, "%s: Creating new section info\n", __func__); #endif /* H5FS_SINFO_DEBUG */ /* Sanity check */ - HDassert(fspace->tot_sect_count == 0); - HDassert(fspace->serial_sect_count == 0); - HDassert(fspace->ghost_sect_count == 0); + assert(fspace->tot_sect_count == 0); + assert(fspace->serial_sect_count == 0); + assert(fspace->ghost_sect_count == 0); /* Allocate and initialize free space section info */ if (NULL == (fspace->sinfo = H5FS__sinfo_new(f, fspace))) @@ -283,7 +283,7 @@ H5FS__sinfo_lock(H5F_t *f, H5FS_t *fspace, unsigned accmode) fspace->sect_size = fspace->alloc_sect_size = 0; } /* end if */ } /* end if */ - HDassert(fspace->rc == 2); + assert(fspace->rc == 2); /* Increment the section info lock count */ fspace->sinfo_lock_count++; @@ -347,10 +347,10 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) #endif /* H5FS_SINFO_DEBUG */ /* Check arguments. */ - HDassert(f); - HDassert(fspace); - HDassert(fspace->rc == 2); - HDassert(fspace->sinfo); + assert(f); + assert(fspace); + assert(fspace->rc == 2); + assert(fspace->sinfo); /* Check if we modified any section */ if (modified) { @@ -390,7 +390,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) unsigned cache_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting heap */ /* Sanity check */ - HDassert(H5_addr_defined(fspace->addr)); + assert(H5_addr_defined(fspace->addr)); /* Check if we've made new changes to the section info while locked */ if (fspace->sinfo_modified) { @@ -412,7 +412,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) } /* end if */ /* Sanity check */ - HDassert(H5_addr_defined(fspace->sect_addr)); + assert(H5_addr_defined(fspace->sect_addr)); /* Unprotect section info in cache */ /* (Possibly dirty) */ @@ -460,15 +460,15 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) release_sinfo_space = TRUE; } else - HDassert(fspace->alloc_sect_size == 0); + assert(fspace->alloc_sect_size == 0); } /* end if */ else { /* Sanity checks... */ if (H5_addr_defined(fspace->sect_addr)) - HDassert(fspace->alloc_sect_size == fspace->sect_size); + assert(fspace->alloc_sect_size == fspace->sect_size); else - HDassert(fspace->alloc_sect_size == 0); + assert(fspace->alloc_sect_size == 0); } /* end else */ } /* end else */ @@ -481,7 +481,7 @@ H5FS__sinfo_unlock(H5F_t *f, H5FS_t *fspace, hbool_t modified) hsize_t old_alloc_sect_size = fspace->alloc_sect_size; /* Previous size of section info in file */ /* Sanity check */ - HDassert(H5_addr_defined(fspace->addr)); + assert(H5_addr_defined(fspace->addr)); /* Reset section info in header */ fspace->sect_addr = HADDR_UNDEF; @@ -531,7 +531,7 @@ H5FS__sect_serialize_size(H5FS_t *fspace) FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(fspace); + assert(fspace); /* Compute the size of the buffer required to serialize all the sections */ if (fspace->serial_sect_count > 0) { @@ -587,9 +587,9 @@ H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, unsigned fl FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace); - HDassert(fspace->sinfo); - HDassert(cls); + assert(fspace); + assert(fspace->sinfo); + assert(cls); /* Increment total # of sections on free space list */ fspace->tot_sect_count++; @@ -597,7 +597,7 @@ H5FS__sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, unsigned fl /* Check for serializable or 'ghost' section */ if (cls->flags & H5FS_CLS_GHOST_OBJ) { /* Sanity check */ - HDassert(cls->serial_size == 0); + assert(cls->serial_size == 0); /* Increment # of ghost sections */ fspace->ghost_sect_count++; @@ -642,9 +642,9 @@ H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace); - HDassert(fspace->sinfo); - HDassert(cls); + assert(fspace); + assert(fspace->sinfo); + assert(cls); /* Decrement total # of sections in free space manager */ fspace->tot_sect_count--; @@ -652,7 +652,7 @@ H5FS__sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls) /* Check for serializable or 'ghost' section */ if (cls->flags & H5FS_CLS_GHOST_OBJ) { /* Sanity check */ - HDassert(cls->serial_size == 0); + assert(cls->serial_size == 0); /* Decrement # of ghost sections */ fspace->ghost_sect_count--; @@ -694,9 +694,9 @@ H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sinfo); - HDassert(fspace_node); - HDassert(cls); + assert(sinfo); + assert(fspace_node); + assert(cls); /* Decrement the # of sections in this bin */ /* (Different from the # of items in the bin's skiplist, since each node on @@ -734,8 +734,8 @@ H5FS__size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node H5FS_node_t *tmp_fspace_node; /* Free space list size node */ /* Sanity checks */ - HDassert(fspace_node->ghost_count == 0); - HDassert(fspace_node->serial_count == 0); + assert(fspace_node->ghost_count == 0); + assert(fspace_node->serial_count == 0); /* Remove size tracking list from bin */ tmp_fspace_node = (H5FS_node_t *)H5SL_remove(sinfo->bins[bin].bin_list, &fspace_node->sect_size); @@ -781,14 +781,14 @@ H5FS__sect_unlink_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5F FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sinfo); - HDassert(sinfo->bins); - HDassert(sect); - HDassert(cls); + assert(sinfo); + assert(sinfo->bins); + assert(sect); + assert(cls); /* Determine correct bin which holds items of at least the section's size */ bin = H5VM_log2_gen(sect->size); - HDassert(bin < sinfo->nbins); + assert(bin < sinfo->nbins); if (sinfo->bins[bin].bin_list == NULL) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "node's bin is empty?") @@ -831,10 +831,10 @@ H5FS__sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sec FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace); - HDassert(fspace->sinfo); - HDassert(cls); - HDassert(sect); + assert(fspace); + assert(fspace->sinfo); + assert(cls); + assert(sect); /* Remove node from merge list, if it was entered there */ if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) { @@ -877,9 +877,9 @@ H5FS__sect_remove_real(H5FS_t *fspace, H5FS_section_info_t *sect) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace); - HDassert(fspace->sinfo); - HDassert(sect); + assert(fspace); + assert(fspace->sinfo); + assert(sect); /* Get section's class */ cls = &fspace->sect_cls[sect->type]; @@ -918,9 +918,9 @@ H5FS_sect_remove(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect) FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ - HDassert(f); - HDassert(fspace); - HDassert(sect); + assert(f); + assert(fspace); + assert(sect); /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) @@ -962,14 +962,14 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_ FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sinfo); - HDassert(sect); - HDassert(H5_addr_defined(sect->addr)); - HDassert(sect->size); + assert(sinfo); + assert(sect); + assert(H5_addr_defined(sect->addr)); + assert(sect->size); /* Determine correct bin which holds items of the section's size */ bin = H5VM_log2_gen(sect->size); - HDassert(bin < sinfo->nbins); + assert(bin < sinfo->nbins); if (sinfo->bins[bin].bin_list == NULL) { if (NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes") @@ -1060,9 +1060,9 @@ H5FS__sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_secti FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace); - HDassert(fspace->sinfo); - HDassert(sect); + assert(fspace); + assert(fspace->sinfo); + assert(sect); /* Add section to the address-ordered list of sections, if allowed */ if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) { @@ -1107,9 +1107,9 @@ H5FS__sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace); - HDassert(fspace->sinfo); - HDassert(sect); + assert(fspace); + assert(fspace->sinfo); + assert(sect); /* Get section's class */ cls = &fspace->sect_cls[sect->type]; @@ -1152,10 +1152,10 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace); - HDassert(*sect); - HDassert(H5_addr_defined((*sect)->addr)); - HDassert((*sect)->size); + assert(fspace); + assert(*sect); + assert(H5_addr_defined((*sect)->addr)); + assert((*sect)->size); /* Loop until no more merging */ if (fspace->sinfo->merge_list) { @@ -1196,7 +1196,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check for merging sections") if (status > 0) { /* Sanity check */ - HDassert(tmp_sect_cls->merge); + assert(tmp_sect_cls->merge); /* Remove 'less than' node from data structures */ if (H5FS__sect_remove_real(fspace, tmp_sect) < 0) @@ -1243,7 +1243,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check for merging sections") if (status > 0) { /* Sanity check */ - HDassert(sect_cls->merge); + assert(sect_cls->merge); /* Remove 'greater than' node from data structures */ if (H5FS__sect_remove_real(fspace, tmp_sect) < 0) @@ -1266,7 +1266,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) } /* end if */ } while (modified); } /* end if */ - HDassert(*sect); + assert(*sect); /* Loop until no more shrinking */ do { @@ -1290,7 +1290,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) /* Shrink the container */ /* (callback can indicate that it has discarded the section by setting *sect to NULL) */ - HDassert(sect_cls->shrink); + assert(sect_cls->shrink); if ((*sect_cls->shrink)(sect, op_data) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't shrink free space container") @@ -1304,7 +1304,7 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) if (NULL != (last_node = H5SL_last(fspace->sinfo->merge_list))) { /* Get the pointer to the last section, from the last node */ *sect = (H5FS_section_info_t *)H5SL_item(last_node); - HDassert(*sect); + assert(*sect); /* Indicate that this section needs to be removed if it causes a shrink */ remove_sect = TRUE; @@ -1355,10 +1355,10 @@ H5FS_sect_add(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flag #endif /* H5FS_SINFO_DEBUG */ /* Check arguments. */ - HDassert(fspace); - HDassert(sect); - HDassert(H5_addr_defined(sect->addr)); - HDassert(sect->size); + assert(fspace); + assert(sect); + assert(H5_addr_defined(sect->addr)); + assert(sect->size); /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) @@ -1441,11 +1441,11 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize #endif /* H5FS_SINFO_DEBUG */ /* Check arguments. */ - HDassert(f); - HDassert(fspace); - HDassert(H5_addr_defined(addr)); - HDassert(size > 0); - HDassert(extra_requested > 0); + assert(f); + assert(fspace); + assert(H5_addr_defined(addr)); + assert(size > 0); + assert(extra_requested > 0); /* Check for any sections on free space list */ #ifdef H5FS_SINFO_DEBUG @@ -1508,7 +1508,7 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize */ if (sect->size > extra_requested) { /* Sanity check (for now) */ - HDassert(cls->flags & H5FS_CLS_ADJUST_OK); + assert(cls->flags & H5FS_CLS_ADJUST_OK); /* Adjust section by amount requested */ sect->addr += extra_requested; @@ -1528,7 +1528,7 @@ H5FS_sect_try_extend(H5F_t *f, H5FS_t *fspace, haddr_t addr, hsize_t size, hsize } /* end if */ else { /* Sanity check */ - HDassert(sect->size == extra_requested); + assert(sect->size == extra_requested); /* Exact match, so just free section */ if ((*cls->free)(sect) < 0) @@ -1577,11 +1577,11 @@ H5FS_sect_try_merge(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, unsigne FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(f); - HDassert(fspace); - HDassert(sect); - HDassert(H5_addr_defined(sect->addr)); - HDassert(sect->size); + assert(f); + assert(fspace); + assert(sect); + assert(H5_addr_defined(sect->addr)); + assert(sect->size); /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) @@ -1644,15 +1644,15 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace); - HDassert(fspace->sinfo); - HDassert(fspace->sinfo->bins); - HDassert(request > 0); - HDassert(node); + assert(fspace); + assert(fspace->sinfo); + assert(fspace->sinfo->bins); + assert(request > 0); + assert(node); /* Determine correct bin which holds items of at least the section's size */ bin = H5VM_log2_gen(request); - HDassert(bin < fspace->sinfo->nbins); + assert(bin < fspace->sinfo->nbins); alignment = fspace->alignment; if (!((alignment > 1) && (request >= fspace->align_thres))) alignment = 0; /* no alignment */ @@ -1708,13 +1708,13 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node /* Get section node */ curr_sect = (H5FS_section_info_t *)H5SL_item(curr_sect_node); - HDassert(H5_addr_defined(curr_sect->addr)); - HDassert(curr_fspace_node->sect_size == curr_sect->size); + assert(H5_addr_defined(curr_sect->addr)); + assert(curr_fspace_node->sect_size == curr_sect->size); cls = &fspace->sect_cls[curr_sect->type]; - HDassert(alignment); - HDassert(cls); + assert(alignment); + assert(cls); if ((mis_align = curr_sect->addr % alignment)) frag_size = alignment - mis_align; @@ -1746,8 +1746,8 @@ H5FS__sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't insert free space section into skip list") /* sanity check */ - HDassert(split_sect->addr < (*node)->addr); - HDassert(request <= (*node)->size); + assert(split_sect->addr < (*node)->addr); + assert(request <= (*node)->size); } /* end if */ /* Indicate that we found a node for the request */ HGOTO_DONE(TRUE) @@ -1793,10 +1793,10 @@ H5FS_sect_find(H5F_t *f, H5FS_t *fspace, hsize_t request, H5FS_section_info_t ** FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(fspace); - HDassert(fspace->nclasses); - HDassert(request); - HDassert(node); + assert(fspace); + assert(fspace->nclasses); + assert(request); + assert(node); /* Check for any sections on free space list */ if (fspace->tot_sect_count > 0) { @@ -1850,9 +1850,9 @@ H5FS__iterate_sect_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect_info); - HDassert(udata->fspace); - HDassert(udata->op); + assert(sect_info); + assert(udata->fspace); + assert(udata->op); /* Make callback for this section */ if ((*udata->op)(sect_info, udata->op_data) < 0) @@ -1885,12 +1885,12 @@ H5FS__iterate_node_cb(void *_item, void H5_ATTR_UNUSED *key, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(fspace_node); - HDassert(udata->fspace); - HDassert(udata->op); + assert(fspace_node); + assert(udata->fspace); + assert(udata->op); /* Iterate through all the sections of this size */ - HDassert(fspace_node->sect_list); + assert(fspace_node->sect_list); if (H5SL_iterate(fspace_node->sect_list, H5FS__iterate_sect_cb, udata) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section nodes") @@ -1920,8 +1920,8 @@ H5FS_sect_iterate(H5F_t *f, H5FS_t *fspace, H5FS_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ - HDassert(fspace); - HDassert(op); + assert(fspace); + assert(op); /* Set up user data for iterator */ udata.fspace = fspace; @@ -1974,7 +1974,7 @@ H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fspace); + assert(fspace); /* Get the stats desired */ if (tot_space) @@ -2010,10 +2010,10 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ - HDassert(fspace); - HDassert(sect); - HDassert(sect->type < fspace->nclasses); - HDassert(new_class < fspace->nclasses); + assert(fspace); + assert(sect); + assert(sect->type < fspace->nclasses); + assert(new_class < fspace->nclasses); /* Get a pointer to the section info */ if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) @@ -2038,16 +2038,16 @@ H5FS_sect_change_class(H5F_t *f, H5FS_t *fspace, H5FS_section_info_t *sect, uint to_ghost = TRUE; /* Sanity check */ - HDassert(fspace->sinfo->bins); + assert(fspace->sinfo->bins); /* Determine correct bin which holds items of at least the section's size */ bin = H5VM_log2_gen(sect->size); - HDassert(bin < fspace->sinfo->nbins); - HDassert(fspace->sinfo->bins[bin].bin_list); + assert(bin < fspace->sinfo->nbins); + assert(fspace->sinfo->bins[bin].bin_list); /* Get space node for section's size */ fspace_node = (H5FS_node_t *)H5SL_search(fspace->sinfo->bins[bin].bin_list, §->size); - HDassert(fspace_node); + assert(fspace_node); /* Adjust serializable/ghost counts */ if (to_ghost) { @@ -2216,8 +2216,8 @@ H5FS__sect_assert(const H5FS_t *fspace) cls = &fspace->sect_cls[sect->type]; /* Sanity check section */ - HDassert(H5_addr_defined(sect->addr)); - HDassert(fspace_node->sect_size == sect->size); + assert(H5_addr_defined(sect->addr)); + assert(fspace_node->sect_size == sect->size); if (cls->valid) (*cls->valid)(cls, sect); @@ -2236,8 +2236,8 @@ H5FS__sect_assert(const H5FS_t *fspace) } /* end while */ /* Check the number of serializable & ghost sections of this size */ - HDassert(fspace_node->serial_count == size_serial_count); - HDassert(fspace_node->ghost_count == size_ghost_count); + assert(fspace_node->serial_count == size_serial_count); + assert(fspace_node->ghost_count == size_ghost_count); /* Add to global count of serializable & ghost section sizes */ if (fspace_node->serial_count > 0) @@ -2254,30 +2254,30 @@ H5FS__sect_assert(const H5FS_t *fspace) } /* end while */ /* Check the number of serializable & ghost sections in this bin */ - HDassert(fspace->sinfo->bins[u].tot_sect_count == (bin_serial_count + bin_ghost_count)); - HDassert(fspace->sinfo->bins[u].serial_sect_count == bin_serial_count); - HDassert(fspace->sinfo->bins[u].ghost_sect_count == bin_ghost_count); + assert(fspace->sinfo->bins[u].tot_sect_count == (bin_serial_count + bin_ghost_count)); + assert(fspace->sinfo->bins[u].serial_sect_count == bin_serial_count); + assert(fspace->sinfo->bins[u].ghost_sect_count == bin_ghost_count); } /* end if */ } /* end for */ /* Check counts from bins vs. global counts */ - HDassert(fspace->sinfo->tot_size_count == acc_tot_size_count); - HDassert(fspace->sinfo->serial_size_count == acc_serial_size_count); - HDassert(fspace->sinfo->ghost_size_count == acc_ghost_size_count); - HDassert(fspace->tot_sect_count == acc_tot_sect_count); - HDassert(fspace->serial_sect_count == acc_serial_sect_count); - HDassert(fspace->ghost_sect_count == acc_ghost_sect_count); + assert(fspace->sinfo->tot_size_count == acc_tot_size_count); + assert(fspace->sinfo->serial_size_count == acc_serial_size_count); + assert(fspace->sinfo->ghost_size_count == acc_ghost_size_count); + assert(fspace->tot_sect_count == acc_tot_sect_count); + assert(fspace->serial_sect_count == acc_serial_sect_count); + assert(fspace->ghost_sect_count == acc_ghost_sect_count); } /* end if */ else { /* Check counts are zero */ - HDassert(fspace->tot_sect_count == 0); - HDassert(fspace->serial_sect_count == 0); - HDassert(fspace->ghost_sect_count == 0); + assert(fspace->tot_sect_count == 0); + assert(fspace->serial_sect_count == 0); + assert(fspace->ghost_sect_count == 0); } /* end else */ /* Make certain that the number of sections on the address list is correct */ if (fspace->sinfo->merge_list) - HDassert(fspace->tot_sect_count == (separate_obj + H5SL_count(fspace->sinfo->merge_list))); + assert(fspace->tot_sect_count == (separate_obj + H5SL_count(fspace->sinfo->merge_list))); FUNC_LEAVE_NOAPI_VOID } /* end H5FS__sect_assert() */ @@ -2305,7 +2305,7 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data) FUNC_ENTER_NOAPI(FAIL) /* Check arguments. */ - HDassert(fspace); + assert(fspace); if (H5FS__sinfo_lock(f, fspace, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't get section info") @@ -2321,14 +2321,14 @@ H5FS_sect_try_shrink_eoa(H5F_t *f, H5FS_t *fspace, void *op_data) /* Get the pointer to the last section, from the last node */ tmp_sect = (H5FS_section_info_t *)H5SL_item(last_node); - HDassert(tmp_sect); + assert(tmp_sect); tmp_sect_cls = &fspace->sect_cls[tmp_sect->type]; if (tmp_sect_cls->can_shrink) { /* Check if the section can be shrunk away */ if ((ret_value = (*tmp_sect_cls->can_shrink)(tmp_sect, op_data)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container") if (ret_value > 0) { - HDassert(tmp_sect_cls->shrink); + assert(tmp_sect_cls->shrink); /* Remove section from free space manager */ if (H5FS__sect_remove_real(fspace, tmp_sect) < 0) @@ -2401,25 +2401,25 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t FUNC_ENTER_NOAPI_NOINIT /* Check arguments. */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(fspace); - HDassert(fs_addr_ptr); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(fspace); + assert(fs_addr_ptr); /* the section info should be unlocked */ - HDassert(fspace->sinfo_lock_count == 0); + assert(fspace->sinfo_lock_count == 0); /* persistent free space managers must be enabled */ - HDassert(f->shared->fs_persist); + assert(f->shared->fs_persist); /* At present, all free space strategies enable the free space managers. * This will probably change -- at which point this assertion should * be revisited. */ /* Updated: Only the following two strategies enable the free-space managers */ - HDassert((f->shared->fs_strategy == H5F_FSPACE_STRATEGY_FSM_AGGR) || - (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE)); + assert((f->shared->fs_strategy == H5F_FSPACE_STRATEGY_FSM_AGGR) || + (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE)); if (fspace->serial_sect_count > 0 && fspace->sinfo) { /* the section info is floating, so space->sinfo should be defined */ @@ -2440,7 +2440,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t hdr_alloc_size = H5FS_HEADER_SIZE(f); if (H5F_PAGED_AGGR(f)) - HDassert(0 == (eoa % f->shared->fs_page_size)); + assert(0 == (eoa % f->shared->fs_page_size)); /* Allocate space for the free space header */ if (HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, hdr_alloc_size))) @@ -2469,7 +2469,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, haddr_t sinfo_alloc_size = fspace->sect_size; if (H5F_PAGED_AGGR(f)) - HDassert(0 == (eoa % f->shared->fs_page_size)); + assert(0 == (eoa % f->shared->fs_page_size)); /* allocate space for the section info */ if (HADDR_UNDEF == (sect_addr = H5MF_alloc(f, H5FD_MEM_FSPACE_SINFO, sinfo_alloc_size))) diff --git a/src/H5FSstat.c b/src/H5FSstat.c index 91c9c13..b968580 100644 --- a/src/H5FSstat.c +++ b/src/H5FSstat.c @@ -74,8 +74,8 @@ H5FS_stat_info(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *stats) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(frsp); - HDassert(stats); + assert(frsp); + assert(stats); /* Report statistics for free space */ stats->tot_space = frsp->tot_space; diff --git a/src/H5FStest.c b/src/H5FStest.c index d913480..1fa4e95 100644 --- a/src/H5FStest.c +++ b/src/H5FStest.c @@ -76,8 +76,8 @@ H5FS__get_cparam_test(const H5FS_t *frsp, H5FS_create_t *cparam) FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(frsp); - HDassert(cparam); + assert(frsp); + assert(cparam); cparam->client = frsp->client; cparam->shrink_percent = frsp->shrink_percent; @@ -109,8 +109,8 @@ H5FS__cmp_cparam_test(const H5FS_create_t *cparam1, const H5FS_create_t *cparam2 FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(cparam1); - HDassert(cparam2); + assert(cparam1); + assert(cparam2); if (cparam1->client < cparam2->client) HGOTO_DONE(-1) diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 533b0be..7beb223 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -107,8 +107,8 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t si FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f_sh); - HDassert(buf); + assert(f_sh); + assert(buf); /* Translate to file driver I/O info object */ file = f_sh->lf; @@ -122,7 +122,7 @@ H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t si if (size < H5F_ACCUM_MAX_SIZE) { /* Sanity check */ - HDassert(!accum->buf || (accum->alloc_size >= accum->size)); + assert(!accum->buf || (accum->alloc_size >= accum->size)); /* Current read adjoins or overlaps with metadata accumulator */ if (H5_addr_defined(accum->loc) && @@ -275,11 +275,11 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file, H5F_accum_adjust_t adju FUNC_ENTER_PACKAGE - HDassert(accum); - HDassert(file); - HDassert(H5F_ACCUM_APPEND == adjust || H5F_ACCUM_PREPEND == adjust); - HDassert(size > 0); - HDassert(size <= H5F_ACCUM_MAX_SIZE); + assert(accum); + assert(file); + assert(H5F_ACCUM_APPEND == adjust || H5F_ACCUM_PREPEND == adjust); + assert(size > 0); + assert(size <= H5F_ACCUM_MAX_SIZE); /* Check if we need more buffer space */ if ((size + accum->size) > accum->alloc_size) { @@ -418,9 +418,9 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); - HDassert(H5F_SHARED_INTENT(f_sh) & H5F_ACC_RDWR); - HDassert(buf); + assert(f_sh); + assert(H5F_SHARED_INTENT(f_sh) & H5F_ACC_RDWR); + assert(buf); /* Translate to file driver pointer */ file = f_sh->lf; @@ -434,7 +434,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s if (size < H5F_ACCUM_MAX_SIZE) { /* Sanity check */ - HDassert(!accum->buf || (accum->alloc_size >= accum->size)); + assert(!accum->buf || (accum->alloc_size >= accum->size)); /* Check if there is already metadata in the accumulator */ if (accum->size > 0) { @@ -794,7 +794,7 @@ H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr, size_t s size_t overlap_size; /* Size of overlapping region */ /* Sanity check */ - HDassert(H5_addr_gt(addr + size, accum->loc + accum->size)); + assert(H5_addr_gt(addr + size, accum->loc + accum->size)); /* Compute overlap size */ overlap_size = (size_t)((accum->loc + accum->size) - addr); @@ -859,7 +859,7 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f_sh); + assert(f_sh); /* Set up alias for file's metadata accumulator info */ accum = &f_sh->accum; @@ -874,8 +874,8 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr /* Sanity check */ /* (The metadata accumulator should not intersect w/raw data */ - HDassert(H5FD_MEM_DRAW != type); - HDassert(H5FD_MEM_GHEAP != type); /* (global heap data is being treated as raw data currently) */ + assert(H5FD_MEM_DRAW != type); + assert(H5FD_MEM_GHEAP != type); /* (global heap data is being treated as raw data currently) */ /* Check for overlapping the beginning of the accumulator */ if (H5_addr_le(addr, accum->loc)) { @@ -952,7 +952,7 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr write_size = (size_t)(dirty_end - tail_addr); dirty_delta = accum->dirty_len - write_size; - HDassert(write_size > 0); + assert(write_size > 0); /* Write out the unfreed dirty region of the accumulator */ if (H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, @@ -973,7 +973,7 @@ H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr write_size = (size_t)(dirty_end - tail_addr); dirty_delta = accum->dirty_len - write_size; - HDassert(write_size > 0); + assert(write_size > 0); /* Write out the unfreed end of the dirty region of the accumulator */ if (H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, @@ -1023,7 +1023,7 @@ H5F__accum_flush(H5F_shared_t *f_sh) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); + assert(f_sh); /* Check if we need to flush out the metadata accumulator */ if ((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && f_sh->accum.dirty) { @@ -1065,7 +1065,7 @@ H5F__accum_reset(H5F_shared_t *f_sh, hbool_t flush) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f_sh); + assert(f_sh); /* Flush any dirty data in accumulator, if requested */ if (flush) diff --git a/src/H5Fcwfs.c b/src/H5Fcwfs.c index 1eb8b2a..7d64a12 100644 --- a/src/H5Fcwfs.c +++ b/src/H5Fcwfs.c @@ -99,9 +99,9 @@ H5F_cwfs_add(H5F_t *f, H5HG_heap_t *heap) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(heap); + assert(f); + assert(f->shared); + assert(heap); /* * Add the new heap to the CWFS list, removing some other entry if @@ -158,9 +158,9 @@ H5F_cwfs_find_free_heap(H5F_t *f, size_t need, haddr_t *addr) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(addr); + assert(f); + assert(f->shared); + assert(addr); /* Note that we don't have metadata cache locks on the entries in * f->shared->cwfs. @@ -254,9 +254,9 @@ H5F_cwfs_advance_heap(H5F_t *f, H5HG_heap_t *heap, hbool_t add_heap) FUNC_ENTER_NOAPI_NOERR /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(heap); + assert(f); + assert(f->shared); + assert(heap); for (u = 0; u < f->shared->ncwfs; u++) if (f->shared->cwfs[u] == heap) { @@ -296,8 +296,8 @@ H5F_cwfs_remove_heap(H5F_shared_t *shared, H5HG_heap_t *heap) FUNC_ENTER_NOAPI_NOERR /* Check args */ - HDassert(shared); - HDassert(heap); + assert(shared); + assert(heap); /* Remove the heap from the CWFS list */ for (u = 0; u < shared->ncwfs; u++) { diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index 99dfca3..f425820 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -50,10 +50,10 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Get property list */ if (NULL == (plist = (H5P_genplist_t *)H5I_object(f->shared->fcpl_id))) @@ -125,7 +125,7 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth) /* Build up a simulated root group symbol table entry */ root_oloc = H5G_oloc(f->shared->root_grp); - HDassert(root_oloc); + assert(root_oloc); root_ent.type = H5G_NOTHING_CACHED; root_ent.header = root_oloc->addr; diff --git a/src/H5Fefc.c b/src/H5Fefc.c index ea9a279..a6afb2c 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -95,7 +95,7 @@ H5F__efc_create(unsigned max_nfiles) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(max_nfiles > 0); + assert(max_nfiles > 0); /* Allocate EFC struct */ if (NULL == (efc = H5FL_CALLOC(H5F_efc_t))) @@ -148,7 +148,7 @@ H5F__efc_open(H5F_efc_t *efc, const char *name, unsigned flags, hid_t fcpl_id, h FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(name); + assert(name); /* Get the VOL info from the fapl */ if (NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -189,7 +189,7 @@ H5F__efc_open(H5F_efc_t *efc, const char *name, unsigned flags, hid_t fcpl_id, h ent = (H5F_efc_ent_t *)H5SL_search(efc->slist, name); } /* end if */ else { - HDassert(efc->nfiles == 0); + assert(efc->nfiles == 0); if (NULL == (efc->slist = H5SL_create(H5SL_TYPE_STR, NULL))) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, NULL, "can't create skip list") } /* end else */ @@ -197,12 +197,12 @@ H5F__efc_open(H5F_efc_t *efc, const char *name, unsigned flags, hid_t fcpl_id, h /* If we found the file update the LRU list and return the cached file, * otherwise open the file and cache it */ if (ent) { - HDassert(efc->LRU_head); - HDassert(efc->LRU_tail); + assert(efc->LRU_head); + assert(efc->LRU_tail); /* Move ent to the head of the LRU list, if it is not already there */ if (ent->LRU_prev) { - HDassert(efc->LRU_head != ent); + assert(efc->LRU_head != ent); /* Remove from current position. Note that once we touch the LRU * list we cannot revert to the previous state. Make sure there can @@ -211,7 +211,7 @@ H5F__efc_open(H5F_efc_t *efc, const char *name, unsigned flags, hid_t fcpl_id, h if (ent->LRU_next) ent->LRU_next->LRU_prev = ent->LRU_prev; else { - HDassert(efc->LRU_tail == ent); + assert(efc->LRU_tail == ent); efc->LRU_tail = ent->LRU_prev; } /* end else */ ent->LRU_prev->LRU_next = ent->LRU_next; @@ -292,7 +292,7 @@ H5F__efc_open(H5F_efc_t *efc, const char *name, unsigned flags, hid_t fcpl_id, h ent->LRU_prev = NULL; efc->LRU_head = ent; if (!efc->LRU_tail) { - HDassert(!ent->LRU_next); + assert(!ent->LRU_next); efc->LRU_tail = ent; } /* end if */ @@ -305,10 +305,10 @@ H5F__efc_open(H5F_efc_t *efc, const char *name, unsigned flags, hid_t fcpl_id, h ent->file->shared->efc->nrefs++; } /* end else */ - HDassert(ent); - HDassert(ent->file); - HDassert(ent->name); - HDassert(ent->nopen); + assert(ent); + assert(ent->file); + assert(ent->name); + assert(ent->nopen); /* Set the return value */ ret_value = ent->file; @@ -353,10 +353,10 @@ H5F_efc_close(H5F_t *parent, H5F_t *file) FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ - HDassert(parent); - HDassert(parent->shared); - HDassert(file); - HDassert(file->shared); + assert(parent); + assert(parent->shared); + assert(file); + assert(file->shared); /* Get external file cache */ efc = parent->shared->efc; @@ -410,8 +410,8 @@ H5F__efc_max_nfiles(H5F_efc_t *efc) { FUNC_ENTER_PACKAGE_NOERR - HDassert(efc); - HDassert(efc->max_nfiles > 0); + assert(efc); + assert(efc->max_nfiles > 0); FUNC_LEAVE_NOAPI(efc->max_nfiles) } /* end H5F__efc_max_nfiles */ @@ -441,14 +441,14 @@ H5F__efc_release_real(H5F_efc_t *efc) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(efc); + assert(efc); /* Lock the EFC to prevent manipulation of the EFC while we are releasing it. * The EFC should never be locked when we enter this function because that * would require a cycle, a cycle would necessarily invoke * H5F__efc_try_close(), and that function checks the status of the lock * before calling this one. */ - HDassert((efc->tag == H5F_EFC_TAG_DEFAULT) || (efc->tag == H5F_EFC_TAG_CLOSE)); + assert((efc->tag == H5F_EFC_TAG_DEFAULT) || (efc->tag == H5F_EFC_TAG_CLOSE)); efc->tag = H5F_EFC_TAG_LOCK; /* Walk down the LRU list, releasing any files that are not opened by an EFC @@ -499,7 +499,7 @@ H5F__efc_release(H5F_efc_t *efc) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(efc); + assert(efc); /* Call 'real' routine */ if (H5F__efc_release_real(efc) < 0) @@ -532,7 +532,7 @@ H5F__efc_destroy(H5F_efc_t *efc) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(efc); + assert(efc); if (efc->nfiles > 0) { /* Release (clear) the efc */ @@ -544,9 +544,9 @@ H5F__efc_destroy(H5F_efc_t *efc) HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't destroy EFC after incomplete release") } /* end if */ - HDassert(efc->nfiles == 0); - HDassert(efc->LRU_head == NULL); - HDassert(efc->LRU_tail == NULL); + assert(efc->nfiles == 0); + assert(efc->LRU_head == NULL); + assert(efc->LRU_tail == NULL); /* Close skip list */ if (efc->slist) @@ -582,9 +582,9 @@ H5F__efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(efc); - HDassert(efc->slist); - HDassert(ent); + assert(efc); + assert(efc->slist); + assert(ent); /* Remove from skip list */ if (ent != H5SL_remove(efc->slist, ent->name)) @@ -594,13 +594,13 @@ H5F__efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) if (ent->LRU_next) ent->LRU_next->LRU_prev = ent->LRU_prev; else { - HDassert(efc->LRU_tail == ent); + assert(efc->LRU_tail == ent); efc->LRU_tail = ent->LRU_prev; } /* end else */ if (ent->LRU_prev) ent->LRU_prev->LRU_next = ent->LRU_next; else { - HDassert(efc->LRU_head == ent); + assert(efc->LRU_head == ent); efc->LRU_head = ent->LRU_next; } /* end else */ @@ -648,12 +648,12 @@ H5F__efc_try_close_tag1(H5F_shared_t *sf, H5F_shared_t **tail) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(sf); - HDassert(sf->efc); - HDassert((sf->efc->tag > 0) || (sf->nrefs == sf->efc->nrefs)); - HDassert(sf->efc->tag != H5F_EFC_TAG_LOCK); - HDassert(tail); - HDassert(*tail); + assert(sf); + assert(sf->efc); + assert((sf->efc->tag > 0) || (sf->nrefs == sf->efc->nrefs)); + assert(sf->efc->tag != H5F_EFC_TAG_LOCK); + assert(tail); + assert(*tail); /* Recurse into this file's cached files */ for (ent = sf->efc->LRU_head; ent; ent = ent->LRU_next) { @@ -662,7 +662,7 @@ H5F__efc_try_close_tag1(H5F_shared_t *sf, H5F_shared_t **tail) if (esf->efc) { /* If tag were 0, that would mean there are more actual references * than are counted by nrefs */ - HDassert(esf->efc->tag != 0); + assert(esf->efc->tag != 0); /* If tag has been set, we have already visited this file so just * decrement tag and continue */ @@ -678,7 +678,7 @@ H5F__efc_try_close_tag1(H5F_shared_t *sf, H5F_shared_t **tail) !(ent->nopen)) { /* If we get here, this file's "tmp_next" pointer must be NULL */ - HDassert(esf->efc->tmp_next == NULL); + assert(esf->efc->tmp_next == NULL); /* If nrefs > 1, Add this file to the list of files with nrefs > * 1 and initialize tag to the number of references (except this @@ -721,8 +721,8 @@ H5F__efc_try_close_tag2(H5F_shared_t *sf, H5F_shared_t **tail) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(sf); - HDassert(sf->efc); + assert(sf); + assert(sf->efc); /* Recurse into this file's cached files */ for (ent = sf->efc->LRU_head; ent; ent = ent->LRU_next) { @@ -741,8 +741,8 @@ H5F__efc_try_close_tag2(H5F_shared_t *sf, H5F_shared_t **tail) ((esf->efc->tag == H5F_EFC_TAG_DEFAULT) && (esf->nrefs == esf->efc->nrefs) && !(ent->nopen)))) { /* tag should always be CLOSE is nrefs > 1 or DEFAULT if nrefs == 1 * here */ - HDassert(((esf->nrefs > 1) && ((esf->efc->tag == H5F_EFC_TAG_CLOSE))) || - ((esf->nrefs == 1) && (esf->efc->tag == H5F_EFC_TAG_DEFAULT))); + assert(((esf->nrefs > 1) && ((esf->efc->tag == H5F_EFC_TAG_CLOSE))) || + ((esf->nrefs == 1) && (esf->efc->tag == H5F_EFC_TAG_DEFAULT))); /* If tag is set to DONTCLOSE, we have already visited this file * *or* it will be the start point of another iteration so just @@ -831,12 +831,12 @@ H5F__efc_try_close(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->efc); - HDassert(f->shared->nrefs > f->shared->efc->nrefs); - HDassert(f->shared->nrefs > 1); - HDassert(f->shared->efc->tag < 0); + assert(f); + assert(f->shared); + assert(f->shared->efc); + assert(f->shared->nrefs > f->shared->efc->nrefs); + assert(f->shared->nrefs > 1); + assert(f->shared->efc->tag < 0); if (f->shared->efc->tag == H5F_EFC_TAG_CLOSE) { /* We must have reentered this function, and we should close this file. @@ -852,7 +852,7 @@ H5F__efc_try_close(H5F_t *f) * detect that the parent file is open (directly or through an EFC) and * refuse to close it. Verify that all files were released from this * EFC (i.e. none were open). */ - HDassert(f->shared->efc->nfiles == 0); + assert(f->shared->efc->nfiles == 0); HGOTO_DONE(SUCCEED) } /* end if */ @@ -880,8 +880,8 @@ H5F__efc_try_close(H5F_t *f) * removed from an EFC), and should have been caught by the above check */ /* If we get here then we must be beginning a new run. Make sure that the * temporary variables in f->shared->efc are at the default value */ - HDassert(f->shared->efc->tag == H5F_EFC_TAG_DEFAULT); - HDassert(f->shared->efc->tmp_next == NULL); + assert(f->shared->efc->tag == H5F_EFC_TAG_DEFAULT); + assert(f->shared->efc->tmp_next == NULL); /* Set up linked list for traversal into EFC tree. f->shared is guaranteed * to always be at the head. */ @@ -915,11 +915,11 @@ H5F__efc_try_close(H5F_t *f) sf = f->shared; tail = NULL; while (sf) { - HDassert(sf->efc->tag >= 0); + assert(sf->efc->tag >= 0); next = sf->efc->tmp_next; if (sf->efc->tag > 0) { /* Remove from main list */ - HDassert(tail); + assert(tail); tail->efc->tmp_next = sf->efc->tmp_next; sf->efc->tmp_next = NULL; @@ -950,7 +950,7 @@ H5F__efc_try_close(H5F_t *f) sf = uncloseable_head; if (sf) { tail = uncloseable_tail; - HDassert(tail); + assert(tail); while (sf != tail->efc->tmp_next) { H5F__efc_try_close_tag2(sf, &uncloseable_tail); sf = sf->efc->tmp_next; @@ -966,7 +966,7 @@ H5F__efc_try_close(H5F_t *f) /* Make sure the file's reference count is now 1 and will be closed by * H5F_dest(). */ - HDassert(f->shared->nrefs == 1); + assert(f->shared->nrefs == 1); } /* end if */ /* Clean up uncloseable files (reset tag and tmp_next). All closeable files @@ -975,7 +975,7 @@ H5F__efc_try_close(H5F_t *f) sf = uncloseable_head; while (sf) { next = sf->efc->tmp_next; - HDassert(sf->efc->tag == H5F_EFC_TAG_DONTCLOSE); + assert(sf->efc->tag == H5F_EFC_TAG_DONTCLOSE); sf->efc->tag = H5F_EFC_TAG_DEFAULT; sf->efc->tmp_next = NULL; sf = next; diff --git a/src/H5Fint.c b/src/H5Fint.c index e7673f1..6484daf 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -209,7 +209,7 @@ H5F__close_cb(H5VL_object_t *file_vol_obj, void **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(file_vol_obj); + assert(file_vol_obj); /* Close the file */ if (H5VL_file_close(file_vol_obj, H5P_DATASET_XFER_DEFAULT, request) < 0) @@ -275,7 +275,7 @@ H5F__set_vol_conn(H5F_t *file) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(file); + assert(file); /* Retrieve a copy of the "top-level" connector property, before any pass-through * connectors modified or unwrapped it. @@ -284,7 +284,7 @@ H5F__set_vol_conn(H5F_t *file) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get VOL connector info from API context") /* Sanity check */ - HDassert(0 != connector_prop.connector_id); + assert(0 != connector_prop.connector_id); /* Retrieve the connector for the ID */ if (NULL == (file->shared->vol_cls = (H5VL_class_t *)H5I_object(connector_prop.connector_id))) @@ -336,7 +336,7 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Check args */ - HDassert(f); + assert(f); /* Make a copy of the default file access property list */ if (NULL == (old_plist = (H5P_genplist_t *)H5I_object(H5P_LST_FILE_ACCESS_ID_g))) @@ -469,7 +469,7 @@ H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref, size_t *obj_i FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(obj_id_count_ptr); + assert(obj_id_count_ptr); /* Perform the query */ if ((ret_value = H5F__get_objects(f, types, 0, NULL, app_ref, obj_id_count_ptr)) < 0) @@ -496,7 +496,7 @@ H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(obj_id_count_ptr); + assert(obj_id_count_ptr); /* Perform the query */ if ((ret_value = H5F__get_objects(f, types, max_objs, oid_list, app_ref, obj_id_count_ptr)) < 0) @@ -527,7 +527,7 @@ H5F__get_objects(const H5F_t *f, unsigned types, size_t max_nobjs, hid_t *obj_id FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(obj_id_count_ptr); + assert(obj_id_count_ptr); /* Set up search information */ olist.obj_id_list = (max_nobjs == 0 ? NULL : obj_id_list); @@ -628,8 +628,8 @@ H5F__get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) FUNC_ENTER_PACKAGE - HDassert(obj_ptr); - HDassert(olist); + assert(obj_ptr); + assert(olist); /* Count file IDs */ if (olist->obj_type == H5I_FILE) { @@ -816,8 +816,8 @@ H5F_prefix_open_file(H5F_t *primary_file, H5F_prefix_open_t prefix_type, const c FUNC_ENTER_NOAPI_NOINIT - HDassert(primary_file); - HDassert(primary_file->shared); + assert(primary_file); + assert(primary_file->shared); efc = primary_file->shared->efc; @@ -843,7 +843,7 @@ H5F_prefix_open_file(H5F_t *primary_file, H5F_prefix_open_t prefix_type, const c /* Get last component of file_name */ H5_GET_LAST_DELIMITER(file_name, ptr) - HDassert(ptr); + assert(ptr); /* Increment past delimiter */ ptr++; @@ -1097,7 +1097,7 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F f->id_exists = FALSE; if (shared) { - HDassert(lf == NULL); + assert(lf == NULL); f->shared = shared; } else { @@ -1105,7 +1105,7 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F unsigned efc_size; /* External file cache size */ size_t u; /* Local index variable */ - HDassert(lf != NULL); + assert(lf != NULL); if (NULL == (f->shared = H5FL_CALLOC(H5F_shared_t))) HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, NULL, "can't allocate shared file structure") @@ -1147,7 +1147,7 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get byte number for object size") if (H5P_get(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &f->shared->sohm_nindexes) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get number of SOHM indexes") - HDassert(f->shared->sohm_nindexes < 255); + assert(f->shared->sohm_nindexes < 255); if (H5P_get(plist, H5F_CRT_FILE_SPACE_STRATEGY_NAME, &f->shared->fs_strategy) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file space strategy") if (H5P_get(plist, H5F_CRT_FREE_SPACE_PERSIST_NAME, &f->shared->fs_persist) < 0) @@ -1156,7 +1156,7 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get free-space section threshold") if (H5P_get(plist, H5F_CRT_FILE_SPACE_PAGE_SIZE_NAME, &f->shared->fs_page_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file space page size") - HDassert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); + assert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); /* Temporary for multi/split drivers: fail file creation * when persisting free-space or using paged aggregation strategy. @@ -1322,7 +1322,7 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F done: if (!ret_value && f) { - HDassert(NULL == f->vol_obj); + assert(NULL == f->vol_obj); if (!shared) { /* Attempt to clean up some of the shared file structures */ @@ -1361,8 +1361,8 @@ H5F__dest(H5F_t *f, hbool_t flush) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (1 == f->shared->nrefs) { int actype; /* metadata cache type (enum value) */ @@ -1402,7 +1402,7 @@ H5F__dest(H5F_t *f, hbool_t flush) * * Verify this. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* Release the external file cache */ if (f->shared->efc) { @@ -1418,7 +1418,7 @@ H5F__dest(H5F_t *f, hbool_t flush) * * Verify this. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* Release objects that depend on the superblock being initialized */ if (f->shared->sblock) { @@ -1446,7 +1446,7 @@ H5F__dest(H5F_t *f, hbool_t flush) /* at this point, only the superblock and superblock * extension should be dirty. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* Flush the file again (if requested), as shutting down the * free space manager may dirty some data structures again. @@ -1480,7 +1480,7 @@ H5F__dest(H5F_t *f, hbool_t flush) /* at this point, only the superblock and superblock * extension should be dirty. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); } /* end if */ } /* end if */ @@ -1504,7 +1504,7 @@ H5F__dest(H5F_t *f, hbool_t flush) * * Verify this. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* Remove shared file struct from list of open files */ if (H5F__sfile_remove(f->shared) < 0) @@ -2142,7 +2142,7 @@ H5F__post_open(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity check arguments */ - HDassert(f); + assert(f); /* Store a vol object in the file struct */ if (NULL == (f->vol_obj = H5VL_create_object_using_vol_id(H5I_FILE, f, f->shared->vol_id))) @@ -2169,7 +2169,7 @@ H5F__flush_phase1(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity check arguments */ - HDassert(f); + assert(f); /* Flush any cached dataset storage raw data */ if (H5D_flush_all(f) < 0) @@ -2206,7 +2206,7 @@ H5F__flush_phase2(H5F_t *f, hbool_t closing) FUNC_ENTER_PACKAGE /* Sanity check arguments */ - HDassert(f); + assert(f); /* Inform the metadata cache that we are about to flush */ if (H5AC_prep_for_file_flush(f) < 0) @@ -2285,7 +2285,7 @@ H5F__flush(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity check arguments */ - HDassert(f); + assert(f); /* First phase of flushing data */ if (H5F__flush_phase1(f) < 0) @@ -2329,7 +2329,7 @@ H5F__close(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); + assert(f); /* Perform checks for "semi" file close degree here, since closing the * file is not allowed if there are objects still open. @@ -2377,7 +2377,7 @@ H5F__delete(const char *filename, hid_t fapl_id) FUNC_ENTER_PACKAGE - HDassert(filename); + assert(filename); /* Delete the file */ if (H5FD_delete(filename, fapl_id) < 0) @@ -2409,8 +2409,8 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Set the was_closed flag to the default value. * This flag lets downstream code know if the file struct is @@ -2462,7 +2462,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) /* Sanity check: If close degree if "semi" and we have gotten this * far and there are objects left open, bail out now. */ - HDassert(nopen_files == 0 && nopen_objs == 0); + assert(nopen_files == 0 && nopen_objs == 0); /* If we've gotten this far (ie. there are no open objects in the file), fall through to flush & * close */ @@ -2487,7 +2487,7 @@ H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) /* If the file close degree is "strong", close all the open objects in this file */ if (f->shared->fc_degree == H5F_CLOSE_STRONG) { - HDassert(nopen_files == 0); + assert(nopen_files == 0); /* Forced close of all opened objects in this file */ if (f->nopen_objs > 0) { @@ -2616,7 +2616,7 @@ H5F_get_id(H5F_t *file) FUNC_ENTER_NOAPI_NOINIT - HDassert(file); + assert(file); if (H5I_find_id(file, H5I_FILE, &ret_value) < 0 || H5I_INVALID_HID == ret_value) { /* resurrect the ID - Register an ID with the native connector */ @@ -2649,7 +2649,7 @@ H5F_incr_nopen_objs(H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(++f->nopen_objs) } /* end H5F_incr_nopen_objs() */ @@ -2669,7 +2669,7 @@ H5F_decr_nopen_objs(H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(--f->nopen_objs) } /* end H5F_decr_nopen_objs() */ @@ -2698,10 +2698,10 @@ H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *n FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(fapl); - HDassert(name); - HDassert(actual_name); + assert(f); + assert(fapl); + assert(name); + assert(actual_name); /* Clear actual name pointer to begin with */ *actual_name = NULL; @@ -2816,15 +2816,15 @@ H5F_addr_encode_len(size_t addr_len, uint8_t **pp /*in,out*/, haddr_t addr) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(addr_len); - HDassert(pp && *pp); + assert(addr_len); + assert(pp && *pp); if (H5_addr_defined(addr)) { for (u = 0; u < addr_len; u++) { *(*pp)++ = (uint8_t)(addr & 0xff); addr >>= 8; } /* end for */ - HDassert("overflow" && 0 == addr); + assert("overflow" && 0 == addr); } /* end if */ else { for (u = 0; u < addr_len; u++) @@ -2850,7 +2850,7 @@ H5F_addr_encode(const H5F_t *f, uint8_t **pp /*in,out*/, haddr_t addr) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); H5F_addr_encode_len(H5F_SIZEOF_ADDR(f), pp, addr); @@ -2879,9 +2879,9 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp /*in,out*/, haddr_t *add /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(addr_len); - HDassert(pp && *pp); - HDassert(addr_p); + assert(addr_len); + assert(pp && *pp); + assert(addr_p); /* Reset value in destination */ *addr_p = 0; @@ -2907,8 +2907,8 @@ H5F_addr_decode_len(size_t addr_len, const uint8_t **pp /*in,out*/, haddr_t *add *addr_p |= tmp; } /* end if */ else if (!all_zero) - HDassert(0 == **pp); /*overflow */ - } /* end for */ + assert(0 == **pp); /*overflow */ + } /* end for */ /* If 'all_zero' is still TRUE, the address was entirely composed of '0xff' * bytes, which is the encoded form of 'HADDR_UNDEF', so set the destination @@ -2938,7 +2938,7 @@ H5F_addr_decode(const H5F_t *f, const uint8_t **pp /*in,out*/, haddr_t *addr_p / /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); H5F_addr_decode_len(H5F_SIZEOF_ADDR(f), pp, addr_p); @@ -2960,9 +2960,9 @@ H5F_set_grp_btree_shared(H5F_t *f, H5UC_t *rc) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(rc); + assert(f); + assert(f->shared); + assert(rc); f->shared->grp_btree_shared = rc; @@ -2984,8 +2984,8 @@ H5F_set_sohm_addr(H5F_t *f, haddr_t addr) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); f->shared->sohm_addr = addr; @@ -3007,8 +3007,8 @@ H5F_set_sohm_vers(H5F_t *f, unsigned vers) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); f->shared->sohm_vers = vers; @@ -3030,8 +3030,8 @@ H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); f->shared->sohm_nindexes = nindexes; @@ -3053,8 +3053,8 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); f->shared->store_msg_crt_idx = flag; @@ -3083,8 +3083,8 @@ H5F__set_libver_bounds(H5F_t *f, H5F_libver_t low, H5F_libver_t high) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Set the bounds only if the existing setting is different from the inputs */ if (f->shared->low_bound != low || f->shared->high_bound != high) { @@ -3240,9 +3240,9 @@ H5F__get_info(H5F_t *f, H5F_info2_t *finfo) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(finfo); + assert(f); + assert(f->shared); + assert(finfo); /* Reset file info struct */ HDmemset(finfo, 0, sizeof(*finfo)); @@ -3291,12 +3291,12 @@ H5F_track_metadata_read_retries(H5F_t *f, unsigned actype, unsigned retries) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared->read_attempts > 1); - HDassert(f->shared->retries_nbins > 0); - HDassert(retries > 0); - HDassert(retries < f->shared->read_attempts); - HDassert(actype < H5AC_NTYPES); + assert(f); + assert(f->shared->read_attempts > 1); + assert(f->shared->retries_nbins > 0); + assert(retries > 0); + assert(retries < f->shared->read_attempts); + assert(actype < H5AC_NTYPES); /* Allocate memory for retries */ if (NULL == f->shared->retries[actype]) @@ -3307,7 +3307,7 @@ H5F_track_metadata_read_retries(H5F_t *f, unsigned actype, unsigned retries) /* Index to retries based on log10 */ tmp = HDlog10((double)retries); log_ind = (unsigned)tmp; - HDassert(log_ind < f->shared->retries_nbins); + assert(log_ind < f->shared->retries_nbins); /* Increment the # of the "retries" */ f->shared->retries[actype][log_ind]++; @@ -3335,7 +3335,7 @@ H5F_set_retries(H5F_t *f) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); + assert(f); /* Initialize the tracking for metadata read retries */ HDmemset(f->shared->retries, 0, sizeof(f->shared->retries)); @@ -3370,8 +3370,8 @@ H5F_object_flush_cb(H5F_t *f, hid_t obj_id) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Invoke object flush callback if there is one */ if (f->shared->object_flush.func && @@ -3397,8 +3397,8 @@ H5F__set_base_addr(const H5F_t *f, haddr_t addr) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Dispatch to driver */ if (H5FD_set_base_addr(f->shared->lf, addr) < 0) @@ -3423,8 +3423,8 @@ H5F__set_eoa(const H5F_t *f, H5F_mem_t type, haddr_t addr) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Dispatch to driver */ /* (H5FD_set_eoa() will add base_addr to addr) */ @@ -3451,8 +3451,8 @@ H5F__set_paged_aggr(const H5F_t *f, hbool_t paged) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Dispatch to driver */ if (H5FD_set_paged_aggr(f->shared->lf, paged) < 0) @@ -3481,8 +3481,8 @@ H5F__get_max_eof_eoa(const H5F_t *f, haddr_t *max_eof_eoa) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Get the relative EOA and EOF */ eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT); @@ -3519,8 +3519,8 @@ H5F_get_metadata_read_retry_info(H5F_t *file, H5F_retry_info_t *info) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(file); - HDassert(info); + assert(file); + assert(info); /* Copy the # of bins for "retries" array */ info->nbins = file->shared->retries_nbins; @@ -3560,7 +3560,7 @@ H5F_get_metadata_read_retry_info(H5F_t *file, H5F_retry_info_t *info) case H5AC_FARRAY_DBLOCK_ID: case H5AC_FARRAY_DBLK_PAGE_ID: case H5AC_SUPERBLOCK_ID: - HDassert(j < H5F_NUM_METADATA_READ_RETRY_TYPES); + assert(j < H5F_NUM_METADATA_READ_RETRY_TYPES); if (file->shared->retries[i] != NULL) { /* Allocate memory for retries[i] * @@ -3641,8 +3641,8 @@ H5F__start_swmr_write(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Should have write permission */ if ((H5F_INTENT(f) & H5F_ACC_RDWR) == 0) @@ -3701,7 +3701,7 @@ H5F__start_swmr_write(H5F_t *f) * or ensure 0 cannot be a valid value and check for 0 at cleanup. */ if ((obj_apl_ids = (hid_t *)H5MM_calloc(grp_dset_count * sizeof(hid_t))) == NULL) HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "can't allocate buffer for hid_t") - HDassert(obj_apl_ids[0] == H5P_DEFAULT); + assert(obj_apl_ids[0] == H5P_DEFAULT); /* Get the list of opened object ids (groups & datasets) */ if (H5F_get_obj_ids(f, H5F_OBJ_GROUP | H5F_OBJ_DATASET, grp_dset_count, obj_ids, FALSE, @@ -3918,8 +3918,8 @@ H5F__format_convert(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Check if the superblock should be downgraded */ if (f->shared->sblock->super_vers > HDF5_SUPERBLOCK_VERSION_V18_LATEST) { @@ -4044,8 +4044,8 @@ H5F_set_min_dset_ohdr(H5F_t *f, hbool_t minimize) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); f->shared->crt_dset_min_ohdr_flag = minimize; diff --git a/src/H5Fio.c b/src/H5Fio.c index 8feacf4..2d29967 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -88,9 +88,9 @@ H5F_shared_block_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); - HDassert(buf); - HDassert(H5_addr_defined(addr)); + assert(f_sh); + assert(buf); + assert(H5_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if (H5_addr_le(f_sh->tmp_addr, (addr + size))) @@ -130,10 +130,10 @@ H5F_block_read(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, void *buf / FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(buf); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->shared); + assert(buf); + assert(H5_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if (H5_addr_le(f->shared->tmp_addr, (addr + size))) @@ -173,10 +173,10 @@ H5F_shared_block_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); - HDassert(H5F_SHARED_INTENT(f_sh) & H5F_ACC_RDWR); - HDassert(buf); - HDassert(H5_addr_defined(addr)); + assert(f_sh); + assert(H5F_SHARED_INTENT(f_sh) & H5F_ACC_RDWR); + assert(buf); + assert(H5_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if (H5_addr_le(f_sh->tmp_addr, (addr + size))) @@ -216,11 +216,11 @@ H5F_block_write(H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size, const void FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); - HDassert(buf); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(f->shared); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(buf); + assert(H5_addr_defined(addr)); /* Check for attempting I/O on 'temporary' file address */ if (H5_addr_le(f->shared->tmp_addr, (addr + size))) @@ -262,12 +262,12 @@ H5F_shared_select_read(H5F_shared_t *f_sh, H5FD_mem_t type, uint32_t count, H5S_ FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); - HDassert((mem_spaces) || (count == 0)); - HDassert((file_spaces) || (count == 0)); - HDassert((offsets) || (count == 0)); - HDassert((element_sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(f_sh); + assert((mem_spaces) || (count == 0)); + assert((file_spaces) || (count == 0)); + assert((offsets) || (count == 0)); + assert((element_sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; @@ -307,12 +307,12 @@ H5F_shared_select_write(H5F_shared_t *f_sh, H5FD_mem_t type, uint32_t count, H5S FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); - HDassert((mem_spaces) || (count == 0)); - HDassert((file_spaces) || (count == 0)); - HDassert((offsets) || (count == 0)); - HDassert((element_sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(f_sh); + assert((mem_spaces) || (count == 0)); + assert((file_spaces) || (count == 0)); + assert((offsets) || (count == 0)); + assert((element_sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* Treat global heap as raw data */ map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; @@ -335,11 +335,11 @@ H5F_shared_vector_read(H5F_shared_t *f_sh, uint32_t count, H5FD_mem_t types[], h FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); - HDassert((types) || (count == 0)); - HDassert((addrs) || (count == 0)); - HDassert((sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(f_sh); + assert((types) || (count == 0)); + assert((addrs) || (count == 0)); + assert((sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* * Note that we don't try to map global heap data to raw @@ -349,7 +349,7 @@ H5F_shared_vector_read(H5F_shared_t *f_sh, uint32_t count, H5FD_mem_t types[], h */ #ifndef NDEBUG for (uint32_t i = 0; i < count; i++) - HDassert(types[i] != H5FD_MEM_GHEAP); + assert(types[i] != H5FD_MEM_GHEAP); #endif /* Pass down to file driver layer (bypass page buffer for now) */ @@ -380,11 +380,11 @@ H5F_shared_vector_write(H5F_shared_t *f_sh, uint32_t count, H5FD_mem_t types[], FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); - HDassert((types) || (count == 0)); - HDassert((addrs) || (count == 0)); - HDassert((sizes) || (count == 0)); - HDassert((bufs) || (count == 0)); + assert(f_sh); + assert((types) || (count == 0)); + assert((addrs) || (count == 0)); + assert((sizes) || (count == 0)); + assert((bufs) || (count == 0)); /* * Note that we don't try to map global heap data to raw @@ -394,7 +394,7 @@ H5F_shared_vector_write(H5F_shared_t *f_sh, uint32_t count, H5FD_mem_t types[], */ #ifndef NDEBUG for (uint32_t i = 0; i < count; i++) - HDassert(types[i] != H5FD_MEM_GHEAP); + assert(types[i] != H5FD_MEM_GHEAP); #endif /* Pass down to file driver layer (bypass page buffer for now) */ @@ -460,8 +460,8 @@ H5F__evict_cache_entries(H5F_t *f) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Evict all except pinned entries in the cache */ if (H5AC_evict(f) < 0) @@ -515,8 +515,8 @@ H5F_get_checksums(const uint8_t *buf, size_t buf_size, uint32_t *s_chksum /*out* FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ - HDassert(buf); - HDassert(buf_size); + assert(buf); + assert(buf_size); /* Return the stored checksum */ if (s_chksum) { diff --git a/src/H5Fmount.c b/src/H5Fmount.c index ac193d7..73c41c2 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -47,7 +47,7 @@ H5F__close_mounts(H5F_t *f) FUNC_ENTER_PACKAGE - HDassert(f); + assert(f); /* Unmount all child files. Loop backwards to avoid having to adjust u when * a file is unmounted. Note that we rely on unsigned u "wrapping around" @@ -75,7 +75,7 @@ H5F__close_mounts(H5F_t *f) } } - HDassert(f->nmounts == 0); + assert(f->nmounts == 0); done: FUNC_LEAVE_NOAPI(ret_value) @@ -111,10 +111,10 @@ H5F_mount(const H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UN FUNC_ENTER_NOAPI(FAIL) - HDassert(loc); - HDassert(name && *name); - HDassert(child); - HDassert(TRUE == H5P_isa_class(plist_id, H5P_FILE_MOUNT)); + assert(loc); + assert(name && *name); + assert(child); + assert(TRUE == H5P_isa_class(plist_id, H5P_FILE_MOUNT)); /* Set up group location to fill in */ mp_loc.oloc = &mp_oloc; @@ -151,11 +151,11 @@ H5F_mount(const H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UN * "took over" the group location - QAK) */ parent = H5G_fileof(mount_point); - HDassert(parent); + assert(parent); mp_loc.oloc = H5G_oloc(mount_point); - HDassert(mp_loc.oloc); + assert(mp_loc.oloc); mp_loc.path = H5G_nameof(mount_point); - HDassert(mp_loc.path); + assert(mp_loc.path); for (ancestor = parent; ancestor; ancestor = ancestor->parent) if (ancestor->shared == child->shared) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount would introduce a cycle") @@ -275,8 +275,8 @@ H5F_unmount(const H5G_loc_t *loc, const char *name) FUNC_ENTER_NOAPI(FAIL) - HDassert(loc); - HDassert(name && *name); + assert(loc); + assert(name && *name); /* Set up mount point location to fill in */ mp_loc.oloc = &mp_oloc; @@ -348,7 +348,7 @@ H5F_unmount(const H5G_loc_t *loc, const char *name) * Could be different due to the shared mount table. */ parent = child->parent; } /* end else */ - HDassert(child_idx >= 0); + assert(child_idx >= 0); /* Save the information about the child from the mount table */ child_group = parent->shared->mtab.child[child_idx].group; @@ -411,7 +411,7 @@ H5F_is_mount(const H5F_t *file) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(file); + assert(file); if (file->parent != NULL) ret_value = TRUE; @@ -442,9 +442,9 @@ H5F__mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_ob FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(nopen_files); - HDassert(nopen_objs); + assert(f); + assert(nopen_files); + assert(nopen_objs); /* If this file is still open, increment number of file IDs open */ if (H5F_ID_EXISTS(f)) @@ -489,9 +489,9 @@ H5F__mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(nopen_files); - HDassert(nopen_objs); + assert(f); + assert(nopen_files); + assert(nopen_objs); /* Find the top file in the mounting hierarchy */ while (f->parent) @@ -525,7 +525,7 @@ H5F__flush_mounts_recurse(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); + assert(f); /* Flush all child files, not stopping for errors */ for (u = 0; u < f->shared->mtab.nmounts; u++) @@ -564,7 +564,7 @@ H5F_flush_mounts(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); + assert(f); /* Find the top file in the mount hierarchy */ while (f->parent) @@ -604,7 +604,7 @@ H5F_traverse_mount(H5O_loc_t *oloc /*in,out*/) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(oloc); + assert(oloc); /* * The loop is necessary because we might have file1 mounted at the root diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index c5368d8..6da127b 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -89,7 +89,7 @@ H5F_mpi_get_rank(const H5F_t *f) FUNC_ENTER_NOAPI((-1)) - HDassert(f && f->shared); + assert(f && f->shared); /* Dispatch to driver */ if ((ret_value = H5FD_mpi_get_rank(f->shared->lf)) < 0) @@ -120,7 +120,7 @@ H5F_mpi_get_comm(const H5F_t *f) FUNC_ENTER_NOAPI(MPI_COMM_NULL) - HDassert(f && f->shared); + assert(f && f->shared); /* Dispatch to driver */ if ((ret_value = H5FD_mpi_get_comm(f->shared->lf)) == MPI_COMM_NULL) @@ -151,7 +151,7 @@ H5F_shared_mpi_get_size(const H5F_shared_t *f_sh) FUNC_ENTER_NOAPI((-1)) - HDassert(f_sh); + assert(f_sh); /* Dispatch to driver */ if ((ret_value = H5FD_mpi_get_size(f_sh->lf)) < 0) @@ -182,7 +182,7 @@ H5F_mpi_get_size(const H5F_t *f) FUNC_ENTER_NOAPI((-1)) - HDassert(f && f->shared); + assert(f && f->shared); /* Dispatch to driver */ if ((ret_value = H5FD_mpi_get_size(f->shared->lf)) < 0) @@ -209,7 +209,7 @@ H5F__set_mpi_atomicity(H5F_t *file, hbool_t flag) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(file); + assert(file); /* Check VFD */ if (!H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI)) @@ -282,8 +282,8 @@ H5F__get_mpi_atomicity(const H5F_t *file, hbool_t *flag) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(file); - HDassert(flag); + assert(file); + assert(flag); /* Check VFD */ if (!H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI)) @@ -363,7 +363,7 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(mpi_comm); + assert(mpi_comm); /* Set value to return to invalid MPI comm */ *mpi_comm = MPI_COMM_NULL; @@ -378,7 +378,7 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) if (H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") f = loc.oloc->file; - HDassert(f); + assert(f); /* Check if MPIO driver is used */ if (H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) { @@ -436,7 +436,7 @@ H5F_get_coll_metadata_reads(const H5F_t *file) FUNC_ENTER_NOAPI_NOERR - HDassert(file && file->shared); + assert(file && file->shared); /* Retrieve the file-global flag */ file_flag = H5F_COLL_MD_READ(file); @@ -514,9 +514,9 @@ H5F_set_coll_metadata_reads(H5F_t *file, H5P_coll_md_read_flag_t *file_flag, hbo FUNC_ENTER_NOAPI_NOERR - HDassert(file && file->shared); - HDassert(file_flag); - HDassert(context_flag); + assert(file && file->shared); + assert(file_flag); + assert(context_flag); /* Save old state */ prev_file_flag = H5F_COLL_MD_READ(file); @@ -565,13 +565,13 @@ H5F_mpi_get_file_block_type(hbool_t commit, MPI_Datatype *new_type, hbool_t *new FUNC_ENTER_NOAPI(FAIL) - HDassert(new_type); - HDassert(new_type_derived); + assert(new_type); + assert(new_type_derived); *new_type_derived = FALSE; field_count = 2; - HDassert(field_count == sizeof(types) / sizeof(MPI_Datatype)); + assert(field_count == sizeof(types) / sizeof(MPI_Datatype)); block_lengths[0] = 1; block_lengths[1] = 1; diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 9f7f3c1..1605b44 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -79,7 +79,7 @@ H5F_shared_get_intent(const H5F_shared_t *f_sh) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f_sh); + assert(f_sh); FUNC_LEAVE_NOAPI(f_sh->flags) } /* end H5F_shared_get_intent() */ @@ -100,7 +100,7 @@ H5F_get_intent(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->shared->flags) } /* end H5F_get_intent() */ @@ -124,7 +124,7 @@ H5F_get_low_bound(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->shared->low_bound) } /* end H5F_get_low_bound() */ @@ -148,7 +148,7 @@ H5F_get_high_bound(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->shared->high_bound) } /* end H5F_get_high_bound() */ @@ -168,8 +168,8 @@ H5F_get_open_name(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->open_name); + assert(f); + assert(f->open_name); FUNC_LEAVE_NOAPI(f->open_name) } /* end H5F_get_open_name() */ @@ -189,8 +189,8 @@ H5F_get_actual_name(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->actual_name); + assert(f); + assert(f->actual_name); FUNC_LEAVE_NOAPI(f->actual_name) } /* end H5F_get_actual_name() */ @@ -211,9 +211,9 @@ H5F_get_extpath(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->extpath); + assert(f); + assert(f->shared); + assert(f->shared->extpath); FUNC_LEAVE_NOAPI(f->shared->extpath) } /* end H5F_get_extpath() */ @@ -232,7 +232,7 @@ H5F_get_shared(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->shared) } /* end H5F_get_shared() */ @@ -251,10 +251,10 @@ H5F_same_shared(const H5F_t *f1, const H5F_t *f2) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f1); - HDassert(f1->shared); - HDassert(f2); - HDassert(f2->shared); + assert(f1); + assert(f1->shared); + assert(f2); + assert(f2->shared); FUNC_LEAVE_NOAPI(f1->shared == f2->shared) } /* end H5F_same_shared() */ @@ -273,7 +273,7 @@ H5F_get_nopen_objs(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->nopen_objs) } /* end H5F_get_nopen_objs() */ @@ -292,7 +292,7 @@ H5F_file_id_exists(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->id_exists) } /* end H5F_file_id_exists() */ @@ -311,7 +311,7 @@ H5F_get_parent(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->parent) } /* end H5F_get_parent() */ @@ -330,7 +330,7 @@ H5F_get_nmounts(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->nmounts) } /* end H5F_get_nmounts() */ @@ -349,7 +349,7 @@ H5F_get_read_attempts(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->shared->read_attempts) } /* end H5F_get_read_attempts() */ @@ -369,8 +369,8 @@ H5F_get_fcpl(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->fcpl_id) } /* end H5F_get_fcpl() */ @@ -391,8 +391,8 @@ H5F_sizeof_addr(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->sizeof_addr) } /* end H5F_sizeof_addr() */ @@ -413,8 +413,8 @@ H5F_sizeof_size(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->sizeof_size) } /* H5F_sizeof_size() */ @@ -433,8 +433,8 @@ H5F_get_sohm_addr(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->sohm_addr) } /* end H5F_get_sohm_addr() */ @@ -453,8 +453,8 @@ H5F_get_sohm_vers(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->sohm_vers) } /* end H5F_get_sohm_vers() */ @@ -473,8 +473,8 @@ H5F_get_sohm_nindexes(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->sohm_nindexes) } /* end H5F_get_sohm_nindexes() */ @@ -497,9 +497,9 @@ H5F_sym_leaf_k(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->sblock); FUNC_LEAVE_NOAPI(f->shared->sblock->sym_leaf_k) } /* end H5F_sym_leaf_k() */ @@ -517,7 +517,7 @@ H5F_get_min_dset_ohdr(const H5F_t *f) { FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->shared->crt_dset_min_ohdr_flag) } /* end H5F_get_min_dset_ohdr */ @@ -540,10 +540,10 @@ H5F_Kvalue(const H5F_t *f, const H5B_class_t *type) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); - HDassert(type); + assert(f); + assert(f->shared); + assert(f->shared->sblock); + assert(type); FUNC_LEAVE_NOAPI(f->shared->sblock->btree_k[type->id]) } /* end H5F_Kvalue() */ @@ -562,8 +562,8 @@ H5F_get_nrefs(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->nrefs) } /* end H5F_get_nrefs() */ @@ -586,8 +586,8 @@ H5F_rdcc_nslots(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->rdcc_nslots) } /* end H5F_rdcc_nelmts() */ @@ -610,8 +610,8 @@ H5F_rdcc_nbytes(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->rdcc_nbytes) } /* end H5F_rdcc_nbytes() */ @@ -634,8 +634,8 @@ H5F_rdcc_w0(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->rdcc_w0) } /* end H5F_rdcc_w0() */ @@ -656,9 +656,9 @@ H5F_get_base_addr(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->sblock); FUNC_LEAVE_NOAPI(f->shared->sblock->base_addr) } /* end H5F_get_base_addr() */ @@ -681,8 +681,8 @@ H5F_grp_btree_shared(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->grp_btree_shared) } /* end H5F_grp_btree_shared() */ @@ -705,8 +705,8 @@ H5F_sieve_buf_size(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->sieve_buf_size) } /* end H5F_sieve_buf_size() */ @@ -732,8 +732,8 @@ H5F_gc_ref(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->gc_ref) } /* end H5F_gc_ref() */ @@ -753,8 +753,8 @@ H5F_get_fc_degree(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->fc_degree) } /* end H5F_get_fc_degree() */ @@ -776,8 +776,8 @@ H5F_get_evict_on_close(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->evict_on_close) } /* end H5F_get_evict_on_close() */ @@ -797,8 +797,8 @@ H5F_store_msg_crt_idx(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->store_msg_crt_idx) } /* end H5F_store_msg_crt_idx() */ @@ -818,7 +818,7 @@ H5F_shared_has_feature(const H5F_shared_t *f_sh, unsigned feature) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f_sh); + assert(f_sh); FUNC_LEAVE_NOAPI((hbool_t)(f_sh->lf->feature_flags & feature)) } /* end H5F_shared_has_feature() */ @@ -838,8 +838,8 @@ H5F_has_feature(const H5F_t *f, unsigned feature) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI((hbool_t)(f->shared->lf->feature_flags & feature)) } /* end H5F_has_feature() */ @@ -860,9 +860,9 @@ H5F_get_driver_id(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); + assert(f); + assert(f->shared); + assert(f->shared->lf); FUNC_LEAVE_NOAPI(f->shared->lf->driver_id) } /* end H5F_get_driver_id() */ @@ -884,10 +884,10 @@ H5F_get_fileno(const H5F_t *f, unsigned long *filenum) FUNC_ENTER_NOAPI(FAIL) - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(filenum); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(filenum); /* Retrieve the file's serial number */ if (H5FD_get_fileno(f->shared->lf, filenum) < 0) @@ -912,7 +912,7 @@ H5F_shared_get_eoa(const H5F_shared_t *f_sh, H5FD_mem_t type) FUNC_ENTER_NOAPI(HADDR_UNDEF) - HDassert(f_sh); + assert(f_sh); /* Dispatch to driver */ if (HADDR_UNDEF == (ret_value = H5FD_get_eoa(f_sh->lf, type))) @@ -937,8 +937,8 @@ H5F_get_eoa(const H5F_t *f, H5FD_mem_t type) FUNC_ENTER_NOAPI(HADDR_UNDEF) - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Dispatch to driver */ if (HADDR_UNDEF == (ret_value = H5FD_get_eoa(f->shared->lf, type))) @@ -963,8 +963,8 @@ H5F_shared_get_file_driver(const H5F_shared_t *f_sh, H5FD_t **file_handle) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f_sh); - HDassert(file_handle); + assert(f_sh); + assert(file_handle); *file_handle = f_sh->lf; @@ -989,8 +989,8 @@ H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void **file_handle) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(file); - HDassert(file_handle); + assert(file); + assert(file_handle); /* Get the VFD handle */ if (H5FD_get_vfd_handle(file->shared->lf, fapl, file_handle) < 0) @@ -1017,8 +1017,8 @@ H5F_is_tmp_addr(const H5F_t *f, haddr_t addr) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(H5_addr_le(f->shared->tmp_addr, addr)) } /* end H5F_is_tmp_addr() */ @@ -1040,8 +1040,8 @@ H5F_use_tmp_space(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->use_tmp_space) } /* end H5F_use_tmp_space() */ @@ -1063,7 +1063,7 @@ H5F_coll_md_read(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->shared->coll_md_read) } /* end H5F_coll_md_read() */ @@ -1088,8 +1088,8 @@ H5F_shared_get_mpi_file_sync_required(const H5F_shared_t *f_sh, hbool_t *flag /* FUNC_ENTER_NOAPI(FAIL) - HDassert(f_sh); - HDassert(flag); + assert(f_sh); + assert(flag); /* Dispatch to driver */ if ((ret_value = H5FD_mpi_get_file_sync_required(f_sh->lf, flag)) < 0) @@ -1117,8 +1117,8 @@ H5F_use_mdc_logging(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->use_mdc_logging) } /* end H5F_use_mdc_logging() */ @@ -1140,8 +1140,8 @@ H5F_start_mdc_log_on_access(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->start_mdc_log_on_access) } /* end H5F_start_mdc_log_on_access() */ @@ -1163,8 +1163,8 @@ H5F_mdc_log_location(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->mdc_log_location) } /* end H5F_mdc_log_location() */ @@ -1184,8 +1184,8 @@ H5F_get_alignment(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->alignment) } /* end H5F_get_alignment() */ @@ -1205,8 +1205,8 @@ H5F_get_threshold(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->threshold) } /* end H5F_get_threshold() */ @@ -1226,8 +1226,8 @@ H5F_get_pgend_meta_thres(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->pgend_meta_thres) } /* end H5F_get_pgend_meta_thres() */ @@ -1247,8 +1247,8 @@ H5F_get_point_of_no_return(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->point_of_no_return) } /* end H5F_get_point_of_no_return() */ @@ -1268,8 +1268,8 @@ H5F_get_null_fsm_addr(const H5F_t *f) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->null_fsm_addr) } /* end H5F_get_null_fsm_addr() */ @@ -1291,8 +1291,8 @@ H5F_get_vol_cls(const H5F_t *f) { FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->vol_cls) } /* end H5F_get_vol_cls */ @@ -1311,7 +1311,7 @@ H5F_get_vol_obj(const H5F_t *f) { FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); + assert(f); FUNC_LEAVE_NOAPI(f->vol_obj) } /* end H5F_get_vol_obj */ @@ -1337,8 +1337,8 @@ H5F__get_cont_info(const H5F_t *f, H5VL_file_cont_info_t *info) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Verify structure version */ if (info->version != H5VL_CONTAINER_INFO_VERSION) @@ -1367,8 +1367,8 @@ H5F_get_file_locking(const H5F_t *f) { FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); FUNC_LEAVE_NOAPI(f->shared->use_file_locking) } /* end H5F_get_file_locking */ @@ -1389,8 +1389,8 @@ H5F_has_vector_select_io(const H5F_t *f, hbool_t is_write) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (is_write) ret_value = (f->shared->lf->cls->write_vector != NULL || f->shared->lf->cls->write_selection != NULL); diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index 2cf75d0..b4720c6 100644 --- a/src/H5Fsfile.c +++ b/src/H5Fsfile.c @@ -56,7 +56,7 @@ H5F_sfile_assert_num(unsigned n) if (n == 0) { /* Sanity checking */ - HDassert(H5F_sfile_head_s == NULL); + assert(H5F_sfile_head_s == NULL); } /* end if */ else { unsigned count; /* Number of open shared files */ @@ -74,7 +74,7 @@ H5F_sfile_assert_num(unsigned n) } /* end while */ /* Sanity checking */ - HDassert(count == n); + assert(count == n); } /* end else */ FUNC_LEAVE_NOAPI_VOID @@ -101,7 +101,7 @@ H5F__sfile_add(H5F_shared_t *shared) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(shared); + assert(shared); /* Allocate new shared file node */ if (NULL == (new_shared = H5FL_CALLOC(H5F_sfile_node_t))) @@ -140,7 +140,7 @@ H5F__sfile_search(H5FD_t *lf) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(lf); + assert(lf); /* Iterate through low-level files for matching low-level file info */ curr = H5F_sfile_head_s; @@ -179,7 +179,7 @@ H5F__sfile_remove(H5F_shared_t *shared) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(shared); + assert(shared); /* Locate shared file node with correct shared file */ last = NULL; diff --git a/src/H5Fspace.c b/src/H5Fspace.c index 9ac0620..0ccfa2e 100644 --- a/src/H5Fspace.c +++ b/src/H5Fspace.c @@ -89,11 +89,11 @@ H5F__alloc(H5F_t *f, H5F_mem_t type, hsize_t size, haddr_t *frag_addr, hsize_t * FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(size > 0); /* Check whether the file can use temporary addresses */ if (f->shared->use_tmp_space) { @@ -148,11 +148,11 @@ H5F__free(H5F_t *f, H5FD_mem_t type, haddr_t addr, hsize_t size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(size > 0); /* Call the file driver 'free' routine */ if (H5FD_free(f->shared->lf, type, f, addr, size) < 0) @@ -192,11 +192,11 @@ H5F__try_extend(H5F_t *f, H5FD_mem_t type, haddr_t blk_end, hsize_t extra_reques FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(extra_requested > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(extra_requested > 0); /* Extend the object by extending the underlying file */ if ((ret_value = H5FD_try_extend(f->shared->lf, type, f, blk_end, extra_requested)) < 0) diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index f6070ed..808fa19 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -94,11 +94,11 @@ H5F__super_ext_create(H5F_t *f, H5O_loc_t *ext_ptr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); - HDassert(!H5_addr_defined(f->shared->sblock->ext_addr)); - HDassert(ext_ptr); + assert(f); + assert(f->shared); + assert(f->shared->sblock); + assert(!H5_addr_defined(f->shared->sblock->ext_addr)); + assert(ext_ptr); /* Check for older version of superblock format that can't support superblock extensions */ if (f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) @@ -148,9 +148,9 @@ H5F__super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(H5_addr_defined(ext_addr)); - HDassert(ext_ptr); + assert(f); + assert(H5_addr_defined(ext_addr)); + assert(ext_ptr); /* Set up "fake" object location for superblock extension */ H5O_loc_reset(ext_ptr); @@ -186,8 +186,8 @@ H5F__super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hbool_t was_created) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(ext_ptr); + assert(f); + assert(ext_ptr); /* Check if extension was created */ if (was_created) { @@ -244,11 +244,11 @@ H5F__update_super_ext_driver_msg(H5F_t *f) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); sblock = f->shared->sblock; - HDassert(sblock); - HDassert(sblock->cache_info.type == H5AC_SUPERBLOCK); + assert(sblock); + assert(sblock->cache_info.type == H5AC_SUPERBLOCK); /* Update the driver information message in the superblock extension * if appropriate. @@ -271,7 +271,7 @@ H5F__update_super_ext_driver_msg(H5F_t *f) uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */ /* Sanity check */ - HDassert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); + assert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); /* Encode driver-specific data */ if (H5FD_sb_encode(f->shared->lf, drvinfo.name, dbuf) < 0) @@ -362,7 +362,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) int mpi_result; /* Sanity check */ - HDassert(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)); + assert(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)); /* Set up MPI info */ if ((mpi_rank = H5F_mpi_get_rank(f)) < 0) @@ -495,7 +495,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) /* Mark the superblock dirty if it was modified during loading */ if (((rw_flags & H5AC__READ_ONLY_FLAG) == 0) && udata.ignore_drvrinfo && udata.drvrinfo_removed) { - HDassert(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2); + assert(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2); sblock_flags |= H5AC__DIRTIED_FLAG; } /* end if */ @@ -536,7 +536,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) /* Handle the B-tree 'K' values */ if (sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) { /* Sanity check */ - HDassert(udata.sym_leaf_k != 0); + assert(udata.sym_leaf_k != 0); /* Set the symbol table internal node 'K' value */ if (H5P_set(c_plist, H5F_CRT_SYM_LEAF_NAME, &udata.sym_leaf_k) < 0) @@ -633,7 +633,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) /* Sanity check - driver info block should only be defined for * superblock version < 2. */ - HDassert(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2); + assert(sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2); /* Set up user data */ drvrinfo_udata.f = f; @@ -725,7 +725,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) /* Reset driver info message */ H5O_msg_reset(H5O_DRVINFO_ID, &drvinfo); - HDassert(FALSE == f->shared->drvinfo_sb_msg_exists); + assert(FALSE == f->shared->drvinfo_sb_msg_exists); f->shared->drvinfo_sb_msg_exists = TRUE; } /* end else */ } /* end if */ @@ -812,8 +812,8 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set file space strategy") } /* end if */ - HDassert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); - HDassert(fsinfo.page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); + assert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); + assert(fsinfo.page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); if (f->shared->fs_page_size != fsinfo.page_size) { f->shared->fs_page_size = fsinfo.page_size; @@ -838,7 +838,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) * option is used. */ if (!skip_eof_check && !f->shared->null_fsm_addr) - HDassert((!f->shared->fs_persist) || (f->shared->eoa_fsm_fsalloc != HADDR_UNDEF)); + assert((!f->shared->fs_persist) || (f->shared->eoa_fsm_fsalloc != HADDR_UNDEF)); /* * A crashed file with persistent free-space managers may have @@ -888,7 +888,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) * be set -- verify that it is NULL, and then set it. * Set it back to NULL when we are done. */ - HDassert(f->shared->sblock == NULL); + assert(f->shared->sblock == NULL); f->shared->sblock = sblock; #endif /* JRM */ @@ -972,7 +972,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */ /* Sanity check */ - HDassert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); + assert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); /* Encode driver-specific data */ if (H5FD_sb_encode(f->shared->lf, drvinfo.name, dbuf) < 0) @@ -991,7 +991,7 @@ H5F__super_read(H5F_t *f, H5P_genplist_t *fa_plist, hbool_t initial_read) * be set -- verify that it is NULL, and then set it. * Set it back to NULL when we are done. */ - HDassert(f->shared->sblock == NULL); + assert(f->shared->sblock == NULL); f->shared->sblock = sblock; #endif /* JRM */ if (H5F__super_ext_write_msg(f, H5O_DRVINFO_ID, &drvinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0) @@ -1304,12 +1304,12 @@ H5F__super_init(H5F_t *f) /* Files with SOHM indices always need the superblock extension */ if (f->shared->sohm_nindexes > 0) { - HDassert(super_vers >= HDF5_SUPERBLOCK_VERSION_2); + assert(super_vers >= HDF5_SUPERBLOCK_VERSION_2); need_ext = TRUE; } /* end if */ /* Files with non-default free space settings always need the superblock extension */ else if (non_default_fs_settings) { - HDassert(super_vers >= HDF5_SUPERBLOCK_VERSION_2); + assert(super_vers >= HDF5_SUPERBLOCK_VERSION_2); need_ext = TRUE; } /* end if */ /* If we're going to use a version of the superblock format which allows @@ -1379,7 +1379,7 @@ H5F__super_init(H5F_t *f) uint8_t dbuf[H5F_MAX_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */ /* Sanity check */ - HDassert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); + assert(driver_size <= H5F_MAX_DRVINFOBLOCK_SIZE); /* Encode driver-specific data */ HDmemset(dbuf, 0, sizeof(dbuf)); @@ -1392,7 +1392,7 @@ H5F__super_init(H5F_t *f) if (H5O_msg_create(&ext_loc, H5O_DRVINFO_ID, H5O_MSG_FLAG_DONTSHARE, H5O_UPDATE_TIME, &info) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update driver info header message") - HDassert(FALSE == f->shared->drvinfo_sb_msg_exists); + assert(FALSE == f->shared->drvinfo_sb_msg_exists); f->shared->drvinfo_sb_msg_exists = TRUE; } /* end if */ @@ -1427,7 +1427,7 @@ H5F__super_init(H5F_t *f) /* Check for creating an "old-style" driver info block */ if (driver_size > 0) { /* Sanity check */ - HDassert(H5_addr_defined(sblock->driver_addr)); + assert(H5_addr_defined(sblock->driver_addr)); /* Allocate space for the driver info */ if (NULL == (drvinfo = (H5O_drvinfo_t *)H5MM_calloc(sizeof(H5O_drvinfo_t)))) @@ -1450,7 +1450,7 @@ H5F__super_init(H5F_t *f) f->shared->drvinfo = drvinfo; } /* end if */ else - HDassert(!H5_addr_defined(sblock->driver_addr)); + assert(!H5_addr_defined(sblock->driver_addr)); } /* end if */ done: @@ -1527,9 +1527,9 @@ H5F_eoa_dirty(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->sblock); /* Mark superblock dirty in cache, so change to EOA will get encoded */ if (H5F_super_dirty(f) < 0) @@ -1574,9 +1574,9 @@ H5F_super_dirty(H5F_t *f) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->sblock); /* Mark superblock dirty in cache, so change to EOA will get encoded */ if (H5AC_mark_entry_dirty(f->shared->sblock) < 0) @@ -1605,7 +1605,7 @@ H5F__super_free(H5F_super_t *sblock) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(sblock); + assert(sblock); /* Free root group symbol table entry, if any */ sblock->root_ent = (H5G_entry_t *)H5MM_xfree(sblock->root_ent); @@ -1638,9 +1638,9 @@ H5F__super_size(H5F_t *f, hsize_t *super_size, hsize_t *super_ext_size) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->sblock); /* Set the superblock size */ if (super_size) @@ -1704,9 +1704,9 @@ H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, hbool_t may_create, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->sblock); /* Set the ring type in the API context */ H5AC_set_ring(H5AC_RING_SBE, &orig_ring); @@ -1717,12 +1717,12 @@ H5F__super_ext_write_msg(H5F_t *f, unsigned id, void *mesg, hbool_t may_create, HGOTO_ERROR(H5E_FILE, H5E_CANTOPENOBJ, FAIL, "unable to open file's superblock extension") } /* end if */ else { - HDassert(may_create); + assert(may_create); if (H5F__super_ext_create(f, &ext_loc) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCREATE, FAIL, "unable to create file's superblock extension") ext_created = TRUE; } /* end else */ - HDassert(H5_addr_defined(ext_loc.addr)); + assert(H5_addr_defined(ext_loc.addr)); ext_opened = TRUE; /* Check if message with ID does not exist in the object header */ @@ -1788,7 +1788,7 @@ H5F__super_ext_remove_msg(H5F_t *f, unsigned id) FUNC_ENTER_PACKAGE /* Make sure that the superblock extension object header exists */ - HDassert(H5_addr_defined(f->shared->sblock->ext_addr)); + assert(H5_addr_defined(f->shared->sblock->ext_addr)); /* Set the ring type in the API context */ H5AC_set_ring(H5AC_RING_SBE, &orig_ring); @@ -1818,7 +1818,7 @@ H5F__super_ext_remove_msg(H5F_t *f, unsigned id) if ((null_count = H5O_msg_count(&ext_loc, H5O_NULL_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to count messages") else if ((unsigned)null_count == hdr_info.nmesgs) { - HDassert(H5_addr_defined(ext_loc.addr)); + assert(H5_addr_defined(ext_loc.addr)); if (H5O_delete(f, ext_loc.addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTCOUNT, FAIL, "unable to count messages") f->shared->sblock->ext_addr = HADDR_UNDEF; diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 9a5c6d3..718c16d 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -148,11 +148,11 @@ H5F__superblock_prefix_decode(H5F_super_t *sblock, const uint8_t **image_ref, si FUNC_ENTER_PACKAGE - HDassert(sblock); - HDassert(image_ref); - HDassert(image); - HDassert(udata); - HDassert(udata->f); + assert(sblock); + assert(image_ref); + assert(image); + assert(udata); + assert(udata->f); /* Skip over signature (already checked when locating the superblock) */ if (H5_IS_BUFFER_OVERFLOW(image, H5F_SIGNATURE_LEN, end)) @@ -234,11 +234,11 @@ H5F__drvrinfo_prefix_decode(H5O_drvinfo_t *drvrinfo, char *drv_name, const uint8 FUNC_ENTER_PACKAGE - HDassert(drvrinfo); - HDassert(image_ref); - HDassert(image); - HDassert(udata); - HDassert(udata->f); + assert(drvrinfo); + assert(image_ref); + assert(image); + assert(udata); + assert(udata->f); /* Version number */ if (H5_IS_BUFFER_OVERFLOW(image, 1, end)) @@ -305,7 +305,7 @@ H5F__cache_superblock_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t { FUNC_ENTER_PACKAGE_NOERR - HDassert(image_len); + assert(image_len); /* Set the initial image length size */ *image_len = H5F_SUPERBLOCK_FIXED_SIZE + /* Fixed size of superblock */ @@ -333,11 +333,11 @@ H5F__cache_superblock_get_final_load_size(const void *_image, size_t image_len, FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(udata); - HDassert(actual_len); - HDassert(*actual_len == image_len); - HDassert(image_len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); + assert(image); + assert(udata); + assert(actual_len); + assert(*actual_len == image_len); + assert(image_len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); /* Deserialize the file superblock's prefix */ if (H5F__superblock_prefix_decode(&sblock, &image, image_len, udata, TRUE) < 0) @@ -375,8 +375,8 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata FUNC_ENTER_PACKAGE_NOERR - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* No checksum for version 0 & 1 */ if (udata->super_vers >= HDF5_SUPERBLOCK_VERSION_2) { @@ -411,10 +411,10 @@ H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata, FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(udata); - HDassert(udata->f); - HDassert(len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); + assert(image); + assert(udata); + assert(udata->f); + assert(len >= H5F_SUPERBLOCK_FIXED_SIZE + 6); /* Allocate space for the superblock */ if (NULL == (sblock = H5FL_CALLOC(H5F_super_t))) @@ -632,9 +632,9 @@ H5F__cache_superblock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(sblock); - HDassert(sblock->cache_info.type == H5AC_SUPERBLOCK); - HDassert(image_len); + assert(sblock); + assert(sblock->cache_info.type == H5AC_SUPERBLOCK); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5F_SUPERBLOCK_SIZE(sblock); @@ -660,15 +660,15 @@ H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNU FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(image); - HDassert(sblock); + assert(f); + assert(image); + assert(sblock); /* Assert that the superblock is marked as being flushed last (and collectively in parallel) */ /* (We'll rely on the cache to make sure it actually *is* flushed last (and collectively in parallel), but this check doesn't hurt) */ - HDassert(sblock->cache_info.flush_me_last); + assert(sblock->cache_info.flush_me_last); /* Encode the common portion of the file superblock for all versions */ H5MM_memcpy(image, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN); @@ -763,11 +763,11 @@ H5F__cache_superblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNU UINT32ENCODE(image, chksum); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == (size_t)H5F_SUPERBLOCK_SIZE(sblock)); + assert((size_t)(image - (uint8_t *)_image) == (size_t)H5F_SUPERBLOCK_SIZE(sblock)); } /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -790,8 +790,8 @@ H5F__cache_superblock_free_icr(void *_thing) FUNC_ENTER_PACKAGE - HDassert(sblock); - HDassert(sblock->cache_info.type == H5AC_SUPERBLOCK); + assert(sblock); + assert(sblock->cache_info.type == H5AC_SUPERBLOCK); /* Destroy superblock */ if (H5F__super_free(sblock) < 0) @@ -814,7 +814,7 @@ H5F__cache_drvrinfo_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *i { FUNC_ENTER_PACKAGE_NOERR - HDassert(image_len); + assert(image_len); /* Set the initial image length size */ *image_len = H5F_DRVINFOBLOCK_HDR_SIZE; /* Fixed size portion of driver info block */ @@ -841,11 +841,11 @@ H5F__cache_drvrinfo_get_final_load_size(const void *_image, size_t image_len, vo FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(udata); - HDassert(actual_len); - HDassert(*actual_len == image_len); - HDassert(image_len == H5F_DRVINFOBLOCK_HDR_SIZE); + assert(image); + assert(udata); + assert(actual_len); + assert(*actual_len == image_len); + assert(image_len == H5F_DRVINFOBLOCK_HDR_SIZE); /* Deserialize the file driver info's prefix */ if (H5F__drvrinfo_prefix_decode(&drvrinfo, NULL, &image, image_len, udata, TRUE) < 0) @@ -878,10 +878,10 @@ H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, hb FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(len >= H5F_DRVINFOBLOCK_HDR_SIZE); - HDassert(udata); - HDassert(udata->f); + assert(image); + assert(len >= H5F_DRVINFOBLOCK_HDR_SIZE); + assert(udata); + assert(udata->f); /* Allocate space for the driver info */ if (NULL == (drvinfo = (H5O_drvinfo_t *)H5MM_calloc(sizeof(H5O_drvinfo_t)))) @@ -892,14 +892,14 @@ H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, hb HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "can't decode file driver info prefix") /* Sanity check */ - HDassert(len == (H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)); + assert(len == (H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)); /* Validate and decode driver information */ if (H5FD_sb_load(udata->f->shared->lf, drv_name, image) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, NULL, "unable to decode driver information") /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) <= len); + assert((size_t)(image - (const uint8_t *)_image) <= len); ret_value = drvinfo; @@ -926,9 +926,9 @@ H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(drvinfo); - HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO); - HDassert(image_len); + assert(drvinfo); + assert(drvinfo->cache_info.type == H5AC_DRVRINFO); + assert(image_len); /* Set the image length size */ *image_len = (size_t)(H5F_DRVINFOBLOCK_HDR_SIZE + /* Fixed-size portion of driver info block */ @@ -955,11 +955,11 @@ H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBU FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(image); - HDassert(drvinfo); - HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO); - HDassert(len == (size_t)(H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)); + assert(f); + assert(image); + assert(drvinfo); + assert(drvinfo->cache_info.type == H5AC_DRVRINFO); + assert(len == (size_t)(H5F_DRVINFOBLOCK_HDR_SIZE + drvinfo->len)); /* Save pointer to beginning of driver info */ dbuf = image; @@ -981,7 +981,7 @@ H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBU image += 8 + drvinfo->len; /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1003,8 +1003,8 @@ H5F__cache_drvrinfo_free_icr(void *_thing) FUNC_ENTER_PACKAGE_NOERR - HDassert(drvinfo); - HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO); + assert(drvinfo); + assert(drvinfo->cache_info.type == H5AC_DRVRINFO); /* Destroy driver info message */ H5MM_xfree(drvinfo); diff --git a/src/H5Gbtree2.c b/src/H5Gbtree2.c index e23c772..3094386 100644 --- a/src/H5Gbtree2.c +++ b/src/H5Gbtree2.c @@ -223,8 +223,8 @@ H5G__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(bt2_udata); - HDassert(bt2_rec); + assert(bt2_udata); + assert(bt2_rec); /* Check hash value */ if (bt2_udata->name_hash < bt2_rec->hash) @@ -235,7 +235,7 @@ H5G__dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec, int H5G_fh_ud_cmp_t fh_udata; /* User data for fractal heap 'op' callback */ /* Sanity check */ - HDassert(bt2_udata->name_hash == bt2_rec->hash); + assert(bt2_udata->name_hash == bt2_rec->hash); /* Prepare user data for callback */ /* down */ @@ -393,8 +393,8 @@ H5G__dense_btree2_corder_compare(const void *_bt2_udata, const void *_bt2_rec, i FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(bt2_udata); - HDassert(bt2_rec); + assert(bt2_udata); + assert(bt2_rec); /* Check creation order value */ if (bt2_udata->corder < bt2_rec->corder) diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 60a0f28..a4a127d 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -112,8 +112,8 @@ H5G__cache_node_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(f); - HDassert(image_len); + assert(f); + assert(image_len); /* Set the image length size */ *image_len = (size_t)(H5G_NODE_SIZE(f)); @@ -149,10 +149,10 @@ H5G__cache_node_deserialize(const void *_image, size_t len, void *_udata, hbool_ FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(len > 0); - HDassert(f); - HDassert(dirty); + assert(image); + assert(len > 0); + assert(f); + assert(dirty); /* Allocate symbol table data structures */ if (NULL == (sym = H5FL_CALLOC(H5G_node_t))) @@ -215,9 +215,9 @@ H5G__cache_node_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(sym); - HDassert(sym->cache_info.type == H5AC_SNODE); - HDassert(image_len); + assert(sym); + assert(sym->cache_info.type == H5AC_SNODE); + assert(image_len); *image_len = sym->node_size; @@ -244,11 +244,11 @@ H5G__cache_node_serialize(const H5F_t *f, void *_image, size_t len, void *_thing FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(image); - HDassert(sym); - HDassert(sym->cache_info.type == H5AC_SNODE); - HDassert(len == sym->node_size); + assert(f); + assert(image); + assert(sym); + assert(sym->cache_info.type == H5AC_SNODE); + assert(len == sym->node_size); /* Magic number */ H5MM_memcpy(image, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -290,8 +290,8 @@ H5G__cache_node_free_icr(void *_thing) FUNC_ENTER_PACKAGE - HDassert(sym); - HDassert(sym->cache_info.type == H5AC_SNODE); + assert(sym); + assert(sym->cache_info.type == H5AC_SNODE); /* Destroy symbol table node */ if (H5G__node_free(sym) < 0) diff --git a/src/H5Gcompact.c b/src/H5Gcompact.c index 4c5e8e3..138bde8 100644 --- a/src/H5Gcompact.c +++ b/src/H5Gcompact.c @@ -85,9 +85,9 @@ H5G__compact_build_table_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(lnk); - HDassert(udata); - HDassert(udata->curr_lnk < udata->ltable->nlinks); + assert(lnk); + assert(udata); + assert(udata->curr_lnk < udata->ltable->nlinks); /* Copy link message into table */ if (NULL == H5O_msg_copy(H5O_LINK_ID, lnk, &(udata->ltable->lnks[udata->curr_lnk]))) @@ -123,9 +123,9 @@ H5G__compact_build_table(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_ind FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(oloc); - HDassert(linfo); - HDassert(ltable); + assert(oloc); + assert(linfo); + assert(ltable); /* Set size of table */ H5_CHECK_OVERFLOW(linfo->nlinks, hsize_t, size_t); @@ -183,8 +183,8 @@ H5G__compact_insert(const H5O_loc_t *grp_oloc, H5O_link_t *obj_lnk) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(grp_oloc && grp_oloc->file); - HDassert(obj_lnk); + assert(grp_oloc && grp_oloc->file); + assert(obj_lnk); /* Insert link message into group */ if (H5O_msg_create(grp_oloc, H5O_LINK_ID, 0, H5O_UPDATE_TIME, obj_lnk) < 0) @@ -217,7 +217,7 @@ H5G__compact_get_name_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5 FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(oloc); + assert(oloc); /* Build table of all link messages */ if (H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) @@ -268,8 +268,8 @@ H5G__compact_remove_common_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, vo FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(lnk); - HDassert(udata); + assert(lnk); + assert(udata); /* If we've found the right link, get the object type */ if (HDstrcmp(lnk->name, udata->name) == 0) { @@ -305,8 +305,8 @@ H5G__compact_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const ch FUNC_ENTER_PACKAGE - HDassert(oloc && oloc->file); - HDassert(name && *name); + assert(oloc && oloc->file); + assert(name && *name); /* Initialize data to pass through object header iteration */ udata.file = oloc->file; @@ -343,8 +343,8 @@ H5G__compact_remove_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5RS FUNC_ENTER_PACKAGE - HDassert(oloc && oloc->file); - HDassert(linfo); + assert(oloc && oloc->file); + assert(linfo); /* Build table of all link messages, sorted according to desired order */ if (H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) @@ -394,9 +394,9 @@ H5G__compact_iterate(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_index_t FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(oloc); - HDassert(linfo); - HDassert(op); + assert(oloc); + assert(linfo); + assert(op); /* Build table of all link messages */ if (H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) @@ -437,8 +437,8 @@ H5G__compact_lookup_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, void *_ud FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(lnk); - HDassert(udata); + assert(lnk); + assert(udata); /* Check for name to get information */ if (HDstrcmp(lnk->name, udata->name) == 0) { @@ -481,9 +481,9 @@ H5G__compact_lookup(const H5O_loc_t *oloc, const char *name, hbool_t *found, H5O FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(name && *name); - HDassert(found); - HDassert(lnk && oloc->file); + assert(name && *name); + assert(found); + assert(lnk && oloc->file); /* Set up user data for iteration */ udata.name = name; @@ -523,9 +523,9 @@ H5G__compact_lookup_by_idx(const H5O_loc_t *oloc, const H5O_linfo_t *linfo, H5_i FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(oloc && oloc->file); - HDassert(linfo); - HDassert(lnk); + assert(oloc && oloc->file); + assert(linfo); + assert(lnk); /* Build table of all link messages, sorted according to desired order */ if (H5G__compact_build_table(oloc, linfo, idx_type, order, <able) < 0) diff --git a/src/H5Gdense.c b/src/H5Gdense.c index 4c74fa8..2b75925 100644 --- a/src/H5Gdense.c +++ b/src/H5Gdense.c @@ -260,8 +260,8 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline) /* * Check arguments. */ - HDassert(f); - HDassert(linfo); + assert(f); + assert(linfo); /* Set fractal heap creation parameters */ /* XXX: Give some control of these to applications? */ @@ -287,7 +287,7 @@ H5G__dense_create(H5F_t *f, H5O_linfo_t *linfo, const H5O_pline_t *pline) /* Retrieve the heap's ID length in the file */ if (H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") - HDassert(fheap_id_len == H5G_DENSE_FHEAP_ID_LEN); + assert(fheap_id_len == H5G_DENSE_FHEAP_ID_LEN); /* Create the name index v2 B-tree */ HDmemset(&bt2_cparam, 0, sizeof(bt2_cparam)); @@ -366,9 +366,9 @@ H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk) /* * Check arguments. */ - HDassert(f); - HDassert(linfo); - HDassert(lnk); + assert(f); + assert(linfo); + assert(lnk); /* Find out the size of buffer needed for serialized link */ if ((link_size = H5O_msg_raw_size(f, H5O_LINK_ID, FALSE, lnk)) == 0) @@ -415,7 +415,7 @@ H5G__dense_insert(H5F_t *f, const H5O_linfo_t *linfo, const H5O_link_t *lnk) /* Check if we should create a creation order index v2 B-tree record */ if (linfo->index_corder) { /* Open the creation order index v2 B-tree */ - HDassert(H5_addr_defined(linfo->corder_bt2_addr)); + assert(H5_addr_defined(linfo->corder_bt2_addr)); if (NULL == (bt2_corder = H5B2_open(f, linfo->corder_bt2_addr, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") @@ -462,8 +462,8 @@ H5G__dense_lookup_cb(const void *_lnk, void *_user_lnk) /* * Check arguments. */ - HDassert(lnk); - HDassert(user_lnk); + assert(lnk); + assert(user_lnk); /* Copy link information */ if (H5O_msg_copy(H5O_LINK_ID, lnk, user_lnk) == NULL) @@ -498,11 +498,11 @@ H5G__dense_lookup(H5F_t *f, const H5O_linfo_t *linfo, const char *name, hbool_t /* * Check arguments. */ - HDassert(f); - HDassert(linfo); - HDassert(name && *name); - HDassert(found); - HDassert(lnk); + assert(f); + assert(linfo); + assert(name && *name); + assert(found); + assert(lnk); /* Open the fractal heap */ if (NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) @@ -636,9 +636,9 @@ H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type /* * Check arguments. */ - HDassert(f); - HDassert(linfo); - HDassert(lnk); + assert(f); + assert(linfo); + assert(lnk); /* Determine the address of the index to use */ if (idx_type == H5_INDEX_NAME) { @@ -649,7 +649,7 @@ H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type bt2_addr = HADDR_UNDEF; } /* end if */ else { - HDassert(idx_type == H5_INDEX_CRT_ORDER); + assert(idx_type == H5_INDEX_CRT_ORDER); /* This address may not be defined if creation order is tracked, but * there's no index on it. If there's no v2 B-tree that indexes @@ -665,7 +665,7 @@ H5G__dense_lookup_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type */ if (order == H5_ITER_NATIVE && !H5_addr_defined(bt2_addr)) { bt2_addr = linfo->name_bt2_addr; - HDassert(H5_addr_defined(bt2_addr)); + assert(H5_addr_defined(bt2_addr)); } /* end if */ /* If there is an index defined for the field, use it */ @@ -738,9 +738,9 @@ H5G__dense_build_table_cb(const H5O_link_t *lnk, void *_udata) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(lnk); - HDassert(udata); - HDassert(udata->curr_lnk < udata->ltable->nlinks); + assert(lnk); + assert(udata); + assert(udata->curr_lnk < udata->ltable->nlinks); /* Copy link information */ if (H5O_msg_copy(H5O_LINK_ID, lnk, &(udata->ltable->lnks[udata->curr_lnk])) == NULL) @@ -778,9 +778,9 @@ H5G__dense_build_table(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(linfo); - HDassert(ltable); + assert(f); + assert(linfo); + assert(ltable); /* Set size of table */ H5_CHECK_OVERFLOW(linfo->nlinks, /* From: */ hsize_t, /* To: */ size_t); @@ -931,9 +931,9 @@ H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_i /* * Check arguments. */ - HDassert(f); - HDassert(linfo); - HDassert(op); + assert(f); + assert(linfo); + assert(op); /* Determine the address of the index to use */ if (idx_type == H5_INDEX_NAME) { @@ -944,7 +944,7 @@ H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_i bt2_addr = HADDR_UNDEF; } /* end if */ else { - HDassert(idx_type == H5_INDEX_CRT_ORDER); + assert(idx_type == H5_INDEX_CRT_ORDER); /* This address may not be defined if creation order is tracked, but * there's no index on it. If there's no v2 B-tree that indexes @@ -959,7 +959,7 @@ H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_i * process. */ if (order == H5_ITER_NATIVE && !H5_addr_defined(bt2_addr)) { - HDassert(H5_addr_defined(linfo->name_bt2_addr)); + assert(H5_addr_defined(linfo->name_bt2_addr)); bt2_addr = linfo->name_bt2_addr; } /* end if */ @@ -968,7 +968,7 @@ H5G__dense_iterate(H5F_t *f, const H5O_linfo_t *linfo, H5_index_t idx_type, H5_i H5G_bt2_ud_it_t udata; /* User data for iterator callback */ /* Sanity check */ - HDassert(H5_addr_defined(bt2_addr)); + assert(H5_addr_defined(bt2_addr)); /* Open the fractal heap */ if (NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) @@ -1127,8 +1127,8 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, H5 /* * Check arguments. */ - HDassert(f); - HDassert(linfo); + assert(f); + assert(linfo); /* Determine the address of the index to use */ if (idx_type == H5_INDEX_NAME) { @@ -1139,7 +1139,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, H5 bt2_addr = HADDR_UNDEF; } /* end if */ else { - HDassert(idx_type == H5_INDEX_CRT_ORDER); + assert(idx_type == H5_INDEX_CRT_ORDER); /* This address may not be defined if creation order is tracked, but * there's no index on it. If there's no v2 B-tree that indexes @@ -1155,7 +1155,7 @@ H5G__dense_get_name_by_idx(H5F_t *f, H5O_linfo_t *linfo, H5_index_t idx_type, H5 */ if (order == H5_ITER_NATIVE && !H5_addr_defined(bt2_addr)) { bt2_addr = linfo->name_bt2_addr; - HDassert(H5_addr_defined(bt2_addr)); + assert(H5_addr_defined(bt2_addr)); } /* end if */ /* If there is an index defined for the field, use it */ @@ -1251,7 +1251,7 @@ H5G__dense_remove_fh_cb(const void *obj, size_t obj_len, void *_udata) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for creation order index") /* Set up the user data for the v2 B-tree 'record remove' callback */ - HDassert(lnk->corder_valid); + assert(lnk->corder_valid); bt2_udata.corder = lnk->corder; /* Remove the record from the name index v2 B-tree */ @@ -1346,9 +1346,9 @@ H5G__dense_remove(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_full_path_ /* * Check arguments. */ - HDassert(f); - HDassert(linfo); - HDassert(name && *name); + assert(f); + assert(linfo); + assert(name && *name); /* Open the fractal heap */ if (NULL == (fheap = H5HF_open(f, linfo->fheap_addr))) @@ -1448,7 +1448,7 @@ H5G__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) else { const H5G_dense_bt2_corder_rec_t *record = (const H5G_dense_bt2_corder_rec_t *)_record; - HDassert(bt2_udata->idx_type == H5_INDEX_CRT_ORDER); + assert(bt2_udata->idx_type == H5_INDEX_CRT_ORDER); /* Set the heap ID to operate on */ heap_id = record->id; @@ -1461,7 +1461,7 @@ H5G__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) /* Call fractal heap 'op' routine, to perform user callback */ if (H5HF_op(bt2_udata->fheap, heap_id, H5G__dense_remove_by_idx_fh_cb, &fh_udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPERATE, FAIL, "link removal callback failed") - HDassert(fh_udata.lnk); + assert(fh_udata.lnk); /* Check for removing the link from the "other" index (creation order, when name used and vice versa) */ if (H5_addr_defined(bt2_udata->other_bt2_addr)) { @@ -1473,7 +1473,7 @@ H5G__dense_remove_by_idx_bt2_cb(const void *_record, void *_bt2_udata) other_bt2_udata.corder = fh_udata.lnk->corder; } /* end if */ else { - HDassert(bt2_udata->idx_type == H5_INDEX_CRT_ORDER); + assert(bt2_udata->idx_type == H5_INDEX_CRT_ORDER); /* Set up the user data for the v2 B-tree 'record remove' callback */ other_bt2_udata.f = bt2_udata->f; @@ -1549,8 +1549,8 @@ H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_ful /* * Check arguments. */ - HDassert(f); - HDassert(linfo); + assert(f); + assert(linfo); /* Determine the address of the index to use */ if (idx_type == H5_INDEX_NAME) { @@ -1561,7 +1561,7 @@ H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_ful bt2_addr = HADDR_UNDEF; } /* end if */ else { - HDassert(idx_type == H5_INDEX_CRT_ORDER); + assert(idx_type == H5_INDEX_CRT_ORDER); /* This address may not be defined if creation order is tracked, but * there's no index on it. If there's no v2 B-tree that indexes @@ -1577,7 +1577,7 @@ H5G__dense_remove_by_idx(H5F_t *f, const H5O_linfo_t *linfo, H5RS_str_t *grp_ful */ if (order == H5_ITER_NATIVE && !H5_addr_defined(bt2_addr)) { bt2_addr = linfo->name_bt2_addr; - HDassert(H5_addr_defined(bt2_addr)); + assert(H5_addr_defined(bt2_addr)); } /* end if */ /* If there is an index defined for the field, use it */ @@ -1651,8 +1651,8 @@ H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link) /* * Check arguments. */ - HDassert(f); - HDassert(linfo); + assert(f); + assert(linfo); /* Check if we are to adjust the ref. count for all the links */ /* (we adjust the ref. count when deleting a group and we _don't_ adjust @@ -1696,13 +1696,13 @@ H5G__dense_delete(H5F_t *f, H5O_linfo_t *linfo, hbool_t adj_link) /* Check if we should delete the creation order index v2 B-tree */ if (linfo->index_corder) { /* Delete the creation order index, without adjusting the ref. count on the links */ - HDassert(H5_addr_defined(linfo->corder_bt2_addr)); + assert(H5_addr_defined(linfo->corder_bt2_addr)); if (H5B2_delete(f, linfo->corder_bt2_addr, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete v2 B-tree for creation order index") linfo->corder_bt2_addr = HADDR_UNDEF; } /* end if */ else - HDassert(!H5_addr_defined(linfo->corder_bt2_addr)); + assert(!H5_addr_defined(linfo->corder_bt2_addr)); /* Delete the fractal heap */ if (H5HF_delete(f, linfo->fheap_addr) < 0) diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index fd729e6..594431c 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -1032,7 +1032,7 @@ H5G__get_objinfo_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char *name, /* Go retrieve the data model & native object information */ /* (don't need index & heap info) */ - HDassert(obj_loc); + assert(obj_loc); if (H5O_get_info(obj_loc->oloc, &dm_info, H5O_INFO_BASIC | H5O_INFO_TIME) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get data model object info") if (H5O_get_native_info(obj_loc->oloc, &nat_info, H5O_INFO_HDR) < 0) @@ -1099,8 +1099,8 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, H5 FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(loc); - HDassert(name && *name); + assert(loc); + assert(name && *name); /* Reset stat buffer */ if (statbuf) @@ -1137,7 +1137,7 @@ H5G__get_objinfo(const H5G_loc_t *loc, const char *name, hbool_t follow_link, H5 } else { /* UD link. H5L_get_info checked for invalid link classes */ - HDassert(linfo.type >= H5L_TYPE_UD_MIN && linfo.type <= H5L_TYPE_MAX); + assert(linfo.type >= H5L_TYPE_UD_MIN && linfo.type <= H5L_TYPE_MAX); statbuf->type = H5G_UDLINK; } } diff --git a/src/H5Gent.c b/src/H5Gent.c index 6ca9408..2a4b693 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -85,9 +85,9 @@ H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, const uint8_t *p_end, H5 FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f); - HDassert(pp); - HDassert(ent); + assert(f); + assert(pp); + assert(ent); /* decode entries */ for (u = 0; u < n; u++) { @@ -126,9 +126,9 @@ H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, const uint8 FUNC_ENTER_NOAPI(FAIL) /* check arguments */ - HDassert(f); - HDassert(pp); - HDassert(ent); + assert(f); + assert(pp); + assert(ent); if (H5_IS_BUFFER_OVERFLOW(*pp, ent->name_off, p_end)) HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, FAIL, "image pointer is out of bounds") @@ -154,7 +154,7 @@ H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent, const uint8 break; case H5G_CACHED_STAB: - HDassert(2 * H5F_SIZEOF_ADDR(f) <= H5G_SIZEOF_SCRATCH); + assert(2 * H5F_SIZEOF_ADDR(f) <= H5G_SIZEOF_SCRATCH); if (H5_IS_BUFFER_OVERFLOW(*pp, H5F_SIZEOF_ADDR(f) * 2, p_end)) HGOTO_ERROR(H5E_FILE, H5E_OVERFLOW, FAIL, "image pointer is out of bounds") H5F_addr_decode(f, pp, &(ent->cache.stab.btree_addr)); @@ -204,9 +204,9 @@ H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent, unsign FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f); - HDassert(pp); - HDassert(ent); + assert(f); + assert(pp); + assert(ent); /* encode entries */ for (u = 0; u < n; u++) @@ -242,8 +242,8 @@ H5G_ent_encode(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) FUNC_ENTER_NOAPI(FAIL) /* check arguments */ - HDassert(f); - HDassert(pp); + assert(f); + assert(pp); /* Check for actual entry to encode */ if (ent) { @@ -259,7 +259,7 @@ H5G_ent_encode(const H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) break; case H5G_CACHED_STAB: - HDassert(2 * H5F_SIZEOF_ADDR(f) <= H5G_SIZEOF_SCRATCH); + assert(2 * H5F_SIZEOF_ADDR(f) <= H5G_SIZEOF_SCRATCH); H5F_addr_encode(f, pp, ent->cache.stab.btree_addr); H5F_addr_encode(f, pp, ent->cache.stab.heap_addr); break; @@ -319,9 +319,9 @@ H5G__ent_copy(H5G_entry_t *dst, H5G_entry_t *src, H5_copy_depth_t depth) FUNC_ENTER_PACKAGE_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); /* Copy the top level information */ H5MM_memcpy(dst, src, sizeof(H5G_entry_t)); @@ -356,7 +356,7 @@ H5G__ent_reset(H5G_entry_t *ent) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(ent); + assert(ent); /* Clear the symbol table entry to an empty state */ HDmemset(ent, 0, sizeof(H5G_entry_t)); @@ -388,10 +388,10 @@ H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f); - HDassert(heap); - HDassert(name); - HDassert(lnk); + assert(f); + assert(heap); + assert(name); + assert(lnk); /* Reset the new entry */ H5G__ent_reset(ent); @@ -427,7 +427,7 @@ H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk if ((stab_exists = H5O_msg_exists(&targ_oloc, H5O_STAB_ID)) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to check for STAB message") - HDassert(!stab_exists); + assert(!stab_exists); } /* end else */ #endif /* NDEBUG */ } /* end if */ diff --git a/src/H5Gint.c b/src/H5Gint.c index 416938a..74a0d49 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -191,7 +191,7 @@ H5G_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(0 == H5I_nmembers(H5I_GROUP)); + assert(0 == H5I_nmembers(H5I_GROUP)); /* Destroy the group object id group */ n += (H5I_dec_type_ref(H5I_GROUP) > 0); @@ -216,7 +216,7 @@ H5G__close_cb(H5VL_object_t *grp_vol_obj, void **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(grp_vol_obj); + assert(grp_vol_obj); /* Close the group */ if (H5VL_group_close(grp_vol_obj, H5P_DATASET_XFER_DEFAULT, request) < 0) @@ -254,10 +254,10 @@ H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, hid_t g FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); - HDassert(name && *name); - HDassert(lcpl_id != H5P_DEFAULT); - HDassert(gcpl_id != H5P_DEFAULT); + assert(loc); + assert(name && *name); + assert(lcpl_id != H5P_DEFAULT); + assert(gcpl_id != H5P_DEFAULT); /* Set up group creation info */ gcrt_info.gcpl_id = gcpl_id; @@ -272,7 +272,7 @@ H5G__create_named(const H5G_loc_t *loc, const char *name, hid_t lcpl_id, hid_t g /* Create the new group and link it to its parent group */ if (H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "unable to create and link to group") - HDassert(ocrt_info.new_obj); + assert(ocrt_info.new_obj); /* Set the return value */ ret_value = (H5G_t *)ocrt_info.new_obj; @@ -308,8 +308,8 @@ H5G__create(H5F_t *file, H5G_obj_create_t *gcrt_info) FUNC_ENTER_PACKAGE /* check args */ - HDassert(file); - HDassert(gcrt_info->gcpl_id != H5P_DEFAULT); + assert(file); + assert(gcrt_info->gcpl_id != H5P_DEFAULT); /* create an open group */ if (NULL == (grp = H5FL_CALLOC(H5G_t))) @@ -383,8 +383,8 @@ H5G__open_name(const H5G_loc_t *loc, const char *name) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(loc); - HDassert(name); + assert(loc); + assert(name); /* Set up opened group location to fill in */ grp_loc.oloc = &grp_oloc; @@ -442,7 +442,7 @@ H5G_open(const H5G_loc_t *loc) FUNC_ENTER_NOAPI(NULL) /* Check args */ - HDassert(loc); + assert(loc); /* Allocate the group structure */ if (NULL == (grp = H5FL_CALLOC(H5G_t))) @@ -533,7 +533,7 @@ H5G__open_oid(H5G_t *grp) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(grp); + assert(grp); /* Allocate the shared information for the group */ if (NULL == (grp->shared = H5FL_CALLOC(H5G_shared_t))) @@ -581,13 +581,13 @@ H5G_close(H5G_t *grp) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(grp && grp->shared); - HDassert(grp->shared->fo_count > 0); + assert(grp && grp->shared); + assert(grp->shared->fo_count > 0); --grp->shared->fo_count; if (0 == grp->shared->fo_count) { - HDassert(grp != H5G_rootof(H5G_fileof(grp))); + assert(grp != H5G_rootof(H5G_fileof(grp))); /* Uncork cache entries with object address tag */ if (H5AC_cork(grp->oloc.file, grp->oloc.addr, H5AC__GET_CORKED, &corked) < 0) @@ -716,7 +716,7 @@ H5G_fileof(H5G_t *grp) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(grp); + assert(grp); FUNC_LEAVE_NOAPI(grp->oloc.file) } /* end H5G_fileof() */ @@ -739,7 +739,7 @@ H5G_get_shared_count(H5G_t *grp) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(grp && grp->shared); + assert(grp && grp->shared); FUNC_LEAVE_NOAPI(grp->shared->fo_count) } /* end H5G_get_shared_count() */ @@ -762,8 +762,8 @@ H5G_mount(H5G_t *grp) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(grp && grp->shared); - HDassert(grp->shared->mounted == FALSE); + assert(grp && grp->shared); + assert(grp->shared->mounted == FALSE); /* Set the 'mounted' flag */ grp->shared->mounted = TRUE; @@ -789,7 +789,7 @@ H5G_mounted(H5G_t *grp) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(grp && grp->shared); + assert(grp && grp->shared); FUNC_LEAVE_NOAPI(grp->shared->mounted) } /* end H5G_mounted() */ @@ -812,8 +812,8 @@ H5G_unmount(H5G_t *grp) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(grp && grp->shared); - HDassert(grp->shared->mounted == TRUE); + assert(grp && grp->shared); + assert(grp->shared->mounted == TRUE); /* Reset the 'mounted' flag */ grp->shared->mounted = FALSE; @@ -843,8 +843,8 @@ H5G__iterate_cb(const H5O_link_t *lnk, void *_udata) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(lnk); - HDassert(udata); + assert(lnk); + assert(udata); switch (udata->lnk_op.op_type) { #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -866,7 +866,7 @@ H5G__iterate_cb(const H5O_link_t *lnk, void *_udata) } break; default: - HDassert(0 && "Unknown link op type?!?"); + assert(0 && "Unknown link op type?!?"); } /* end switch */ done: @@ -897,10 +897,10 @@ H5G_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(loc); - HDassert(group_name); - HDassert(last_lnk); - HDassert(lnk_op && lnk_op->op_func.op_new); + assert(loc); + assert(group_name); + assert(last_lnk); + assert(lnk_op && lnk_op->op_func.op_new); /* Open the group on which to operate. We also create a group ID which * we can pass to the application-defined operator. @@ -985,8 +985,8 @@ H5G__visit_cb(const H5O_link_t *lnk, void *_udata) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(lnk); - HDassert(udata); + assert(lnk); + assert(udata); /* Check if we will need more space to store this link's relative path */ /* ("+2" is for string terminator and possible '/' for group separator later) */ @@ -1003,7 +1003,7 @@ H5G__visit_cb(const H5O_link_t *lnk, void *_udata) } /* end if */ /* Build the link's relative path name */ - HDassert(udata->path[old_path_len] == '\0'); + assert(udata->path[old_path_len] == '\0'); HDstrncpy(&(udata->path[old_path_len]), lnk->name, link_name_len + 1); udata->curr_path_len += link_name_len; @@ -1068,7 +1068,7 @@ H5G__visit_cb(const H5O_link_t *lnk, void *_udata) htri_t linfo_exists; /* Whether the link info message exists */ /* Add the path separator to the current path */ - HDassert(udata->path[udata->curr_path_len] == '\0'); + assert(udata->path[udata->curr_path_len] == '\0'); HDstrncpy(&(udata->path[udata->curr_path_len]), "/", (size_t)2); udata->curr_path_len++; @@ -1084,7 +1084,7 @@ H5G__visit_cb(const H5O_link_t *lnk, void *_udata) idx_type = H5_INDEX_NAME; } /* end if */ else - HDassert(idx_type == H5_INDEX_NAME); + assert(idx_type == H5_INDEX_NAME); } /* end if */ else { /* Can only perform name lookups on groups with symbol tables */ @@ -1229,7 +1229,7 @@ H5G_visit(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_o idx_type = H5_INDEX_NAME; } /* end if */ else - HDassert(idx_type == H5_INDEX_NAME); + assert(idx_type == H5_INDEX_NAME); } /* end if */ else { /* Can only perform name lookups on groups with symbol tables */ @@ -1378,8 +1378,8 @@ H5G__get_info_by_name(const H5G_loc_t *loc, const char *name, H5G_info_t *grp_in FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); - HDassert(grp_info); + assert(loc); + assert(grp_info); /* Set up opened group location to fill in */ grp_loc.oloc = &grp_oloc; @@ -1428,8 +1428,8 @@ H5G__get_info_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t id FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); - HDassert(grp_info); + assert(loc); + assert(grp_info); /* Set up opened group location to fill in */ grp_loc.oloc = &grp_oloc; diff --git a/src/H5Glink.c b/src/H5Glink.c index 37aad84..7d14a9e 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -211,10 +211,10 @@ H5G__ent_to_link(H5O_link_t *lnk, const H5HL_t *heap, const H5G_entry_t *ent, co FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(lnk); - HDassert(heap); - HDassert(ent); - HDassert(name); + assert(lnk); + assert(heap); + assert(ent); + assert(name); /* Set (default) common info for link */ lnk->cset = H5F_DEFAULT_CSET; @@ -277,8 +277,8 @@ H5G_link_to_info(const H5O_loc_t *link_loc, const H5O_link_t *lnk, H5L_info2_t * FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(link_loc); - HDassert(lnk); + assert(link_loc); + assert(lnk); /* Get information from the link */ if (info) { @@ -358,9 +358,9 @@ H5G__link_to_loc(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t *obj FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(grp_loc); - HDassert(lnk); - HDassert(obj_loc); + assert(grp_loc); + assert(lnk); + assert(obj_loc); /* * Build location from the link @@ -404,14 +404,14 @@ H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, H5_iter_orde FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ltable); + assert(ltable); /* Can't sort when empty since the links table will be NULL */ if (0 == ltable->nlinks) HGOTO_DONE(ret_value); /* This should never be NULL if the number of links is non-zero */ - HDassert(ltable->lnks); + assert(ltable->lnks); /* Pick appropriate sorting routine */ if (idx_type == H5_INDEX_NAME) { @@ -420,16 +420,16 @@ H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type, H5_iter_orde else if (order == H5_ITER_DEC) qsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_name_dec); else - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); } /* end if */ else { - HDassert(idx_type == H5_INDEX_CRT_ORDER); + assert(idx_type == H5_INDEX_CRT_ORDER); if (order == H5_ITER_INC) qsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_inc); else if (order == H5_ITER_DEC) qsort(ltable->lnks, ltable->nlinks, sizeof(H5O_link_t), H5G__link_cmp_corder_dec); else - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); } /* end else */ done: @@ -460,8 +460,8 @@ H5G__link_iterate_table(const H5G_link_table_t *ltable, hsize_t skip, hsize_t *l FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ltable); - HDassert(op); + assert(ltable); + assert(op); /* Skip over links, if requested */ if (last_lnk) @@ -507,7 +507,7 @@ H5G__link_release_table(H5G_link_table_t *ltable) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ltable); + assert(ltable); /* Release link info, if any */ if (ltable->nlinks > 0) { @@ -520,7 +520,7 @@ H5G__link_release_table(H5G_link_table_t *ltable) H5MM_xfree(ltable->lnks); } /* end if */ else - HDassert(ltable->lnks == NULL); + assert(ltable->lnks == NULL); done: FUNC_LEAVE_NOAPI(ret_value) @@ -548,7 +548,7 @@ H5G__link_name_replace(H5F_t *file, H5RS_str_t *grp_full_path_r, const H5O_link_ FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(file); + assert(file); /* Search the open IDs and replace names for unlinked object */ if (grp_full_path_r) { diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 2b746b3..4edcb1c 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -291,8 +291,8 @@ H5G_loc_copy(H5G_loc_t *dst, const H5G_loc_t *src, H5_copy_depth_t depth) FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(dst); - HDassert(src); + assert(dst); + assert(src); /* Copy components of the location */ if (H5O_loc_copy(dst->oloc, src->oloc, depth) < 0) @@ -324,7 +324,7 @@ H5G_loc_reset(H5G_loc_t *loc) FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(loc); + assert(loc); /* Reset components of the location */ if (H5O_loc_reset(loc->oloc) < 0) @@ -356,7 +356,7 @@ H5G_loc_free(H5G_loc_t *loc) FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(loc); + assert(loc); /* Reset components of the location */ if (H5G_name_free(loc->path) < 0) @@ -426,9 +426,9 @@ H5G_loc_find(const H5G_loc_t *loc, const char *name, H5G_loc_t *obj_loc /*out*/) FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(loc); - HDassert(name && *name); - HDassert(obj_loc); + assert(loc); + assert(name && *name); + assert(obj_loc); /* Set up user data for locating object */ udata.loc = obj_loc; @@ -527,9 +527,9 @@ H5G_loc_find_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(loc); - HDassert(group_name && *group_name); - HDassert(obj_loc); + assert(loc); + assert(group_name && *group_name); + assert(obj_loc); /* Set up user data for locating object */ udata.idx_type = idx_type; @@ -566,9 +566,9 @@ H5G__loc_insert(H5G_loc_t *grp_loc, char *name, H5G_loc_t *obj_loc, H5O_type_t o FUNC_ENTER_PACKAGE /* Check args. */ - HDassert(grp_loc); - HDassert(name && *name); - HDassert(obj_loc); + assert(grp_loc); + assert(name && *name); + assert(obj_loc); /* Create link object for the object location */ lnk.type = H5L_TYPE_HARD; @@ -650,9 +650,9 @@ H5G_loc_exists(const H5G_loc_t *loc, const char *name, hbool_t *exists) FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(loc); - HDassert(name && *name); - HDassert(exists); + assert(loc); + assert(name && *name); + assert(exists); /* Traverse group hierarchy to locate object */ if (H5G_traverse(loc, name, H5G_TARGET_EXISTS, H5G__loc_exists_cb, exists) < 0) @@ -720,9 +720,9 @@ H5G__loc_addr(const H5G_loc_t *loc, const char *name, haddr_t *addr /*out*/) FUNC_ENTER_PACKAGE /* Check args. */ - HDassert(loc); - HDassert(name && *name); - HDassert(addr); + assert(loc); + assert(name && *name); + assert(addr); /* Traverse group hierarchy to locate object */ if (H5G_traverse(loc, name, H5G_TARGET_NORMAL, H5G__loc_addr_cb, addr) < 0) @@ -792,9 +792,9 @@ H5G_loc_info(const H5G_loc_t *loc, const char *name, H5O_info2_t *oinfo /*out*/, FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(loc); - HDassert(name && *name); - HDassert(oinfo); + assert(loc); + assert(name && *name); + assert(oinfo); /* Set up user data for locating object */ udata.fields = fields; @@ -868,9 +868,9 @@ H5G_loc_native_info(const H5G_loc_t *loc, const char *name, H5O_native_info_t *o FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(loc); - HDassert(name && *name); - HDassert(oinfo); + assert(loc); + assert(name && *name); + assert(oinfo); /* Set up user data for locating object */ udata.fields = fields; @@ -962,8 +962,8 @@ H5G_loc_set_comment(const H5G_loc_t *loc, const char *name, const char *comment) FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(loc); - HDassert(name && *name); + assert(loc); + assert(name && *name); /* Set up user data for locating object */ udata.comment = comment; @@ -1049,8 +1049,8 @@ H5G_loc_get_comment(const H5G_loc_t *loc, const char *name, char *comment /*out* FUNC_ENTER_NOAPI(FAIL) /* Check args. */ - HDassert(loc); - HDassert(name && *name); + assert(loc); + assert(name && *name); /* Set up user data for locating object */ udata.comment = comment; diff --git a/src/H5Gname.c b/src/H5Gname.c index 5b72e89..9e5393f 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -116,7 +116,7 @@ H5G__component(const char *name, size_t *size_p) { FUNC_ENTER_PACKAGE_NOERR - HDassert(name); + assert(name); while ('/' == *name) name++; @@ -151,7 +151,7 @@ H5G_normalize(const char *name) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(name); + assert(name); /* Duplicate the name, to return */ if (NULL == (norm = H5MM_strdup(name))) @@ -215,13 +215,13 @@ H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) /* Get component of each name */ fullpath = H5RS_get_str(fullpath_r); - HDassert(fullpath); + assert(fullpath); fullpath = H5G__component(fullpath, &nchars1); - HDassert(fullpath); + assert(fullpath); prefix = H5RS_get_str(prefix_r); - HDassert(prefix); + assert(prefix); prefix = H5G__component(prefix, &nchars2); - HDassert(prefix); + assert(prefix); /* Check if we have a real string for each component */ while (*fullpath && *prefix) { @@ -235,9 +235,9 @@ H5G__common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) /* Get next component of each name */ fullpath = H5G__component(fullpath, &nchars1); - HDassert(fullpath); + assert(fullpath); prefix = H5G__component(prefix, &nchars2); - HDassert(prefix); + assert(prefix); } /* end if */ else HGOTO_DONE(FALSE) @@ -275,8 +275,8 @@ H5G__build_fullpath(const char *prefix, const char *name) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(prefix); - HDassert(name); + assert(prefix); + assert(name); /* Create full path */ if (NULL == (ret_value = H5RS_create(prefix))) @@ -310,12 +310,12 @@ H5G_build_fullpath_refstr_str(H5RS_str_t *prefix_r, const char *name) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(prefix_r); - HDassert(name); + assert(prefix_r); + assert(name); /* Get the raw string for the user path */ prefix = H5RS_get_str(prefix_r); - HDassert(prefix); + assert(prefix); /* Create reference counted string for path */ ret_value = H5G__build_fullpath(prefix, name); @@ -342,13 +342,13 @@ H5G__name_init(H5G_name_t *name, const char *path) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(name); + assert(name); /* Set the initial paths for a name object */ name->full_path_r = H5RS_create(path); - HDassert(name->full_path_r); + assert(name->full_path_r); name->user_path_r = H5RS_create(path); - HDassert(name->user_path_r); + assert(name->user_path_r); name->obj_hidden = 0; FUNC_LEAVE_NOAPI(SUCCEED) @@ -374,9 +374,9 @@ H5G_name_set(const H5G_name_t *loc, H5G_name_t *obj, const char *name) FUNC_ENTER_NOAPI(FAIL) - HDassert(loc); - HDassert(obj); - HDassert(name); + assert(loc); + assert(obj); + assert(name); /* Free & reset the object's previous paths info (if they exist) */ H5G_name_free(obj); @@ -428,13 +428,13 @@ H5G_name_copy(H5G_name_t *dst, const H5G_name_t *src, H5_copy_depth_t depth) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ - HDassert(src); - HDassert(dst); + assert(src); + assert(dst); #if defined(H5_USING_MEMCHECKER) || !defined(NDEBUG) - HDassert(dst->full_path_r == NULL); - HDassert(dst->user_path_r == NULL); + assert(dst->full_path_r == NULL); + assert(dst->user_path_r == NULL); #endif /* H5_USING_MEMCHECKER */ - HDassert(depth == H5_COPY_SHALLOW || depth == H5_COPY_DEEP); + assert(depth == H5_COPY_SHALLOW || depth == H5_COPY_DEEP); /* Copy the top level information */ H5MM_memcpy(dst, src, sizeof(H5G_name_t)); @@ -476,7 +476,7 @@ H5G_get_name(const H5G_loc_t *loc, char *name /*out*/, size_t size, size_t *name FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(loc); + assert(loc); /* If the user path is available and it's not "hidden", use it */ if (loc->path->user_path_r != NULL && loc->path->obj_hidden == 0) { @@ -533,7 +533,7 @@ H5G_name_reset(H5G_name_t *name) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments */ - HDassert(name); + assert(name); /* Clear the group hier. name to an empty state */ HDmemset(name, 0, sizeof(H5G_name_t)); @@ -560,7 +560,7 @@ H5G_name_free(H5G_name_t *name) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(name); + assert(name); if (name->full_path_r) { H5RS_decr(name->full_path_r); @@ -600,14 +600,14 @@ H5G__name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(path_r_ptr && *path_r_ptr); - HDassert(full_suffix); - HDassert(src_path); - HDassert(dst_path); + assert(path_r_ptr && *path_r_ptr); + assert(full_suffix); + assert(src_path); + assert(dst_path); /* Get pointer to path to update */ path = H5RS_get_str(*path_r_ptr); - HDassert(path); + assert(path); /* Check if path needs to be updated */ full_suffix_len = HDstrlen(full_suffix); @@ -692,7 +692,7 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) FUNC_ENTER_PACKAGE - HDassert(obj_ptr); + assert(obj_ptr); /* Get the symbol table entry */ switch (H5I_get_type(obj_id)) { @@ -736,8 +736,8 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object") } /* end switch */ - HDassert(oloc); - HDassert(obj_path); + assert(oloc); + assert(obj_path); /* Check if the object has a full path still */ if (!obj_path->full_path_r) @@ -880,7 +880,7 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) H5RS_str_t *rs; /* Ref-counted string for new path */ /* Sanity check */ - HDassert(names->dst_full_path_r); + assert(names->dst_full_path_r); /* Get pointers to paths of interest */ full_path = H5RS_get_str(obj_path->full_path_r); @@ -888,8 +888,8 @@ H5G__name_replace_cb(void *obj_ptr, hid_t obj_id, void *key) dst_path = H5RS_get_str(names->dst_full_path_r); /* Make certain that the source and destination names are full (not relative) paths */ - HDassert(*src_path == '/'); - HDassert(*dst_path == '/'); + assert(*src_path == '/'); + assert(*dst_path == '/'); /* Get pointer to "full suffix" */ full_suffix = full_path + HDstrlen(src_path); @@ -947,7 +947,7 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, H5RS FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(src_file); + assert(src_file); /* Check if the object we are manipulating has a path */ if (src_full_path_r) { @@ -1089,10 +1089,10 @@ H5G__get_name_by_addr_cb(hid_t gid, const char *path, const H5L_info2_t *linfo, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(path); - HDassert(linfo); - HDassert(udata->loc); - HDassert(udata->path == NULL); + assert(path); + assert(linfo); + assert(udata->loc); + assert(udata->path == NULL); /* Check for hard link with correct address */ if (linfo->type == H5L_TYPE_HARD) { diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 101604f..c68a919 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -140,7 +140,7 @@ H5G__node_get_shared(const H5F_t *f, const void H5_ATTR_UNUSED *_udata) { FUNC_ENTER_PACKAGE_NOERR - HDassert(f); + assert(f); /* Return the pointer to the ref-count object */ FUNC_LEAVE_NOAPI(H5F_GRP_BTREE_SHARED(f)) @@ -165,9 +165,9 @@ H5G__node_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) FUNC_ENTER_PACKAGE_NOERR - HDassert(shared); - HDassert(raw); - HDassert(key); + assert(shared); + assert(raw); + assert(key); H5_DECODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); @@ -193,9 +193,9 @@ H5G__node_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) FUNC_ENTER_PACKAGE_NOERR - HDassert(shared); - HDassert(raw); - HDassert(key); + assert(shared); + assert(raw); + assert(key); H5_ENCODE_LENGTH_LEN(raw, key->offset, shared->sizeof_len); @@ -222,7 +222,7 @@ H5G__node_debug_key(FILE *stream, int indent, int fwidth, const void *_key, cons FUNC_ENTER_PACKAGE_NOERR - HDassert(key); + assert(key); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Heap offset:", (unsigned)key->offset); @@ -260,10 +260,10 @@ H5G__node_free(H5G_node_t *sym) /* * Check arguments. */ - HDassert(sym); + assert(sym); /* Verify that node is clean */ - HDassert(sym->cache_info.is_dirty == FALSE); + assert(sym->cache_info.is_dirty == FALSE); if (sym->entry) sym->entry = H5FL_SEQ_FREE(H5G_entry_t, sym->entry); @@ -304,8 +304,8 @@ H5G__node_create(H5F_t *f, H5B_ins_t H5_ATTR_UNUSED op, void *_lt_key, void H5_A /* * Check arguments. */ - HDassert(f); - HDassert(H5B_INS_FIRST == op); + assert(f); + assert(H5B_INS_FIRST == op); if (NULL == (sym = H5FL_CALLOC(H5G_node_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") @@ -372,9 +372,9 @@ H5G__node_cmp2(void *_lt_key, void *_udata, void *_rt_key) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(udata && udata->heap); - HDassert(lt_key); - HDassert(rt_key); + assert(udata && udata->heap); + assert(lt_key); + assert(rt_key); /* Get pointers to string names */ if ((s1 = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) @@ -425,9 +425,9 @@ H5G__node_cmp3(void *_lt_key, void *_udata, void *_rt_key) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(udata && udata->heap); - HDassert(lt_key); - HDassert(rt_key); + assert(udata && udata->heap); + assert(lt_key); + assert(rt_key); /* left side */ if ((s = (const char *)H5HL_offset_into(udata->heap, lt_key->offset)) == NULL) @@ -485,10 +485,10 @@ H5G__node_found(H5F_t *f, haddr_t addr, const void H5_ATTR_UNUSED *_lt_key, hboo /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(found); - HDassert(udata && udata->common.heap); + assert(f); + assert(H5_addr_defined(addr)); + assert(found); + assert(udata && udata->common.heap); /* * Load the symbol table node for exclusive access. @@ -583,12 +583,12 @@ H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, hbool_t H /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(md_key); - HDassert(rt_key); - HDassert(udata && udata->common.heap); - HDassert(new_node_p); + assert(f); + assert(H5_addr_defined(addr)); + assert(md_key); + assert(rt_key); + assert(udata && udata->common.heap); + assert(new_node_p); /* * Load the symbol node. @@ -676,7 +676,7 @@ H5G__node_insert(H5F_t *f, haddr_t addr, void H5_ATTR_UNUSED *_lt_key, hbool_t H } /* end else */ /* Move entries down to make room for new entry */ - HDassert(idx >= 0); + assert(idx >= 0); HDmemmove(insert_into->entry + idx + 1, insert_into->entry + idx, (insert_into->nsyms - (unsigned)idx) * sizeof(H5G_entry_t)); @@ -739,11 +739,11 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert((H5G_node_key_t *)_lt_key); - HDassert(rt_key); - HDassert(udata && udata->common.heap); + assert(f); + assert(H5_addr_defined(addr)); + assert((H5G_node_key_t *)_lt_key); + assert(rt_key); + assert(udata && udata->common.heap); /* Load the symbol table */ if (NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__NO_FLAGS_SET))) @@ -789,7 +789,7 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i } /* end if */ else { lnk.type = H5L_TYPE_HARD; - HDassert(H5_addr_defined(sn->entry[idx].header)); + assert(H5_addr_defined(sn->entry[idx].header)); lnk.u.hard.addr = sn->entry[idx].header; } /* end else */ @@ -832,7 +832,7 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i * node and indicate that the pointer to this node in the B-tree * should be removed also. */ - HDassert(0 == idx); + assert(0 == idx); sn->nsyms = 0; sn_flags |= H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG | H5AC__FREE_FILE_SPACE_FLAG; ret_value = H5B_INS_REMOVE; @@ -882,7 +882,7 @@ H5G__node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key /*i for (idx = 0; idx < sn->nsyms; idx++) { if (!(H5G_CACHED_SLINK == sn->entry[idx].type)) { /* Decrement the reference count */ - HDassert(H5_addr_defined(sn->entry[idx].header)); + assert(H5_addr_defined(sn->entry[idx].header)); tmp_oloc.addr = sn->entry[idx].header; if (H5O_link(&tmp_oloc, -1) < 0) @@ -935,9 +935,9 @@ H5G__node_iterate(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(udata && udata->heap); + assert(f); + assert(H5_addr_defined(addr)); + assert(udata && udata->heap); /* Protect the symbol table node & local heap while we iterate over entries */ if (NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) @@ -1012,9 +1012,9 @@ H5G__node_sumup(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(num_objs); + assert(f); + assert(H5_addr_defined(addr)); + assert(num_objs); /* Find the object node and add the number of symbol entries. */ if (NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) @@ -1056,9 +1056,9 @@ H5G__node_by_idx(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(udata); + assert(f); + assert(H5_addr_defined(addr)); + assert(udata); /* Get a pointer to the symbol table node */ if (NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) @@ -1072,7 +1072,7 @@ H5G__node_by_idx(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, ent_idx = udata->idx - udata->num_objs; /* Call 'by index' callback */ - HDassert(udata->op); + assert(udata->op); if ((udata->op)(&sn->entry[ent_idx], udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "'by index' callback failed") @@ -1113,7 +1113,7 @@ H5G__node_init(H5F_t *f) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(f); + assert(f); /* Set the raw key size */ sizeof_rkey = H5F_SIZEOF_SIZE(f); /*name offset */ @@ -1154,7 +1154,7 @@ H5G_node_close(const H5F_t *f) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(f); + assert(f); /* Free the raw B-tree node buffer */ if (H5F_GRP_BTREE_SHARED(f)) @@ -1191,9 +1191,9 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(udata); + assert(f); + assert(H5_addr_defined(addr)); + assert(udata); /* load the symbol table into memory from the source file */ if (NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) @@ -1287,7 +1287,7 @@ H5G__node_copy(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr, const HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "unable to get link name") } /* else if */ else - HDassert(0 && "Unknown entry type"); + assert(0 && "Unknown entry type"); /* Set up common link data */ lnk.cset = H5F_DEFAULT_CSET; /* XXX: Allow user to set this */ @@ -1349,9 +1349,9 @@ H5G__node_build_table(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t addr /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(udata && udata->heap); + assert(f); + assert(H5_addr_defined(addr)); + assert(udata && udata->heap); /* * Save information about the symbol table node since we can't lock it @@ -1420,8 +1420,8 @@ H5G__node_iterate_size(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, haddr_t H5_ FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(stab_size); + assert(f); + assert(stab_size); *stab_size += H5G_NODE_SIZE(f); @@ -1454,11 +1454,11 @@ H5G_node_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, had /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Pin the heap down in memory */ if (heap_addr > 0 && H5_addr_defined(heap_addr)) diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 262b92e..3a92f56 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -120,8 +120,8 @@ H5G__obj_create(H5F_t *f, H5G_obj_create_t *gcrt_info, H5O_loc_t *oloc /*out*/) /* * Check arguments. */ - HDassert(f); - HDassert(oloc); + assert(f); + assert(oloc); /* Get the property list */ if (NULL == (gc_plist = (H5P_genplist_t *)H5I_object(gcrt_info->gcpl_id))) @@ -173,11 +173,11 @@ H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linf /* * Check arguments. */ - HDassert(f); - HDassert(ginfo); - HDassert(linfo); - HDassert(pline); - HDassert(oloc); + assert(f); + assert(ginfo); + assert(linfo); + assert(pline); + assert(oloc); /* Check for invalid access request */ if (0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) @@ -207,14 +207,14 @@ H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linf /* Calculate message size information, for creating group's object header */ linfo_size = H5O_msg_size_f(f, gcpl_id, H5O_LINFO_ID, linfo, (size_t)0); - HDassert(linfo_size); + assert(linfo_size); ginfo_size = H5O_msg_size_f(f, gcpl_id, H5O_GINFO_ID, ginfo, (size_t)0); - HDassert(ginfo_size); + assert(ginfo_size); if (pline && pline->nused) { pline_size = H5O_msg_size_f(f, gcpl_id, H5O_PLINE_ID, pline, (size_t)0); - HDassert(pline_size); + assert(pline_size); } /* end if */ lnk.type = H5L_TYPE_HARD; @@ -223,7 +223,7 @@ H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linf lnk.cset = H5T_CSET_ASCII; lnk.name = &null_char; link_size = H5O_msg_size_f(f, gcpl_id, H5O_LINK_ID, &lnk, (size_t)ginfo->est_name_len); - HDassert(link_size); + assert(link_size); /* Compute size of header to use for creation */ hdr_size = linfo_size + ginfo_size + pline_size + (ginfo->est_num_entries * link_size); @@ -296,8 +296,8 @@ H5G__obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo) FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ - HDassert(grp_oloc); - HDassert(linfo); + assert(grp_oloc); + assert(linfo); /* Check for the group having a link info message */ if ((ret_value = H5O_msg_exists(grp_oloc, H5O_LINFO_ID)) < 0) @@ -359,8 +359,8 @@ H5G__obj_compact_to_dense_cb(const void *_mesg, unsigned H5_ATTR_UNUSED idx, voi FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(lnk); - HDassert(udata); + assert(lnk); + assert(udata); /* Insert link into dense link storage */ if (H5G__dense_insert(udata->f, udata->linfo, lnk) < 0) @@ -392,8 +392,8 @@ H5G__obj_stab_to_new_cb(const H5O_link_t *lnk, void *_udata) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(lnk); - HDassert(udata); + assert(lnk); + assert(udata); /* Insert link into group */ H5_GCC_CLANG_DIAG_OFF("cast-qual") @@ -436,9 +436,9 @@ H5G_obj_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_lnk, FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* check arguments */ - HDassert(grp_oloc && grp_oloc->file); - HDassert(name && *name); - HDassert(obj_lnk); + assert(grp_oloc && grp_oloc->file); + assert(name && *name); + assert(obj_lnk); /* Check if we have information about the number of objects in this group */ /* (by attempting to get the link info message for this group) */ @@ -631,8 +631,8 @@ H5G__obj_iterate(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_order_t FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* Sanity check */ - HDassert(grp_oloc); - HDassert(op); + assert(grp_oloc); + assert(op); /* Attempt to get the link info for this group */ if ((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) @@ -702,8 +702,8 @@ H5G__obj_info(const H5O_loc_t *oloc, H5G_info_t *grp_info) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(oloc); - HDassert(grp_info); + assert(oloc); + assert(grp_info); /* Set up group location to fill in */ grp_loc.oloc = &grp_oloc; @@ -777,7 +777,7 @@ H5G_obj_get_name_by_idx(const H5O_loc_t *oloc, H5_index_t idx_type, H5_iter_orde FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL) /* Sanity check */ - HDassert(oloc && oloc->file); + assert(oloc && oloc->file); /* Attempt to get the link info for this group */ if ((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) @@ -837,8 +837,8 @@ H5G__obj_remove_update_linfo(const H5O_loc_t *oloc, H5O_linfo_t *linfo) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(oloc); - HDassert(linfo); + assert(oloc); + assert(linfo); /* Decrement # of links in group */ linfo->nlinks--; @@ -951,8 +951,8 @@ H5G_obj_remove(const H5O_loc_t *oloc, H5RS_str_t *grp_full_path_r, const char *n FUNC_ENTER_NOAPI_TAG(oloc->addr, FAIL) /* Sanity check */ - HDassert(oloc); - HDassert(name && *name); + assert(oloc); + assert(name && *name); /* Attempt to get the link info for this group */ if ((linfo_exists = H5G__obj_get_linfo(oloc, &linfo)) < 0) @@ -1015,7 +1015,7 @@ H5G_obj_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, H5 FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(grp_oloc && grp_oloc->file); + assert(grp_oloc && grp_oloc->file); /* Attempt to get the link info for this group */ if ((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) @@ -1087,8 +1087,8 @@ H5G__obj_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found, H5O FUNC_ENTER_PACKAGE_TAG(grp_oloc->addr) /* check arguments */ - HDassert(grp_oloc && grp_oloc->file); - HDassert(name && *name); + assert(grp_oloc && grp_oloc->file); + assert(name && *name); /* Attempt to get the link info message for this group */ if ((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) @@ -1139,7 +1139,7 @@ H5G_obj_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_index_t idx_type, H5_iter_or FUNC_ENTER_NOAPI_TAG(grp_oloc->addr, FAIL) /* check arguments */ - HDassert(grp_oloc && grp_oloc->file); + assert(grp_oloc && grp_oloc->file); /* Attempt to get the link info message for this group */ if ((linfo_exists = H5G__obj_get_linfo(grp_oloc, &linfo)) < 0) diff --git a/src/H5Goh.c b/src/H5Goh.c index a8a018f..1d2ab9d 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -129,7 +129,7 @@ H5O__group_free_copy_file_udata(void *_udata) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(udata); + assert(udata); /* Free the ginfo struct (including nested data structs) */ H5O_msg_free(H5O_PLINE_ID, udata->common.src_pline); @@ -166,7 +166,7 @@ H5O__group_isa(const H5O_t *oh) FUNC_ENTER_PACKAGE - HDassert(oh); + assert(oh); /* Check for any of the messages that indicate a group */ if ((stab_exists = H5O_msg_exists_oh(oh, H5O_STAB_ID)) < 0) @@ -201,7 +201,7 @@ H5O__group_open(const H5G_loc_t *obj_loc, H5I_type_t *opened_type) FUNC_ENTER_PACKAGE - HDassert(obj_loc); + assert(obj_loc); *opened_type = H5I_GROUP; @@ -242,9 +242,9 @@ H5O__group_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(crt_info); - HDassert(obj_loc); + assert(f); + assert(crt_info); + assert(obj_loc); /* Create the group */ if (NULL == (grp = H5G__create(f, crt_info))) @@ -325,11 +325,11 @@ H5O__group_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5_ih_info_t *bh_info) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(oh); - HDassert(bh_info); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(oh); + assert(bh_info); /* Check for "new style" group info */ if ((exists = H5O_msg_exists_oh(oh, H5O_LINFO_ID)) < 0) diff --git a/src/H5Groot.c b/src/H5Groot.c index 3629f72..b33c1e1 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -91,17 +91,17 @@ H5G_rootof(H5F_t *f) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Walk to top of mounted files */ while (f->parent) f = f->parent; /* Sanity check */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->root_grp); + assert(f); + assert(f->shared); + assert(f->shared->root_grp); /* Check to see if the root group was opened through a different * "top" file, and switch it to point at the current "top" file. @@ -142,9 +142,9 @@ H5G_mkroot(H5F_t *f, hbool_t create_root) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->sblock); /* Check if the root group is already initialized */ if (f->shared->root_grp) @@ -193,7 +193,7 @@ H5G_mkroot(H5F_t *f, hbool_t create_root) sblock_dirty = TRUE; /* Create the root group symbol table entry */ - HDassert(!f->shared->sblock->root_ent); + assert(!f->shared->sblock->root_ent); if (f->shared->sblock->super_vers < HDF5_SUPERBLOCK_VERSION_2) { /* Allocate space for the root group symbol table entry */ if (NULL == (f->shared->sblock->root_ent = (H5G_entry_t *)H5MM_calloc(sizeof(H5G_entry_t)))) @@ -287,7 +287,7 @@ H5G_mkroot(H5F_t *f, hbool_t create_root) * exists. Don't count either the superblock extension or the root group * in the number of open objects in the file. */ - HDassert((1 == f->nopen_objs) || (2 == f->nopen_objs && HADDR_UNDEF != f->shared->sblock->ext_addr)); + assert((1 == f->nopen_objs) || (2 == f->nopen_objs && HADDR_UNDEF != f->shared->sblock->ext_addr)); f->nopen_objs--; done: @@ -334,8 +334,8 @@ H5G_root_free(H5G_t *grp) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(grp && grp->shared); - HDassert(grp->shared->fo_count > 0); + assert(grp && grp->shared); + assert(grp->shared->fo_count > 0); /* Free the path */ H5G_name_free(&(grp->path)); @@ -367,12 +367,12 @@ H5G_root_loc(H5F_t *f, H5G_loc_t *loc) FUNC_ENTER_NOAPI(FAIL) - HDassert(f); - HDassert(loc); + assert(f); + assert(loc); /* Retrieve the root group for the file */ root_grp = H5G_rootof(f); - HDassert(root_grp); + assert(root_grp); /* Build the group location for the root group */ if (NULL == (loc->oloc = H5G_oloc(root_grp))) diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 23fb9ae..9627340 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -132,9 +132,9 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint) /* * Check arguments. */ - HDassert(f); - HDassert(stab); - HDassert(size_hint > 0); + assert(f); + assert(stab); + assert(size_hint > 0); /* Create the B-tree */ if (H5B_create(f, H5B_SNODE, NULL, &(stab->btree_addr) /*out*/) < 0) @@ -155,7 +155,7 @@ H5G__stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint) /* B-trees won't work if the first name isn't at the beginning * of the heap. */ - HDassert(0 == name_offset); + assert(0 == name_offset); done: /* Release resources */ @@ -196,8 +196,8 @@ H5G__stab_create(H5O_loc_t *grp_oloc, const H5O_ginfo_t *ginfo, H5O_stab_t *stab /* * Check arguments. */ - HDassert(grp_oloc); - HDassert(stab); + assert(grp_oloc); + assert(stab); /* Adjust the size hint, if necessary */ if (ginfo->lheap_size_hint == 0) @@ -251,10 +251,10 @@ H5G__stab_insert_real(H5F_t *f, const H5O_stab_t *stab, const char *name, H5O_li FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(f); - HDassert(stab); - HDassert(name && *name); - HDassert(obj_lnk); + assert(f); + assert(stab); + assert(name && *name); + assert(obj_lnk); /* Pin the heap down in memory */ if (NULL == (heap = H5HL_protect(f, stab->heap_addr, H5AC__NO_FLAGS_SET))) @@ -303,9 +303,9 @@ H5G__stab_insert(const H5O_loc_t *grp_oloc, const char *name, H5O_link_t *obj_ln FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(grp_oloc && grp_oloc->file); - HDassert(name && *name); - HDassert(obj_lnk); + assert(grp_oloc && grp_oloc->file); + assert(name && *name); + assert(obj_lnk); /* Retrieve symbol table message */ if (NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) @@ -340,8 +340,8 @@ H5G__stab_remove(const H5O_loc_t *loc, H5RS_str_t *grp_full_path_r, const char * FUNC_ENTER_PACKAGE - HDassert(loc && loc->file); - HDassert(name && *name); + assert(loc && loc->file); + assert(name && *name); /* Read in symbol table message */ if (NULL == H5O_msg_read(loc, H5O_STAB_ID, &stab)) @@ -393,7 +393,7 @@ H5G__stab_remove_by_idx(const H5O_loc_t *grp_oloc, H5RS_str_t *grp_full_path_r, FUNC_ENTER_PACKAGE - HDassert(grp_oloc && grp_oloc->file); + assert(grp_oloc && grp_oloc->file); /* Look up name of link to remove, by index */ if (H5G__stab_lookup_by_idx(grp_oloc, order, n, &obj_lnk) < 0) @@ -450,10 +450,10 @@ H5G__stab_delete(H5F_t *f, const H5O_stab_t *stab) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(stab); - HDassert(H5_addr_defined(stab->btree_addr)); - HDassert(H5_addr_defined(stab->heap_addr)); + assert(f); + assert(stab); + assert(H5_addr_defined(stab->btree_addr)); + assert(H5_addr_defined(stab->heap_addr)); /* Pin the heap down in memory */ if (NULL == (heap = H5HL_protect(f, stab->heap_addr, H5AC__NO_FLAGS_SET))) @@ -508,8 +508,8 @@ H5G__stab_iterate(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t skip, hs FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(oloc); - HDassert(op); + assert(oloc); + assert(op); /* Get the B-tree info */ if (NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) @@ -596,8 +596,8 @@ H5G__stab_count(const H5O_loc_t *oloc, hsize_t *num_objs) FUNC_ENTER_PACKAGE_TAG(oloc->addr) /* Sanity check */ - HDassert(oloc); - HDassert(num_objs); + assert(oloc); + assert(num_objs); /* Reset the number of objects in the group */ *num_objs = 0; @@ -636,9 +636,9 @@ H5G__stab_bh_size(H5F_t *f, const H5O_stab_t *stab, H5_ih_info_t *bh_info) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(stab); - HDassert(bh_info); + assert(f); + assert(stab); + assert(bh_info); /* Set up user data for B-tree iteration */ snode_size = 0; @@ -683,8 +683,8 @@ H5G__stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ent); - HDassert(udata && udata->heap); + assert(ent); + assert(udata && udata->heap); /* Get name offset in heap */ name_off = ent->name_off; @@ -727,7 +727,7 @@ H5G__stab_get_name_by_idx(const H5O_loc_t *oloc, H5_iter_order_t order, hsize_t FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(oloc); + assert(oloc); /* Get the B-tree & local heap info */ if (NULL == H5O_msg_read(oloc, H5O_STAB_ID, &stab)) @@ -843,10 +843,10 @@ H5G__stab_lookup(const H5O_loc_t *grp_oloc, const char *name, hbool_t *found, H5 FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(grp_oloc && grp_oloc->file); - HDassert(name && *name); - HDassert(found); - HDassert(lnk); + assert(grp_oloc && grp_oloc->file); + assert(name && *name); + assert(found); + assert(lnk); /* Retrieve the symbol table message for the group */ if (NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) @@ -903,8 +903,8 @@ H5G__stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ent); - HDassert(udata && udata->heap); + assert(ent); + assert(udata && udata->heap); /* Get a pointer to the link name */ if ((name = (const char *)H5HL_offset_into(udata->heap, ent->name_off)) == NULL) @@ -942,8 +942,8 @@ H5G__stab_lookup_by_idx(const H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_ FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(grp_oloc && grp_oloc->file); - HDassert(lnk); + assert(grp_oloc && grp_oloc->file); + assert(lnk); /* Get the B-tree & local heap info */ if (NULL == H5O_msg_read(grp_oloc, H5O_STAB_ID, &stab)) diff --git a/src/H5Gtest.c b/src/H5Gtest.c index 2299fdc..f8c59dc 100644 --- a/src/H5Gtest.c +++ b/src/H5Gtest.c @@ -560,8 +560,8 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(user_path_len); - HDassert(obj_hidden); + assert(user_path_len); + assert(obj_hidden); /* Get pointer to object for ID */ if (NULL == (obj_ptr = H5VL_object(obj_id))) @@ -611,7 +611,7 @@ H5G__user_path_test(hid_t obj_id, char *user_path, size_t *user_path_len, unsign default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object type") } /* end switch */ - HDassert(obj_path); + assert(obj_path); /* Retrieve a copy of the user path and put it into the buffer */ if (obj_path->user_path_r) { @@ -723,8 +723,8 @@ H5G__verify_cached_stabs_test_cb(H5F_t *f, const void H5_ATTR_UNUSED *_lt_key, h FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(H5_addr_defined(addr)); /* Load the node */ if (NULL == (sn = (H5G_node_t *)H5AC_protect(f, H5AC_SNODE, addr, f, H5AC__READ_ONLY_FLAG))) @@ -777,7 +777,7 @@ done: HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5_ITER_ERROR, "unable to release object header") if (targ_oh) { - HDassert(ret_value == H5_ITER_ERROR); + assert(ret_value == H5_ITER_ERROR); if (H5O_unprotect(&targ_oloc, targ_oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTUNPROTECT, H5_ITER_ERROR, "unable to release object header"); } /* end if */ @@ -815,7 +815,7 @@ H5G__verify_cached_stabs_test(hid_t gid) FUNC_ENTER_PACKAGE /* check args */ - HDassert(gid >= 0); + assert(gid >= 0); /* Check args */ if (NULL == (grp = (H5G_t *)H5VL_object_verify(gid, H5I_GROUP))) diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 24a9cb8..537d9b9 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -165,10 +165,10 @@ H5G__traverse_ud(const H5G_loc_t *grp_loc /*in,out*/, const H5O_link_t *lnk, H5G FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(grp_loc); - HDassert(lnk); - HDassert(lnk->type >= H5L_TYPE_UD_MIN); - HDassert(obj_loc); + assert(grp_loc); + assert(lnk); + assert(lnk->type >= H5L_TYPE_UD_MIN); + assert(obj_loc); /* Get the link class for this type of link. */ if (NULL == (link_class = H5L_find_class(lnk->type))) @@ -286,9 +286,9 @@ H5G__traverse_slink(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, H5G_loc_t * FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(grp_loc); - HDassert(lnk); - HDassert(lnk->type == H5L_TYPE_SOFT); + assert(grp_loc); + assert(lnk); + assert(lnk->type == H5L_TYPE_SOFT); /* Set up temporary location */ tmp_grp_loc.oloc = &tmp_grp_oloc; @@ -358,9 +358,9 @@ H5G__traverse_special(const H5G_loc_t *grp_loc, const H5O_link_t *lnk, unsigned FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(grp_loc); - HDassert(lnk); - HDassert(obj_loc); + assert(grp_loc); + assert(lnk); + assert(obj_loc); /* If we found a symbolic link then we should follow it. But if this * is the last component of the name and the H5G_TARGET_SLINK bit of @@ -477,9 +477,9 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G FUNC_ENTER_PACKAGE /* Check parameters */ - HDassert(_loc); - HDassert(name); - HDassert(op); + assert(_loc); + assert(name); + assert(op); /* * Where does the searching start? For absolute names it starts at the @@ -491,7 +491,7 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G /* Look up root group for starting location */ root_grp = H5G_rootof(_loc->oloc->file); - HDassert(root_grp); + assert(root_grp); /* Set the location entry to the root group's info */ loc.oloc = &(root_grp->oloc); @@ -571,8 +571,8 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G /* If the lookup was OK, build object location and traverse special links, etc. */ if (lookup_status) { /* Sanity check link and indicate it's valid */ - HDassert(lnk.type >= H5L_TYPE_HARD); - HDassert(!HDstrcmp(comp, lnk.name)); + assert(lnk.type >= H5L_TYPE_HARD); + assert(!HDstrcmp(comp, lnk.name)); link_valid = TRUE; /* Build object location from the link */ @@ -603,7 +603,7 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G cb_loc = NULL; } /* end if */ else { - HDassert(!obj_loc_valid); + assert(!obj_loc_valid); cb_lnk = NULL; cb_loc = NULL; } /* end else */ @@ -748,14 +748,14 @@ H5G__traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, H5G * Since we don't have a group location or a link to the object we pass in * NULL. */ - HDassert(group_copy); + assert(group_copy); if ((op)(NULL, ".", NULL, &grp_loc, op_data, &own_loc) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTNEXT, FAIL, "traversal operator failed") /* If the callback took ownership of the object location, it actually has * ownership of grp_loc. It shouldn't have tried to take ownership of * the "group location", which was NULL. */ - HDassert(!(own_loc & H5G_OWN_GRP_LOC)); + assert(!(own_loc & H5G_OWN_GRP_LOC)); if (own_loc & H5G_OWN_OBJ_LOC) own_loc |= H5G_OWN_GRP_LOC; diff --git a/src/H5HF.c b/src/H5HF.c index 1a736d0..60f19c2 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -151,8 +151,8 @@ H5HF_create(H5F_t *f, const H5HF_create_t *cparam) /* * Check arguments. */ - HDassert(f); - HDassert(cparam); + assert(f); + assert(cparam); /* Create shared fractal heap header */ if (HADDR_UNDEF == (fh_addr = H5HF__hdr_create(f, cparam))) @@ -216,8 +216,8 @@ H5HF_open(H5F_t *f, haddr_t fh_addr) /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(fh_addr)); + assert(f); + assert(H5_addr_defined(fh_addr)); /* Load the heap header into memory */ if (NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__READ_ONLY_FLAG))) @@ -276,8 +276,8 @@ H5HF_get_id_len(H5HF_t *fh, size_t *id_len_p) /* * Check arguments. */ - HDassert(fh); - HDassert(id_len_p); + assert(fh); + assert(id_len_p); /* Retrieve the ID length for entries in this heap */ *id_len_p = fh->hdr->id_len; @@ -305,8 +305,8 @@ H5HF_get_heap_addr(const H5HF_t *fh, haddr_t *heap_addr_p) /* * Check arguments. */ - HDassert(fh); - HDassert(heap_addr_p); + assert(fh); + assert(heap_addr_p); /* Retrieve the heap header address for this heap */ *heap_addr_p = fh->hdr->heap_addr; @@ -336,9 +336,9 @@ H5HF_insert(H5HF_t *fh, size_t size, const void *obj, void *id /*out*/) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(fh); - HDassert(obj); - HDassert(id); + assert(fh); + assert(obj); + assert(id); /* Check arguments */ if (size == 0) @@ -408,9 +408,9 @@ H5HF_get_obj_len(H5HF_t *fh, const void *_id, size_t *obj_len_p) /* * Check arguments. */ - HDassert(fh); - HDassert(id); - HDassert(obj_len_p); + assert(fh); + assert(id); + assert(obj_len_p); /* Get the ID flags */ id_flags = *id; @@ -468,9 +468,9 @@ H5HF_get_obj_off(H5HF_t *fh, const void *_id, hsize_t *obj_off_p) /* * Check arguments. */ - HDassert(fh); - HDassert(id); - HDassert(obj_off_p); + assert(fh); + assert(id); + assert(obj_off_p); /* Get the ID flags */ id_flags = *id; @@ -528,9 +528,9 @@ H5HF_read(H5HF_t *fh, const void *_id, void *obj /*out*/) /* * Check arguments. */ - HDassert(fh); - HDassert(id); - HDassert(obj); + assert(fh); + assert(id); + assert(obj); /* Get the ID flags */ id_flags = *id; @@ -603,9 +603,9 @@ H5HF_write(H5HF_t *fh, void *_id, hbool_t H5_ATTR_UNUSED *id_changed, const void /* * Check arguments. */ - HDassert(fh); - HDassert(id); - HDassert(obj); + assert(fh); + assert(id); + assert(obj); /* Get the ID flags */ id_flags = *id; @@ -672,9 +672,9 @@ H5HF_op(H5HF_t *fh, const void *_id, H5HF_operator_t op, void *op_data) /* * Check arguments. */ - HDassert(fh); - HDassert(id); - HDassert(op); + assert(fh); + assert(id); + assert(op); /* Get the ID flags */ id_flags = *id; @@ -735,9 +735,9 @@ H5HF_remove(H5HF_t *fh, const void *_id) /* * Check arguments. */ - HDassert(fh); - HDassert(fh->hdr); - HDassert(id); + assert(fh); + assert(fh->hdr); + assert(id); /* Get the ID flags */ id_flags = *id; @@ -798,7 +798,7 @@ H5HF_close(H5HF_t *fh) /* * Check arguments. */ - HDassert(fh); + assert(fh); /* Decrement file reference & check if this is the last open fractal heap using the shared heap header */ if (0 == H5HF__hdr_fuse_decr(fh->hdr)) { @@ -892,8 +892,8 @@ H5HF_delete(H5F_t *f, haddr_t fh_addr) /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(fh_addr)); + assert(f); + assert(H5_addr_defined(fh_addr)); /* Lock the heap header into memory */ if (NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__NO_FLAGS_SET))) diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 0c9d4a1..41c2322 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -195,7 +195,7 @@ H5HF__huge_bt2_crt_context(void *_f) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); + assert(f); /* Allocate callback context */ if (NULL == (ctx = H5FL_MALLOC(H5HF_huge_bt2_ctx_t))) @@ -235,7 +235,7 @@ H5HF__huge_bt2_dst_context(void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Release callback context */ ctx = H5FL_FREE(H5HF_huge_bt2_ctx_t, ctx); @@ -371,7 +371,7 @@ H5HF__huge_bt2_indir_encode(uint8_t *raw, const void *_nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Encode the record's fields */ H5F_addr_encode_len(ctx->sizeof_addr, &raw, nrecord->addr); @@ -403,7 +403,7 @@ H5HF__huge_bt2_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Decode the record's fields */ H5F_addr_decode_len(ctx->sizeof_addr, &raw, &nrecord->addr); @@ -569,7 +569,7 @@ H5HF__huge_bt2_filt_indir_encode(uint8_t *raw, const void *_nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Encode the record's fields */ H5F_addr_encode_len(ctx->sizeof_addr, &raw, nrecord->addr); @@ -603,7 +603,7 @@ H5HF__huge_bt2_filt_indir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Decode the record's fields */ H5F_addr_decode_len(ctx->sizeof_addr, &raw, &nrecord->addr); @@ -758,7 +758,7 @@ H5HF__huge_bt2_dir_encode(uint8_t *raw, const void *_nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Encode the record's fields */ H5F_addr_encode_len(ctx->sizeof_addr, &raw, nrecord->addr); @@ -789,7 +789,7 @@ H5HF__huge_bt2_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Decode the record's fields */ H5F_addr_decode_len(ctx->sizeof_addr, &raw, &nrecord->addr); @@ -965,7 +965,7 @@ H5HF__huge_bt2_filt_dir_encode(uint8_t *raw, const void *_nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Encode the record's fields */ H5F_addr_encode_len(ctx->sizeof_addr, &raw, nrecord->addr); @@ -998,7 +998,7 @@ H5HF__huge_bt2_filt_dir_decode(const uint8_t *raw, void *_nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Decode the record's fields */ H5F_addr_decode_len(ctx->sizeof_addr, &raw, &nrecord->addr); diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 704d55a..25cbf82 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -202,8 +202,8 @@ H5HF__hdr_prefix_decode(H5HF_hdr_t *hdr, const uint8_t **image_ref) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(hdr); - HDassert(image); + assert(hdr); + assert(image); /* Magic number */ if (HDmemcmp(image, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) @@ -245,9 +245,9 @@ H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(pp && *pp); - HDassert(dtable); + assert(f); + assert(pp && *pp); + assert(dtable); /* Table width */ UINT16DECODE(*pp, dtable->cparam.width); @@ -293,9 +293,9 @@ H5HF__dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(pp && *pp); - HDassert(dtable); + assert(f); + assert(pp && *pp); + assert(dtable); /* Table width */ UINT16ENCODE(*pp, dtable->cparam.width); @@ -349,8 +349,8 @@ H5HF__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(udata); - HDassert(image_len); + assert(udata); + assert(image_len); /* Set the internal parameters for the heap */ dummy_hdr.f = udata->f; @@ -389,10 +389,10 @@ H5HF__cache_hdr_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UN FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(image); - HDassert(udata); - HDassert(actual_len); - HDassert(*actual_len == image_len); + assert(image); + assert(udata); + assert(actual_len); + assert(*actual_len == image_len); /* Deserialize the fractal heap header's prefix */ if (H5HF__hdr_prefix_decode(&hdr, &image) < 0) @@ -433,7 +433,7 @@ H5HF__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -473,10 +473,10 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(image); - HDassert(len > 0); - HDassert(udata); - HDassert(dirty); + assert(image); + assert(len > 0); + assert(udata); + assert(dirty); /* Allocate space for the fractal heap data structure */ if (NULL == (hdr = H5HF__hdr_alloc(udata->f))) @@ -522,14 +522,14 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_ /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(image - (const uint8_t *)_image) == (hdr->heap_size - H5HF_SIZEOF_CHKSUM)); + assert((size_t)(image - (const uint8_t *)_image) == (hdr->heap_size - H5HF_SIZEOF_CHKSUM)); /* Check for I/O filter information to decode */ if (hdr->filter_len > 0) { H5O_pline_t *pline; /* Pipeline information from the header on disk */ /* Sanity check */ - HDassert(len > hdr->heap_size); /* A header with filter info is > than a standard header */ + assert(len > hdr->heap_size); /* A header with filter info is > than a standard header */ /* Compute the heap header's size */ hdr->heap_size += (size_t)(hdr->sizeof_size /* Size of size for filtered root direct block */ @@ -561,7 +561,7 @@ H5HF__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_ UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == hdr->heap_size); + assert((size_t)(image - (const uint8_t *)_image) == hdr->heap_size); /* Finish initialization of heap header */ if (H5HF__hdr_finish_init(hdr) < 0) @@ -603,9 +603,9 @@ H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(hdr); - HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); - HDassert(image_len); + assert(hdr); + assert(hdr->cache_info.type == H5AC_FHEAP_HDR); + assert(image_len); *image_len = hdr->heap_size; @@ -643,14 +643,14 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(hdr); - HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); - HDassert(H5_addr_defined(addr)); - HDassert(addr == hdr->heap_addr); - HDassert(new_addr); - HDassert(new_len); - HDassert(flags); + assert(f); + assert(hdr); + assert(hdr->cache_info.type == H5AC_FHEAP_HDR); + assert(H5_addr_defined(addr)); + assert(addr == hdr->heap_addr); + assert(new_addr); + assert(new_len); + assert(flags); #ifndef NDEBUG { @@ -686,7 +686,7 @@ H5HF__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, if (H5HF__cache_verify_hdr_descendants_clean((H5F_t *)f, hdr, &fd_children_clean, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify hdr descendants clean.") - HDassert(fd_children_clean); + assert(fd_children_clean); } #endif /* NDEBUG */ @@ -729,11 +729,11 @@ H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(image); - HDassert(hdr); - HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); - HDassert(len == hdr->heap_size); + assert(f); + assert(image); + assert(hdr); + assert(hdr->cache_info.type == H5AC_FHEAP_HDR); + assert(len == hdr->heap_size); /* Set the shared heap header's file context for this operation */ H5_GCC_DIAG_OFF("discarded-qualifiers") @@ -805,7 +805,7 @@ H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UN UINT32ENCODE(image, metadata_chksum); /* sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) == len); + assert((size_t)(image - (uint8_t *)_image) == len); done: FUNC_LEAVE_NOAPI(ret_value) @@ -840,9 +840,9 @@ H5HF__cache_hdr_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(hdr); - HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); - HDassert(hdr->rc == 0); + assert(hdr); + assert(hdr->cache_info.type == H5AC_FHEAP_HDR); + assert(hdr->rc == 0); if (H5HF__hdr_free(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "unable to release fractal heap header") @@ -873,10 +873,10 @@ H5HF__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(udata); - HDassert(udata->par_info); - HDassert(udata->par_info->hdr); - HDassert(image_len); + assert(udata); + assert(udata->par_info); + assert(udata->par_info->hdr); + assert(image_len); /* Set the image length size */ *image_len = (size_t)H5HF_MAN_INDIRECT_SIZE(udata->par_info->hdr, *udata->nrows); @@ -908,7 +908,7 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -955,11 +955,11 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(image); - HDassert(udata); - HDassert(dirty); + assert(image); + assert(udata); + assert(dirty); hdr = udata->par_info->hdr; - HDassert(hdr->f); + assert(hdr->f); /* Set the shared heap header's file context for this operation */ hdr->f = udata->f; @@ -982,7 +982,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock->nrows); /* sanity check */ - HDassert(iblock->size == len); + assert(iblock->size == len); /* Magic number */ if (HDmemcmp(image, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) @@ -1026,7 +1026,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED UINT64DECODE_VAR(image, iblock->block_off, hdr->heap_off_size); /* Allocate & decode child block entry tables */ - HDassert(iblock->nrows > 0); + assert(iblock->nrows > 0); if (NULL == (iblock->ents = H5FL_SEQ_MALLOC(H5HF_indirect_ent_t, (size_t)(iblock->nrows * hdr->man_dtable.cparam.width)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for direct entries") @@ -1052,7 +1052,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED /* Check for heap with I/O filters */ if (hdr->filter_len > 0) { /* Sanity check */ - HDassert(iblock->filt_ents); + assert(iblock->filt_ents); /* Decode extra information for direct blocks */ if (u < (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width)) { @@ -1063,8 +1063,8 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED /* (either both the address & size are defined or both are * not defined) */ - HDassert((H5_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) || - (!H5_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); + assert((H5_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) || + (!H5_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); /* I/O filter mask for filtered direct block */ UINT32DECODE(image, iblock->filt_ents[u].filter_mask); @@ -1079,7 +1079,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED } /* end for */ /* Sanity check */ - HDassert(iblock->nchildren); /* indirect blocks w/no children should have been deleted */ + assert(iblock->nchildren); /* indirect blocks w/no children should have been deleted */ /* checksum verification already done by verify_chksum cb */ @@ -1087,7 +1087,7 @@ H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == iblock->size); + assert((size_t)(image - (const uint8_t *)_image) == iblock->size); /* Check if we have any indirect block children */ if (iblock->nrows > hdr->man_dtable.max_direct_rows) { @@ -1136,9 +1136,9 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(iblock); - HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(image_len); + assert(iblock); + assert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(image_len); *image_len = iblock->size; @@ -1176,18 +1176,18 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5 FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(iblock); - HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(iblock->cache_info.size == iblock->size); - HDassert(H5_addr_defined(addr)); - HDassert(H5_addr_eq(iblock->addr, addr)); - HDassert(new_addr); - HDassert(new_len); - HDassert(flags); + assert(f); + assert(iblock); + assert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(iblock->cache_info.size == iblock->size); + assert(H5_addr_defined(addr)); + assert(H5_addr_eq(iblock->addr, addr)); + assert(new_addr); + assert(new_len); + assert(flags); hdr = iblock->hdr; - HDassert(hdr); - HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + assert(hdr); + assert(hdr->cache_info.type == H5AC_FHEAP_HDR); #ifndef NDEBUG { @@ -1210,7 +1210,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5 if (H5HF__cache_verify_iblock_descendants_clean((H5F_t *)f, iblock->addr, iblock, &iblock_status, &fd_children_clean, &descendants_clean) < 0) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "can't verify descendants clean.") - HDassert(fd_children_clean); + assert(fd_children_clean); } #endif /* NDEBUG */ @@ -1226,7 +1226,7 @@ H5HF__cache_iblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5 HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap indirect block") /* Sanity check */ - HDassert(!H5_addr_eq(iblock->addr, iblock_addr)); + assert(!H5_addr_eq(iblock->addr, iblock_addr)); /* Let the metadata cache know the block moved */ if (H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_IBLOCK, iblock->addr, iblock_addr) < 0) @@ -1302,16 +1302,16 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(f); - HDassert(image); - HDassert(iblock); - HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(iblock->cache_info.size == iblock->size); - HDassert(len == iblock->size); + assert(f); + assert(image); + assert(iblock); + assert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(iblock->cache_info.size == iblock->size); + assert(len == iblock->size); /* Indirect block must be in 'normal' file space */ - HDassert(!H5F_IS_TMP_ADDR(f, iblock->addr)); - HDassert(H5_addr_eq(iblock->addr, iblock->cache_info.addr)); + assert(!H5F_IS_TMP_ADDR(f, iblock->addr)); + assert(H5_addr_eq(iblock->addr, iblock->cache_info.addr)); /* Get the pointer to the shared heap header */ hdr = iblock->hdr; @@ -1344,7 +1344,7 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG /* Check for heap with I/O filters */ if (hdr->filter_len > 0) { /* Sanity check */ - HDassert(iblock->filt_ents); + assert(iblock->filt_ents); /* Encode extra information for direct blocks */ if (u < (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width)) { @@ -1352,8 +1352,8 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG /* (either both the address & size are defined or both are * not defined) */ - HDassert((H5_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) || - (!H5_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); + assert((H5_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) || + (!H5_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); /* Size of filtered direct block */ H5F_ENCODE_LENGTH(f, image, iblock->filt_ents[u].size); @@ -1380,10 +1380,10 @@ H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG UINT32ENCODE(image, metadata_chksum); /* Sanity checks */ - HDassert((size_t)(image - (uint8_t *)_image) == iblock->size); + assert((size_t)(image - (uint8_t *)_image) == iblock->size); #ifndef NDEBUG - HDassert(nchildren == iblock->nchildren); - HDassert(max_child == iblock->max_child); + assert(nchildren == iblock->nchildren); + assert(max_child == iblock->max_child); #endif /* NDEBUG */ FUNC_LEAVE_NOAPI(ret_value) @@ -1416,9 +1416,9 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(iblock); - HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(iblock->hdr); + assert(iblock); + assert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(iblock->hdr); /* further sanity checks */ if (iblock->parent == NULL) { @@ -1426,7 +1426,7 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) /* the fractal heap has already pinned the hdr. Do what */ /* sanity checking we can. */ if ((iblock->block_off == 0) && (iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED)) - HDassert(iblock->hdr->root_iblock == iblock); + assert(iblock->hdr->root_iblock == iblock); } /* end if */ else { /* if this is a child iblock, verify that the pointers are */ @@ -1435,9 +1435,9 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) unsigned H5_ATTR_NDEBUG_UNUSED indir_idx; /* Index in parent's child iblock pointer array */ /* Sanity check */ - HDassert(par_iblock->child_iblocks); - HDassert(iblock->par_entry >= - (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width)); + assert(par_iblock->child_iblocks); + assert(iblock->par_entry >= + (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width)); /* Compute index in parent's child iblock pointer array */ indir_idx = iblock->par_entry - @@ -1446,8 +1446,8 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) /* The pointer to iblock in the parent may not be set yet -- */ /* verify that it is either NULL, or that it has been set to */ /* iblock. */ - HDassert((NULL == par_iblock->child_iblocks[indir_idx]) || - (par_iblock->child_iblocks[indir_idx] == iblock)); + assert((NULL == par_iblock->child_iblocks[indir_idx]) || + (par_iblock->child_iblocks[indir_idx] == iblock)); } /* end else */ switch (action) { @@ -1510,10 +1510,10 @@ H5HF__cache_iblock_free_icr(void *thing) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(iblock); - HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(iblock->rc == 0); - HDassert(iblock->hdr); + assert(iblock); + assert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(iblock->rc == 0); + assert(iblock->hdr); /* Destroy fractal heap indirect block */ if (H5HF__man_iblock_dest(iblock) < 0) @@ -1547,14 +1547,14 @@ H5HF__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(udata); - HDassert(image_len); + assert(udata); + assert(image_len); /* Convenience variables */ par_info = (const H5HF_parent_t *)(&(udata->par_info)); - HDassert(par_info); + assert(par_info); hdr = par_info->hdr; - HDassert(hdr); + assert(hdr); /* Check for I/O filters on this heap */ if (hdr->filter_len > 0) { @@ -1602,12 +1602,12 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); par_info = (H5HF_parent_t *)(&(udata->par_info)); - HDassert(par_info); + assert(par_info); hdr = par_info->hdr; - HDassert(hdr); + assert(hdr); /* Get out if data block is not checksummed */ if (!(hdr->checksum_dblocks)) @@ -1677,8 +1677,8 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) /* Save the decompressed data to be used later in deserialize callback */ if (hdr->filter_len > 0) { /* Sanity check */ - HDassert(udata->decompressed); - HDassert(len == udata->dblock_size); + assert(udata->decompressed); + assert(len == udata->dblock_size); /* Allocate block buffer */ if (NULL == (udata->dblk = H5FL_BLK_MALLOC(direct_block, (size_t)len))) @@ -1731,14 +1731,14 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); par_info = (H5HF_parent_t *)(&(udata->par_info)); - HDassert(par_info); + assert(par_info); hdr = par_info->hdr; - HDassert(hdr); - HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); - HDassert(dirty); + assert(hdr); + assert(hdr->cache_info.type == H5AC_FHEAP_HDR); + assert(dirty); /* Allocate space for the fractal heap direct block */ if (NULL == (dblock = H5FL_CALLOC(H5HF_direct_t))) @@ -1761,7 +1761,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo /* Direct block is already decompressed in verify_chksum callback */ if (udata->decompressed) { /* Sanity check */ - HDassert(udata->dblk); + assert(udata->dblk); /* Take ownership of the decompressed direct block */ dblock->blk = udata->dblk; @@ -1773,7 +1773,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo unsigned filter_mask; /* Excluded filters for direct block */ /* Sanity check */ - HDassert(udata->dblk == NULL); + assert(udata->dblk == NULL); /* Initialize the filter callback struct */ filter_cb.op_data = NULL; @@ -1797,7 +1797,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") /* Sanity check */ - HDassert(nbytes == dblock->size); + assert(nbytes == dblock->size); /* Copy un-filtered data into block's buffer */ H5MM_memcpy(dblock->blk, read_buf, dblock->size); @@ -1805,8 +1805,8 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo } /* end if */ else { /* Sanity checks */ - HDassert(udata->dblk == NULL); - HDassert(!udata->decompressed); + assert(udata->dblk == NULL); + assert(!udata->decompressed); /* Allocate block buffer */ /* XXX: Change to using free-list factories */ @@ -1814,7 +1814,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy image to dblock->blk */ - HDassert(dblock->size == len); + assert(dblock->size == len); H5MM_memcpy(dblock->blk, image, dblock->size); } /* end else */ @@ -1863,7 +1863,7 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, hbo } /* end if */ /* Sanity check */ - HDassert((size_t)(image - dblock->blk) == (size_t)H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); + assert((size_t)(image - dblock->blk) == (size_t)H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); /* Set return value */ ret_value = (void *)dblock; @@ -1906,13 +1906,13 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(dblock); - HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); - HDassert(image_len); + assert(dblock); + assert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + assert(image_len); /* Set up convenience variables */ hdr = dblock->hdr; - HDassert(hdr); + assert(hdr); /* Check for I/O filters on this heap */ if (hdr->filter_len > 0) { @@ -1959,7 +1959,7 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len) size = dblock->size; /* Set the image size */ - HDassert(size > 0); + assert(size > 0); *image_len = size; FUNC_LEAVE_NOAPI(SUCCEED) @@ -2047,16 +2047,16 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(dblock); - HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); - HDassert(dblock->write_buf == NULL); - HDassert(dblock->write_size == 0); - HDassert(dblock->cache_info.size == len); - HDassert(H5_addr_defined(addr)); - HDassert(new_addr); - HDassert(new_len); - HDassert(flags); + assert(f); + assert(dblock); + assert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + assert(dblock->write_buf == NULL); + assert(dblock->write_size == 0); + assert(dblock->cache_info.size == len); + assert(H5_addr_defined(addr)); + assert(new_addr); + assert(new_len); + assert(flags); /* Set up local variables */ hdr = dblock->hdr; @@ -2065,8 +2065,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le /* Set the shared heap header's file context for this operation */ hdr->f = (H5F_t *)f; - HDassert(hdr); - HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); + assert(hdr); + assert(hdr->cache_info.type == H5AC_FHEAP_HDR); if (dblock->parent) { /* this is the common case, in which the direct block is the child @@ -2078,8 +2078,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le par_iblock = dblock->parent; par_entry = dblock->par_entry; - HDassert(par_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(H5_addr_eq(par_iblock->ents[par_entry].addr, addr)); + assert(par_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(H5_addr_eq(par_iblock->ents[par_entry].addr, addr)); } /* end if */ else { /* the direct block is a root direct block -- just set par_iblock @@ -2096,7 +2096,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le * and the checksum at the beginning of the block. */ - HDassert(dblock->blk); + assert(dblock->blk); image = dblock->blk; /* Magic number */ @@ -2132,7 +2132,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le */ /* Sanity check */ - HDassert((size_t)(image - dblock->blk) == (size_t)H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); + assert((size_t)(image - dblock->blk) == (size_t)H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); /* If I/O filters are enabled on this heap, we must run the direct block * image through the filters to obtain the image that we will hand off @@ -2179,8 +2179,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le hbool_t hdr_changed = FALSE; /* Whether the header info changed */ /* Sanity check */ - HDassert(H5_addr_eq(hdr->man_dtable.table_addr, addr)); - HDassert(hdr->pline_root_direct_size > 0); + assert(H5_addr_eq(hdr->man_dtable.table_addr, addr)); + assert(hdr->pline_root_direct_size > 0); /* Check if the filter mask changed */ if (hdr->pline_root_direct_filter_mask != filter_mask) { @@ -2192,7 +2192,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le * size matches the heap's last record. This value will * likely change shortly. */ - HDassert(len == hdr->pline_root_direct_size); + assert(len == hdr->pline_root_direct_size); /* Check if we need to re-size the block on disk */ if (hdr->pline_root_direct_size != write_size || at_tmp_addr) { @@ -2215,8 +2215,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le /* Update information about compressed direct block's * location & size */ - HDassert(hdr->man_dtable.table_addr == addr); - HDassert(hdr->pline_root_direct_size == len); + assert(hdr->man_dtable.table_addr == addr); + assert(hdr->pline_root_direct_size == len); hdr->man_dtable.table_addr = dblock_addr; hdr->pline_root_direct_size = write_size; @@ -2233,8 +2233,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le hbool_t par_changed = FALSE; /* Whether the parent's infochanged */ /* Sanity check */ - HDassert(par_iblock); - HDassert(par_iblock->filt_ents[par_entry].size > 0); + assert(par_iblock); + assert(par_iblock->filt_ents[par_entry].size > 0); /* Check if the filter mask changed */ if (par_iblock->filt_ents[par_entry].filter_mask != filter_mask) { @@ -2246,7 +2246,7 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le * size matches the heap's last record. This value will * likely change shortly. */ - HDassert(len == par_iblock->filt_ents[par_entry].size); + assert(len == par_iblock->filt_ents[par_entry].size); /* Check if we need to re-size the block on disk */ if (par_iblock->filt_ents[par_entry].size != write_size || at_tmp_addr) { @@ -2270,8 +2270,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le /* Update information about compressed direct block's * location & size */ - HDassert(par_iblock->ents[par_entry].addr == addr); - HDassert(par_iblock->filt_ents[par_entry].size == len); + assert(par_iblock->ents[par_entry].addr == addr); + assert(par_iblock->filt_ents[par_entry].size == len); par_iblock->ents[par_entry].addr = dblock_addr; par_iblock->filt_ents[par_entry].size = write_size; @@ -2312,8 +2312,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le /* Check for root direct block */ if (NULL == dblock->parent) { /* Sanity checks */ - HDassert(H5_addr_eq(hdr->man_dtable.table_addr, addr)); - HDassert(!H5_addr_eq(hdr->man_dtable.table_addr, dblock_addr)); + assert(H5_addr_eq(hdr->man_dtable.table_addr, addr)); + assert(!H5_addr_eq(hdr->man_dtable.table_addr, dblock_addr)); /* Update information about direct block's location */ hdr->man_dtable.table_addr = dblock_addr; @@ -2324,10 +2324,10 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le } /* end if */ else { /* the direct block's parent is an indirect block */ /* Sanity checks */ - HDassert(par_iblock); - HDassert(par_iblock->ents); - HDassert(H5_addr_eq(par_iblock->ents[par_entry].addr, addr)); - HDassert(!H5_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr)); + assert(par_iblock); + assert(par_iblock->ents); + assert(H5_addr_eq(par_iblock->ents[par_entry].addr, addr)); + assert(!H5_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr)); /* Update information about direct block's location */ par_iblock->ents[par_entry].addr = dblock_addr; @@ -2366,8 +2366,8 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t le *flags = dblock_flags; /* final sanity check */ - HDassert(dblock->write_buf); - HDassert(dblock->write_size > 0); + assert(dblock->write_buf); + assert(dblock->write_size > 0); done: /* discard the write buf if we have an error */ @@ -2408,16 +2408,16 @@ H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(f); - HDassert(image); - HDassert(len > 0); - HDassert(dblock); - HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); - HDassert((dblock->blk != dblock->write_buf) || (dblock->cache_info.size == dblock->size)); - HDassert(dblock->write_buf); - HDassert(dblock->write_size > 0); - HDassert((dblock->blk != dblock->write_buf) || (dblock->write_size == dblock->size)); - HDassert(dblock->write_size == len); + assert(f); + assert(image); + assert(len > 0); + assert(dblock); + assert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + assert((dblock->blk != dblock->write_buf) || (dblock->cache_info.size == dblock->size)); + assert(dblock->write_buf); + assert(dblock->write_size > 0); + assert((dblock->blk != dblock->write_buf) || (dblock->write_size == dblock->size)); + assert(dblock->write_size == len); /* Copy the image from *(dblock->write_buf) to *image */ H5MM_memcpy(image, dblock->write_buf, dblock->write_size); @@ -2458,9 +2458,9 @@ H5HF__cache_dblock_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dblock); - HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); - HDassert(dblock->hdr); + assert(dblock); + assert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + assert(dblock->hdr); switch (action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: @@ -2522,8 +2522,8 @@ H5HF__cache_dblock_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dblock); - HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + assert(dblock); + assert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); /* Destroy fractal heap direct block */ if (H5HF__man_dblock_dest(dblock) < 0) @@ -2556,10 +2556,10 @@ H5HF__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(dblock); - HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); - HDassert(dblock->file_size > 0); - HDassert(fsf_size); + assert(dblock); + assert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK); + assert(dblock->file_size > 0); + assert(fsf_size); /* Set free space in file size */ *fsf_size = dblock->file_size; @@ -2642,17 +2642,17 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(hdr); - HDassert(hdr->cache_info.type == H5AC_FHEAP_HDR); - HDassert(fd_clean); - HDassert(clean); + assert(f); + assert(hdr); + assert(hdr->cache_info.type == H5AC_FHEAP_HDR); + assert(fd_clean); + assert(clean); hdr_addr = hdr->cache_info.addr; - HDassert(hdr_addr == hdr->heap_addr); + assert(hdr_addr == hdr->heap_addr); if (H5AC_get_entry_status(f, hdr_addr, &hdr_status) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get hdr status") - HDassert(hdr_status & H5AC_ES__IN_CACHE); + assert(hdr_status & H5AC_ES__IN_CACHE); /* We have three basic scenarios we have to deal with: * @@ -2702,12 +2702,12 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ root_iblock_addr = root_iblock->addr; /* get the status of the root iblock */ - HDassert(root_iblock_addr != HADDR_UNDEF); + assert(root_iblock_addr != HADDR_UNDEF); if (H5AC_get_entry_status(f, root_iblock_addr, &root_iblock_status) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get root iblock status") root_iblock_in_cache = ((root_iblock_status & H5AC_ES__IN_CACHE) != 0); - HDassert(root_iblock_in_cache || (root_iblock == NULL)); + assert(root_iblock_in_cache || (root_iblock == NULL)); if (!root_iblock_in_cache) { /* we are done */ *clean = TRUE; @@ -2723,7 +2723,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ */ if (H5AC_flush_dependency_exists(f, hdr->heap_addr, root_iblock_addr, &fd_exists) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check flush dependency") - HDassert(fd_exists); + assert(fd_exists); *fd_clean = FALSE; } /* end else-if */ @@ -2806,7 +2806,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ */ if (H5AC_get_entry_ptr_from_addr(f, root_iblock_addr, (void **)(&root_iblock)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "H5AC_get_entry_ptr_from_addr() failed.") - HDassert(root_iblock); + assert(root_iblock); } /* end else */ } /* end if */ else { /* root_iblock != NULL */ @@ -2842,7 +2842,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ H5_END_TAG unprotect_root_iblock = TRUE; - HDassert(iblock == root_iblock); + assert(iblock == root_iblock); } /* end if */ } /* end else */ @@ -2850,7 +2850,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ * in memory for the duration of the call. Do some sanity checks, * and then call H5HF__cache_verify_iblock_descendants_clean(). */ - HDassert(root_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(root_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); if (H5HF__cache_verify_iblock_descendants_clean(f, hdr->heap_addr, root_iblock, &root_iblock_status, fd_clean, clean) < 0) @@ -2858,7 +2858,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ /* Unprotect the root indirect block if required */ if (unprotect_root_iblock) { - HDassert(root_iblock); + assert(root_iblock); if (H5AC_unprotect(f, H5AC_FHEAP_IBLOCK, root_iblock_addr, root_iblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "H5AC_unprotect() failed.") @@ -2879,7 +2879,7 @@ H5HF__cache_verify_hdr_descendants_clean(H5F_t *f, H5HF_hdr_t *hdr, hbool_t *fd_ if (root_dblock_status & H5AC_ES__IN_CACHE) { if (H5AC_verify_entry_type(f, root_dblock_addr, &H5AC_FHEAP_DBLOCK[0], &in_cache, &type_ok) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't check dblock type") - HDassert(in_cache); + assert(in_cache); if (!type_ok) HGOTO_ERROR(H5E_HEAP, H5E_SYSTEM, FAIL, "root dblock addr doesn't refer to a dblock?!?") @@ -3004,14 +3004,14 @@ H5HF__cache_verify_iblock_descendants_clean(H5F_t *f, haddr_t fd_parent_addr, H5 FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(H5_addr_defined(fd_parent_addr)); - HDassert(iblock); - HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(iblock_status); - HDassert(fd_clean); - HDassert(*fd_clean); - HDassert(clean); /* note that *clean need not be TRUE */ + assert(f); + assert(H5_addr_defined(fd_parent_addr)); + assert(iblock); + assert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(iblock_status); + assert(fd_clean); + assert(*fd_clean); + assert(clean); /* note that *clean need not be TRUE */ if ((*fd_clean) && H5HF__cache_verify_iblocks_dblocks_clean(f, fd_parent_addr, iblock, fd_clean, clean, &has_dblocks) < 0) @@ -3122,21 +3122,21 @@ H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(H5_addr_defined(fd_parent_addr)); - HDassert(iblock); - HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(fd_clean); - HDassert(*fd_clean); - HDassert(clean); /* note that *clean need not be true */ - HDassert(has_dblocks); + assert(f); + assert(H5_addr_defined(fd_parent_addr)); + assert(iblock); + assert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(fd_clean); + assert(*fd_clean); + assert(clean); /* note that *clean need not be true */ + assert(has_dblocks); i = 0; num_direct_rows = MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); - HDassert(num_direct_rows <= iblock->nrows); + assert(num_direct_rows <= iblock->nrows); max_dblock_index = (num_direct_rows * iblock->hdr->man_dtable.cparam.width) - 1; iblock_addr = iblock->addr; - HDassert(H5_addr_defined(iblock_addr)); + assert(H5_addr_defined(iblock_addr)); while ((*fd_clean) && (i <= max_dblock_index)) { haddr_t dblock_addr; @@ -3159,7 +3159,7 @@ H5HF__cache_verify_iblocks_dblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5HF_ if (H5AC_get_entry_status(f, dblock_addr, &dblock_status) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get dblock status") - HDassert(dblock_status & H5AC_ES__IN_CACHE); + assert(dblock_status & H5AC_ES__IN_CACHE); *has_dblocks = TRUE; @@ -3286,16 +3286,16 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5 FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(H5_addr_defined(fd_parent_addr)); - HDassert(iblock); - HDassert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(fd_clean); - HDassert(*fd_clean); - HDassert(clean); /* note that *clean need not be true */ - HDassert(has_iblocks); + assert(f); + assert(H5_addr_defined(fd_parent_addr)); + assert(iblock); + assert(iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(fd_clean); + assert(*fd_clean); + assert(clean); /* note that *clean need not be true */ + assert(has_iblocks); num_direct_rows = MIN(iblock->nrows, iblock->hdr->man_dtable.max_direct_rows); - HDassert(num_direct_rows <= iblock->nrows); + assert(num_direct_rows <= iblock->nrows); iblock_addr = iblock->addr; first_iblock_index = num_direct_rows * iblock->hdr->man_dtable.cparam.width; @@ -3426,13 +3426,13 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "H5AC_get_entry_ptr_from_addr() failed.") - HDassert(child_iblock); + assert(child_iblock); } /* end else */ } /* end if */ else { /* child iblock is pinned -- look it up in the */ /* parent iblocks child_iblocks array. */ - HDassert(iblock->child_iblocks); + assert(iblock->child_iblocks); child_iblock = iblock->child_iblocks[i - first_iblock_index]; } /* end else */ @@ -3440,9 +3440,9 @@ H5HF__cache_verify_descendant_iblocks_clean(H5F_t *f, haddr_t fd_parent_addr, H5 * a pointer to the child iblock. Verify that we * that we have the correct one. */ - HDassert(child_iblock); - HDassert(child_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); - HDassert(child_iblock->addr == child_iblock_addr); + assert(child_iblock); + assert(child_iblock->cache_info.type == H5AC_FHEAP_IBLOCK); + assert(child_iblock->addr == child_iblock_addr); /* now make the recursive call */ if (H5HF__cache_verify_iblock_descendants_clean( diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 63f6a70..8fb8b24 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -115,11 +115,11 @@ H5HF_id_print(H5HF_t *fh, const void *_id, FILE *stream, int indent, int fwidth) /* * Check arguments. */ - HDassert(fh); - HDassert(id); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(fh); + assert(id); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Get the ID flags */ id_flags = *id; @@ -179,10 +179,10 @@ H5HF__dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fw /* * Check arguments. */ - HDassert(dtable); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(dtable); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* * Print the values. @@ -237,10 +237,10 @@ H5HF_hdr_print(const H5HF_hdr_t *hdr, hbool_t dump_internal, FILE *stream, int i /* * Check arguments. */ - HDassert(hdr); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(hdr); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Print opening message */ HDfprintf(stream, "%*sFractal Heap Header...\n", indent, ""); @@ -337,11 +337,11 @@ H5HF_hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Load the fractal heap header */ if (NULL == (hdr = H5HF__hdr_protect(f, addr, H5AC__READ_ONLY_FLAG))) @@ -382,16 +382,16 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) /* * Check arguments. */ - HDassert(sect); - HDassert(udata); + assert(sect); + assert(udata); /* Set up some local variables, for convenience */ sect_start = sect->sect_info.addr; sect_end = (sect->sect_info.addr + sect->sect_info.size) - 1; - HDassert(sect_end >= sect_start); + assert(sect_end >= sect_start); dblock_start = udata->dblock_addr; dblock_end = (udata->dblock_addr + udata->dblock_size) - 1; - HDassert(dblock_end >= dblock_start); + assert(dblock_end >= dblock_start); /* Check for overlap between free space section & direct block */ if ((sect_start <= dblock_end && @@ -467,13 +467,13 @@ H5HF_dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(H5_addr_defined(hdr_addr)); - HDassert(block_size > 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(H5_addr_defined(hdr_addr)); + assert(block_size > 0); /* Load the fractal heap header */ if (NULL == (hdr = H5HF__hdr_protect(f, hdr_addr, H5AC__READ_ONLY_FLAG))) @@ -584,11 +584,11 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, FILE *st /* * Check arguments. */ - HDassert(iblock); - HDassert(iblock->hdr); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(iblock); + assert(iblock->hdr); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Set up convenience variables */ hdr = iblock->hdr; @@ -699,13 +699,13 @@ H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); - HDassert(H5_addr_defined(hdr_addr)); - HDassert(nrows > 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); + assert(H5_addr_defined(hdr_addr)); + assert(nrows > 0); /* Load the fractal heap header */ if (NULL == (hdr = H5HF__hdr_protect(f, hdr_addr, H5AC__READ_ONLY_FLAG))) @@ -754,8 +754,8 @@ H5HF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) /* * Check arguments. */ - HDassert(sect); - HDassert(udata); + assert(sect); + assert(udata); /* Print generic section information */ HDfprintf( @@ -802,11 +802,11 @@ H5HF_sects_debug(H5F_t *f, haddr_t fh_addr, FILE *stream, int indent, int fwidth /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(fh_addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(H5_addr_defined(fh_addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Load the fractal heap header */ if (NULL == (hdr = H5HF__hdr_protect(f, fh_addr, H5AC__READ_ONLY_FLAG))) diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 0e7b868..32acc42 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -95,7 +95,7 @@ H5HF__man_dblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* * Allocate file and memory data structures. @@ -226,8 +226,8 @@ H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, haddr_t dblock_ /* * Check arguments. */ - HDassert(hdr); - HDassert(dblock); + assert(hdr); + assert(dblock); /* Check for I/O filters on this heap */ if (hdr->filter_len > 0) { @@ -257,11 +257,11 @@ H5HF__man_dblock_destroy(H5HF_hdr_t *hdr, H5HF_direct_t *dblock, haddr_t dblock_ /* Check for root direct block */ if (hdr->man_dtable.curr_root_rows == 0) { /* Sanity check */ - HDassert(hdr->man_dtable.table_addr == dblock_addr); - HDassert(hdr->man_dtable.cparam.start_block_size == dblock->size); + assert(hdr->man_dtable.table_addr == dblock_addr); + assert(hdr->man_dtable.cparam.start_block_size == dblock->size); /* Sanity check block iterator */ - HDassert(!H5HF__man_iter_ready(&hdr->next_block)); + assert(!H5HF__man_iter_ready(&hdr->next_block)); /* Reset header information back to "empty heap" state */ if (H5HF__hdr_empty(hdr) < 0) @@ -338,15 +338,15 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_ /* * Check arguments. */ - HDassert(hdr); - HDassert(request > 0); + assert(hdr); + assert(request > 0); /* Compute the min. size of the direct block needed to fulfill the request */ if (request < hdr->man_dtable.cparam.start_block_size) min_dblock_size = hdr->man_dtable.cparam.start_block_size; else { min_dblock_size = ((size_t)1) << (1 + H5VM_log2_gen((uint64_t)request)); - HDassert(min_dblock_size <= hdr->man_dtable.cparam.max_direct_size); + assert(min_dblock_size <= hdr->man_dtable.cparam.max_direct_size); } /* end else */ /* Adjust the size of block needed to fulfill request, with overhead */ @@ -388,7 +388,7 @@ H5HF__man_dblock_new(H5HF_hdr_t *hdr, size_t request, H5HF_free_section_t **ret_ /* Retrieve information about current iterator position */ if (H5HF__man_iter_curr(&hdr->next_block, &next_row, NULL, &next_entry, &iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to retrieve current block iterator location") - HDassert(next_row < iblock->nrows); + assert(next_row < iblock->nrows); H5_CHECKED_ASSIGN(next_size, size_t, hdr->man_dtable.row_block_size[next_row], hsize_t); /* Check for skipping over blocks */ @@ -439,12 +439,12 @@ H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_addr, size_t dblock_siz /* * Check arguments. */ - HDassert(hdr); - HDassert(H5_addr_defined(dblock_addr)); - HDassert(dblock_size > 0); + assert(hdr); + assert(H5_addr_defined(dblock_addr)); + assert(dblock_size > 0); /* only H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up parent info */ udata.par_info.hdr = hdr; @@ -467,7 +467,7 @@ H5HF__man_dblock_protect(H5HF_hdr_t *hdr, haddr_t dblock_addr, size_t dblock_siz } /* end if */ else { /* Sanity check */ - HDassert(H5_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr)); + assert(H5_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr)); /* Set up parameters to read filtered direct block */ udata.odi_size = par_iblock->filt_ents[par_entry].size; @@ -523,13 +523,13 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_ /* * Check arguments. */ - HDassert(hdr); - HDassert(hdr->man_dtable.curr_root_rows); /* Only works for heaps with indirect root block */ - HDassert(ret_iblock); - HDassert(ret_did_protect); + assert(hdr); + assert(hdr->man_dtable.curr_root_rows); /* Only works for heaps with indirect root block */ + assert(ret_iblock); + assert(ret_did_protect); /* only H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Look up row & column for object */ if (H5HF__dtable_lookup(&hdr->man_dtable, obj_off, &row, &col) < 0) @@ -552,7 +552,7 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_ /* Compute # of rows in child indirect block */ nrows = (H5VM_log2_gen(hdr->man_dtable.row_block_size[row]) - hdr->man_dtable.first_row_bits) + 1; - HDassert(nrows < iblock->nrows); /* child must be smaller than parent */ + assert(nrows < iblock->nrows); /* child must be smaller than parent */ /* Compute indirect block's entry */ entry = (row * hdr->man_dtable.cparam.width) + col; @@ -585,8 +585,8 @@ H5HF__man_dblock_locate(H5HF_hdr_t *hdr, hsize_t obj_off, H5HF_indirect_t **ret_ /* Look up row & column in new indirect block for object */ if (H5HF__dtable_lookup(&hdr->man_dtable, (obj_off - iblock->block_off), &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object") - HDassert(row < iblock->nrows); /* child must be smaller than parent */ - } /* end while */ + assert(row < iblock->nrows); /* child must be smaller than parent */ + } /* end while */ /* Set return parameters */ if (ret_entry) @@ -626,9 +626,9 @@ H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size) /* * Check arguments. */ - HDassert(f); - HDassert(H5_addr_defined(dblock_addr)); - HDassert(dblock_size > 0); + assert(f); + assert(H5_addr_defined(dblock_addr)); + assert(dblock_size > 0); /* Check the direct block's status in the metadata cache */ if (H5AC_get_entry_status(f, dblock_addr, &dblock_status) < 0) @@ -637,8 +637,8 @@ H5HF__man_dblock_delete(H5F_t *f, haddr_t dblock_addr, hsize_t dblock_size) /* If the direct block is in the cache, expunge it now */ if (dblock_status & H5AC_ES__IN_CACHE) { /* Sanity checks on direct block */ - HDassert(!(dblock_status & H5AC_ES__IS_PINNED)); - HDassert(!(dblock_status & H5AC_ES__IS_PROTECTED)); + assert(!(dblock_status & H5AC_ES__IS_PINNED)); + assert(!(dblock_status & H5AC_ES__IS_PROTECTED)); /* Evict the direct block from the metadata cache */ if (H5AC_expunge_entry(f, H5AC_FHEAP_DBLOCK, dblock_addr, H5AC__NO_FLAGS_SET) < 0) @@ -688,10 +688,10 @@ H5HF__man_dblock_dest(H5HF_direct_t *dblock) /* * Check arguments. */ - HDassert(dblock); + assert(dblock); /* Decrement reference count on shared fractal heap info */ - HDassert(dblock->hdr != NULL); + assert(dblock->hdr != NULL); if (H5HF__hdr_decr(dblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if (dblock->parent) diff --git a/src/H5HFdtable.c b/src/H5HFdtable.c index 9b971be..c71ed98 100644 --- a/src/H5HFdtable.c +++ b/src/H5HFdtable.c @@ -89,7 +89,7 @@ H5HF__dtable_init(H5HF_dtable_t *dtable) /* * Check arguments. */ - HDassert(dtable); + assert(dtable); /* Compute/cache some values */ dtable->start_bits = H5VM_log2_of2((uint32_t)dtable->cparam.start_block_size); @@ -147,9 +147,9 @@ H5HF__dtable_lookup(const H5HF_dtable_t *dtable, hsize_t off, unsigned *row, uns /* * Check arguments. */ - HDassert(dtable); - HDassert(row); - HDassert(col); + assert(dtable); + assert(row); + assert(col); /* Check for offset in first row */ if (off < dtable->num_id_first_row) { @@ -187,7 +187,7 @@ H5HF__dtable_dest(H5HF_dtable_t *dtable) /* * Check arguments. */ - HDassert(dtable); + assert(dtable); /* Free the block size lookup table for the doubling table */ H5MM_xfree(dtable->row_block_size); @@ -226,7 +226,7 @@ H5HF__dtable_size_to_row(const H5HF_dtable_t *dtable, size_t block_size) /* * Check arguments. */ - HDassert(dtable); + assert(dtable); if (block_size == dtable->cparam.start_block_size) row = 0; @@ -260,7 +260,7 @@ H5HF__dtable_size_to_rows(const H5HF_dtable_t *dtable, hsize_t size) /* * Check arguments. */ - HDassert(dtable); + assert(dtable); rows = (H5VM_log2_gen(size) - dtable->first_row_bits) + 1; @@ -294,8 +294,8 @@ H5HF__dtable_span_size(const H5HF_dtable_t *dtable, unsigned start_row, unsigned /* * Check arguments. */ - HDassert(dtable); - HDassert(num_entries > 0); + assert(dtable); + assert(num_entries > 0); /* Compute starting entry */ start_entry = (start_row * dtable->cparam.width) + start_col; diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 3606619..770f7d6 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -106,7 +106,7 @@ H5HF__hdr_alloc(H5F_t *f) /* * Check arguments. */ - HDassert(f); + assert(f); /* Allocate space for the shared information */ if (NULL == (hdr = H5FL_CALLOC(H5HF_hdr_t))) @@ -152,8 +152,8 @@ H5HF__hdr_compute_free_space(H5HF_hdr_t *hdr, unsigned iblock_row) /* * Check arguments. */ - HDassert(hdr); - HDassert(iblock_row >= hdr->man_dtable.max_direct_rows); + assert(hdr); + assert(iblock_row >= hdr->man_dtable.max_direct_rows); /* Set the free space in direct blocks */ acc_heap_size = 0; @@ -198,7 +198,7 @@ H5HF__hdr_finish_init_phase1(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Compute/cache some values */ hdr->heap_off_size = (uint8_t)H5HF_SIZEOF_OFFSET_BITS(hdr->man_dtable.cparam.max_index); @@ -236,7 +236,7 @@ H5HF__hdr_finish_init_phase2(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Set the free space in direct blocks */ for (u = 0; u < hdr->man_dtable.max_root_rows; u++) { @@ -289,7 +289,7 @@ H5HF__hdr_finish_init(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* First phase of header final initialization */ if (H5HF__hdr_finish_init_phase1(hdr) < 0) @@ -327,8 +327,8 @@ H5HF__hdr_create(H5F_t *f, const H5HF_create_t *cparam) /* * Check arguments. */ - HDassert(f); - HDassert(cparam); + assert(f); + assert(cparam); #ifndef NDEBUG /* Check for valid parameters */ @@ -520,11 +520,11 @@ H5HF__hdr_protect(H5F_t *f, haddr_t addr, unsigned flags) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(H5_addr_defined(addr)); /* only H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Set up userdata for protect call */ cache_udata.f = f; @@ -566,7 +566,7 @@ H5HF__hdr_incr(H5HF_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Mark header as un-evictable when a block is depending on it */ if (hdr->rc == 0) @@ -600,15 +600,15 @@ H5HF__hdr_decr(H5HF_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(hdr->rc); + assert(hdr); + assert(hdr->rc); /* Decrement reference count on shared header */ hdr->rc--; /* Mark header as evictable again when no child blocks depend on it */ if (hdr->rc == 0) { - HDassert(hdr->file_rc == 0); + assert(hdr->file_rc == 0); if (H5AC_unpin_entry(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap header") } /* end if */ @@ -635,7 +635,7 @@ H5HF__hdr_fuse_incr(H5HF_hdr_t *hdr) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Increment file reference count on shared header */ hdr->file_rc++; @@ -661,8 +661,8 @@ H5HF__hdr_fuse_decr(H5HF_hdr_t *hdr) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(hdr); - HDassert(hdr->file_rc); + assert(hdr); + assert(hdr->file_rc); /* Decrement file reference count on shared header */ hdr->file_rc--; @@ -690,7 +690,7 @@ H5HF__hdr_dirty(H5HF_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Resize pinned header in cache if I/O filter is present. */ if (hdr->filter_len > 0) @@ -727,10 +727,10 @@ H5HF__hdr_adj_free(H5HF_hdr_t *hdr, ssize_t amt) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Update heap header */ - HDassert(amt > 0 || hdr->total_man_free >= (hsize_t)-amt); + assert(amt > 0 || hdr->total_man_free >= (hsize_t)-amt); hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + amt); /* Mark heap header as modified */ @@ -763,13 +763,13 @@ H5HF__hdr_adjust_heap(H5HF_hdr_t *hdr, hsize_t new_size, hssize_t extra_free) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Set the total managed space in heap */ hdr->man_size = new_size; /* Adjust the free space in direct blocks */ - HDassert(extra_free > 0 || hdr->total_man_free >= (hsize_t)-extra_free); + assert(extra_free > 0 || hdr->total_man_free >= (hsize_t)-extra_free); hdr->total_man_free = (hsize_t)((hssize_t)hdr->total_man_free + extra_free); /* Mark heap header as modified */ @@ -800,8 +800,8 @@ H5HF__hdr_inc_alloc(H5HF_hdr_t *hdr, size_t alloc_size) /* * Check arguments. */ - HDassert(hdr); - HDassert(alloc_size); + assert(hdr); + assert(alloc_size); /* Update the "allocated" size within the heap */ hdr->man_alloc_size += alloc_size; @@ -831,8 +831,8 @@ H5HF__hdr_start_iter(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, hsize_t curr_off, /* * Check arguments. */ - HDassert(hdr); - HDassert(iblock); + assert(hdr); + assert(iblock); /* Set up "next block" iterator at correct location */ if (H5HF__man_iter_start_entry(hdr, &hdr->next_block, iblock, curr_entry) < 0) @@ -867,7 +867,7 @@ H5HF__hdr_reset_iter(H5HF_hdr_t *hdr, hsize_t curr_off) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Reset "next block" iterator */ if (H5HF__man_iter_reset(&hdr->next_block) < 0) @@ -904,15 +904,15 @@ H5HF__hdr_skip_blocks(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start_e /* * Check arguments. */ - HDassert(hdr); - HDassert(iblock); - HDassert(nentries); + assert(hdr); + assert(iblock); + assert(nentries); /* Compute the span within the heap to skip */ row = start_entry / hdr->man_dtable.cparam.width; col = start_entry % hdr->man_dtable.cparam.width; sect_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries); - HDassert(sect_size > 0); + assert(sect_size > 0); /* Advance the new block iterator */ if (H5HF__hdr_inc_iter(hdr, sect_size, nentries) < 0) @@ -952,8 +952,8 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) /* * Check arguments. */ - HDassert(hdr); - HDassert(min_dblock_size > 0); + assert(hdr); + assert(min_dblock_size > 0); /* Check for creating first indirect block */ if (hdr->man_dtable.curr_root_rows == 0) { @@ -1039,7 +1039,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) if (next_row >= hdr->man_dtable.max_direct_rows) { unsigned child_nrows; /* Number of rows in new indirect block */ - HDassert(!H5_addr_defined(iblock->ents[next_entry].addr)); + assert(!H5_addr_defined(iblock->ents[next_entry].addr)); /* Compute # of rows in next child indirect block to use */ child_nrows = @@ -1055,7 +1055,7 @@ H5HF__hdr_update_iter(H5HF_hdr_t *hdr, size_t min_dblock_size) child_rows_needed = (H5VM_log2_of2((uint32_t)min_dblock_size) - H5VM_log2_of2((uint32_t)hdr->man_dtable.cparam.start_block_size)) + 2; - HDassert(child_rows_needed > child_nrows); + assert(child_rows_needed > child_nrows); child_entry = (next_row + (child_rows_needed - child_nrows)) * hdr->man_dtable.cparam.width; if (child_entry > (iblock->nrows * hdr->man_dtable.cparam.width)) @@ -1145,8 +1145,8 @@ H5HF__hdr_inc_iter(H5HF_hdr_t *hdr, hsize_t adv_size, unsigned nentries) /* * Check arguments. */ - HDassert(hdr); - HDassert(nentries); + assert(hdr); + assert(nentries); /* Advance the iterator for the current location within the indirect block */ if (hdr->next_block.curr) @@ -1187,7 +1187,7 @@ H5HF__hdr_reverse_iter(H5HF_hdr_t *hdr, haddr_t dblock_addr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Initialize block iterator, if necessary */ if (!H5HF__man_iter_ready(&hdr->next_block)) @@ -1333,7 +1333,7 @@ H5HF__hdr_empty(H5HF_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); + assert(hdr); /* Reset block iterator, if necessary */ if (H5HF__man_iter_ready(&hdr->next_block)) @@ -1384,7 +1384,7 @@ H5HF__hdr_free(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Free the block size lookup table for the doubling table */ if (H5HF__dtable_dest(&hdr->man_dtable) < 0) @@ -1425,8 +1425,8 @@ H5HF__hdr_delete(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); - HDassert(!hdr->file_rc); + assert(hdr); + assert(!hdr->file_rc); #ifndef NDEBUG { @@ -1437,8 +1437,8 @@ H5HF__hdr_delete(H5HF_hdr_t *hdr) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "unable to check metadata cache status for heap header") /* Sanity checks on heap header */ - HDassert(hdr_status & H5AC_ES__IN_CACHE); - HDassert(hdr_status & H5AC_ES__IS_PROTECTED); + assert(hdr_status & H5AC_ES__IN_CACHE); + assert(hdr_status & H5AC_ES__IS_PROTECTED); } /* end block */ #endif /* NDEBUG */ diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index d4bfb21..84eb120 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -98,7 +98,7 @@ H5HF__huge_bt2_create(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Compute the size of 'raw' records on disk */ /* (Note: the size for huge IDs could be set to 'huge_id_size', instead @@ -176,7 +176,7 @@ H5HF__huge_init(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Compute information about 'huge' objects for the heap */ @@ -248,7 +248,7 @@ H5HF__huge_new_id(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Check for wrapping around 'huge' object ID space */ if (hdr->huge_ids_wrapped) @@ -298,10 +298,10 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id) /* * Check arguments. */ - HDassert(hdr); - HDassert(obj_size > hdr->max_man_size); - HDassert(obj); - HDassert(id); + assert(hdr); + assert(obj_size > hdr->max_man_size); + assert(obj); + assert(id); /* Check if the v2 B-tree for tracking 'huge' heap objects has been created yet */ if (!H5_addr_defined(hdr->huge_bt2_addr)) { @@ -319,7 +319,7 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id) "unable to open v2 B-tree for tracking 'huge' heap objects") } /* end if */ } /* end else */ - HDassert(hdr->huge_bt2); + assert(hdr->huge_bt2); /* Check for I/O pipeline filter on heap */ if (hdr->filter_len > 0) { @@ -360,7 +360,7 @@ H5HF__huge_insert(H5HF_hdr_t *hdr, size_t obj_size, void *obj, void *_id) /* Release buffer for writing, if we had one */ if (write_buf != obj) { - HDassert(hdr->filter_len > 0); + assert(hdr->filter_len > 0); H5MM_xfree(write_buf); } /* end if */ @@ -479,10 +479,10 @@ H5HF__huge_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) /* * Check arguments. */ - HDassert(hdr); - HDassert(H5_addr_defined(hdr->huge_bt2_addr)); - HDassert(id); - HDassert(obj_len_p); + assert(hdr); + assert(H5_addr_defined(hdr->huge_bt2_addr)); + assert(id); + assert(obj_len_p); /* Skip over the flag byte */ id++; @@ -577,10 +577,10 @@ H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p) /* * Check arguments. */ - HDassert(hdr); - HDassert(H5_addr_defined(hdr->huge_bt2_addr)); - HDassert(id); - HDassert(obj_off_p); + assert(hdr); + assert(H5_addr_defined(hdr->huge_bt2_addr)); + assert(id); + assert(obj_off_p); /* Skip over the flag byte */ id++; @@ -594,7 +594,7 @@ H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off_p) hbool_t found = FALSE; /* Whether entry was found */ /* Sanity check */ - HDassert(H5_addr_defined(hdr->huge_bt2_addr)); + assert(H5_addr_defined(hdr->huge_bt2_addr)); /* Check if v2 B-tree is open yet */ if (NULL == hdr->huge_bt2) { @@ -672,9 +672,9 @@ H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, H5HF_ope /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(is_read || op); + assert(hdr); + assert(id); + assert(is_read || op); /* Skip over the flag byte */ id++; @@ -693,7 +693,7 @@ H5HF__huge_op_real(H5HF_hdr_t *hdr, const uint8_t *id, hbool_t is_read, H5HF_ope hbool_t found = FALSE; /* Whether entry was found */ /* Sanity check */ - HDassert(H5_addr_defined(hdr->huge_bt2_addr)); + assert(H5_addr_defined(hdr->huge_bt2_addr)); /* Check if v2 B-tree is open yet */ if (NULL == hdr->huge_bt2) { @@ -821,9 +821,9 @@ H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) FUNC_ENTER_PACKAGE - HDassert(hdr); - HDassert(id); - HDassert(obj); + assert(hdr); + assert(id); + assert(obj); /* Check for filters on the heap */ if (hdr->filter_len > 0) @@ -844,7 +844,7 @@ H5HF__huge_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) hbool_t found = FALSE; /* Whether entry was found */ /* Sanity check */ - HDassert(H5_addr_defined(hdr->huge_bt2_addr)); + assert(H5_addr_defined(hdr->huge_bt2_addr)); /* Check if v2 B-tree is open yet */ if (NULL == hdr->huge_bt2) { @@ -899,9 +899,9 @@ H5HF__huge_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(obj); + assert(hdr); + assert(id); + assert(obj); /* Call the internal 'op' routine */ if (H5HF__huge_op_real(hdr, id, TRUE, NULL, obj) < 0) @@ -933,9 +933,9 @@ H5HF__huge_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_d /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(op); + assert(hdr); + assert(id); + assert(op); /* Call the internal 'op' routine routine */ if (H5HF__huge_op_real(hdr, id, FALSE, op, op_data) < 0) @@ -968,9 +968,9 @@ H5HF__huge_remove(H5HF_hdr_t *hdr, const uint8_t *id) /* * Check arguments. */ - HDassert(hdr); - HDassert(H5_addr_defined(hdr->huge_bt2_addr)); - HDassert(id); + assert(hdr); + assert(H5_addr_defined(hdr->huge_bt2_addr)); + assert(id); /* Check if v2 B-tree is open yet */ if (NULL == hdr->huge_bt2) { @@ -1074,12 +1074,12 @@ H5HF__huge_term(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Check if v2 B-tree index is open */ if (hdr->huge_bt2) { /* Sanity check */ - HDassert(H5_addr_defined(hdr->huge_bt2_addr)); + assert(H5_addr_defined(hdr->huge_bt2_addr)); /* Close v2 B-tree index */ if (H5B2_close(hdr->huge_bt2) < 0) @@ -1092,7 +1092,7 @@ H5HF__huge_term(H5HF_hdr_t *hdr) */ if (H5_addr_defined(hdr->huge_bt2_addr) && hdr->huge_nobjs == 0) { /* Sanity check */ - HDassert(hdr->huge_size == 0); + assert(hdr->huge_size == 0); /* Delete the v2 B-tree */ /* (any v2 B-tree class will work here) */ @@ -1138,10 +1138,10 @@ H5HF__huge_delete(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); - HDassert(H5_addr_defined(hdr->huge_bt2_addr)); - HDassert(hdr->huge_nobjs); - HDassert(hdr->huge_size); + assert(hdr); + assert(H5_addr_defined(hdr->huge_bt2_addr)); + assert(hdr->huge_nobjs); + assert(hdr->huge_size); /* Set up the callback info */ udata.hdr = hdr; diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index fcd46f6..a6cf1b9 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -101,7 +101,7 @@ H5HF__iblock_pin(H5HF_indirect_t *iblock) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(iblock); + assert(iblock); /* Mark block as un-evictable */ if (H5AC_pin_protected_entry(iblock) < 0) @@ -113,27 +113,27 @@ H5HF__iblock_pin(H5HF_indirect_t *iblock) unsigned indir_idx; /* Index in parent's child iblock pointer array */ /* Sanity check */ - HDassert(par_iblock->child_iblocks); - HDassert(iblock->par_entry >= - (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width)); + assert(par_iblock->child_iblocks); + assert(iblock->par_entry >= + (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width)); /* Compute index in parent's child iblock pointer array */ indir_idx = iblock->par_entry - (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width); /* Set pointer to pinned indirect block in parent */ - HDassert(par_iblock->child_iblocks[indir_idx] == NULL); + assert(par_iblock->child_iblocks[indir_idx] == NULL); par_iblock->child_iblocks[indir_idx] = iblock; } /* end if */ else { /* Check for pinning the root indirect block */ if (iblock->block_off == 0) { /* Sanity check - shouldn't be recursively pinning root indirect block */ - HDassert(0 == (iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED)); + assert(0 == (iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED)); /* Check if we should set the root iblock pointer */ if (0 == iblock->hdr->root_iblock_flags) { - HDassert(NULL == iblock->hdr->root_iblock); + assert(NULL == iblock->hdr->root_iblock); iblock->hdr->root_iblock = iblock; } /* end if */ @@ -166,7 +166,7 @@ H5HF__iblock_unpin(H5HF_indirect_t *iblock) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(iblock); + assert(iblock); /* Mark block as evictable again */ if (H5AC_unpin_entry(iblock) < 0) @@ -196,8 +196,8 @@ H5HF__iblock_incr(H5HF_indirect_t *iblock) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(iblock); - HDassert(iblock->block_off == 0 || iblock->parent); + assert(iblock); + assert(iblock->block_off == 0 || iblock->parent); /* Mark block as un-evictable when a child block is depending on it */ if (iblock->rc == 0) @@ -231,7 +231,7 @@ H5HF__iblock_decr(H5HF_indirect_t *iblock) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(iblock); + assert(iblock); /* Decrement reference count on shared indirect block */ iblock->rc--; @@ -245,27 +245,27 @@ H5HF__iblock_decr(H5HF_indirect_t *iblock) unsigned indir_idx; /* Index in parent's child iblock pointer array */ /* Sanity check */ - HDassert(par_iblock->child_iblocks); - HDassert(iblock->par_entry >= - (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width)); + assert(par_iblock->child_iblocks); + assert(iblock->par_entry >= + (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width)); /* Compute index in parent's child iblock pointer array */ indir_idx = iblock->par_entry - (iblock->hdr->man_dtable.max_direct_rows * iblock->hdr->man_dtable.cparam.width); /* Reset pointer to pinned child indirect block in parent */ - HDassert(par_iblock->child_iblocks[indir_idx]); + assert(par_iblock->child_iblocks[indir_idx]); par_iblock->child_iblocks[indir_idx] = NULL; } /* end if */ else { /* Check for root indirect block */ if (iblock->block_off == 0) { /* Sanity check - shouldn't be recursively unpinning root indirect block */ - HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED); + assert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED); /* Check if we should reset the root iblock pointer */ if (H5HF_ROOT_IBLOCK_PINNED == iblock->hdr->root_iblock_flags) { - HDassert(NULL != iblock->hdr->root_iblock); + assert(NULL != iblock->hdr->root_iblock); iblock->hdr->root_iblock = NULL; } /* end if */ @@ -311,7 +311,7 @@ H5HF__iblock_dirty(H5HF_indirect_t *iblock) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(iblock); + assert(iblock); /* Mark indirect block as dirty in cache */ if (H5AC_mark_entry_dirty(iblock) < 0) @@ -509,8 +509,8 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) next_size = hdr->man_dtable.row_block_size[next_row]; /* Make certain the iterator is at the root indirect block */ - HDassert(iblock->parent == NULL); - HDassert(iblock->block_off == 0); + assert(iblock->parent == NULL); + assert(iblock->block_off == 0); /* Keep this for later */ old_nrows = iblock->nrows; @@ -518,7 +518,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) /* Check for skipping over direct block rows */ if (iblock->nrows < hdr->man_dtable.max_direct_rows && min_dblock_size > next_size) { /* Sanity check */ - HDassert(min_dblock_size > hdr->man_dtable.cparam.start_block_size); + assert(min_dblock_size > hdr->man_dtable.cparam.start_block_size); /* Set flag */ skip_direct_rows = TRUE; @@ -595,7 +595,7 @@ H5HF__man_iblock_root_double(H5HF_hdr_t *hdr, size_t min_dblock_size) /* Compute the number of direct rows for this indirect block */ dir_rows = MIN(iblock->nrows, hdr->man_dtable.max_direct_rows); - HDassert(dir_rows > old_nrows); + assert(dir_rows > old_nrows); /* Re-allocate filtered direct block entry array */ if (NULL == (iblock->filt_ents = H5FL_SEQ_REALLOC(H5HF_indirect_filt_ent_t, iblock->filt_ents, @@ -681,9 +681,9 @@ H5HF__man_iblock_root_halve(H5HF_indirect_t *iblock) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(iblock); - HDassert(iblock->parent == NULL); - HDassert(hdr); + assert(iblock); + assert(iblock->parent == NULL); + assert(hdr); /* Compute maximum row used by child of indirect block */ max_child_row = iblock->max_child / hdr->man_dtable.cparam.width; @@ -813,7 +813,7 @@ H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock) /* * Check arguments. */ - HDassert(root_iblock); + assert(root_iblock); /* Set up local convenience variables */ hdr = root_iblock->hdr; @@ -824,8 +824,8 @@ H5HF__man_iblock_root_revert(H5HF_indirect_t *root_iblock) if (NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, root_iblock, 0, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") - HDassert(dblock->parent == root_iblock); - HDassert(dblock->par_entry == 0); + assert(dblock->parent == root_iblock); + assert(dblock->par_entry == 0); /* Check for I/O filters on this heap */ if (hdr->filter_len > 0) { @@ -903,9 +903,9 @@ H5HF__man_iblock_alloc_row(H5HF_hdr_t *hdr, H5HF_free_section_t **sec_node) /* * Check arguments. */ - HDassert(hdr); - HDassert(sec_node && old_sec_node); - HDassert(old_sec_node->u.row.row < hdr->man_dtable.max_direct_rows); + assert(hdr); + assert(sec_node && old_sec_node); + assert(old_sec_node->u.row.row < hdr->man_dtable.max_direct_rows); /* Check for serialized row section, or serialized / deleted indirect * section under it. */ @@ -968,9 +968,9 @@ H5HF__man_iblock_create(H5HF_hdr_t *hdr, H5HF_indirect_t *par_iblock, unsigned p /* * Check arguments. */ - HDassert(hdr); - HDassert(nrows > 0); - HDassert(addr_p); + assert(hdr); + assert(nrows > 0); + assert(addr_p); /* * Allocate file and memory data structures. @@ -1118,13 +1118,13 @@ H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_n /* * Check arguments. */ - HDassert(hdr); - HDassert(H5_addr_defined(iblock_addr)); - HDassert(iblock_nrows > 0); - HDassert(did_protect); + assert(hdr); + assert(H5_addr_defined(iblock_addr)); + assert(iblock_nrows > 0); + assert(did_protect); /* only H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Check if we are allowed to use existing pinned iblock pointer */ if (!must_protect) { @@ -1133,8 +1133,8 @@ H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_n unsigned indir_idx; /* Index in parent's child iblock pointer array */ /* Sanity check */ - HDassert(par_iblock->child_iblocks); - HDassert(par_entry >= (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width)); + assert(par_iblock->child_iblocks); + assert(par_entry >= (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width)); /* Compute index in parent's child iblock pointer array */ indir_idx = par_entry - (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width); @@ -1151,14 +1151,14 @@ H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_n /* Check for valid pointer to pinned indirect block in root */ if (H5HF_ROOT_IBLOCK_PINNED == hdr->root_iblock_flags) { /* Sanity check */ - HDassert(NULL != hdr->root_iblock); + assert(NULL != hdr->root_iblock); /* Return the pointer to the pinned root indirect block */ iblock = hdr->root_iblock; } /* end if */ else { /* Sanity check */ - HDassert(NULL == hdr->root_iblock); + assert(NULL == hdr->root_iblock); should_protect = TRUE; } /* end else */ @@ -1193,11 +1193,11 @@ H5HF__man_iblock_protect(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_n /* Check for root indirect block */ if (iblock->block_off == 0) { /* Sanity check - shouldn't be recursively protecting root indirect block */ - HDassert(0 == (hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PROTECTED)); + assert(0 == (hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PROTECTED)); /* Check if we should set the root iblock pointer */ if (0 == hdr->root_iblock_flags) { - HDassert(NULL == hdr->root_iblock); + assert(NULL == hdr->root_iblock); hdr->root_iblock = iblock; } /* end if */ @@ -1241,7 +1241,7 @@ H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, hbool_ /* * Check arguments. */ - HDassert(iblock); + assert(iblock); /* Check if we previously protected this indirect block */ /* (as opposed to using an existing pointer to a pinned child indirect block) */ @@ -1249,11 +1249,11 @@ H5HF__man_iblock_unprotect(H5HF_indirect_t *iblock, unsigned cache_flags, hbool_ /* Check for root indirect block */ if (iblock->block_off == 0) { /* Sanity check - shouldn't be recursively unprotecting root indirect block */ - HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PROTECTED); + assert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PROTECTED); /* Check if we should reset the root iblock pointer */ if (H5HF_ROOT_IBLOCK_PROTECTED == iblock->hdr->root_iblock_flags) { - HDassert(NULL != iblock->hdr->root_iblock); + assert(NULL != iblock->hdr->root_iblock); iblock->hdr->root_iblock = NULL; } /* end if */ @@ -1292,9 +1292,9 @@ H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_a /* * Check arguments. */ - HDassert(iblock); - HDassert(H5_addr_defined(child_addr)); - HDassert(!H5_addr_defined(iblock->ents[entry].addr)); + assert(iblock); + assert(H5_addr_defined(child_addr)); + assert(!H5_addr_defined(iblock->ents[entry].addr)); /* Increment the reference count on this indirect block */ if (H5HF__iblock_incr(iblock) < 0) @@ -1308,7 +1308,7 @@ H5HF__man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_a unsigned row; /* Row for entry */ /* Sanity check */ - HDassert(iblock->filt_ents); + assert(iblock->filt_ents); /* Compute row for entry */ row = entry / iblock->hdr->man_dtable.cparam.width; @@ -1358,8 +1358,8 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) /* * Check arguments. */ - HDassert(iblock); - HDassert(iblock->nchildren); + assert(iblock); + assert(iblock->nchildren); /* Set up convenience variables */ hdr = iblock->hdr; @@ -1373,7 +1373,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) /* Check for I/O filters on this heap */ if (hdr->filter_len > 0) { /* Sanity check */ - HDassert(iblock->filt_ents); + assert(iblock->filt_ents); /* If this is a direct block, reset its initial size */ if (row < hdr->man_dtable.max_direct_rows) { @@ -1387,13 +1387,13 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) unsigned indir_idx; /* Index in parent's child iblock pointer array */ /* Sanity check */ - HDassert(iblock->child_iblocks); + assert(iblock->child_iblocks); /* Compute index in child iblock pointer array */ indir_idx = entry - (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width); /* Sanity check */ - HDassert(iblock->child_iblocks[indir_idx]); + assert(iblock->child_iblocks[indir_idx]); /* Reset pointer to child indirect block in parent */ iblock->child_iblocks[indir_idx] = NULL; @@ -1470,7 +1470,7 @@ H5HF__man_iblock_detach(H5HF_indirect_t *iblock, unsigned entry) iblock->parent, iblock->par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") - HDassert(did_protect == TRUE); + assert(did_protect == TRUE); /* Check for deleting root indirect block (and no root direct block) */ if (iblock->block_off == 0 && hdr->man_dtable.curr_root_rows > 0) @@ -1570,8 +1570,8 @@ H5HF__man_iblock_entry_addr(H5HF_indirect_t *iblock, unsigned entry, haddr_t *ch /* * Check arguments. */ - HDassert(iblock); - HDassert(child_addr); + assert(iblock); + assert(child_addr); /* Retrieve address of entry */ *child_addr = iblock->ents[entry].addr; @@ -1611,16 +1611,16 @@ H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nr /* * Check arguments. */ - HDassert(hdr); - HDassert(H5_addr_defined(iblock_addr)); - HDassert(iblock_nrows > 0); + assert(hdr); + assert(H5_addr_defined(iblock_addr)); + assert(iblock_nrows > 0); /* Lock indirect block */ if (NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, iblock_nrows, par_iblock, par_entry, TRUE, H5AC__NO_FLAGS_SET, &did_protect))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap indirect block") - HDassert(iblock->nchildren > 0); - HDassert(did_protect == TRUE); + assert(iblock->nchildren > 0); + assert(did_protect == TRUE); /* Iterate over rows in this indirect block */ entry = 0; @@ -1674,7 +1674,7 @@ H5HF__man_iblock_delete(H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned iblock_nr "unable to check metadata cache status for indirect block") /* Check if indirect block is pinned */ - HDassert(!(iblock_status & H5AC_ES__IS_PINNED)); + assert(!(iblock_status & H5AC_ES__IS_PINNED)); } #endif /* NDEBUG */ @@ -1720,10 +1720,10 @@ H5HF__man_iblock_size(H5F_t *f, H5HF_hdr_t *hdr, haddr_t iblock_addr, unsigned n /* * Check arguments. */ - HDassert(f); - HDassert(hdr); - HDassert(H5_addr_defined(iblock_addr)); - HDassert(heap_size); + assert(f); + assert(hdr); + assert(H5_addr_defined(iblock_addr)); + assert(heap_size); /* Protect the indirect block */ if (NULL == (iblock = H5HF__man_iblock_protect(hdr, iblock_addr, nrows, par_iblock, par_entry, FALSE, @@ -1797,16 +1797,16 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, hsize_t * /* * Check arguments. */ - HDassert(hdr); - HDassert(block_off > 0); - HDassert(ret_entry); + assert(hdr); + assert(block_off > 0); + assert(ret_entry); /* Look up row & column for object */ if (H5HF__dtable_lookup(&hdr->man_dtable, block_off, &row, &col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of block") /* Sanity check - first lookup must be an indirect block */ - HDassert(row >= hdr->man_dtable.max_direct_rows); + assert(row >= hdr->man_dtable.max_direct_rows); /* Traverse down, until a direct block at the offset is found, then * use previous (i.e. parent's) offset, row, and column. @@ -1831,8 +1831,8 @@ H5HF__man_iblock_parent_info(const H5HF_hdr_t *hdr, hsize_t block_off, hsize_t * } /* end while */ /* Sanity check */ - HDassert(row == 0); - HDassert(col == 0); + assert(row == 0); + assert(col == 0); /* Set return parameters */ *ret_par_block_off = prev_par_block_off; @@ -1864,11 +1864,11 @@ H5HF__man_iblock_dest(H5HF_indirect_t *iblock) /* * Check arguments. */ - HDassert(iblock); - HDassert(iblock->rc == 0); + assert(iblock); + assert(iblock->rc == 0); /* Decrement reference count on shared info */ - HDassert(iblock->hdr); + assert(iblock->hdr); if (H5HF__hdr_decr(iblock->hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on shared heap header") if (iblock->parent) diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 7794eaf..1fd7932 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -88,7 +88,7 @@ H5HF__man_iter_init(H5HF_block_iter_t *biter) /* * Check arguments. */ - HDassert(biter); + assert(biter); /* Reset block iterator information */ HDmemset(biter, 0, sizeof(H5HF_block_iter_t)); @@ -128,11 +128,11 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t o /* * Check arguments. */ - HDassert(biter); - HDassert(!biter->ready); + assert(biter); + assert(!biter->ready); /* Check for empty heap */ - HDassert(offset >= hdr->man_dtable.cparam.start_block_size); + assert(offset >= hdr->man_dtable.cparam.start_block_size); /* Allocate level structure */ if (NULL == (biter->curr = H5FL_MALLOC(H5HF_block_loc_t))) @@ -225,7 +225,7 @@ H5HF__man_iter_start_offset(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, hsize_t o /* Or, if the offset has just filled up a direct or indirect block */ if (curr_offset == (col * hdr->man_dtable.row_block_size[row]) || row < hdr->man_dtable.max_direct_rows) { - HDassert(curr_offset - (col * hdr->man_dtable.row_block_size[row]) == 0); + assert(curr_offset - (col * hdr->man_dtable.row_block_size[row]) == 0); break; /* Done now */ } /* end if */ /* Indirect block row */ @@ -275,7 +275,7 @@ H5HF__man_iter_set_entry(const H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsign /* * Check arguments. */ - HDassert(biter); + assert(biter); /* Set location context */ biter->curr->entry = entry; @@ -310,10 +310,10 @@ H5HF__man_iter_start_entry(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, H5HF_indir /* * Check arguments. */ - HDassert(hdr); - HDassert(biter); - HDassert(!biter->ready); - HDassert(iblock); + assert(hdr); + assert(biter); + assert(!biter->ready); + assert(iblock); /* Create new location for iterator */ if (NULL == (new_loc = H5FL_MALLOC(H5HF_block_loc_t))) @@ -367,7 +367,7 @@ H5HF__man_iter_reset(H5HF_block_iter_t *biter) /* * Check arguments. */ - HDassert(biter); + assert(biter); /* Free any location contexts that exist */ if (biter->curr) { @@ -424,16 +424,16 @@ H5HF__man_iter_next(H5HF_hdr_t *hdr, H5HF_block_iter_t *biter, unsigned nentries /* * Check arguments. */ - HDassert(biter); - HDassert(biter->curr); - HDassert(biter->curr->context); - HDassert(biter->curr->row < biter->curr->context->nrows); + assert(biter); + assert(biter->curr); + assert(biter->curr->context); + assert(biter->curr->row < biter->curr->context->nrows); /* Advance entry in current block */ biter->curr->entry += nentries; biter->curr->row = biter->curr->entry / hdr->man_dtable.cparam.width; biter->curr->col = biter->curr->entry % hdr->man_dtable.cparam.width; - /* HDassert(biter->curr->row <= biter->curr->context->nrows); */ + /* assert(biter->curr->row <= biter->curr->context->nrows); */ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5HF__man_iter_next() */ @@ -461,11 +461,11 @@ H5HF__man_iter_up(H5HF_block_iter_t *biter) /* * Check arguments. */ - HDassert(biter); - HDassert(biter->ready); - HDassert(biter->curr); - HDassert(biter->curr->up); - HDassert(biter->curr->context); + assert(biter); + assert(biter->ready); + assert(biter->curr); + assert(biter->curr->up); + assert(biter->curr->context); /* Release hold on current location's indirect block */ if (H5HF__iblock_decr(biter->curr->context) < 0) @@ -507,10 +507,10 @@ H5HF__man_iter_down(H5HF_block_iter_t *biter, H5HF_indirect_t *iblock) /* * Check arguments. */ - HDassert(biter); - HDassert(biter->ready); - HDassert(biter->curr); - HDassert(biter->curr->context); + assert(biter); + assert(biter->ready); + assert(biter->curr); + assert(biter->curr->context); /* Create new location to move down to */ if (NULL == (down_loc = H5FL_MALLOC(H5HF_block_loc_t))) @@ -559,8 +559,8 @@ H5HF__man_iter_curr(H5HF_block_iter_t *biter, unsigned *row, unsigned *col, unsi /* * Check arguments. */ - HDassert(biter); - HDassert(biter->ready); + assert(biter); + assert(biter->ready); /* Retrieve the information asked for */ if (row) @@ -595,7 +595,7 @@ H5HF__man_iter_ready(H5HF_block_iter_t *biter) /* * Check arguments. */ - HDassert(biter); + assert(biter); FUNC_LEAVE_NOAPI(biter->ready) } /* end H5HF__man_iter_ready() */ diff --git a/src/H5HFman.c b/src/H5HFman.c index 25537bb..2d0aed3 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -109,10 +109,10 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) /* * Check arguments. */ - HDassert(hdr); - HDassert(obj_size > 0); - HDassert(obj); - HDassert(id); + assert(hdr); + assert(obj_size > 0); + assert(obj); + assert(id); /* Check pipeline */ H5HF_MAN_WRITE_CHECK_PLINE(hdr) @@ -135,13 +135,13 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) if (H5HF__man_iblock_alloc_row(hdr, &sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't break up row section") } /* end if */ - HDassert(sec_node->sect_info.type == H5HF_FSPACE_SECT_SINGLE); + assert(sec_node->sect_info.type == H5HF_FSPACE_SECT_SINGLE); /* Check for 'single' section being serialized */ if (sec_node->sect_info.state == H5FS_SECT_SERIALIZED) if (H5HF__sect_single_revive(hdr, sec_node) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't revive single free section") - HDassert(sec_node->sect_info.state == H5FS_SECT_LIVE); + assert(sec_node->sect_info.state == H5FS_SECT_LIVE); /* Retrieve direct block address from section */ if (H5HF__sect_single_dblock_info(hdr, sec_node, &dblock_addr, &dblock_size) < 0) @@ -159,7 +159,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) blk_off = (size_t)(sec_node->sect_info.addr - dblock->block_off); /* Sanity checks */ - HDassert(sec_node->sect_info.size >= obj_size); + assert(sec_node->sect_info.size >= obj_size); /* Reduce (& possibly re-add) single section */ if (H5HF__sect_single_reduce(hdr, sec_node, obj_size) < 0) @@ -178,7 +178,7 @@ H5HF__man_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) p += obj_size; /* Sanity check */ - HDassert((size_t)(p - (dblock->blk + blk_off)) == obj_size); + assert((size_t)(p - (dblock->blk + blk_off)) == obj_size); } /* end block */ /* Set the heap ID for the new object (heap offset & obj length) */ @@ -225,9 +225,9 @@ H5HF__man_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(obj_len_p); + assert(hdr); + assert(id); + assert(obj_len_p); /* Skip over the flag byte */ id++; @@ -261,9 +261,9 @@ H5HF__man_get_obj_off(const H5HF_hdr_t *hdr, const uint8_t *id, hsize_t *obj_off /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(obj_off_p); + assert(hdr); + assert(id); + assert(obj_off_p); /* Skip over the flag byte */ id++; @@ -310,9 +310,9 @@ H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void * /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(op); + assert(hdr); + assert(id); + assert(op); /* Set the access mode for the direct block */ if (op_flags & H5HF_OP_MODIFY) { @@ -400,7 +400,7 @@ H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void * } /* end else */ /* Compute offset of object within block */ - HDassert((obj_off - dblock->block_off) < (hsize_t)dblock_size); + assert((obj_off - dblock->block_off) < (hsize_t)dblock_size); blk_off = (size_t)(obj_off - dblock->block_off); /* Check for object's offset in the direct block prefix information */ @@ -448,9 +448,9 @@ H5HF__man_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(obj); + assert(hdr); + assert(id); + assert(obj); /* Call the internal 'op' routine routine */ if (H5HF__man_op_real(hdr, id, H5HF__op_read, obj, 0) < 0) @@ -482,9 +482,9 @@ H5HF__man_write(H5HF_hdr_t *hdr, const uint8_t *id, const void *obj) /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(obj); + assert(hdr); + assert(id); + assert(obj); /* Call the internal 'op' routine routine * @@ -523,9 +523,9 @@ H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_da /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(op); + assert(hdr); + assert(id); + assert(op); /* Call the internal 'op' routine routine */ if (H5HF__man_op_real(hdr, id, op, op_data, 0) < 0) @@ -566,8 +566,8 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) /* * Check arguments. */ - HDassert(hdr); - HDassert(id); + assert(hdr); + assert(id); /* Check pipeline */ H5HF_MAN_WRITE_CHECK_PLINE(hdr) @@ -622,7 +622,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) } /* end else */ /* Compute offset of object within block */ - HDassert((obj_off - dblock_block_off) < (hsize_t)dblock_size); + assert((obj_off - dblock_block_off) < (hsize_t)dblock_size); blk_off = (size_t)(obj_off - dblock_block_off); /* Check for object's offset in the direct block prefix information */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index fae6f1d..6624bdb 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -297,8 +297,8 @@ H5FS__sect_init_cls(H5FS_section_class_t *cls, H5HF_hdr_t *hdr) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(cls); - HDassert(!cls->cls_private); + assert(cls); + assert(!cls->cls_private); /* Allocate & initialize the class-private (i.e. private shared) information * for this type of section @@ -338,7 +338,7 @@ H5FS__sect_term_cls(H5FS_section_class_t *cls) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(cls); + assert(cls); /* Get pointer to class private info */ cls_prvt = (H5HF_sect_private_t *)cls->cls_private; @@ -377,7 +377,7 @@ H5FS__sect_node_new(unsigned sect_type, haddr_t sect_addr, hsize_t sect_size, H5 FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(H5_addr_defined(sect_addr)); + assert(H5_addr_defined(sect_addr)); /* Create free list section node */ if (NULL == (new_sect = H5FL_MALLOC(H5HF_free_section_t))) @@ -420,7 +420,7 @@ H5HF__sect_node_free(H5HF_free_section_t *sect, H5HF_indirect_t *iblock) FUNC_ENTER_PACKAGE - HDassert(sect); + assert(sect); /* Release indirect block, if there was one */ if (iblock) @@ -458,7 +458,7 @@ H5HF__sect_single_new(hsize_t sect_off, size_t sect_size, H5HF_indirect_t *paren /* * Check arguments. */ - HDassert(sect_size); + assert(sect_size); /* Create free space section node */ if (NULL == @@ -511,9 +511,9 @@ H5HF__sect_single_locate_parent(H5HF_hdr_t *hdr, hbool_t refresh, H5HF_free_sect /* * Check arguments. */ - HDassert(hdr); - HDassert(hdr->man_dtable.curr_root_rows > 0); - HDassert(sect); + assert(hdr); + assert(hdr->man_dtable.curr_root_rows > 0); + assert(sect); /* Look up indirect block containing direct blocks for range */ if (H5HF__man_dblock_locate(hdr, sect->sect_info.addr, &sec_iblock, &sec_entry, &did_protect, @@ -569,14 +569,14 @@ H5HF__sect_single_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) /* * Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(sect->sect_info.state == H5FS_SECT_SERIALIZED); + assert(hdr); + assert(sect); + assert(sect->sect_info.state == H5FS_SECT_SERIALIZED); /* Check for root direct block */ if (hdr->man_dtable.curr_root_rows == 0) { /* Set the information for the section */ - HDassert(H5_addr_defined(hdr->man_dtable.table_addr)); + assert(H5_addr_defined(hdr->man_dtable.table_addr)); sect->u.single.parent = NULL; sect->u.single.par_entry = 0; } /* end if */ @@ -614,17 +614,17 @@ H5HF__sect_single_dblock_info(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, /* * Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); - HDassert(sect->sect_info.state == H5FS_SECT_LIVE); - HDassert(dblock_addr); - HDassert(dblock_size); + assert(hdr); + assert(sect); + assert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); + assert(sect->sect_info.state == H5FS_SECT_LIVE); + assert(dblock_addr); + assert(dblock_size); /* Check for root direct block */ if (hdr->man_dtable.curr_root_rows == 0) { /* Retrieve direct block info from heap header */ - HDassert(H5_addr_defined(hdr->man_dtable.table_addr)); + assert(H5_addr_defined(hdr->man_dtable.table_addr)); *dblock_addr = hdr->man_dtable.table_addr; *dblock_size = hdr->man_dtable.cparam.start_block_size; } /* end if */ @@ -662,10 +662,10 @@ H5HF__sect_single_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, size_t amt) /* * Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); - HDassert(sect->sect_info.state == H5FS_SECT_LIVE); + assert(hdr); + assert(sect); + assert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); + assert(sect->sect_info.state == H5FS_SECT_LIVE); /* Check for eliminating the section */ if (sect->sect_info.size == amt) { @@ -715,9 +715,9 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect); - HDassert(sect->sect_info.state == H5FS_SECT_LIVE); - HDassert(hdr); + assert(sect); + assert(sect->sect_info.state == H5FS_SECT_LIVE); + assert(hdr); /* Retrieve direct block address from section */ if (H5HF__sect_single_dblock_info(hdr, sect, &dblock_addr, &dblock_size) < 0) @@ -733,7 +733,7 @@ H5HF__sect_single_full_dblock(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) if (NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, sect->u.single.parent, sect->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") - HDassert(H5_addr_eq(dblock->block_off + dblock_overhead, sect->sect_info.addr)); + assert(H5_addr_eq(dblock->block_off + dblock_overhead, sect->sect_info.addr)); /* Convert 'single' section into 'row' section */ if (H5HF__sect_row_from_single(hdr, sect, dblock) < 0) @@ -786,8 +786,8 @@ H5HF__sect_single_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ /* Sanity check */ - HDassert(sect); - HDassert(hdr); + assert(sect); + assert(hdr); /* Check if single section covers entire direct block it's in */ /* (converts to row section possibly) */ @@ -830,8 +830,8 @@ H5HF__sect_single_deserialize(const H5FS_section_class_t H5_ATTR_UNUSED *cls, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(H5_addr_defined(sect_addr)); - HDassert(sect_size); + assert(H5_addr_defined(sect_addr)); + assert(sect_size); /* Create free list section node */ if (NULL == @@ -872,10 +872,10 @@ H5HF__sect_single_can_merge(const H5FS_section_info_t *_sect1, const H5FS_sectio FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect1); - HDassert(sect2); - HDassert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ - HDassert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); + assert(sect1); + assert(sect2); + assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ + assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); /* Check if second section adjoins first section */ /* (This can only occur within a direct block, due to the direct block @@ -917,11 +917,11 @@ H5HF__sect_single_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect1); - HDassert((*sect1)->sect_info.type == H5HF_FSPACE_SECT_SINGLE); - HDassert(sect2); - HDassert(sect2->sect_info.type == H5HF_FSPACE_SECT_SINGLE); - HDassert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); + assert(sect1); + assert((*sect1)->sect_info.type == H5HF_FSPACE_SECT_SINGLE); + assert(sect2); + assert(sect2->sect_info.type == H5HF_FSPACE_SECT_SINGLE); + assert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); /* Add second section's size to first section */ (*sect1)->sect_info.size += sect2->sect_info.size; @@ -973,7 +973,7 @@ H5HF__sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect); + assert(sect); /* Check for section occupying entire root direct block */ /* (We shouldn't ever have a single section that occupies an entire @@ -994,7 +994,7 @@ H5HF__sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) /* We shouldn't have a situation where the 'next block' iterator * is moved before a direct block that still has objects within it. */ - HDassert(hdr->man_iter_off > sect->sect_info.addr); + assert(hdr->man_iter_off > sect->sect_info.addr); HGOTO_DONE(FALSE) } /* end else */ @@ -1030,9 +1030,9 @@ H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect); - HDassert(*sect); - HDassert((*sect)->sect_info.type == H5HF_FSPACE_SECT_SINGLE); + assert(sect); + assert(*sect); + assert((*sect)->sect_info.type == H5HF_FSPACE_SECT_SINGLE); /* Check to see if we should revive section */ if ((*sect)->sect_info.state != H5FS_SECT_LIVE) @@ -1045,11 +1045,11 @@ H5HF__sect_single_shrink(H5FS_section_info_t **_sect, void *_udata) /* Protect the direct block for the section */ /* (should be a root direct block) */ - HDassert(dblock_addr == hdr->man_dtable.table_addr); + assert(dblock_addr == hdr->man_dtable.table_addr); if (NULL == (dblock = H5HF__man_dblock_protect(hdr, dblock_addr, dblock_size, (*sect)->u.single.parent, (*sect)->u.single.par_entry, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") - HDassert(H5_addr_eq(dblock->block_off + dblock_size, (*sect)->sect_info.addr + (*sect)->sect_info.size)); + assert(H5_addr_eq(dblock->block_off + dblock_size, (*sect)->sect_info.addr + (*sect)->sect_info.size)); /* Get rid of section */ if (H5HF__sect_single_free((H5FS_section_info_t *)*sect) < 0) @@ -1091,7 +1091,7 @@ H5HF__sect_single_free(H5FS_section_info_t *_sect) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect); + assert(sect); /* Check for live reference to an indirect block */ if (sect->sect_info.state == H5FS_SECT_LIVE) @@ -1128,7 +1128,7 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect); + assert(sect); if (sect->sect_info.state == H5FS_SECT_LIVE) { /* Check if this section is not in a direct block that is the root direct block */ @@ -1143,25 +1143,25 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 /* Sanity check settings for section's direct block's parent */ iblock = sect->u.single.parent; - HDassert(H5_addr_defined(iblock->ents[sect->u.single.par_entry].addr)); + assert(H5_addr_defined(iblock->ents[sect->u.single.par_entry].addr)); /* Retrieve direct block address from section */ status = H5HF__sect_single_dblock_info(iblock->hdr, (const H5HF_free_section_t *)sect, &dblock_addr, &dblock_size); - HDassert(status >= 0); - HDassert(H5_addr_eq(iblock->ents[sect->u.single.par_entry].addr, dblock_addr)); - HDassert(dblock_size > 0); + assert(status >= 0); + assert(H5_addr_eq(iblock->ents[sect->u.single.par_entry].addr, dblock_addr)); + assert(dblock_size > 0); /* Check if the section is actually within the heap */ - HDassert(sect->sect_info.addr < iblock->hdr->man_iter_off); + assert(sect->sect_info.addr < iblock->hdr->man_iter_off); /* Check that the direct block has been merged correctly */ dblock_overhead = H5HF_MAN_ABS_DIRECT_OVERHEAD(iblock->hdr); - HDassert((sect->sect_info.size + dblock_overhead) < dblock_size); + assert((sect->sect_info.size + dblock_overhead) < dblock_size); /* Check the direct block's status in the metadata cache */ status = H5AC_get_entry_status(iblock->hdr->f, dblock_addr, &dblock_status); - HDassert(status >= 0); + assert(status >= 0); /* If the direct block for the section isn't already protected, * protect it here in order to check single section's sanity @@ -1173,19 +1173,19 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 /* Protect the direct block for the section */ dblock = H5HF__man_dblock_protect(iblock->hdr, dblock_addr, dblock_size, iblock, sect->u.single.par_entry, H5AC__READ_ONLY_FLAG); - HDassert(dblock); + assert(dblock); /* Sanity check settings for section */ - HDassert(dblock_size == dblock->size); - HDassert(dblock->size > sect->sect_info.size); - HDassert(H5_addr_lt(dblock->block_off, sect->sect_info.addr)); - HDassert(H5_addr_ge((dblock->block_off + dblock->size), - (sect->sect_info.addr + sect->sect_info.size))); + assert(dblock_size == dblock->size); + assert(dblock->size > sect->sect_info.size); + assert(H5_addr_lt(dblock->block_off, sect->sect_info.addr)); + assert(H5_addr_ge((dblock->block_off + dblock->size), + (sect->sect_info.addr + sect->sect_info.size))); /* Release direct block */ status = H5AC_unprotect(iblock->hdr->f, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET); - HDassert(status >= 0); + assert(status >= 0); } /* end if */ } /* end if */ } /* end if */ @@ -1217,9 +1217,9 @@ H5HF__sect_row_create(haddr_t sect_off, hsize_t sect_size, hbool_t is_first, uns FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect_size); - HDassert(nentries); - HDassert(under_sect); + assert(sect_size); + assert(nentries); + assert(under_sect); /* Create 'row' free space section node */ /* ("inherits" underlying indirect section's state) */ @@ -1264,9 +1264,9 @@ H5HF__sect_row_from_single(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_dire /* * Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(dblock); + assert(hdr); + assert(sect); + assert(dblock); /* Convert 'single' section information to 'row' section info */ sect->sect_info.addr = dblock->block_off; @@ -1310,9 +1310,9 @@ H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) /* * Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(sect->u.row.under); + assert(hdr); + assert(sect); + assert(sect->u.row.under); /* If the indirect section's iblock has been removed from the cache, but the * section is still marked as "live", switch it to the "serialized" state. @@ -1326,7 +1326,7 @@ H5HF__sect_row_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) /* (which will mark this section as "live") */ if (H5HF__sect_indirect_revive_row(hdr, sect->u.row.under) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREVIVE, FAIL, "can't revive indirect section") - HDassert(sect->sect_info.state == H5FS_SECT_LIVE); + assert(sect->sect_info.state == H5FS_SECT_LIVE); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1357,15 +1357,15 @@ H5HF__sect_row_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned *entr /* * Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW || - sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); - HDassert(sect->sect_info.state == H5FS_SECT_LIVE); - HDassert(entry_p); + assert(hdr); + assert(sect); + assert(sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW || + sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); + assert(sect->sect_info.state == H5FS_SECT_LIVE); + assert(entry_p); /* Mark the row as checked out from the free space manager */ - HDassert(sect->u.row.checked_out == FALSE); + assert(sect->u.row.checked_out == FALSE); sect->u.row.checked_out = TRUE; /* Forward row section to indirect routines, to handle reducing underlying indirect section */ @@ -1427,9 +1427,9 @@ H5HF__sect_row_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(sect); - HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); + assert(hdr); + assert(sect); + assert(sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); /* If the row is already checked out from the free space manager, just * change it's class directly and the free space manager will adjust when @@ -1468,10 +1468,10 @@ H5HF__sect_row_get_iblock(H5HF_free_section_t *sect) /* * Check arguments. */ - HDassert(sect); - HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW || - sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); - HDassert(sect->sect_info.state == H5FS_SECT_LIVE); + assert(sect); + assert(sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW || + sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); + assert(sect->sect_info.state == H5FS_SECT_LIVE); ret_value = H5HF__sect_indirect_get_iblock(sect->u.row.under); @@ -1501,7 +1501,7 @@ H5HF__sect_row_parent_removed(H5HF_free_section_t *sect) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(sect); + assert(sect); /* Get a copy of the indirect block's offset before decrementing refcount on it */ tmp_iblock_off = sect->u.row.under->u.indirect.u.iblock->block_off; @@ -1555,8 +1555,8 @@ H5HF__sect_row_init_cls(H5FS_section_class_t *cls, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(cls); - HDassert(hdr); + assert(cls); + assert(hdr); /* Call common class initialization */ if (H5FS__sect_init_cls(cls, hdr) < 0) @@ -1597,7 +1597,7 @@ H5HF__sect_row_term_cls(H5FS_section_class_t *cls) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(cls); + assert(cls); /* Call common class termination */ if (H5FS__sect_term_cls(cls) < 0) @@ -1631,11 +1631,11 @@ H5HF__sect_row_serialize(const H5FS_section_class_t *cls, const H5FS_section_inf FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(cls); - HDassert(buf); - HDassert(sect); - HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); - HDassert(sect->sect_info.addr == sect->u.row.under->sect_info.addr); + assert(cls); + assert(buf); + assert(sect); + assert(sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); + assert(sect->sect_info.addr == sect->u.row.under->sect_info.addr); /* Forward to indirect routine to serialize underlying section */ hdr = ((H5HF_sect_private_t *)(cls->cls_private))->hdr; @@ -1674,10 +1674,10 @@ H5HF__sect_row_deserialize(const H5FS_section_class_t *cls, const uint8_t *buf, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(cls); - HDassert(buf); - HDassert(H5_addr_defined(sect_addr)); - HDassert(sect_size); + assert(cls); + assert(buf); + assert(H5_addr_defined(sect_addr)); + assert(sect_size); /* Forward to indirect routine to deserialize underlying section */ hdr = ((H5HF_sect_private_t *)(cls->cls_private))->hdr; @@ -1717,17 +1717,17 @@ H5HF__sect_row_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_i FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect1); - HDassert(sect1->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); - HDassert(sect2); - HDassert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ - HDassert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); + assert(sect1); + assert(sect1->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); + assert(sect2); + assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ + assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); /* Get the top indirect section underlying each row */ top_indir_sect1 = H5HF__sect_indirect_top(sect1->u.row.under); - HDassert(top_indir_sect1); + assert(top_indir_sect1); top_indir_sect2 = H5HF__sect_indirect_top(sect2->u.row.under); - HDassert(top_indir_sect2); + assert(top_indir_sect2); /* Check if second section shares the same underlying indirect block as * the first section, but doesn't already have same underlying indirect @@ -1773,10 +1773,10 @@ H5HF__sect_row_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect1); - HDassert((*sect1)->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); - HDassert(sect2); - HDassert(sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); + assert(sect1); + assert((*sect1)->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); + assert(sect2); + assert(sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Check if second section is past end of "next block" iterator */ if (sect2->sect_info.addr >= hdr->man_iter_off) { @@ -1827,8 +1827,8 @@ H5HF__sect_row_can_shrink(const H5FS_section_info_t *_sect, void H5_ATTR_UNUSED FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect); - HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); + assert(sect); + assert(sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Check if section is past end of "next block" iterator */ if (sect->sect_info.addr >= hdr->man_iter_off) @@ -1864,9 +1864,9 @@ H5HF__sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect); - HDassert(*sect); - HDassert((*sect)->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); + assert(sect); + assert(*sect); + assert((*sect)->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Get the top indirect section underlying each row */ top_indir_sect = H5HF__sect_indirect_top((*sect)->u.row.under); @@ -1903,7 +1903,7 @@ H5HF__sect_row_free_real(H5HF_free_section_t *sect) FUNC_ENTER_PACKAGE - HDassert(sect); + assert(sect); /* Release the section */ if (H5HF__sect_node_free(sect, NULL) < 0) @@ -1935,8 +1935,8 @@ H5HF__sect_row_free(H5FS_section_info_t *_sect) FUNC_ENTER_PACKAGE - HDassert(sect); - HDassert(sect->u.row.under); + assert(sect); + assert(sect->u.row.under); /* Decrement the ref. count on the row section's underlying indirect section */ if (H5HF__sect_indirect_decr(sect->u.row.under) < 0) @@ -1975,30 +1975,30 @@ H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t FUNC_ENTER_PACKAGE_NOERR /* Basic sanity check */ - HDassert(cls); - HDassert(sect); + assert(cls); + assert(sect); /* Retrieve class private information */ cls_prvt = (H5HF_sect_private_t *)cls->cls_private; hdr = cls_prvt->hdr; /* Sanity checking on the row */ - HDassert(sect->u.row.under); - HDassert(sect->u.row.num_entries); - HDassert(sect->u.row.checked_out == FALSE); + assert(sect->u.row.under); + assert(sect->u.row.num_entries); + assert(sect->u.row.checked_out == FALSE); indir_sect = sect->u.row.under; indir_idx = sect->u.row.row - indir_sect->u.indirect.row; - HDassert(indir_sect->u.indirect.dir_rows[indir_idx] == sect); + assert(indir_sect->u.indirect.dir_rows[indir_idx] == sect); /* Check if the section is actually within the heap */ - HDassert(sect->sect_info.addr < hdr->man_iter_off); + assert(sect->sect_info.addr < hdr->man_iter_off); /* Different checking for different kinds of rows */ if (sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW) { H5HF_free_section_t *top_indir_sect; /* Top indirect section for row */ /* Some extra sanity checks on the row */ - HDassert(sect->u.row.row == indir_sect->u.indirect.row); + assert(sect->u.row.row == indir_sect->u.indirect.row); /* Get the top indirect section underlying row */ top_indir_sect = H5HF__sect_indirect_top(sect->u.row.under); @@ -2031,7 +2031,7 @@ H5HF__sect_row_debug(const H5FS_section_info_t *_sect, FILE *stream, int indent, FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect); + assert(sect); /* Print indirect section information */ HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Row:", sect->u.row.row); @@ -2071,7 +2071,7 @@ H5HF__sect_indirect_iblock_off(const H5HF_free_section_t *sect) /* * Check arguments. */ - HDassert(sect); + assert(sect); ret_value = sect->sect_info.state == H5FS_SECT_LIVE ? sect->u.indirect.u.iblock->block_off : sect->u.indirect.u.iblock_off; @@ -2101,7 +2101,7 @@ H5HF__sect_indirect_top(H5HF_free_section_t *sect) /* * Check arguments. */ - HDassert(sect); + assert(sect); if (sect->u.indirect.parent) ret_value = H5HF__sect_indirect_top(sect->u.indirect.parent); @@ -2134,8 +2134,8 @@ H5HF__sect_indirect_init_cls(H5FS_section_class_t *cls, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(cls); - HDassert(hdr); + assert(cls); + assert(hdr); /* Call to common class initialization */ if (H5FS__sect_init_cls(cls, hdr) < 0) @@ -2170,7 +2170,7 @@ H5HF__sect_indirect_term_cls(H5FS_section_class_t *cls) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(cls); + assert(cls); /* Call common class termination */ if (H5FS__sect_term_cls(cls) < 0) @@ -2205,8 +2205,8 @@ H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5 /* * Check arguments. */ - HDassert(hdr); - HDassert(nentries); + assert(hdr); + assert(nentries); /* Create free space section node */ if (NULL == (sect = H5FS__sect_node_new(H5HF_FSPACE_SECT_INDIRECT, sect_off, sect_size, @@ -2231,7 +2231,7 @@ H5HF__sect_indirect_new(H5HF_hdr_t *hdr, haddr_t sect_off, hsize_t sect_size, H5 /* Compute span size of indirect section */ sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, row, col, nentries); - HDassert(sect->u.indirect.span_size > 0); + assert(sect->u.indirect.span_size > 0); /* This indirect section doesn't (currently) have a parent */ sect->u.indirect.parent = NULL; @@ -2272,10 +2272,10 @@ H5HF__sect_indirect_for_row(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, H5HF_free_ /* * Check arguments. */ - HDassert(hdr); - HDassert(iblock); - HDassert(row_sect); - HDassert(row_sect->u.row.row < hdr->man_dtable.max_direct_rows); + assert(hdr); + assert(iblock); + assert(row_sect); + assert(row_sect->u.row.row < hdr->man_dtable.max_direct_rows); /* Create free space section node */ if (NULL == (sect = H5HF__sect_indirect_new(hdr, row_sect->sect_info.addr, row_sect->sect_info.size, @@ -2344,8 +2344,8 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ /* * Check arguments. */ - HDassert(sect); - HDassert(sect->u.indirect.span_size > 0); + assert(sect); + assert(sect->u.indirect.span_size > 0); /* Reset reference count for indirect section */ /* (Also reset the direct & indirect row pointers */ @@ -2551,7 +2551,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ sect->u.indirect.dir_nrows = dir_nrows; /* Make certain we've tracked the section's dependents correctly */ - HDassert(sect->u.indirect.rc == (sect->u.indirect.indir_nents + sect->u.indirect.dir_nrows)); + assert(sect->u.indirect.rc == (sect->u.indirect.indir_nents + sect->u.indirect.dir_nrows)); done: if (ret_value < 0) { @@ -2596,9 +2596,9 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start /* * Check arguments. */ - HDassert(hdr); - HDassert(iblock); - HDassert(nentries); + assert(hdr); + assert(iblock); + assert(nentries); /* Compute starting column & row */ start_row = start_entry / hdr->man_dtable.cparam.width; @@ -2624,7 +2624,7 @@ H5HF__sect_indirect_add(H5HF_hdr_t *hdr, H5HF_indirect_t *iblock, unsigned start if (H5HF__sect_indirect_init_rows(hdr, sect, TRUE, &first_row_sect, H5FS_ADD_SKIP_VALID, start_row, start_col, end_row, end_col) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize indirect section") - HDassert(first_row_sect); + assert(first_row_sect); /* Now that underlying indirect section is consistent, add first row * section to free space manager for the heap @@ -2662,8 +2662,8 @@ H5HF__sect_indirect_decr(H5HF_free_section_t *sect) /* * Check arguments. */ - HDassert(sect); - HDassert(sect->u.indirect.rc); + assert(sect); + assert(sect->u.indirect.rc); /* Decrement ref. count for indirect section */ sect->u.indirect.rc--; @@ -2714,9 +2714,9 @@ H5HF__sect_indirect_revive_row(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) /* * Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(sect->sect_info.state == H5FS_SECT_SERIALIZED); + assert(hdr); + assert(sect); + assert(sect->sect_info.state == H5FS_SECT_SERIALIZED); /* Look up indirect block containing indirect blocks for section */ if (H5HF__man_dblock_locate(hdr, sect->sect_info.addr, &sec_iblock, NULL, &did_protect, @@ -2758,10 +2758,10 @@ H5HF__sect_indirect_revive(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, H5HF_indi /* * Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(sect->sect_info.state == H5FS_SECT_SERIALIZED); - HDassert(sect_iblock); + assert(hdr); + assert(sect); + assert(sect->sect_info.state == H5FS_SECT_SERIALIZED); + assert(sect_iblock); /* Increment reference count on indirect block that free section is in */ if (H5HF__iblock_incr(sect_iblock) < 0) @@ -2823,8 +2823,8 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h /* * Check arguments. */ - HDassert(hdr); - HDassert(row_sect); + assert(hdr); + assert(row_sect); /* Compute starting & ending information for row section */ row_start_entry = (row_sect->u.row.row * hdr->man_dtable.cparam.width) + row_sect->u.row.col; @@ -2839,11 +2839,11 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h end_row = end_entry / hdr->man_dtable.cparam.width; /* Additional sanity check */ - HDassert(sect->u.indirect.span_size > 0); - HDassert(sect->u.indirect.iblock_entries > 0); - HDassert(sect->u.indirect.dir_nrows > 0); - HDassert(sect->u.indirect.dir_rows); - HDassert(sect->u.indirect.dir_rows[(row_sect->u.row.row - start_row)] == row_sect); + assert(sect->u.indirect.span_size > 0); + assert(sect->u.indirect.iblock_entries > 0); + assert(sect->u.indirect.dir_nrows > 0); + assert(sect->u.indirect.dir_rows); + assert(sect->u.indirect.dir_rows[(row_sect->u.row.row - start_row)] == row_sect); /* Check if we should allocate from end of indirect section */ if (row_end_entry == end_entry && start_row != end_row) { @@ -2886,7 +2886,7 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h /* Adjust block coordinates of span */ sect->u.indirect.col++; if (sect->u.indirect.col == hdr->man_dtable.cparam.width) { - HDassert(row_sect->u.row.num_entries == 1); + assert(row_sect->u.row.num_entries == 1); /* Adjust section's span information */ sect->u.indirect.row++; @@ -2897,10 +2897,10 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h /* Adjust direct row sections for indirect section */ if (sect->u.indirect.dir_nrows > 0) { - HDassert(sect->u.indirect.dir_rows); + assert(sect->u.indirect.dir_rows); HDmemmove(§->u.indirect.dir_rows[0], §->u.indirect.dir_rows[1], sect->u.indirect.dir_nrows * sizeof(H5HF_free_section_t *)); - HDassert(sect->u.indirect.dir_rows[0]); + assert(sect->u.indirect.dir_rows[0]); /* Make new "first row" in indirect section */ if (row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW) @@ -2910,8 +2910,8 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h } /* end if */ else { /* Sanity check */ - HDassert(sect->u.indirect.indir_nents > 0); - HDassert(sect->u.indirect.indir_ents); + assert(sect->u.indirect.indir_nents > 0); + assert(sect->u.indirect.indir_ents); /* Eliminate direct rows for this section */ sect->u.indirect.dir_rows = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.dir_rows); @@ -2931,17 +2931,17 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h unsigned new_end_row; /* New end row for entries */ /* Sanity check */ - HDassert(sect->u.indirect.indir_nents == 0); - HDassert(sect->u.indirect.indir_ents == NULL); + assert(sect->u.indirect.indir_nents == 0); + assert(sect->u.indirect.indir_ents == NULL); /* Adjust number of entries covered */ sect->u.indirect.num_entries--; /* Check for eliminating a direct row */ new_end_row = ((start_entry + sect->u.indirect.num_entries) - 1) / hdr->man_dtable.cparam.width; - HDassert(new_end_row <= end_row); + assert(new_end_row <= end_row); if (new_end_row < end_row) { - HDassert(new_end_row == (end_row - 1)); + assert(new_end_row == (end_row - 1)); sect->u.indirect.dir_nrows--; } /* end if */ } /* end if */ @@ -2954,11 +2954,11 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h unsigned u; /* Local index variable */ /* Sanity checks */ - HDassert(row_sect->u.row.col == 0); - HDassert(row_sect->u.row.row > 0); - HDassert(row_sect->u.row.row < hdr->man_dtable.max_direct_rows); - HDassert(row_sect->u.row.num_entries == hdr->man_dtable.cparam.width); - HDassert(row_sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); + assert(row_sect->u.row.col == 0); + assert(row_sect->u.row.row > 0); + assert(row_sect->u.row.row < hdr->man_dtable.max_direct_rows); + assert(row_sect->u.row.num_entries == hdr->man_dtable.cparam.width); + assert(row_sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); /* Compute basic information about peer & current indirect sections */ new_start_row = row_sect->u.row.row; @@ -2995,7 +2995,7 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h HDmemmove(§->u.indirect.dir_rows[0], §->u.indirect.dir_rows[peer_dir_nrows], (sizeof(H5HF_free_section_t *) * (sect->u.indirect.dir_nrows - peer_dir_nrows))); sect->u.indirect.dir_nrows -= peer_dir_nrows; - HDassert(row_sect == sect->u.indirect.dir_rows[0]); + assert(row_sect == sect->u.indirect.dir_rows[0]); /* Re-target transferred row sections to point to new underlying indirect section */ for (u = 0; u < peer_dir_nrows; u++) @@ -3026,9 +3026,9 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h (peer_nentries + 1); /* Transferred entries, plus the entry allocated out of the row */ /* Make certain we've tracked the sections' dependents correctly */ - HDassert(sect->u.indirect.rc == (sect->u.indirect.indir_nents + sect->u.indirect.dir_nrows)); - HDassert(peer_sect->u.indirect.rc == - (peer_sect->u.indirect.indir_nents + peer_sect->u.indirect.dir_nrows)); + assert(sect->u.indirect.rc == (sect->u.indirect.indir_nents + sect->u.indirect.dir_nrows)); + assert(peer_sect->u.indirect.rc == + (peer_sect->u.indirect.indir_nents + peer_sect->u.indirect.dir_nrows)); /* Reset the peer_sect variable, to indicate that it has been hooked into the data structures * correctly and shouldn't be freed */ @@ -3039,7 +3039,7 @@ H5HF__sect_indirect_reduce_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect, h /* Decrement count of entries & rows */ sect->u.indirect.num_entries--; sect->u.indirect.dir_nrows--; - HDassert(sect->u.indirect.dir_nrows == 0); + assert(sect->u.indirect.dir_nrows == 0); /* Eliminate direct rows for this section */ sect->u.indirect.dir_rows = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.dir_rows); @@ -3050,7 +3050,7 @@ done: * into the main free space structures (via the direct blocks), and the reference count is updated. */ if (peer_sect) { /* Sanity check - we should only be here if an error occurred */ - HDassert(ret_value < 0); + assert(ret_value < 0); if (H5HF__sect_indirect_free(peer_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") @@ -3089,10 +3089,10 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned /* * Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(sect->u.indirect.span_size > 0); - HDassert(sect->u.indirect.iblock_entries > 0); + assert(hdr); + assert(sect); + assert(sect->u.indirect.span_size > 0); + assert(sect->u.indirect.iblock_entries > 0); /* Compute starting & ending information for indirect section */ start_row = sect->u.indirect.row; @@ -3126,10 +3126,10 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned /* Check if we can allocate from start of indirect section */ if (child_entry == start_entry) { /* Sanity check */ - HDassert(sect->u.indirect.dir_nrows == 0); - HDassert(sect->u.indirect.dir_rows == NULL); - HDassert(sect->u.indirect.indir_nents > 0); - HDassert(sect->u.indirect.indir_ents); + assert(sect->u.indirect.dir_nrows == 0); + assert(sect->u.indirect.dir_rows == NULL); + assert(sect->u.indirect.indir_nents > 0); + assert(sect->u.indirect.indir_ents); /* Adjust section start */ sect->sect_info.addr += hdr->man_dtable.row_block_size[start_row]; @@ -3147,7 +3147,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned sect->u.indirect.indir_nents--; HDmemmove(§->u.indirect.indir_ents[0], §->u.indirect.indir_ents[1], sect->u.indirect.indir_nents * sizeof(H5HF_free_section_t *)); - HDassert(sect->u.indirect.indir_ents[0]); + assert(sect->u.indirect.indir_ents[0]); /* Make new "first row" in new first indirect child section */ if (H5HF__sect_indirect_first(hdr, sect->u.indirect.indir_ents[0]) < 0) @@ -3156,8 +3156,8 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned } /* end if */ else if (child_entry == end_entry) { /* Sanity check */ - HDassert(sect->u.indirect.indir_nents > 0); - HDassert(sect->u.indirect.indir_ents); + assert(sect->u.indirect.indir_nents > 0); + assert(sect->u.indirect.indir_ents); /* Adjust span of blocks covered */ sect->u.indirect.num_entries--; @@ -3180,8 +3180,8 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned unsigned u; /* Local index variable */ /* Sanity check */ - HDassert(sect->u.indirect.indir_nents > 0); - HDassert(sect->u.indirect.indir_ents); + assert(sect->u.indirect.indir_nents > 0); + assert(sect->u.indirect.indir_ents); /* Compute basic information about peer & current indirect sections */ peer_nentries = end_entry - child_entry; @@ -3189,7 +3189,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned peer_start_col = (child_entry + 1) % hdr->man_dtable.cparam.width; child_row = child_entry / hdr->man_dtable.cparam.width; new_nentries = sect->u.indirect.num_entries - (peer_nentries + 1); - HDassert(child_row >= hdr->man_dtable.max_direct_rows); + assert(child_row >= hdr->man_dtable.max_direct_rows); /* Get indirect block information for peer */ if (sect->sect_info.state == H5FS_SECT_LIVE) { @@ -3206,7 +3206,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned sect->u.indirect.num_entries = new_nentries; sect->u.indirect.span_size = H5HF__dtable_span_size(&hdr->man_dtable, sect->u.indirect.row, sect->u.indirect.col, new_nentries); - HDassert(sect->u.indirect.span_size > 0); + assert(sect->u.indirect.span_size > 0); /* Compute address of peer indirect section */ peer_sect_addr = sect->sect_info.addr; @@ -3253,10 +3253,9 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned /* (Note modified on current section's ref. count, since we haven't * detached the child section yet) */ - HDassert((sect->u.indirect.rc - 1) == - (sect->u.indirect.indir_nents + sect->u.indirect.dir_nrows)); - HDassert(peer_sect->u.indirect.rc == - (peer_sect->u.indirect.indir_nents + peer_sect->u.indirect.dir_nrows)); + assert((sect->u.indirect.rc - 1) == (sect->u.indirect.indir_nents + sect->u.indirect.dir_nrows)); + assert(peer_sect->u.indirect.rc == + (peer_sect->u.indirect.indir_nents + peer_sect->u.indirect.dir_nrows)); /* Make new "first row" in peer section */ if (H5HF__sect_indirect_first(hdr, peer_sect->u.indirect.indir_ents[0]) < 0) @@ -3272,7 +3271,7 @@ H5HF__sect_indirect_reduce(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, unsigned /* Decrement count of entries & indirect entries */ sect->u.indirect.num_entries--; sect->u.indirect.indir_nents--; - HDassert(sect->u.indirect.indir_nents == 0); + assert(sect->u.indirect.indir_nents == 0); /* Eliminate indirect entries for this section */ sect->u.indirect.indir_ents = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.indir_ents); @@ -3288,7 +3287,7 @@ done: * into the main free space structures (via the direct blocks), and the reference count is updated. */ if (peer_sect) { /* Sanity check - we should only be here if an error occurred */ - HDassert(ret_value < 0); + assert(ret_value < 0); if (H5HF__sect_indirect_free(peer_sect) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free indirect section node") @@ -3317,7 +3316,7 @@ H5HF__sect_indirect_is_first(H5HF_free_section_t *sect) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(sect); + assert(sect); /* Recurse to parent */ if (sect->u.indirect.parent) { @@ -3350,16 +3349,16 @@ H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(hdr); - HDassert(sect); + assert(hdr); + assert(sect); /* Check if this indirect section has direct block rows */ if (sect->u.indirect.dir_nrows > 0) { /* Sanity checks */ - HDassert(sect->u.indirect.row == 0); - HDassert(sect->u.indirect.col == 0); - HDassert(sect->u.indirect.dir_rows); - HDassert(sect->u.indirect.dir_rows[0]); + assert(sect->u.indirect.row == 0); + assert(sect->u.indirect.col == 0); + assert(sect->u.indirect.dir_rows); + assert(sect->u.indirect.dir_rows[0]); /* Change first row section in indirect section to be the "first row" */ if (H5HF__sect_row_first(hdr, sect->u.indirect.dir_rows[0]) < 0) @@ -3367,9 +3366,9 @@ H5HF__sect_indirect_first(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) } /* end if */ else { /* Sanity checks */ - HDassert(sect->u.indirect.indir_nents > 0); - HDassert(sect->u.indirect.indir_ents); - HDassert(sect->u.indirect.indir_ents[0]); + assert(sect->u.indirect.indir_nents > 0); + assert(sect->u.indirect.indir_ents); + assert(sect->u.indirect.indir_ents[0]); /* Forward to first child indirect section */ if (H5HF__sect_indirect_first(hdr, sect->u.indirect.indir_ents[0]) < 0) @@ -3400,9 +3399,9 @@ H5HF__sect_indirect_get_iblock(H5HF_free_section_t *sect) /* * Check arguments. */ - HDassert(sect); - HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_INDIRECT); - HDassert(sect->sect_info.state == H5FS_SECT_LIVE); + assert(sect); + assert(sect->sect_info.type == H5HF_FSPACE_SECT_INDIRECT); + assert(sect->sect_info.state == H5FS_SECT_LIVE); FUNC_LEAVE_NOAPI(sect->u.indirect.u.iblock) } /* end H5HF__sect_indirect_get_iblock() */ @@ -3439,22 +3438,22 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H FUNC_ENTER_PACKAGE /* Sanity check parameters */ - HDassert(hdr); - HDassert(row_sect1); - HDassert(row_sect1->u.row.under); - HDassert(row_sect2); - HDassert(row_sect2->u.row.under); - HDassert(row_sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); + assert(hdr); + assert(row_sect1); + assert(row_sect1->u.row.under); + assert(row_sect2); + assert(row_sect2->u.row.under); + assert(row_sect2->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW); /* Set up indirect section information */ sect1 = H5HF__sect_indirect_top(row_sect1->u.row.under); - HDassert(sect1); + assert(sect1); sect2 = H5HF__sect_indirect_top(row_sect2->u.row.under); - HDassert(sect2); + assert(sect2); /* Sanity check some assumptions about the indirect sections */ - HDassert(sect1->u.indirect.span_size > 0); - HDassert(sect2->u.indirect.span_size > 0); + assert(sect1->u.indirect.span_size > 0); + assert(sect2->u.indirect.span_size > 0); /* Set up span information */ start_row1 = sect1->u.indirect.row; @@ -3480,8 +3479,8 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H * has child row sections, first indirect section _must_ have * them also) */ - HDassert(sect1->u.indirect.dir_nrows > 0); - HDassert(sect1->u.indirect.dir_rows); + assert(sect1->u.indirect.dir_nrows > 0); + assert(sect1->u.indirect.dir_rows); /* Get the offsets for the indirect blocks under the rows */ if (H5FS_SECT_LIVE == row_sect1->u.row.under->sect_info.state) @@ -3502,11 +3501,11 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H last_row_sect1 = sect1->u.indirect.dir_rows[sect1->u.indirect.dir_nrows - 1]; else last_row_sect1 = row_sect1; - HDassert(last_row_sect1); - HDassert(last_row_sect1->u.row.row == end_row1); + assert(last_row_sect1); + assert(last_row_sect1->u.row.row == end_row1); /* Adjust info for first row section, to absorb second row section */ - HDassert((last_row_sect1->u.row.col + last_row_sect1->u.row.num_entries) == row_sect2->u.row.col); + assert((last_row_sect1->u.row.col + last_row_sect1->u.row.num_entries) == row_sect2->u.row.col); last_row_sect1->u.row.num_entries += row_sect2->u.row.num_entries; /* Set up parameters for transfer of rows */ @@ -3564,9 +3563,9 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H unsigned new_indir_nents1; /* New value for number of indirect entries in first section */ /* Some sanity checks on second indirect section */ - HDassert(sect2->u.indirect.rc > 0); - HDassert(sect2->u.indirect.indir_nents > 0); - HDassert(sect2->u.indirect.indir_ents); + assert(sect2->u.indirect.rc > 0); + assert(sect2->u.indirect.indir_nents > 0); + assert(sect2->u.indirect.indir_ents); /* Set up parameters for transfer of entries */ new_indir_nents1 = sect1->u.indirect.indir_nents + sect2->u.indirect.indir_nents; @@ -3608,7 +3607,7 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H sect1->u.indirect.span_size += sect2->u.indirect.span_size; /* Make certain we've tracked the first section's dependents correctly */ - HDassert(sect1->u.indirect.rc == (sect1->u.indirect.indir_nents + sect1->u.indirect.dir_nrows)); + assert(sect1->u.indirect.rc == (sect1->u.indirect.indir_nents + sect1->u.indirect.dir_nrows)); /* Wrap up, freeing or re-inserting second row section */ /* (want this to be after the first indirect section is consistent again) */ @@ -3617,13 +3616,13 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H /* (indirectly releases second indirect section, since all of it's * other dependents are gone) */ - HDassert(sect2->u.indirect.rc == 1); + assert(sect2->u.indirect.rc == 1); if (H5HF__sect_row_free((H5FS_section_info_t *)row_sect2) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't free row section") } /* end if */ else { /* Decrement ref. count on second indirect section's parent */ - HDassert(sect2->u.indirect.rc == 0); + assert(sect2->u.indirect.rc == 0); if (sect2->u.indirect.parent) if (H5HF__sect_indirect_decr(sect2->u.indirect.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, @@ -3646,7 +3645,7 @@ H5HF__sect_indirect_merge_row(H5HF_hdr_t *hdr, H5HF_free_section_t *row_sect1, H /* (i.e. merged indirect sections cover an entire indirect block) */ if (sect1->u.indirect.iblock_entries == sect1->u.indirect.num_entries) { /* Build parent section for fully populated indirect section */ - HDassert(sect1->u.indirect.parent == NULL); + assert(sect1->u.indirect.parent == NULL); if (H5HF__sect_indirect_build_parent(hdr, sect1) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTCREATE, FAIL, "can't create parent for full indirect section") } /* end if */ @@ -3681,14 +3680,14 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) FUNC_ENTER_PACKAGE /* Sanity check parameters */ - HDassert(hdr); - HDassert(sect); - HDassert(H5FS_SECT_LIVE == sect->sect_info.state); - HDassert(sect->u.indirect.span_size > 0); - HDassert(sect->u.indirect.iblock_entries > 0); - HDassert(sect->u.indirect.iblock_entries == sect->u.indirect.num_entries); - HDassert(sect->u.indirect.u.iblock); - HDassert(sect->u.indirect.parent == NULL); + assert(hdr); + assert(sect); + assert(H5FS_SECT_LIVE == sect->sect_info.state); + assert(sect->u.indirect.span_size > 0); + assert(sect->u.indirect.iblock_entries > 0); + assert(sect->u.indirect.iblock_entries == sect->u.indirect.num_entries); + assert(sect->u.indirect.u.iblock); + assert(sect->u.indirect.parent == NULL); /* Get information for creating parent indirect section */ if (sect->u.indirect.u.iblock->parent) { @@ -3706,7 +3705,7 @@ H5HF__sect_indirect_build_parent(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) /* Compute row & column for block in parent */ par_row = par_entry / hdr->man_dtable.cparam.width; par_col = par_entry % hdr->man_dtable.cparam.width; - HDassert(par_row >= hdr->man_dtable.max_direct_rows); + assert(par_row >= hdr->man_dtable.max_direct_rows); /* Create parent indirect section */ if (NULL == (par_sect = H5HF__sect_indirect_new(hdr, sect->sect_info.addr, sect->sect_info.size, @@ -3759,17 +3758,17 @@ H5HF__sect_indirect_shrink(H5HF_hdr_t *hdr, H5HF_free_section_t *sect) FUNC_ENTER_PACKAGE /* Sanity check parameters */ - HDassert(hdr); - HDassert(sect); + assert(hdr); + assert(sect); /* Sanity check some assumptions about the indirect section */ - HDassert(sect->u.indirect.dir_nrows > 0 || sect->u.indirect.indir_nents > 0); + assert(sect->u.indirect.dir_nrows > 0 || sect->u.indirect.indir_nents > 0); /* Walk through direct rows, freeing them */ for (u = 0; u < sect->u.indirect.dir_nrows; u++) { /* Remove the normal rows from free space manager */ if (sect->u.indirect.dir_rows[u]->sect_info.type != H5HF_FSPACE_SECT_FIRST_ROW) { - HDassert(sect->u.indirect.dir_rows[u]->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); + assert(sect->u.indirect.dir_rows[u]->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); if (H5HF__space_remove(hdr, sect->u.indirect.dir_rows[u]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "can't remove section from heap free space") } /* end if */ @@ -3814,9 +3813,9 @@ H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(sect); - HDassert(buf); + assert(hdr); + assert(sect); + assert(buf); /* Check if this indirect section has a parent & forward if this section is first */ if (sect->u.indirect.parent) { @@ -3828,7 +3827,7 @@ H5HF__sect_indirect_serialize(H5HF_hdr_t *hdr, const H5HF_free_section_t *sect, else { /* Indirect range's indirect block's block offset */ if (sect->sect_info.state == H5FS_SECT_LIVE) { - HDassert(sect->u.indirect.u.iblock); + assert(sect->u.indirect.u.iblock); UINT64ENCODE_VAR(buf, sect->u.indirect.u.iblock->block_off, hdr->heap_off_size); } /* end if */ else @@ -3879,10 +3878,10 @@ H5HF__sect_indirect_deserialize(H5HF_hdr_t *hdr, const uint8_t *buf, haddr_t sec FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(hdr); - HDassert(buf); - HDassert(H5_addr_defined(sect_addr)); - HDassert(sect_size); + assert(hdr); + assert(buf); + assert(H5_addr_defined(sect_addr)); + assert(sect_size); /* Indirect range's indirect block's block offset */ UINT64DECODE_VAR(buf, iblock_off, hdr->heap_off_size); @@ -3947,7 +3946,7 @@ H5HF__sect_indirect_free(H5HF_free_section_t *sect) FUNC_ENTER_PACKAGE - HDassert(sect); + assert(sect); /* Release the memory for tracking direct rows */ sect->u.indirect.dir_rows = (H5HF_free_section_t **)H5MM_xfree(sect->u.indirect.dir_rows); @@ -3995,8 +3994,8 @@ H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect FUNC_ENTER_PACKAGE_NOERR /* Sanity check arguments */ - HDassert(hdr); - HDassert(sect); + assert(hdr); + assert(sect); /* Compute starting entry, column & row */ start_row = sect->u.indirect.row; @@ -4020,22 +4019,22 @@ H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect /* Iterate over direct rows, checking pointer references */ dir_nrows = (max_dir_row - start_row) + 1; - HDassert(dir_nrows == sect->u.indirect.dir_nrows); + assert(dir_nrows == sect->u.indirect.dir_nrows); for (u = 0; u < dir_nrows; u++) { const H5HF_free_section_t H5_ATTR_NDEBUG_UNUSED *tmp_row_sect; /* Pointer to row section */ tmp_row_sect = sect->u.indirect.dir_rows[u]; - HDassert(tmp_row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW || - tmp_row_sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); - HDassert(tmp_row_sect->u.row.under == sect); - HDassert(tmp_row_sect->u.row.row == (start_row + u)); + assert(tmp_row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW || + tmp_row_sect->sect_info.type == H5HF_FSPACE_SECT_NORMAL_ROW); + assert(tmp_row_sect->u.row.under == sect); + assert(tmp_row_sect->u.row.row == (start_row + u)); if (u > 0) { const H5HF_free_section_t H5_ATTR_NDEBUG_UNUSED *tmp_row_sect2; /* Pointer to row section */ tmp_row_sect2 = sect->u.indirect.dir_rows[u - 1]; - HDassert(tmp_row_sect2->u.row.row < tmp_row_sect->u.row.row); - HDassert(H5_addr_lt(tmp_row_sect2->sect_info.addr, tmp_row_sect->sect_info.addr)); - HDassert(tmp_row_sect2->sect_info.size <= tmp_row_sect->sect_info.size); + assert(tmp_row_sect2->u.row.row < tmp_row_sect->u.row.row); + assert(H5_addr_lt(tmp_row_sect2->sect_info.addr, tmp_row_sect->sect_info.addr)); + assert(tmp_row_sect2->sect_info.size <= tmp_row_sect->sect_info.size); } /* end if */ } /* end for */ } /* end if */ @@ -4044,24 +4043,24 @@ H5HF__sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect if (sect->u.indirect.indir_nents > 0) { /* Basic sanity checks */ if (sect->sect_info.state == H5FS_SECT_LIVE) { - HDassert(sect->u.indirect.iblock_entries); - HDassert(sect->u.indirect.indir_nents <= sect->u.indirect.iblock_entries); + assert(sect->u.indirect.iblock_entries); + assert(sect->u.indirect.indir_nents <= sect->u.indirect.iblock_entries); } /* end if */ - HDassert(sect->u.indirect.indir_ents); + assert(sect->u.indirect.indir_ents); /* Sanity check each child indirect section */ for (u = 0; u < sect->u.indirect.indir_nents; u++) { const H5HF_free_section_t *tmp_child_sect; /* Pointer to child indirect section */ tmp_child_sect = sect->u.indirect.indir_ents[u]; - HDassert(tmp_child_sect->sect_info.type == H5HF_FSPACE_SECT_INDIRECT); - HDassert(tmp_child_sect->u.indirect.parent == sect); + assert(tmp_child_sect->sect_info.type == H5HF_FSPACE_SECT_INDIRECT); + assert(tmp_child_sect->u.indirect.parent == sect); if (u > 0) { const H5HF_free_section_t H5_ATTR_NDEBUG_UNUSED *tmp_child_sect2; /* Pointer to child indirect section */ tmp_child_sect2 = sect->u.indirect.indir_ents[u - 1]; - HDassert(H5_addr_lt(tmp_child_sect2->sect_info.addr, tmp_child_sect->sect_info.addr)); + assert(H5_addr_lt(tmp_child_sect2->sect_info.addr, tmp_child_sect->sect_info.addr)); } /* end if */ /* Recursively check child indirect section */ @@ -4092,7 +4091,7 @@ H5HF__sect_indirect_debug(const H5HF_free_section_t *sect, FILE *stream, int ind FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect); + assert(sect); /* Print indirect section information */ HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Row:", sect->u.indirect.row); diff --git a/src/H5HFspace.c b/src/H5HFspace.c index 045b4e2..1c24f70 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -96,7 +96,7 @@ H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Check for creating free space info for the heap */ if (H5_addr_defined(hdr->fs_addr)) { @@ -122,7 +122,7 @@ H5HF__space_start(H5HF_hdr_t *hdr, hbool_t may_create) (hdr->fspace = H5FS_create(hdr->f, &hdr->fs_addr, &fs_create, NELMTS(classes), classes, hdr, (hsize_t)H5HF_FSPACE_THRHD_DEF, (hsize_t)H5HF_FSPACE_ALIGN_DEF))) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't initialize free space info") - HDassert(H5_addr_defined(hdr->fs_addr)); + assert(H5_addr_defined(hdr->fs_addr)); } /* end if */ } /* end else */ @@ -155,8 +155,8 @@ H5HF__space_add(H5HF_hdr_t *hdr, H5HF_free_section_t *node, unsigned flags) /* * Check arguments. */ - HDassert(hdr); - HDassert(node); + assert(hdr); + assert(node); /* Check if the free space for the heap has been initialized */ if (!hdr->fspace) @@ -198,9 +198,9 @@ H5HF__space_find(H5HF_hdr_t *hdr, hsize_t request, H5HF_free_section_t **node) /* * Check arguments. */ - HDassert(hdr); - HDassert(request); - HDassert(node); + assert(hdr); + assert(request); + assert(node); /* Check if the free space for the heap has been initialized */ if (!hdr->fspace) @@ -245,12 +245,12 @@ H5HF__space_revert_root_cb(H5FS_section_info_t *_sect, void H5_ATTR_UNUSED *_uda /* * Check arguments. */ - HDassert(sect); + assert(sect); /* Only modify "live" single blocks... */ if (sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE && sect->sect_info.state == H5FS_SECT_LIVE) { /* Release hold on previous indirect block (we must have one) */ - HDassert(sect->u.single.parent); + assert(sect->u.single.parent); if (H5HF__iblock_decr(sect->u.single.parent) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block") @@ -288,7 +288,7 @@ H5HF__space_revert_root(const H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Only need to scan the sections if the free space has been initialized */ if (hdr->fspace) @@ -327,13 +327,13 @@ H5HF__space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) /* * Check arguments. */ - HDassert(sect); - HDassert(root_iblock); + assert(sect); + assert(root_iblock); /* Sanity check sections */ /* (If we are switching from a direct block for the root block of the heap, */ /* there should only be 'single' type sections. -QAK) */ - HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); + assert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); /* Increment ref. count on new root indirect block */ if (H5HF__iblock_incr(root_iblock) < 0) @@ -344,7 +344,7 @@ H5HF__space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) if (sect->sect_info.state == H5FS_SECT_SERIALIZED) sect->sect_info.state = H5FS_SECT_LIVE; /* Mark "live" now */ else - HDassert(!sect->u.single.parent); + assert(!sect->u.single.parent); sect->u.single.parent = root_iblock; sect->u.single.par_entry = 0; @@ -377,8 +377,8 @@ H5HF__space_create_root(const H5HF_hdr_t *hdr, H5HF_indirect_t *root_iblock) /* * Check arguments. */ - HDassert(hdr); - HDassert(root_iblock); + assert(hdr); + assert(root_iblock); /* Only need to scan the sections if the free space has been initialized */ if (hdr->fspace) @@ -414,8 +414,8 @@ H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size) /* * Check arguments. */ - HDassert(hdr); - HDassert(fs_size); + assert(hdr); + assert(fs_size); /* Check if the free space for the heap has been initialized */ if (!hdr->fspace) @@ -457,9 +457,9 @@ H5HF__space_remove(H5HF_hdr_t *hdr, H5HF_free_section_t *node) /* * Check arguments. */ - HDassert(hdr); - HDassert(hdr->fspace); - HDassert(node); + assert(hdr); + assert(hdr->fspace); + assert(node); /* Remove from the free space for the heap */ if (H5FS_sect_remove(hdr->f, hdr->fspace, (H5FS_section_info_t *)node) < 0) @@ -493,7 +493,7 @@ H5HF__space_close(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Check if the free space was ever opened */ if (hdr->fspace) { @@ -543,7 +543,7 @@ H5HF__space_delete(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Delete the free space manager */ if (H5FS_delete(hdr->f, hdr->fs_addr) < 0) @@ -577,9 +577,9 @@ H5HF__space_sect_change_class(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, uint16 /* * Check arguments. */ - HDassert(hdr); - HDassert(hdr->fspace); - HDassert(sect); + assert(hdr); + assert(hdr->fspace); + assert(sect); /* Notify the free space manager that a section has changed class */ if (H5FS_sect_change_class(hdr->f, hdr->fspace, (H5FS_section_info_t *)sect, new_class) < 0) diff --git a/src/H5HFstat.c b/src/H5HFstat.c index 3c917b4..d76fce5 100644 --- a/src/H5HFstat.c +++ b/src/H5HFstat.c @@ -78,8 +78,8 @@ H5HF_stat_info(const H5HF_t *fh, H5HF_stat_t *stats) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); - HDassert(stats); + assert(fh); + assert(stats); /* Report statistics for fractal heap */ stats->man_size = fh->hdr->man_size; @@ -124,8 +124,8 @@ H5HF_size(const H5HF_t *fh, hsize_t *heap_size) /* * Check arguments. */ - HDassert(fh); - HDassert(heap_size); + assert(fh); + assert(heap_size); /* Get "convenience" pointer to fractal heap header */ hdr = fh->hdr; diff --git a/src/H5HFtest.c b/src/H5HFtest.c index 14199ee..35d16b2 100644 --- a/src/H5HFtest.c +++ b/src/H5HFtest.c @@ -80,8 +80,8 @@ H5HF_get_cparam_test(const H5HF_t *fh, H5HF_create_t *cparam) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); - HDassert(cparam); + assert(fh); + assert(cparam); /* Get fractal heap creation parameters */ if (fh->hdr->id_len == (unsigned)(1 + fh->hdr->heap_off_size + fh->hdr->heap_len_size)) @@ -118,8 +118,8 @@ H5HF_cmp_cparam_test(const H5HF_create_t *cparam1, const H5HF_create_t *cparam2) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(cparam1); - HDassert(cparam2); + assert(cparam1); + assert(cparam2); /* Compare doubling table parameters */ if (cparam1->managed.width < cparam2->managed.width) @@ -234,7 +234,7 @@ H5HF_get_max_root_rows(const H5HF_t *fh) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); + assert(fh); /* Return max. # of rows in root indirect block */ ret_value = fh->hdr->man_dtable.max_root_rows; @@ -264,7 +264,7 @@ H5HF_get_dtable_width_test(const H5HF_t *fh) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); + assert(fh); /* Return width of doubling table */ ret_value = fh->hdr->man_dtable.cparam.width; @@ -294,7 +294,7 @@ H5HF_get_dtable_max_drows_test(const H5HF_t *fh) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); + assert(fh); /* Return max. # of direct blocks in any indirect block */ ret_value = fh->hdr->man_dtable.max_direct_rows; @@ -328,8 +328,8 @@ H5HF_get_iblock_max_drows_test(const H5HF_t *fh, unsigned pos) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); - HDassert(pos); + assert(fh); + assert(pos); /* Return max. # of direct blocks in this indirect block row */ ret_value = pos + (fh->hdr->man_dtable.max_direct_bits - fh->hdr->man_dtable.first_row_bits) + 1; @@ -359,7 +359,7 @@ H5HF_get_dblock_size_test(const H5HF_t *fh, unsigned row) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); + assert(fh); /* Return direct block free space */ ret_value = fh->hdr->man_dtable.row_block_size[row]; @@ -390,7 +390,7 @@ H5HF_get_dblock_free_test(const H5HF_t *fh, unsigned row) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); + assert(fh); /* Return direct block free space */ ret_value = fh->hdr->man_dtable.row_tot_dblock_free[row]; @@ -420,10 +420,10 @@ H5HF_get_id_off_test(const H5HF_t *fh, const void *_id, hsize_t *obj_off) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); - HDassert(fh->hdr); - HDassert(id); - HDassert(obj_off); + assert(fh); + assert(fh->hdr); + assert(id); + assert(obj_off); /* Get the offset for a 'normal' heap ID */ id++; @@ -453,8 +453,8 @@ H5HF_get_id_type_test(const void *_id, unsigned char *obj_type) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(id); - HDassert(obj_type); + assert(id); + assert(obj_type); /* Get the type for a heap ID */ *obj_type = (uint8_t)(*id & H5HF_ID_TYPE_MASK); @@ -481,10 +481,10 @@ H5HF_get_tiny_info_test(const H5HF_t *fh, size_t *max_len, hbool_t *len_extended FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); - HDassert(fh->hdr); - HDassert(max_len); - HDassert(len_extended); + assert(fh); + assert(fh->hdr); + assert(max_len); + assert(len_extended); /* Retrieve information about tiny object's ID encoding in a heap */ *max_len = fh->hdr->tiny_max_len; @@ -512,9 +512,9 @@ H5HF_get_huge_info_test(const H5HF_t *fh, hsize_t *next_id, hbool_t *ids_direct) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check arguments. */ - HDassert(fh); - HDassert(fh->hdr); - HDassert(ids_direct); + assert(fh); + assert(fh->hdr); + assert(ids_direct); /* Retrieve information about tiny object's ID encoding in a heap */ if (next_id) diff --git a/src/H5HFtiny.c b/src/H5HFtiny.c index 0a44640..745fc06 100644 --- a/src/H5HFtiny.c +++ b/src/H5HFtiny.c @@ -91,7 +91,7 @@ H5HF__tiny_init(H5HF_hdr_t *hdr) /* * Check arguments. */ - HDassert(hdr); + assert(hdr); /* Compute information about 'tiny' objects for the heap */ @@ -140,11 +140,11 @@ H5HF__tiny_insert(H5HF_hdr_t *hdr, size_t obj_size, const void *obj, void *_id) /* * Check arguments. */ - HDassert(hdr); - HDassert(obj_size <= hdr->tiny_max_len); - HDassert(obj_size <= (H5HF_TINY_MASK_EXT + 1)); - HDassert(obj); - HDassert(id); + assert(hdr); + assert(obj_size <= hdr->tiny_max_len); + assert(obj_size <= (H5HF_TINY_MASK_EXT + 1)); + assert(obj); + assert(id); /* Adjust object's size for encoding it */ enc_obj_size = obj_size - 1; @@ -196,9 +196,9 @@ H5HF__tiny_get_obj_len(H5HF_hdr_t *hdr, const uint8_t *id, size_t *obj_len_p) /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(obj_len_p); + assert(hdr); + assert(id); + assert(obj_len_p); /* Check if 'tiny' object ID is in extended form, and retrieve encoded size */ if (!hdr->tiny_len_extended) @@ -238,9 +238,9 @@ H5HF__tiny_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(op); + assert(hdr); + assert(id); + assert(op); /* Get the object's encoded length */ /* H5HF__tiny_obj_len can't fail */ @@ -287,9 +287,9 @@ H5HF__tiny_read(H5HF_hdr_t *hdr, const uint8_t *id, void *obj) /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(obj); + assert(hdr); + assert(id); + assert(obj); /* Call the internal 'op' routine */ if (H5HF__tiny_op_real(hdr, id, H5HF__op_read, obj) < 0) @@ -321,9 +321,9 @@ H5HF__tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_d /* * Check arguments. */ - HDassert(hdr); - HDassert(id); - HDassert(op); + assert(hdr); + assert(id); + assert(op); /* Call the internal 'op' routine routine */ if (H5HF__tiny_op_real(hdr, id, op, op_data) < 0) @@ -356,8 +356,8 @@ H5HF__tiny_remove(H5HF_hdr_t *hdr, const uint8_t *id) /* * Check arguments. */ - HDassert(hdr); - HDassert(id); + assert(hdr); + assert(id); /* Get the object's encoded length */ /* H5HF__tiny_obj_len can't fail */ diff --git a/src/H5HG.c b/src/H5HG.c index 599da94..9e11bf1 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -131,7 +131,7 @@ H5HG__create(H5F_t *f, size_t size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); + assert(f); if (size < H5HG_MINSIZE) size = H5HG_MINSIZE; size = H5HG_ALIGN(size); @@ -173,7 +173,7 @@ H5HG__create(H5F_t *f, size_t size) /* The freespace object */ heap->obj[0].size = size - H5HG_SIZEOF_HDR(f); - HDassert(H5HG_ISALIGNED(heap->obj[0].size)); + assert(H5HG_ISALIGNED(heap->obj[0].size)); heap->obj[0].nrefs = 0; heap->obj[0].begin = p; UINT16ENCODE(p, 0); /*object ID*/ @@ -233,11 +233,11 @@ H5HG__protect(H5F_t *f, haddr_t addr, unsigned flags) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(H5_addr_defined(addr)); /* only H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Lock the heap into memory */ if (NULL == (heap = (H5HG_heap_t *)H5AC_protect(f, H5AC_GHEAP, addr, f, flags))) @@ -282,9 +282,9 @@ H5HG__alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(heap); - HDassert(heap->obj[0].size >= need); - HDassert(heap_flags_ptr); + assert(heap); + assert(heap->obj[0].size >= need); + assert(heap_flags_ptr); /* * Find an ID for the new object. ID zero is reserved for the free space @@ -298,7 +298,7 @@ H5HG__alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) break; } /* end else */ - HDassert(idx < heap->nused); + assert(idx < heap->nused); /* Check if we need more room to store heap objects */ if (idx >= heap->nalloc) { @@ -308,7 +308,7 @@ H5HG__alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) /* Determine the new number of objects to index */ /* nalloc is *not* guaranteed to be a power of 2! - NAF 10/26/09 */ new_alloc = MIN(MAX(heap->nalloc * 2, (idx + 1)), (H5HG_MAXIDX + 1)); - HDassert(idx < new_alloc); + assert(idx < new_alloc); /* Reallocate array of objects */ if (NULL == (new_obj = H5FL_SEQ_REALLOC(H5HG_obj_t, heap->obj, new_alloc))) @@ -320,7 +320,7 @@ H5HG__alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) /* Update heap information */ heap->nalloc = new_alloc; heap->obj = new_obj; - HDassert(heap->nalloc > heap->nused); + assert(heap->nalloc > heap->nused); } /* end if */ /* Initialize the new object */ @@ -353,7 +353,7 @@ H5HG__alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) UINT16ENCODE(p, 0); /*nrefs*/ UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH(f, p, heap->obj[0].size); - HDassert(H5HG_ISALIGNED(heap->obj[0].size)); + assert(H5HG_ISALIGNED(heap->obj[0].size)); } /* end else-if */ else { /* @@ -362,7 +362,7 @@ H5HG__alloc(H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned *heap_flags_ptr) */ heap->obj[0].size -= need; heap->obj[0].begin += need; - HDassert(H5HG_ISALIGNED(heap->obj[0].size)); + assert(H5HG_ISALIGNED(heap->obj[0].size)); } /* Mark the heap as dirty */ @@ -406,8 +406,8 @@ H5HG_extend(H5F_t *f, haddr_t addr, size_t need) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(f); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(H5_addr_defined(addr)); /* Protect the heap */ if (NULL == (heap = H5HG__protect(f, addr, H5AC__NO_FLAGS_SET))) @@ -443,7 +443,7 @@ H5HG_extend(H5F_t *f, haddr_t addr, size_t need) UINT16ENCODE(p, 0); /*nrefs*/ UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH(f, p, heap->obj[0].size); - HDassert(H5HG_ISALIGNED(heap->obj[0].size)); + assert(H5HG_ISALIGNED(heap->obj[0].size)); /* Resize the heap in the cache */ if (H5AC_resize_entry(heap, heap->size) < 0) @@ -494,9 +494,9 @@ H5HG_insert(H5F_t *f, size_t size, const void *obj, H5HG_t *hobj /*out*/) FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(0 == size || obj); - HDassert(hobj); + assert(f); + assert(0 == size || obj); + assert(hobj); if (0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") @@ -519,7 +519,7 @@ H5HG_insert(H5F_t *f, size_t size, const void *obj, H5HG_t *hobj /*out*/) if (!H5_addr_defined(addr)) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to allocate a global heap collection") } /* end if */ - HDassert(H5_addr_defined(addr)); + assert(H5_addr_defined(addr)); if (NULL == (heap = H5HG__protect(f, addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") @@ -573,15 +573,15 @@ H5HG_read(H5F_t *f, H5HG_t *hobj, void *object /*out*/, size_t *buf_size) FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, NULL) /* Check args */ - HDassert(f); - HDassert(hobj); + assert(f); + assert(hobj); /* Load the heap */ if (NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect global heap") - HDassert(hobj->idx < heap->nused); - HDassert(heap->obj[hobj->idx].begin); + assert(hobj->idx < heap->nused); + assert(heap->obj[hobj->idx].begin); size = heap->obj[hobj->idx].size; p = heap->obj[hobj->idx].begin + H5HG_SIZEOF_OBJHDR(f); @@ -644,8 +644,8 @@ H5HG_link(H5F_t *f, const H5HG_t *hobj, int adjust) FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(hobj); + assert(f); + assert(hobj); if (0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") @@ -654,8 +654,8 @@ H5HG_link(H5F_t *f, const H5HG_t *hobj, int adjust) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") if (adjust != 0) { - HDassert(hobj->idx < heap->nused); - HDassert(heap->obj[hobj->idx].begin); + assert(hobj->idx < heap->nused); + assert(heap->obj[hobj->idx].begin); if ((heap->obj[hobj->idx].nrefs + adjust) < 0) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "new link count would be out of range") if ((heap->obj[hobj->idx].nrefs + adjust) > H5HG_MAXLINK) @@ -696,16 +696,16 @@ H5HG_get_obj_size(H5F_t *f, H5HG_t *hobj, size_t *obj_size) FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(hobj); - HDassert(obj_size); + assert(f); + assert(hobj); + assert(obj_size); /* Load the heap */ if (NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") - HDassert(hobj->idx < heap->nused); - HDassert(heap->obj[hobj->idx].begin); + assert(hobj->idx < heap->nused); + assert(heap->obj[hobj->idx].begin); /* Set object size */ *obj_size = heap->obj[hobj->idx].size; @@ -742,8 +742,8 @@ H5HG_remove(H5F_t *f, H5HG_t *hobj) FUNC_ENTER_NOAPI_TAG(H5AC__GLOBALHEAP_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(hobj); + assert(f); + assert(hobj); if (0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "no write intent on file") @@ -751,7 +751,7 @@ H5HG_remove(H5F_t *f, H5HG_t *hobj) if (NULL == (heap = H5HG__protect(f, hobj->addr, H5AC__NO_FLAGS_SET))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap") - HDassert(hobj->idx < heap->nused); + assert(hobj->idx < heap->nused); /* When the application selects the same location to rewrite the VL element by using H5Sselect_elements, * it can happen that the entry has been removed by first rewrite. Here we simply skip the removal of @@ -832,7 +832,7 @@ H5HG__free(H5HG_heap_t *heap) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(heap); + assert(heap); /* Remove the heap from the CWFS list */ if (H5F_cwfs_remove_heap(heap->shared, heap) < 0) diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 7ae0cd4..8465537 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -109,9 +109,9 @@ H5HG__hdr_deserialize(H5HG_heap_t *heap, const uint8_t *image, size_t len, const FUNC_ENTER_PACKAGE - HDassert(heap); - HDassert(image); - HDassert(f); + assert(heap); + assert(image); + assert(f); /* Magic number */ if (H5_IS_BUFFER_OVERFLOW(image, H5_SIZEOF_MAGIC, p_end)) @@ -159,7 +159,7 @@ H5HG__cache_heap_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *imag { FUNC_ENTER_PACKAGE_NOERR - HDassert(image_len); + assert(image_len); *image_len = H5HG_MINSIZE; @@ -183,11 +183,11 @@ H5HG__cache_heap_get_final_load_size(const void *image, size_t image_len, void * FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(udata); - HDassert(actual_len); - HDassert(*actual_len == image_len); - HDassert(image_len == H5HG_MINSIZE); + assert(image); + assert(udata); + assert(actual_len); + assert(*actual_len == image_len); + assert(image_len == H5HG_MINSIZE); /* Deserialize the heap's header */ heap.size = 0; @@ -226,10 +226,10 @@ H5HG__cache_heap_deserialize(const void *_image, size_t len, void *_udata, hbool FUNC_ENTER_PACKAGE - HDassert(_image); - HDassert(len >= (size_t)H5HG_MINSIZE); - HDassert(f); - HDassert(dirty); + assert(_image); + assert(len >= (size_t)H5HG_MINSIZE); + assert(f); + assert(dirty); /* Allocate a new global heap */ if (NULL == (heap = H5FL_CALLOC(H5HG_heap_t))) @@ -411,10 +411,10 @@ H5HG__cache_heap_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(heap); - HDassert(heap->cache_info.type == H5AC_GHEAP); - HDassert(heap->size >= H5HG_MINSIZE); - HDassert(image_len); + assert(heap); + assert(heap->cache_info.type == H5AC_GHEAP); + assert(heap->size >= H5HG_MINSIZE); + assert(image_len); *image_len = heap->size; @@ -439,12 +439,12 @@ H5HG__cache_heap_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, si FUNC_ENTER_PACKAGE_NOERR - HDassert(f); - HDassert(image); - HDassert(heap); - HDassert(heap->cache_info.type == H5AC_GHEAP); - HDassert(heap->size == len); - HDassert(heap->chunk); + assert(f); + assert(image); + assert(heap); + assert(heap->cache_info.type == H5AC_GHEAP); + assert(heap->size == len); + assert(heap->chunk); /* Copy the image into the buffer */ H5MM_memcpy(image, heap->chunk, len); @@ -468,8 +468,8 @@ H5HG__cache_heap_free_icr(void *_thing) FUNC_ENTER_PACKAGE - HDassert(heap); - HDassert(heap->cache_info.type == H5AC_GHEAP); + assert(heap); + assert(heap->cache_info.type == H5AC_GHEAP); /* Destroy global heap collection */ if (H5HG__free(heap) < 0) diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index e2a8a90..c3a5255 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -83,11 +83,11 @@ H5HG_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) FUNC_ENTER_NOAPI(FAIL) /* check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); if (NULL == (h = H5HG__protect(f, addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect global heap collection"); diff --git a/src/H5HGquery.c b/src/H5HGquery.c index 9e4c789..ac36f21 100644 --- a/src/H5HGquery.c +++ b/src/H5HGquery.c @@ -77,7 +77,7 @@ H5HG_get_addr(const H5HG_heap_t *heap) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(heap); + assert(heap); FUNC_LEAVE_NOAPI(heap->addr) } /* H5HG_get_addr() */ @@ -100,7 +100,7 @@ H5HG_get_size(const H5HG_heap_t *heap) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(heap); + assert(heap); FUNC_LEAVE_NOAPI(heap->size) } /* H5HG_get_size() */ @@ -123,7 +123,7 @@ H5HG_get_free_size(const H5HG_heap_t *heap) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(heap); + assert(heap); FUNC_LEAVE_NOAPI(heap->obj[0].size) } /* H5HG_get_free_size() */ diff --git a/src/H5HL.c b/src/H5HL.c index b761fd3..9f7bb5f 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -106,8 +106,8 @@ H5HL_create(H5F_t *f, size_t size_hint, haddr_t *addr_p /*out*/) FUNC_ENTER_NOAPI(FAIL) /* check arguments */ - HDassert(f); - HDassert(addr_p); + assert(f); + assert(addr_p); /* Adjust size hint as necessary */ if (size_hint && size_hint < H5HL_SIZEOF_FREE(f)) @@ -198,8 +198,8 @@ H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(heap); + assert(f); + assert(heap); /* Check to see if we can reduce the size of the heap in memory by * eliminating free blocks at the tail of the buffer before flushing the @@ -245,7 +245,7 @@ H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap) /* Truncate the free block */ last_fl->size = H5HL_ALIGN(new_heap_size - last_fl->offset); new_heap_size = last_fl->offset + last_fl->size; - HDassert(last_fl->size >= H5HL_SIZEOF_FREE(f)); + assert(last_fl->size >= H5HL_SIZEOF_FREE(f)); } else { /* Set the size of the memory buffer to the start @@ -261,8 +261,8 @@ H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap) /* Truncate the free block */ last_fl->size = H5HL_ALIGN(new_heap_size - last_fl->offset); new_heap_size = last_fl->offset + last_fl->size; - HDassert(last_fl->size >= H5HL_SIZEOF_FREE(f)); - HDassert(last_fl->size == H5HL_ALIGN(last_fl->size)); + assert(last_fl->size >= H5HL_SIZEOF_FREE(f)); + assert(last_fl->size == H5HL_ALIGN(last_fl->size)); } } } @@ -273,7 +273,7 @@ H5HL__minimize_heap_space(H5F_t *f, H5HL_t *heap) * storage. */ if (new_heap_size != heap->dblk_size) { - HDassert(new_heap_size < heap->dblk_size); + assert(new_heap_size < heap->dblk_size); /* Resize the memory buffer */ if (NULL == (heap->dblk_image = H5FL_BLK_REALLOC(lheap_chunk, heap->dblk_image, new_heap_size))) @@ -315,11 +315,11 @@ H5HL_protect(H5F_t *f, haddr_t addr, unsigned flags) FUNC_ENTER_NOAPI(NULL) /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(H5_addr_defined(addr)); /* Only the H5AC__READ_ONLY_FLAG may appear in flags */ - HDassert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); + assert((flags & (unsigned)(~H5AC__READ_ONLY_FLAG)) == 0); /* Construct the user data for protect callback */ prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); @@ -392,7 +392,7 @@ H5HL_offset_into(const H5HL_t *heap, size_t offset) FUNC_ENTER_NOAPI(NULL) /* Sanity check */ - HDassert(heap); + assert(heap); if (offset >= heap->dblk_size) HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, NULL, "unable to offset into local heap data block"); @@ -422,7 +422,7 @@ H5HL_unprotect(H5HL_t *heap) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(heap); + assert(heap); /* Decrement # of times heap is protected */ heap->prots--; @@ -437,7 +437,7 @@ H5HL_unprotect(H5HL_t *heap) } else { /* Sanity check */ - HDassert(heap->dblk); + assert(heap->dblk); /* Mark local heap data block as evictable again */ /* (data block still pins prefix) */ @@ -504,13 +504,13 @@ H5HL__dirty(H5HL_t *heap) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(heap); - HDassert(heap->prfx); + assert(heap); + assert(heap->prfx); /* Mark heap data block as dirty, if there is one */ if (!heap->single_cache_obj) { /* Sanity check */ - HDassert(heap->dblk); + assert(heap->dblk); if (FAIL == H5AC_mark_entry_dirty(heap->dblk)) HGOTO_ERROR(H5E_HEAP, H5E_CANTMARKDIRTY, FAIL, "unable to mark heap data block as dirty"); @@ -552,11 +552,11 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(f); - HDassert(heap); - HDassert(buf_size > 0); - HDassert(buf); - HDassert(offset_out); + assert(f); + assert(heap); + assert(buf_size > 0); + assert(buf); + assert(offset_out); /* Mark heap as dirty in cache */ /* (A bit early in the process, but it's difficult to determine in the @@ -582,8 +582,8 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of offset = fl->offset; fl->offset += need_size; fl->size -= need_size; - HDassert(fl->offset == H5HL_ALIGN(fl->offset)); - HDassert(fl->size == H5HL_ALIGN(fl->size)); + assert(fl->offset == H5HL_ALIGN(fl->offset)); + assert(fl->size == H5HL_ALIGN(fl->size)); found = TRUE; break; } @@ -627,7 +627,7 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of need_more = need_size; new_dblk_size = heap->dblk_size + need_more; - HDassert(heap->dblk_size < new_dblk_size); + assert(heap->dblk_size < new_dblk_size); old_dblk_size = heap->dblk_size; H5_CHECK_OVERFLOW(heap->dblk_size, size_t, hsize_t); H5_CHECK_OVERFLOW(new_dblk_size, size_t, hsize_t); @@ -669,8 +669,8 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of offset = last_fl->offset; last_fl->offset += need_size; last_fl->size += need_more - need_size; - HDassert(last_fl->offset == H5HL_ALIGN(last_fl->offset)); - HDassert(last_fl->size == H5HL_ALIGN(last_fl->size)); + assert(last_fl->offset == H5HL_ALIGN(last_fl->offset)); + assert(last_fl->size == H5HL_ALIGN(last_fl->size)); if (last_fl->size < H5HL_SIZEOF_FREE(f)) { #ifdef H5HL_DEBUG @@ -692,8 +692,8 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed"); fl->offset = old_dblk_size + need_size; fl->size = need_more - need_size; - HDassert(fl->offset == H5HL_ALIGN(fl->offset)); - HDassert(fl->size == H5HL_ALIGN(fl->size)); + assert(fl->offset == H5HL_ALIGN(fl->offset)); + assert(fl->size == H5HL_ALIGN(fl->size)); fl->prev = NULL; fl->next = heap->freelist; if (heap->freelist) @@ -763,15 +763,15 @@ H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(f); - HDassert(heap); - HDassert(size > 0); - HDassert(offset == H5HL_ALIGN(offset)); + assert(f); + assert(heap); + assert(size > 0); + assert(offset == H5HL_ALIGN(offset)); size = H5HL_ALIGN(size); - HDassert(offset < heap->dblk_size); - HDassert(offset + size <= heap->dblk_size); + assert(offset < heap->dblk_size); + assert(offset + size <= heap->dblk_size); /* Mark heap as dirty in cache * @@ -794,15 +794,15 @@ H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size) if ((offset + size) == fl->offset) { fl->offset = offset; fl->size += size; - HDassert(fl->offset == H5HL_ALIGN(fl->offset)); - HDassert(fl->size == H5HL_ALIGN(fl->size)); + assert(fl->offset == H5HL_ALIGN(fl->offset)); + assert(fl->size == H5HL_ALIGN(fl->size)); fl2 = fl->next; while (fl2) { if ((fl2->offset + fl2->size) == fl->offset) { fl->offset = fl2->offset; fl->size += fl2->size; - HDassert(fl->offset == H5HL_ALIGN(fl->offset)); - HDassert(fl->size == H5HL_ALIGN(fl->size)); + assert(fl->offset == H5HL_ALIGN(fl->offset)); + assert(fl->size == H5HL_ALIGN(fl->size)); fl2 = H5HL__remove_free(heap, fl2); if (((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { if (FAIL == H5HL__minimize_heap_space(f, heap)) @@ -821,11 +821,11 @@ H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size) else if (fl->offset + fl->size == offset) { fl->size += size; fl2 = fl->next; - HDassert(fl->size == H5HL_ALIGN(fl->size)); + assert(fl->size == H5HL_ALIGN(fl->size)); while (fl2) { if (fl->offset + fl->size == fl2->offset) { fl->size += fl2->size; - HDassert(fl->size == H5HL_ALIGN(fl->size)); + assert(fl->size == H5HL_ALIGN(fl->size)); fl2 = H5HL__remove_free(heap, fl2); if (((fl->offset + fl->size) == heap->dblk_size) && ((2 * fl->size) > heap->dblk_size)) { if (FAIL == H5HL__minimize_heap_space(f, heap)) @@ -863,8 +863,8 @@ H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed"); fl->offset = offset; fl->size = size; - HDassert(fl->offset == H5HL_ALIGN(fl->offset)); - HDassert(fl->size == H5HL_ALIGN(fl->size)); + assert(fl->offset == H5HL_ALIGN(fl->offset)); + assert(fl->size == H5HL_ALIGN(fl->size)); fl->prev = NULL; fl->next = heap->freelist; if (heap->freelist) @@ -904,8 +904,8 @@ H5HL_delete(H5F_t *f, haddr_t addr) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); + assert(f); + assert(H5_addr_defined(addr)); /* Construct the user data for protect callback */ prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); @@ -966,9 +966,9 @@ H5HL_get_size(H5F_t *f, haddr_t addr, size_t *size) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(size); + assert(f); + assert(H5_addr_defined(addr)); + assert(size); /* Construct the user data for protect callback */ prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); @@ -1018,9 +1018,9 @@ H5HL_heapsize(H5F_t *f, haddr_t addr, hsize_t *heap_size) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(heap_size); + assert(f); + assert(H5_addr_defined(addr)); + assert(heap_size); /* Construct the user data for protect callback */ prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); diff --git a/src/H5HLcache.c b/src/H5HLcache.c index fcf93d1..f1db854 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -151,9 +151,9 @@ H5HL__hdr_deserialize(H5HL_t *heap, const uint8_t *image, size_t len, H5HL_cache FUNC_ENTER_PACKAGE - HDassert(heap); - HDassert(image); - HDassert(udata); + assert(heap); + assert(image); + assert(udata); /* Magic number */ if (H5_IS_BUFFER_OVERFLOW(image, H5_SIZEOF_MAGIC, p_end)) @@ -220,8 +220,8 @@ H5HL__fl_deserialize(H5HL_t *heap) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(heap); - HDassert(!heap->freelist); + assert(heap); + assert(!heap->freelist); /* Build free list */ free_block = heap->free_block; @@ -288,13 +288,13 @@ H5HL__fl_serialize(const H5HL_t *heap) FUNC_ENTER_PACKAGE_NOERR /* check arguments */ - HDassert(heap); + assert(heap); /* Serialize the free list into the heap data's image */ for (fl = heap->freelist; fl; fl = fl->next) { uint8_t *image; /* Pointer into raw data buffer */ - HDassert(fl->offset == H5HL_ALIGN(fl->offset)); + assert(fl->offset == H5HL_ALIGN(fl->offset)); image = heap->dblk_image + fl->offset; if (fl->next) @@ -329,7 +329,7 @@ H5HL__cache_prefix_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *im FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(image_len); + assert(image_len); /* Set the image length size */ *image_len = H5HL_SPEC_READ_SIZE; @@ -362,10 +362,10 @@ H5HL__cache_prefix_get_final_load_size(const void *_image, size_t image_len, voi FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(image); - HDassert(udata); - HDassert(actual_len); - HDassert(*actual_len == image_len); + assert(image); + assert(udata); + assert(actual_len); + assert(*actual_len == image_len); HDmemset(&heap, 0, sizeof(H5HL_t)); @@ -412,14 +412,14 @@ H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata, hbo FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(len > 0); - HDassert(udata); - HDassert(udata->sizeof_size > 0); - HDassert(udata->sizeof_addr > 0); - HDassert(udata->sizeof_prfx > 0); - HDassert(H5_addr_defined(udata->prfx_addr)); - HDassert(dirty); + assert(image); + assert(len > 0); + assert(udata); + assert(udata->sizeof_size > 0); + assert(udata->sizeof_addr > 0); + assert(udata->sizeof_prfx > 0); + assert(H5_addr_defined(udata->prfx_addr)); + assert(dirty); /* Allocate space in memory for the heap */ if (NULL == (heap = H5HL__new(udata->sizeof_size, udata->sizeof_addr, udata->sizeof_prfx))) @@ -506,9 +506,9 @@ H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(prfx); - HDassert(prfx->cache_info.type == H5AC_LHEAP_PRFX); - HDassert(image_len); + assert(prfx); + assert(prfx->cache_info.type == H5AC_LHEAP_PRFX); + assert(image_len); /* Set the prefix's size */ *image_len = prfx->heap->prfx_size; @@ -549,23 +549,23 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(prfx); - HDassert(prfx->cache_info.type == H5AC_LHEAP_PRFX); - HDassert(H5_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); - HDassert(prfx->heap); + assert(f); + assert(image); + assert(prfx); + assert(prfx->cache_info.type == H5AC_LHEAP_PRFX); + assert(H5_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); + assert(prfx->heap); /* Get the pointer to the heap */ heap = prfx->heap; - HDassert(heap); + assert(heap); #ifndef NDEBUG /* Compute the buffer size */ size_t buf_size = heap->prfx_size; /* expected size of the image buffer */ if (heap->single_cache_obj) buf_size += heap->dblk_size; - HDassert(len == buf_size); + assert(len == buf_size); #endif /* Update the free block value from the free list */ @@ -603,11 +603,11 @@ H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, H5MM_memcpy(image, heap->dblk_image, heap->dblk_size); /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) + heap->dblk_size == len); + assert((size_t)(image - (uint8_t *)_image) + heap->dblk_size == len); } else { /* Sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) <= len); + assert((size_t)(image - (uint8_t *)_image) <= len); /* Clear rest of local heap */ HDmemset(image, 0, len - (size_t)(image - (uint8_t *)_image)); @@ -643,9 +643,9 @@ H5HL__cache_prefix_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(prfx); - HDassert(prfx->cache_info.type == H5AC_LHEAP_PRFX); - HDassert(H5_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); + assert(prfx); + assert(prfx->cache_info.type == H5AC_LHEAP_PRFX); + assert(H5_addr_eq(prfx->cache_info.addr, prfx->heap->prfx_addr)); /* Destroy local heap prefix */ if (H5HL__prfx_dest(prfx) < 0) @@ -678,9 +678,9 @@ H5HL__cache_datablock_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(heap); - HDassert(heap->dblk_size > 0); - HDassert(image_len); + assert(heap); + assert(heap->dblk_size > 0); + assert(image_len); /* Set the image length size */ *image_len = heap->dblk_size; @@ -713,13 +713,13 @@ H5HL__cache_datablock_deserialize(const void *image, size_t len, void *_udata, h FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(len > 0); - HDassert(heap); - HDassert(heap->dblk_size == len); - HDassert(!heap->single_cache_obj); - HDassert(NULL == heap->dblk); - HDassert(dirty); + assert(image); + assert(len > 0); + assert(heap); + assert(heap->dblk_size == len); + assert(!heap->single_cache_obj); + assert(NULL == heap->dblk); + assert(dirty); /* Allocate space in memory for the heap data block */ if (NULL == (dblk = H5HL__dblk_new(heap))) @@ -772,11 +772,11 @@ H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(dblk); - HDassert(dblk->cache_info.type == H5AC_LHEAP_DBLK); - HDassert(dblk->heap); - HDassert(dblk->heap->dblk_size > 0); - HDassert(image_len); + assert(dblk); + assert(dblk->cache_info.type == H5AC_LHEAP_DBLK); + assert(dblk->heap); + assert(dblk->heap->dblk_size > 0); + assert(image_len); *image_len = dblk->heap->dblk_size; @@ -807,14 +807,14 @@ H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *imag FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(dblk); - HDassert(dblk->cache_info.type == H5AC_LHEAP_DBLK); - HDassert(dblk->heap); + assert(f); + assert(image); + assert(dblk); + assert(dblk->cache_info.type == H5AC_LHEAP_DBLK); + assert(dblk->heap); heap = dblk->heap; - HDassert(heap->dblk_size == len); - HDassert(!heap->single_cache_obj); + assert(heap->dblk_size == len); + assert(!heap->single_cache_obj); /* Update the free block value from the free list */ heap->free_block = heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL; @@ -851,7 +851,7 @@ H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dblk); + assert(dblk); switch (action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: @@ -860,8 +860,8 @@ H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_AFTER_LOAD: /* Sanity checks */ - HDassert(dblk->heap); - HDassert(dblk->heap->prfx); + assert(dblk->heap); + assert(dblk->heap->prfx); /* Pin the heap's prefix */ if (FAIL == H5AC_pin_protected_entry(dblk->heap->prfx)) @@ -880,8 +880,8 @@ H5HL__cache_datablock_notify(H5C_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Sanity checks */ - HDassert(dblk->heap); - HDassert(dblk->heap->prfx); + assert(dblk->heap); + assert(dblk->heap->prfx); /* Unpin the local heap prefix */ if (FAIL == H5AC_unpin_entry(dblk->heap->prfx)) @@ -919,8 +919,8 @@ H5HL__cache_datablock_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(dblk); - HDassert(dblk->cache_info.type == H5AC_LHEAP_DBLK); + assert(dblk); + assert(dblk->cache_info.type == H5AC_LHEAP_DBLK); /* Destroy the data block */ if (H5HL__dblk_dest(dblk) < 0) diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c index 5902378..86e522d 100644 --- a/src/H5HLdbg.c +++ b/src/H5HLdbg.c @@ -56,11 +56,11 @@ H5HL_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) FUNC_ENTER_NOAPI(FAIL) /* check arguments */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); if (NULL == (h = (H5HL_t *)H5HL_protect(f, addr, H5AC__READ_ONLY_FLAG))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load/protect local heap") diff --git a/src/H5HLdblk.c b/src/H5HLdblk.c index 73aa9b6..b337ed5 100644 --- a/src/H5HLdblk.c +++ b/src/H5HLdblk.c @@ -89,7 +89,7 @@ H5HL__dblk_new(H5HL_t *heap) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(heap); + assert(heap); /* Allocate new local heap data block */ if (NULL == (dblk = H5FL_CALLOC(H5HL_dblk_t))) @@ -135,7 +135,7 @@ H5HL__dblk_dest(H5HL_dblk_t *dblk) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(dblk); + assert(dblk); /* Check if data block was initialized */ if (dblk->heap) { @@ -182,8 +182,8 @@ H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(heap); - HDassert(new_heap_size > 0); + assert(heap); + assert(new_heap_size > 0); /* Release old space on disk */ old_addr = heap->dblk_addr; @@ -206,8 +206,8 @@ H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size) /* Check if heap data block is contiguous w/prefix */ if (heap->single_cache_obj) { /* Sanity check */ - HDassert(H5_addr_eq(heap->prfx_addr + heap->prfx_size, old_addr)); - HDassert(heap->prfx); + assert(H5_addr_eq(heap->prfx_addr + heap->prfx_size, old_addr)); + assert(heap->prfx); /* Resize the heap prefix in the cache */ if (FAIL == H5AC_resize_entry(heap->prfx, (size_t)(heap->prfx_size + new_heap_size))) @@ -215,8 +215,8 @@ H5HL__dblk_realloc(H5F_t *f, H5HL_t *heap, size_t new_heap_size) } else { /* Sanity check */ - HDassert(H5_addr_ne(heap->prfx_addr + heap->prfx_size, old_addr)); - HDassert(heap->dblk); + assert(H5_addr_ne(heap->prfx_addr + heap->prfx_size, old_addr)); + assert(heap->dblk); /* Resize the heap data block in the cache */ if (H5AC_resize_entry(heap->dblk, (size_t)new_heap_size) < 0) diff --git a/src/H5HLint.c b/src/H5HLint.c index fa879fa..9e7f04c 100644 --- a/src/H5HLint.c +++ b/src/H5HLint.c @@ -88,9 +88,9 @@ H5HL__new(size_t sizeof_size, size_t sizeof_addr, size_t prfx_size) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(sizeof_size > 0); - HDassert(sizeof_addr > 0); - HDassert(prfx_size > 0); + assert(sizeof_size > 0); + assert(sizeof_addr > 0); + assert(prfx_size > 0); /* Allocate new local heap structure */ if (NULL == (heap = H5FL_CALLOC(H5HL_t))) @@ -130,7 +130,7 @@ H5HL__inc_rc(H5HL_t *heap) FUNC_ENTER_PACKAGE_NOERR /* check arguments */ - HDassert(heap); + assert(heap); /* Increment heap's ref. count */ heap->rc++; @@ -158,7 +158,7 @@ H5HL__dec_rc(H5HL_t *heap) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(heap); + assert(heap); /* Decrement heap's ref. count */ heap->rc--; @@ -191,13 +191,13 @@ H5HL__dest(H5HL_t *heap) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(heap); + assert(heap); /* Verify that node is unused */ - HDassert(heap->prots == 0); - HDassert(heap->rc == 0); - HDassert(heap->prfx == NULL); - HDassert(heap->dblk == NULL); + assert(heap->prots == 0); + assert(heap->rc == 0); + assert(heap->prfx == NULL); + assert(heap->dblk == NULL); /* Use DONE errors here to try to free as much as possible */ if (heap->dblk_image) diff --git a/src/H5HLprfx.c b/src/H5HLprfx.c index f81381c..558bdce 100644 --- a/src/H5HLprfx.c +++ b/src/H5HLprfx.c @@ -88,7 +88,7 @@ H5HL__prfx_new(H5HL_t *heap) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(heap); + assert(heap); /* Allocate new local heap prefix */ if (NULL == (prfx = H5FL_CALLOC(H5HL_prfx_t))) @@ -134,7 +134,7 @@ H5HL__prfx_dest(H5HL_prfx_t *prfx) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(prfx); + assert(prfx); /* Check if prefix was initialized */ if (prfx->heap) { diff --git a/src/H5Iint.c b/src/H5Iint.c index ca54af7..f7b4344 100644 --- a/src/H5Iint.c +++ b/src/H5Iint.c @@ -136,7 +136,7 @@ H5I_term_package(void) for (i = 0; i < H5I_next_type_g; i++) { type_info = H5I_type_info_array_g[i]; if (type_info) { - HDassert(NULL == type_info->hash_table); + assert(NULL == type_info->hash_table); type_info = H5MM_xfree(type_info); H5I_type_info_array_g[i] = NULL; in_use++; @@ -167,8 +167,8 @@ H5I_register_type(const H5I_class_t *cls) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(cls); - HDassert(cls->type > 0 && (int)cls->type < H5I_MAX_NUM_TYPES); + assert(cls); + assert(cls->type > 0 && (int)cls->type < H5I_MAX_NUM_TYPES); /* Initialize the type */ if (NULL == H5I_type_info_array_g[cls->type]) { @@ -260,7 +260,7 @@ H5I__unwrap(void *object, H5I_type_t type) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(object); + assert(object); /* The stored object pointer might be an H5VL_object_t, in which * case we'll need to get the wrapped object struct (H5F_t *, etc.). @@ -372,9 +372,9 @@ H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(info); - HDassert(udata); - HDassert(udata->type_info); + assert(info); + assert(udata); + assert(udata->type_info); /* Do nothing to the object if the reference count is larger than * one and forcing is off. @@ -551,7 +551,7 @@ H5I__register(H5I_type_t type, const void *object, hbool_t app_ref, H5I_future_r type_info->nextid++; /* Sanity check for the 'nextid' getting too large and wrapping around */ - HDassert(type_info->nextid <= ID_MASK); + assert(type_info->nextid <= ID_MASK); /* Set the most recent ID to this object */ type_info->last_id_info = info; @@ -581,8 +581,8 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Sanity checks */ - HDassert(type >= H5I_FILE && type < H5I_NTYPES); - HDassert(object); + assert(type >= H5I_FILE && type < H5I_NTYPES); + assert(object); /* Retrieve ID for object */ if (H5I_INVALID_HID == (ret_value = H5I__register(type, object, app_ref, NULL, NULL))) @@ -620,7 +620,7 @@ H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, h FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(object); + assert(object); /* Make sure ID is not already in use */ if (NULL != (info = H5I__find_id(existing_id))) @@ -760,7 +760,7 @@ H5I_object_verify(hid_t id, H5I_type_t type) FUNC_ENTER_NOAPI_NOERR - HDassert(type >= 1 && (int)type < H5I_next_type_g); + assert(type >= 1 && (int)type < H5I_next_type_g); /* Verify that the type of the ID is correct & lookup the ID */ if (type == H5I_TYPE(id) && NULL != (info = H5I__find_id(id))) { @@ -801,7 +801,7 @@ H5I_get_type(hid_t id) if (id > 0) ret_value = H5I_TYPE(id); - HDassert(ret_value >= H5I_BADID && (int)ret_value < H5I_next_type_g); + assert(ret_value >= H5I_BADID && (int)ret_value < H5I_next_type_g); FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_type() */ @@ -910,12 +910,12 @@ H5I__remove_common(H5I_type_info_t *type_info, hid_t id) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(type_info); + assert(type_info); /* Delete or mark the node */ HASH_FIND(hh, type_info->hash_table, &id, sizeof(hid_t), info); if (info) { - HDassert(!info->marked); + assert(!info->marked); if (!H5I_marking_s) HASH_DELETE(hh, type_info->hash_table, info); else @@ -1004,7 +1004,7 @@ H5I__dec_ref(hid_t id, void **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* General lookup of the ID */ if (NULL == (info = H5I__find_id(id))) @@ -1068,7 +1068,7 @@ H5I_dec_ref(hid_t id) FUNC_ENTER_NOAPI((-1)) /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* Synchronously decrement refcount on ID */ if ((ret_value = H5I__dec_ref(id, H5_REQUEST_NULL)) < 0) @@ -1100,7 +1100,7 @@ H5I__dec_app_ref(hid_t id, void **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* Call regular decrement reference count routine */ if ((ret_value = H5I__dec_ref(id, request)) < 0) @@ -1116,7 +1116,7 @@ H5I__dec_app_ref(hid_t id, void **request) /* Adjust app_ref */ --(info->app_count); - HDassert(info->count >= info->app_count); + assert(info->count >= info->app_count); /* Set return value */ ret_value = (int)info->app_count; @@ -1148,7 +1148,7 @@ H5I_dec_app_ref(hid_t id) FUNC_ENTER_NOAPI((-1)) /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* Synchronously decrement refcount on ID */ if ((ret_value = H5I__dec_app_ref(id, H5_REQUEST_NULL)) < 0) @@ -1183,7 +1183,7 @@ H5I_dec_app_ref_async(hid_t id, void **token) FUNC_ENTER_NOAPI((-1)) /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* [Possibly] aynchronously decrement refcount on ID */ if ((ret_value = H5I__dec_app_ref(id, token)) < 0) @@ -1215,7 +1215,7 @@ H5I__dec_app_ref_always_close(hid_t id, void **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* Call application decrement reference count routine */ ret_value = H5I__dec_app_ref(id, request); @@ -1256,7 +1256,7 @@ H5I_dec_app_ref_always_close(hid_t id) FUNC_ENTER_NOAPI((-1)) /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* Synchronously decrement refcount on ID */ if ((ret_value = H5I__dec_app_ref_always_close(id, H5_REQUEST_NULL)) < 0) @@ -1288,7 +1288,7 @@ H5I_dec_app_ref_always_close_async(hid_t id, void **token) FUNC_ENTER_NOAPI((-1)) /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* [Possibly] aynchronously decrement refcount on ID */ if ((ret_value = H5I__dec_app_ref_always_close(id, token)) < 0) @@ -1317,7 +1317,7 @@ H5I_inc_ref(hid_t id, hbool_t app_ref) FUNC_ENTER_NOAPI((-1)) /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* General lookup of the ID */ if (NULL == (info = H5I__find_id(id))) @@ -1354,7 +1354,7 @@ H5I_get_ref(hid_t id, hbool_t app_ref) FUNC_ENTER_NOAPI((-1)) /* Sanity check */ - HDassert(id >= 0); + assert(id >= 0); /* General lookup of the ID */ if (NULL == (info = H5I__find_id(id))) @@ -1386,7 +1386,7 @@ H5I__inc_type_ref(H5I_type_t type) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(type > 0 && (int)type < H5I_next_type_g); + assert(type > 0 && (int)type < H5I_next_type_g); /* Check arguments */ type_info = H5I_type_info_array_g[type]; @@ -1472,7 +1472,7 @@ H5I__get_type_ref(H5I_type_t type) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(type >= 0); + assert(type >= 0); /* Check arguments */ type_info = H5I_type_info_array_g[type]; @@ -1662,7 +1662,7 @@ H5I__find_id(hid_t id) /* Swap the actual object in for the future object */ future_object = (void *)id_info->object; actual_object = H5I__remove_common(type_info, actual_id); - HDassert(actual_object); + assert(actual_object); id_info->object = actual_object; /* Discard the future object */ @@ -1706,8 +1706,8 @@ H5I__find_id_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(info); - HDassert(udata); + assert(info); + assert(udata); /* Get a pointer to the VOL connector's data */ H5_GCC_CLANG_DIAG_OFF("cast-qual") @@ -1742,7 +1742,7 @@ H5I_find_id(const void *object, H5I_type_t type, hid_t *id) FUNC_ENTER_NOAPI(FAIL) - HDassert(id); + assert(id); *id = H5I_INVALID_HID; diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index facd7de..9155418 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -124,7 +124,7 @@ H5L__extern_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, cons FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(p); + assert(p); /* Check external link version & flags */ if (((*p >> 4) & 0x0F) > H5L_EXT_VERSION) diff --git a/src/H5Lint.c b/src/H5Lint.c index b7ee60d..ee223a5 100644 --- a/src/H5Lint.c +++ b/src/H5Lint.c @@ -332,8 +332,8 @@ H5L_register(const H5L_class_t *cls) FUNC_ENTER_NOAPI(FAIL) - HDassert(cls); - HDassert(cls->id >= 0 && cls->id <= H5L_TYPE_MAX); + assert(cls); + assert(cls->id >= 0 && cls->id <= H5L_TYPE_MAX); /* Is the link type already registered? */ for (i = 0; i < H5L_table_used_g; i++) @@ -384,7 +384,7 @@ H5L_unregister(H5L_type_t id) FUNC_ENTER_NOAPI(FAIL) - HDassert(id >= 0 && id <= H5L_TYPE_MAX); + assert(id >= 0 && id <= H5L_TYPE_MAX); /* Is the filter already registered? */ for (i = 0; i < H5L_table_used_g; i++) @@ -422,7 +422,7 @@ H5L_is_registered(H5L_type_t id, hbool_t *is_registered) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(is_registered); + assert(is_registered); /* Is the link class already registered? */ *is_registered = FALSE; @@ -457,9 +457,9 @@ H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, hid FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(new_loc); - HDassert(obj_loc); - HDassert(new_name && *new_name); + assert(new_loc); + assert(obj_loc); + assert(new_name && *new_name); /* The link callback will check that the object isn't being hard linked * into a different file, so we don't need to do it here (there could be @@ -499,9 +499,9 @@ H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, H5O_obj_create_t FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(new_loc); - HDassert(new_name && *new_name); - HDassert(ocrt_info); + assert(new_loc); + assert(new_name && *new_name); + assert(ocrt_info); /* The link callback will check that the object isn't being hard linked * into a different file, so we don't need to do it here (there could be @@ -711,10 +711,10 @@ H5L__create_real(const H5G_loc_t *link_loc, const char *link_name, H5G_name_t *o FUNC_ENTER_PACKAGE /* Check args */ - HDassert(link_loc); - HDassert(link_name && *link_name); - HDassert(lnk); - HDassert(lnk->type >= H5L_TYPE_HARD && lnk->type <= H5L_TYPE_MAX); + assert(link_loc); + assert(link_name && *link_name); + assert(lnk); + assert(lnk->type >= H5L_TYPE_HARD && lnk->type <= H5L_TYPE_MAX); /* Get normalized link name */ if ((norm_link_name = H5G_normalize(link_name)) == NULL) @@ -794,10 +794,10 @@ H5L__create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link FUNC_ENTER_PACKAGE /* Check args */ - HDassert(cur_loc); - HDassert(cur_name && *cur_name); - HDassert(link_loc); - HDassert(link_name && *link_name); + assert(cur_loc); + assert(cur_name && *cur_name); + assert(link_loc); + assert(link_name && *link_name); /* Get normalized copy of the current name */ if ((norm_cur_name = H5G_normalize(cur_name)) == NULL) @@ -860,9 +860,9 @@ H5L__create_soft(const char *target_path, const H5G_loc_t *link_loc, const char FUNC_ENTER_PACKAGE /* Check args */ - HDassert(link_loc); - HDassert(target_path && *target_path); - HDassert(link_name && *link_name); + assert(link_loc); + assert(target_path && *target_path); + assert(link_name && *link_name); /* Get normalized copy of the link target */ if ((norm_target = H5G_normalize(target_path)) == NULL) @@ -907,10 +907,10 @@ H5L__create_ud(const H5G_loc_t *link_loc, const char *link_name, const void *ud_ FUNC_ENTER_PACKAGE /* Check args */ - HDassert(type >= H5L_TYPE_UD_MIN && type <= H5L_TYPE_MAX); - HDassert(link_loc); - HDassert(link_name && *link_name); - HDassert(ud_data_size == 0 || ud_data); + assert(type >= H5L_TYPE_UD_MIN && type <= H5L_TYPE_MAX); + assert(link_loc); + assert(link_name && *link_name); + assert(ud_data_size == 0 || ud_data); /* Initialize the link struct's pointer to its udata buffer */ lnk.u.ud.udata = NULL; @@ -961,7 +961,7 @@ H5L__get_val_real(const H5O_link_t *lnk, void *buf, size_t size) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(lnk); + assert(lnk); /* Check for soft link */ if (H5L_TYPE_SOFT == lnk->type) { @@ -1061,8 +1061,8 @@ H5L__get_val(const H5G_loc_t *loc, const char *name, void *buf /*out*/, size_t s FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(loc); - HDassert(name && *name); + assert(loc); + assert(name && *name); /* Set up user data for retrieving information */ udata.size = size; @@ -1149,8 +1149,8 @@ H5L__get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); - HDassert(name && *name); + assert(loc); + assert(name && *name); /* Set up user data for retrieving information */ udata.idx_type = idx_type; @@ -1237,8 +1237,8 @@ H5L__delete(const H5G_loc_t *loc, const char *name) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(loc); - HDassert(name && *name); + assert(loc); + assert(name && *name); /* Get normalized copy of the name */ if ((norm_name = H5G_normalize(name)) == NULL) @@ -1319,8 +1319,8 @@ H5L__delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(loc); - HDassert(name && *name); + assert(loc); + assert(name && *name); /* Set up user data for unlink operation */ udata.idx_type = idx_type; @@ -1374,7 +1374,7 @@ H5L__move_dest_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "moving a link across files is not allowed") /* Give the object its new name */ - HDassert(udata->lnk->name == NULL); + assert(udata->lnk->name == NULL); H5_GCC_CLANG_DIAG_OFF("cast-qual") udata->lnk->name = (char *)name; H5_GCC_CLANG_DIAG_ON("cast-qual") @@ -1517,7 +1517,7 @@ H5L__move_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk, /* Make certain that the destination name is a full (not relative) path */ if (*(udata->dst_name) != '/') { - HDassert(udata->dst_loc->path->full_path_r); + assert(udata->dst_loc->path->full_path_r); /* Create reference counted string for full dst path */ if ((dst_name_r = H5G_build_fullpath_refstr_str(udata->dst_loc->path->full_path_r, @@ -1526,7 +1526,7 @@ H5L__move_cb(H5G_loc_t *grp_loc /*in*/, const char *name, const H5O_link_t *lnk, } /* end if */ else dst_name_r = H5RS_wrap(udata->dst_name); - HDassert(dst_name_r); + assert(dst_name_r); /* Fix names up */ if (H5G_name_replace(lnk, H5G_NAME_MOVE, obj_loc->oloc->file, obj_loc->path->full_path_r, @@ -1596,10 +1596,10 @@ H5L__move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_l FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(src_loc); - HDassert(dst_loc); - HDassert(src_name && *src_name); - HDassert(dst_name && *dst_name); + assert(src_loc); + assert(dst_loc); + assert(src_name && *src_name); + assert(dst_name && *dst_name); /* Check for flags present in creation property list */ if (lcpl_id != H5P_DEFAULT) { @@ -1761,9 +1761,9 @@ H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hbool_t *exists) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(loc); - HDassert(name); - HDassert(exists); + assert(loc); + assert(name); + assert(exists); /* Copy the name and skip leading '/'s */ name_trav = name_copy = H5MM_strdup(name); @@ -1823,9 +1823,9 @@ H5L__exists(const H5G_loc_t *loc, const char *name, hbool_t *exists) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(loc); - HDassert(name); - HDassert(exists); + assert(loc); + assert(name); + assert(exists); /* A path of "/" will always exist in a file */ if (0 == HDstrcmp(name, "/")) @@ -1978,9 +1978,9 @@ H5L__get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); - HDassert(name && *name); - HDassert(linfo); + assert(loc); + assert(name && *name); + assert(linfo); /* Set up user data for callback */ udata.idx_type = idx_type; @@ -2056,9 +2056,9 @@ H5L__get_name_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t id FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); - HDassert(group_name && *group_name); - HDassert(link_name_len); + assert(loc); + assert(group_name && *group_name); + assert(link_name_len); /* Set up user data for callback */ udata.idx_type = idx_type; @@ -2109,10 +2109,10 @@ H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(dst_file); - HDassert(src_lnk); - HDassert(dst_lnk); - HDassert(cpy_info); + assert(dst_file); + assert(src_lnk); + assert(dst_lnk); + assert(cpy_info); /* Expand soft or external link, if requested */ if ((H5L_TYPE_SOFT == src_lnk->type && cpy_info->expand_soft_link) || @@ -2180,7 +2180,7 @@ H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t tmp_src_oloc.file = src_oloc->file; tmp_src_oloc.addr = src_lnk->u.hard.addr; } /* end if */ - HDassert(H5_addr_defined(tmp_src_oloc.addr)); + assert(H5_addr_defined(tmp_src_oloc.addr)); /* Copy the shared object from source to destination */ /* Don't care about obj_type or udata because those are only important @@ -2195,7 +2195,7 @@ H5L__link_copy_file(H5F_t *dst_file, const H5O_link_t *_src_lnk, const H5O_loc_t done: /* Check if we used a temporary src link */ if (src_lnk != _src_lnk) { - HDassert(src_lnk == &tmp_src_lnk); + assert(src_lnk == &tmp_src_lnk); H5O_msg_reset(H5O_LINK_ID, &tmp_src_lnk); } /* end if */ if (ret_value < 0) @@ -2230,9 +2230,9 @@ H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter FUNC_ENTER_NOAPI_NOINIT /* Sanity checks */ - HDassert(loc); - HDassert(group_name); - HDassert(op); + assert(loc); + assert(group_name); + assert(op); /* Set up iteration beginning/end info */ idx = (idx_p == NULL ? 0 : *idx_p); diff --git a/src/H5M.c b/src/H5M.c index 2469145..1afd540 100644 --- a/src/H5M.c +++ b/src/H5M.c @@ -144,7 +144,7 @@ H5M_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(0 == H5I_nmembers(H5I_MAP)); + assert(0 == H5I_nmembers(H5I_MAP)); /* Destroy the dataset object id group */ n += (H5I_dec_type_ref(H5I_MAP) > 0); @@ -170,7 +170,7 @@ H5M__close_cb(H5VL_object_t *map_vol_obj, void **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(map_vol_obj); + assert(map_vol_obj); /* Set up VOL callback arguments */ vol_cb_args.op_type = H5VL_MAP_CLOSE; diff --git a/src/H5MF.c b/src/H5MF.c index f382789..a54501b 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -49,7 +49,7 @@ #define H5MF_CHECK_FSM(FSM, CF) \ do { \ - HDassert(*CF == FALSE); \ + assert(*CF == FALSE); \ if (!H5_addr_defined(FSM->addr) || !H5_addr_defined(FSM->sect_addr)) \ *CF = TRUE; \ } while (0) @@ -146,8 +146,8 @@ H5MF_init_merge_flags(H5F_shared_t *f_sh) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f_sh); - HDassert(f_sh->lf); + assert(f_sh); + assert(f_sh->lf); /* Iterate over all the free space types to determine if sections of that type * can merge with the metadata or small 'raw' data aggregator @@ -253,8 +253,8 @@ H5MF__alloc_to_fs_type(H5F_shared_t *f_sh, H5FD_mem_t alloc_type, hsize_t size, FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f_sh); - HDassert(fs_type); + assert(f_sh); + assert(fs_type); if (H5F_SHARED_PAGED_AGGR(f_sh)) { /* paged aggregation */ if (size >= f_sh->fs_page_size) { @@ -311,16 +311,16 @@ H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else { - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert((H5FD_mem_t)type != H5FD_MEM_NOLIST); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type != H5FD_MEM_NOLIST); } /* end else */ - HDassert(f->shared); - HDassert(H5_addr_defined(f->shared->fs_addr[type])); - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); + assert(f->shared); + assert(H5_addr_defined(f->shared->fs_addr[type])); + assert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); /* Set up the alignment and threshold to use depending on the manager type */ if (H5F_PAGED_AGGR(f)) { @@ -389,16 +389,16 @@ H5MF__create_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else { - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert((H5FD_mem_t)type != H5FD_MEM_NOLIST); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type != H5FD_MEM_NOLIST); } /* end else */ - HDassert(f->shared); - HDassert(!H5_addr_defined(f->shared->fs_addr[type])); - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); + assert(f->shared); + assert(!H5_addr_defined(f->shared->fs_addr[type])); + assert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED); /* Set the free space creation parameters */ fs_create.client = H5FS_CLIENT_FILE_ID; @@ -464,13 +464,13 @@ H5MF__start_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else { - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert((H5FD_mem_t)type != H5FD_MEM_NOLIST); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type != H5FD_MEM_NOLIST); } /* end else */ /* Check if the free space manager exists already */ @@ -513,12 +513,12 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert(H5_addr_defined(f->shared->fs_addr[type])); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert(H5_addr_defined(f->shared->fs_addr[type])); /* Put address into temporary variable and reset it */ /* (Avoids loopback in file space freeing routine) */ @@ -546,11 +546,11 @@ H5MF__delete_fstype(H5F_t *f, H5F_mem_page_t type) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't delete free space manager") /* Shift [back] to closed state */ - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_DELETING); + assert(f->shared->fs_state[type] == H5F_FS_STATE_DELETING); f->shared->fs_state[type] = H5F_FS_STATE_CLOSED; /* Sanity check that the free space manager for this type wasn't started up again */ - HDassert(!H5_addr_defined(f->shared->fs_addr[type])); + assert(!H5_addr_defined(f->shared->fs_addr[type])); done: /* Reset the ring in the API context */ @@ -583,14 +583,14 @@ H5MF__close_fstype(H5F_t *f, H5F_mem_page_t type) /* * Check arguments. */ - HDassert(f); + assert(f); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); - HDassert(f->shared); - HDassert(f->shared->fs_man[type]); - HDassert(f->shared->fs_state[type] != H5F_FS_STATE_CLOSED); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert(f->shared); + assert(f->shared->fs_man[type]); + assert(f->shared->fs_state[type] != H5F_FS_STATE_CLOSED); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Before closing free space manager\n", __func__); @@ -629,9 +629,9 @@ H5MF__add_sect(H5F_t *f, H5FD_mem_t alloc_type, H5FS_t *fspace, H5MF_free_sectio FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(fspace); - HDassert(node); + assert(f); + assert(fspace); + assert(node); H5MF__alloc_to_fs_type(f->shared, alloc_type, node->sect_info.size, &fs_type); @@ -689,8 +689,8 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(fspace); + assert(f); + assert(fspace); /* Set the ring type in the API context */ if (H5MF__fsm_is_self_referential(f->shared, fspace)) @@ -710,7 +710,7 @@ H5MF__find_sect(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size, H5FS_t *fspace, h /* Check for actually finding section */ if (ret_value) { /* Sanity check */ - HDassert(node); + assert(node); /* Retrieve return value */ if (addr) @@ -780,10 +780,10 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) #endif /* H5MF_ALLOC_DEBUG */ /* check arguments */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(size > 0); H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type); @@ -813,7 +813,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) /* Open the free-space manager */ if (H5MF__open_fstype(f, fs_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, HADDR_UNDEF, "can't initialize file free space") - HDassert(f->shared->fs_man[fs_type]); + assert(f->shared->fs_man[fs_type]); } /* end if */ /* Search for large enough space in the free space manager */ @@ -828,7 +828,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) HDfprintf(stderr, "%s: Check 2.0\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ if (f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE) { - HDassert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); + assert(f->shared->fs_page_size >= H5F_FILE_SPACE_PAGE_SIZE_MIN); if (HADDR_UNDEF == (ret_value = H5MF__alloc_pagefs(f, alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from paged aggregation") @@ -838,7 +838,7 @@ H5MF_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd") } /* end else */ } /* end if */ - HDassert(H5_addr_defined(ret_value)); + assert(H5_addr_defined(ret_value)); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Check 3.0\n", __func__); #endif /* H5MF_ALLOC_DEBUG_MORE */ @@ -908,7 +908,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) /* Get the EOA for the file */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, alloc_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, "Unable to get eoa") - HDassert(!(eoa % f->shared->fs_page_size)); + assert(!(eoa % f->shared->fs_page_size)); H5MF_EOA_MISALIGN(f, (eoa + size), f->shared->fs_page_size, frag_size); @@ -955,7 +955,7 @@ H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) if (!(f->shared->fs_man[ptype])) if (H5MF__start_fstype(f, ptype) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "can't initialize file free space") - HDassert(f->shared->fs_man[ptype]); + assert(f->shared->fs_man[ptype]); if (NULL == (node = H5MF__sect_new(H5MF_FSPACE_SECT_SMALL, (new_page + size), (f->shared->fs_page_size - size)))) @@ -1038,10 +1038,10 @@ H5MF_alloc_tmp(H5F_t *f, hsize_t size) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(size > 0); /* Retrieve the 'eoa' for the file */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) @@ -1091,10 +1091,10 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) #endif /* H5MF_ALLOC_DEBUG */ /* check arguments */ - HDassert(f); + assert(f); if (!H5_addr_defined(addr) || 0 == size) HGOTO_DONE(SUCCEED) - HDassert(addr != 0); /* Can't deallocate the superblock :-) */ + assert(addr != 0); /* Can't deallocate the superblock :-) */ H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type); @@ -1192,7 +1192,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) /* If size of the freed section is larger than threshold, add it to the free space manager */ if (size >= f->shared->fs_threshold) { - HDassert(f->shared->fs_man[fs_type]); + assert(f->shared->fs_man[fs_type]); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Before H5FS_sect_add()\n", __func__); @@ -1288,8 +1288,8 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi #endif /* H5MF_ALLOC_DEBUG */ /* Sanity check */ - HDassert(f); - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(f); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); /* Set mapped type, treating global heap as raw data */ map_type = (alloc_type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : alloc_type; @@ -1315,7 +1315,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi * page boundary if extended */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, alloc_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "Unable to get eoa") - HDassert(!(eoa % f->shared->fs_page_size)); + assert(!(eoa % f->shared->fs_page_size)); H5MF_EOA_MISALIGN(f, (eoa + extra_requested), f->shared->fs_page_size, frag_size); } /* end else */ @@ -1345,7 +1345,7 @@ H5MF_try_extend(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsi H5MF_free_section_t *node = NULL; /* Free space section pointer */ /* Should be large-sized block */ - HDassert(size >= f->shared->fs_page_size); + assert(size >= f->shared->fs_page_size); /* Start up the free-space manager */ if (!(f->shared->fs_man[fs_type])) @@ -1464,15 +1464,15 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) #endif /* H5MF_ALLOC_DEBUG */ /* check arguments */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(H5_addr_defined(addr)); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(H5_addr_defined(addr)); + assert(size > 0); /* Set up free-space section class information */ sect_cls = H5MF_SECT_CLS_TYPE(f, size); - HDassert(sect_cls); + assert(sect_cls); /* Get free space type from allocation type */ H5MF__alloc_to_fs_type(f->shared, alloc_type, size, &fs_type); @@ -1499,7 +1499,7 @@ H5MF_try_shrink(H5F_t *f, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size) if ((ret_value = (*sect_cls->can_shrink)((const H5FS_section_info_t *)node, &udata)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "can't check if section can shrink container") if (ret_value > 0) { - HDassert(sect_cls->shrink); + assert(sect_cls->shrink); if ((*sect_cls->shrink)((H5FS_section_info_t **)&node, &udata) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink container") @@ -1544,8 +1544,8 @@ H5MF_close(H5F_t *f) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (H5F_PAGED_AGGR(f)) { if ((ret_value = H5MF__close_pagefs(f)) < 0) @@ -1588,12 +1588,12 @@ H5MF__close_delete_fstype(H5F_t *f, H5F_mem_page_t type) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if (H5F_PAGED_AGGR(f)) - HDassert(type < H5F_MEM_PAGE_NTYPES); + assert(type < H5F_MEM_PAGE_NTYPES); else - HDassert((H5FD_mem_t)type < H5FD_MEM_NTYPES); + assert((H5FD_mem_t)type < H5FD_MEM_NTYPES); #ifdef H5MF_ALLOC_DEBUG_MORE HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_addr[%u] = %" PRIuHADDR "\n", @@ -1652,7 +1652,7 @@ H5MF_try_close(H5F_t *f) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); + assert(f); /* If there have been no file space allocations / deallocation so * far, must call H5MF_tidy_self_referential_fsm_hack() to float @@ -1759,10 +1759,10 @@ H5MF__close_aggrfs(H5F_t *f) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(f->shared->sblock); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(f->shared->sblock); /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initially set the ring in @@ -1789,7 +1789,7 @@ H5MF__close_aggrfs(H5F_t *f) /* superblock extension and free space manager message should * exist at this point -- verify at least the former. */ - HDassert(H5_addr_defined(f->shared->sblock->ext_addr)); + assert(H5_addr_defined(f->shared->sblock->ext_addr)); /* file space for all non-empty free space managers should be * allocated at this point, and these free space managers should @@ -1832,7 +1832,7 @@ H5MF__close_aggrfs(H5F_t *f) curr_ring = needed_ring; } /* end if */ - HDassert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); + assert(f->shared->fs_state[type] == H5F_FS_STATE_OPEN); if (H5FS_close(f, f->shared->fs_man[type]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") @@ -1845,16 +1845,16 @@ H5MF__close_aggrfs(H5F_t *f) /* verify that we haven't dirtied any metadata cache entries * from the metadata free space manager ring out. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* verify that the aggregators are still shutdown. */ - HDassert(f->shared->sdata_aggr.tot_size == 0); - HDassert(f->shared->sdata_aggr.addr == 0); - HDassert(f->shared->sdata_aggr.size == 0); + assert(f->shared->sdata_aggr.tot_size == 0); + assert(f->shared->sdata_aggr.addr == 0); + assert(f->shared->sdata_aggr.size == 0); - HDassert(f->shared->meta_aggr.tot_size == 0); - HDassert(f->shared->meta_aggr.addr == 0); - HDassert(f->shared->meta_aggr.size == 0); + assert(f->shared->meta_aggr.tot_size == 0); + assert(f->shared->meta_aggr.addr == 0); + assert(f->shared->meta_aggr.size == 0); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ @@ -1869,7 +1869,7 @@ H5MF__close_aggrfs(H5F_t *f) * been no file space allocation or deallocation since file * open. */ - HDassert(H5F_NULL_FSM_ADDR(f) || final_eoa == f->shared->eoa_fsm_fsalloc); + assert(H5F_NULL_FSM_ADDR(f) || final_eoa == f->shared->eoa_fsm_fsalloc); } /* end if */ else { /* super_vers can be 0, 1, 2 */ for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; type++) @@ -1925,12 +1925,12 @@ H5MF__close_pagefs(H5F_t *f) #endif /* H5MF_ALLOC_DEBUG */ /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(f->shared->sblock); - HDassert(f->shared->fs_page_size); - HDassert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(f->shared->sblock); + assert(f->shared->fs_page_size); + assert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initially set the ring in @@ -1961,7 +1961,7 @@ H5MF__close_pagefs(H5F_t *f) /* superblock extension and free space manager message should * exist at this point -- verify at least the former. */ - HDassert(H5_addr_defined(f->shared->sblock->ext_addr)); + assert(H5_addr_defined(f->shared->sblock->ext_addr)); /* file space for all non-empty free space managers should be * allocated at this point, and these free space managers should @@ -1998,7 +1998,7 @@ H5MF__close_pagefs(H5F_t *f) curr_ring = needed_ring; } /* end if */ - HDassert(f->shared->fs_state[ptype] == H5F_FS_STATE_OPEN); + assert(f->shared->fs_state[ptype] == H5F_FS_STATE_OPEN); if (H5FS_close(f, f->shared->fs_man[ptype]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't close free space manager") @@ -2011,7 +2011,7 @@ H5MF__close_pagefs(H5F_t *f) /* verify that we haven't dirtied any metadata cache entries * from the metadata free space manager ring out. */ - HDassert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); + assert(H5AC_cache_is_clean(f, H5AC_RING_MDFSM)); /* Trying shrinking the EOA for the file */ /* (in case any free space is now at the EOA) */ @@ -2038,9 +2038,9 @@ H5MF__close_pagefs(H5F_t *f) * the file driver layer. However, as this possibility seems remote, * it is ignored in the following assert. */ - HDassert((H5F_NULL_FSM_ADDR(f)) || (final_eoa == f->shared->eoa_fsm_fsalloc) || - ((H5_addr_defined(f->shared->eoa_post_mdci_fsalloc)) && - (final_eoa == f->shared->eoa_post_mdci_fsalloc))); + assert((H5F_NULL_FSM_ADDR(f)) || (final_eoa == f->shared->eoa_fsm_fsalloc) || + ((H5_addr_defined(f->shared->eoa_post_mdci_fsalloc)) && + (final_eoa == f->shared->eoa_post_mdci_fsalloc))); } /* end if */ else { /* Iterate over all the free space types that have managers @@ -2101,8 +2101,8 @@ H5MF__close_shrink_eoa(H5F_t *f) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); /* Construct user data for callbacks */ udata.f = f; @@ -2219,9 +2219,9 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); + assert(f); + assert(f->shared); + assert(f->shared->lf); /* Set the ring type in the API context. In most cases, we will * need H5AC_RING_RDFSM, so initially set the ring in @@ -2262,7 +2262,7 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) if (!f->shared->fs_man[type] && H5_addr_defined(f->shared->fs_addr[type])) { if (H5MF__open_fstype(f, type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") - HDassert(f->shared->fs_man[type]); + assert(f->shared->fs_man[type]); fs_started[type] = TRUE; } /* end if */ @@ -2355,9 +2355,9 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); + assert(f); + assert(f->shared); + assert(f->shared->lf); /* H5MF_tidy_self_referential_fsm_hack() will fail if any self * referential FSM is opened prior to the call to it. Thus call @@ -2415,7 +2415,7 @@ H5MF_get_free_sections(H5F_t *f, H5FD_mem_t type, size_t nsects, H5F_sect_info_t if (!f->shared->fs_man[ty] && H5_addr_defined(f->shared->fs_addr[ty])) { if (H5MF__open_fstype(f, ty) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't open the free space manager") - HDassert(f->shared->fs_man[ty]); + assert(f->shared->fs_man[ty]); fs_started = TRUE; } /* end if */ @@ -2498,10 +2498,10 @@ H5MF__get_free_sects(H5F_t *f, H5FS_t *fspace, H5MF_sect_iter_ud_t *sect_udata, FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(sect_udata); - HDassert(nums); - HDassert(fspace); + assert(f); + assert(sect_udata); + assert(nums); + assert(fspace); /* Query how many sections of this type */ if (H5FS_sect_stats(fspace, NULL, &hnums) < 0) @@ -2636,9 +2636,9 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(fsm_settled); + assert(f); + assert(f->shared); + assert(fsm_settled); /* Initialize structs */ HDmemset(&fsinfo, 0, sizeof(fsinfo)); @@ -2653,15 +2653,15 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) hbool_t fsm_visited[H5F_MEM_PAGE_NTYPES]; /* State of FSM */ /* Sanity check */ - HDassert(f->shared->sblock); + assert(f->shared->sblock); /* should only be called if file is opened R/W */ - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); /* shouldn't be called unless we have a superblock supporting the * superblock extension. */ - HDassert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); + assert(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2); /* Initialize fsm_opened and fsm_visited */ HDmemset(fsm_opened, 0, sizeof(fsm_opened)); @@ -2733,15 +2733,15 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5MF__alloc_to_fs_type(f->shared, mem_type, alloc_size, &fsm_type); if (pass_count == 0) { /* this is the first pass */ - HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT); - HDassert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type > H5F_MEM_PAGE_DEFAULT); + assert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); } /* end if */ else if (H5F_PAGED_AGGR(f)) { /* page alloc active */ - HDassert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(fsm_type < H5F_MEM_PAGE_NTYPES); + assert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type < H5F_MEM_PAGE_NTYPES); } /* end else-if */ else /* paged allocation disabled -- should be unreachable */ - HDassert(FALSE); + assert(FALSE); if (!fsm_visited[fsm_type]) { fsm_visited[fsm_type] = TRUE; @@ -2753,7 +2753,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (NULL == f->shared->fs_man[fsm_type]) { if (H5_addr_defined(f->shared->fs_addr[fsm_type])) { /* Sanity check */ - HDassert(fsm_opened[fsm_type] == FALSE); + assert(fsm_opened[fsm_type] == FALSE); if (H5MF__open_fstype(f, fsm_type) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, @@ -2879,15 +2879,15 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5MF__alloc_to_fs_type(f->shared, mem_type, alloc_size, &fsm_type); if (pass_count == 0) { /* this is the first pass */ - HDassert(fsm_type > H5F_MEM_PAGE_DEFAULT); - HDassert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type > H5F_MEM_PAGE_DEFAULT); + assert(fsm_type < H5F_MEM_PAGE_LARGE_SUPER); } /* end if */ else if (H5F_PAGED_AGGR(f)) { /* page alloc active */ - HDassert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(fsm_type < H5F_MEM_PAGE_NTYPES); + assert(fsm_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(fsm_type < H5F_MEM_PAGE_NTYPES); } /* end else-if */ else /* paged allocation disabled -- should be unreachable */ - HDassert(FALSE); + assert(FALSE); /* Test to see if we need to switch rings -- do so if required */ if (H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) @@ -2915,7 +2915,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) */ if (!H5MF__fsm_type_is_self_referential(f->shared, fsm_type)) { /* The current ring should be H5AC_RING_RDFSM */ - HDassert(curr_ring == H5AC_RING_RDFSM); + assert(curr_ring == H5AC_RING_RDFSM); /* Query free space manager info for this type */ if (H5FS_stat_info(f, f->shared->fs_man[fsm_type], &fs_stat) < 0) @@ -2928,7 +2928,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) */ if (fs_stat.serial_sect_count > 0) { /* Sanity check */ - HDassert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.addr)); /* Allocate FSM header */ if (H5FS_alloc_hdr(f, f->shared->fs_man[fsm_type], @@ -2937,8 +2937,8 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) "can't allocated free-space header") /* Allocate FSM section info */ - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); if (H5FS_alloc_sect(f, f->shared->fs_man[fsm_type]) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate free-space section info") @@ -2949,18 +2949,18 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't get free-space info") - HDassert(H5_addr_defined(fs_stat.addr)); - HDassert(H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.serial_sect_count > 0); - HDassert(fs_stat.alloc_sect_size > 0); - HDassert(fs_stat.alloc_sect_size == fs_stat.sect_size); + assert(H5_addr_defined(fs_stat.addr)); + assert(H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.serial_sect_count > 0); + assert(fs_stat.alloc_sect_size > 0); + assert(fs_stat.alloc_sect_size == fs_stat.sect_size); #endif /* NDEBUG */ } /* end if */ else { - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.serial_sect_count == 0); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.serial_sect_count == 0); + assert(fs_stat.alloc_sect_size == 0); } /* end else */ } /* end if */ } /* end if */ @@ -2978,7 +2978,7 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) /* verify that all opened FSMs were closed */ for (fsm_type = H5F_MEM_PAGE_SUPER; fsm_type < H5F_MEM_PAGE_NTYPES; fsm_type++) - HDassert(!fsm_opened[fsm_type]); + assert(!fsm_opened[fsm_type]); /* Indicate that the FSM was settled successfully */ *fsm_settled = TRUE; @@ -3108,9 +3108,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(fsm_settled); + assert(f); + assert(f->shared); + assert(fsm_settled); /* * Only need to settle things if we are persisting free space and @@ -3118,22 +3118,22 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) */ if (f->shared->fs_persist && !H5F_NULL_FSM_ADDR(f)) { /* Sanity check */ - HDassert(f->shared->lf); + assert(f->shared->lf); /* should only be called if file is opened R/W */ - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fs_type); H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fs_type); - HDassert(sm_fshdr_fs_type > H5F_MEM_PAGE_DEFAULT); - HDassert(sm_fshdr_fs_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(sm_fshdr_fs_type > H5F_MEM_PAGE_DEFAULT); + assert(sm_fshdr_fs_type < H5F_MEM_PAGE_LARGE_SUPER); - HDassert(sm_fssinfo_fs_type > H5F_MEM_PAGE_DEFAULT); - HDassert(sm_fssinfo_fs_type < H5F_MEM_PAGE_LARGE_SUPER); + assert(sm_fssinfo_fs_type > H5F_MEM_PAGE_DEFAULT); + assert(sm_fssinfo_fs_type < H5F_MEM_PAGE_LARGE_SUPER); - HDassert(!H5_addr_defined(f->shared->fs_addr[sm_fshdr_fs_type])); - HDassert(!H5_addr_defined(f->shared->fs_addr[sm_fssinfo_fs_type])); + assert(!H5_addr_defined(f->shared->fs_addr[sm_fshdr_fs_type])); + assert(!H5_addr_defined(f->shared->fs_addr[sm_fssinfo_fs_type])); /* Note that in most cases, sm_hdr_fspace will equal sm_sinfo_fspace. */ sm_hdr_fspace = f->shared->fs_man[sm_fshdr_fs_type]; @@ -3145,14 +3145,14 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_FSPACE_SINFO, f->shared->fs_page_size + 1, &lg_fssinfo_fs_type); - HDassert(lg_fshdr_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(lg_fshdr_fs_type < H5F_MEM_PAGE_NTYPES); + assert(lg_fshdr_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(lg_fshdr_fs_type < H5F_MEM_PAGE_NTYPES); - HDassert(lg_fssinfo_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); - HDassert(lg_fssinfo_fs_type < H5F_MEM_PAGE_NTYPES); + assert(lg_fssinfo_fs_type >= H5F_MEM_PAGE_LARGE_SUPER); + assert(lg_fssinfo_fs_type < H5F_MEM_PAGE_NTYPES); - HDassert(!H5_addr_defined(f->shared->fs_addr[lg_fshdr_fs_type])); - HDassert(!H5_addr_defined(f->shared->fs_addr[lg_fssinfo_fs_type])); + assert(!H5_addr_defined(f->shared->fs_addr[lg_fshdr_fs_type])); + assert(!H5_addr_defined(f->shared->fs_addr[lg_fssinfo_fs_type])); /* Note that in most cases, lg_hdr_fspace will equal lg_sinfo_fspace. */ lg_hdr_fspace = f->shared->fs_man[lg_fshdr_fs_type]; @@ -3171,9 +3171,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, sm_hdr_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ /* Verify that sm_sinfo_fspace is floating if it exists and is distinct */ @@ -3182,9 +3182,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, sm_sinfo_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info") - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ if (H5F_PAGED_AGGR(f)) { @@ -3194,9 +3194,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, lg_hdr_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info (3)") - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ /* Verify that lg_sinfo_fspace is floating if it @@ -3207,9 +3207,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) if (H5FS_stat_info(f, lg_sinfo_fspace, &fs_stat) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't get free-space info (4)") - HDassert(!H5_addr_defined(fs_stat.addr)); - HDassert(!H5_addr_defined(fs_stat.sect_addr)); - HDassert(fs_stat.alloc_sect_size == 0); + assert(!H5_addr_defined(fs_stat.addr)); + assert(!H5_addr_defined(fs_stat.sect_addr)); + assert(fs_stat.alloc_sect_size == 0); } /* end if */ } /* end if */ } @@ -3343,8 +3343,8 @@ H5MF__continue_alloc_fsm(H5F_shared_t *f_sh, H5FS_t *sm_hdr_fspace, H5FS_t *sm_s FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(f_sh); - HDassert(continue_alloc_fsm); + assert(f_sh); + assert(continue_alloc_fsm); /* Check sm_hdr_fspace */ if (sm_hdr_fspace && sm_hdr_fspace->serial_sect_count > 0 && sm_hdr_fspace->sinfo) @@ -3395,9 +3395,9 @@ H5MF__fsm_type_is_self_referential(H5F_shared_t *f_sh, H5F_mem_page_t fsm_type) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f_sh); - HDassert(fsm_type >= H5F_MEM_PAGE_DEFAULT); - HDassert(fsm_type < H5F_MEM_PAGE_NTYPES); + assert(f_sh); + assert(fsm_type >= H5F_MEM_PAGE_DEFAULT); + assert(fsm_type < H5F_MEM_PAGE_NTYPES); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm); @@ -3448,8 +3448,8 @@ H5MF__fsm_is_self_referential(H5F_shared_t *f_sh, H5FS_t *fspace) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f_sh); - HDassert(fspace); + assert(f_sh); + assert(fspace); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_HDR, (size_t)1, &sm_fshdr_fsm); H5MF__alloc_to_fs_type(f_sh, H5FD_MEM_FSPACE_SINFO, (size_t)1, &sm_fssinfo_fsm); diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 72f1548..70d807f 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -95,10 +95,10 @@ H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) #endif /* H5MF_AGGR_DEBUG */ /* check arguments */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); - HDassert(size > 0); + assert(f); + assert(f->shared); + assert(f->shared->lf); + assert(size > 0); /* Couldn't find anything from the free space manager, go allocate some */ if (alloc_type != H5FD_MEM_DRAW && alloc_type != H5FD_MEM_GHEAP) { @@ -115,7 +115,7 @@ H5MF_aggr_vfd_alloc(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size) } /* end else */ /* Sanity check for overlapping into file's temporary allocation space */ - HDassert(H5_addr_le((ret_value + size), f->shared->tmp_addr)); + assert(H5_addr_le((ret_value + size), f->shared->tmp_addr)); done: #ifdef H5MF_AGGR_DEBUG @@ -154,16 +154,16 @@ H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5F #endif /* H5MF_AGGR_DEBUG */ /* check args */ - HDassert(f); - HDassert(aggr); - HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || - aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); - HDassert(other_aggr); - HDassert(other_aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || - other_aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); - HDassert(other_aggr->feature_flag != aggr->feature_flag); - HDassert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); - HDassert(size > 0); + assert(f); + assert(aggr); + assert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || + aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); + assert(other_aggr); + assert(other_aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || + other_aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); + assert(other_aggr->feature_flag != aggr->feature_flag); + assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); + assert(size > 0); /* Get the EOA for the file */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, type))) @@ -320,7 +320,7 @@ H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5F * been allocated in an aligned manner if the aggregator * block is larger than the threshold */ if (eoa_frag_size && !alignment) { - HDassert(eoa_frag_addr + eoa_frag_size == new_space); + assert(eoa_frag_addr + eoa_frag_size == new_space); aggr->addr = eoa_frag_addr; aggr->size = aggr->alloc_size + eoa_frag_size; aggr->tot_size = aggr->size; @@ -380,11 +380,11 @@ H5MF__aggr_alloc(H5F_t *f, H5F_blk_aggr_t *aggr, H5F_blk_aggr_t *other_aggr, H5F } /* end else */ /* Sanity check for overlapping into file's temporary allocation space */ - HDassert(H5_addr_le((ret_value + size), f->shared->tmp_addr)); + assert(H5_addr_le((ret_value + size), f->shared->tmp_addr)); /* Post-condition sanity check */ if (H5F_ALIGNMENT(f) && size >= H5F_THRESHOLD(f)) - HDassert(!((ret_value + H5FD_get_base_addr(f->shared->lf)) % H5F_ALIGNMENT(f))); + assert(!((ret_value + H5FD_get_base_addr(f->shared->lf)) % H5F_ALIGNMENT(f))); done: #ifdef H5MF_AGGR_DEBUG @@ -426,10 +426,10 @@ done: FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(aggr); - HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || - aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); + assert(f); + assert(aggr); + assert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || + aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); /* Check if this aggregator is active */ if (f->shared->feature_flags & aggr->feature_flag) { @@ -524,12 +524,12 @@ done: FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(f); - HDassert(aggr); - HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || - aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); - HDassert(sect); - HDassert(shrink); + assert(f); + assert(aggr); + assert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || + aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); + assert(sect); + assert(shrink); /* Check if this aggregator is active */ if (f->shared->feature_flags & aggr->feature_flag) { @@ -578,12 +578,12 @@ done: FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(f); - HDassert(aggr); - HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || - aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); - HDassert(f->shared->feature_flags & aggr->feature_flag); - HDassert(sect); + assert(f); + assert(aggr); + assert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || + aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); + assert(f->shared->feature_flags & aggr->feature_flag); + assert(sect); /* Check if aggregator would get too large and should be absorbed into section */ if ((aggr->size + sect->sect_info.size) >= aggr->alloc_size && allow_sect_absorb) { @@ -601,7 +601,7 @@ done: } /* end if */ else { /* Sanity check */ - HDassert(H5_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr)); + assert(H5_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr)); #ifdef H5MF_AGGR_DEBUG HDfprintf(stderr, @@ -641,7 +641,7 @@ done: } /* end if */ else { /* Sanity check */ - HDassert(H5_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr)); + assert(H5_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr)); #ifdef H5MF_AGGR_DEBUG HDfprintf(stderr, @@ -654,7 +654,7 @@ done: aggr->size += sect->sect_info.size; } /* end if */ /* Sanity check */ - HDassert(!allow_sect_absorb || (aggr->size < aggr->alloc_size)); + assert(!allow_sect_absorb || (aggr->size < aggr->alloc_size)); } /* end else */ FUNC_LEAVE_NOAPI(SUCCEED) @@ -678,10 +678,10 @@ done: FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(f); - HDassert(aggr); - HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || - aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); + assert(f); + assert(aggr); + assert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || + aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); /* Check if this aggregator is active */ if (f->shared->feature_flags & aggr->feature_flag) { @@ -715,10 +715,10 @@ done: FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(aggr); - HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || - aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); + assert(f); + assert(aggr); + assert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || + aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); /* Set the type of memory in the file */ alloc_type = (aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA @@ -780,9 +780,9 @@ done: FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->lf); + assert(f); + assert(f->shared); + assert(f->shared->lf); /* Retrieve metadata aggregator info, if available */ if (H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size) < 0) @@ -840,10 +840,10 @@ done: FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(aggr); - HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || - aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); + assert(f); + assert(aggr); + assert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || + aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); /* Get the EOA for the file */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, type))) @@ -878,15 +878,15 @@ done: FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(f->shared->lf); - HDassert(aggr); - HDassert(H5_addr_defined(aggr->addr)); - HDassert(aggr->size > 0); - HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); - HDassert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || - aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); - HDassert(f->shared->feature_flags & aggr->feature_flag); + assert(f); + assert(f->shared->lf); + assert(aggr); + assert(H5_addr_defined(aggr->addr)); + assert(aggr->size > 0); + assert(H5F_INTENT(f) & H5F_ACC_RDWR); + assert(aggr->feature_flag == H5FD_FEAT_AGGREGATE_METADATA || + aggr->feature_flag == H5FD_FEAT_AGGREGATE_SMALLDATA); + assert(f->shared->feature_flags & aggr->feature_flag); /* Free the remaining space at EOA in the aggregator */ if (H5F__free(f, type, aggr->addr, aggr->size) < 0) @@ -923,8 +923,8 @@ done: FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(f->shared); + assert(f); + assert(f->shared); if ((ma_status = H5MF__aggr_can_shrink_eoa(f, H5FD_MEM_DEFAULT, &(f->shared->meta_aggr))) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats") diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index 017579a..6b9f897 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -99,8 +99,8 @@ H5MF__sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) /* * Check arguments. */ - HDassert(sect); - HDassert(udata); + assert(sect); + assert(udata); /* Print generic section information */ HDfprintf(udata->stream, "%*s%-*s %s\n", udata->indent, "", udata->fwidth, "Section type:", @@ -150,10 +150,10 @@ H5MF_sects_debug(H5F_t *f, haddr_t fs_addr, FILE *stream, int indent, int fwidth /* * Check arguments. */ - HDassert(f); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); for (type = H5F_MEM_PAGE_DEFAULT; type < H5F_MEM_PAGE_NTYPES; type++) if (H5_addr_eq(f->shared->fs_addr[type], fs_addr)) { @@ -215,8 +215,8 @@ H5MF__sects_dump(H5F_t *f, FILE *stream) /* * Check arguments. */ - HDassert(f); - HDassert(stream); + assert(f); + assert(stream); /* Retrieve the 'eoa' for the file */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT))) diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 8107ad3..f2ed3b2 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -193,7 +193,7 @@ H5MF__sect_new(unsigned ctype, haddr_t sect_off, hsize_t sect_size) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect_size); + assert(sect_size); /* Create free space section node */ if (NULL == (sect = H5FL_MALLOC(H5MF_free_section_t))) @@ -236,7 +236,7 @@ H5MF__sect_free(H5FS_section_info_t *_sect) FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect); + assert(sect); /* Release the section */ sect = H5FL_FREE(H5MF_free_section_t, sect); @@ -267,9 +267,9 @@ H5MF__sect_deserialize(const H5FS_section_class_t *cls, const uint8_t H5_ATTR_UN FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(cls); - HDassert(H5_addr_defined(sect_addr)); - HDassert(sect_size); + assert(cls); + assert(H5_addr_defined(sect_addr)); + assert(sect_size); /* Create free space section for block */ if (NULL == (sect = H5MF__sect_new(cls->type, sect_addr, sect_size))) @@ -309,7 +309,7 @@ H5MF__sect_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5FS_sect FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect); + assert(sect); FUNC_LEAVE_NOAPI(SUCCEED) } /* H5MF__sect_valid() */ @@ -376,10 +376,10 @@ H5MF__sect_simple_can_merge(const H5FS_section_info_t *_sect1, const H5FS_sectio FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect1); - HDassert(sect2); - HDassert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ - HDassert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); + assert(sect1); + assert(sect2); + assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ + assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); /* Check if second section adjoins first section */ ret_value = H5_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr); @@ -413,11 +413,11 @@ H5MF__sect_simple_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect1); - HDassert((*sect1)->sect_info.type == H5MF_FSPACE_SECT_SIMPLE); - HDassert(sect2); - HDassert(sect2->sect_info.type == H5MF_FSPACE_SECT_SIMPLE); - HDassert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); + assert(sect1); + assert((*sect1)->sect_info.type == H5MF_FSPACE_SECT_SIMPLE); + assert(sect2); + assert(sect2->sect_info.type == H5MF_FSPACE_SECT_SIMPLE); + assert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); /* Add second section's size to first section */ (*sect1)->sect_info.size += sect2->sect_info.size; @@ -455,9 +455,9 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect); - HDassert(udata); - HDassert(udata->f); + assert(sect); + assert(udata); + assert(udata->f); /* Retrieve the end of the file's address space */ if (HADDR_UNDEF == (eoa = H5F_get_eoa(udata->f, udata->alloc_type))) @@ -559,14 +559,14 @@ H5MF__sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect); - HDassert(udata); - HDassert(udata->f); + assert(sect); + assert(udata); + assert(udata->f); /* Check for shrinking file */ if (H5MF_SHRINK_EOA == udata->shrink) { /* Sanity check */ - HDassert(H5F_INTENT(udata->f) & H5F_ACC_RDWR); + assert(H5F_INTENT(udata->f) & H5F_ACC_RDWR); /* Release section's space at EOA */ if (H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0) @@ -574,7 +574,7 @@ H5MF__sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata) } /* end if */ else { /* Sanity check */ - HDassert(udata->aggr); + assert(udata->aggr); /* Absorb the section into the aggregator or vice versa */ if (H5MF__aggr_absorb(udata->f, udata->aggr, *sect, udata->allow_sect_absorb) < 0) @@ -690,10 +690,10 @@ H5MF__sect_small_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect1); - HDassert(sect2); - HDassert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ - HDassert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); + assert(sect1); + assert(sect2); + assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ + assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); /* Check if second section adjoins first section */ ret_value = H5_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr); @@ -737,11 +737,11 @@ H5MF__sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2 FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect1); - HDassert((*sect1)->sect_info.type == H5MF_FSPACE_SECT_SMALL); - HDassert(sect2); - HDassert(sect2->sect_info.type == H5MF_FSPACE_SECT_SMALL); - HDassert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); + assert(sect1); + assert((*sect1)->sect_info.type == H5MF_FSPACE_SECT_SMALL); + assert(sect2); + assert(sect2->sect_info.type == H5MF_FSPACE_SECT_SMALL); + assert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); /* Add second section's size to first section */ (*sect1)->sect_info.size += sect2->sect_info.size; @@ -800,10 +800,10 @@ H5MF__sect_large_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section FUNC_ENTER_PACKAGE_NOERR /* Check arguments. */ - HDassert(sect1); - HDassert(sect2); - HDassert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ - HDassert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); + assert(sect1); + assert(sect2); + assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ + assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); ret_value = H5_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr); @@ -838,11 +838,11 @@ H5MF__sect_large_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2 FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect1); - HDassert((*sect1)->sect_info.type == H5MF_FSPACE_SECT_LARGE); - HDassert(sect2); - HDassert(sect2->sect_info.type == H5MF_FSPACE_SECT_LARGE); - HDassert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); + assert(sect1); + assert((*sect1)->sect_info.type == H5MF_FSPACE_SECT_LARGE); + assert(sect2); + assert(sect2->sect_info.type == H5MF_FSPACE_SECT_LARGE); + assert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); /* Add second section's size to first section */ (*sect1)->sect_info.size += sect2->sect_info.size; @@ -879,10 +879,10 @@ H5MF__sect_large_can_shrink(const H5FS_section_info_t *_sect, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect); - HDassert(sect->sect_info.type == H5MF_FSPACE_SECT_LARGE); - HDassert(udata); - HDassert(udata->f); + assert(sect); + assert(sect->sect_info.type == H5MF_FSPACE_SECT_LARGE); + assert(udata); + assert(udata->f); /* Retrieve the end of the file's address space */ if (HADDR_UNDEF == (eoa = H5FD_get_eoa(udata->f->shared->lf, udata->alloc_type))) @@ -932,13 +932,13 @@ H5MF__sect_large_shrink(H5FS_section_info_t **_sect, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(sect); - HDassert((*sect)->sect_info.type == H5MF_FSPACE_SECT_LARGE); - HDassert(udata); - HDassert(udata->f); - HDassert(udata->shrink == H5MF_SHRINK_EOA); - HDassert(H5F_INTENT(udata->f) & H5F_ACC_RDWR); - HDassert(H5F_PAGED_AGGR(udata->f)); + assert(sect); + assert((*sect)->sect_info.type == H5MF_FSPACE_SECT_LARGE); + assert(udata); + assert(udata->f); + assert(udata->shrink == H5MF_SHRINK_EOA); + assert(H5F_INTENT(udata->f) & H5F_ACC_RDWR); + assert(H5F_PAGED_AGGR(udata->f)); /* Calculate possible mis-aligned fragment */ H5MF_EOA_MISALIGN(udata->f, (*sect)->sect_info.addr, udata->f->shared->fs_page_size, frag_size); diff --git a/src/H5MM.c b/src/H5MM.c index aa4c6ce..28281f8 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -301,11 +301,11 @@ H5MM_memcpy(void *dest, const void *src, size_t n) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(dest); - HDassert(src); + assert(dest); + assert(src); /* Check for buffer overlap */ - HDassert((char *)dest >= (const char *)src + n || (const char *)src >= (char *)dest + n); + assert((char *)dest >= (const char *)src + n || (const char *)src >= (char *)dest + n); /* Copy */ ret = HDmemcpy(dest, src, n); diff --git a/src/H5O.c b/src/H5O.c index f782152..5fa8a15 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -2235,7 +2235,7 @@ H5O__are_mdc_flushes_disabled(const H5O_loc_t *oloc, hbool_t *are_disabled) FUNC_ENTER_PACKAGE - HDassert(are_disabled); + assert(are_disabled); if (H5AC_cork(oloc->file, oloc->addr, H5AC__GET_CORKED, are_disabled) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to retrieve object's cork status"); diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index b5e21ef..fd651e3 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -100,8 +100,8 @@ H5O__ainfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); sizeof_addr = H5F_sizeof_addr(f); @@ -186,9 +186,9 @@ H5O__ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(ainfo); + assert(f); + assert(p); + assert(ainfo); /* Message version */ *p++ = H5O_AINFO_VERSION; @@ -212,7 +212,7 @@ H5O__ainfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c if (ainfo->index_corder) H5F_addr_encode(f, &p, ainfo->corder_bt2_addr); else - HDassert(!H5_addr_defined(ainfo->corder_bt2_addr)); + assert(!H5_addr_defined(ainfo->corder_bt2_addr)); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__ainfo_encode() */ @@ -241,7 +241,7 @@ H5O__ainfo_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(ainfo); + assert(ainfo); if (!dest && NULL == (dest = H5FL_MALLOC(H5O_ainfo_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -309,7 +309,7 @@ H5O__ainfo_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_ainfo_t, mesg); @@ -339,9 +339,9 @@ H5O__ainfo_delete(H5F_t *f, H5O_t H5_ATTR_NDEBUG_UNUSED *open_oh, void *_mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(ainfo); - HDassert(open_oh); + assert(f); + assert(ainfo); + assert(open_oh); /* If the object is using "dense" attribute storage, delete it */ if (H5_addr_defined(ainfo->fheap_addr)) @@ -374,8 +374,8 @@ H5O__ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUS FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(deleted); - HDassert(cpy_info); + assert(deleted); + assert(cpy_info); /* If we are not copying attributes into the destination file, indicate * that this message should be deleted. @@ -411,11 +411,11 @@ H5O__ainfo_copy_file(H5F_t H5_ATTR_NDEBUG_UNUSED *file_src, void *mesg_src, H5F_ FUNC_ENTER_PACKAGE /* check args */ - HDassert(file_src); - HDassert(ainfo_src); - HDassert(file_dst); - HDassert(cpy_info); - HDassert(!cpy_info->copy_without_attr); + assert(file_src); + assert(ainfo_src); + assert(file_dst); + assert(cpy_info); + assert(!cpy_info->copy_without_attr); /* Allocate space for the destination message */ if (NULL == (ainfo_dst = H5FL_MALLOC(H5O_ainfo_t))) @@ -473,7 +473,7 @@ H5O__ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_l FUNC_ENTER_PACKAGE - HDassert(ainfo_src); + assert(ainfo_src); if (H5_addr_defined(ainfo_src->fheap_addr)) if (H5A__dense_post_copy_file_all(src_oloc, ainfo_src, dst_oloc, (H5O_ainfo_t *)mesg_dst, cpy_info) < @@ -504,11 +504,11 @@ H5O__ainfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int i FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(ainfo); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(ainfo); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, "Number of attributes:", ainfo->nattrs); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 000a850..85351b8 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -108,11 +108,11 @@ H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_ FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(oh->version > H5O_VERSION_1); - HDassert(chk_dirtied); - HDassert(new_gap_loc); - HDassert(new_gap_size); + assert(oh); + assert(oh->version > H5O_VERSION_1); + assert(chk_dirtied); + assert(new_gap_loc); + assert(new_gap_size); #ifndef NDEBUG if (chunkno > 0) { @@ -124,7 +124,7 @@ H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_ "unable to check metadata cache status for object header chunk proxy") /* Make certain that object header is protected */ - HDassert(chk_proxy_status & H5AC_ES__IS_PROTECTED); + assert(chk_proxy_status & H5AC_ES__IS_PROTECTED); } /* end if */ #endif /* NDEBUG */ @@ -135,7 +135,7 @@ H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_ /* (a null message that's not the one we are eliminating) */ if (H5O_NULL_ID == oh->mesg[u].type->id && oh->mesg[u].chunkno == chunkno && u != idx) { /* Sanity check - chunks with null messages shouldn't have a gap */ - HDassert(oh->chunk[chunkno].gap == 0); + assert(oh->chunk[chunkno].gap == 0); /* Eliminate the gap in the chunk */ if (H5O__eliminate_gap(oh, chk_dirtied, &oh->mesg[u], new_gap_loc, new_gap_size) < 0) @@ -231,12 +231,12 @@ H5O__eliminate_gap(H5O_t *oh, hbool_t *chk_dirtied, H5O_mesg_t *mesg, uint8_t *g FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(oh); - HDassert(oh->version > H5O_VERSION_1); - HDassert(chk_dirtied); - HDassert(mesg); - HDassert(gap_loc); - HDassert(gap_size); + assert(oh); + assert(oh->version > H5O_VERSION_1); + assert(chk_dirtied); + assert(mesg); + assert(gap_loc); + assert(gap_size); /* Check if the null message is before or after the gap produced */ null_before_gap = (hbool_t)(mesg->raw < gap_loc); @@ -331,9 +331,9 @@ H5O__alloc_null(H5F_t *f, H5O_t *oh, size_t null_idx, const H5O_msg_class_t *new FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(new_type); - HDassert(new_size); + assert(oh); + assert(new_type); + assert(new_size); /* Point to null message to allocate out of */ alloc_msg = &oh->mesg[null_idx]; @@ -439,7 +439,7 @@ H5O__alloc_msgs(H5O_t *oh, size_t min_alloc) FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); + assert(oh); /* Initialize number of messages information */ old_alloc = oh->alloc_nmesgs; @@ -509,12 +509,12 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size FUNC_ENTER_PACKAGE /* check args */ - HDassert(f != NULL); - HDassert(oh != NULL); - HDassert(chunkno < oh->nchunks); - HDassert(size > 0); - HDassert(msg_idx != NULL); - HDassert(H5_addr_defined(oh->chunk[chunkno].addr)); + assert(f != NULL); + assert(oh != NULL); + assert(chunkno < oh->nchunks); + assert(size > 0); + assert(msg_idx != NULL); + assert(H5_addr_defined(oh->chunk[chunkno].addr)); /* Test to see if the specified chunk ends with a null messages. * If successful, set the index of the null message in extend_msg. @@ -535,7 +535,7 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size /* If we can extend an existing null message, adjust the delta appropriately */ if (extended_msg) { - HDassert(oh->chunk[chunkno].gap == 0); + assert(oh->chunk[chunkno].gap == 0); delta = aligned_size - oh->mesg[extend_msg].raw_size; } /* end if */ else @@ -547,7 +547,7 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size uint64_t chunk0_size; /* Size of chunk 0's data */ size_t orig_prfx_size = (size_t)1 << (oh->flags & H5O_HDR_CHUNK0_SIZE); /* Original prefix size */ - HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); + assert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); /* Check for moving to a 8-byte size encoding */ @@ -659,7 +659,7 @@ H5O__alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size, size HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header chunk") /* Adjust size in continuation message */ - HDassert(((H5O_cont_t *)(oh->mesg[u].native))->size == old_size); + assert(((H5O_cont_t *)(oh->mesg[u].native))->size == old_size); ((H5O_cont_t *)(oh->mesg[u].native))->size = oh->chunk[chunkno].size; /* Flag continuation message as dirty */ @@ -725,11 +725,11 @@ H5O__alloc_find_best_nonnull(const H5F_t *f, const H5O_t *oh, size_t *size, H5O_ FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(f); - HDassert(oh); - HDassert(size); - HDassert(*size > 0); - HDassert(found_msg); + assert(f); + assert(oh); + assert(size); + assert(*size > 0); + assert(found_msg); /* * Find the smallest message that could be moved to make room for the @@ -881,10 +881,10 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); - HDassert(found_msg); - HDassert(new_idx); + assert(f); + assert(oh); + assert(found_msg); + assert(new_idx); /* * The total chunk size must include the requested space plus enough @@ -892,7 +892,7 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ * aligned properly. */ size = MAX(H5O_MIN_SIZE, size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh)); - HDassert(size == H5O_ALIGN_OH(oh, size)); + assert(size == H5O_ALIGN_OH(oh, size)); /* * The total chunk size must include enough space for the checksum @@ -966,7 +966,7 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ oh->nmesgs--; } /* end if */ else { - HDassert(curr_msg->type->id != H5O_CONT_ID); + assert(curr_msg->type->id != H5O_CONT_ID); /* Copy the raw data */ H5MM_memcpy(p, curr_msg->raw - (size_t)H5O_SIZEOF_MSGHDR_OH(oh), @@ -997,7 +997,7 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ (size_t)H5O_SIZEOF_MSGHDR_OH(oh); null_msg->chunkno = chunkno - 1; - HDassert(null_msg->raw_size >= cont_size); + assert(null_msg->raw_size >= cont_size); /* Remove any gap in the chunk */ oh->chunk[chunkno - 1].gap = 0; @@ -1040,7 +1040,7 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ /* Add any available space after the message to move to the new null message */ if (found_msg->gap_size > 0) { /* Absorb a gap after the moved message */ - HDassert(oh->chunk[null_msg->chunkno].gap == found_msg->gap_size); + assert(oh->chunk[null_msg->chunkno].gap == found_msg->gap_size); null_msg->raw_size += found_msg->gap_size; oh->chunk[null_msg->chunkno].gap = 0; } /* end if */ @@ -1049,8 +1049,8 @@ H5O__alloc_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t found_null, const H5O_ &oh->mesg[found_msg->null_msgno]; /* Pointer to NULL message to eliminate */ /* Absorb a null message after the moved message */ - HDassert((null_msg->raw + null_msg->raw_size) == - (old_null_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh))); + assert((null_msg->raw + null_msg->raw_size) == + (old_null_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh))); null_msg->raw_size += found_msg->null_size; /* Release any information/memory for message */ @@ -1155,8 +1155,8 @@ H5O__alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size, size_t *new_idx) FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(size > 0); + assert(oh); + assert(size > 0); size = H5O_ALIGN_OH(oh, size); /* Find the smallest null message that could hold a continuation message */ @@ -1202,9 +1202,9 @@ H5O__alloc_find_best_null(const H5O_t *oh, size_t size, size_t *mesg_idx) FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(oh); - HDassert(size > 0); - HDassert(mesg_idx); + assert(oh); + assert(size > 0); + assert(mesg_idx); /* Find the smallest null message that could hold the new object header message */ found_null = -1; @@ -1277,10 +1277,10 @@ H5O__alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const void *mesg, s FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(type); - HDassert(mesg); - HDassert(mesg_idx); + assert(oh); + assert(type); + assert(mesg); + assert(mesg_idx); /* Compute the size needed to store the message in the object header */ raw_size = (type->raw_size)(f, FALSE, mesg); @@ -1319,7 +1319,7 @@ H5O__alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const void *mesg, s if (H5O__alloc_new_chunk(f, oh, raw_size, &idx) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "unable to create a new object header data chunk") } /* end if */ - HDassert(idx < oh->nmesgs); + assert(idx < oh->nmesgs); /* Split the null message and point at continuation message */ if (H5O__alloc_null(f, oh, idx, type, NULL, aligned_size) < 0) @@ -1359,9 +1359,9 @@ H5O__release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); - HDassert(mesg); + assert(f); + assert(oh); + assert(mesg); /* Check if we should operate on the message */ if (adj_link) @@ -1379,8 +1379,8 @@ H5O__release_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link) /* Change message type to nil and zero it */ mesg->type = H5O_MSG_NULL; - HDassert(mesg->raw + mesg->raw_size <= (oh->chunk[mesg->chunkno].image + oh->chunk[mesg->chunkno].size) - - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[mesg->chunkno].gap)); + assert(mesg->raw + mesg->raw_size <= (oh->chunk[mesg->chunkno].image + oh->chunk[mesg->chunkno].size) - + (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[mesg->chunkno].gap)); HDmemset(mesg->raw, 0, mesg->raw_size); /* Clear message flags */ @@ -1433,8 +1433,8 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) FUNC_ENTER_PACKAGE /* Check arguments. */ - HDassert(f); - HDassert(oh); + assert(f); + assert(oh); /* Get initial information */ cont_msg = &oh->mesg[cont_u]; @@ -1454,7 +1454,7 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) if (curr_msg->chunkno == deleted_chunkno) { /* Find size of all non-null messages in the chunk pointed to by the continuation message */ if (curr_msg->type->id != H5O_NULL_ID) { - HDassert(curr_msg->type->id != H5O_CONT_ID); + assert(curr_msg->type->id != H5O_CONT_ID); nonnull_size += curr_msg->raw_size + (size_t)H5O_SIZEOF_MSGHDR_OH(oh); } /* end if */ } /* end if */ @@ -1512,7 +1512,7 @@ H5O__move_cont(H5F_t *f, H5O_t *oh, unsigned cont_u) if (H5O__chunk_delete(f, oh, deleted_chunkno) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to remove chunk from cache") - HDassert(move_start <= (move_end + gap_size)); + assert(move_start <= (move_end + gap_size)); /* Check if there is space remaining in the continuation message */ /* (The remaining space can be gap or a null message) */ @@ -1605,7 +1605,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); + assert(oh); /* Loop until no messages packed */ /* (Double loop is not very efficient, but it would be some extra work to @@ -1679,7 +1679,7 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) } /* end if */ } /* end for */ /* Should have been message after null message */ - HDassert(v < oh->nmesgs); + assert(v < oh->nmesgs); } /* end if */ } /* end if */ else { @@ -1729,8 +1729,8 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) /* The other chunks involved should never be * chunk 0 */ - HDassert(curr_msg->chunkno > 0); - HDassert(((H5O_cont_t *)(curr_msg->native))->chunkno > 0); + assert(curr_msg->chunkno > 0); + assert(((H5O_cont_t *)(curr_msg->native))->chunkno > 0); /* Protect continuation message target chunk */ if (NULL == (cont_targ_chk_proxy = H5O__chunk_protect( @@ -1743,9 +1743,9 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) if (cont_targ_chk_proxy->fd_parent) { /* Remove flush dependency on old continuation * message chunk */ - HDassert(cont_targ_chk_proxy); - HDassert(curr_chk_proxy); - HDassert((void *)curr_chk_proxy == cont_targ_chk_proxy->fd_parent); + assert(cont_targ_chk_proxy); + assert(curr_chk_proxy); + assert((void *)curr_chk_proxy == cont_targ_chk_proxy->fd_parent); if (H5AC_destroy_flush_dependency(curr_chk_proxy, cont_targ_chk_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNDEPEND, FAIL, @@ -1757,10 +1757,9 @@ H5O__move_msgs_forward(H5F_t *f, H5O_t *oh) /* Avoid (another) flush dependency on chunk 0 */ if (0 != null_msg->chunkno) { /* Sanity checks */ - HDassert(null_chk_mdc_obj); - HDassert(((H5C_cache_entry_t *)null_chk_mdc_obj)->type); - HDassert(((H5C_cache_entry_t *)null_chk_mdc_obj)->type->id == - H5AC_OHDR_CHK_ID); + assert(null_chk_mdc_obj); + assert(((H5C_cache_entry_t *)null_chk_mdc_obj)->type); + assert(((H5C_cache_entry_t *)null_chk_mdc_obj)->type->id == H5AC_OHDR_CHK_ID); /* Create flush dependency on new continuation * message chunk */ @@ -1948,7 +1947,7 @@ done: "unable to unprotect continuation message target object header chunk") } /* end if */ else - HDassert(!null_chk_proxy && !curr_chk_proxy && !cont_targ_chk_proxy); + assert(!null_chk_proxy && !curr_chk_proxy && !cont_targ_chk_proxy); FUNC_LEAVE_NOAPI(ret_value) } /* H5O__move_msgs_forward() */ @@ -1976,7 +1975,7 @@ H5O__merge_null(H5F_t *f, H5O_t *oh) FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh != NULL); + assert(oh != NULL); /* Loop until no messages merged */ /* (Double loop is not very efficient, but it would be some extra work to add @@ -1996,7 +1995,7 @@ H5O__merge_null(H5F_t *f, H5O_t *oh) unsigned v; /* Local index variable */ /* Should be no gaps in chunk with null message */ - HDassert(oh->chunk[curr_msg->chunkno].gap == 0); + assert(oh->chunk[curr_msg->chunkno].gap == 0); /* Loop over messages again, looking for null message in same chunk */ for (v = 0, curr_msg2 = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg2++) { @@ -2124,7 +2123,7 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh) FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh != NULL); + assert(oh != NULL); /* Loop until no chunks are freed */ do { @@ -2164,7 +2163,7 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh) ((H5O_cont_t *)(cont_msg->native))->chunkno = w; break; } /* end if */ - HDassert(((H5O_cont_t *)(cont_msg->native))->chunkno > 0); + assert(((H5O_cont_t *)(cont_msg->native))->chunkno > 0); } /* end if */ /* Check for correct chunk to delete */ @@ -2173,9 +2172,9 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh) } /* end if */ } /* end for */ /* Must be a continuation message that points to chunk containing null message */ - HDassert(v < oh->nmesgs); - HDassert(cont_msg); - HDassert(((H5O_cont_t *)(cont_msg->native))->chunkno == null_msg->chunkno); + assert(v < oh->nmesgs); + assert(cont_msg); + assert(((H5O_cont_t *)(cont_msg->native))->chunkno == null_msg->chunkno); /* Initialize information about null message */ null_msg_no = u; @@ -2239,7 +2238,7 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh) /* Adjust chunk # for messages in chunks after deleted chunk */ for (u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) { /* Sanity check - there should be no messages in deleted chunk */ - HDassert(curr_msg->chunkno != deleted_chunkno); + assert(curr_msg->chunkno != deleted_chunkno); /* Adjust chunk index for messages in later chunks */ if (curr_msg->chunkno > deleted_chunkno) @@ -2261,7 +2260,7 @@ H5O__remove_empty_chunks(H5F_t *f, H5O_t *oh) ((H5O_cont_t *)(curr_msg->native))->chunkno = w; break; } /* end if */ - HDassert(((H5O_cont_t *)(curr_msg->native))->chunkno > 0); + assert(((H5O_cont_t *)(curr_msg->native))->chunkno > 0); } /* end if */ else { /* Check for pointer to chunk after deleted chunk */ @@ -2312,7 +2311,7 @@ H5O__condense_header(H5F_t *f, H5O_t *oh) FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh != NULL); + assert(oh != NULL); /* Loop until no changed to the object header messages & chunks */ do { @@ -2383,8 +2382,8 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); + assert(f); + assert(oh); /* Protect chunk */ if (NULL == (chk_proxy = H5O__chunk_protect(f, oh, chunkno))) @@ -2435,7 +2434,7 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) /* Check if the chunk is too small, extend if necessary */ total_msg_size = new_size - (size_t)(chunkno == 0 ? H5O_SIZEOF_HDR(oh) : H5O_SIZEOF_CHKHDR_OH(oh)); if (total_msg_size < min_chunk_size) { - HDassert(oh->alloc_nmesgs > oh->nmesgs); + assert(oh->alloc_nmesgs > oh->nmesgs); oh->nmesgs++; /* Initialize new null message to make the chunk large enough */ @@ -2517,7 +2516,7 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to protect object header chunk") /* Adjust size of continuation message */ - HDassert(((H5O_cont_t *)(curr_msg->native))->size == old_size); + assert(((H5O_cont_t *)(curr_msg->native))->size == old_size); ((H5O_cont_t *)(curr_msg->native))->size = chunk->size; /* Flag continuation message as dirty */ @@ -2529,7 +2528,7 @@ H5O__alloc_shrink_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno) } /* end if */ } /* end for */ - HDassert(new_size <= old_size); + assert(new_size <= old_size); /* Resize the chunk in the cache */ if (H5O__chunk_resize(oh, chk_proxy) < 0) diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 20eeae3..587dd43 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -132,8 +132,8 @@ H5O__attr_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flags, u FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (NULL == (attr = H5FL_CALLOC(H5A_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -332,9 +332,9 @@ H5O__attr_encode(H5F_t *f, uint8_t *p, const void *mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(p); - HDassert(attr); + assert(f); + assert(p); + assert(attr); /* Check whether datatype and dataspace are shared */ if ((is_type_shared = H5O_msg_is_shared(H5O_DTYPE_ID, attr->shared->dt)) < 0) @@ -434,7 +434,7 @@ H5O__attr_copy(const void *_src, void *_dst) FUNC_ENTER_PACKAGE /* check args */ - HDassert(_src); + assert(_src); /* copy */ if (NULL == (ret_value = (H5A_t *)H5A__copy((H5A_t *)_dst, (const H5A_t *)_src))) @@ -469,7 +469,7 @@ H5O__attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) FUNC_ENTER_PACKAGE_NOERR - HDassert(attr); + assert(attr); /* Common size information */ ret_value = 1 + /*version */ @@ -499,7 +499,7 @@ H5O__attr_size(const H5F_t H5_ATTR_UNUSED *f, const void *_mesg) attr->shared->ds_size + /*dataspace */ attr->shared->data_size; /*the data itself */ else - HDassert(0 && "Bad attribute version"); + assert(0 && "Bad attribute version"); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__attr_size() */ @@ -545,7 +545,7 @@ H5O__attr_free(void *mesg) FUNC_ENTER_PACKAGE - HDassert(mesg); + assert(mesg); if (H5A__close(attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "unable to close attribute object") @@ -575,8 +575,8 @@ H5O__attr_delete(H5F_t *f, H5O_t *oh, void *_mesg) FUNC_ENTER_NOAPI_NOINIT /* check args */ - HDassert(f); - HDassert(attr); + assert(f); + assert(attr); /* Decrement reference count on datatype in file */ if ((H5O_MSG_DTYPE->del)(f, oh, attr->shared->dt) < 0) @@ -612,8 +612,8 @@ H5O__attr_link(H5F_t *f, H5O_t *oh, void *_mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(attr); + assert(f); + assert(attr); /* Re-share attribute's datatype and dataspace to increment their * reference count if they're shared. @@ -653,9 +653,9 @@ H5O__attr_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *native_src, FUNC_ENTER_PACKAGE /* check args */ - HDassert(deleted); - HDassert(cpy_info); - HDassert(cpy_info->file_dst); + assert(deleted); + assert(cpy_info); + assert(cpy_info->file_dst); /* Check to ensure that the version of the message to be copied does not exceed * the message version allowed by the destination file's high bound. @@ -696,10 +696,10 @@ H5O__attr_copy_file(H5F_t *file_src, const H5O_msg_class_t H5_ATTR_UNUSED *mesg_ FUNC_ENTER_PACKAGE /* check args */ - HDassert(native_src); - HDassert(file_dst); - HDassert(cpy_info); - HDassert(!cpy_info->copy_without_attr); + assert(native_src); + assert(file_dst); + assert(cpy_info); + assert(!cpy_info->copy_without_attr); /* Mark datatype as being on disk now. This step used to be done in a lower level * by H5O_dtype_decode. But it has been moved up. Not an ideal place, but no better @@ -765,8 +765,8 @@ H5O__attr_get_crt_index(const void *_mesg, H5O_msg_crt_idx_t *crt_idx /*out*/) FUNC_ENTER_PACKAGE_NOERR - HDassert(attr); - HDassert(crt_idx); + assert(attr); + assert(crt_idx); /* Get the attribute's creation index */ *crt_idx = attr->shared->crt_idx; @@ -793,7 +793,7 @@ H5O__attr_set_crt_index(void *_mesg, H5O_msg_crt_idx_t crt_idx) FUNC_ENTER_PACKAGE_NOERR - HDassert(attr); + assert(attr); /* Set the creation index */ attr->shared->crt_idx = crt_idx; @@ -830,10 +830,10 @@ H5O__attr_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidt FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, "Name:", mesg->shared->name); switch (mesg->shared->encoding) { diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 736b915..b7ccafb 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -164,12 +164,12 @@ H5O__attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_U FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(mesg); - HDassert(udata); - HDassert(udata->f); - HDassert(udata->ainfo); - HDassert(attr); + assert(oh); + assert(mesg); + assert(udata); + assert(udata->f); + assert(udata->ainfo); + assert(attr); /* Insert attribute into dense storage */ if (H5A__dense_insert(udata->f, udata->ainfo, attr) < 0) @@ -210,8 +210,8 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) FUNC_ENTER_NOAPI_NOINIT /* Check arguments */ - HDassert(loc); - HDassert(attr); + assert(loc); + assert(attr); /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) @@ -240,9 +240,9 @@ H5O__attr_create(const H5O_loc_t *loc, H5A_t *attr) } /* end if */ else { /* Sanity check attribute info read in */ - HDassert(ainfo.nattrs > 0); - HDassert(ainfo.track_corder == ((oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) > 0)); - HDassert(ainfo.index_corder == ((oh->flags & H5O_HDR_ATTR_CRT_ORDER_INDEXED) > 0)); + assert(ainfo.nattrs > 0); + assert(ainfo.track_corder == ((oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) > 0)); + assert(ainfo.index_corder == ((oh->flags & H5O_HDR_ATTR_CRT_ORDER_INDEXED) > 0)); } /* end else */ /* Check if switching to "dense" attribute storage is possible */ @@ -404,9 +404,9 @@ H5O__attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(mesg); - HDassert(!udata->attr); + assert(oh); + assert(mesg); + assert(!udata->attr); /* Check for correct attribute message to modify */ if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { @@ -452,8 +452,8 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ - HDassert(loc); - HDassert(name); + assert(loc); + assert(name); /* Protect the object header to iterate over */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -502,7 +502,7 @@ H5O__attr_open_by_name(const H5O_loc_t *loc, const char *name) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, NULL, "can't locate attribute: '%s'", name) /* Get attribute opened from object header */ - HDassert(udata.attr); + assert(udata.attr); opened_attr = udata.attr; } /* end else */ @@ -547,8 +547,8 @@ H5O__attr_open_by_idx_cb(const H5A_t *attr, void *_ret_attr) FUNC_ENTER_PACKAGE /* check arguments */ - HDassert(attr); - HDassert(ret_attr); + assert(attr); + assert(ret_attr); /* Copy attribute information. Shared some attribute information. */ if (NULL == (*ret_attr = H5A__copy(NULL, attr))) @@ -583,7 +583,7 @@ H5O__attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order_t FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); + assert(loc); /* Build attribute operator info */ attr_op.op_type = H5A_ATTR_OP_LIB; @@ -731,8 +731,8 @@ H5O__attr_update_shared(H5F_t *f, H5O_t *oh, H5A_t *attr, H5O_shared_t *update_s FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(attr); + assert(f); + assert(attr); /* Extract shared message info from current attribute (for later use) */ if (H5O_set_shared(&sh_mesg, &(attr->sh_loc)) < 0) @@ -805,9 +805,9 @@ H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNUS FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(mesg); - HDassert(!udata->found); + assert(oh); + assert(mesg); + assert(!udata->found); /* Check for correct attribute message to modify */ if (0 == HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->attr->shared->name)) { @@ -820,9 +820,9 @@ H5O__attr_write_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNUS * The shared attribute structure will be different in that situation. SLU-2010/7/29 */ if (((H5A_t *)mesg->native)->shared != udata->attr->shared) { /* Sanity check */ - HDassert(((H5A_t *)mesg->native)->shared->data); - HDassert(udata->attr->shared->data); - HDassert(((H5A_t *)mesg->native)->shared->data != udata->attr->shared->data); + assert(((H5A_t *)mesg->native)->shared->data); + assert(udata->attr->shared->data); + assert(((H5A_t *)mesg->native)->shared->data != udata->attr->shared->data); /* (Needs to occur before updating the shared message, or the hash * value on the old & new messages will be the same) */ @@ -885,8 +885,8 @@ H5O__attr_write(const H5O_loc_t *loc, H5A_t *attr) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); - HDassert(attr); + assert(loc); + assert(attr); /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) @@ -961,9 +961,9 @@ H5O__attr_rename_chk_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg /*in,out*/, FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(oh); - HDassert(mesg); - HDassert(!udata->found); + assert(oh); + assert(mesg); + assert(!udata->found); /* Check for existing attribute with new name */ if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->new_name) == 0) { @@ -1007,9 +1007,9 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(mesg); - HDassert(!udata->found); + assert(oh); + assert(mesg); + assert(!udata->found); /* Find correct attribute message to rename */ if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->old_name) == 0) { @@ -1045,7 +1045,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR } /* end if */ else { /* Sanity check */ - HDassert(H5O_msg_is_shared(H5O_ATTR_ID, (H5A_t *)mesg->native) == FALSE); + assert(H5O_msg_is_shared(H5O_ATTR_ID, (H5A_t *)mesg->native) == FALSE); /* Check for attribute message changing size */ if (HDstrlen(udata->new_name) != HDstrlen(udata->old_name) || @@ -1083,7 +1083,7 @@ H5O__attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR "unable to relocate renamed attribute in header") /* Sanity check */ - HDassert(H5O_msg_is_shared(H5O_ATTR_ID, attr) == FALSE); + assert(H5O_msg_is_shared(H5O_ATTR_ID, attr) == FALSE); /* Close the local copy of the attribute */ H5A__close(attr); @@ -1130,9 +1130,9 @@ H5O__attr_rename(const H5O_loc_t *loc, const char *old_name, const char *new_nam FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ - HDassert(loc); - HDassert(old_name); - HDassert(new_name); + assert(loc); + assert(old_name); + assert(new_name); /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) @@ -1218,10 +1218,10 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, H5_index_t idx_type, H FUNC_ENTER_NOAPI_NOINIT_TAG(loc->addr) /* Check arguments */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(attr_op); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(attr_op); /* Protect the object header to iterate over */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -1302,7 +1302,7 @@ H5O__attr_iterate(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsiz FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(attr_op); + assert(attr_op); /* Look up location for location ID */ if (H5G_loc(loc_id, &loc) < 0) @@ -1346,9 +1346,9 @@ H5O__attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(loc); - HDassert(oh); - HDassert(ainfo); + assert(loc); + assert(oh); + assert(ainfo); /* Decrement the number of attributes on the object */ ainfo->nattrs--; @@ -1466,9 +1466,9 @@ H5O__attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned H5_ATTR_UNU FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(mesg); - HDassert(!udata->found); + assert(oh); + assert(mesg); + assert(!udata->found); /* Check for correct attribute message to modify */ if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { @@ -1513,8 +1513,8 @@ H5O__attr_remove(const H5O_loc_t *loc, const char *name) FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ - HDassert(loc); - HDassert(name); + assert(loc); + assert(name); /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) @@ -1595,7 +1595,7 @@ H5O__attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5_iter_order FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ - HDassert(loc); + assert(loc); /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) @@ -1681,9 +1681,9 @@ H5O__attr_count_real(H5F_t *f, H5O_t *oh, hsize_t *nattrs) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(oh); - HDassert(nattrs); + assert(f); + assert(oh); + assert(nattrs); /* Check for attributes stored densely */ if (oh->version > H5O_VERSION_1) { @@ -1737,8 +1737,8 @@ H5O__attr_exists_cb(H5O_t H5_ATTR_UNUSED *oh, H5O_mesg_t *mesg /*in,out*/, unsig FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(mesg); - HDassert(udata->exists && !*udata->exists); + assert(mesg); + assert(udata->exists && !*udata->exists); /* Check for correct attribute message */ if (HDstrcmp(((H5A_t *)mesg->native)->shared->name, udata->name) == 0) { @@ -1774,9 +1774,9 @@ H5O__attr_exists(const H5O_loc_t *loc, const char *name, hbool_t *attr_exists) FUNC_ENTER_PACKAGE_TAG(loc->addr) /* Check arguments */ - HDassert(loc); - HDassert(name); - HDassert(attr_exists); + assert(loc); + assert(name); + assert(attr_exists); /* Protect the object header to iterate over */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -1840,9 +1840,9 @@ H5O__attr_bh_info(H5F_t *f, H5O_t *oh, H5_ih_info_t *bh_info) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(oh); - HDassert(bh_info); + assert(f); + assert(oh); + assert(bh_info); /* Attributes are only stored in fractal heap & indexed w/v2 B-tree in later versions */ if (oh->version > H5O_VERSION_1) { diff --git a/src/H5Obogus.c b/src/H5Obogus.c index 1b83ed1..491dbf9 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -107,8 +107,8 @@ H5O__bogus_decode(H5F_t *f, H5O_t H5_ATTR_NDEBUG_UNUSED *open_oh, unsigned H5_AT FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Allocate the bogus message */ if (NULL == (mesg = (H5O_bogus_t *)H5MM_calloc(sizeof(H5O_bogus_t)))) @@ -151,9 +151,9 @@ H5O__bogus_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(mesg); + assert(f); + assert(p); + assert(mesg); /* encode */ UINT32ENCODE(p, H5O_BOGUS_VALUE); @@ -207,11 +207,11 @@ H5O__bogus_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int i FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s `%u'\n", indent, "", fwidth, "Bogus Value:", mesg->u); diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index c21b3b9..8da10a9 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -79,8 +79,8 @@ H5O__btreek_decode(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Version of message */ if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) @@ -133,9 +133,9 @@ H5O__btreek_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_share FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(p); - HDassert(mesg); + assert(f); + assert(p); + assert(mesg); /* Store version and non-default v1 B-tree 'K' values */ *p++ = H5O_BTREEK_VERSION; @@ -170,7 +170,7 @@ H5O__btreek_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(mesg); + assert(mesg); if (!dest && NULL == (dest = (H5O_btreek_t *)H5MM_malloc(sizeof(H5O_btreek_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, @@ -209,7 +209,7 @@ H5O__btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_s FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); + assert(f); ret_value = 1 + /* Version number */ 2 + /* Chunked storage internal B-tree 'K' value */ @@ -239,11 +239,11 @@ H5O__btreek_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Chunked storage internal B-tree 'K' value:", mesg->btree_k[H5B_CHUNK_ID]); diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 48de673..dd1a640 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -153,7 +153,7 @@ H5O__cache_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *image_len) { FUNC_ENTER_PACKAGE_NOERR - HDassert(image_len); + assert(image_len); /* Set the image length size */ *image_len = H5O_SPEC_READ_SIZE; @@ -177,17 +177,17 @@ H5O__cache_get_final_load_size(const void *image, size_t image_len, void *_udata FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(udata); - HDassert(actual_len); - HDassert(*actual_len == image_len); + assert(image); + assert(udata); + assert(actual_len); + assert(*actual_len == image_len); /* Deserialize the object header prefix */ if (H5O__prefix_deserialize((const uint8_t *)image, image_len, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, FAIL, "can't deserialize object header prefix") /* Sanity check */ - HDassert(udata->oh); + assert(udata->oh); /* Set the final size for the cache image */ *actual_len = udata->chunk0_size + (size_t)H5O_SIZEOF_HDR(udata->oh); @@ -215,9 +215,9 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) FUNC_ENTER_PACKAGE_NOERR - HDassert(image); - HDassert(udata); - HDassert(udata->oh); + assert(image); + assert(udata); + assert(udata->oh); /* There is no checksum for version 1 */ if (udata->oh->version != H5O_VERSION_1) { @@ -229,9 +229,9 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) if (stored_chksum != computed_chksum) { /* These fields are not deserialized yet in H5O__prefix_deserialize() */ - HDassert(udata->oh->chunk == NULL); - HDassert(udata->oh->mesg == NULL); - HDassert(udata->oh->proxy == NULL); + assert(udata->oh->chunk == NULL); + assert(udata->oh->mesg == NULL); + assert(udata->oh->proxy == NULL); /* Indicate that udata->oh is to be freed later in H5O__prefix_deserialize() */ @@ -240,7 +240,7 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) } } else - HDassert(!(udata->common.file_intent & H5F_ACC_SWMR_WRITE)); + assert(!(udata->common.file_intent & H5F_ACC_SWMR_WRITE)); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O__cache_verify_chksum() */ @@ -271,12 +271,12 @@ H5O__cache_deserialize(const void *image, size_t len, void *_udata, hbool_t *dir FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(len > 0); - HDassert(udata); - HDassert(udata->common.f); - HDassert(udata->common.cont_msg_info); - HDassert(dirty); + assert(image); + assert(len > 0); + assert(udata); + assert(udata->common.f); + assert(udata->common.cont_msg_info); + assert(dirty); /* Check for partially deserialized object header * @@ -288,7 +288,7 @@ H5O__cache_deserialize(const void *image, size_t len, void *_udata, hbool_t *dir /* Deserialize the object header prefix */ if (H5O__prefix_deserialize((const uint8_t *)image, len, udata) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, NULL, "can't deserialize object header prefix") - HDassert(udata->oh); + assert(udata->oh); } /* Retrieve partially deserialized object header from user data */ @@ -343,9 +343,9 @@ H5O__cache_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(oh); - HDassert(oh->cache_info.type == H5AC_OHDR); - HDassert(image_len); + assert(oh); + assert(oh->cache_info.type == H5AC_OHDR); + assert(image_len); /* Report the object header's prefix+first chunk length */ *image_len = oh->chunk[0].size; @@ -371,11 +371,11 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(image); - HDassert(oh); - HDassert(oh->cache_info.type == H5AC_OHDR); - HDassert(oh->chunk[0].size == len); + assert(f); + assert(image); + assert(oh); + assert(oh->cache_info.type == H5AC_OHDR); + assert(oh->chunk[0].size == len); #ifdef H5O_DEBUG H5O__assert(oh); #endif /* H5O_DEBUG */ @@ -393,11 +393,11 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing) if (oh->version > H5O_VERSION_1) { uint64_t chunk0_size; /* Size of chunk 0's data */ - HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); + assert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); /* Verify magic number */ - HDassert(!HDmemcmp(chunk_image, H5O_HDR_MAGIC, H5_SIZEOF_MAGIC)); + assert(!HDmemcmp(chunk_image, H5O_HDR_MAGIC, H5_SIZEOF_MAGIC)); chunk_image += H5_SIZEOF_MAGIC; /* Version */ @@ -423,18 +423,18 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing) /* First chunk size */ switch (oh->flags & H5O_HDR_CHUNK0_SIZE) { case 0: /* 1 byte size */ - HDassert(chunk0_size < 256); + assert(chunk0_size < 256); *chunk_image++ = (uint8_t)chunk0_size; break; case 1: /* 2 byte size */ - HDassert(chunk0_size < 65536); + assert(chunk0_size < 65536); UINT16ENCODE(chunk_image, chunk0_size); break; case 2: /* 4 byte size */ /* use <= 2**32 -1 to stay within 4 bytes integer range */ - HDassert(chunk0_size <= 4294967295UL); + assert(chunk0_size <= 4294967295UL); UINT32ENCODE(chunk_image, chunk0_size); break; @@ -472,8 +472,8 @@ H5O__cache_serialize(const H5F_t *f, void *image, size_t len, void *_thing) chunk_image += (size_t)(H5O_SIZEOF_HDR(oh) - 12); } - HDassert((size_t)(chunk_image - oh->chunk[0].image) == - (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + assert((size_t)(chunk_image - oh->chunk[0].image) == + (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); /* Serialize messages for this chunk */ if (H5O__chunk_serialize(f, oh, (unsigned)0) < 0) @@ -505,14 +505,14 @@ H5O__cache_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE - HDassert(oh); + assert(oh); switch (action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: case H5AC_NOTIFY_ACTION_AFTER_LOAD: if (oh->swmr_write) { /* Sanity check */ - HDassert(oh->proxy); + assert(oh->proxy); /* Register the object header as a parent of the virtual entry */ if (H5AC_proxy_entry_add_parent(oh->proxy, oh) < 0) @@ -577,8 +577,8 @@ H5O__cache_free_icr(void *_thing) FUNC_ENTER_PACKAGE - HDassert(oh); - HDassert(oh->cache_info.type == H5AC_OHDR); + assert(oh); + assert(oh->cache_info.type == H5AC_OHDR); /* Destroy object header */ if (H5O__free(oh, FALSE) < 0) @@ -605,9 +605,9 @@ H5O__cache_chk_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(udata); - HDassert(udata->oh); - HDassert(image_len); + assert(udata); + assert(udata->oh); + assert(image_len); /* Set the image length size */ *image_len = udata->size; @@ -634,7 +634,7 @@ H5O__cache_chk_verify_chksum(const void *_image, size_t len, void *_udata) FUNC_ENTER_PACKAGE_NOERR - HDassert(image); + assert(image); /* There is no checksum for version 1 */ if (udata->oh->version != H5O_VERSION_1) { @@ -671,11 +671,11 @@ H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, hbool_t FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(len > 0); - HDassert(udata); - HDassert(udata->oh); - HDassert(dirty); + assert(image); + assert(len > 0); + assert(udata); + assert(udata->oh); + assert(dirty); /* Allocate space for the object header data structure */ if (NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) @@ -684,8 +684,8 @@ H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, hbool_t /* Check if we are still decoding the object header */ /* (as opposed to bringing a piece of it back from the file) */ if (udata->decoding) { - HDassert(udata->common.f); - HDassert(udata->common.cont_msg_info); + assert(udata->common.f); + assert(udata->common.cont_msg_info); /* Parse the chunk */ if (H5O__chunk_deserialize(udata->oh, udata->common.addr, udata->size, (const uint8_t *)image, len, @@ -697,7 +697,7 @@ H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, hbool_t } else { /* Sanity check */ - HDassert(udata->chunkno < udata->oh->nchunks); + assert(udata->chunkno < udata->oh->nchunks); /* Set the chunk number for the chunk proxy */ chk_proxy->chunkno = udata->chunkno; @@ -705,8 +705,8 @@ H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, hbool_t /* Sanity check that the chunk representation we have in memory is * the same as the one being brought in from disk. */ - HDassert(0 == HDmemcmp(image, udata->oh->chunk[chk_proxy->chunkno].image, - udata->oh->chunk[chk_proxy->chunkno].size)); + assert(0 == HDmemcmp(image, udata->oh->chunk[chk_proxy->chunkno].image, + udata->oh->chunk[chk_proxy->chunkno].size)); } /* Increment reference count of object header */ @@ -741,10 +741,10 @@ H5O__cache_chk_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR - HDassert(chk_proxy); - HDassert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); - HDassert(chk_proxy->oh); - HDassert(image_len); + assert(chk_proxy); + assert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); + assert(chk_proxy->oh); + assert(image_len); *image_len = chk_proxy->oh->chunk[chk_proxy->chunkno].size; @@ -770,12 +770,12 @@ H5O__cache_chk_serialize(const H5F_t *f, void *image, size_t len, void *_thing) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(image); - HDassert(chk_proxy); - HDassert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); - HDassert(chk_proxy->oh); - HDassert(chk_proxy->oh->chunk[chk_proxy->chunkno].size == len); + assert(f); + assert(image); + assert(chk_proxy); + assert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); + assert(chk_proxy->oh); + assert(chk_proxy->oh->chunk[chk_proxy->chunkno].size == len); /* Serialize messages for this chunk */ if (H5O__chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0) @@ -806,8 +806,8 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) FUNC_ENTER_PACKAGE - HDassert(chk_proxy); - HDassert(chk_proxy->oh); + assert(chk_proxy); + assert(chk_proxy->oh); switch (action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: @@ -816,9 +816,9 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) /* Add flush dependency on chunk with continuation, if one exists */ if (chk_proxy->fd_parent) { /* Sanity checks */ - HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type); - HDassert((((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_ID) || - (((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_CHK_ID)); + assert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type); + assert((((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_ID) || + (((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_CHK_ID)); /* Add flush dependency from chunk containing the continuation message * that points to this chunk (either oh or another chunk proxy object) @@ -836,7 +836,7 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) /* Add flush dependency on object header proxy, if proxy exists */ { /* Sanity check */ - HDassert(chk_proxy->oh->proxy); + assert(chk_proxy->oh->proxy); /* Register the object header chunk as a parent of the virtual entry */ if (H5AC_proxy_entry_add_parent(chk_proxy->oh->proxy, chk_proxy) < 0) @@ -872,9 +872,9 @@ H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing) /* Remove flush dependency on parent object header chunk, if one is set */ if (chk_proxy->fd_parent) { /* Sanity checks */ - HDassert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type); - HDassert((((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_ID) || - (((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_CHK_ID)); + assert(((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type); + assert((((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_ID) || + (((H5C_cache_entry_t *)(chk_proxy->fd_parent))->type->id == H5AC_OHDR_CHK_ID)); if (H5AC_destroy_flush_dependency(chk_proxy->fd_parent, chk_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNDEPEND, FAIL, "unable to destroy flush dependency") @@ -917,8 +917,8 @@ H5O__cache_chk_free_icr(void *_thing) FUNC_ENTER_PACKAGE - HDassert(chk_proxy); - HDassert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); + assert(chk_proxy); + assert(chk_proxy->cache_info.type == H5AC_OHDR_CHK); /* Destroy object header chunk proxy */ if (H5O__chunk_dest(chk_proxy) < 0) @@ -945,8 +945,8 @@ H5O__add_cont_msg(H5O_cont_msgs_t *cont_msg_info, const H5O_cont_t *cont) FUNC_ENTER_PACKAGE - HDassert(cont_msg_info); - HDassert(cont); + assert(cont_msg_info); + assert(cont); /* Increase chunk array size, if necessary */ if (cont_msg_info->nmsgs >= cont_msg_info->alloc_nmsgs) { @@ -987,8 +987,8 @@ H5O__prefix_deserialize(const uint8_t *_image, size_t len, H5O_cache_ud_t *udata FUNC_ENTER_PACKAGE - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* Allocate space for the new object header data structure */ if (NULL == (oh = H5FL_CALLOC(H5O_t))) @@ -1147,7 +1147,7 @@ H5O__prefix_deserialize(const uint8_t *_image, size_t len, H5O_cache_ud_t *udata */ if (udata->free_oh) { H5O_t *saved_oh = udata->oh; - HDassert(udata->oh); + assert(udata->oh); /* Save the object header for later use in 'deserialize' callback */ udata->oh = oh; @@ -1194,12 +1194,12 @@ H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t chunk_size, const uint8_t FUNC_ENTER_PACKAGE - HDassert(oh); - HDassert(H5_addr_defined(addr)); - HDassert(image); - HDassert(len); - HDassert(udata->f); - HDassert(udata->cont_msg_info); + assert(oh); + assert(H5_addr_defined(addr)); + assert(image); + assert(len); + assert(udata->f); + assert(udata->cont_msg_info); /* Increase chunk array size, if necessary */ if (oh->nchunks >= oh->alloc_nchunks) { @@ -1558,8 +1558,8 @@ H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(oh); + assert(f); + assert(oh); /* Encode any dirty messages in this chunk */ for (u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) @@ -1573,11 +1573,11 @@ H5O__chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) /* Sanity checks */ if (oh->version > H5O_VERSION_1) /* Make certain the magic # is present */ - HDassert(!HDmemcmp(oh->chunk[chunkno].image, (chunkno == 0 ? H5O_HDR_MAGIC : H5O_CHK_MAGIC), - H5_SIZEOF_MAGIC)); + assert(!HDmemcmp(oh->chunk[chunkno].image, (chunkno == 0 ? H5O_HDR_MAGIC : H5O_CHK_MAGIC), + H5_SIZEOF_MAGIC)); else /* Gaps should never occur in version 1 of the format */ - HDassert(oh->chunk[chunkno].gap == 0); + assert(oh->chunk[chunkno].gap == 0); /* Extra work, for later versions of the format */ if (oh->version > H5O_VERSION_1) { diff --git a/src/H5Ocache_image.c b/src/H5Ocache_image.c index 30725ad..2eae6b3 100644 --- a/src/H5Ocache_image.c +++ b/src/H5Ocache_image.c @@ -93,8 +93,8 @@ H5O__mdci_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); /* Version of message */ if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) @@ -145,9 +145,9 @@ H5O__mdci_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, co FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(p); - HDassert(mesg); + assert(f); + assert(p); + assert(mesg); /* encode */ *p++ = H5O_MDCI_VERSION_0; @@ -181,7 +181,7 @@ H5O__mdci_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(mesg); + assert(mesg); if (!dest && NULL == (dest = H5FL_MALLOC(H5O_mdci_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -245,7 +245,7 @@ H5O__mdci_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_mdci_t, mesg); @@ -274,8 +274,8 @@ H5O__mdci_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); /* Free file space for cache image */ if (H5_addr_defined(mesg->addr)) { @@ -289,7 +289,7 @@ H5O__mdci_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) if (HADDR_UNDEF == (final_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "unable to get file size") - HDassert(H5_addr_eq(final_eoa, mesg->addr + mesg->size)); + assert(H5_addr_eq(final_eoa, mesg->addr + mesg->size)); if (H5FD_free(f->shared->lf, H5FD_MEM_SUPER, f, mesg->addr, mesg->size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't free MDC image") @@ -322,11 +322,11 @@ H5O__mdci_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mdci); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mdci); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Metadata Cache Image Block address:", mdci->addr); diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index c37a2a6..a09416b 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -88,10 +88,10 @@ H5O__chunk_add(H5F_t *f, H5O_t *oh, unsigned idx, unsigned cont_chunkno) FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ - HDassert(f); - HDassert(oh); - HDassert(idx < oh->nchunks); - HDassert(idx > 0); + assert(f); + assert(oh); + assert(idx < oh->nchunks); + assert(idx > 0); /* Allocate space for the object header data structure */ if (NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) @@ -154,9 +154,9 @@ H5O__chunk_protect(H5F_t *f, H5O_t *oh, unsigned idx) FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ - HDassert(f); - HDassert(oh); - HDassert(idx < oh->nchunks); + assert(f); + assert(oh); + assert(idx < oh->nchunks); /* Check for protecting first chunk */ if (0 == idx) { @@ -190,8 +190,8 @@ H5O__chunk_protect(H5F_t *f, H5O_t *oh, unsigned idx) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") /* Sanity check */ - HDassert(chk_proxy->oh == oh); - HDassert(chk_proxy->chunkno == idx); + assert(chk_proxy->oh == oh); + assert(chk_proxy->chunkno == idx); } /* end else */ /* Set return value */ @@ -226,8 +226,8 @@ H5O__chunk_unprotect(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t dirtied) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(chk_proxy); + assert(f); + assert(chk_proxy); /* Check for releasing first chunk */ if (0 == chk_proxy->chunkno) { @@ -276,8 +276,8 @@ H5O__chunk_resize(H5O_t *oh, H5O_chunk_proxy_t *chk_proxy) FUNC_ENTER_PACKAGE /* check args */ - HDassert(oh); - HDassert(chk_proxy); + assert(oh); + assert(chk_proxy); /* Check for resizing first chunk */ if (0 == chk_proxy->chunkno) { @@ -317,10 +317,10 @@ H5O__chunk_update_idx(H5F_t *f, H5O_t *oh, unsigned idx) FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ - HDassert(f); - HDassert(oh); - HDassert(idx < oh->nchunks); - HDassert(idx > 0); + assert(f); + assert(oh); + assert(idx < oh->nchunks); + assert(idx > 0); /* Construct the user data for protecting chunk proxy */ /* (and _not_ decoding it) */ @@ -367,10 +367,10 @@ H5O__chunk_delete(H5F_t *f, H5O_t *oh, unsigned idx) FUNC_ENTER_PACKAGE_TAG(oh->cache_info.addr) /* check args */ - HDassert(f); - HDassert(oh); - HDassert(idx < oh->nchunks); - HDassert(idx > 0); + assert(f); + assert(oh); + assert(idx < oh->nchunks); + assert(idx > 0); /* Get the chunk proxy */ if (NULL == (chk_proxy = H5O__chunk_protect(f, oh, idx))) @@ -408,7 +408,7 @@ H5O__chunk_dest(H5O_chunk_proxy_t *chk_proxy) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(chk_proxy); + assert(chk_proxy); /* Decrement reference count of object header */ if (H5O__dec_rc(chk_proxy->oh) < 0) diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 444fb2b..da05ae2 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -87,8 +87,8 @@ H5O__cont_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); /* Allocate space for the message */ if (NULL == (cont = H5FL_MALLOC(H5O_cont_t))) @@ -134,11 +134,11 @@ H5O__cont_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(cont); - HDassert(H5_addr_defined(cont->addr)); - HDassert(cont->size > 0); + assert(f); + assert(p); + assert(cont); + assert(H5_addr_defined(cont->addr)); + assert(cont->size > 0); /* encode */ H5F_addr_encode(f, &p, cont->addr); @@ -194,7 +194,7 @@ H5O__cont_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_cont_t, mesg); @@ -222,8 +222,8 @@ H5O__cont_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); /* Notify the cache that the chunk has been deleted */ /* (releases the space for the chunk) */ @@ -254,11 +254,11 @@ H5O__cont_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(cont); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(cont); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Continuation address:", cont->addr); 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))) diff --git a/src/H5Ocopy_ref.c b/src/H5Ocopy_ref.c index 87d78f7..a55caa0 100644 --- a/src/H5Ocopy_ref.c +++ b/src/H5Ocopy_ref.c @@ -100,8 +100,8 @@ H5O__copy_obj_by_ref(H5O_loc_t *src_oloc, H5O_loc_t *dst_oloc, H5G_loc_t *dst_ro FUNC_ENTER_PACKAGE - HDassert(src_oloc); - HDassert(dst_oloc); + assert(src_oloc); + assert(dst_oloc); /* Perform the copy, or look up existing copy */ if ((ret_value = H5O_copy_header_map(src_oloc, dst_oloc, cpy_info, FALSE, NULL, NULL)) < 0) @@ -442,12 +442,12 @@ H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_src, const H5T_t *dt_src, void *b FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(file_src); - HDassert(buf_src); - HDassert(file_dst); - HDassert(buf_dst); - HDassert(nbytes_src); - HDassert(cpy_info); + assert(file_src); + assert(buf_src); + assert(file_dst); + assert(buf_dst); + assert(nbytes_src); + assert(cpy_info); /* Initialize object locations */ H5O_loc_reset(&src_oloc); diff --git a/src/H5Odbg.c b/src/H5Odbg.c index b60c934..040189c 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -108,24 +108,23 @@ H5O__assert(const H5O_t *oh) free_space += oh->chunk[u].gap; /* Check for valid raw data image */ - HDassert(oh->chunk[u].image); - HDassert(oh->chunk[u].size > (size_t)H5O_SIZEOF_CHKHDR_OH(oh)); + assert(oh->chunk[u].image); + assert(oh->chunk[u].size > (size_t)H5O_SIZEOF_CHKHDR_OH(oh)); /* All chunks must be allocated on disk */ - HDassert(H5_addr_defined(oh->chunk[u].addr)); + assert(H5_addr_defined(oh->chunk[u].addr)); /* Version specific checks */ if (oh->version > H5O_VERSION_1) { /* Make certain that the magic number is correct for each chunk */ - HDassert( - !HDmemcmp(oh->chunk[u].image, (u == 0 ? H5O_HDR_MAGIC : H5O_CHK_MAGIC), H5_SIZEOF_MAGIC)); + assert(!HDmemcmp(oh->chunk[u].image, (u == 0 ? H5O_HDR_MAGIC : H5O_CHK_MAGIC), H5_SIZEOF_MAGIC)); /* Check for valid gap size */ - HDassert(oh->chunk[u].gap < (size_t)H5O_SIZEOF_MSGHDR_OH(oh)); + assert(oh->chunk[u].gap < (size_t)H5O_SIZEOF_MSGHDR_OH(oh)); } /* end if */ else /* Gaps should never occur in version 1 of the format */ - HDassert(oh->chunk[u].gap == 0); + assert(oh->chunk[u].gap == 0); } /* end for */ /* Check for correct chunk #0 size flags */ @@ -133,13 +132,13 @@ H5O__assert(const H5O_t *oh) uint64_t chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); if (chunk0_size <= 255) - HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_1); + assert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_1); else if (chunk0_size <= 65535) - HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_2); + assert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_2); else if (chunk0_size <= 4294967295) - HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_4); + assert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_4); else - HDassert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_8); + assert((oh->flags & H5O_HDR_CHUNK0_SIZE) == H5O_HDR_CHUNK0_8); } /* end if */ /* Loop over all messages in object header */ @@ -157,7 +156,7 @@ H5O__assert(const H5O_t *oh) H5O_cont_t *cont = (H5O_cont_t *)curr_msg->native; hbool_t H5_ATTR_NDEBUG_UNUSED found_chunk = FALSE; /* Found a chunk that matches */ - HDassert(cont); + assert(cont); /* Increment # of continuation messages found */ cont_msgs_found++; @@ -166,12 +165,12 @@ H5O__assert(const H5O_t *oh) /* (and only one) */ for (v = 0; v < oh->nchunks; v++) { if (H5_addr_eq(cont->addr, oh->chunk[v].addr) && cont->size == oh->chunk[v].size) { - HDassert(cont->chunkno == v); - HDassert(!found_chunk); + assert(cont->chunkno == v); + assert(!found_chunk); found_chunk = TRUE; } /* end if */ } /* end for */ - HDassert(found_chunk); + assert(found_chunk); meta_space += curr_tot_size; } /* end if */ @@ -180,42 +179,42 @@ H5O__assert(const H5O_t *oh) mesg_space += curr_msg->raw_size; /* Make sure the message has a native form if it is marked dirty */ - HDassert(curr_msg->native || !curr_msg->dirty); + assert(curr_msg->native || !curr_msg->dirty); } /* end else */ /* Make certain that the message is in a valid chunk */ - HDassert(curr_msg->chunkno < oh->nchunks); + assert(curr_msg->chunkno < oh->nchunks); /* Make certain null messages aren't in chunks with gaps */ if (H5O_NULL_ID == curr_msg->type->id) - HDassert(oh->chunk[curr_msg->chunkno].gap == 0); + assert(oh->chunk[curr_msg->chunkno].gap == 0); /* Make certain that the message is completely in a chunk message area */ - HDassert(curr_tot_size <= (oh->chunk[curr_msg->chunkno].size) - - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); + assert(curr_tot_size <= (oh->chunk[curr_msg->chunkno].size) - + (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); if (curr_msg->chunkno == 0) - HDassert(curr_hdr >= - oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + assert(curr_hdr >= + oh->chunk[curr_msg->chunkno].image + (H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); else - HDassert(curr_hdr >= oh->chunk[curr_msg->chunkno].image + - (H5O_SIZEOF_CHKHDR_OH(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); - HDassert(curr_msg->raw + curr_msg->raw_size <= - (oh->chunk[curr_msg->chunkno].image + oh->chunk[curr_msg->chunkno].size) - - (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); + assert(curr_hdr >= oh->chunk[curr_msg->chunkno].image + + (H5O_SIZEOF_CHKHDR_OH(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + assert(curr_msg->raw + curr_msg->raw_size <= + (oh->chunk[curr_msg->chunkno].image + oh->chunk[curr_msg->chunkno].size) - + (H5O_SIZEOF_CHKSUM_OH(oh) + oh->chunk[curr_msg->chunkno].gap)); /* Make certain that no other messages overlap this message */ for (v = 0, tmp_msg = &oh->mesg[0]; v < oh->nmesgs; v++, tmp_msg++) { if (u != v) - HDassert(!((tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) >= curr_hdr && - (tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) < (curr_hdr + curr_tot_size))); + assert(!((tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) >= curr_hdr && + (tmp_msg->raw - H5O_SIZEOF_MSGHDR_OH(oh)) < (curr_hdr + curr_tot_size))); } /* end for */ } /* end for */ /* Sanity check that the # of cont. messages is correct for the # of chunks */ - HDassert(oh->nchunks == (cont_msgs_found + 1)); + assert(oh->nchunks == (cont_msgs_found + 1)); /* Sanity check that all the bytes are accounted for */ - HDassert(hdr_size == (free_space + meta_space + mesg_space)); + assert(hdr_size == (free_space + meta_space + mesg_space)); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__assert() */ @@ -243,15 +242,15 @@ H5O_debug_id(unsigned type_id, H5F_t *f, const void *mesg, FILE *stream, int ind FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(type->debug); - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(type); + assert(type->debug); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Call the debug method in the class */ if ((ret_value = (type->debug)(f, mesg, stream, indent, fwidth)) < 0) @@ -284,12 +283,12 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(oh); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* debug */ HDfprintf(stream, "%*sObject Header...\n", indent, ""); @@ -436,7 +435,7 @@ H5O__debug_real(H5F_t *f, H5O_t *oh, haddr_t addr, FILE *stream, int indent, int flag_printed = TRUE; } /* end if */ if (oh->mesg[i].flags & H5O_MSG_FLAG_WAS_UNKNOWN) { - HDassert(oh->mesg[i].flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN); + assert(oh->mesg[i].flags & H5O_MSG_FLAG_MARK_IF_UNKNOWN); HDfprintf(stream, "%sWU", (flag_printed ? ", " : "<")); flag_printed = TRUE; } /* end if */ @@ -518,11 +517,11 @@ H5O_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f); - HDassert(H5_addr_defined(addr)); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(H5_addr_defined(addr)); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Set up the object location */ loc.file = f; diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c index 81d3b38..af1649e 100644 --- a/src/H5Odeprec.c +++ b/src/H5Odeprec.c @@ -127,8 +127,8 @@ H5O__iterate1_adapter(hid_t obj_id, const char *name, const H5O_info2_t *oinfo2, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(oinfo2); - HDassert(op_data); + assert(oinfo2); + assert(op_data); /* Reset the legacy info struct */ if (H5O__reset_info1(&oinfo) < 0) @@ -226,8 +226,8 @@ H5O__get_info_old(H5VL_object_t *vol_obj, H5VL_loc_params_t *loc_params, H5O_inf FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(vol_obj); - HDassert(loc_params); + assert(vol_obj); + assert(loc_params); /* Reset the passed-in info struct */ if (H5O__reset_info1(oinfo) < 0) diff --git a/src/H5Odrvinfo.c b/src/H5Odrvinfo.c index 53de66d..828645c 100644 --- a/src/H5Odrvinfo.c +++ b/src/H5Odrvinfo.c @@ -80,8 +80,8 @@ H5O__drvinfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Version of message */ if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) @@ -149,15 +149,15 @@ H5O__drvinfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shar FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(p); - HDassert(mesg); + assert(f); + assert(p); + assert(mesg); /* Store version, driver name, buffer length, & encoded buffer */ *p++ = H5O_DRVINFO_VERSION; H5MM_memcpy(p, mesg->name, 8); p += 8; - HDassert(mesg->len <= 65535); + assert(mesg->len <= 65535); UINT16ENCODE(p, mesg->len); H5MM_memcpy(p, mesg->buf, mesg->len); @@ -188,7 +188,7 @@ H5O__drvinfo_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(mesg); + assert(mesg); if (!dest && NULL == (dest = (H5O_drvinfo_t *)H5MM_malloc(sizeof(H5O_drvinfo_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, @@ -235,8 +235,8 @@ H5O__drvinfo_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_ FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); ret_value = 1 + /* Version number */ 8 + /* Driver name */ @@ -267,7 +267,7 @@ H5O__drvinfo_reset(void *_mesg) FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(mesg); + assert(mesg); /* reset */ mesg->buf = (uint8_t *)H5MM_xfree(mesg->buf); @@ -295,11 +295,11 @@ H5O__drvinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Driver name:", mesg->name); HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Buffer size:", mesg->len); diff --git a/src/H5Odtype.c b/src/H5Odtype.c index db9dde5..d69e2c0 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -128,8 +128,8 @@ H5O__dtype_decode_helper(unsigned *ioflags /*in,out*/, const uint8_t **pp, H5T_t FUNC_ENTER_PACKAGE - HDassert(pp && *pp); - HDassert(dt && dt->shared); + assert(pp && *pp); + assert(dt && dt->shared); /* XXX NOTE! * @@ -810,8 +810,8 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) FUNC_ENTER_PACKAGE /* check args */ - HDassert(pp && *pp); - HDassert(dt); + assert(pp && *pp); + assert(dt); /* skip the type and class bit-field for now */ *pp += 4; @@ -904,7 +904,7 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) case H5T_ORDER_VAX: /*turn on 1st and 6th (reserved before adding VAX) bits*/ flags |= 0x41; - HDassert(dt->shared->version >= H5O_DTYPE_VERSION_3); + assert(dt->shared->version >= H5O_DTYPE_VERSION_3); break; case H5T_ORDER_MIXED: @@ -984,13 +984,13 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) flags = (unsigned)(flags | ((dt->shared->u.atomic.u.f.sign << 8) & 0xff00)); UINT16ENCODE(*pp, dt->shared->u.atomic.offset); UINT16ENCODE(*pp, dt->shared->u.atomic.prec); - HDassert(dt->shared->u.atomic.u.f.epos <= 255); + assert(dt->shared->u.atomic.u.f.epos <= 255); *(*pp)++ = (uint8_t)(dt->shared->u.atomic.u.f.epos); - HDassert(dt->shared->u.atomic.u.f.esize <= 255); + assert(dt->shared->u.atomic.u.f.esize <= 255); *(*pp)++ = (uint8_t)(dt->shared->u.atomic.u.f.esize); - HDassert(dt->shared->u.atomic.u.f.mpos <= 255); + assert(dt->shared->u.atomic.u.f.mpos <= 255); *(*pp)++ = (uint8_t)(dt->shared->u.atomic.u.f.mpos); - HDassert(dt->shared->u.atomic.u.f.msize <= 255); + assert(dt->shared->u.atomic.u.f.msize <= 255); *(*pp)++ = (uint8_t)(dt->shared->u.atomic.u.f.msize); UINT32ENCODE(*pp, dt->shared->u.atomic.u.f.ebias); break; @@ -1019,11 +1019,11 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) /* * Character string types... (not fully implemented) */ - HDassert(dt->shared->u.atomic.order == H5T_ORDER_NONE); - HDassert(dt->shared->u.atomic.prec == 8 * dt->shared->size); - HDassert(dt->shared->u.atomic.offset == 0); - HDassert(dt->shared->u.atomic.lsb_pad == H5T_PAD_ZERO); - HDassert(dt->shared->u.atomic.msb_pad == H5T_PAD_ZERO); + assert(dt->shared->u.atomic.order == H5T_ORDER_NONE); + assert(dt->shared->u.atomic.prec == 8 * dt->shared->size); + assert(dt->shared->u.atomic.offset == 0); + assert(dt->shared->u.atomic.lsb_pad == H5T_PAD_ZERO); + assert(dt->shared->u.atomic.msb_pad == H5T_PAD_ZERO); flags = (unsigned)(flags | (dt->shared->u.atomic.u.s.pad & 0x0f)); flags = (unsigned)(flags | ((((unsigned)dt->shared->u.atomic.u.s.cset) & 0x0f) << 4)); @@ -1118,11 +1118,11 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { /* Sanity check */ /* (compound datatypes w/array members must be encoded w/version >= 2) */ - HDassert(dt->shared->u.compnd.memb[i].type->shared->type != H5T_ARRAY || - dt->shared->version >= H5O_DTYPE_VERSION_2); + assert(dt->shared->u.compnd.memb[i].type->shared->type != H5T_ARRAY || + dt->shared->version >= H5O_DTYPE_VERSION_2); /* Check that the version is at least as great as the member */ - HDassert(dt->shared->version >= dt->shared->u.compnd.memb[i].type->shared->version); + assert(dt->shared->version >= dt->shared->u.compnd.memb[i].type->shared->version); /* Name */ HDstrcpy((char *)(*pp), dt->shared->u.compnd.memb[i].name); @@ -1185,7 +1185,7 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) case H5T_ENUM: /* Check that the version is at least as great as the parent */ - HDassert(dt->shared->version >= dt->shared->parent->shared->version); + assert(dt->shared->version >= dt->shared->parent->shared->version); /* * Enumeration datatypes... @@ -1221,7 +1221,7 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) case H5T_VLEN: /* Variable length datatypes... */ /* Check that the version is at least as great as the parent */ - HDassert(dt->shared->version >= dt->shared->parent->shared->version); + assert(dt->shared->version >= dt->shared->parent->shared->version); flags |= (dt->shared->u.vlen.type & 0x0f); if (dt->shared->u.vlen.type == H5T_VLEN_STRING) { @@ -1236,16 +1236,16 @@ H5O__dtype_encode_helper(uint8_t **pp, const H5T_t *dt) case H5T_ARRAY: /* Array datatypes */ /* Double-check the number of dimensions */ - HDassert(dt->shared->u.array.ndims <= H5S_MAX_RANK); + assert(dt->shared->u.array.ndims <= H5S_MAX_RANK); /* Check that the version is valid */ - HDassert(dt->shared->version >= H5O_DTYPE_VERSION_2); + assert(dt->shared->version >= H5O_DTYPE_VERSION_2); /* Check that the version is at least as great as the parent */ - HDassert(dt->shared->version >= dt->shared->parent->shared->version); + assert(dt->shared->version >= dt->shared->parent->shared->version); /* Encode the number of dimensions */ - HDassert(dt->shared->u.array.ndims <= UCHAR_MAX); + assert(dt->shared->u.array.ndims <= UCHAR_MAX); *(*pp)++ = (uint8_t)dt->shared->u.array.ndims; /* Drop this information for Version 3 of the format */ @@ -1321,8 +1321,8 @@ H5O__dtype_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Allocate datatype message */ if (NULL == (dt = H5T__alloc())) @@ -1378,9 +1378,9 @@ H5O__dtype_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(p); - HDassert(dt); + assert(f); + assert(p); + assert(dt); /* encode */ if (H5O__dtype_encode_helper(&p, dt) < 0) @@ -1417,7 +1417,7 @@ H5O__dtype_copy(const void *_src, void *_dst) FUNC_ENTER_PACKAGE /* check args */ - HDassert(src); + assert(src); /* Copy */ if (NULL == (dst = H5T_copy(src, H5T_COPY_ALL))) @@ -1462,8 +1462,8 @@ H5O__dtype_size(const H5F_t *f, const void *_mesg) FUNC_ENTER_PACKAGE_NOERR - HDassert(f); - HDassert(dt); + assert(f); + assert(dt); /* Set the common size information */ ret_value = 4 + /* Type, class & flags */ @@ -1616,7 +1616,7 @@ H5O__dtype_free(void *mesg) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(mesg); + assert(mesg); /* Release the datatype */ if (H5T_close_real((H5T_t *)mesg) < 0) @@ -1646,17 +1646,17 @@ H5O__dtype_set_share(void *_mesg /*in,out*/, const H5O_shared_t *sh) FUNC_ENTER_PACKAGE - HDassert(dt); - HDassert(sh); + assert(dt); + assert(sh); /* Make sure the shared message location is initialized, so that it * either has valid sharing information or is set to 0. */ - HDassert(sh->type <= H5O_SHARE_TYPE_HERE); + assert(sh->type <= H5O_SHARE_TYPE_HERE); /* Make sure we're not sharing a committed type in the heap */ - HDassert(sh->type == H5O_SHARE_TYPE_COMMITTED || - (dt->shared->state != H5T_STATE_OPEN && dt->shared->state != H5T_STATE_NAMED)); + assert(sh->type == H5O_SHARE_TYPE_COMMITTED || + (dt->shared->state != H5T_STATE_OPEN && dt->shared->state != H5T_STATE_NAMED)); /* Copy the shared information */ if (H5O_set_shared(&(dt->sh_loc), sh) < 0) @@ -1702,7 +1702,7 @@ H5O__dtype_can_share(const void *_mesg) FUNC_ENTER_PACKAGE - HDassert(mesg); + assert(mesg); /* Don't share immutable datatypes */ if ((tri_ret = H5T_is_immutable(mesg)) > 0) @@ -1746,10 +1746,10 @@ H5O__dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t H5_ATTR_ FUNC_ENTER_PACKAGE /* check args */ - HDassert(file_src); - HDassert(dt_src); - HDassert(cpy_info); - HDassert(cpy_info->file_dst); + assert(file_src); + assert(dt_src); + assert(cpy_info); + assert(cpy_info->file_dst); /* Check to ensure that the version of the message to be copied does not exceed the message version as indicated by the destination file's high bound */ @@ -1841,14 +1841,14 @@ H5O__dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc, const FUNC_ENTER_PACKAGE if (dt_dst->sh_loc.type == H5O_SHARE_TYPE_COMMITTED) { - HDassert(H5T_is_named(dt_dst)); + assert(H5T_is_named(dt_dst)); if (H5O_loc_reset(&(dt_dst->oloc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to reset location") dt_dst->oloc.file = dt_dst->sh_loc.file; dt_dst->oloc.addr = dt_dst->sh_loc.u.loc.oh_addr; } /* end if */ else - HDassert(!H5T_is_named(dt_dst)); + assert(!H5T_is_named(dt_dst)); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1885,11 +1885,11 @@ H5O__dtype_debug(H5F_t *f, const void *mesg, FILE *stream, int indent, int fwidt FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(dt); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(dt); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); switch (dt->shared->type) { case H5T_INTEGER: diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 30dc1d8..6673b98 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -83,8 +83,8 @@ H5O__efl_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (NULL == (mesg = (H5O_efl_t *)H5MM_calloc(sizeof(H5O_efl_t)))) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "memory allocation failed") @@ -208,9 +208,9 @@ H5O__efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); - HDassert(p); + assert(f); + assert(mesg); + assert(p); /* Version */ *p++ = H5O_EFL_VERSION; @@ -221,13 +221,13 @@ H5O__efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con *p++ = 0; /* Number of slots */ - HDassert(mesg->nalloc > 0); + assert(mesg->nalloc > 0); UINT16ENCODE(p, mesg->nused); /*yes, twice*/ - HDassert(mesg->nused > 0 && mesg->nused <= mesg->nalloc); + assert(mesg->nused > 0 && mesg->nused <= mesg->nalloc); UINT16ENCODE(p, mesg->nused); /* Heap address */ - HDassert(H5_addr_defined(mesg->heap_addr)); + assert(H5_addr_defined(mesg->heap_addr)); H5F_addr_encode(f, &p, mesg->heap_addr); /* Encode file list */ @@ -236,7 +236,7 @@ H5O__efl_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, con * The name should have been added to the heap when the dataset was * created. */ - HDassert(mesg->slot[u].name_offset); + assert(mesg->slot[u].name_offset); H5F_ENCODE_LENGTH(f, p, mesg->slot[u].name_offset); H5F_ENCODE_LENGTH(f, p, (hsize_t)mesg->slot[u].offset); H5F_ENCODE_LENGTH(f, p, mesg->slot[u].size); @@ -272,7 +272,7 @@ H5O__efl_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(mesg); + assert(mesg); /* Allocate destination message, if necessary */ if (!dest && NULL == (dest = (H5O_efl_t *)H5MM_calloc(sizeof(H5O_efl_t)))) @@ -337,8 +337,8 @@ H5O__efl_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const void FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); ret_value = (size_t)H5F_SIZEOF_ADDR(f) + /*heap address */ 2 + /*slots allocated*/ @@ -373,7 +373,7 @@ H5O__efl_reset(void *_mesg) FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(mesg); + assert(mesg); /* reset */ if (mesg->slot) { @@ -455,8 +455,8 @@ H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_d FUNC_ENTER_PACKAGE_TAG(H5AC__COPIED_TAG) /* check args */ - HDassert(efl_src); - HDassert(file_dst); + assert(efl_src); + assert(file_dst); /* Allocate space for the destination efl */ if (NULL == (efl_dst = (H5O_efl_t *)H5MM_calloc(sizeof(H5O_efl_t)))) @@ -481,7 +481,7 @@ H5O__efl_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *mesg_src, H5F_t *file_d /* Insert "empty" name first */ if (H5HL_insert(file_dst, heap, (size_t)1, "", &name_offset) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTINSERT, NULL, "can't insert file name into heap") - HDassert(0 == name_offset); + assert(0 == name_offset); /* allocate array of external file entries */ if (efl_src->nalloc > 0) { @@ -536,11 +536,11 @@ H5O__efl_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int ind FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "Heap address:", mesg->heap_addr); diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 7b789bc..a11824e 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -196,8 +196,8 @@ H5O__fill_new_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (NULL == (fill = H5FL_CALLOC(H5O_fill_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value message") @@ -336,8 +336,8 @@ H5O__fill_old_decode(H5F_t *f, H5O_t *open_oh, unsigned H5_ATTR_UNUSED mesg_flag FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (NULL == (fill = H5FL_CALLOC(H5O_fill_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value message") @@ -415,9 +415,9 @@ H5O__fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) FUNC_ENTER_PACKAGE_NOERR - HDassert(f); - HDassert(p); - HDassert(fill && NULL == fill->type); + assert(f); + assert(p); + assert(fill && NULL == fill->type); /* Version */ *p++ = (uint8_t)fill->version; @@ -446,12 +446,12 @@ H5O__fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) uint8_t flags = 0; /* Fill value setting flags */ /* Encode space allocation time */ - HDassert(fill->alloc_time == (H5O_FILL_MASK_ALLOC_TIME & fill->alloc_time)); + assert(fill->alloc_time == (H5O_FILL_MASK_ALLOC_TIME & fill->alloc_time)); flags = (uint8_t)(flags | ((H5O_FILL_MASK_ALLOC_TIME & fill->alloc_time) << H5O_FILL_SHIFT_ALLOC_TIME)); /* Encode fill value writing time */ - HDassert(fill->fill_time == (H5O_FILL_MASK_FILL_TIME & fill->fill_time)); + assert(fill->fill_time == (H5O_FILL_MASK_FILL_TIME & fill->fill_time)); flags = (uint8_t)(flags | ((H5O_FILL_MASK_FILL_TIME & fill->fill_time) << H5O_FILL_SHIFT_FILL_TIME)); /* Check if we need to encode a fill value size */ @@ -463,7 +463,7 @@ H5O__fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) *p++ = (uint8_t)flags; /* Sanity check */ - HDassert(!fill->buf); + assert(!fill->buf); } /* end if */ else if (fill->size > 0) { /* Indicate that a fill value size is present */ @@ -476,7 +476,7 @@ H5O__fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) INT32ENCODE(p, fill->size); /* Encode the fill value */ - HDassert(fill->buf); + assert(fill->buf); H5_CHECK_OVERFLOW(fill->size, ssize_t, size_t); H5MM_memcpy(p, fill->buf, (size_t)fill->size); } /* end if */ @@ -485,7 +485,7 @@ H5O__fill_new_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) *p++ = (uint8_t)flags; /* Sanity check */ - HDassert(!fill->buf); + assert(!fill->buf); } /* end else */ } /* end else */ @@ -511,9 +511,9 @@ H5O__fill_old_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p, const void *_fill) FUNC_ENTER_PACKAGE_NOERR - HDassert(f); - HDassert(p); - HDassert(fill && NULL == fill->type); + assert(f); + assert(p); + assert(fill && NULL == fill->type); UINT32ENCODE(p, fill->size); if (fill->buf) @@ -547,7 +547,7 @@ H5O__fill_copy(const void *_src, void *_dst) FUNC_ENTER_PACKAGE - HDassert(src); + assert(src); if (!dst && NULL == (dst = H5FL_MALLOC(H5O_fill_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill message") @@ -665,8 +665,8 @@ H5O__fill_new_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) FUNC_ENTER_PACKAGE_NOERR - HDassert(f); - HDassert(fill); + assert(f); + assert(fill); /* Determine size for different versions */ if (fill->version < H5O_FILL_VERSION_3) { @@ -711,7 +711,7 @@ H5O__fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) FUNC_ENTER_PACKAGE_NOERR - HDassert(fill); + assert(fill); FUNC_LEAVE_NOAPI(4 + (size_t)fill->size) } /* end H5O__fill_old_size() */ @@ -736,7 +736,7 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) FUNC_ENTER_NOAPI(FAIL) - HDassert(fill); + assert(fill); if (fill->buf) { if (fill->type && H5T_detect_class(fill->type, H5T_VLEN, FALSE) > 0) { @@ -800,7 +800,7 @@ H5O__fill_reset(void *_fill) FUNC_ENTER_PACKAGE_NOERR - HDassert(fill); + assert(fill); /* Reset dynamic fields */ H5O_fill_reset_dyn(fill); @@ -830,7 +830,7 @@ H5O__fill_free(void *fill) { FUNC_ENTER_PACKAGE_NOERR - HDassert(fill); + assert(fill); fill = H5FL_FREE(H5O_fill_t, fill); @@ -860,8 +860,8 @@ H5O__fill_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, hb FUNC_ENTER_PACKAGE /* check args */ - HDassert(cpy_info); - HDassert(cpy_info->file_dst); + assert(cpy_info); + assert(cpy_info->file_dst); /* Check to ensure that the version of the message to be copied does not exceed the message version allowed by the destination file's high bound */ @@ -892,11 +892,11 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, int in FUNC_ENTER_PACKAGE_NOERR - HDassert(f); - HDassert(fill); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(fill); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Space Allocation Time:"); switch (fill->alloc_time) { @@ -996,9 +996,9 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, hbool_t *fill_changed) FUNC_ENTER_NOAPI(FAIL) - HDassert(fill); - HDassert(dset_type); - HDassert(fill_changed); + assert(fill); + assert(dset_type); + assert(fill_changed); /* No-op cases */ if (!fill->buf || !fill->type || 0 == H5T_cmp(fill->type, dset_type, FALSE)) { @@ -1090,8 +1090,8 @@ H5O_fill_set_version(H5F_t *f, H5O_fill_t *fill) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(fill); + assert(f); + assert(fill); /* Upgrade to the version indicated by the file's low bound if higher */ version = MAX(fill->version, H5O_fill_ver_bounds[H5F_LOW_BOUND(f)]); diff --git a/src/H5Oflush.c b/src/H5Oflush.c index aefa098..822da33 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -157,7 +157,7 @@ H5O__oh_tag(const H5O_loc_t *oloc, haddr_t *tag) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(oloc); + assert(oloc); /* Get object header for object */ if (NULL == (oh = H5O_protect(oloc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -372,8 +372,8 @@ H5O_refresh_metadata_reopen(hid_t oid, hid_t apl_id, H5G_loc_t *obj_loc, H5VL_t FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(obj_loc); - HDassert(vol_connector); + assert(obj_loc); + assert(vol_connector); /* Get object's type */ type = H5I_get_type(oid); diff --git a/src/H5Ofsinfo.c b/src/H5Ofsinfo.c index dec9997..094ff5e 100644 --- a/src/H5Ofsinfo.c +++ b/src/H5Ofsinfo.c @@ -96,8 +96,8 @@ H5O__fsinfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Allocate space for message */ if (NULL == (fsinfo = H5FL_CALLOC(H5O_fsinfo_t))) @@ -232,9 +232,9 @@ H5O__fsinfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(fsinfo); + assert(f); + assert(p); + assert(fsinfo); *p++ = (uint8_t)fsinfo->version; /* message version */ *p++ = (uint8_t)fsinfo->strategy; /* File space strategy */ @@ -277,7 +277,7 @@ H5O__fsinfo_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(fsinfo); + assert(fsinfo); if (!dest && NULL == (dest = H5FL_CALLOC(H5O_fsinfo_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -342,7 +342,7 @@ H5O__fsinfo_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_fsinfo_t, mesg); @@ -369,11 +369,11 @@ H5O__fsinfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(fsinfo); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(fsinfo); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "File space strategy:"); switch (fsinfo->strategy) { @@ -443,7 +443,7 @@ H5O_fsinfo_set_version(H5F_libver_t low, H5F_libver_t high, H5O_fsinfo_t *fsinfo /* Sanity check */ HDcompile_assert(N_FSINFO_VERSION_BOUNDS == H5F_LIBVER_NBOUNDS); - HDassert(fsinfo); + assert(fsinfo); version = H5O_FSINFO_VERSION_1; @@ -483,7 +483,7 @@ H5O_fsinfo_check_version(H5F_libver_t high, H5O_fsinfo_t *fsinfo) /* Sanity check */ HDcompile_assert(N_FSINFO_VERSION_BOUNDS == H5F_LIBVER_NBOUNDS); - HDassert(fsinfo); + assert(fsinfo); /* Check the version */ if (H5O_fsinfo_ver_bounds[high] == H5O_INVALID_VERSION || fsinfo->version > H5O_fsinfo_ver_bounds[high]) diff --git a/src/H5Oginfo.c b/src/H5Oginfo.c index 59121c9..4ceb551 100644 --- a/src/H5Oginfo.c +++ b/src/H5Oginfo.c @@ -91,8 +91,8 @@ H5O__ginfo_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Version of message */ if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) @@ -170,8 +170,8 @@ H5O__ginfo_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(p); - HDassert(ginfo); + assert(p); + assert(ginfo); /* Message version */ *p++ = H5O_GINFO_VERSION; @@ -221,7 +221,7 @@ H5O__ginfo_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(ginfo); + assert(ginfo); if (!dest && NULL == (dest = H5FL_MALLOC(H5O_ginfo_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -291,7 +291,7 @@ H5O__ginfo_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_ginfo_t, mesg); @@ -318,11 +318,11 @@ H5O__ginfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int i FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(ginfo); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(ginfo); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Max. compact links:", ginfo->max_compact); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Min. dense links:", ginfo->min_dense); 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 */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index e24bfc4..01526e7 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -91,8 +91,8 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (NULL == (mesg = H5FL_CALLOC(H5O_layout_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "memory allocation failed") @@ -798,9 +798,9 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(mesg); - HDassert(p); + assert(f); + assert(mesg); + assert(p); /* Message version */ *p++ = (uint8_t)((mesg->version < H5O_LAYOUT_VERSION_3) ? H5O_LAYOUT_VERSION_3 : mesg->version); @@ -835,7 +835,7 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, case H5D_CHUNKED: if (mesg->version < H5O_LAYOUT_VERSION_4) { /* Number of dimensions */ - HDassert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); *p++ = (uint8_t)mesg->u.chunk.ndims; /* B-tree address */ @@ -850,11 +850,11 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, *p++ = mesg->u.chunk.flags; /* Number of dimensions */ - HDassert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); *p++ = (uint8_t)mesg->u.chunk.ndims; /* Encoded # of bytes for each chunk dimension */ - HDassert(mesg->u.chunk.enc_bytes_per_dim > 0 && mesg->u.chunk.enc_bytes_per_dim <= 8); + assert(mesg->u.chunk.enc_bytes_per_dim > 0 && mesg->u.chunk.enc_bytes_per_dim <= 8); *p++ = (uint8_t)mesg->u.chunk.enc_bytes_per_dim; /* Dimension sizes */ @@ -956,7 +956,7 @@ H5O__layout_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(mesg); + assert(mesg); /* Allocate destination message, if necessary */ if (!dest && NULL == (dest = H5FL_MALLOC(H5O_layout_t))) @@ -971,7 +971,7 @@ H5O__layout_copy(const void *_mesg, void *_dest) /* Deep copy the buffer for compact datasets also */ if (mesg->storage.u.compact.size > 0) { /* Sanity check */ - HDassert(mesg->storage.u.compact.buf); + assert(mesg->storage.u.compact.buf); /* Allocate memory for the raw data */ if (NULL == (dest->storage.u.compact.buf = H5MM_malloc(dest->storage.u.compact.size))) @@ -982,7 +982,7 @@ H5O__layout_copy(const void *_mesg, void *_dest) dest->storage.u.compact.size); } /* end if */ else - HDassert(dest->storage.u.compact.buf == NULL); + assert(dest->storage.u.compact.buf == NULL); break; case H5D_CONTIGUOUS: @@ -1042,8 +1042,8 @@ H5O__layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const vo FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); /* Compute serialized size */ /* (including possibly compact data) */ @@ -1110,7 +1110,7 @@ H5O__layout_free(void *_mesg) FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); /* Free resources within the message */ H5O__layout_reset(mesg); @@ -1141,9 +1141,9 @@ H5O__layout_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(open_oh); - HDassert(mesg); + assert(f); + assert(open_oh); + assert(mesg); /* Perform different actions, depending on the type of storage */ switch (mesg->type) { @@ -1203,8 +1203,8 @@ H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, FUNC_ENTER_PACKAGE /* check args */ - HDassert(cpy_info); - HDassert(cpy_info->file_dst); + assert(cpy_info); + assert(cpy_info->file_dst); /* Check to ensure that the version of the message to be copied does not exceed the message version allowed by the destination file's high bound */ @@ -1243,9 +1243,9 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, FUNC_ENTER_PACKAGE /* check args */ - HDassert(file_src); - HDassert(layout_src); - HDassert(file_dst); + assert(file_src); + assert(layout_src); + assert(file_dst); /* Copy the layout information */ if (NULL == (layout_dst = (H5O_layout_t *)H5O__layout_copy(layout_src, NULL))) @@ -1345,11 +1345,11 @@ H5O__layout_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Version:", mesg->version); switch (mesg->type) { diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index 0330f21..cecdb32 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -109,8 +109,8 @@ H5O__linfo_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNUS FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Check input buffer before decoding version and index flags */ if (H5_IS_BUFFER_OVERFLOW(p, 2, p_end)) @@ -194,9 +194,9 @@ H5O__linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(linfo); + assert(f); + assert(p); + assert(linfo); /* Message version */ *p++ = H5O_LINFO_VERSION; @@ -220,7 +220,7 @@ H5O__linfo_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, c if (linfo->index_corder) H5F_addr_encode(f, &p, linfo->corder_bt2_addr); else - HDassert(!H5_addr_defined(linfo->corder_bt2_addr)); + assert(!H5_addr_defined(linfo->corder_bt2_addr)); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O__linfo_encode() */ @@ -249,7 +249,7 @@ H5O__linfo_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(linfo); + assert(linfo); if (!dest && NULL == (dest = H5FL_MALLOC(H5O_linfo_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -316,7 +316,7 @@ H5O__linfo_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_linfo_t, mesg); @@ -344,8 +344,8 @@ H5O__linfo_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(linfo); + assert(f); + assert(linfo); /* If the group is using "dense" link storage, delete it */ if (H5_addr_defined(linfo->fheap_addr)) @@ -383,8 +383,8 @@ H5O__linfo_copy_file(H5F_t H5_ATTR_UNUSED *file_src, void *native_src, H5F_t *fi FUNC_ENTER_PACKAGE_TAG(H5AC__COPIED_TAG) /* check args */ - HDassert(linfo_src); - HDassert(cpy_info); + assert(linfo_src); + assert(cpy_info); /* Copy the source message */ if (NULL == (linfo_dst = (H5O_linfo_t *)H5O__linfo_copy(linfo_src, NULL))) @@ -449,8 +449,8 @@ H5O__linfo_post_copy_file_cb(const H5O_link_t *src_lnk, void *_udata) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(src_lnk); - HDassert(udata); + assert(src_lnk); + assert(udata); /* Copy the link (and the object it points to) */ if (H5L__link_copy_file(udata->dst_oloc->file, src_lnk, udata->src_oloc, &dst_lnk, udata->cpy_info) < 0) @@ -499,12 +499,12 @@ H5O__linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_l FUNC_ENTER_PACKAGE /* check args */ - HDassert(src_oloc && src_oloc->file); - HDassert(linfo_src); - HDassert(dst_oloc && dst_oloc->file); - HDassert(H5_addr_defined(dst_oloc->addr)); - HDassert(linfo_dst); - HDassert(cpy_info); + assert(src_oloc && src_oloc->file); + assert(linfo_src); + assert(dst_oloc && dst_oloc->file); + assert(H5_addr_defined(dst_oloc->addr)); + assert(linfo_dst); + assert(cpy_info); /* If we are performing a 'shallow hierarchy' copy, get out now */ if (cpy_info->max_depth >= 0 && cpy_info->curr_depth >= cpy_info->max_depth) @@ -550,11 +550,11 @@ H5O__linfo_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int i FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(linfo); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(linfo); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Track creation order of links:", linfo->track_corder ? "TRUE" : "FALSE"); 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 diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 8dd8526..adf64c9 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -106,10 +106,10 @@ H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, unsi FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(loc); - HDassert(type_id < NELMTS(H5O_msg_class_g)); - HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); - HDassert(mesg); + assert(loc); + assert(type_id < NELMTS(H5O_msg_class_g)); + assert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); + assert(mesg); /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) @@ -152,14 +152,14 @@ H5O_msg_append_oh(H5F_t *f, H5O_t *oh, unsigned type_id, unsigned mesg_flags, un FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f); - HDassert(oh); - HDassert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(f); + assert(oh); + assert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); - HDassert(mesg); + assert(type); + assert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); + assert(mesg); /* Append new message to object header */ if (H5O__msg_append_real(f, oh, type, mesg_flags, update_flags, mesg) < 0) @@ -193,11 +193,11 @@ H5O__msg_append_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); - HDassert(type); - HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); - HDassert(mesg); + assert(f); + assert(oh); + assert(type); + assert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); + assert(mesg); /* Allocate space for a new message */ if (H5O__msg_alloc(f, oh, type, &mesg_flags, mesg, &idx) < 0) @@ -243,15 +243,15 @@ H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, unsig FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(mesg); - HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); + assert(type); + assert(mesg); + assert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) @@ -296,14 +296,14 @@ H5O_msg_write_oh(H5F_t *f, H5O_t *oh, unsigned type_id, unsigned mesg_flags, uns FUNC_ENTER_NOAPI_TAG(oh->cache_info.addr, FAIL) /* check args */ - HDassert(f); - HDassert(oh); - HDassert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(f); + assert(oh); + assert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(mesg); - HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); + assert(type); + assert(mesg); + assert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); /* Call the "real" modify routine */ if (H5O__msg_write_real(f, oh, type, mesg_flags, update_flags, mesg) < 0) @@ -343,12 +343,12 @@ H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned m FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); - HDassert(type); - HDassert(type != H5O_MSG_ATTR); - HDassert(mesg); - HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); + assert(f); + assert(oh); + assert(type); + assert(type != H5O_MSG_ATTR); + assert(mesg); + assert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); /* Locate message of correct type */ for (idx = 0, idx_msg = &oh->mesg[0]; idx < oh->nmesgs; idx++, idx_msg++) @@ -367,13 +367,13 @@ H5O__msg_write_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned m /* First, sanity check to make sure it's not a committed message; * these can't ever be modified. */ - HDassert(((H5O_shared_t *)idx_msg->native)->type != H5O_SHARE_TYPE_COMMITTED); + assert(((H5O_shared_t *)idx_msg->native)->type != H5O_SHARE_TYPE_COMMITTED); /* Also, sanity check that a message doesn't switch status from being * shared (or shareable) to being unshareable. (Which could cause * a message to increase in size in the object header) */ - HDassert(!(mesg_flags & H5O_MSG_FLAG_DONTSHARE)); + assert(!(mesg_flags & H5O_MSG_FLAG_DONTSHARE)); /* Remove the old message from the SOHM index */ /* (It would be more efficient to try to share the message first, then @@ -441,10 +441,10 @@ H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg) FUNC_ENTER_NOAPI_TAG(loc->addr, NULL) /* check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(type_id < NELMTS(H5O_msg_class_g)); /* Get the object header */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -493,11 +493,11 @@ H5O_msg_read_oh(H5F_t *f, H5O_t *oh, unsigned type_id, void *mesg) FUNC_ENTER_NOAPI_NOINIT /* check args */ - HDassert(f); - HDassert(oh); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(f); + assert(oh); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Scan through the messages looking for the right one */ for (idx = 0; idx < oh->nmesgs; idx++) @@ -547,9 +547,9 @@ H5O_msg_reset(unsigned type_id, void *native) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Call the "real" reset routine */ if (H5O__msg_reset_real(type, native) < 0) @@ -581,7 +581,7 @@ H5O__msg_reset_real(const H5O_msg_class_t *type, void *native) FUNC_ENTER_PACKAGE /* check args */ - HDassert(type); + assert(type); if (native) { if (type->reset) { @@ -620,9 +620,9 @@ H5O_msg_free(unsigned type_id, void *mesg) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Call the "real" free routine */ ret_value = H5O_msg_free_real(type, mesg); @@ -648,7 +648,7 @@ H5O__msg_free_mesg(H5O_mesg_t *mesg) FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(mesg); + assert(mesg); /* Free any native information */ mesg->native = H5O_msg_free_real(mesg->type, mesg->native); @@ -676,7 +676,7 @@ H5O_msg_free_real(const H5O_msg_class_t *type, void *msg_native) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(type); + assert(type); if (msg_native) { H5O__msg_reset_real(type, msg_native); @@ -713,10 +713,10 @@ H5O_msg_copy(unsigned type_id, const void *mesg, void *dst) FUNC_ENTER_NOAPI(NULL) /* check args */ - HDassert(mesg); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(mesg); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Call the message class's copy routine */ if (NULL == (ret_value = (type->copy)(mesg, dst))) @@ -752,12 +752,12 @@ H5O_msg_count(const H5O_loc_t *loc, unsigned type_id) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Load the object header */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -798,8 +798,8 @@ H5O__msg_count_real(const H5O_t *oh, const H5O_msg_class_t *type) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(oh); - HDassert(type); + assert(oh); + assert(type); /* Loop over all messages, counting the ones of the type looked for */ for (u = ret_value = 0; u < oh->nmesgs; u++) @@ -835,9 +835,9 @@ H5O_msg_exists(const H5O_loc_t *loc, unsigned type_id) FUNC_ENTER_NOAPI_TAG(loc->addr, FAIL) - HDassert(loc); - HDassert(loc->file); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(loc); + assert(loc->file); + assert(type_id < NELMTS(H5O_msg_class_g)); /* Load the object header */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -881,10 +881,10 @@ H5O_msg_exists_oh(const H5O_t *oh, unsigned type_id) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(oh); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(oh); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Scan through the messages looking for the right one */ for (u = 0; u < oh->nmesgs; u++) @@ -924,13 +924,13 @@ H5O_msg_remove(const H5O_loc_t *loc, unsigned type_id, int sequence, hbool_t adj FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) @@ -974,13 +974,13 @@ H5O_msg_remove_op(const H5O_loc_t *loc, unsigned type_id, int sequence, H5O_oper FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(H5O_ATTR_ID != type_id); /* Attributes are modified in another routine */ + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Pin the object header */ if (NULL == (oh = H5O_pin(loc))) @@ -1022,7 +1022,7 @@ H5O__msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, un FUNC_ENTER_PACKAGE /* check args */ - HDassert(mesg); + assert(mesg); /* Check for callback routine */ if (udata->op) { @@ -1087,9 +1087,9 @@ H5O__msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, int seque FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); - HDassert(type); + assert(f); + assert(oh); + assert(type); /* Make certain we are allowed to modify the file */ if (0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) @@ -1157,13 +1157,13 @@ H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, const H5O_mesg_operator_ FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(op); + assert(type); + assert(op); /* Protect the object header to iterate over */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) @@ -1223,11 +1223,11 @@ H5O__msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const H5 FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); - HDassert(type); - HDassert(op); - HDassert(op->u.app_op); + assert(f); + assert(oh); + assert(type); + assert(op); + assert(op->u.app_op); /* Iterate over messages */ for (sequence = 0, idx = 0, idx_msg = &oh->mesg[0]; idx < oh->nmesgs && !ret_value; idx++, idx_msg++) { @@ -1300,12 +1300,12 @@ H5O_msg_raw_size(const H5F_t *f, unsigned type_id, hbool_t disable_shared, const FUNC_ENTER_NOAPI(0) /* Check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(type->raw_size); - HDassert(f); - HDassert(mesg); + assert(type); + assert(type->raw_size); + assert(f); + assert(mesg); /* Compute the raw data size for the mesg */ if (0 == (ret_value = (type->raw_size)(f, disable_shared, mesg))) @@ -1342,12 +1342,12 @@ H5O_msg_size_f(const H5F_t *f, hid_t ocpl_id, unsigned type_id, const void *mesg FUNC_ENTER_NOAPI(0) /* Check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(type->raw_size); - HDassert(f); - HDassert(mesg); + assert(type); + assert(type->raw_size); + assert(f); + assert(mesg); /* Get the property list */ if (NULL == (ocpl = (H5P_genplist_t *)H5I_object(ocpl_id))) @@ -1400,12 +1400,12 @@ H5O_msg_size_oh(const H5F_t *f, const H5O_t *oh, unsigned type_id, const void *m FUNC_ENTER_NOAPI(0) /* Check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(type->raw_size); - HDassert(f); - HDassert(mesg); + assert(type); + assert(type->raw_size); + assert(f); + assert(mesg); /* Compute the raw data size for the mesg */ if ((ret_value = (type->raw_size)(f, FALSE, mesg)) == 0) @@ -1450,10 +1450,10 @@ H5O_msg_can_share(unsigned type_id, const void *mesg) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(mesg); + assert(type); + assert(mesg); /* If there is a can_share callback, use it */ if (type->can_share) @@ -1468,7 +1468,7 @@ H5O_msg_can_share(unsigned type_id, const void *mesg) /* If the message is shareable, both copy_file and post_copy_file must be * defined */ - HDassert((type->post_copy_file && type->copy_file) || ret_value == FALSE); + assert((type->post_copy_file && type->copy_file) || ret_value == FALSE); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_msg_can_share() */ @@ -1496,9 +1496,9 @@ H5O_msg_can_share_in_ohdr(unsigned type_id) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Otherwise, the message can be shared if messages of this type are * shareable in general; i.e., if they have the "is_sharable" flag @@ -1538,10 +1538,10 @@ H5O_msg_is_shared(unsigned type_id, const void *mesg) else #endif /* H5O_ENABLE_BOGUS */ { - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(mesg); + assert(type); + assert(mesg); /* If messages in a class aren't shareable, then obviously this message isn't shared! :-) */ if (type->share_flags & H5O_SHARE_IS_SHARABLE) @@ -1575,13 +1575,13 @@ H5O_msg_set_share(unsigned type_id, const H5O_shared_t *share, void *mesg) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(type->share_flags & H5O_SHARE_IS_SHARABLE); - HDassert(mesg); - HDassert(share); - HDassert(share->type != H5O_SHARE_TYPE_UNSHARED); + assert(type); + assert(type->share_flags & H5O_SHARE_IS_SHARABLE); + assert(mesg); + assert(share); + assert(share->type != H5O_SHARE_TYPE_UNSHARED); /* If there's a special action for this class that needs to be performed * when setting the shared component, do that @@ -1621,10 +1621,10 @@ H5O_msg_reset_share(unsigned H5_ATTR_NDEBUG_UNUSED type_id, void *mesg) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); - HDassert(H5O_msg_class_g[type_id]); /* map the type ID to the actual type object */ - HDassert(H5O_msg_class_g[type_id]->share_flags & H5O_SHARE_IS_SHARABLE); - HDassert(mesg); + assert(type_id < NELMTS(H5O_msg_class_g)); + assert(H5O_msg_class_g[type_id]); /* map the type ID to the actual type object */ + assert(H5O_msg_class_g[type_id]->share_flags & H5O_SHARE_IS_SHARABLE); + assert(mesg); /* Reset the shared component in the message to zero. */ HDmemset((H5O_shared_t *)mesg, 0, sizeof(H5O_shared_t)); @@ -1654,11 +1654,11 @@ H5O_msg_get_crt_index(unsigned type_id, const void *mesg, H5O_msg_crt_idx_t *crt FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(mesg); - HDassert(crt_idx); + assert(type); + assert(mesg); + assert(crt_idx); /* If there is a "get_crt_index callback, use it */ if (type->get_crt_index) { @@ -1697,10 +1697,10 @@ H5O_msg_encode(H5F_t *f, unsigned type_id, hbool_t disable_shared, unsigned char FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(f); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Encode */ if ((type->encode)(f, disable_shared, buf, mesg) < 0) @@ -1735,10 +1735,10 @@ H5O_msg_decode(H5F_t *f, H5O_t *open_oh, unsigned type_id, size_t buf_size, cons FUNC_ENTER_NOAPI(NULL) /* check args */ - HDassert(f); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(f); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* decode */ if (NULL == (ret_value = (type->decode)(f, open_oh, 0, &ioflags, buf_size, buf))) @@ -1775,13 +1775,13 @@ H5O__msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *native_sr FUNC_ENTER_PACKAGE /* check args */ - HDassert(type); - HDassert(type->copy_file); - HDassert(file_src); - HDassert(native_src); - HDassert(file_dst); - HDassert(recompute_size); - HDassert(cpy_info); + assert(type); + assert(type->copy_file); + assert(file_src); + assert(native_src); + assert(file_dst); + assert(recompute_size); + assert(cpy_info); /* The copy_file callback will return an H5O_shared_t only if the message * to be copied is a committed datatype. @@ -1818,13 +1818,13 @@ H5O__msg_alloc(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, unsigned *mesg_ FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); - HDassert(mesg_flags); - HDassert(!(*mesg_flags & H5O_MSG_FLAG_SHARED)); - HDassert(type); - HDassert(native); - HDassert(mesg_idx); + assert(f); + assert(oh); + assert(mesg_flags); + assert(!(*mesg_flags & H5O_MSG_FLAG_SHARED)); + assert(type); + assert(native); + assert(mesg_idx); /* Check if message is already shared */ if ((shared_mesg = H5O_msg_is_shared(type->id, native)) < 0) @@ -1884,11 +1884,11 @@ H5O__copy_mesg(H5F_t *f, H5O_t *oh, size_t idx, const H5O_msg_class_t *type, con FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); - HDassert(type); - HDassert(type->copy); - HDassert(mesg); + assert(f); + assert(oh); + assert(type); + assert(type->copy); + assert(mesg); /* Protect chunk */ if (NULL == (chk_proxy = H5O__chunk_protect(f, oh, idx_msg->chunkno))) @@ -1957,10 +1957,10 @@ H5O_msg_delete(H5F_t *f, H5O_t *open_oh, unsigned type_id, void *mesg) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(f); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* delete */ if ((type->del) && (type->del)(f, open_oh, mesg) < 0) @@ -1993,9 +1993,9 @@ H5O__delete_mesg(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(mesg); - HDassert(oh); + assert(f); + assert(mesg); + assert(oh); /* Check if there is a file space deletion callback for this type of message */ if (type->del) { @@ -2033,8 +2033,8 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(f); - HDassert(oh); + assert(f); + assert(oh); /* Point into message's chunk's image */ p = mesg->raw - H5O_SIZEOF_MSGHDR_OH(oh); @@ -2050,7 +2050,7 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) UINT16ENCODE(p, msg_id); else *p++ = (uint8_t)msg_id; - HDassert(mesg->raw_size < H5O_MESG_MAX_SIZE); + assert(mesg->raw_size < H5O_MESG_MAX_SIZE); UINT16ENCODE(p, mesg->raw_size); *p++ = mesg->flags; @@ -2066,15 +2066,15 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) if (oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED) UINT16ENCODE(p, mesg->crt_idx); } /* end else */ - HDassert(p == mesg->raw); + assert(p == mesg->raw); #ifndef NDEBUG /* Make certain that null messages aren't in chunks w/gaps */ if (H5O_NULL_ID == msg_id) - HDassert(oh->chunk[mesg->chunkno].gap == 0); + assert(oh->chunk[mesg->chunkno].gap == 0); else /* Non-null messages should always have a native pointer */ - HDassert(mesg->native); + assert(mesg->native); #endif /* NDEBUG */ /* Encode the message itself, if it's not an "unknown" message */ @@ -2084,10 +2084,10 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) * encode a Shared Object message instead of the object * which is being shared. */ - HDassert(mesg->raw >= oh->chunk[mesg->chunkno].image); - HDassert(mesg->raw_size == H5O_ALIGN_OH(oh, mesg->raw_size)); - HDassert(mesg->raw + mesg->raw_size <= - oh->chunk[mesg->chunkno].image + (oh->chunk[mesg->chunkno].size - H5O_SIZEOF_CHKSUM_OH(oh))); + assert(mesg->raw >= oh->chunk[mesg->chunkno].image); + assert(mesg->raw_size == H5O_ALIGN_OH(oh, mesg->raw_size)); + assert(mesg->raw + mesg->raw_size <= + oh->chunk[mesg->chunkno].image + (oh->chunk[mesg->chunkno].size - H5O_SIZEOF_CHKSUM_OH(oh))); #ifndef NDEBUG /* Sanity check that the message won't overwrite past it's allocated space */ { @@ -2095,10 +2095,10 @@ H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg) msg_size = mesg->type->raw_size(f, FALSE, mesg->native); msg_size = H5O_ALIGN_OH(oh, msg_size); - HDassert(msg_size <= mesg->raw_size); + assert(msg_size <= mesg->raw_size); } #endif /* NDEBUG */ - HDassert(mesg->type->encode); + assert(mesg->type->encode); if ((mesg->type->encode)(f, FALSE, mesg->raw, mesg->native) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode object header message") } /* end if */ @@ -2132,8 +2132,8 @@ H5O__flush_msgs(H5F_t *f, H5O_t *oh) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(oh); + assert(f); + assert(oh); /* Encode any dirty messages */ for (u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) @@ -2178,12 +2178,12 @@ H5O_msg_get_flags(const H5O_loc_t *loc, unsigned type_id, uint8_t *flags) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(loc); - HDassert(loc->file); - HDassert(H5_addr_defined(loc->addr)); - HDassert(type_id < NELMTS(H5O_msg_class_g)); + assert(loc); + assert(loc->file); + assert(H5_addr_defined(loc->addr)); + assert(type_id < NELMTS(H5O_msg_class_g)); type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Get the object header */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 8205a01..150b3be 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -118,8 +118,8 @@ H5O__mtime_new_decode(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t H5_ATTR_UNUSED *open 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"); @@ -177,8 +177,8 @@ H5O__mtime_decode(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Buffer should have 14 message bytes and 2 reserved bytes */ if (H5_IS_BUFFER_OVERFLOW(p, 16, p_end)) @@ -232,9 +232,9 @@ H5O__mtime_new_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(mesg); + assert(f); + assert(p); + assert(mesg); /* Version */ *p++ = H5O_MTIME_VERSION; @@ -272,9 +272,9 @@ H5O__mtime_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(mesg); + assert(f); + assert(p); + assert(mesg); /* encode */ tm = HDgmtime(mesg); @@ -309,7 +309,7 @@ H5O__mtime_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(mesg); + assert(mesg); if (!dest && NULL == (dest = H5FL_MALLOC(time_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -347,8 +347,8 @@ H5O__mtime_new_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disabl FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); FUNC_LEAVE_NOAPI(8) } /* end H5O__mtime_new_size() */ @@ -377,8 +377,8 @@ H5O__mtime_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sh FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); FUNC_LEAVE_NOAPI(16) } /* end H5O__mtime_size() */ @@ -400,7 +400,7 @@ H5O__mtime_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(time_t, mesg); @@ -429,11 +429,11 @@ H5O__mtime_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int i FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* debug */ tm = HDlocaltime(mesg); diff --git a/src/H5Oname.c b/src/H5Oname.c index 10ea365..29bbab0 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -79,8 +79,8 @@ H5O__name_decode(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (NULL == (mesg = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -121,9 +121,9 @@ H5O__name_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(mesg && mesg->s); + assert(f); + assert(p); + assert(mesg && mesg->s); /* encode */ HDstrcpy((char *)p, mesg->s); @@ -156,7 +156,7 @@ H5O__name_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(mesg); + assert(mesg); if (!dest && NULL == (dest = (H5O_name_t *)H5MM_calloc(sizeof(H5O_name_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -203,8 +203,8 @@ H5O__name_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); ret_value = mesg->s ? HDstrlen(mesg->s) + 1 : 0; @@ -232,7 +232,7 @@ H5O__name_reset(void *_mesg) FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(mesg); + assert(mesg); /* reset */ mesg->s = (char *)H5MM_xfree(mesg->s); @@ -260,11 +260,11 @@ H5O__name_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth, "Name:", mesg->s); diff --git a/src/H5Opkg.h b/src/H5Opkg.h index d0e3c26..2ef2e38 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -166,7 +166,7 @@ unsigned ioflags = (IOF); \ \ /* Decode the message */ \ - HDassert(msg_type->decode); \ + assert(msg_type->decode); \ if (NULL == ((MSG)->native = (msg_type->decode)((F), (OH), (MSG)->flags, &ioflags, (MSG)->raw_size, \ (MSG)->raw))) \ HGOTO_ERROR(H5E_OHDR, H5E_CANTDECODE, ERR, "unable to decode message") \ @@ -181,7 +181,7 @@ \ /* Set the message's "shared info", if it's shareable */ \ if ((MSG)->flags & H5O_MSG_FLAG_SHAREABLE) { \ - HDassert(msg_type->share_flags &H5O_SHARE_IS_SHARABLE); \ + assert(msg_type->share_flags &H5O_SHARE_IS_SHARABLE); \ H5O_UPDATE_SHARED((H5O_shared_t *)(MSG)->native, H5O_SHARE_TYPE_HERE, (F), msg_type->id, \ (MSG)->crt_idx, (OH)->chunk[0].addr) \ } /* end if */ \ diff --git a/src/H5Opline.c b/src/H5Opline.c index a40f027..4b4b8ab 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -118,8 +118,8 @@ H5O__pline_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, unsign FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Allocate space for I/O pipeline message */ if (NULL == (pline = H5FL_CALLOC(H5O_pline_t))) @@ -276,8 +276,8 @@ H5O__pline_encode(H5F_t H5_ATTR_UNUSED *f, uint8_t *p /*out*/, const void *mesg) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(p); - HDassert(mesg); + assert(p); + assert(mesg); /* Message header */ *p++ = (uint8_t)pline->version; @@ -534,18 +534,18 @@ H5O__pline_reset(void *mesg) * other API calls so DO NOT ASSUME THAT ANY VALUES ARE SANE. */ - HDassert(pline); + assert(pline); /* Free the filter information and array */ if (pline->filter) { /* Free information for each filter */ for (i = 0; i < pline->nused; i++) { if (pline->filter[i].name && pline->filter[i].name != pline->filter[i]._name) - HDassert((HDstrlen(pline->filter[i].name) + 1) > H5Z_COMMON_NAME_LEN); + assert((HDstrlen(pline->filter[i].name) + 1) > H5Z_COMMON_NAME_LEN); if (pline->filter[i].name != pline->filter[i]._name) pline->filter[i].name = (char *)H5MM_xfree(pline->filter[i].name); if (pline->filter[i].cd_values && pline->filter[i].cd_values != pline->filter[i]._cd_values) - HDassert(pline->filter[i].cd_nelmts > H5Z_COMMON_CD_VALUES); + assert(pline->filter[i].cd_nelmts > H5Z_COMMON_CD_VALUES); if (pline->filter[i].cd_values != pline->filter[i]._cd_values) pline->filter[i].cd_values = (unsigned *)H5MM_xfree(pline->filter[i].cd_values); } /* end for */ @@ -580,7 +580,7 @@ H5O__pline_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_pline_t, mesg); @@ -613,9 +613,9 @@ H5O__pline_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, FUNC_ENTER_PACKAGE /* check args */ - HDassert(pline_src); - HDassert(cpy_info); - HDassert(cpy_info->file_dst); + assert(pline_src); + assert(cpy_info); + assert(cpy_info->file_dst); /* Check to ensure that the version of the message to be copied does not exceed the message version allowed by the destination file's high bound */ @@ -656,11 +656,11 @@ H5O__pline_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, int in FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(pline); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(pline); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %zu/%zu\n", indent, "", fwidth, "Number of filters:", pline->nused, pline->nalloc); @@ -721,8 +721,8 @@ H5O_pline_set_version(H5F_t *f, H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(pline); + assert(f); + assert(pline); /* Upgrade to the version indicated by the file's low bound if higher */ version = MAX(pline->version, H5O_pline_ver_bounds[H5F_LOW_BOUND(f)]); diff --git a/src/H5Orefcount.c b/src/H5Orefcount.c index da36551..04d9eaa 100644 --- a/src/H5Orefcount.c +++ b/src/H5Orefcount.c @@ -88,8 +88,8 @@ H5O__refcount_decode(H5F_t H5_ATTR_UNUSED *f, H5O_t H5_ATTR_UNUSED *open_oh, FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); /* Version of message */ if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) @@ -137,9 +137,9 @@ H5O__refcount_encode(H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_sha FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(refcount); + assert(f); + assert(p); + assert(refcount); /* Message version */ *p++ = H5O_REFCOUNT_VERSION; @@ -174,7 +174,7 @@ H5O__refcount_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(refcount); + assert(refcount); if (!dest && NULL == (dest = H5FL_MALLOC(H5O_refcount_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -235,7 +235,7 @@ H5O__refcount_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_refcount_t, mesg); @@ -264,8 +264,8 @@ H5O__refcount_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_U FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(deleted); - HDassert(cpy_info); + assert(deleted); + assert(cpy_info); /* Always delete this message when copying objects between files. Let * the copy routine set the correct ref. count. @@ -295,11 +295,11 @@ H5O__refcount_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, in FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(refcount); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(refcount); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of links:", (unsigned)*refcount); diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 9bf5d6f..c71a839 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -115,8 +115,8 @@ H5O__sdspace_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UN FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (NULL == (sdim = H5FL_CALLOC(H5S_extent_t))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, NULL, "dataspace structure allocation failed") @@ -255,13 +255,13 @@ H5O__sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg) FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(p); - HDassert(sdim); + assert(f); + assert(p); + assert(sdim); /* Version */ - HDassert(sdim->version > 0); - HDassert(sdim->type != H5S_NULL || sdim->version >= H5O_SDSPACE_VERSION_2); + assert(sdim->version > 0); + assert(sdim->type != H5S_NULL || sdim->version >= H5O_SDSPACE_VERSION_2); *p++ = (uint8_t)sdim->version; /* Rank */ @@ -323,7 +323,7 @@ H5O__sdspace_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(mesg); + assert(mesg); if (!dest && NULL == (dest = H5FL_CALLOC(H5S_extent_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -425,7 +425,7 @@ H5O__sdspace_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5S_extent_t, mesg); @@ -458,10 +458,10 @@ H5O__sdspace_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, FUNC_ENTER_PACKAGE /* check args */ - HDassert(file_src); - HDassert(src_space_extent); - HDassert(cpy_info); - HDassert(cpy_info->file_dst); + assert(file_src); + assert(src_space_extent); + assert(cpy_info); + assert(cpy_info->file_dst); /* Check to ensure that the version of the message to be copied does not exceed the message version allowed by the destination file's high bound */ @@ -514,11 +514,11 @@ H5O__sdspace_debug(H5F_t H5_ATTR_UNUSED *f, const void *mesg, FILE *stream, int FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(sdim); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(sdim); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Rank:", (unsigned long)(sdim->rank)); diff --git a/src/H5Oshared.c b/src/H5Oshared.c index a6af84e..4483b44 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -110,15 +110,15 @@ H5O__shared_read(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const H5O_shared_t FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(shared); - HDassert(type); - HDassert(type->share_flags & H5O_SHARE_IS_SHARABLE); + assert(f); + assert(shared); + assert(type); + assert(type->share_flags & H5O_SHARE_IS_SHARABLE); /* This message could have a heap ID (SOHM) or the address of an object * header on disk (named datatype) */ - HDassert(H5O_IS_STORED_SHARED(shared->type)); + assert(H5O_IS_STORED_SHARED(shared->type)); /* Check for implicit shared object header message */ if (shared->type == H5O_SHARE_TYPE_SOHM) { @@ -157,7 +157,7 @@ H5O__shared_read(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const H5O_shared_t else { H5O_loc_t oloc; /* Location for object header where message is stored */ - HDassert(shared->type == H5O_SHARE_TYPE_COMMITTED); + assert(shared->type == H5O_SHARE_TYPE_COMMITTED); /* Build the object location for the shared message's object header */ oloc.file = f; @@ -219,8 +219,8 @@ H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, H5O_ FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(shared); + assert(f); + assert(shared); /* Check for type of shared message */ if (shared->type == H5O_SHARE_TYPE_COMMITTED) { @@ -259,7 +259,7 @@ H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, H5O_ if (H5O__link_oh(f, adjust, open_oh, &deleted) < 0) HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") - HDassert(!deleted); + assert(!deleted); } else /* The shared message is in another object header */ @@ -267,7 +267,7 @@ H5O__shared_link_adj(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, H5O_ HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count") } /* end if */ else { - HDassert(shared->type == H5O_SHARE_TYPE_SOHM || shared->type == H5O_SHARE_TYPE_HERE); + assert(shared->type == H5O_SHARE_TYPE_SOHM || shared->type == H5O_SHARE_TYPE_HERE); /* Check for decrementing reference count on shared message */ if (adjust < 0) { @@ -309,9 +309,9 @@ H5O__shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const uint8_t *b FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(buf); - HDassert(type); + assert(f); + assert(buf); + assert(type); /* Version */ version = *buf++; @@ -346,7 +346,7 @@ H5O__shared_decode(H5F_t *f, H5O_t *open_oh, unsigned *ioflags, const uint8_t *b * Otherwise, it is a named datatype, so copy an H5O_loc_t. */ if (sh_mesg.type == H5O_SHARE_TYPE_SOHM) { - HDassert(version >= H5O_SHARED_VERSION_3); + assert(version >= H5O_SHARED_VERSION_3); H5MM_memcpy(&sh_mesg.u.heap_id, buf, sizeof(sh_mesg.u.heap_id)); } /* end if */ else { @@ -393,9 +393,9 @@ H5O__shared_encode(const H5F_t *f, uint8_t *buf /*out*/, const H5O_shared_t *sh_ FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(f); - HDassert(buf); - HDassert(sh_mesg); + assert(f); + assert(buf); + assert(sh_mesg); /* If this message is shared in the heap, we need to use version 3 of the * encoding and encode the SHARED_IN_HEAP flag. @@ -403,7 +403,7 @@ H5O__shared_encode(const H5F_t *f, uint8_t *buf /*out*/, const H5O_shared_t *sh_ if (sh_mesg->type == H5O_SHARE_TYPE_SOHM) version = H5O_SHARED_VERSION_LATEST; else { - HDassert(sh_mesg->type == H5O_SHARE_TYPE_COMMITTED); + assert(sh_mesg->type == H5O_SHARE_TYPE_COMMITTED); version = H5O_SHARED_VERSION_2; /* version 1 is no longer used */ } /* end else */ @@ -439,8 +439,8 @@ H5O_set_shared(H5O_shared_t *dst, const H5O_shared_t *src) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(dst); - HDassert(src); + assert(dst); + assert(src); /* copy */ *dst = *src; @@ -474,7 +474,7 @@ H5O__shared_size(const H5F_t *f, const H5O_shared_t *sh_mesg) (size_t)H5F_SIZEOF_ADDR(f); /* Sharing by another obj hdr */ } /* end if */ else { - HDassert(sh_mesg->type == H5O_SHARE_TYPE_SOHM); + assert(sh_mesg->type == H5O_SHARE_TYPE_SOHM); ret_value = 1 + /* Version */ 1 + /* Type field */ H5O_FHEAP_ID_LEN; /* Shared in the heap */ @@ -503,8 +503,8 @@ H5O__shared_delete(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, H5O_sh FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(sh_mesg); + assert(f); + assert(sh_mesg); /* * Committed datatypes increment the OH of the original message when they @@ -544,8 +544,8 @@ H5O__shared_link(H5F_t *f, H5O_t *open_oh, const H5O_msg_class_t *type, H5O_shar FUNC_ENTER_PACKAGE /* Check args */ - HDassert(f); - HDassert(sh_mesg); + assert(f); + assert(sh_mesg); /* Increment the reference count on the shared object */ if (H5O__shared_link_adj(f, open_oh, type, sh_mesg, 1) < 0) @@ -582,13 +582,13 @@ H5O__shared_copy_file(H5F_t H5_ATTR_NDEBUG_UNUSED *file_src, H5F_t *file_dst, FUNC_ENTER_PACKAGE /* check args */ - HDassert(file_src); - HDassert(file_dst); - HDassert(mesg_type); - HDassert(shared_src); - HDassert(shared_dst); - HDassert(recompute_size); - HDassert(cpy_info); + assert(file_src); + assert(file_dst); + assert(mesg_type); + assert(shared_src); + assert(shared_dst); + assert(recompute_size); + assert(cpy_info); /* Committed shared messages create a shared message at the destination * and also copy the committed object that they point to. @@ -647,9 +647,9 @@ H5O__shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(shared_src); - HDassert(shared_dst); + assert(f); + assert(shared_src); + assert(shared_dst); /* Copy the target of committed messages, try to share others */ if (shared_src->type == H5O_SHARE_TYPE_COMMITTED) { @@ -694,10 +694,10 @@ H5O__shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); switch (mesg->type) { case H5O_SHARE_TYPE_UNSHARED: diff --git a/src/H5Oshared.h b/src/H5Oshared.h index b7d2353..d10b298 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -110,7 +110,7 @@ H5O_SHARED_ENCODE(H5F_t *f, hbool_t disable_shared, uint8_t *p, const void *_mes #endif /* H5O_SHARED_ENCODE_REAL */ /* Sanity check */ - HDassert(sh_mesg->type == H5O_SHARE_TYPE_UNSHARED || sh_mesg->msg_type_id == H5O_SHARED_TYPE->id); + assert(sh_mesg->type == H5O_SHARE_TYPE_UNSHARED || sh_mesg->msg_type_id == H5O_SHARED_TYPE->id); /* Check for message stored elsewhere */ if (H5O_IS_STORED_SHARED(sh_mesg->type) && !disable_shared) { @@ -349,11 +349,11 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const FUNC_ENTER_NOAPI_NOINIT - HDassert(oloc_src->file); - HDassert(oloc_dst->file); - HDassert(mesg_src); - HDassert(mesg_dst); - HDassert(cpy_info); + assert(oloc_src->file); + assert(oloc_dst->file); + assert(mesg_src); + assert(mesg_dst); + assert(cpy_info); #ifndef H5O_SHARED_TYPE #error "Need to define H5O_SHARED_TYPE macro!" @@ -384,8 +384,7 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const /* Make sure that if the source or destination is committed, both are * committed */ - HDassert((shared_src->type == H5O_SHARE_TYPE_COMMITTED) == - (shared_dst->type == H5O_SHARE_TYPE_COMMITTED)); + assert((shared_src->type == H5O_SHARE_TYPE_COMMITTED) == (shared_dst->type == H5O_SHARE_TYPE_COMMITTED)); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oshmesg.c b/src/H5Oshmesg.c index 8510c6e..6112b9c 100644 --- a/src/H5Oshmesg.c +++ b/src/H5Oshmesg.c @@ -75,8 +75,8 @@ H5O__shmesg_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (NULL == (mesg = (H5O_shmesg_table_t *)H5MM_calloc(sizeof(H5O_shmesg_table_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, @@ -125,9 +125,9 @@ H5O__shmesg_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(p); - HDassert(mesg); + assert(f); + assert(p); + assert(mesg); /* Store version, table address, and number of indexes */ *p++ = (uint8_t)mesg->version; @@ -161,7 +161,7 @@ H5O__shmesg_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(mesg); + assert(mesg); if (!dest && NULL == (dest = (H5O_shmesg_table_t *)H5MM_malloc(sizeof(H5O_shmesg_table_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, @@ -199,7 +199,7 @@ H5O__shmesg_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const vo FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); + assert(f); ret_value = (size_t)(1 + /* Version number */ H5F_SIZEOF_ADDR(f) + /* Table address */ @@ -228,11 +228,11 @@ H5O__shmesg_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Version:", mesg->version); HDfprintf(stream, "%*s%-*s %" PRIuHADDR " (rel)\n", indent, "", fwidth, diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 3b7417d..ecb55b2 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -90,8 +90,8 @@ H5O__stab_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 (NULL == (stab = H5FL_CALLOC(H5O_stab_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -133,9 +133,9 @@ H5O__stab_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(stab); + assert(f); + assert(p); + assert(stab); /* encode */ H5F_addr_encode(f, &p, stab->btree_addr); @@ -169,7 +169,7 @@ H5O__stab_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(stab); + assert(stab); if (!dest && NULL == (dest = H5FL_MALLOC(H5O_stab_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -229,7 +229,7 @@ H5O__stab_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_stab_t, mesg); @@ -256,8 +256,8 @@ H5O__stab_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); /* Free the file space for the symbol table */ if (H5G__stab_delete(f, (const H5O_stab_t *)mesg) < 0) @@ -295,8 +295,8 @@ H5O__stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, FUNC_ENTER_PACKAGE /* check args */ - HDassert(stab_src); - HDassert(file_dst); + assert(stab_src); + assert(file_dst); /* Allocate space for the destination stab */ if (NULL == (stab_dst = H5FL_MALLOC(H5O_stab_t))) @@ -356,11 +356,11 @@ H5O__stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_lo FUNC_ENTER_PACKAGE /* check args */ - HDassert(stab_src); - HDassert(H5_addr_defined(dst_oloc->addr)); - HDassert(dst_oloc->file); - HDassert(stab_dst); - HDassert(cpy_info); + assert(stab_src); + assert(H5_addr_defined(dst_oloc->addr)); + assert(dst_oloc->file); + assert(stab_dst); + assert(cpy_info); /* If we are performing a 'shallow hierarchy' copy, get out now */ if (cpy_info->max_depth >= 0 && cpy_info->curr_depth >= cpy_info->max_depth) @@ -401,11 +401,11 @@ H5O__stab_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int in FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(stab); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(stab); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, "B-tree address:", stab->btree_addr); diff --git a/src/H5Otest.c b/src/H5Otest.c index f3e6745..41c8ed4 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -117,7 +117,7 @@ H5O__is_attr_dense_test(hid_t oid) /* Check if dense storage is being used */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Check for any messages in object header */ - HDassert(H5O__msg_count_real(oh, H5O_MSG_ATTR) == 0); + assert(H5O__msg_count_real(oh, H5O_MSG_ATTR) == 0); ret_value = TRUE; } /* end if */ @@ -194,7 +194,7 @@ H5O__is_attr_empty_test(hid_t oid) /* Check for using dense storage */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Check for any messages in object header */ - HDassert(nattrs == 0); + assert(nattrs == 0); /* Set metadata tag in API context */ H5_BEGIN_TAG(loc->addr) @@ -214,10 +214,10 @@ H5O__is_attr_empty_test(hid_t oid) } /* end if */ /* Verify that attribute count in object header is correct */ - HDassert(nattrs == ainfo.nattrs); + assert(nattrs == ainfo.nattrs); } /* end if */ else - HDassert(nattrs == 0); + assert(nattrs == 0); } /* end if */ /* Set the return value */ @@ -296,7 +296,7 @@ H5O__num_attrs_test(hid_t oid, hsize_t *nattrs) /* Check for using dense storage */ if (H5_addr_defined(ainfo.fheap_addr)) { /* Check for any messages in object header */ - HDassert(obj_nattrs == 0); + assert(obj_nattrs == 0); /* Set metadata tag in API context */ H5_BEGIN_TAG(loc->addr) @@ -314,7 +314,7 @@ H5O__num_attrs_test(hid_t oid, hsize_t *nattrs) } /* end if */ /* Verify that attribute count in object header is correct */ - HDassert(obj_nattrs == ainfo.nattrs); + assert(obj_nattrs == ainfo.nattrs); } /* end if */ /* Set the number of attributes */ @@ -535,7 +535,7 @@ H5O__expunge_chunks_test(const H5O_loc_t *loc) /* Safety check */ nchunks = oh->nchunks; - HDassert(0 < nchunks && nchunks < NELMTS(chk_addr)); + assert(0 < nchunks && nchunks < NELMTS(chk_addr)); /* Iterate over all the chunks, saving the chunk addresses */ for (u = 0; u < oh->nchunks; u++) @@ -585,8 +585,8 @@ H5O__get_rc_test(const H5O_loc_t *loc, unsigned *rc) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(loc); - HDassert(rc); + assert(loc); + assert(rc); /* Get the object header */ if (NULL == (oh = H5O_protect(loc, H5AC__READ_ONLY_FLAG, FALSE))) diff --git a/src/H5Ounknown.c b/src/H5Ounknown.c index 38b07a1..2d2dc2b 100644 --- a/src/H5Ounknown.c +++ b/src/H5Ounknown.c @@ -75,7 +75,7 @@ H5O__unknown_free(void *mesg) { FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); mesg = H5FL_FREE(H5O_unknown_t, mesg); diff --git a/src/H5P.c b/src/H5P.c index c66e723..3aea232 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -434,7 +434,7 @@ H5Pregister2(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_p /* Substitute the new property class in the ID */ if (NULL == (old_pclass = (H5P_genclass_t *)H5I_subst(cls_id, pclass))) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to substitute property class in ID") - HDassert(old_pclass == orig_pclass); + assert(old_pclass == orig_pclass); /* Close the previous class */ if (H5P__close_class(old_pclass) < 0) @@ -1124,8 +1124,8 @@ H5P__iterate_cb(H5P_genprop_t *prop, void *_udata) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(prop); - HDassert(udata); + assert(prop); + assert(udata); /* Call the user's callback routine */ ret_value = (*udata->iter_func)(udata->id, prop->name, udata->iter_data); diff --git a/src/H5PB.c b/src/H5PB.c index 069ee19..23efc06 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -78,8 +78,8 @@ #define H5PB__INSERT_LRU(page_buf, page_ptr) \ { \ - HDassert(page_buf); \ - HDassert(page_ptr); \ + assert(page_buf); \ + assert(page_ptr); \ /* insert the entry at the head of the list. */ \ H5PB__PREPEND((page_ptr), (page_buf)->LRU_head_ptr, (page_buf)->LRU_tail_ptr, \ (page_buf)->LRU_list_len) \ @@ -87,8 +87,8 @@ #define H5PB__REMOVE_LRU(page_buf, page_ptr) \ { \ - HDassert(page_buf); \ - HDassert(page_ptr); \ + assert(page_buf); \ + assert(page_ptr); \ /* remove the entry from the list. */ \ H5PB__REMOVE((page_ptr), (page_buf)->LRU_head_ptr, (page_buf)->LRU_tail_ptr, \ (page_buf)->LRU_list_len) \ @@ -96,8 +96,8 @@ #define H5PB__MOVE_TO_TOP_LRU(page_buf, page_ptr) \ { \ - HDassert(page_buf); \ - HDassert(page_ptr); \ + assert(page_buf); \ + assert(page_ptr); \ /* Remove entry and insert at the head of the list. */ \ H5PB__REMOVE((page_ptr), (page_buf)->LRU_head_ptr, (page_buf)->LRU_tail_ptr, \ (page_buf)->LRU_list_len) \ @@ -163,7 +163,7 @@ H5PB_reset_stats(H5PB_t *page_buf) FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(page_buf); + assert(page_buf); page_buf->accesses[0] = 0; page_buf->accesses[1] = 0; @@ -205,7 +205,7 @@ H5PB_get_stats(const H5PB_t *page_buf, unsigned accesses[2], unsigned hits[2], u FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(page_buf); + assert(page_buf); accesses[0] = page_buf->accesses[0]; accesses[1] = page_buf->accesses[1]; @@ -240,7 +240,7 @@ H5PB_print_stats(const H5PB_t *page_buf) { FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(page_buf); + assert(page_buf); HDprintf("PAGE BUFFER STATISTICS:\n"); @@ -287,7 +287,7 @@ H5PB_create(H5F_shared_t *f_sh, size_t size, unsigned page_buf_min_meta_perc, un FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); + assert(f_sh); /* Check args */ if (f_sh->fs_strategy != H5F_FSPACE_STRATEGY_PAGE) @@ -364,8 +364,8 @@ H5PB__flush_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(page_entry); - HDassert(f_sh); + assert(page_entry); + assert(f_sh); /* Flush the page if it's dirty */ if (page_entry->is_dirty) @@ -395,7 +395,7 @@ H5PB_flush(H5F_shared_t *f_sh) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f_sh); + assert(f_sh); /* Flush all the entries in the PB skiplist, if we have write access on the file */ if (f_sh->page_buf && (H5F_ACC_RDWR & H5F_SHARED_INTENT(f_sh))) { @@ -430,9 +430,9 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data) FUNC_ENTER_PACKAGE_NOERR /* Sanity checking */ - HDassert(page_entry); - HDassert(op_data); - HDassert(op_data->page_buf); + assert(page_entry); + assert(op_data); + assert(op_data->page_buf); /* Remove entry from LRU list */ if (op_data->actual_slist) { @@ -465,7 +465,7 @@ H5PB_dest(H5F_shared_t *f_sh) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); + assert(f_sh); /* flush and destroy the page buffer, if it exists */ if (f_sh->page_buf) { @@ -523,9 +523,9 @@ H5PB_add_new_page(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t page_addr) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); + assert(f_sh); page_buf = f_sh->page_buf; - HDassert(page_buf); + assert(page_buf); /* If there is an existing page, this means that at some point the * file free space manager freed and re-allocated a page at the same @@ -581,9 +581,9 @@ H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf) FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(page_buf); - HDassert(size <= page_buf->page_size); - HDassert(buf); + assert(page_buf); + assert(size <= page_buf->page_size); + assert(buf); /* calculate the aligned address of the first page */ page_addr = (addr / page_buf->page_size) * page_buf->page_size; @@ -593,7 +593,7 @@ H5PB_update_entry(H5PB_t *page_buf, haddr_t addr, size_t size, const void *buf) if (page_entry) { haddr_t offset; - HDassert(addr + size <= page_addr + page_buf->page_size); + assert(addr + size <= page_addr + page_buf->page_size); offset = addr - page_addr; H5MM_memcpy((uint8_t *)page_entry->page_buf_ptr + offset, buf, size); @@ -629,22 +629,22 @@ H5PB_remove_entry(const H5F_shared_t *f_sh, haddr_t addr) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); + assert(f_sh); page_buf = f_sh->page_buf; - HDassert(page_buf); + assert(page_buf); /* Search for address in the skip list */ page_entry = (H5PB_entry_t *)H5SL_search(page_buf->slist_ptr, (void *)(&addr)); /* If found, remove the entry from the PB cache */ if (page_entry) { - HDassert(page_entry->type != H5F_MEM_PAGE_DRAW); + assert(page_entry->type != H5F_MEM_PAGE_DRAW); if (NULL == H5SL_remove(page_buf->slist_ptr, &(page_entry->addr))) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Page Entry is not in skip list") /* Remove from LRU list */ H5PB__REMOVE_LRU(page_buf, page_entry) - HDassert(H5SL_count(page_buf->slist_ptr) == page_buf->LRU_list_len); + assert(H5SL_count(page_buf->slist_ptr) == page_buf->LRU_list_len); page_buf->meta_count--; @@ -686,8 +686,8 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); - HDassert(type != H5FD_MEM_GHEAP); + assert(f_sh); + assert(type != H5FD_MEM_GHEAP); /* Get pointer to page buffer info for this file */ page_buf = f_sh->page_buf; @@ -753,7 +753,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * num_touched_pages = (last_page_addr / page_buf->page_size + 1) - (first_page_addr / page_buf->page_size); if (first_page_addr == last_page_addr) { - HDassert(1 == num_touched_pages); + assert(1 == num_touched_pages); last_page_addr = HADDR_UNDEF; } /* end if */ } /* end if */ @@ -788,20 +788,20 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * if (node) { page_entry = (H5PB_entry_t *)H5SL_item(node); - HDassert(page_entry); + assert(page_entry); /* If the current page address falls out of the access block, then there are no more pages to go over */ if (page_entry->addr >= addr + size) break; - HDassert(page_entry->addr == search_addr); + assert(page_entry->addr == search_addr); if (page_entry->is_dirty) { /* special handling for the first page if it is not a full page access */ if (i == 0 && first_page_addr != addr) { offset = addr - first_page_addr; - HDassert(page_buf->page_size > offset); + assert(page_buf->page_size > offset); H5MM_memcpy(buf, (uint8_t *)page_entry->page_buf_ptr + offset, page_buf->page_size - (size_t)offset); @@ -836,7 +836,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * else { /* A raw data access could span 1 or 2 PB entries at this point so we need to handle that */ - HDassert(1 == num_touched_pages || 2 == num_touched_pages); + assert(1 == num_touched_pages || 2 == num_touched_pages); for (i = 0; i < num_touched_pages; i++) { haddr_t buf_offset; @@ -890,7 +890,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * if (0 == can_make_space) { /* make space can't return FALSE on second touched page since the first is of the same * type */ - HDassert(0 == i); + assert(0 == i); /* read entire block from VFD and return */ if (H5FD_read(file, type, addr, size, buf) < 0) @@ -987,7 +987,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(f_sh); + assert(f_sh); /* Get pointer to page buffer info for this file */ page_buf = f_sh->page_buf; @@ -1061,7 +1061,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const num_touched_pages = (last_page_addr / page_buf->page_size + 1) - (first_page_addr / page_buf->page_size); if (first_page_addr == last_page_addr) { - HDassert(1 == num_touched_pages); + assert(1 == num_touched_pages); last_page_addr = HADDR_UNDEF; } /* end if */ } /* end if */ @@ -1088,7 +1088,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const page_entry = (H5PB_entry_t *)H5SL_search(page_buf->slist_ptr, (void *)(&search_addr)); if (page_entry) { offset = addr - first_page_addr; - HDassert(page_buf->page_size > offset); + assert(page_buf->page_size > offset); /* Update page's data */ H5MM_memcpy((uint8_t *)page_entry->page_buf_ptr + offset, buf, @@ -1102,7 +1102,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const /* Special handling for the last page if it is not a full page update */ else if (num_touched_pages > 1 && i == (num_touched_pages - 1) && (search_addr + page_buf->page_size) != (addr + size)) { - HDassert(search_addr + page_buf->page_size > addr + size); + assert(search_addr + page_buf->page_size > addr + size); /* Lookup the page in the skip list */ page_entry = (H5PB_entry_t *)H5SL_search(page_buf->slist_ptr, (void *)(&search_addr)); @@ -1141,7 +1141,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const } /* end if */ else { /* An access could span 1 or 2 PBs at this point so we need to handle that */ - HDassert(1 == num_touched_pages || 2 == num_touched_pages); + assert(1 == num_touched_pages || 2 == num_touched_pages); for (i = 0; i < num_touched_pages; i++) { haddr_t buf_offset; @@ -1194,7 +1194,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const * buffer for this I/O and we need to bypass */ if (0 == can_make_space) { - HDassert(0 == i); + assert(0 == i); /* Write to VFD and return */ if (H5FD_write(file, type, addr, size, buf) < 0) @@ -1323,7 +1323,7 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled) FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(f_sh); + assert(f_sh); /* Get pointer to page buffer info for this file */ page_buf = f_sh->page_buf; @@ -1356,7 +1356,7 @@ H5PB_enabled(H5F_shared_t *f_sh, H5FD_mem_t type, hbool_t *enabled) * returns FALSE, the calling function performs I/O avoiding the page * buffer layer */ if (page_buf) { - HDassert(type == H5FD_MEM_DRAW); + assert(type == H5FD_MEM_DRAW); page_buf->bypasses[1]++; } /* end if */ @@ -1402,7 +1402,7 @@ H5PB__insert_entry(H5PB_t *page_buf, H5PB_entry_t *page_entry) /* Insert entry in skip list */ if (H5SL_insert(page_buf->slist_ptr, page_entry, &(page_entry->addr)) < 0) HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTINSERT, FAIL, "can't insert entry in skip list") - HDassert(H5SL_count(page_buf->slist_ptr) * page_buf->page_size <= page_buf->max_size); + assert(H5SL_count(page_buf->slist_ptr) * page_buf->page_size <= page_buf->max_size); /* Increment appropriate page count */ if (H5F_MEM_PAGE_DRAW == page_entry->type || H5F_MEM_PAGE_GHEAP == page_entry->type) @@ -1445,8 +1445,8 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f_sh); - HDassert(page_buf); + assert(f_sh); + assert(page_buf); /* Get oldest entry */ page_entry = page_buf->LRU_tail_ptr; @@ -1455,7 +1455,7 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) /* If threshould is 100% metadata and page buffer is full of metadata, then we can't make space for raw data */ if (0 == page_buf->raw_count && page_buf->min_meta_count == page_buf->meta_count) { - HDassert(page_buf->meta_count * page_buf->page_size == page_buf->max_size); + assert(page_buf->meta_count * page_buf->page_size == page_buf->max_size); HGOTO_DONE(FALSE) } /* end if */ @@ -1472,7 +1472,7 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) /* If threshould is 100% raw data and page buffer is full of raw data, then we can't make space for meta data */ if (0 == page_buf->meta_count && page_buf->min_raw_count == page_buf->raw_count) { - HDassert(page_buf->raw_count * page_buf->page_size == page_buf->max_size); + assert(page_buf->raw_count * page_buf->page_size == page_buf->max_size); HGOTO_DONE(FALSE) } /* end if */ @@ -1493,7 +1493,7 @@ H5PB__make_space(H5F_shared_t *f_sh, H5PB_t *page_buf, H5FD_mem_t inserted_type) /* Remove entry from LRU list */ H5PB__REMOVE_LRU(page_buf, page_entry) - HDassert(H5SL_count(page_buf->slist_ptr) == page_buf->LRU_list_len); + assert(H5SL_count(page_buf->slist_ptr) == page_buf->LRU_list_len); /* Decrement appropriate page type counter */ if (H5F_MEM_PAGE_DRAW == page_entry->type || H5F_MEM_PAGE_GHEAP == page_entry->type) @@ -1543,8 +1543,8 @@ H5PB__write_entry(H5F_shared_t *f_sh, H5PB_entry_t *page_entry) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f_sh); - HDassert(page_entry); + assert(f_sh); + assert(page_entry); /* Retrieve the 'eoa' for the file */ if (HADDR_UNDEF == (eoa = H5F_shared_get_eoa(f_sh, (H5FD_mem_t)page_entry->type))) diff --git a/src/H5PLint.c b/src/H5PLint.c index 62e0074..e9156f2 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -82,7 +82,7 @@ H5PL__get_plugin_control_mask(unsigned int *mask /*out*/) FUNC_ENTER_PACKAGE_NOERR /* Check args - Just assert on package functions */ - HDassert(mask); + assert(mask); /* Return the mask */ *mask = H5PL_plugin_control_mask_g; @@ -329,11 +329,11 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *s FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(path); + assert(path); if (type == H5PL_TYPE_NONE) - HDassert(!key); - HDassert(success); - HDassert(plugin_info); + assert(!key); + assert(success); + assert(plugin_info); /* Initialize out parameters */ *success = FALSE; diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 965479f..4cfa83e 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -108,8 +108,8 @@ H5PL__insert_at(const char *path, unsigned int idx) FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(path); - HDassert(HDstrlen(path)); + assert(path); + assert(HDstrlen(path)); /* Expand the table if it is full */ if (H5PL_num_paths_g == H5PL_path_capacity_g) @@ -158,7 +158,7 @@ H5PL__make_space_at(unsigned int idx) FUNC_ENTER_PACKAGE_NOERR /* Check args - Just assert on package functions */ - HDassert(idx < H5PL_path_capacity_g); + assert(idx < H5PL_path_capacity_g); /* Copy the paths back to make a space */ for (u = H5PL_num_paths_g; u > idx; u--) @@ -189,8 +189,8 @@ H5PL__replace_at(const char *path, unsigned int idx) FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(path); - HDassert(HDstrlen(path)); + assert(path); + assert(HDstrlen(path)); /* Check that the table entry is in use */ if (!H5PL_paths_g[idx]) @@ -386,8 +386,8 @@ H5PL__append_path(const char *path) FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(path); - HDassert(HDstrlen(path)); + assert(path); + assert(HDstrlen(path)); /* Insert the path at the end of the table */ if (H5PL__insert_at(path, H5PL_num_paths_g) < 0) @@ -414,8 +414,8 @@ H5PL__prepend_path(const char *path) FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(path); - HDassert(HDstrlen(path)); + assert(path); + assert(HDstrlen(path)); /* Insert the path at the beginning of the table */ if (H5PL__insert_at(path, 0) < 0) @@ -442,9 +442,9 @@ H5PL__replace_path(const char *path, unsigned int idx) FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(path); - HDassert(HDstrlen(path)); - HDassert(idx < H5PL_path_capacity_g); + assert(path); + assert(HDstrlen(path)); + assert(idx < H5PL_path_capacity_g); /* Insert the path at the requested index */ if (H5PL__replace_at(path, idx) < 0) @@ -472,9 +472,9 @@ H5PL__insert_path(const char *path, unsigned int idx) FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(path); - HDassert(HDstrlen(path)); - HDassert(idx < H5PL_path_capacity_g); + assert(path); + assert(HDstrlen(path)); + assert(idx < H5PL_path_capacity_g); /* Insert the path at the requested index */ if (H5PL__insert_at(path, idx) < 0) @@ -503,7 +503,7 @@ H5PL__remove_path(unsigned int idx) FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(idx < H5PL_path_capacity_g); + assert(idx < H5PL_path_capacity_g); /* Check if the path at that index is set */ if (!H5PL_paths_g[idx]) @@ -612,8 +612,8 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type FUNC_ENTER_PACKAGE - HDassert(plugin_path); - HDassert(iter_op); + assert(plugin_path); + assert(iter_op); /* Open the directory - skip the path if the directory can't be opened */ if (!(dirp = HDopendir(plugin_path))) @@ -704,8 +704,8 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(plugin_path); - HDassert(iter_op); + assert(plugin_path); + assert(iter_op); /* Specify a file mask. *.* = We want everything! - * skip the path if the directory can't be opened */ @@ -788,9 +788,9 @@ H5PL__find_plugin_in_path_table(const H5PL_search_params_t *search_params, hbool FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(search_params); - HDassert(found); - HDassert(plugin_info); + assert(search_params); + assert(found); + assert(plugin_info); /* Initialize output parameters */ *found = FALSE; @@ -844,10 +844,10 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(search_params); - HDassert(found); - HDassert(dir); - HDassert(plugin_info); + assert(search_params); + assert(found); + assert(dir); + assert(plugin_info); /* Initialize the found parameter */ *found = FALSE; @@ -926,10 +926,10 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(search_params); - HDassert(found); - HDassert(dir); - HDassert(plugin_info); + assert(search_params); + assert(found); + assert(dir); + assert(plugin_info); /* Initialize the found parameter */ *found = FALSE; diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index 7d7c1d6..a120972 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -253,9 +253,9 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f FUNC_ENTER_PACKAGE /* Check args - Just assert on package functions */ - HDassert(search_params); - HDassert(found); - HDassert(plugin_info); + assert(search_params); + assert(found); + assert(plugin_info); /* Initialize output parameters */ *found = FALSE; @@ -289,7 +289,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f matched = TRUE; } else { - HDassert(search_params->key->vol.kind == H5VL_GET_CONNECTOR_BY_VALUE); + assert(search_params->key->vol.kind == H5VL_GET_CONNECTOR_BY_VALUE); /* Make sure the plugin cache entry key type matches our search key type */ if (H5PL_cache_g[u].key.vol.kind != H5VL_GET_CONNECTOR_BY_VALUE) @@ -313,7 +313,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f matched = TRUE; } else { - HDassert(search_params->key->vfd.kind == H5FD_GET_DRIVER_BY_VALUE); + assert(search_params->key->vfd.kind == H5FD_GET_DRIVER_BY_VALUE); /* Make sure the plugin cache entry key type matches our search key type */ if (H5PL_cache_g[u].key.vfd.kind != H5FD_GET_DRIVER_BY_VALUE) diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 268728d..7fae53b 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -269,7 +269,7 @@ H5P__dapl_vds_file_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNU FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(value); + assert(value); /* Copy the prefix */ *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -293,7 +293,7 @@ H5P__dapl_vds_file_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNU FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(value); + assert(value); /* Copy the prefix */ *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -330,7 +330,7 @@ H5P__dapl_vds_file_pref_enc(const void *value, void **_pp, size_t *size) enc_value = (uint64_t)len; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); if (NULL != *pp) { /* encode the length of the prefix */ @@ -373,14 +373,14 @@ H5P__dapl_vds_file_pref_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE - HDassert(pp); - HDassert(*pp); - HDassert(vds_file_pref); + assert(pp); + assert(*pp); + assert(vds_file_pref); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); /* Decode the size */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); /* Decode the value */ UINT64DECODE_VAR(*pp, enc_value, enc_size); @@ -416,7 +416,7 @@ H5P__dapl_vds_file_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNU { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); H5MM_xfree(*(void **)value); @@ -436,7 +436,7 @@ H5P__dapl_vds_file_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNU { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -486,7 +486,7 @@ H5P__dapl_vds_file_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UN { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); H5MM_xfree(*(void **)value); @@ -509,7 +509,7 @@ H5P__dapl_efile_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(value); + assert(value); /* Copy the prefix */ *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -533,7 +533,7 @@ H5P__dapl_efile_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(value); + assert(value); /* Copy the prefix */ *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -570,7 +570,7 @@ H5P__dapl_efile_pref_enc(const void *value, void **_pp, size_t *size) enc_value = (uint64_t)len; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); if (NULL != *pp) { /* encode the length of the prefix */ @@ -613,14 +613,14 @@ H5P__dapl_efile_pref_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE - HDassert(pp); - HDassert(*pp); - HDassert(efile_pref); + assert(pp); + assert(*pp); + assert(efile_pref); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); /* Decode the size */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); /* Decode the value */ UINT64DECODE_VAR(*pp, enc_value, enc_size); @@ -656,7 +656,7 @@ H5P__dapl_efile_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); H5MM_xfree(*(void **)value); @@ -676,7 +676,7 @@ H5P__dapl_efile_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -726,7 +726,7 @@ H5P__dapl_efile_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSE { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); H5MM_xfree(*(void **)value); @@ -874,7 +874,7 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) /* Sanity checks */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - HDassert(size); + assert(size); /* Determine if this is the default value, in which case only encode * enc_size (as 255). Also set size needed for encoding. */ @@ -885,11 +885,11 @@ H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) else { enc_value = (uint64_t) * (const size_t *)value; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size > 0); + assert(enc_size > 0); *size += (1 + enc_size); } /* end else */ - HDassert(enc_size < 256); + assert(enc_size < 256); if (NULL != *pp) { /* Encode the size */ @@ -929,13 +929,13 @@ H5P__decode_chunk_cache_nslots(const void **_pp, void *_value) /* Sanity check */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - HDassert(pp); - HDassert(*pp); - HDassert(value); + assert(pp); + assert(*pp); + assert(value); /* Decode the size */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); /* Determine if enc_size indicates that this is the default value, in which * case set value to H5D_ACS_DATA_CACHE_NUM_SLOTS_DEF and return */ @@ -974,7 +974,7 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) /* Sanity checks */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - HDassert(size); + assert(size); /* Determine if this is the default value, in which case only encode * enc_size (as 255). Also set size needed for encoding. */ @@ -985,11 +985,11 @@ H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) else { enc_value = (uint64_t) * (const size_t *)value; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size > 0); + assert(enc_size > 0); *size += (1 + enc_size); } /* end else */ - HDassert(enc_size < 256); + assert(enc_size < 256); if (NULL != *pp) { /* Encode the size */ @@ -1029,13 +1029,13 @@ H5P__decode_chunk_cache_nbytes(const void **_pp, void *_value) /* Sanity check */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - HDassert(pp); - HDassert(*pp); - HDassert(value); + assert(pp); + assert(*pp); + assert(value); /* Decode the size */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); /* Determine if enc_size indicates that this is the default value, in which * case set value to H5D_ACS_DATA_CACHE_BYTE_SIZE_DEF and return */ @@ -1144,8 +1144,8 @@ H5P__dacc_vds_view_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(view); - HDassert(size); + assert(view); + assert(size); if (NULL != *pp) /* Encode EDC property */ @@ -1176,9 +1176,9 @@ H5P__dacc_vds_view_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(view); + assert(pp); + assert(*pp); + assert(view); /* Decode EDC property */ *view = (H5D_vds_view_t) * (*pp)++; diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 2e814d3..27a3a06 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -365,7 +365,7 @@ H5P__dcrt_layout_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of layout */ if (NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) @@ -402,7 +402,7 @@ H5P__dcrt_layout_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of layout */ if (NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) @@ -443,8 +443,8 @@ H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(layout); - HDassert(size); + assert(layout); + assert(size); if (NULL != *pp) { /* Encode layout type */ @@ -577,9 +577,9 @@ H5P__dcrt_layout_dec(const void **_pp, void *value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(value); + assert(pp); + assert(*pp); + assert(value); /* Decode layout type */ type = (H5D_layout_t) * (*pp)++; @@ -771,7 +771,7 @@ H5P__dcrt_layout_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *na FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Reset the old layout */ if (H5O_msg_reset(H5O_LAYOUT_ID, value) < 0) @@ -803,7 +803,7 @@ H5P__dcrt_layout_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED siz FUNC_ENTER_PACKAGE - HDassert(layout); + assert(layout); /* Make copy of layout */ if (NULL == H5O_msg_copy(H5O_LAYOUT_ID, layout, &new_layout)) @@ -842,9 +842,9 @@ H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2, size_t H5_ATTR_ FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(layout1); - HDassert(layout2); - HDassert(size == sizeof(H5O_layout_t)); + assert(layout1); + assert(layout2); + assert(size == sizeof(H5O_layout_t)); /* Check for different layout type */ if (layout1->type < layout2->type) @@ -942,7 +942,7 @@ H5P__dcrt_layout_cmp(const void *_layout1, const void *_layout2, size_t H5_ATTR_ case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert(0 && "Unknown layout type!"); + assert(0 && "Unknown layout type!"); } /* end switch */ done: @@ -970,7 +970,7 @@ H5P__dcrt_layout_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED si FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Reset the old layout */ if (H5O_msg_reset(H5O_LAYOUT_ID, value) < 0) @@ -1004,7 +1004,7 @@ H5P__dcrt_fill_value_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of fill value */ if (NULL == H5O_msg_copy(H5O_FILL_ID, fill, &new_fill)) @@ -1041,7 +1041,7 @@ H5P__dcrt_fill_value_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of fill value */ if (NULL == H5O_msg_copy(H5O_FILL_ID, fill, &new_fill)) @@ -1084,8 +1084,8 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) /* Sanity check */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); HDcompile_assert(sizeof(ssize_t) <= sizeof(int64_t)); - HDassert(fill); - HDassert(size); + assert(fill); + assert(size); if (NULL != *pp) { /* Encode alloc and fill time */ @@ -1102,7 +1102,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) *pp += fill->size; /* Encode fill value datatype */ - HDassert(fill->type); + assert(fill->type); if (H5T_encode(fill->type, NULL, &dt_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") @@ -1110,7 +1110,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) /* Encode the size of a size_t */ enc_value = (uint64_t)dt_size; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); /* Encode the size */ *(*pp)++ = (uint8_t)enc_size; @@ -1134,7 +1134,7 @@ H5P__dcrt_fill_value_enc(const void *value, void **_pp, size_t *size) /* calculate those if they were not calculated earlier */ if (NULL == *pp) { /* Get the size of the encoded datatype */ - HDassert(fill->type); + assert(fill->type); if (H5T_encode(fill->type, NULL, &dt_size) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "can't encode datatype") enc_value = (uint64_t)dt_size; @@ -1198,7 +1198,7 @@ H5P__dcrt_fill_value_dec(const void **_pp, void *_value) *pp += fill->size; enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); /* Decode the size of encoded datatype */ UINT64DECODE_VAR(*pp, enc_value, enc_size); @@ -1236,7 +1236,7 @@ H5P__dcrt_fill_value_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Reset the old fill value message */ if (H5O_msg_reset(H5O_FILL_ID, value) < 0) @@ -1268,7 +1268,7 @@ H5P__dcrt_fill_value_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED FUNC_ENTER_PACKAGE - HDassert(fill); + assert(fill); /* Make copy of fill value message */ if (NULL == H5O_msg_copy(H5O_FILL_ID, fill, &new_fill)) @@ -1307,9 +1307,9 @@ H5P_fill_value_cmp(const void *_fill1, const void *_fill2, size_t H5_ATTR_UNUSED FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(fill1); - HDassert(fill2); - HDassert(size == sizeof(H5O_fill_t)); + assert(fill1); + assert(fill2); + assert(size == sizeof(H5O_fill_t)); /* Check the size of fill values */ if (fill1->size < fill2->size) @@ -1372,7 +1372,7 @@ H5P__dcrt_fill_value_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSE FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Reset the old fill value message */ if (H5O_msg_reset(H5O_FILL_ID, value) < 0) @@ -1406,7 +1406,7 @@ H5P__dcrt_ext_file_list_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNU FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of external file list */ if (NULL == H5O_msg_copy(H5O_EFL_ID, efl, &new_efl)) @@ -1443,7 +1443,7 @@ H5P__dcrt_ext_file_list_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNU FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of external file list */ if (NULL == H5O_msg_copy(H5O_EFL_ID, efl, &new_efl)) @@ -1484,17 +1484,17 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(efl); + assert(efl); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); HDcompile_assert(sizeof(off_t) <= sizeof(uint64_t)); HDcompile_assert(sizeof(hsize_t) <= sizeof(uint64_t)); - HDassert(size); + assert(size); if (NULL != *pp) { /* Encode number of slots used */ enc_value = (uint64_t)efl->nused; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1504,7 +1504,7 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) len = HDstrlen(efl->slot[u].name) + 1; enc_value = (uint64_t)len; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1515,14 +1515,14 @@ H5P__dcrt_ext_file_list_enc(const void *value, void **_pp, size_t *size) /* Encode offset */ enc_value = (uint64_t)efl->slot[u].offset; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); /* encode size */ enc_value = (uint64_t)efl->slot[u].size; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); } /* end for */ @@ -1569,9 +1569,9 @@ H5P__dcrt_ext_file_list_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(pp); - HDassert(*pp); - HDassert(efl); + assert(pp); + assert(*pp); + assert(efl); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); HDcompile_assert(sizeof(off_t) <= sizeof(uint64_t)); HDcompile_assert(sizeof(hsize_t) <= sizeof(uint64_t)); @@ -1581,7 +1581,7 @@ H5P__dcrt_ext_file_list_dec(const void **_pp, void *_value) /* Decode number of slots used */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); nused = (size_t)enc_value; @@ -1600,7 +1600,7 @@ H5P__dcrt_ext_file_list_dec(const void **_pp, void *_value) /* Decode length of slot name */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); len = (size_t)enc_value; @@ -1610,13 +1610,13 @@ H5P__dcrt_ext_file_list_dec(const void **_pp, void *_value) /* decode offset */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); efl->slot[u].offset = (off_t)enc_value; /* decode size */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); efl->slot[u].size = (hsize_t)enc_value; @@ -1650,7 +1650,7 @@ H5P__dcrt_ext_file_list_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNU FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Reset the old efl message */ if (H5O_msg_reset(H5O_EFL_ID, value) < 0) @@ -1682,7 +1682,7 @@ H5P__dcrt_ext_file_list_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNU FUNC_ENTER_PACKAGE - HDassert(efl); + assert(efl); /* Make copy of efl message */ if (NULL == H5O_msg_copy(H5O_EFL_ID, efl, &new_efl)) @@ -1722,9 +1722,9 @@ H5P__dcrt_ext_file_list_cmp(const void *_efl1, const void *_efl2, size_t H5_ATTR FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(efl1); - HDassert(efl2); - HDassert(size == sizeof(H5O_efl_t)); + assert(efl1); + assert(efl2); + assert(size == sizeof(H5O_efl_t)); /* Check the number of allocated efl entries */ if (efl1->nalloc < efl2->nalloc) @@ -1802,7 +1802,7 @@ H5P__dcrt_ext_file_list_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UN FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Reset the old efl message */ if (H5O_msg_reset(H5O_EFL_ID, value) < 0) @@ -2170,7 +2170,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const H5MM_memcpy(&virtual_layout, &H5D_def_layout_virtual_g, sizeof(H5D_def_layout_virtual_g)); /* Sanity check */ - HDassert(virtual_layout.storage.u.virt.list_nalloc == 0); + assert(virtual_layout.storage.u.virt.list_nalloc == 0); } /* end else */ /* Expand list if necessary */ @@ -2359,7 +2359,7 @@ H5Pget_virtual_vspace(hid_t dcpl_id, size_t idx) /* Get the virtual space */ if (idx >= layout.storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); + assert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); if (NULL == (space = H5S_copy(layout.storage.u.virt.list[idx].source_dset.virtual_select, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection") @@ -2416,7 +2416,7 @@ H5Pget_virtual_srcspace(hid_t dcpl_id, size_t idx) /* Check index */ if (idx >= layout.storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); + assert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); /* Attempt to open source dataset and patch extent if extent status is not * H5O_VIRTUAL_STATUS_CORRECT? -NAF */ @@ -2519,8 +2519,8 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t idx, char *name /*out*/, size_t si /* Get the virtual filename */ if (idx >= layout.storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); - HDassert(layout.storage.u.virt.list[idx].source_file_name); + assert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); + assert(layout.storage.u.virt.list[idx].source_file_name); if (name && (size > 0)) (void)HDstrncpy(name, layout.storage.u.virt.list[idx].source_file_name, size); ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[idx].source_file_name); @@ -2580,8 +2580,8 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t idx, char *name /*out*/, size_t si /* Get the virtual filename */ if (idx >= layout.storage.u.virt.list_nused) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid index (out of range)") - HDassert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); - HDassert(layout.storage.u.virt.list[idx].source_dset_name); + assert(layout.storage.u.virt.list_nused <= layout.storage.u.virt.list_nalloc); + assert(layout.storage.u.virt.list[idx].source_dset_name); if (name && (size > 0)) (void)HDstrncpy(name, layout.storage.u.virt.list[idx].source_dset_name, size); ret_value = (ssize_t)HDstrlen(layout.storage.u.virt.list[idx].source_dset_name); @@ -3358,8 +3358,8 @@ H5P_is_fill_value_defined(const H5O_fill_t *fill, H5D_fill_value_t *status) FUNC_ENTER_NOAPI(FAIL) - HDassert(fill); - HDassert(status); + assert(fill); + assert(status); /* Check if the fill value was "unset" */ if (fill->size == -1 && !fill->buf) @@ -3399,7 +3399,7 @@ H5P_fill_value_defined(H5P_genplist_t *plist, H5D_fill_value_t *status) FUNC_ENTER_NOAPI(FAIL) - HDassert(status); + assert(status); /* Get the fill value struct */ if (H5P_peek(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) @@ -3434,7 +3434,7 @@ H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status) FUNC_ENTER_API(FAIL) H5TRACE2("e", "i*DF", plist_id, status); - HDassert(status); + assert(status); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index c02534b..abe94df 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -243,7 +243,7 @@ H5Pregister1(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_p /* Substitute the new property class in the ID */ if (NULL == (old_pclass = (H5P_genclass_t *)H5I_subst(cls_id, pclass))) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to substitute property class in ID") - HDassert(old_pclass == orig_pclass); + assert(old_pclass == orig_pclass); /* Close the previous class */ if (H5P__close_class(orig_pclass) < 0) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 1983898..6a2481e 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -508,8 +508,8 @@ H5P__dxfr_bkgr_buf_type_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(bkgr_buf_type); - HDassert(size); + assert(bkgr_buf_type); + assert(size); if (NULL != *pp) /* Encode background buffer type */ @@ -545,9 +545,9 @@ H5P__dxfr_bkgr_buf_type_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(bkgr_buf_type); + assert(pp); + assert(*pp); + assert(bkgr_buf_type); /* Decode background buffer type */ *bkgr_buf_type = (H5T_bkg_t) * (*pp)++; @@ -579,8 +579,8 @@ H5P__dxfr_btree_split_ratio_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(btree_split_ratio); - HDassert(size); + assert(btree_split_ratio); + assert(size); if (NULL != *pp) { /* Encode the size of a double*/ @@ -630,9 +630,9 @@ H5P__dxfr_btree_split_ratio_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(btree_split_ratio); + assert(pp); + assert(*pp); + assert(btree_split_ratio); /* Decode the size */ enc_size = *(*pp)++; @@ -670,7 +670,7 @@ H5P__dxfr_xform_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *nam FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of data transform */ if (H5Z_xform_copy((H5Z_data_xform_t **)value) < 0) @@ -702,7 +702,7 @@ H5P__dxfr_xform_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *nam FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of data transform */ if (H5Z_xform_copy((H5Z_data_xform_t **)value) < 0) @@ -741,7 +741,7 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) /* Sanity check */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - HDassert(size); + assert(size); /* Check for data transform set */ if (NULL != data_xform_prop) { @@ -760,13 +760,13 @@ H5P__dxfr_xform_enc(const void *value, void **_pp, size_t *size) /* encode the length of the prefix */ enc_value = (uint64_t)len; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); if (NULL != data_xform_prop) { /* Sanity check */ - HDassert(pexp); + assert(pexp); /* Copy the expression into the buffer */ H5MM_memcpy(*pp, (const uint8_t *)pexp, len); @@ -812,14 +812,14 @@ H5P__dxfr_xform_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(data_xform_prop); + assert(pp); + assert(*pp); + assert(data_xform_prop); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); /* Decode the length of xform expression */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); len = (size_t)enc_value; @@ -856,7 +856,7 @@ H5P__dxfr_xform_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *nam FUNC_ENTER_PACKAGE - HDassert(value); + assert(value); if (H5Z_xform_destroy(*(H5Z_data_xform_t **)value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "error closing the parse tree") @@ -887,7 +887,7 @@ H5P__dxfr_xform_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED size FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of data transform */ if (H5Z_xform_copy((H5Z_data_xform_t **)value) < 0) @@ -923,9 +923,9 @@ H5P__dxfr_xform_cmp(const void *_xform1, const void *_xform2, size_t H5_ATTR_UNU FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(xform1); - HDassert(xform2); - HDassert(size == sizeof(H5Z_data_xform_t *)); + assert(xform1); + assert(xform2); + assert(size == sizeof(H5Z_data_xform_t *)); /* Check for a property being set */ if (*xform1 == NULL && *xform2 != NULL) @@ -934,7 +934,7 @@ H5P__dxfr_xform_cmp(const void *_xform1, const void *_xform2, size_t H5_ATTR_UNU HGOTO_DONE(1); if (*xform1) { - HDassert(*xform2); + assert(*xform2); /* Get the transform expressions */ pexp1 = H5Z_xform_extract_xform_str(*xform1); @@ -947,7 +947,7 @@ H5P__dxfr_xform_cmp(const void *_xform1, const void *_xform2, size_t H5_ATTR_UNU HGOTO_DONE(1); if (pexp1) { - HDassert(pexp2); + assert(pexp2); ret_value = HDstrcmp(pexp1, pexp2); } /* end if */ } /* end if */ @@ -976,7 +976,7 @@ H5P__dxfr_xform_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED siz FUNC_ENTER_PACKAGE - HDassert(value); + assert(value); if (H5Z_xform_destroy(*(H5Z_data_xform_t **)value) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "error closing the parse tree") @@ -1593,7 +1593,7 @@ H5P_set_vlen_mem_manager(H5P_genplist_t *plist, H5MM_allocate_t alloc_func, void FUNC_ENTER_NOAPI(FAIL) - HDassert(plist); + assert(plist); /* Update property list */ if (H5P_set(plist, H5D_XFER_VLEN_ALLOC_NAME, &alloc_func) < 0) @@ -1797,8 +1797,8 @@ H5P__dxfr_io_xfer_mode_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(xfer_mode); - HDassert(size); + assert(xfer_mode); + assert(size); if (NULL != *pp) /* Encode I/O transfer mode */ @@ -1834,9 +1834,9 @@ H5P__dxfr_io_xfer_mode_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(xfer_mode); + assert(pp); + assert(*pp); + assert(xfer_mode); /* Decode I/O transfer mode */ *xfer_mode = (H5FD_mpio_xfer_t) * (*pp)++; @@ -1869,8 +1869,8 @@ H5P__dxfr_mpio_collective_opt_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(coll_opt); - HDassert(size); + assert(coll_opt); + assert(size); if (NULL != *pp) /* Encode MPI-I/O collective optimization property */ @@ -1907,9 +1907,9 @@ H5P__dxfr_mpio_collective_opt_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(coll_opt); + assert(pp); + assert(*pp); + assert(coll_opt); /* Decode MPI-I/O collective optimization mode */ *coll_opt = (H5FD_mpio_collective_opt_t) * (*pp)++; @@ -1942,8 +1942,8 @@ H5P__dxfr_mpio_chunk_opt_hard_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(chunk_opt); - HDassert(size); + assert(chunk_opt); + assert(size); if (NULL != *pp) /* Encode MPI-I/O chunk optimization property */ @@ -1979,9 +1979,9 @@ H5P__dxfr_mpio_chunk_opt_hard_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(chunk_opt); + assert(pp); + assert(*pp); + assert(chunk_opt); /* Decode MPI-I/O chunk optimization mode */ *chunk_opt = (H5FD_mpio_chunk_opt_t) * (*pp)++; @@ -2123,8 +2123,8 @@ H5P__dxfr_edc_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(check); - HDassert(size); + assert(check); + assert(size); if (NULL != *pp) /* Encode EDC property */ @@ -2160,9 +2160,9 @@ H5P__dxfr_edc_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(check); + assert(pp); + assert(*pp); + assert(check); /* Decode EDC property */ *check = (H5Z_EDC_t) * (*pp)++; @@ -2233,9 +2233,9 @@ H5P__dxfr_dset_io_hyp_sel_cmp(const void *_space1, const void *_space2, size_t H FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(space1); - HDassert(space1); - HDassert(size == sizeof(H5S_t *)); + assert(space1); + assert(space1); + assert(size == sizeof(H5S_t *)); /* Check for a property being set */ if (*space1 == NULL && *space2 != NULL) @@ -2244,7 +2244,7 @@ H5P__dxfr_dset_io_hyp_sel_cmp(const void *_space1, const void *_space2, size_t H HGOTO_DONE(1); if (*space1) { - HDassert(*space2); + assert(*space2); /* Compare the extents of the dataspaces */ /* (Error & not-equal count the same) */ @@ -2322,8 +2322,8 @@ H5P__dxfr_selection_io_mode_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(select_io_mode); - HDassert(size); + assert(select_io_mode); + assert(size); if (NULL != *pp) /* Encode selection I/O mode property */ @@ -2359,9 +2359,9 @@ H5P__dxfr_selection_io_mode_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(select_io_mode); + assert(pp); + assert(*pp); + assert(select_io_mode); /* Decode selection I/O mode property */ *select_io_mode = (H5D_selection_io_mode_t) * (*pp)++; @@ -2632,8 +2632,8 @@ H5P__dxfr_modify_write_buf_enc(const void *value, void **_pp /*out*/, size_t *si FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(modify_write_buf); - HDassert(size); + assert(modify_write_buf); + assert(size); if (NULL != *pp) /* Encode modify write buf property. Use "!!" so we always get 0 or 1 */ @@ -2666,9 +2666,9 @@ H5P__dxfr_modify_write_buf_dec(const void **_pp, void *_value /*out*/) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(modify_write_buf); + assert(pp); + assert(*pp); + assert(modify_write_buf); /* Decode selection I/O mode property */ *modify_write_buf = (hbool_t) * (*pp)++; diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index ebfa567..d75c52c 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -90,8 +90,8 @@ H5P__encode_size_t(const void *value, void **_pp, size_t *size) /* Sanity checks */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - HDassert(enc_size < 256); - HDassert(size); + assert(enc_size < 256); + assert(size); if (NULL != *pp) { /* Encode the size */ @@ -131,8 +131,8 @@ H5P__encode_hsize_t(const void *value, void **_pp, size_t *size) /* Sanity checks */ HDcompile_assert(sizeof(hsize_t) <= sizeof(uint64_t)); - HDassert(enc_size < 256); - HDassert(size); + assert(enc_size < 256); + assert(size); if (NULL != *pp) { *(*pp)++ = (uint8_t)enc_size; @@ -168,8 +168,8 @@ H5P__encode_unsigned(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(value); - HDassert(size); + assert(value); + assert(size); if (NULL != *pp) { /* Encode the size */ @@ -206,8 +206,8 @@ H5P__encode_uint8_t(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(value); - HDassert(size); + assert(value); + assert(size); if (NULL != *pp) { /* Encode the value */ @@ -241,8 +241,8 @@ H5P__encode_hbool_t(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(value); - HDassert(size); + assert(value); + assert(size); if (NULL != *pp) /* Encode the value */ @@ -275,8 +275,8 @@ H5P__encode_double(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(value); - HDassert(size); + assert(value); + assert(size); if (NULL != *pp) { /* Encode the size */ @@ -321,8 +321,8 @@ H5P__encode_cb(H5P_genprop_t *prop, void *_udata) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(prop); - HDassert(udata); + assert(prop); + assert(udata); /* Check if this property can be encoded */ if (prop->encode) { @@ -450,13 +450,13 @@ H5P__decode_size_t(const void **_pp, void *_value) /* Sanity check */ HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); - HDassert(pp); - HDassert(*pp); - HDassert(value); + assert(pp); + assert(*pp); + assert(value); /* Decode the size */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); /* Decode the value */ UINT64DECODE_VAR(*pp, enc_value, enc_size); @@ -490,13 +490,13 @@ H5P__decode_hsize_t(const void **_pp, void *_value) /* Sanity check */ HDcompile_assert(sizeof(hsize_t) <= sizeof(uint64_t)); - HDassert(pp); - HDassert(*pp); - HDassert(value); + assert(pp); + assert(*pp); + assert(value); /* Decode the size */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); /* Decode the value */ UINT64DECODE_VAR(*pp, enc_value, enc_size); @@ -529,9 +529,9 @@ H5P__decode_unsigned(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(value); + assert(pp); + assert(*pp); + assert(value); /* Decode the size */ enc_size = *(*pp)++; @@ -567,9 +567,9 @@ H5P__decode_uint8_t(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(value); + assert(pp); + assert(*pp); + assert(value); /* Decode the value */ *value = *(*pp)++; @@ -600,9 +600,9 @@ H5P__decode_hbool_t(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(value); + assert(pp); + assert(*pp); + assert(value); /* Decode the value */ *value = (hbool_t) * (*pp)++; @@ -634,9 +634,9 @@ H5P__decode_double(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(value); + assert(pp); + assert(*pp); + assert(value); /* Decode the size */ enc_size = *(*pp)++; diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 84d2522..2b79b82 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -868,7 +868,7 @@ H5P__facc_set_def_driver(void) if ((driver_is_registered = H5FD_is_driver_registered_by_name(driver_env_var, &driver_id)) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't check if VFL driver is already registered") if (driver_is_registered) { - HDassert(driver_id >= 0); + assert(driver_id >= 0); if (H5I_inc_ref(driver_id, TRUE) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINC, FAIL, "unable to increment ref count on VFD") @@ -948,8 +948,8 @@ H5P__facc_set_def_driver_check_predefined(const char *driver_name, hid_t *driver FUNC_ENTER_PACKAGE - HDassert(driver_name); - HDassert(driver_id); + assert(driver_name); + assert(driver_id); if (!HDstrcmp(driver_name, "sec2")) { if ((*driver_id = H5FD_SEC2) < 0) @@ -1166,7 +1166,7 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive /* If VFD configuration information is supplied, ensure that either binary * configuration data or a configuration string is supplied, but not both. */ - HDassert(!new_driver_info || !new_driver_config_str); + assert(!new_driver_info || !new_driver_config_str); if (NULL == H5I_object_verify(new_driver_id, H5I_VFL)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file driver ID") @@ -1258,8 +1258,8 @@ H5P_set_driver_by_name(H5P_genplist_t *plist, const char *driver_name, const cha FUNC_ENTER_NOAPI(FAIL) - HDassert(plist); - HDassert(driver_name); + assert(plist); + assert(driver_name); /* Register the driver */ if ((new_driver_id = H5FD_register_driver_by_name(driver_name, app_ref)) < 0) @@ -1346,8 +1346,8 @@ H5P_set_driver_by_value(H5P_genplist_t *plist, H5FD_class_value_t driver_value, FUNC_ENTER_NOAPI(FAIL) - HDassert(plist); - HDassert(driver_value >= 0); + assert(plist); + assert(driver_value >= 0); /* Register the driver */ if ((new_driver_id = H5FD_register_driver_by_value(driver_value, app_ref)) < 0) @@ -1827,7 +1827,7 @@ H5P__facc_file_driver_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSE FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of file driver ID & info */ if (H5P__file_driver_copy(value) < 0) @@ -1859,7 +1859,7 @@ H5P__facc_file_driver_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSE FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of file driver */ if (H5P__file_driver_copy(value) < 0) @@ -1954,9 +1954,9 @@ H5P__facc_file_driver_cmp(const void *_info1, const void *_info2, size_t H5_ATTR FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(info1); - HDassert(info2); - HDassert(size == sizeof(H5FD_driver_prop_t)); + assert(info1); + assert(info2); + assert(size == sizeof(H5FD_driver_prop_t)); /* Compare drivers */ if (NULL == (cls1 = H5FD_get_class(info1->driver_id))) @@ -1975,13 +1975,13 @@ H5P__facc_file_driver_cmp(const void *_info1, const void *_info2, size_t H5_ATTR HGOTO_DONE(-1) if (cls1->fapl_size > cls2->fapl_size) HGOTO_DONE(1) - HDassert(cls1->fapl_size == cls2->fapl_size); + assert(cls1->fapl_size == cls2->fapl_size); if (info1->driver_info == NULL && info2->driver_info != NULL) HGOTO_DONE(-1); if (info1->driver_info != NULL && info2->driver_info == NULL) HGOTO_DONE(1); if (info1->driver_info) { - HDassert(cls1->fapl_size > 0); + assert(cls1->fapl_size > 0); if (0 != (cmp_value = HDmemcmp(info1->driver_info, info2->driver_info, cls1->fapl_size))) HGOTO_DONE(cmp_value); } /* end if */ @@ -3235,8 +3235,8 @@ H5Pget_file_image(hid_t fapl_id, void **buf /*out*/, size_t *buf_len /*out*/) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistency */ - HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || - ((image_info.buffer == NULL) && (image_info.size == 0))); + assert(((image_info.buffer != NULL) && (image_info.size > 0)) || + ((image_info.buffer == NULL) && (image_info.size == 0))); /* Set output size */ if (buf_len != NULL) @@ -3310,7 +3310,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info") /* verify file image field consistency */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); + assert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* Make sure a file image hasn't already been set */ if (info.buffer != NULL || info.size > 0) @@ -3329,7 +3329,7 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* Release old udata if it exists */ if (info.callbacks.udata != NULL) { - HDassert(info.callbacks.udata_free); + assert(info.callbacks.udata_free); if (info.callbacks.udata_free(info.callbacks.udata) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") } /* end if */ @@ -3338,8 +3338,8 @@ H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback info.callbacks = *callbacks_ptr; if (callbacks_ptr->udata) { - HDassert(callbacks_ptr->udata_copy); - HDassert(callbacks_ptr->udata_free); + assert(callbacks_ptr->udata_copy); + assert(callbacks_ptr->udata_free); if ((info.callbacks.udata = callbacks_ptr->udata_copy(callbacks_ptr->udata)) == NULL) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy the supplied udata") } /* end if */ @@ -3386,7 +3386,7 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") /* verify file image field consistency */ - HDassert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); + assert(((info.buffer != NULL) && (info.size > 0)) || ((info.buffer == NULL) && (info.size == 0))); /* verify that callbacks is not NULL */ if (NULL == callbacks) @@ -3397,7 +3397,7 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback /* Copy udata if it exists */ if (info.callbacks.udata != NULL) { - HDassert(info.callbacks.udata_copy); + assert(info.callbacks.udata_copy); if ((callbacks->udata = info.callbacks.udata_copy(info.callbacks.udata)) == 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy udata") } /* end if */ @@ -3438,8 +3438,7 @@ H5P__file_image_info_copy(void *value) info = (H5FD_file_image_info_t *)value; /* verify file image field consistency */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || - ((info->buffer == NULL) && (info->size == 0))); + assert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); if (info->buffer && info->size > 0) { void *old_buffer; /* Pointer to old image buffer */ @@ -3512,8 +3511,7 @@ H5P__file_image_info_free(void *value) info = (H5FD_file_image_info_t *)value; /* Verify file image field consistency */ - HDassert(((info->buffer != NULL) && (info->size > 0)) || - ((info->buffer == NULL) && (info->size == 0))); + assert(((info->buffer != NULL) && (info->size > 0)) || ((info->buffer == NULL) && (info->size == 0))); /* Free buffer */ if (info->buffer != NULL && info->size > 0) { @@ -3618,7 +3616,7 @@ H5P__facc_cache_image_config_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(value); + assert(value); if (NULL != *pp) { /* Encode type sizes (as a safety check) */ @@ -3665,9 +3663,9 @@ H5P__facc_cache_image_config_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(config); + assert(pp); + assert(*pp); + assert(config); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); /* Set property to default value */ @@ -3712,7 +3710,7 @@ H5P__facc_file_image_info_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of file image info */ if (H5P__file_image_info_copy(value) < 0) @@ -3744,7 +3742,7 @@ H5P__facc_file_image_info_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_U FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of file image info */ if (H5P__file_image_info_copy(value) < 0) @@ -3840,9 +3838,9 @@ H5P__facc_file_image_info_cmp(const void *_info1, const void *_info2, size_t H5_ FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(info1); - HDassert(info2); - HDassert(size == sizeof(H5FD_file_image_info_t)); + assert(info1); + assert(info2); + assert(size == sizeof(H5FD_file_image_info_t)); /* Check for different buffer sizes */ if (info1->size < info2->size) @@ -4109,7 +4107,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(value); + assert(value); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); if (NULL != *pp) { @@ -4136,7 +4134,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) enc_value = (uint64_t)config->initial_size; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -4144,13 +4142,13 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) enc_value = (uint64_t)config->max_size; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); enc_value = (uint64_t)config->min_size; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -4168,7 +4166,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) enc_value = (uint64_t)config->max_increment; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -4190,7 +4188,7 @@ H5P__facc_cache_config_enc(const void *value, void **_pp, size_t *size) enc_value = (uint64_t)config->max_decrement; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -4254,9 +4252,9 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(config); + assert(pp); + assert(*pp); + assert(config); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); /* Set property to default value */ @@ -4287,19 +4285,19 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value) H5_DECODE_UNSIGNED(*pp, config->set_initial_size); enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); config->initial_size = (size_t)enc_value; H5_DECODE_DOUBLE(*pp, config->min_clean_fraction); enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); config->max_size = (size_t)enc_value; enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); config->min_size = (size_t)enc_value; @@ -4319,7 +4317,7 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value) H5_DECODE_UNSIGNED(*pp, config->apply_max_increment); enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); config->max_increment = (size_t)enc_value; @@ -4340,7 +4338,7 @@ H5P__facc_cache_config_dec(const void **_pp, void *_value) H5_DECODE_UNSIGNED(*pp, config->apply_max_decrement); enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); config->max_decrement = (size_t)enc_value; @@ -4386,8 +4384,8 @@ H5P__facc_fclose_degree_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(fclose_degree); - HDassert(size); + assert(fclose_degree); + assert(size); if (NULL != *pp) /* Encode file close degree */ @@ -4423,9 +4421,9 @@ H5P__facc_fclose_degree_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(fclose_degree); + assert(pp); + assert(*pp); + assert(fclose_degree); /* Decode file close degree */ *fclose_degree = (H5F_close_degree_t) * (*pp)++; @@ -4457,8 +4455,8 @@ H5P__facc_multi_type_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(type); - HDassert(size); + assert(type); + assert(size); if (NULL != *pp) /* Encode file close degree */ @@ -4494,9 +4492,9 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(type); + assert(pp); + assert(*pp); + assert(type); /* Decode multi VFD memory type */ *type = (H5FD_mem_t) * (*pp)++; @@ -4527,8 +4525,8 @@ H5P__facc_libver_type_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(type); - HDassert(size); + assert(type); + assert(size); /* Encode */ if (NULL != *pp) @@ -4563,9 +4561,9 @@ H5P__facc_libver_type_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(type); + assert(pp); + assert(*pp); + assert(type); /* Decode */ *type = (H5F_libver_t) * (*pp)++; @@ -4868,7 +4866,7 @@ H5P__facc_mdc_log_location_enc(const void *value, void **_pp, size_t *size) enc_value = (uint64_t)len; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); if (NULL != *pp) { /* encode the length of the prefix */ @@ -4913,14 +4911,14 @@ H5P__facc_mdc_log_location_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE - HDassert(pp); - HDassert(*pp); - HDassert(log_location); + assert(pp); + assert(*pp); + assert(log_location); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); /* Decode the size */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); /* Decode the value */ UINT64DECODE_VAR(*pp, enc_value, enc_size); @@ -4957,7 +4955,7 @@ H5P__facc_mdc_log_location_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_ { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); H5MM_xfree(*(void **)value); @@ -4978,7 +4976,7 @@ H5P__facc_mdc_log_location_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -5031,7 +5029,7 @@ H5P__facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); H5MM_xfree(*(void **)value); @@ -5242,8 +5240,8 @@ H5P__encode_coll_md_read_flag_t(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(coll_md_read_flag); - HDassert(size); + assert(coll_md_read_flag); + assert(size); if (NULL != *pp) { /* Encode the value */ @@ -5279,9 +5277,9 @@ H5P__decode_coll_md_read_flag_t(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(coll_md_read_flag); + assert(pp); + assert(*pp); + assert(coll_md_read_flag); /* Decode file close degree */ *coll_md_read_flag = (H5P_coll_md_read_flag_t) * (*pp); @@ -6337,7 +6335,7 @@ H5P__facc_vol_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of VOL connector ID & info */ if (H5VL_conn_copy((H5VL_connector_prop_t *)value) < 0) @@ -6366,7 +6364,7 @@ H5P__facc_vol_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED *name, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of VOL connector */ if (H5VL_conn_copy((H5VL_connector_prop_t *)value) < 0) @@ -6454,9 +6452,9 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(info1); - HDassert(info2); - HDassert(size == sizeof(H5VL_connector_prop_t)); + assert(info1); + assert(info2); + assert(size == sizeof(H5VL_connector_prop_t)); /* Compare connectors */ if (NULL == (cls1 = (H5VL_class_t *)H5I_object(info1->connector_id))) @@ -6464,7 +6462,7 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED if (NULL == (cls2 = (H5VL_class_t *)H5I_object(info2->connector_id))) HGOTO_DONE(1) status = H5VL_cmp_connector_cls(&cmp_value, cls1, cls2); - HDassert(status >= 0); + assert(status >= 0); if (cmp_value != 0) HGOTO_DONE(cmp_value); @@ -6475,9 +6473,9 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED /* Use one of the classes (cls1) info comparison routines to compare the * info objects */ - HDassert(cls1->info_cls.cmp == cls2->info_cls.cmp); + assert(cls1->info_cls.cmp == cls2->info_cls.cmp); status = H5VL_cmp_connector_info(cls1, &cmp_value, info1->connector_info, info2->connector_info); - HDassert(status >= 0); + assert(status >= 0); /* Set return value */ ret_value = cmp_value; diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index aa06240..4d9a5be 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -700,8 +700,8 @@ H5P__fcrt_btree_rank_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(btree_k); - HDassert(size); + assert(btree_k); + assert(size); if (NULL != *pp) { unsigned u; /* Local index variable */ @@ -749,9 +749,9 @@ H5P__fcrt_btree_rank_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(btree_k); + assert(pp); + assert(*pp); + assert(btree_k); /* Decode the size */ enc_size = *(*pp)++; @@ -987,8 +987,8 @@ H5P__fcrt_shmsg_index_types_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(type_flags); - HDassert(size); + assert(type_flags); + assert(size); if (NULL != *pp) { unsigned u; /* Local index variable */ @@ -1037,9 +1037,9 @@ H5P__fcrt_shmsg_index_types_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(type_flags); + assert(pp); + assert(*pp); + assert(type_flags); /* Decode the size */ enc_size = *(*pp)++; @@ -1078,8 +1078,8 @@ H5P__fcrt_shmsg_index_minsize_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(minsizes); - HDassert(size); + assert(minsizes); + assert(size); if (NULL != *pp) { unsigned u; /* Local index variable */ @@ -1128,9 +1128,9 @@ H5P__fcrt_shmsg_index_minsize_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(minsizes); + assert(pp); + assert(*pp); + assert(minsizes); /* Decode the size */ enc_size = *(*pp)++; @@ -1356,8 +1356,8 @@ H5P__fcrt_fspace_strategy_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(strategy); - HDassert(size); + assert(strategy); + assert(size); if (NULL != *pp) /* Encode free-space strategy */ @@ -1393,9 +1393,9 @@ H5P__fcrt_fspace_strategy_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(strategy); + assert(pp); + assert(*pp); + assert(strategy); /* Decode free-space strategy */ *strategy = (H5F_fspace_strategy_t) * (*pp)++; diff --git a/src/H5Pint.c b/src/H5Pint.c index 45647aa..88f9550 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -461,11 +461,11 @@ H5P_init_phase1(void) H5P_libclass_t const *lib_class = init_class[u]; /* Current class to operate on */ /* Check if the current class hasn't been initialized and can be now */ - HDassert(lib_class->class_id); + assert(lib_class->class_id); if (*lib_class->class_id == (-1) && (lib_class->par_pclass == NULL || *lib_class->par_pclass != NULL)) { /* Sanity check - only the root class is not allowed to have a parent class */ - HDassert(lib_class->par_pclass || lib_class == H5P_CLS_ROOT); + assert(lib_class->par_pclass || lib_class == H5P_CLS_ROOT); /* Allocate the new class */ if (NULL == (*lib_class->pclass = H5P__create_class( @@ -499,7 +499,7 @@ H5P_init_phase1(void) } while (pass_init > 0); /* Verify that all classes were initialized */ - HDassert(tot_init == NELMTS(init_class)); + assert(tot_init == NELMTS(init_class)); done: if (ret_value < 0 && tot_init > 0) { @@ -510,7 +510,7 @@ done: for (u = 0; u < NELMTS(init_class); u++) { H5P_libclass_t const *lib_class = init_class[u]; /* Current class to operate on */ - HDassert(lib_class->class_id); + assert(lib_class->class_id); if (*lib_class->class_id >= 0) { /* Close the class ID */ if (H5I_dec_ref(*lib_class->class_id) < 0) @@ -706,7 +706,7 @@ H5P__close_class_cb(void *_pclass, void H5_ATTR_UNUSED **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(pclass); + assert(pclass); /* Close the property list class object */ if (H5P__close_class(pclass) < 0) @@ -737,7 +737,7 @@ H5P__close_list_cb(void *_plist, void H5_ATTR_UNUSED **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); + assert(plist); /* Close the property list object */ if (H5P_close(plist) < 0) @@ -779,10 +779,10 @@ H5P__do_prop_cb1(H5SL_t *slist, H5P_genprop_t *prop, H5P_prp_cb1_t cb) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(slist); - HDassert(prop); - HDassert(prop->cmp); - HDassert(cb); + assert(slist); + assert(prop); + assert(prop->cmp); + assert(cb); /* Allocate space for a temporary copy of the property value */ if (NULL == (tmp_value = H5MM_malloc(prop->size))) @@ -846,7 +846,7 @@ H5P__copy_pclass(H5P_genclass_t *pclass) FUNC_ENTER_PACKAGE - HDassert(pclass); + assert(pclass); /* * Create new property class object @@ -928,7 +928,7 @@ H5P_copy_plist(const H5P_genplist_t *old_plist, hbool_t app_ref) FUNC_ENTER_NOAPI(H5I_INVALID_HID) - HDassert(old_plist); + assert(old_plist); /* * Create new property list object @@ -1144,8 +1144,8 @@ H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) FUNC_ENTER_PACKAGE - HDassert(oprop); - HDassert(type != H5P_PROP_WITHIN_UNKNOWN); + assert(oprop); + assert(type != H5P_PROP_WITHIN_UNKNOWN); /* Allocate the new property */ if (NULL == (prop = H5FL_MALLOC(H5P_genprop_t))) @@ -1158,8 +1158,8 @@ H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) /* Duplicating property for a class */ if (type == H5P_PROP_WITHIN_CLASS) { - HDassert(oprop->type == H5P_PROP_WITHIN_CLASS); - HDassert(oprop->shared_name == FALSE); + assert(oprop->type == H5P_PROP_WITHIN_CLASS); + assert(oprop->shared_name == FALSE); /* Duplicate name */ prop->name = H5MM_xstrdup(oprop->name); @@ -1176,8 +1176,8 @@ H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) } /* end if */ /* Duplicating a property from a class */ else { - HDassert(oprop->type == H5P_PROP_WITHIN_CLASS); - HDassert(oprop->shared_name == FALSE); + assert(oprop->type == H5P_PROP_WITHIN_CLASS); + assert(oprop->shared_name == FALSE); /* Share the name */ prop->shared_name = TRUE; @@ -1189,7 +1189,7 @@ H5P__dup_prop(H5P_genprop_t *oprop, H5P_prop_within_t type) /* Duplicate current value, if it exists */ if (oprop->value != NULL) { - HDassert(prop->size > 0); + assert(prop->size > 0); if (NULL == (prop->value = H5MM_malloc(prop->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") H5MM_memcpy(prop->value, oprop->value, prop->size); @@ -1258,9 +1258,9 @@ H5P__create_prop(const char *name, size_t size, H5P_prop_within_t type, const vo FUNC_ENTER_PACKAGE - HDassert(name); - HDassert((size > 0 && value != NULL) || (size == 0)); - HDassert(type != H5P_PROP_WITHIN_UNKNOWN); + assert(name); + assert((size > 0 && value != NULL) || (size == 0)); + assert(type != H5P_PROP_WITHIN_UNKNOWN); /* Allocate the new property */ if (NULL == (prop = H5FL_MALLOC(H5P_genprop_t))) @@ -1339,9 +1339,9 @@ H5P__add_prop(H5SL_t *slist, H5P_genprop_t *prop) FUNC_ENTER_PACKAGE - HDassert(slist); - HDassert(prop); - HDassert(prop->type != H5P_PROP_WITHIN_UNKNOWN); + assert(slist); + assert(prop); + assert(prop->type != H5P_PROP_WITHIN_UNKNOWN); /* Insert property into skip list */ if (H5SL_insert(slist, prop, prop->name) < 0) @@ -1376,8 +1376,8 @@ H5P__find_prop_plist(const H5P_genplist_t *plist, const char *name) FUNC_ENTER_PACKAGE - HDassert(plist); - HDassert(name); + assert(plist); + assert(name); /* Check if the property has been deleted from list */ if (H5SL_search(plist->del, name) != NULL) { @@ -1435,8 +1435,8 @@ H5P__find_prop_pclass(H5P_genclass_t *pclass, const char *name) FUNC_ENTER_PACKAGE - HDassert(pclass); - HDassert(name); + assert(pclass); + assert(name); /* Get the property from the skip list */ if (NULL == (ret_value = (H5P_genprop_t *)H5SL_search(pclass->props, name))) @@ -1469,7 +1469,7 @@ H5P__free_prop(H5P_genprop_t *prop) { FUNC_ENTER_PACKAGE_NOERR - HDassert(prop); + assert(prop); /* Release the property value if it exists */ if (prop->value) @@ -1512,7 +1512,7 @@ H5P__free_prop_cb(void *item, void H5_ATTR_UNUSED *key, void *op_data) FUNC_ENTER_PACKAGE_NOERR - HDassert(tprop); + assert(tprop); /* Call the close callback and ignore the return value, there's nothing we can do about it */ if (make_cb && tprop->close != NULL) @@ -1550,7 +1550,7 @@ H5P__free_del_name_cb(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED FUNC_ENTER_PACKAGE_NOERR - HDassert(del_name); + assert(del_name); /* Free the name */ H5MM_xfree(del_name); @@ -1585,8 +1585,8 @@ H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) { FUNC_ENTER_PACKAGE_NOERR - HDassert(pclass); - HDassert(mod > H5P_MOD_ERR && mod < H5P_MOD_MAX); + assert(pclass); + assert(mod > H5P_MOD_ERR && mod < H5P_MOD_MAX); switch (mod) { case H5P_MOD_INC_CLS: /* Increment the dependent class count*/ @@ -1623,14 +1623,14 @@ H5P__access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) case H5P_MOD_ERR: case H5P_MOD_MAX: default: - HDassert(0 && "Invalid H5P class modification"); + assert(0 && "Invalid H5P class modification"); } /* end switch */ /* Check if we can release the class information now */ if (pclass->deleted && pclass->plists == 0 && pclass->classes == 0) { H5P_genclass_t *par_class = pclass->parent; /* Pointer to class's parent */ - HDassert(pclass->name); + assert(pclass->name); H5MM_xfree(pclass->name); /* Free the class properties without making callbacks */ @@ -1680,9 +1680,9 @@ H5P__open_class_path_cb(void *_obj, hid_t H5_ATTR_UNUSED id, void *_key) FUNC_ENTER_PACKAGE_NOERR - HDassert(obj); - HDassert(H5I_GENPROP_CLS == H5I_get_type(id)); - HDassert(key); + assert(obj); + assert(H5I_GENPROP_CLS == H5I_get_type(id)); + assert(key); /* Check if the class object has the same parent as the new class */ if (obj->parent == key->parent) { @@ -1739,11 +1739,11 @@ H5P__create_class(H5P_genclass_t *par_class, const char *name, H5P_plist_type_t FUNC_ENTER_PACKAGE - HDassert(name); + assert(name); /* Allow internal classes to break some rules */ /* (This allows the root of the tree to be created with this routine -QAK) */ if (type == H5P_TYPE_USER) - HDassert(par_class); + assert(par_class); /* Allocate room for the class */ if (NULL == (pclass = H5FL_CALLOC(H5P_genclass_t))) @@ -1835,7 +1835,7 @@ H5P__create(H5P_genclass_t *pclass) FUNC_ENTER_PACKAGE - HDassert(pclass); + assert(pclass); /* * Create new property list object @@ -1974,7 +1974,7 @@ H5P_create_id(H5P_genclass_t *pclass, hbool_t app_ref) FUNC_ENTER_NOAPI(H5I_INVALID_HID) - HDassert(pclass); + assert(pclass); /* Create the new property list */ if ((plist = H5P__create(pclass)) == NULL) @@ -2214,11 +2214,11 @@ H5P__register_real(H5P_genclass_t *pclass, const char *name, size_t size, const FUNC_ENTER_PACKAGE - HDassert(pclass); - HDassert(0 == pclass->plists); - HDassert(0 == pclass->classes); - HDassert(name); - HDassert((size > 0 && def_value != NULL) || (size == 0)); + assert(pclass); + assert(0 == pclass->plists); + assert(0 == pclass->classes); + assert(name); + assert((size > 0 && def_value != NULL) || (size == 0)); /* Check for duplicate named properties */ if (NULL != H5SL_search(pclass->props, name)) @@ -2445,8 +2445,8 @@ H5P__register(H5P_genclass_t **ppclass, const char *name, size_t size, const voi FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(ppclass); - HDassert(pclass); + assert(ppclass); + assert(pclass); /* Check if class needs to be split because property lists or classes have * been created since the last modification was made to the class. @@ -2684,9 +2684,9 @@ H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, void *value, H5 FUNC_ENTER_NOAPI_NOINIT - HDassert(plist); - HDassert(name); - HDassert((size > 0 && value != NULL) || (size == 0)); + assert(plist); + assert(name); + assert((size > 0 && value != NULL) || (size == 0)); /* Check for duplicate named properties */ if (NULL != H5SL_search(plist->props, name)) @@ -2777,10 +2777,10 @@ H5P__do_prop(H5P_genplist_t *plist, const char *name, H5P_do_plist_op_t plist_op FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(plist_op); - HDassert(pclass_op); + assert(plist); + assert(name); + assert(plist_op); + assert(pclass_op); /* Check if the property has been deleted */ if (NULL != H5SL_search(plist->del, name)) @@ -2857,9 +2857,9 @@ H5P__poke_plist_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_AT FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(prop); + assert(plist); + assert(name); + assert(prop); /* Check for property size >0 */ if (0 == prop->size) @@ -2904,10 +2904,10 @@ H5P__poke_pclass_cb(H5P_genplist_t *plist, const char H5_ATTR_NDEBUG_UNUSED *nam FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(prop); - HDassert(prop->cmp); + assert(plist); + assert(name); + assert(prop); + assert(prop->cmp); /* Check for property size >0 */ if (0 == prop->size) @@ -2965,9 +2965,9 @@ H5P_poke(H5P_genplist_t *plist, const char *name, const void *value) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(value); + assert(plist); + assert(name); + assert(value); /* Find the property and set the value */ udata.value = value; @@ -3010,9 +3010,9 @@ H5P__set_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(prop); + assert(plist); + assert(name); + assert(prop); /* Check for property size >0 */ if (0 == prop->size) @@ -3087,10 +3087,10 @@ H5P__set_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(prop); - HDassert(prop->cmp); + assert(plist); + assert(name); + assert(prop); + assert(prop->cmp); /* Check for property size >0 */ if (0 == prop->size) @@ -3177,9 +3177,9 @@ H5P_set(H5P_genplist_t *plist, const char *name, const void *value) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(value); + assert(plist); + assert(name); + assert(value); /* Find the property and set the value */ udata.value = value; @@ -3224,9 +3224,9 @@ H5P__class_get(const H5P_genclass_t *pclass, const char *name, void *value) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(pclass); - HDassert(name); - HDassert(value); + assert(pclass); + assert(name); + assert(value); /* Find property in list */ if (NULL == (prop = (H5P_genprop_t *)H5SL_search(pclass->props, name))) @@ -3279,9 +3279,9 @@ H5P__class_set(const H5P_genclass_t *pclass, const char *name, const void *value FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(pclass); - HDassert(name); - HDassert(value); + assert(pclass); + assert(name); + assert(value); /* Find property in list */ if (NULL == (prop = (H5P_genprop_t *)H5SL_search(pclass->props, name))) @@ -3326,8 +3326,8 @@ H5P_exist_plist(const H5P_genplist_t *plist, const char *name) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(plist); - HDassert(name); + assert(plist); + assert(name); /* Check for property in deleted property list */ if (H5SL_search(plist->del, name) != NULL) @@ -3385,8 +3385,8 @@ H5P__exist_pclass(H5P_genclass_t *pclass, const char *name) FUNC_ENTER_PACKAGE_NOERR - HDassert(pclass); - HDassert(name); + assert(pclass); + assert(name); /* Check for property in property list */ if (H5SL_search(pclass->props, name) != NULL) @@ -3441,9 +3441,9 @@ H5P__get_size_plist(const H5P_genplist_t *plist, const char *name, size_t *size) FUNC_ENTER_PACKAGE - HDassert(plist); - HDassert(name); - HDassert(size); + assert(plist); + assert(name); + assert(size); /* Find property */ if (NULL == (prop = H5P__find_prop_plist(plist, name))) @@ -3486,9 +3486,9 @@ H5P__get_size_pclass(H5P_genclass_t *pclass, const char *name, size_t *size) FUNC_ENTER_PACKAGE - HDassert(pclass); - HDassert(name); - HDassert(size); + assert(pclass); + assert(name); + assert(size); /* Find property */ if ((prop = H5P__find_prop_pclass(pclass, name)) == NULL) @@ -3526,8 +3526,8 @@ H5P__get_nprops_plist(const H5P_genplist_t *plist, size_t *nprops) { FUNC_ENTER_PACKAGE_NOERR - HDassert(plist); - HDassert(nprops); + assert(plist); + assert(nprops); /* Get property size */ *nprops = plist->nprops; @@ -3563,8 +3563,8 @@ H5P_get_nprops_pclass(const H5P_genclass_t *pclass, size_t *nprops, hbool_t recu FUNC_ENTER_NOAPI_NOERR - HDassert(pclass); - HDassert(nprops); + assert(pclass); + assert(nprops); /* Get number of properties */ *nprops = pclass->nprops; @@ -3609,8 +3609,8 @@ H5P__cmp_prop(const H5P_genprop_t *prop1, const H5P_genprop_t *prop2) FUNC_ENTER_PACKAGE_NOERR - HDassert(prop1); - HDassert(prop2); + assert(prop1); + assert(prop2); /* Check the name */ if ((cmp_value = HDstrcmp(prop1->name, prop2->name)) != 0) @@ -3740,8 +3740,8 @@ H5P__cmp_class(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) FUNC_ENTER_PACKAGE_NOERR - HDassert(pclass1); - HDassert(pclass2); + assert(pclass1); + assert(pclass2); /* Use the revision number to quickly check for identical classes */ if (pclass1->revision == pclass2->revision) @@ -3871,8 +3871,8 @@ H5P__cmp_plist_cb(H5P_genprop_t *prop, void *_udata) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(prop); - HDassert(udata); + assert(prop); + assert(udata); /* Check if the property exists in the second property list */ if ((prop2_exist = H5P_exist_plist(udata->plist2, prop->name)) < 0) @@ -3931,9 +3931,9 @@ H5P__cmp_plist(const H5P_genplist_t *plist1, const H5P_genplist_t *plist2, int * FUNC_ENTER_PACKAGE - HDassert(plist1); - HDassert(plist2); - HDassert(cmp_ret); + assert(plist1); + assert(plist2); + assert(cmp_ret); /* Check the number of properties */ if (plist1->nprops < plist2->nprops) { @@ -4008,8 +4008,8 @@ H5P_class_isa(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2) FUNC_ENTER_NOAPI_NOERR - HDassert(pclass1); - HDassert(pclass2); + assert(pclass1); + assert(pclass2); /* Compare property classes */ if (H5P__cmp_class(pclass1, pclass2) == 0) { @@ -4153,8 +4153,8 @@ H5P__iterate_plist_cb(void *_item, void *_key, void *_udata) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(item); - HDassert(key); + assert(item); + assert(key); /* Check if we've found the correctly indexed property */ if (*udata->curr_idx_ptr >= udata->prev_idx) { @@ -4206,8 +4206,8 @@ H5P__iterate_plist_pclass_cb(void *_item, void *_key, void *_udata) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(item); - HDassert(key); + assert(item); + assert(key); /* Only call iterator callback for properties we haven't seen * before and that haven't been deleted. @@ -4285,9 +4285,9 @@ H5P__iterate_plist(const H5P_genplist_t *plist, hbool_t iter_all_prop, int *idx, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(idx); - HDassert(cb_func); + assert(plist); + assert(idx); + assert(cb_func); /* Create the skip list to hold names of properties already seen */ if (NULL == (seen = H5SL_create(H5SL_TYPE_STR, NULL))) @@ -4364,8 +4364,8 @@ H5P__iterate_pclass_cb(void *_item, void H5_ATTR_NDEBUG_UNUSED *_key, void *_uda FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(item); - HDassert((char *)_key); + assert(item); + assert((char *)_key); /* Check if we've found the correctly indexed property */ if (*udata->curr_idx_ptr >= udata->prev_idx) { @@ -4443,9 +4443,9 @@ H5P__iterate_pclass(const H5P_genclass_t *pclass, int *idx, H5P_iterate_int_t cb FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(pclass); - HDassert(idx); - HDassert(cb_func); + assert(pclass); + assert(idx); + assert(cb_func); /* Set up iterator callback info */ udata_int.cb_func = cb_func; @@ -4497,9 +4497,9 @@ H5P__peek_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDE FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(prop); + assert(plist); + assert(name); + assert(prop); /* Check for property size >0 */ if (0 == prop->size) @@ -4545,9 +4545,9 @@ H5P_peek(H5P_genplist_t *plist, const char *name, void *value) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(value); + assert(plist); + assert(name); + assert(value); /* Find the property and peek at the value */ udata.value = value; @@ -4590,9 +4590,9 @@ H5P__get_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, void * FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(prop); + assert(plist); + assert(name); + assert(prop); /* Check for property size >0 */ if (0 == prop->size) @@ -4661,9 +4661,9 @@ H5P_get(H5P_genplist_t *plist, const char *name, void *value) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(value); + assert(plist); + assert(name); + assert(value); /* Find the property and get the value */ udata.value = value; @@ -4704,9 +4704,9 @@ H5P__del_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(prop); + assert(plist); + assert(name); + assert(prop); /* Pass value to 'close' callback, if it exists */ if (NULL != prop->del) { @@ -4773,9 +4773,9 @@ H5P__del_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(plist); - HDassert(name); - HDassert(prop); + assert(plist); + assert(name); + assert(prop); /* Pass value to 'del' callback, if it exists */ if (NULL != prop->del) { @@ -4848,8 +4848,8 @@ H5P_remove(H5P_genplist_t *plist, const char *name) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(plist); - HDassert(name); + assert(plist); + assert(name); /* Find the property and get the value */ if (H5P__do_prop(plist, name, H5P__del_plist_cb, H5P__del_pclass_cb, NULL) < 0) @@ -4901,7 +4901,7 @@ H5P__copy_prop_plist(hid_t dst_id, hid_t src_id, const char *name) FUNC_ENTER_PACKAGE - HDassert(name); + assert(name); /* Get the objects to operate on */ if (NULL == (src_plist = (H5P_genplist_t *)H5I_object(src_id)) || @@ -5012,7 +5012,7 @@ H5P__copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(name); + assert(name); /* Get property list classes */ if (NULL == (src_pclass = (H5P_genclass_t *)H5I_object(src_id))) @@ -5044,7 +5044,7 @@ H5P__copy_prop_pclass(hid_t dst_id, hid_t src_id, const char *name) /* Substitute the new destination property class in the ID */ if (NULL == (old_dst_pclass = (H5P_genclass_t *)H5I_subst(dst_id, dst_pclass))) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to substitute property class in ID") - HDassert(old_dst_pclass == orig_dst_pclass); + assert(old_dst_pclass == orig_dst_pclass); /* Close the previous class */ if (H5P__close_class(old_dst_pclass) < 0) @@ -5087,8 +5087,8 @@ H5P__unregister(H5P_genclass_t *pclass, const char *name) FUNC_ENTER_PACKAGE - HDassert(pclass); - HDassert(name); + assert(pclass); + assert(name); /* Get the property node from the skip list */ if ((prop = (H5P_genprop_t *)H5SL_search(pclass->props, name)) == NULL) @@ -5150,7 +5150,7 @@ H5P_close(H5P_genplist_t *plist) FUNC_ENTER_NOAPI_NOINIT - HDassert(plist); + assert(plist); /* Make call to property list class close callback, if needed * (up through chain of parent classes also) @@ -5310,7 +5310,7 @@ H5P_get_class_name(H5P_genclass_t *pclass) FUNC_ENTER_NOAPI_NOERR - HDassert(pclass); + assert(pclass); /* Get class name */ ret_value = H5MM_xstrdup(pclass->name); @@ -5346,7 +5346,7 @@ H5P__get_class_path(H5P_genclass_t *pclass) FUNC_ENTER_PACKAGE - HDassert(pclass); + assert(pclass); /* Recursively build the full path */ if (pclass->parent != NULL) { @@ -5412,11 +5412,11 @@ H5P__open_class_path(const char *path) FUNC_ENTER_PACKAGE - HDassert(path); + assert(path); /* Duplicate the path to use */ tmp_path = H5MM_xstrdup(path); - HDassert(tmp_path); + assert(tmp_path); /* Find the generic property class with this full path */ curr_name = tmp_path; @@ -5491,7 +5491,7 @@ H5P__get_class_parent(const H5P_genclass_t *pclass) FUNC_ENTER_PACKAGE_NOERR - HDassert(pclass); + assert(pclass); /* Get property size */ ret_value = pclass->parent; @@ -5523,7 +5523,7 @@ H5P__close_class(H5P_genclass_t *pclass) FUNC_ENTER_NOAPI_NOINIT - HDassert(pclass); + assert(pclass); /* Decrement the reference count & check if the object should go away */ if (H5P__access_class(pclass, H5P_MOD_DEC_REF) < 0) @@ -5557,7 +5557,7 @@ H5P__new_plist_of_type(H5P_plist_type_t type) /* Sanity checks */ HDcompile_assert(H5P_TYPE_REFERENCE_ACCESS == (H5P_TYPE_MAX_TYPE - 1)); - HDassert(type >= H5P_TYPE_USER && type <= H5P_TYPE_REFERENCE_ACCESS); + assert(type >= H5P_TYPE_USER && type <= H5P_TYPE_REFERENCE_ACCESS); /* Check arguments */ if (type == H5P_TYPE_USER) @@ -5693,7 +5693,7 @@ H5P_get_plist_id(const H5P_genplist_t *plist) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(plist); + assert(plist); FUNC_LEAVE_NOAPI(plist->plist_id) } /* end H5P_get_plist_id() */ @@ -5720,7 +5720,7 @@ H5P_get_class(const H5P_genplist_t *plist) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(plist); + assert(plist); FUNC_LEAVE_NOAPI(plist->pclass) } /* end H5P_get_class() */ diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 18ebffd..8357a79 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -258,7 +258,7 @@ H5P__lacc_elink_fapl_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Get the FAPL ID */ l_fapl_id = *(const hid_t *)value; @@ -300,7 +300,7 @@ H5P__lacc_elink_fapl_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Get the FAPL ID */ l_fapl_id = *(const hid_t *)value; @@ -371,7 +371,7 @@ H5P__lacc_elink_fapl_enc(const void *value, void **_pp, size_t *size) /* encode the length of the plist */ enc_value = (uint64_t)fapl_size; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -416,9 +416,9 @@ H5P__lacc_elink_fapl_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(pp); - HDassert(*pp); - HDassert(elink_fapl); + assert(pp); + assert(*pp); + assert(elink_fapl); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); /* Determine if the FAPL is non-default */ @@ -431,7 +431,7 @@ H5P__lacc_elink_fapl_dec(const void **_pp, void *_value) /* Decode the plist length */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); fapl_size = (size_t)enc_value; @@ -471,7 +471,7 @@ H5P__lacc_elink_fapl_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Get the FAPL ID */ l_fapl_id = (*(const hid_t *)value); @@ -506,7 +506,7 @@ H5P__lacc_elink_fapl_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Get the FAPL ID */ l_fapl_id = (*(const hid_t *)value); @@ -568,7 +568,7 @@ H5P__lacc_elink_fapl_cmp(const void *value1, const void *value2, size_t H5_ATTR_ herr_t H5_ATTR_NDEBUG_UNUSED status; status = H5P__cmp_plist(obj1, obj2, &ret_value); - HDassert(status >= 0); + assert(status >= 0); } /* end if */ done: @@ -597,7 +597,7 @@ H5P__lacc_elink_fapl_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSE FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Get the FAPL ID */ l_fapl_id = (*(const hid_t *)value); @@ -630,7 +630,7 @@ H5P__lacc_elink_pref_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(value); + assert(value); /* Copy the prefix */ *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -658,7 +658,7 @@ H5P__lacc_elink_pref_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(value); + assert(value); /* Copy the prefix */ *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -700,7 +700,7 @@ H5P__lacc_elink_pref_enc(const void *value, void **_pp, size_t *size) enc_value = (uint64_t)len; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); if (NULL != *pp) { /* encode the length of the prefix */ @@ -748,14 +748,14 @@ H5P__lacc_elink_pref_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE - HDassert(pp); - HDassert(*pp); - HDassert(elink_pref); + assert(pp); + assert(*pp); + assert(elink_pref); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); /* Decode the size */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); /* Decode the value */ UINT64DECODE_VAR(*pp, enc_value, enc_size); @@ -795,7 +795,7 @@ H5P__lacc_elink_pref_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); H5MM_xfree(*(void **)value); @@ -819,7 +819,7 @@ H5P__lacc_elink_pref_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); *(char **)value = H5MM_xstrdup(*(const char **)value); @@ -877,7 +877,7 @@ H5P__lacc_elink_pref_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSE { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); H5MM_xfree(*(void **)value); diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index a9968b0..4e8392c 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -1211,7 +1211,7 @@ H5P__get_filter(const H5Z_filter_info_t *filter, unsigned int *flags /*out*/, si FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(filter); + assert(filter); /* Filter flags */ if (flags) @@ -1289,7 +1289,7 @@ H5P__ocrt_pipeline_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED * FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of I/O pipeline */ if (NULL == H5O_msg_copy(H5O_PLINE_ID, pline, &new_pline)) @@ -1326,7 +1326,7 @@ H5P__ocrt_pipeline_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED * FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of I/O pipeline */ if (NULL == H5O_msg_copy(H5O_PLINE_ID, pline, &new_pline)) @@ -1363,8 +1363,8 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR - HDassert(pline); - HDassert(size); + assert(pline); + assert(size); HDcompile_assert(sizeof(size_t) <= sizeof(uint64_t)); if (NULL != *pp) { @@ -1377,7 +1377,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode nused value */ enc_value = (uint64_t)pline->nused; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1407,7 +1407,7 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size) /* encode cd_nelmts */ enc_value = (uint64_t)pline->filter[u].cd_nelmts; enc_size = H5VM_limit_enc_size(enc_value); - HDassert(enc_size < 256); + assert(enc_size < 256); *(*pp)++ = (uint8_t)enc_size; UINT64ENCODE_VAR(*pp, enc_value, enc_size); @@ -1468,7 +1468,7 @@ H5P__ocrt_pipeline_dec(const void **_pp, void *_value) /* decode nused */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); nused = (size_t)enc_value; @@ -1499,7 +1499,7 @@ H5P__ocrt_pipeline_dec(const void **_pp, void *_value) /* decode num elements */ enc_size = *(*pp)++; - HDassert(enc_size < 256); + assert(enc_size < 256); UINT64DECODE_VAR(*pp, enc_value, enc_size); filter.cd_nelmts = (size_t)enc_value; @@ -1548,7 +1548,7 @@ H5P__ocrt_pipeline_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATTR_UNUSED * FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Reset the old I/O pipeline */ if (H5O_msg_reset(H5O_PLINE_ID, value) < 0) @@ -1581,7 +1581,7 @@ H5P__ocrt_pipeline_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED s FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(pline); + assert(pline); /* Make copy of I/O pipeline */ if (NULL == H5O_msg_copy(H5O_PLINE_ID, pline, &new_pline)) @@ -1620,9 +1620,9 @@ H5P__ocrt_pipeline_cmp(const void *_pline1, const void *_pline2, size_t H5_ATTR_ FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(pline1); - HDassert(pline2); - HDassert(size == sizeof(H5O_pline_t)); + assert(pline1); + assert(pline2); + assert(size == sizeof(H5O_pline_t)); /* Check the number of used pipeline entries */ if (pline1->nused < pline2->nused) @@ -1712,7 +1712,7 @@ H5P__ocrt_pipeline_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Reset the old I/O pipeline */ if (H5O_msg_reset(H5O_PLINE_ID, value) < 0) diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index b61bcf9..d11f728 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -238,7 +238,7 @@ H5P__copy_merge_comm_dt_list(H5O_copy_dtype_merge_list_t **value) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of merge committed dtype list */ src_dt_list = *value; @@ -301,7 +301,7 @@ H5P__ocpy_merge_comm_dt_list_set(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATT FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of merge committed dtype list */ if (H5P__copy_merge_comm_dt_list((H5O_copy_dtype_merge_list_t **)value) < 0) @@ -333,7 +333,7 @@ H5P__ocpy_merge_comm_dt_list_get(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATT FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of merge committed dtype list */ if (H5P__copy_merge_comm_dt_list((H5O_copy_dtype_merge_list_t **)value) < 0) @@ -368,8 +368,8 @@ H5P__ocpy_merge_comm_dt_list_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR - HDassert(dt_list_ptr); - HDassert(size); + assert(dt_list_ptr); + assert(size); /* Iterate over merge committed dtype list */ dt_list = *dt_list_ptr; @@ -429,9 +429,9 @@ H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(pp); - HDassert(*pp); - HDassert(dt_list); + assert(pp); + assert(*pp); + assert(dt_list); /* Start off with NULL (default value) */ *dt_list = NULL; @@ -445,7 +445,7 @@ H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value) if (NULL == (tmp_dt_list->path = H5MM_strdup(*(const char **)pp))) HGOTO_ERROR(H5E_PLIST, H5E_CANTALLOC, FAIL, "memory allocation failed") *pp += len + 1; - HDassert(len == HDstrlen(tmp_dt_list->path)); + assert(len == HDstrlen(tmp_dt_list->path)); /* Add copied node to dtype list */ if (dt_list_tail) { @@ -497,7 +497,7 @@ H5P__ocpy_merge_comm_dt_list_del(hid_t H5_ATTR_UNUSED prop_id, const char H5_ATT FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(value); + assert(value); /* Free the merge named dtype list */ H5P__free_merge_comm_dtype_list(*(H5O_copy_dtype_merge_list_t **)value); @@ -526,7 +526,7 @@ H5P__ocpy_merge_comm_dt_list_copy(const char H5_ATTR_UNUSED *name, size_t H5_ATT FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(value); + assert(value); /* Make copy of merge committed dtype list */ if (H5P__copy_merge_comm_dt_list((H5O_copy_dtype_merge_list_t **)value) < 0) @@ -563,15 +563,15 @@ H5P__ocpy_merge_comm_dt_list_cmp(const void *_dt_list1, const void *_dt_list2, s FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(_dt_list1); - HDassert(_dt_list2); - HDassert(size == sizeof(H5O_copy_dtype_merge_list_t *)); + assert(_dt_list1); + assert(_dt_list2); + assert(size == sizeof(H5O_copy_dtype_merge_list_t *)); /* Walk through the lists, comparing each path. For the lists to be the * same, the paths must be in the same order. */ while (dt_list1 && dt_list2) { - HDassert(dt_list1->path); - HDassert(dt_list2->path); + assert(dt_list1->path); + assert(dt_list2->path); /* Compare paths */ ret_value = HDstrcmp(dt_list1->path, dt_list2->path); @@ -611,7 +611,7 @@ H5P__ocpy_merge_comm_dt_list_close(const char H5_ATTR_UNUSED *name, size_t H5_AT { FUNC_ENTER_PACKAGE_NOERR - HDassert(value); + assert(value); /* Free the merge named dtype list */ H5P__free_merge_comm_dtype_list(*(H5O_copy_dtype_merge_list_t **)value); diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index e27de8c..d7fabff 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -222,8 +222,8 @@ H5P__strcrt_char_encoding_enc(const void *value, void **_pp, size_t *size) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(encoding); - HDassert(size); + assert(encoding); + assert(size); if (NULL != *pp) /* Encode character set encoding */ @@ -259,9 +259,9 @@ H5P__strcrt_char_encoding_dec(const void **_pp, void *_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pp); - HDassert(*pp); - HDassert(encoding); + assert(pp); + assert(*pp); + assert(encoding); /* Decode character set encoding */ *encoding = (H5T_cset_t) * (*pp)++; diff --git a/src/H5RS.c b/src/H5RS.c index 172f1a5..18cf068 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -110,7 +110,7 @@ H5RS__xstrdup(H5RS_str_t *rs, const char *s) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(rs); + assert(rs); if (s) { size_t len = HDstrlen(s); @@ -138,9 +138,9 @@ H5RS__xstrdup(H5RS_str_t *rs, const char *s) } /* end if */ else { /* Sanity checks */ - HDassert(NULL == rs->end); - HDassert(0 == rs->max); - HDassert(0 == rs->len); + assert(NULL == rs->end); + assert(0 == rs->max); + assert(0 == rs->len); } /* end else */ } /* end else */ @@ -174,7 +174,7 @@ H5RS__prepare_for_append(H5RS_str_t *rs) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(rs); + assert(rs); if (NULL == rs->s) { rs->max = H5RS_ALLOC_SIZE; @@ -226,7 +226,7 @@ H5RS__resize_for_append(H5RS_str_t *rs, size_t len) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(rs); + assert(rs); /* Check if buffer should be re-allocated */ if (len >= (rs->max - rs->len)) { @@ -365,8 +365,8 @@ H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(rs); - HDassert(fmt); + assert(rs); + assert(fmt); /* Prepare the [possibly wrapped or empty] ref-counted string for an append */ if (H5RS__prepare_for_append(rs) < 0) @@ -419,8 +419,8 @@ H5RS_acat(H5RS_str_t *rs, const char *s) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(rs); - HDassert(s); + assert(rs); + assert(s); /* Concatenate the provided string on to the managed string */ if (*s) { @@ -468,8 +468,8 @@ H5RS_ancat(H5RS_str_t *rs, const char *s, size_t n) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(rs); - HDassert(s); + assert(rs); + assert(s); /* Concatenate the provided string on to the managed string */ if (n && *s) { @@ -519,8 +519,8 @@ H5RS_aputc(H5RS_str_t *rs, int c) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(rs); - HDassert(c); + assert(rs); + assert(c); /* Allocate the underlying string, if necessary */ if (H5RS__prepare_for_append(rs) < 0) @@ -565,8 +565,8 @@ H5RS_decr(H5RS_str_t *rs) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs); - HDassert(rs->n > 0); + assert(rs); + assert(rs->n > 0); /* Decrement reference count for string */ if ((--rs->n) == 0) { @@ -604,8 +604,8 @@ H5RS_incr(H5RS_str_t *rs) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(rs); - HDassert(rs->n > 0); + assert(rs); + assert(rs->n > 0); /* If the ref-counted string started life as a wrapper around an existing * string, duplicate the string now, so that the wrapped string can go out @@ -684,10 +684,10 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs1); - HDassert(rs1->s); - HDassert(rs2); - HDassert(rs2->s); + assert(rs1); + assert(rs1->s); + assert(rs2); + assert(rs2->s); FUNC_LEAVE_NOAPI(HDstrcmp(rs1->s, rs2->s)) } /* end H5RS_cmp() */ @@ -716,8 +716,8 @@ H5RS_len(const H5RS_str_t *rs) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs); - HDassert(rs->s); + assert(rs); + assert(rs->s); FUNC_LEAVE_NOAPI(HDstrlen(rs->s)) } /* end H5RS_len() */ @@ -749,8 +749,8 @@ H5RS_get_str(const H5RS_str_t *rs) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs); - HDassert(rs->s); + assert(rs); + assert(rs->s); FUNC_LEAVE_NOAPI(rs->s) } /* end H5RS_get_str() */ @@ -780,8 +780,8 @@ H5RS_get_count(const H5RS_str_t *rs) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs); - HDassert(rs->n > 0); + assert(rs); + assert(rs->n > 0); FUNC_LEAVE_NOAPI(rs->n) } /* end H5RS_get_count() */ diff --git a/src/H5Rdeprec.c b/src/H5Rdeprec.c index 56879c4..733fa49 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -108,7 +108,7 @@ H5R__decode_token_compat(H5VL_object_t *vol_obj, H5I_type_t type, H5R_type_t ref HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -174,11 +174,11 @@ H5R__encode_token_region_compat(H5F_t *f, const H5O_token_t *obj_token, size_t t FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(obj_token); - HDassert(token_size); - HDassert(space); - HDassert(nalloc); + assert(f); + assert(obj_token); + assert(token_size); + assert(space); + assert(nalloc); /* Get required buffer size */ if (H5R__encode_heap(f, NULL, &buf_size, NULL, (size_t)0) < 0) @@ -413,7 +413,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -664,7 +664,7 @@ H5Rget_region(hid_t id, H5R_type_t ref_type, const void *ref) "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ diff --git a/src/H5Rint.c b/src/H5Rint.c index ae24ccd..db9ce26 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -187,7 +187,7 @@ H5R__create_object(const H5O_token_t *obj_token, size_t token_size, H5R_ref_priv FUNC_ENTER_PACKAGE - HDassert(ref); + assert(ref); /* Create new reference */ ref->info.obj.filename = NULL; @@ -226,8 +226,8 @@ H5R__create_region(const H5O_token_t *obj_token, size_t token_size, H5S_t *space FUNC_ENTER_PACKAGE - HDassert(space); - HDassert(ref); + assert(space); + assert(ref); /* Create new reference */ ref->info.obj.filename = NULL; @@ -275,8 +275,8 @@ H5R__create_attr(const H5O_token_t *obj_token, size_t token_size, const char *at FUNC_ENTER_PACKAGE - HDassert(attr_name); - HDassert(ref); + assert(attr_name); + assert(ref); /* Make sure that attribute name is not longer than supported encode size */ if (HDstrlen(attr_name) > H5R_MAX_STRING_LEN) @@ -327,7 +327,7 @@ H5R__destroy(H5R_ref_priv_t *ref) FUNC_ENTER_PACKAGE - HDassert(ref != NULL); + assert(ref != NULL); H5R_LOG_DEBUG("Destroying reference, filename=%s, obj_addr=%s, encode size=%u", ref->info.obj.filename, H5R__print_token(ref->info.obj.token), ref->encode_size); @@ -355,11 +355,11 @@ H5R__destroy(H5R_ref_priv_t *ref) break; case H5R_BADTYPE: case H5R_MAXTYPE: - HDassert("invalid reference type" && 0); + assert("invalid reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") default: - HDassert("unknown reference type" && 0); + assert("unknown reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") } /* end switch */ @@ -395,8 +395,8 @@ H5R__set_loc_id(H5R_ref_priv_t *ref, hid_t id, hbool_t inc_ref, hbool_t app_ref) FUNC_ENTER_PACKAGE - HDassert(ref != NULL); - HDassert(id != H5I_INVALID_HID); + assert(ref != NULL); + assert(id != H5I_INVALID_HID); /* If a location ID was previously assigned, decrement refcount and * assign new one */ @@ -440,7 +440,7 @@ H5R__get_loc_id(const H5R_ref_priv_t *ref) FUNC_ENTER_PACKAGE_NOERR - HDassert(ref != NULL); + assert(ref != NULL); ret_value = ref->loc_id; @@ -543,7 +543,7 @@ H5R__get_type(const H5R_ref_priv_t *ref) FUNC_ENTER_PACKAGE_NOERR - HDassert(ref != NULL); + assert(ref != NULL); ret_value = (H5R_type_t)ref->type; FUNC_LEAVE_NOAPI(ret_value) @@ -565,8 +565,8 @@ H5R__equal(const H5R_ref_priv_t *ref1, const H5R_ref_priv_t *ref2) FUNC_ENTER_PACKAGE - HDassert(ref1 != NULL); - HDassert(ref2 != NULL); + assert(ref1 != NULL); + assert(ref2 != NULL); /* Compare reference types */ if (ref1->type != ref2->type) @@ -594,7 +594,7 @@ H5R__equal(const H5R_ref_priv_t *ref1, const H5R_ref_priv_t *ref2) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOMPARE, FAIL, "cannot compare dataspace extents") break; case H5R_ATTR: - HDassert(ref1->info.attr.name && ref2->info.attr.name); + assert(ref1->info.attr.name && ref2->info.attr.name); if (0 != HDstrcmp(ref1->info.attr.name, ref2->info.attr.name)) HGOTO_DONE(FALSE); break; @@ -602,10 +602,10 @@ H5R__equal(const H5R_ref_priv_t *ref1, const H5R_ref_priv_t *ref2) case H5R_DATASET_REGION1: case H5R_BADTYPE: case H5R_MAXTYPE: - HDassert("invalid reference type" && 0); + assert("invalid reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") default: - HDassert("unknown reference type" && 0); + assert("unknown reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") } /* end switch */ @@ -629,7 +629,7 @@ H5R__copy(const H5R_ref_priv_t *src_ref, H5R_ref_priv_t *dst_ref) FUNC_ENTER_PACKAGE - HDassert((src_ref != NULL) && (dst_ref != NULL)); + assert((src_ref != NULL) && (dst_ref != NULL)); H5MM_memcpy(&dst_ref->info.obj.token, &src_ref->info.obj.token, sizeof(H5O_token_t)); dst_ref->encode_size = src_ref->encode_size; @@ -649,18 +649,18 @@ H5R__copy(const H5R_ref_priv_t *src_ref, H5R_ref_priv_t *dst_ref) break; case H5R_OBJECT1: case H5R_DATASET_REGION1: - HDassert("invalid reference type" && 0); + assert("invalid reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") case H5R_BADTYPE: case H5R_MAXTYPE: default: - HDassert("unknown reference type" && 0); + assert("unknown reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") } /* end switch */ /* We only need to keep a copy of the filename if we don't have the loc_id */ if (src_ref->loc_id == H5I_INVALID_HID) { - HDassert(src_ref->info.obj.filename); + assert(src_ref->info.obj.filename); if (NULL == (dst_ref->info.obj.filename = HDstrdup(src_ref->info.obj.filename))) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Cannot copy filename") @@ -696,8 +696,8 @@ H5R__get_obj_token(const H5R_ref_priv_t *ref, H5O_token_t *obj_token, size_t *to FUNC_ENTER_PACKAGE - HDassert(ref != NULL); - HDassert(ref->token_size <= H5O_MAX_TOKEN_SIZE); + assert(ref != NULL); + assert(ref->token_size <= H5O_MAX_TOKEN_SIZE); if (obj_token) { if (0 == ref->token_size) @@ -727,13 +727,13 @@ H5R__set_obj_token(H5R_ref_priv_t *ref, const H5O_token_t *obj_token, size_t tok FUNC_ENTER_PACKAGE_NOERR - HDassert(ref != NULL); - HDassert(obj_token); - HDassert(token_size); - HDassert(token_size <= H5O_MAX_TOKEN_SIZE); + assert(ref != NULL); + assert(obj_token); + assert(token_size); + assert(token_size <= H5O_MAX_TOKEN_SIZE); H5MM_memcpy(&ref->info.obj.token, obj_token, token_size); - HDassert(token_size <= 255); + assert(token_size <= 255); ref->token_size = (uint8_t)token_size; FUNC_LEAVE_NOAPI(ret_value) @@ -757,9 +757,9 @@ H5R__get_region(const H5R_ref_priv_t *ref, H5S_t *space) FUNC_ENTER_PACKAGE - HDassert(ref != NULL); - HDassert(ref->type == H5R_DATASET_REGION2); - HDassert(space); + assert(ref != NULL); + assert(ref->type == H5R_DATASET_REGION2); + assert(space); /* Copy reference selection to destination */ if (H5S_select_copy(space, ref->info.reg.space, FALSE) < 0) @@ -788,7 +788,7 @@ H5R__get_file_name(const H5R_ref_priv_t *ref, char *buf, size_t size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(ref != NULL); + assert(ref != NULL); /* Return if that reference has no filename set */ if (!ref->info.obj.filename) @@ -796,7 +796,7 @@ H5R__get_file_name(const H5R_ref_priv_t *ref, char *buf, size_t size) /* Get the file name length */ copy_len = HDstrlen(ref->info.obj.filename); - HDassert(copy_len <= H5R_MAX_STRING_LEN); + assert(copy_len <= H5R_MAX_STRING_LEN); /* Copy the file name */ if (buf) { @@ -828,12 +828,12 @@ H5R__get_attr_name(const H5R_ref_priv_t *ref, char *buf, size_t size) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(ref != NULL); - HDassert(ref->type == H5R_ATTR); + assert(ref != NULL); + assert(ref->type == H5R_ATTR); /* Get the attribute name length */ attr_name_len = HDstrlen(ref->info.attr.name); - HDassert(attr_name_len <= H5R_MAX_STRING_LEN); + assert(attr_name_len <= H5R_MAX_STRING_LEN); /* Get the attribute name */ if (buf) { @@ -866,8 +866,8 @@ H5R__encode(const char *filename, const H5R_ref_priv_t *ref, unsigned char *buf, FUNC_ENTER_PACKAGE - HDassert(ref); - HDassert(nalloc); + assert(ref); + assert(nalloc); /** * Encoding format: @@ -929,11 +929,11 @@ H5R__encode(const char *filename, const H5R_ref_priv_t *ref, unsigned char *buf, case H5R_DATASET_REGION1: case H5R_BADTYPE: case H5R_MAXTYPE: - HDassert("invalid reference type" && 0); + assert("invalid reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") default: - HDassert("unknown reference type" && 0); + assert("unknown reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") } /* end switch */ @@ -966,9 +966,9 @@ H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_priv_t *ref) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(buf); - HDassert(nbytes); - HDassert(ref); + assert(buf); + assert(nbytes); + assert(ref); /* Don't decode if buffer size isn't big enough */ buf_size = *nbytes; @@ -1016,10 +1016,10 @@ H5R__decode(const unsigned char *buf, size_t *nbytes, H5R_ref_priv_t *ref) case H5R_DATASET_REGION1: case H5R_BADTYPE: case H5R_MAXTYPE: - HDassert("invalid reference type" && 0); + assert("invalid reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (invalid reference type)") default: - HDassert("unknown reference type" && 0); + assert("unknown reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") } /* end switch */ @@ -1055,7 +1055,7 @@ H5R__encode_obj_token(const H5O_token_t *obj_token, size_t token_size, unsigned FUNC_ENTER_PACKAGE_NOERR - HDassert(nalloc); + assert(nalloc); /* Don't encode if buffer size isn't big enough or buffer is empty */ if (buf && *nalloc >= token_size) { @@ -1089,10 +1089,10 @@ H5R__decode_obj_token(const unsigned char *buf, size_t *nbytes, H5O_token_t *obj FUNC_ENTER_PACKAGE - HDassert(buf); - HDassert(nbytes); - HDassert(obj_token); - HDassert(token_size); + assert(buf); + assert(nbytes); + assert(obj_token); + assert(token_size); /* Don't decode if buffer size isn't big enough */ if (*nbytes < sizeof(uint8_t)) @@ -1133,8 +1133,8 @@ H5R__encode_region(H5S_t *space, unsigned char *buf, size_t *nalloc) FUNC_ENTER_PACKAGE - HDassert(space); - HDassert(nalloc); + assert(space); + assert(nalloc); /* Get the amount of space required to serialize the selection */ if ((buf_size = H5S_SELECT_SERIAL_SIZE(space)) < 0) @@ -1185,9 +1185,9 @@ H5R__decode_region(const unsigned char *buf, size_t *nbytes, H5S_t **space_ptr) FUNC_ENTER_PACKAGE - HDassert(buf); - HDassert(nbytes); - HDassert(space_ptr); + assert(buf); + assert(nbytes); + assert(space_ptr); /* Don't decode if buffer size isn't big enough */ if (*nbytes < (2 * sizeof(uint32_t))) @@ -1241,8 +1241,8 @@ H5R__encode_string(const char *string, unsigned char *buf, size_t *nalloc) FUNC_ENTER_PACKAGE - HDassert(string); - HDassert(nalloc); + assert(string); + assert(nalloc); /* Get the amount of space required to serialize the string */ string_len = HDstrlen(string); @@ -1284,9 +1284,9 @@ H5R__decode_string(const unsigned char *buf, size_t *nbytes, char **string_ptr) FUNC_ENTER_PACKAGE - HDassert(buf); - HDassert(nbytes); - HDassert(string_ptr); + assert(buf); + assert(nbytes); + assert(string_ptr); /* Don't decode if buffer size isn't big enough */ if (*nbytes < sizeof(uint16_t)) @@ -1294,7 +1294,7 @@ H5R__decode_string(const unsigned char *buf, size_t *nbytes, char **string_ptr) /* Get the string length */ UINT16DECODE(p, string_len); - HDassert(string_len <= H5R_MAX_STRING_LEN); + assert(string_len <= H5R_MAX_STRING_LEN); /* Allocate the string */ if (NULL == (string = (char *)H5MM_malloc(string_len + 1))) @@ -1328,8 +1328,8 @@ H5R__encode_heap(H5F_t *f, unsigned char *buf, size_t *nalloc, const unsigned ch FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(nalloc); + assert(f); + assert(nalloc); buf_size = H5HG_HEAP_ID_SIZE(f); if (buf && *nalloc >= buf_size) { @@ -1370,10 +1370,10 @@ H5R__decode_heap(H5F_t *f, const unsigned char *buf, size_t *nbytes, unsigned ch FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(buf); - HDassert(nbytes); - HDassert(data_ptr); + assert(f); + assert(buf); + assert(nbytes); + assert(data_ptr); buf_size = H5HG_HEAP_ID_SIZE(f); /* Don't decode if buffer size isn't big enough */ @@ -1413,9 +1413,9 @@ H5R__encode_token_obj_compat(const H5O_token_t *obj_token, size_t token_size, un FUNC_ENTER_PACKAGE_NOERR - HDassert(obj_token); - HDassert(token_size); - HDassert(nalloc); + assert(obj_token); + assert(token_size); + assert(nalloc); /* Don't encode if buffer size isn't big enough or buffer is empty */ if (buf && *nalloc >= token_size) @@ -1443,10 +1443,10 @@ H5R__decode_token_obj_compat(const unsigned char *buf, size_t *nbytes, H5O_token FUNC_ENTER_PACKAGE - HDassert(buf); - HDassert(nbytes); - HDassert(obj_token); - HDassert(token_size); + assert(buf); + assert(nbytes); + assert(obj_token); + assert(token_size); /* Don't decode if buffer size isn't big enough */ if (*nbytes < token_size) @@ -1484,10 +1484,10 @@ H5R__decode_token_region_compat(H5F_t *f, const unsigned char *buf, size_t *nbyt FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(buf); - HDassert(nbytes); - HDassert(token_size); + assert(f); + assert(buf); + assert(nbytes); + assert(token_size); /* Read from heap */ if (H5R__decode_heap(f, buf, nbytes, &data, &data_size) < 0) diff --git a/src/H5S.c b/src/H5S.c index c938a71..9561bb8 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -187,8 +187,8 @@ H5S_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity checks */ - HDassert(0 == H5I_nmembers(H5I_DATASPACE)); - HDassert(0 == H5I_nmembers(H5I_SPACE_SEL_ITER)); + assert(0 == H5I_nmembers(H5I_DATASPACE)); + assert(0 == H5I_nmembers(H5I_SPACE_SEL_ITER)); /* Destroy the dataspace object id group */ n += (H5I_dec_type_ref(H5I_DATASPACE) > 0); @@ -220,7 +220,7 @@ H5S__close_cb(void *_space, void H5_ATTR_UNUSED **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(space); + assert(space); /* Close the dataspace object */ if (H5S_close(space) < 0) @@ -281,7 +281,7 @@ H5S_create(H5S_class_t type) case H5S_NO_CLASS: default: - HDassert("unknown dataspace (extent) type" && 0); + assert("unknown dataspace (extent) type" && 0); break; } /* end switch */ @@ -370,7 +370,7 @@ H5S__extent_release(H5S_extent_t *extent) { FUNC_ENTER_PACKAGE_NOERR - HDassert(extent); + assert(extent); /* Release extent */ if (extent->type == H5S_SIMPLE) { @@ -405,7 +405,7 @@ H5S_close(H5S_t *ds) FUNC_ENTER_NOAPI(FAIL) - HDassert(ds); + assert(ds); /* Release selection (this should come before the extent release) */ if (H5S_SELECT_RELEASE(ds) < 0) @@ -557,8 +557,8 @@ H5S_extent_copy(H5S_t *dst, const H5S_t *src) FUNC_ENTER_NOAPI(FAIL) - HDassert(dst); - HDassert(src); + assert(dst); + assert(src); /* Copy extent */ if (H5S__extent_copy_real(&(dst->extent), &(src->extent), TRUE) < 0) @@ -630,7 +630,7 @@ H5S__extent_copy_real(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_m case H5S_NO_CLASS: default: - HDassert("unknown dataspace type" && 0); + assert("unknown dataspace type" && 0); break; } /* end switch */ @@ -717,7 +717,7 @@ H5S_get_simple_extent_npoints(const H5S_t *ds) FUNC_ENTER_NOAPI_NOERR /* check args */ - HDassert(ds); + assert(ds); /* Get the number of elements in extent */ ret_value = (hssize_t)ds->extent.nelem; @@ -784,7 +784,7 @@ H5S_get_npoints_max(const H5S_t *ds) FUNC_ENTER_NOAPI(0) /* check args */ - HDassert(ds); + assert(ds); switch (H5S_GET_EXTENT_TYPE(ds)) { case H5S_NULL: @@ -813,7 +813,7 @@ H5S_get_npoints_max(const H5S_t *ds) case H5S_NO_CLASS: default: - HDassert("unknown dataspace class" && 0); + assert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, 0, "internal error (unknown dataspace class)") } @@ -880,7 +880,7 @@ H5S_get_simple_extent_ndims(const H5S_t *ds) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(ds); + assert(ds); switch (H5S_GET_EXTENT_TYPE(ds)) { case H5S_NULL: @@ -891,7 +891,7 @@ H5S_get_simple_extent_ndims(const H5S_t *ds) case H5S_NO_CLASS: default: - HDassert("unknown dataspace class" && 0); + assert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)") } /* end switch */ @@ -957,7 +957,7 @@ H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[]) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(ext); + assert(ext); switch (ext->type) { case H5S_NULL: @@ -981,7 +981,7 @@ H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t max_dims[]) case H5S_NO_CLASS: default: - HDassert("unknown dataspace class" && 0); + assert("unknown dataspace class" && 0); HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "internal error (unknown dataspace class)") } /* end switch */ @@ -1011,7 +1011,7 @@ H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[], hsize_t max_dims[]) FUNC_ENTER_NOAPI(FAIL) /* check args */ - HDassert(ds); + assert(ds); /* Get dims for extent */ if ((ret_value = H5S_extent_get_dims(&ds->extent, dims, max_dims)) < 0) @@ -1041,10 +1041,10 @@ H5S_write(H5F_t *f, H5O_t *oh, unsigned update_flags, H5S_t *ds) FUNC_ENTER_NOAPI(FAIL) - HDassert(f); - HDassert(oh); - HDassert(ds); - HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0); + assert(f); + assert(oh); + assert(ds); + assert(H5S_GET_EXTENT_TYPE(ds) >= 0); /* Write the current dataspace extent to the dataspace message */ if (H5O_msg_write_oh(f, oh, H5O_SDSPACE_ID, 0, update_flags, &(ds->extent)) < 0) @@ -1073,10 +1073,10 @@ H5S_append(H5F_t *f, H5O_t *oh, H5S_t *ds) FUNC_ENTER_NOAPI(FAIL) - HDassert(f); - HDassert(oh); - HDassert(ds); - HDassert(H5S_GET_EXTENT_TYPE(ds) >= 0); + assert(f); + assert(oh); + assert(ds); + assert(H5S_GET_EXTENT_TYPE(ds) >= 0); /* Add the dataspace message to the object header */ if (H5O_msg_append_oh(f, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0) @@ -1109,7 +1109,7 @@ H5S_read(const H5O_loc_t *loc) FUNC_ENTER_NOAPI(NULL) /* check args */ - HDassert(loc); + assert(loc); if (NULL == (ds = H5FL_CALLOC(H5S_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -1154,7 +1154,7 @@ H5S__is_simple(const H5S_t *sdim) FUNC_ENTER_PACKAGE_NOERR /* Check args and all the boring stuff. */ - HDassert(sdim); + assert(sdim); /* H5S_NULL shouldn't be simple dataspace */ ret_value = @@ -1282,7 +1282,7 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, const hs FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(rank <= H5S_MAX_RANK); + assert(rank <= H5S_MAX_RANK); /* shift out of the previous state to a "simple" dataspace. */ if (H5S__extent_release(&space->extent) < 0) @@ -1423,7 +1423,7 @@ H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], const hsize_t max FUNC_ENTER_NOAPI(NULL) /* Check arguments */ - HDassert(rank <= H5S_MAX_RANK); + assert(rank <= H5S_MAX_RANK); /* Create the space and set the extent */ if (NULL == (ret_value = H5S_create(H5S_SIMPLE))) @@ -1697,7 +1697,7 @@ H5S_get_simple_extent_type(const H5S_t *space) FUNC_ENTER_NOAPI_NOERR - HDassert(space); + assert(space); ret_value = H5S_GET_EXTENT_TYPE(space); @@ -1795,8 +1795,8 @@ H5S_set_extent(H5S_t *space, const hsize_t *size) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); - HDassert(size); + assert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); + assert(size); /* Verify that the dimensions being changed are allowed to change */ for (u = 0; u < space->extent.rank; u++) @@ -1842,7 +1842,7 @@ H5S_has_extent(const H5S_t *ds) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(ds); + assert(ds); if (0 == ds->extent.rank && 0 == ds->extent.nelem && H5S_NULL != ds->extent.type) ret_value = FALSE; @@ -1875,8 +1875,8 @@ H5S_set_extent_real(H5S_t *space, const hsize_t *size) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); - HDassert(size); + assert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); + assert(size); /* Change the dataspace size & re-compute the number of elements in the extent */ for (u = 0, nelem = 1; u < space->extent.rank; u++) { @@ -1957,8 +1957,8 @@ H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(ds1); - HDassert(ds2); + assert(ds1); + assert(ds2); /* Make certain the dataspaces are the same type */ if (ds1->extent.type != ds2->extent.type) @@ -1970,8 +1970,8 @@ H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2) /* Make certain the dataspaces' current dimensions are the same size */ if (ds1->extent.rank > 0) { - HDassert(ds1->extent.size); - HDassert(ds2->extent.size); + assert(ds1->extent.size); + assert(ds2->extent.size); for (u = 0; u < ds1->extent.rank; u++) if (ds1->extent.size[u] != ds2->extent.size[u]) HGOTO_DONE(FALSE) @@ -2013,7 +2013,7 @@ H5S_extent_nelem(const H5S_extent_t *ext) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(ext); + assert(ext); /* Return the number of elements in extent */ FUNC_LEAVE_NOAPI(ext->nelem) @@ -2039,8 +2039,8 @@ H5S_set_version(H5F_t *f, H5S_t *ds) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(ds); + assert(f); + assert(ds); /* Upgrade to the version indicated by the file's low bound if higher */ version = MAX(ds->extent.version, H5O_sdspace_ver_bounds[H5F_LOW_BOUND(f)]); diff --git a/src/H5SL.c b/src/H5SL.c index 11ccb9f..a65a144 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -158,17 +158,17 @@ /* Check if we need to increase allocation of forward pointers */ \ if (LVL + 1 >= ((size_t)1) << X->log_nalloc) { \ H5SL_node_t **_tmp; \ - HDassert(LVL + 1 == ((size_t)1) << X->log_nalloc); \ + assert(LVL + 1 == ((size_t)1) << X->log_nalloc); \ /* Double the amount of allocated space */ \ X->log_nalloc++; \ \ /* Check if we need to create a new factory */ \ if (X->log_nalloc >= H5SL_fac_nused_g) { \ - HDassert(X->log_nalloc == H5SL_fac_nused_g); \ + assert(X->log_nalloc == H5SL_fac_nused_g); \ \ /* Check if we need to allocate space for the factory pointer*/ \ if (H5SL_fac_nused_g >= H5SL_fac_nalloc_g) { \ - HDassert(H5SL_fac_nused_g == H5SL_fac_nalloc_g); \ + assert(H5SL_fac_nused_g == H5SL_fac_nalloc_g); \ /* Double the size of the array of factory pointers */ \ H5SL_fac_nalloc_g *= 2; \ if (NULL == (H5SL_fac_g = (H5FL_fac_head_t **)H5MM_realloc( \ @@ -200,7 +200,7 @@ /* Check if we can reduce the allocation of forward pointers */ \ if (LVL <= ((size_t)1) << (X->log_nalloc - 1)) { \ H5SL_node_t **_tmp; \ - HDassert(LVL == ((size_t)1) << (X->log_nalloc - 1)); \ + assert(LVL == ((size_t)1) << (X->log_nalloc - 1)); \ X->log_nalloc--; \ \ /* Allocate space for new forward pointers */ \ @@ -224,14 +224,14 @@ H5SL_GROW(X, _lvl, ERR); \ \ if (_lvl == (size_t)SLIST->curr_level) { \ - HDassert(PREV == SLIST->header); \ + assert(PREV == SLIST->header); \ /* Grow the head */ \ H5SL_GROW(PREV, _lvl, ERR) \ SLIST->curr_level++; \ X->forward[_lvl + 1] = NULL; \ } \ else { \ - HDassert(_lvl < (size_t)SLIST->curr_level); \ + assert(_lvl < (size_t)SLIST->curr_level); \ X->forward[_lvl + 1] = PREV->forward[_lvl + 1]; \ } \ PREV->forward[_lvl + 1] = X; \ @@ -243,7 +243,7 @@ { \ size_t _lvl = X->level; \ \ - HDassert(PREV->forward[_lvl] == X); \ + assert(PREV->forward[_lvl] == X); \ PREV->forward[_lvl] = X->forward[_lvl]; \ H5SL_SHRINK(X, _lvl); \ } @@ -287,12 +287,12 @@ } \ X = X->forward[_i]; \ } \ - HDassert(!_drop->forward[_i] || \ - !H5_GLUE3(H5SL_LOCATE_, CMP, _CMP)(SLIST, TYPE, _drop->forward[_i], KEY, HASHVAL)); \ + assert(!_drop->forward[_i] || \ + !H5_GLUE3(H5SL_LOCATE_, CMP, _CMP)(SLIST, TYPE, _drop->forward[_i], KEY, HASHVAL)); \ \ /* Promote the middle node if necessary */ \ if (_count == 3) { \ - HDassert(X == _last->forward[_i]->forward[_i]); \ + assert(X == _last->forward[_i]->forward[_i]); \ H5SL_PROMOTE(SLIST, X, _last, NULL) \ } \ \ @@ -351,7 +351,7 @@ /* If we have already found the node to drop into and there */ \ /* is more than one node in this gap, we can stop searching */ \ if (_drop) { \ - HDassert(_count >= 1); \ + assert(_count >= 1); \ _count = 2; \ break; \ } \ @@ -378,9 +378,9 @@ } \ X = X->forward[_i]; \ } \ - HDassert(_count >= 1 && _count <= 3); \ - HDassert(!_drop->forward[_i] || \ - !H5_GLUE3(H5SL_LOCATE_, CMP, _CMP)(SLIST, TYPE, _drop->forward[_i], KEY, HASHVAL)); \ + assert(_count >= 1 && _count <= 3); \ + assert(!_drop->forward[_i] || \ + !H5_GLUE3(H5SL_LOCATE_, CMP, _CMP)(SLIST, TYPE, _drop->forward[_i], KEY, HASHVAL)); \ \ /* Check if we need to adjust node heights */ \ if (_count == 1) { \ @@ -402,8 +402,8 @@ } \ else if (!_head->forward[_i + 1]) { \ /* shrink the header */ \ - HDassert(_i == SLIST->curr_level - 1); \ - HDassert((size_t)SLIST->curr_level == _head->level); \ + assert(_i == SLIST->curr_level - 1); \ + assert((size_t)SLIST->curr_level == _head->level); \ \ H5SL_SHRINK(_head, (size_t)(_i + 1)) \ SLIST->curr_level--; \ @@ -417,7 +417,7 @@ X = _llast->forward[_i]; \ for (_count = 1; _count < 3 && X->forward[_i] != _last; _count++) \ X = X->forward[_i]; \ - HDassert(X->forward[_i] == _last); \ + assert(X->forward[_i] == _last); \ \ /* Demote the separator node */ \ H5SL_DEMOTE(_last, _llast) \ @@ -427,8 +427,8 @@ H5SL_PROMOTE(SLIST, X, _llast, NULL) \ else if (!_head->forward[_i + 1]) { \ /* shrink the header */ \ - HDassert(_i == SLIST->curr_level - 1); \ - HDassert((size_t)SLIST->curr_level == _head->level); \ + assert(_i == SLIST->curr_level - 1); \ + assert((size_t)SLIST->curr_level == _head->level); \ \ H5SL_SHRINK(_head, (size_t)(_i + 1)) \ SLIST->curr_level--; \ @@ -455,7 +455,7 @@ _next->item = X->item; \ _next->hashval = X->hashval; \ } \ - HDassert(!X->level); \ + assert(!X->level); \ \ /* Remove the node */ \ X->backward->forward[0] = X->forward[0]; \ @@ -538,12 +538,12 @@ H5SL_init(void) /* Allocate space for array of factories */ H5SL_fac_g = (H5FL_fac_head_t **)H5MM_malloc(sizeof(H5FL_fac_head_t *)); - HDassert(H5SL_fac_g); + assert(H5SL_fac_g); H5SL_fac_nalloc_g = 1; /* Initialize first factory */ H5SL_fac_g[0] = H5FL_fac_init(sizeof(H5SL_node_t *)); - HDassert(H5SL_fac_g[0]); + assert(H5SL_fac_g[0]); H5SL_fac_nused_g = 1; FUNC_LEAVE_NOAPI(ret_value) @@ -582,7 +582,7 @@ H5SL_term_package(void) for (i = 0; i < H5SL_fac_nused_g; i++) { ret = H5FL_fac_term(H5SL_fac_g[i]); - HDassert(ret >= 0); + assert(ret >= 0); } H5SL_fac_nused_g = 0; @@ -680,8 +680,8 @@ H5SL__insert_common(H5SL_t *slist, void *item, const void *key) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -730,7 +730,7 @@ H5SL__insert_common(H5SL_t *slist, void *item, const void *key) break; default: - HDassert(0 && "Unknown skiplist type!"); + assert(0 && "Unknown skiplist type!"); } /* 'key' must not have been found in existing list, if we get here */ @@ -749,7 +749,7 @@ H5SL__insert_common(H5SL_t *slist, void *item, const void *key) if (x->forward[0]) x->forward[0]->backward = x; else { - HDassert(slist->last == prev); + assert(slist->last == prev); slist->last = x; } @@ -796,7 +796,7 @@ H5SL__release_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -874,7 +874,7 @@ H5SL__close_common(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -922,7 +922,7 @@ H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp) FUNC_ENTER_NOAPI(NULL) /* Check args */ - HDassert(type >= H5SL_TYPE_INT && type <= H5SL_TYPE_GENERIC); + assert(type >= H5SL_TYPE_INT && type <= H5SL_TYPE_GENERIC); /* Allocate skip list structure */ if (NULL == (new_slist = H5FL_MALLOC(H5SL_t))) @@ -930,7 +930,7 @@ H5SL_create(H5SL_type_t type, H5SL_cmp_t cmp) /* Set the static internal fields */ new_slist->type = type; - HDassert((type == H5SL_TYPE_GENERIC) == !!cmp); + assert((type == H5SL_TYPE_GENERIC) == !!cmp); new_slist->cmp = cmp; /* Set the dynamic internal fields */ @@ -988,7 +988,7 @@ H5SL_count(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -1025,8 +1025,8 @@ H5SL_insert(H5SL_t *slist, void *item, const void *key) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1071,8 +1071,8 @@ H5SL_add(H5SL_t *slist, void *item, const void *key) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1114,8 +1114,8 @@ H5SL_remove(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1164,7 +1164,7 @@ H5SL_remove(H5SL_t *slist, const void *key) break; default: - HDassert(0 && "Unknown skiplist type!"); + assert(0 && "Unknown skiplist type!"); } done: @@ -1202,7 +1202,7 @@ H5SL_remove_first(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(slist); + assert(slist); /* Assign level */ H5_CHECK_OVERFLOW(slist->curr_level, int, size_t); @@ -1218,8 +1218,8 @@ H5SL_remove_first(H5SL_t *slist) /* Assign return value */ ret_value = tmp->item; - HDassert(level == head->level); - HDassert(0 == tmp->level); + assert(level == head->level); + assert(0 == tmp->level); /* Remove the first node */ head->forward[0] = tmp->forward[0]; @@ -1235,14 +1235,14 @@ H5SL_remove_first(H5SL_t *slist) /* Reshape the skip list as necessary to maintain 1-2-3 condition */ for (i = 0; i < level; i++) { next = head->forward[i + 1]; - HDassert(next); + assert(next); /* Check if head->forward[i] == head->forward[i+1] (illegal) */ if (head->forward[i] == next) { tmp = next; next = next->forward[i + 1]; - HDassert(tmp->level == i + 1); + assert(tmp->level == i + 1); /* Demote head->forward[i] */ H5SL_DEMOTE(tmp, head) @@ -1250,8 +1250,8 @@ H5SL_remove_first(H5SL_t *slist) /* Check if we need to promote the following node to maintain * 1-2-3 condition */ if (tmp->forward[i]->forward[i] != next) { - HDassert(tmp->forward[i]->forward[i]->forward[i] == next || - tmp->forward[i]->forward[i]->forward[i]->forward[i] == next); + assert(tmp->forward[i]->forward[i]->forward[i] == next || + tmp->forward[i]->forward[i]->forward[i]->forward[i] == next); tmp = tmp->forward[i]; H5SL_PROMOTE(slist, tmp, head, NULL); /* In this case, since there is a node of height = i+1 here @@ -1261,7 +1261,7 @@ H5SL_remove_first(H5SL_t *slist) } else if (!head->forward[i + 1]) { /* We just shrunk the largest node, shrink the header */ - HDassert(i == level - 1); + assert(i == level - 1); H5SL_SHRINK(head, level) slist->curr_level--; @@ -1305,8 +1305,8 @@ H5SL_search(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1355,7 +1355,7 @@ H5SL_search(H5SL_t *slist, const void *key) break; default: - HDassert(0 && "Unknown skiplist type!"); + assert(0 && "Unknown skiplist type!"); } /* 'key' must not have been found in list, if we get here */ @@ -1397,8 +1397,8 @@ H5SL_less(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1447,7 +1447,7 @@ H5SL_less(H5SL_t *slist, const void *key) break; default: - HDassert(0 && "Unknown skiplist type!"); + assert(0 && "Unknown skiplist type!"); } /* An exact match for 'key' must not have been found in list, if we get here */ @@ -1502,8 +1502,8 @@ H5SL_greater(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1552,7 +1552,7 @@ H5SL_greater(H5SL_t *slist, const void *key) break; default: - HDassert(0 && "Unknown skiplist type!"); + assert(0 && "Unknown skiplist type!"); } /* An exact match for 'key' must not have been found in list, if we get here */ @@ -1597,8 +1597,8 @@ H5SL_find(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1647,7 +1647,7 @@ H5SL_find(H5SL_t *slist, const void *key) break; default: - HDassert(0 && "Unknown skiplist type!"); + assert(0 && "Unknown skiplist type!"); } /* 'key' must not have been found in list, if we get here */ @@ -1689,8 +1689,8 @@ H5SL_below(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1739,7 +1739,7 @@ H5SL_below(H5SL_t *slist, const void *key) break; default: - HDassert(0 && "Unknown skiplist type!"); + assert(0 && "Unknown skiplist type!"); } /* An exact match for 'key' must not have been found in list, if we get here */ @@ -1794,8 +1794,8 @@ H5SL_above(H5SL_t *slist, const void *key) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); - HDassert(key); + assert(slist); + assert(key); /* Check internal consistency */ /* (Pre-condition) */ @@ -1844,7 +1844,7 @@ H5SL_above(H5SL_t *slist, const void *key) break; default: - HDassert(0 && "Unknown skiplist type!"); + assert(0 && "Unknown skiplist type!"); } /* An exact match for 'key' must not have been found in list, if we get here */ @@ -1883,7 +1883,7 @@ H5SL_first(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -1916,7 +1916,7 @@ H5SL_next(H5SL_node_t *slist_node) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist_node); + assert(slist_node); /* Check internal consistency */ /* (Pre-condition) */ @@ -1949,7 +1949,7 @@ H5SL_prev(H5SL_node_t *slist_node) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist_node); + assert(slist_node); /* Check internal consistency */ /* (Pre-condition) */ @@ -1983,7 +1983,7 @@ H5SL_last(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2016,7 +2016,7 @@ H5SL_item(H5SL_node_t *slist_node) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist_node); + assert(slist_node); /* Check internal consistency */ /* (Pre-condition) */ @@ -2067,7 +2067,7 @@ H5SL_iterate(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2125,7 +2125,7 @@ H5SL_release(H5SL_t *slist) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2174,7 +2174,7 @@ H5SL_free(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2221,7 +2221,7 @@ H5SL_destroy(H5SL_t *slist, H5SL_operator_t op, void *op_data) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ @@ -2261,7 +2261,7 @@ H5SL_close(H5SL_t *slist) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(slist); + assert(slist); /* Check internal consistency */ /* (Pre-condition) */ diff --git a/src/H5SM.c b/src/H5SM.c index 3a5be7d..c87001d 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -120,9 +120,9 @@ H5SM_init(H5F_t *f, H5P_genplist_t *fc_plist, const H5O_loc_t *ext_loc) FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) - HDassert(f); + assert(f); /* File should not already have a SOHM table */ - HDassert(!H5_addr_defined(H5F_SOHM_ADDR(f))); + assert(!H5_addr_defined(H5F_SOHM_ADDR(f))); /* Set the ring type in the DXPL */ H5AC_set_ring(H5AC_RING_USER, &orig_ring); @@ -159,15 +159,15 @@ H5SM_init(H5F_t *f, H5P_genplist_t *fc_plist, const H5O_loc_t *ext_loc) /* Check that number of indexes in table and in superblock make sense. * Right now we just use one byte to hold the number of indexes. */ - HDassert(table->num_indexes < 256); + assert(table->num_indexes < 256); /* Check that list and btree cutoffs make sense. There can't be any * values greater than the list max but less than the btree min; the * list max has to be greater than or equal to one less than the btree * min. */ - HDassert(list_max + 1 >= btree_min); - HDassert(table->num_indexes > 0 && table->num_indexes <= H5O_SHMESG_MAX_NINDEXES); + assert(list_max + 1 >= btree_min); + assert(table->num_indexes > 0 && table->num_indexes <= H5O_SHMESG_MAX_NINDEXES); /* Allocate the SOHM indexes as an array. */ if (NULL == (table->indexes = @@ -404,8 +404,8 @@ H5SM_get_fheap_addr(H5F_t *f, unsigned type_id, haddr_t *fheap_addr) FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* Sanity checks */ - HDassert(f); - HDassert(fheap_addr); + assert(f); + assert(fheap_addr); /* Set up user data for callback */ cache_udata.f = f; @@ -453,9 +453,9 @@ H5SM__create_index(H5F_t *f, H5SM_index_header_t *header) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(header); - HDassert(header->index_addr == HADDR_UNDEF); - HDassert(header->btree_min <= header->list_max + 1); + assert(header); + assert(header->index_addr == HADDR_UNDEF); + assert(header->btree_min <= header->list_max + 1); /* In most cases, the index starts as a list */ if (header->list_max > 0) { @@ -515,7 +515,7 @@ H5SM__create_index(H5F_t *f, H5SM_index_header_t *header) /* Sanity check ID length */ if (H5HF_get_id_len(fheap, &fheap_id_len) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGETSIZE, FAIL, "can't get fractal heap ID length") - HDassert(fheap_id_len == H5O_FHEAP_ID_LEN); + assert(fheap_id_len == H5O_FHEAP_ID_LEN); } #endif /* NDEBUG */ @@ -566,8 +566,8 @@ H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, hbool_t delete_heap) /* If the index list is in the cache, expunge it now */ if (index_status & H5AC_ES__IN_CACHE) { /* Sanity checks on index list */ - HDassert(!(index_status & H5AC_ES__IS_PINNED)); - HDassert(!(index_status & H5AC_ES__IS_PROTECTED)); + assert(!(index_status & H5AC_ES__IS_PINNED)); + assert(!(index_status & H5AC_ES__IS_PROTECTED)); /* Evict the index list from the metadata cache */ if (H5AC_expunge_entry(f, H5AC_SOHM_LIST, header->index_addr, H5AC__FREE_FILE_SPACE_FLAG) < 0) @@ -575,7 +575,7 @@ H5SM__delete_index(H5F_t *f, H5SM_index_header_t *header, hbool_t delete_heap) } /* end if */ } /* end if */ else { - HDassert(header->index_type == H5SM_BTREE); + assert(header->index_type == H5SM_BTREE); /* Delete the B-tree. */ if (H5B2_delete(f, header->index_addr, f, NULL, NULL) < 0) @@ -627,8 +627,8 @@ H5SM__create_list(H5F_t *f, H5SM_index_header_t *header) FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(header); + assert(f); + assert(header); num_entries = header->list_max; @@ -707,8 +707,8 @@ H5SM__convert_list_to_btree(H5F_t *f, H5SM_index_header_t *header, H5SM_list_t * FUNC_ENTER_PACKAGE - HDassert(_list && *_list); - HDassert(header); + assert(_list && *_list); + assert(header); /* Get pointer to list of messages to convert */ list = *_list; @@ -810,16 +810,16 @@ H5SM__bt2_convert_to_list_op(const void *record, void *op_data) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(record); - HDassert(op_data); + assert(record); + assert(op_data); /* Get the message index, and increment the # of messages in list */ mesg_idx = list->header->num_messages++; - HDassert(list->header->num_messages <= list->header->list_max); + assert(list->header->num_messages <= list->header->list_max); /* Insert this message at the end of the list */ - HDassert(list->messages[mesg_idx].location == H5SM_NO_LOC); - HDassert(message->location != H5SM_NO_LOC); + assert(list->messages[mesg_idx].location == H5SM_NO_LOC); + assert(message->location != H5SM_NO_LOC); H5MM_memcpy(&(list->messages[mesg_idx]), message, sizeof(H5SM_sohm_t)); FUNC_LEAVE_NOAPI(SUCCEED) @@ -1139,19 +1139,19 @@ H5SM_try_share(H5F_t *f, H5O_t *open_oh, unsigned defer_flags, unsigned type_id, if (((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE) *mesg_flags |= H5O_MSG_FLAG_SHAREABLE; else { - HDassert(((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); + assert(((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); *mesg_flags |= H5O_MSG_FLAG_SHARED; } /* end else */ } /* end if */ done: - HDassert((ret_value != TRUE) || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE || - ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); + assert((ret_value != TRUE) || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE || + ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); #ifndef NDEBUG /* If we previously deferred this operation, make sure the saved message * type is the same as the one we get here. */ if (defer_flags & H5SM_WAS_DEFERRED) - HDassert(deferred_type == ((H5O_shared_t *)mesg)->type); + assert(deferred_type == ((H5O_shared_t *)mesg)->type); #endif /* NDEBUG */ /* Release the master SOHM table */ @@ -1187,15 +1187,15 @@ H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed) FUNC_ENTER_PACKAGE - HDassert(record); - HDassert(op_data); - HDassert(changed); + assert(record); + assert(op_data); + assert(changed); /* If the message was previously shared in an object header, share * it in the heap now. */ if (message->location == H5SM_IN_OH) { - HDassert(op_data->key && op_data->key->fheap); + assert(op_data->key && op_data->key->fheap); /* Put the message in the heap and record its new heap ID */ if (H5HF_insert(op_data->key->fheap, op_data->key->encoding_size, op_data->key->encoding, @@ -1206,7 +1206,7 @@ H5SM__incr_ref(void *record, void *_op_data, hbool_t *changed) message->u.heap_loc.ref_count = 2; } /* end if */ else { - HDassert(message->location == H5SM_IN_HEAP); + assert(message->location == H5SM_IN_HEAP); /* If it's already in the heap, just increment the ref count */ ++message->u.heap_loc.ref_count; } /* end else */ @@ -1273,9 +1273,9 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(header); - HDassert(header->index_type != H5SM_BADTYPE); - HDassert(cache_flags_ptr); + assert(header); + assert(header->index_type != H5SM_BADTYPE); + assert(cache_flags_ptr); /* Encode the message to be written */ if ((buf_size = H5O_msg_raw_size(f, type_id, TRUE, mesg)) == 0) @@ -1341,7 +1341,7 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t } /* end if */ else { /* If the message was already in the heap, increase its ref count */ - HDassert(list->messages[list_pos].location == H5SM_IN_HEAP); + assert(list->messages[list_pos].location == H5SM_IN_HEAP); ++(list->messages[list_pos].u.heap_loc.ref_count); } /* end else */ @@ -1353,7 +1353,7 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t } /* end if */ /* Index is a B-tree */ else { - HDassert(header->index_type == H5SM_BTREE); + assert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ if (NULL == (bt2 = H5B2_open(f, header->index_addr, f))) @@ -1487,13 +1487,13 @@ H5SM__write_mesg(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, hbool_t HGOTO_ERROR(H5E_SOHM, H5E_CANTINSERT, FAIL, "unable to find empty entry in list") } /* Insert message into list */ - HDassert(list->messages[empty_pos].location == H5SM_NO_LOC); - HDassert(key.message.location != H5SM_NO_LOC); + assert(list->messages[empty_pos].location == H5SM_NO_LOC); + assert(key.message.location != H5SM_NO_LOC); list->messages[empty_pos] = key.message; } /* end if */ /* Index is a B-tree */ else { - HDassert(header->index_type == H5SM_BTREE); + assert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree, if it isn't already */ if (NULL == bt2) { @@ -1570,9 +1570,9 @@ H5SM_delete(H5F_t *f, H5O_t *open_oh, H5O_shared_t *sh_mesg) FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) - HDassert(f); - HDassert(H5_addr_defined(H5F_SOHM_ADDR(f))); - HDassert(sh_mesg); + assert(f); + assert(H5_addr_defined(H5F_SOHM_ADDR(f))); + assert(sh_mesg); /* Get message type */ type_id = sh_mesg->msg_type_id; @@ -1665,9 +1665,9 @@ H5SM__find_in_list(const H5SM_list_t *list, const H5SM_mesg_key_t *key, size_t * FUNC_ENTER_PACKAGE - HDassert(list); + assert(list); /* Both key and empty_pos can be NULL, but not both! */ - HDassert(key || empty_pos); + assert(key || empty_pos); /* Initialize empty_pos to an invalid value */ if (empty_pos) @@ -1730,9 +1730,9 @@ H5SM__decr_ref(void *record, void *op_data, hbool_t *changed) FUNC_ENTER_PACKAGE_NOERR - HDassert(record); - HDassert(op_data); - HDassert(changed); + assert(record); + assert(op_data); + assert(changed); /* Adjust the message's reference count if it's stored in the heap. * Messages stored in object headers always have refcounts of 1, @@ -1784,11 +1784,11 @@ H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, c FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(header); - HDassert(mesg); - HDassert(cache_flags); - HDassert(*encoded_mesg == NULL); + assert(f); + assert(header); + assert(mesg); + assert(cache_flags); + assert(*encoded_mesg == NULL); /* Get the message type for later */ type_id = mesg->msg_type_id; @@ -1851,7 +1851,7 @@ H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, c } /* end if */ else { /* Index is a B-tree */ - HDassert(header->index_type == H5SM_BTREE); + assert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ if (NULL == (bt2 = H5B2_open(f, header->index_addr, f))) @@ -1910,7 +1910,7 @@ H5SM__delete_from_index(H5F_t *f, H5O_t *open_oh, H5SM_index_header_t *header, c HGOTO_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to release SOHM list") list = NULL; - HDassert(fheap); + assert(fheap); if (H5HF_close(fheap) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "can't close fractal heap") fheap = NULL; @@ -1976,9 +1976,9 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist) FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* Sanity check */ - HDassert(ext_loc); - HDassert(f); - HDassert(fc_plist); + assert(ext_loc); + assert(f); + assert(fc_plist); /* Check for the extension having a 'shared message info' message */ if ((status = H5O_msg_exists(ext_loc, H5O_SHMESG_ID)) < 0) @@ -2003,8 +2003,8 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist) H5F_SET_SOHM_ADDR(f, sohm_table.addr); H5F_SET_SOHM_VERS(f, sohm_table.version); H5F_SET_SOHM_NINDEXES(f, sohm_table.nindexes); - HDassert(H5_addr_defined(H5F_SOHM_ADDR(f))); - HDassert(H5F_SOHM_NINDEXES(f) > 0 && H5F_SOHM_NINDEXES(f) <= H5O_SHMESG_MAX_NINDEXES); + assert(H5_addr_defined(H5F_SOHM_ADDR(f))); + assert(H5F_SOHM_NINDEXES(f) > 0 && H5F_SOHM_NINDEXES(f) <= H5O_SHMESG_MAX_NINDEXES); /* Set up user data for callback */ cache_udata.f = f; @@ -2028,8 +2028,8 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist) minsizes[u] = (unsigned)table->indexes[u].min_mesg_size; /* Sanity check */ - HDassert(sohm_l2b == table->indexes[u].list_max); - HDassert(sohm_b2l == table->indexes[u].btree_min); + assert(sohm_l2b == table->indexes[u].list_max); + assert(sohm_b2l == table->indexes[u].btree_min); /* Check for sharing attributes in this file, which means that creation * indices must be tracked on object header message in the file. @@ -2094,7 +2094,7 @@ H5SM_reconstitute(H5O_shared_t *sh_mesg, H5F_t *f, unsigned msg_type_id, H5O_fhe FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check args */ - HDassert(sh_mesg); + assert(sh_mesg); /* Set flag for shared message */ sh_mesg->type = H5O_SHARE_TYPE_SOHM; @@ -2128,8 +2128,8 @@ H5SM__get_refcount_bt2_cb(const void *_record, void *_op_data) /* * Check arguments. */ - HDassert(record); - HDassert(op_data); + assert(record); + assert(op_data); /* Make a copy of the record */ *op_data = *record; @@ -2168,9 +2168,9 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, hsize FUNC_ENTER_NOAPI_NOINIT_TAG(H5AC__SOHM_TAG) /* Sanity check */ - HDassert(f); - HDassert(sh_mesg); - HDassert(ref_count); + assert(f); + assert(sh_mesg); + assert(ref_count); /* Set up user data for callback */ tbl_cache_udata.f = f; @@ -2232,7 +2232,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, hsize hbool_t msg_exists; /* Whether the message exists in the v2 B-tree */ /* Index is a B-tree */ - HDassert(header->index_type == H5SM_BTREE); + assert(header->index_type == H5SM_BTREE); /* Open the index v2 B-tree */ if (NULL == (bt2 = H5B2_open(f, header->index_addr, f))) @@ -2247,7 +2247,7 @@ H5SM_get_refcount(H5F_t *f, unsigned type_id, const H5O_shared_t *sh_mesg, hsize } /* end else */ /* Set the refcount for the message */ - HDassert(message.location == H5SM_IN_HEAP); + assert(message.location == H5SM_IN_HEAP); *ref_count = message.u.heap_loc.ref_count; done: @@ -2296,10 +2296,10 @@ H5SM__read_iter_op(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, /* * Check arguments. */ - HDassert(oh); - HDassert(mesg); - HDassert(udata); - HDassert(NULL == udata->encoding_buf); + assert(oh); + assert(mesg); + assert(udata); + assert(NULL == udata->encoding_buf); /* Check the creation index for this message */ if (sequence == udata->idx) { @@ -2310,7 +2310,7 @@ H5SM__read_iter_op(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, /* Get the message's encoded size */ udata->buf_size = mesg->raw_size; - HDassert(udata->buf_size); + assert(udata->buf_size); /* Allocate buffer to return the message in */ if (NULL == (udata->encoding_buf = H5MM_malloc(udata->buf_size))) @@ -2385,9 +2385,9 @@ H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, H5O_t *open_oh FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(mesg); - HDassert(fheap); + assert(f); + assert(mesg); + assert(fheap); /* Set up user data for message iteration */ udata.file = f; @@ -2404,7 +2404,7 @@ H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, H5O_t *open_oh H5O_mesg_operator_t op; /* Wrapper for operator */ type = H5O_msg_class_g[mesg->msg_type_id]; /* map the type ID to the actual type object */ - HDassert(type); + assert(type); /* Reset object location for operation */ if (H5O_loc_reset(&oloc) < 0) @@ -2431,14 +2431,14 @@ H5SM__read_mesg(H5F_t *f, const H5SM_sohm_t *mesg, H5HF_t *fheap, H5O_t *open_oh HGOTO_ERROR(H5E_SOHM, H5E_BADITER, FAIL, "unable to iterate over object header messages") } /* end if */ else { - HDassert(mesg->location == H5SM_IN_HEAP); + assert(mesg->location == H5SM_IN_HEAP); /* Copy the message from the heap */ if (H5HF_op(fheap, &(mesg->u.heap_loc.fheap_id), H5SM__read_mesg_fh_cb, &udata) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTLOAD, FAIL, "can't read message from fractal heap.") } /* end else */ - HDassert(udata.encoding_buf); - HDassert(udata.buf_size); + assert(udata.encoding_buf); + assert(udata.buf_size); /* Record the returned values */ *encoded_mesg = udata.encoding_buf; @@ -2478,8 +2478,8 @@ H5SM__table_free(H5SM_master_table_t *table) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(table); - HDassert(table->indexes); + assert(table); + assert(table->indexes); table->indexes = H5FL_ARR_FREE(H5SM_index_header_t, table->indexes); @@ -2505,8 +2505,8 @@ H5SM__list_free(H5SM_list_t *list) { FUNC_ENTER_PACKAGE_NOERR - HDassert(list); - HDassert(list->messages); + assert(list); + assert(list->messages); list->messages = H5FL_ARR_FREE(H5SM_sohm_t, list->messages); @@ -2541,11 +2541,11 @@ H5SM_table_debug(H5F_t *f, haddr_t table_addr, FILE *stream, int indent, int fwi FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) - HDassert(f); - HDassert(table_addr != HADDR_UNDEF); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(table_addr != HADDR_UNDEF); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* If table_vers and num_indexes are UINT_MAX, replace them with values from * userblock @@ -2633,11 +2633,11 @@ H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, int indent, int fwidt FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) - HDassert(f); - HDassert(list_addr != HADDR_UNDEF); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(list_addr != HADDR_UNDEF); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); /* Set up user data for callback */ tbl_cache_udata.f = f; @@ -2679,7 +2679,7 @@ H5SM_list_debug(H5F_t *f, haddr_t list_addr, FILE *stream, int indent, int fwidt HDfprintf(stream, "%*s%-*s %08lu\n", indent + 3, "", fwidth, "Hash value:", (unsigned long)list->messages[x].hash); if (list->messages[x].location == H5SM_IN_HEAP) { - HDassert(fh); + assert(fh); HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth, "Location:", "in heap"); HDfprintf(stream, "%*s%-*s 0x%" PRIx64 "\n", indent + 3, "", fwidth, @@ -2740,10 +2740,10 @@ H5SM_ih_size(H5F_t *f, hsize_t *hdr_size, H5_ih_info_t *ih_info) FUNC_ENTER_NOAPI_TAG(H5AC__SOHM_TAG, FAIL) /* Sanity check */ - HDassert(f); - HDassert(H5_addr_defined(H5F_SOHM_ADDR(f))); - HDassert(hdr_size); - HDassert(ih_info); + assert(f); + assert(H5_addr_defined(H5F_SOHM_ADDR(f))); + assert(hdr_size); + assert(ih_info); /* Set up user data for callback */ cache_udata.f = f; @@ -2775,7 +2775,7 @@ H5SM_ih_size(H5F_t *f, hsize_t *hdr_size, H5_ih_info_t *ih_info) } /* end if */ } /* end if */ else { - HDassert(table->indexes[u].index_type == H5SM_LIST); + assert(table->indexes[u].index_type == H5SM_LIST); ih_info->index_size += table->indexes[u].list_size; } /* end else */ diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index 15b0125..5ba9d9b 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -92,7 +92,7 @@ H5SM__bt2_crt_context(void *_f) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); + assert(f); /* Allocate callback context */ if (NULL == (ctx = H5FL_MALLOC(H5SM_bt2_ctx_t))) @@ -129,7 +129,7 @@ H5SM__bt2_dst_context(void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); /* Release callback context */ ctx = H5FL_FREE(H5SM_bt2_ctx_t, ctx); @@ -190,7 +190,7 @@ H5SM__bt2_debug(FILE *stream, int indent, int fwidth, const void *record, const "Shared Message in heap:", sohm->u.heap_loc.fheap_id.val, sohm->hash, sohm->u.heap_loc.ref_count); else { - HDassert(sohm->location == H5SM_IN_OH); + assert(sohm->location == H5SM_IN_OH); HDfprintf(stream, "%*s%-*s {%" PRIuHADDR ", %" PRIo32 ", %x, %" PRIx32 "}\n", indent, "", fwidth, "Shared Message in OH:", sohm->u.mesg_loc.oh_addr, sohm->hash, sohm->msg_type_id, sohm->u.mesg_loc.index); diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 30676f1..a93d9e0 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -134,9 +134,9 @@ H5SM__cache_table_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->f); - HDassert(image_len); + assert(udata); + assert(udata->f); + assert(image_len); /* Set the image length size */ *image_len = H5SM_TABLE_SIZE(udata->f); @@ -168,7 +168,7 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); + assert(image); /* Get stored and computed checksums */ H5F_get_checksums(image, len, &stored_chksum, &computed_chksum); @@ -210,17 +210,17 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(len > 0); - HDassert(udata); - HDassert(udata->f); + assert(image); + assert(len > 0); + assert(udata); + assert(udata->f); f = udata->f; - HDassert(dirty); + assert(dirty); /* Verify that we're reading version 0 of the table; this is the only * version defined so far. */ - HDassert(H5F_SOHM_VERS(f) == HDF5_SHAREDHEADER_VERSION); + assert(H5F_SOHM_VERS(f) == HDF5_SHAREDHEADER_VERSION); /* Allocate space for the master table in memory */ if (NULL == (table = H5FL_CALLOC(H5SM_master_table_t))) @@ -228,13 +228,13 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l /* Read number of indexes and version from file superblock */ table->num_indexes = H5F_SOHM_NINDEXES(f); - HDassert(table->num_indexes > 0); + assert(table->num_indexes > 0); /* Compute the size of the SOHM table header on disk. This is the "table" * itself plus each index within the table */ table->table_size = H5SM_TABLE_SIZE(f); - HDassert(table->table_size == len); + assert(table->table_size == len); /* Check magic number */ if (HDmemcmp(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0) @@ -286,7 +286,7 @@ H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED l UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) == table->table_size); + assert((size_t)(image - (const uint8_t *)_image) == table->table_size); /* Set return value */ ret_value = table; @@ -323,9 +323,9 @@ H5SM__cache_table_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(table); - HDassert(table->cache_info.type == H5AC_SOHM_TABLE); - HDassert(image_len); + assert(table); + assert(table->cache_info.type == H5AC_SOHM_TABLE); + assert(image_len); *image_len = table->table_size; @@ -357,16 +357,16 @@ H5SM__cache_table_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_ FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(table); - HDassert(table->cache_info.type == H5AC_SOHM_TABLE); - HDassert(table->table_size == len); + assert(f); + assert(image); + assert(table); + assert(table->cache_info.type == H5AC_SOHM_TABLE); + assert(table->table_size == len); /* Verify that we're writing version 0 of the table; this is the only * version defined so far. */ - HDassert(H5F_SOHM_VERS(f) == HDF5_SHAREDHEADER_VERSION); + assert(H5F_SOHM_VERS(f) == HDF5_SHAREDHEADER_VERSION); /* Encode magic number */ H5MM_memcpy(image, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -407,7 +407,7 @@ H5SM__cache_table_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_ UINT32ENCODE(image, computed_chksum); /* sanity check */ - HDassert((size_t)(image - ((uint8_t *)_image)) == table->table_size); + assert((size_t)(image - ((uint8_t *)_image)) == table->table_size); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5SM__cache_table_serialize() */ @@ -438,8 +438,8 @@ H5SM__cache_table_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(table); - HDassert(table->cache_info.type == H5AC_SOHM_TABLE); + assert(table); + assert(table->cache_info.type == H5AC_SOHM_TABLE); /* Destroy Shared Object Header Message table */ if (H5SM__table_free(table) < 0) @@ -472,10 +472,10 @@ H5SM__cache_list_get_initial_load_size(void *_udata, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(udata); - HDassert(udata->header); - HDassert(udata->header->list_size > 0); - HDassert(image_len); + assert(udata); + assert(udata->header); + assert(udata->header->list_size > 0); + assert(image_len); /* Set the image length size */ *image_len = udata->header->list_size; @@ -509,8 +509,8 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(image); - HDassert(udata); + assert(image); + assert(udata); /* Exact size with checksum at the end */ chk_size = H5SM_LIST_SIZE(udata->f, udata->header->num_messages); @@ -554,12 +554,12 @@ H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED le FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(image); - HDassert(len > 0); - HDassert(udata); - HDassert(udata->header); - HDassert(udata->header->list_size == len); - HDassert(dirty); + assert(image); + assert(len > 0); + assert(udata); + assert(udata->header); + assert(udata->header->list_size == len); + assert(dirty); /* Allocate space for the SOHM list data structure */ if (NULL == (list = H5FL_MALLOC(H5SM_list_t))) @@ -591,7 +591,7 @@ H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED le UINT32DECODE(image, stored_chksum); /* Sanity check */ - HDassert((size_t)(image - (const uint8_t *)_image) <= udata->header->list_size); + assert((size_t)(image - (const uint8_t *)_image) <= udata->header->list_size); /* Initialize the rest of the array */ for (u = udata->header->num_messages; u < udata->header->list_max; u++) @@ -631,10 +631,10 @@ H5SM__cache_list_image_len(const void *_thing, size_t *image_len) FUNC_ENTER_PACKAGE_NOERR /* Check arguments */ - HDassert(list); - HDassert(list->cache_info.type == H5AC_SOHM_LIST); - HDassert(list->header); - HDassert(image_len); + assert(list); + assert(list->cache_info.type == H5AC_SOHM_LIST); + assert(list->header); + assert(image_len); *image_len = list->header->list_size; @@ -669,12 +669,12 @@ H5SM__cache_list_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_U FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(f); - HDassert(image); - HDassert(list); - HDassert(list->cache_info.type == H5AC_SOHM_LIST); - HDassert(list->header); - HDassert(list->header->list_size == len); + assert(f); + assert(image); + assert(list); + assert(list->cache_info.type == H5AC_SOHM_LIST); + assert(list->header); + assert(list->header->list_size == len); /* Encode magic number */ H5MM_memcpy(image, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -693,14 +693,14 @@ H5SM__cache_list_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_U } /* end if */ } /* end for */ - HDassert(mesgs_serialized == list->header->num_messages); + assert(mesgs_serialized == list->header->num_messages); /* Compute checksum on buffer */ computed_chksum = H5_checksum_metadata(_image, (size_t)(image - (uint8_t *)_image), 0); UINT32ENCODE(image, computed_chksum); /* sanity check */ - HDassert((size_t)(image - (uint8_t *)_image) <= list->header->list_size); + assert((size_t)(image - (uint8_t *)_image) <= list->header->list_size); /* Clear memory */ HDmemset(image, 0, (list->header->list_size - (size_t)(image - (uint8_t *)_image))); @@ -735,8 +735,8 @@ H5SM__cache_list_free_icr(void *_thing) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(list); - HDassert(list->cache_info.type == H5AC_SOHM_LIST); + assert(list); + assert(list->cache_info.type == H5AC_SOHM_LIST); /* Destroy Shared Object Header Message list */ if (H5SM__list_free(list) < 0) diff --git a/src/H5SMmessage.c b/src/H5SMmessage.c index 4714b52..7ee3f67 100644 --- a/src/H5SMmessage.c +++ b/src/H5SMmessage.c @@ -123,16 +123,16 @@ H5SM__compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, /* * Check arguments. */ - HDassert(oh); - HDassert(mesg); - HDassert(udata && udata->key); + assert(oh); + assert(mesg); + assert(udata && udata->key); /* Check the creation index for this message */ if (sequence == udata->idx) { size_t aligned_encoded_size = H5O_ALIGN_OH(oh, udata->key->encoding_size); /* Sanity check the message's length */ - HDassert(mesg->raw_size > 0); + assert(mesg->raw_size > 0); if (aligned_encoded_size > mesg->raw_size) udata->ret = 1; @@ -145,7 +145,7 @@ H5SM__compare_iter_op(H5O_t *oh, H5O_mesg_t *mesg /*in,out*/, unsigned sequence, HGOTO_ERROR(H5E_SOHM, H5E_CANTENCODE, H5_ITER_ERROR, "unable to encode object header message") - HDassert(udata->key->encoding_size <= mesg->raw_size); + assert(udata->key->encoding_size <= mesg->raw_size); udata->ret = HDmemcmp(udata->key->encoding, mesg->raw, udata->key->encoding_size); } /* end else */ @@ -215,8 +215,8 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) */ H5SM_compare_udata_t udata; - HDassert(key->message.hash == mesg->hash); - HDassert(key->encoding_size > 0 && key->encoding); + assert(key->message.hash == mesg->hash); + assert(key->encoding_size > 0 && key->encoding); /* Set up user data for callback */ udata.key = key; @@ -234,8 +234,8 @@ H5SM__message_compare(const void *rec1, const void *rec2, int *result) H5O_mesg_operator_t op; /* Message operator */ /* Sanity checks */ - HDassert(key->file); - HDassert(mesg->location == H5SM_IN_OH); + assert(key->file); + assert(mesg->location == H5SM_IN_OH); /* Reset the object location */ if (H5O_loc_reset(&oloc) < 0) @@ -284,7 +284,7 @@ H5SM__message_encode(uint8_t *raw, const void *_nrecord, void *_ctx) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(ctx); + assert(ctx); *raw++ = (uint8_t)message->location; UINT32ENCODE(raw, message->hash); @@ -294,7 +294,7 @@ H5SM__message_encode(uint8_t *raw, const void *_nrecord, void *_ctx) H5MM_memcpy(raw, message->u.heap_loc.fheap_id.id, (size_t)H5O_FHEAP_ID_LEN); } /* end if */ else { - HDassert(message->location == H5SM_IN_OH); + assert(message->location == H5SM_IN_OH); *raw++ = 0; /* reserved (possible flags byte) */ *raw++ = (uint8_t)message->msg_type_id; @@ -334,7 +334,7 @@ H5SM__message_decode(const uint8_t *raw, void *_nrecord, void *_ctx) H5MM_memcpy(message->u.heap_loc.fheap_id.id, raw, (size_t)H5O_FHEAP_ID_LEN); } /* end if */ else { - HDassert(message->location == H5SM_IN_OH); + assert(message->location == H5SM_IN_OH); raw++; /* reserved */ message->msg_type_id = *raw++; diff --git a/src/H5SMtest.c b/src/H5SMtest.c index d80d57f..7209a0a 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -72,8 +72,8 @@ H5SM__get_mesg_count_test(H5F_t *f, unsigned type_id, size_t *mesg_count) FUNC_ENTER_PACKAGE_TAG(H5AC__SOHM_TAG) /* Sanity check */ - HDassert(f); - HDassert(mesg_count); + assert(f); + assert(mesg_count); /* Check for shared messages being enabled */ if (H5_addr_defined(H5F_SOHM_ADDR(f))) { diff --git a/src/H5Sall.c b/src/H5Sall.c index 7f5633f..a5d86ae 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -148,8 +148,8 @@ H5S__all_iter_init(H5S_t H5_ATTR_UNUSED *space, H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); - HDassert(iter); + assert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); + assert(iter); /* Start at the upper left location */ iter->u.all.elmt_offset = 0; @@ -182,8 +182,8 @@ H5S__all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(iter); - HDassert(coords); + assert(iter); + assert(coords); /* Calculate the coordinates for the current iterator offset */ if (H5VM_array_calc(iter->u.all.elmt_offset, iter->rank, iter->dims, coords) < 0) @@ -214,9 +214,9 @@ H5S__all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(start); - HDassert(end); + assert(iter); + assert(start); + assert(end); for (u = 0; u < iter->rank; u++) { /* Set the start of the 'all' block */ @@ -249,7 +249,7 @@ H5S__all_iter_nelmts(const H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(iter->elmt_left) } /* end H5S__all_iter_nelmts() */ @@ -277,7 +277,7 @@ H5S__all_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(FALSE) } /* end H5S__all_iter_has_next_block() */ @@ -306,8 +306,8 @@ H5S__all_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(nelem > 0); + assert(iter); + assert(nelem > 0); /* Increment the iterator */ iter->u.all.elmt_offset += nelem; @@ -339,7 +339,7 @@ H5S__all_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__all_iter_next_block() */ @@ -382,18 +382,18 @@ H5S__all_iter_get_seq_list(H5S_sel_iter_t *iter, size_t H5_ATTR_UNUSED maxseq, s FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(maxseq > 0); - HDassert(maxelem > 0); - HDassert(nseq); - HDassert(nelem); - HDassert(off); - HDassert(len); + assert(iter); + assert(maxseq > 0); + assert(maxelem > 0); + assert(nseq); + assert(nelem); + assert(off); + assert(len); /* Determine the actual number of elements to use */ H5_CHECK_OVERFLOW(iter->elmt_left, hsize_t, size_t); elem_used = MIN(maxelem, (size_t)iter->elmt_left); - HDassert(elem_used > 0); + assert(elem_used > 0); /* Compute the offset in the dataset */ off[0] = iter->u.all.byte_offset; @@ -436,7 +436,7 @@ H5S__all_iter_release(H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__all_iter_release() */ @@ -464,7 +464,7 @@ H5S__all_release(H5S_t *space) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); + assert(space); /* Reset the number of elements in the selection */ space->select.num_elem = 0; @@ -497,8 +497,8 @@ H5S__all_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUSE { FUNC_ENTER_PACKAGE_NOERR - HDassert(src); - HDassert(dst); + assert(src); + assert(dst); /* Set number of elements in selection */ dst->select.num_elem = (hsize_t)H5S_GET_EXTENT_NPOINTS(dst); @@ -531,7 +531,7 @@ H5S__all_is_valid(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__all_is_valid() */ @@ -560,7 +560,7 @@ H5S__all_serial_size(H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); /* Basic number of bytes required to serialize point selection: * + + + @@ -598,9 +598,9 @@ H5S__all_serialize(H5S_t *space, uint8_t **p) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); - HDassert(p); - HDassert(pp); + assert(space); + assert(p); + assert(pp); /* Store the preamble information */ UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ @@ -646,8 +646,8 @@ H5S__all_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hboo const uint8_t *p_end = *p + p_size - 1; /* Pointer to last valid byte in buffer */ FUNC_ENTER_PACKAGE - HDassert(p); - HDassert(*p); + assert(p); + assert(*p); /* As part of the efforts to push all selection-type specific coding to the callbacks, the coding for the allocation of a null dataspace @@ -725,9 +725,9 @@ H5S__all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); - HDassert(start); - HDassert(end); + assert(space); + assert(start); + assert(end); /* Get the dataspace extent rank */ rank = space->extent.rank; @@ -766,8 +766,8 @@ H5S__all_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); /* 'All' selections always start at offset 0 */ *offset = 0; @@ -827,7 +827,7 @@ H5S__all_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__all_is_contiguous() */ @@ -855,7 +855,7 @@ H5S__all_is_single(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__all_is_single() */ @@ -885,7 +885,7 @@ H5S__all_is_regular(H5S_t H5_ATTR_UNUSED *space) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__all_is_regular() */ @@ -919,8 +919,8 @@ H5S__all_shape_same(H5S_t *space1, H5S_t *space2) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space1); - HDassert(space2); + assert(space1); + assert(space2); /* Initialize dataspace dims */ space1_dim = (int)space1->extent.rank - 1; @@ -979,10 +979,10 @@ H5S__all_intersect_block(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUS FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(space); - HDassert(H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); - HDassert(start); - HDassert(end); + assert(space); + assert(H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); + assert(start); + assert(end); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__all_intersect_block() */ @@ -1011,8 +1011,8 @@ H5S__all_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *off FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__all_adjust_u() */ @@ -1041,8 +1041,8 @@ H5S__all_adjust_s(H5S_t H5_ATTR_UNUSED *space, const hssize_t H5_ATTR_UNUSED *of FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__all_adjust_s() */ @@ -1066,8 +1066,8 @@ H5S__all_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t *offset) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); - HDassert(offset); + assert(space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)); + assert(offset); /* Set offset of selection in projected buffer */ *offset = 0; @@ -1097,9 +1097,9 @@ H5S__all_project_simple(const H5S_t H5_ATTR_UNUSED *base_space, H5S_t *new_space FUNC_ENTER_PACKAGE /* Check args */ - HDassert(base_space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(base_space)); - HDassert(new_space); - HDassert(offset); + assert(base_space && H5S_SEL_ALL == H5S_GET_SELECT_TYPE(base_space)); + assert(new_space); + assert(offset); /* Select the entire new space */ if (H5S_select_all(new_space, TRUE) < 0) @@ -1135,7 +1135,7 @@ H5S_select_all(H5S_t *space, hbool_t rel_prev) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(space); + assert(space); /* Remove current selection first */ if (rel_prev) diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 376426d..a208ed5 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -405,7 +405,7 @@ H5S__hyper_print_spans_dfs(FILE *f, const H5S_hyper_span_info_t *span_lst, unsig /* get the actual tail from head */ cur_elem = span_lst->head; - HDassert(cur_elem); /* at least 1 element */ + assert(cur_elem); /* at least 1 element */ while (cur_elem) { actual_tail = cur_elem; cur_elem = cur_elem->next; @@ -472,7 +472,7 @@ H5S__hyper_print_space_dfs(FILE *f, const H5S_t *space) FUNC_ENTER_PACKAGE_NOERR - HDassert(hslab); + assert(hslab); HDfprintf(f, "=======================\n"); HDfprintf(f, "SPACE: span_lst=%p, #dims=%u, offset_changed=%d\n", (void *)hslab->span_lst, dims, @@ -574,9 +574,9 @@ H5S__hyper_iter_init(H5S_t *space, H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); - HDassert(iter); - HDassert(space->select.sel_info.hslab->unlim_dim < 0); + assert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); + assert(iter); + assert(space->select.sel_info.hslab->unlim_dim < 0); /* Initialize the hyperslab iterator's rank */ iter->u.hyp.iter_rank = 0; @@ -640,7 +640,7 @@ H5S__hyper_iter_init(H5S_t *space, H5S_sel_iter_t *iter) for (i = (int)rank - 1, acc = 1; i >= 0; i--) { if (tdiminfo[i].block == mem_size[i] && i > 0) { /* "Flatten" this dimension */ - HDassert(tdiminfo[i].start == 0); + assert(tdiminfo[i].start == 0); acc *= mem_size[i]; /* Indicate that the dimension was flattened */ @@ -732,7 +732,7 @@ H5S__hyper_iter_init(H5S_t *space, H5S_sel_iter_t *iter) } /* end if */ else { /* Share the source dataspace's span tree by incrementing the reference count on it */ - HDassert(space->select.sel_info.hslab->span_lst); + assert(space->select.sel_info.hslab->span_lst); iter->u.hyp.spans = space->select.sel_info.hslab->span_lst; iter->u.hyp.spans->count++; } /* end else */ @@ -741,8 +741,8 @@ H5S__hyper_iter_init(H5S_t *space, H5S_sel_iter_t *iter) spans = iter->u.hyp.spans; for (u = 0; u < rank; u++) { /* Set the pointers to the initial span in each dimension */ - HDassert(spans); - HDassert(spans->head); + assert(spans); + assert(spans->head); /* Set the pointer to the first span in the list for this node */ iter->u.hyp.span[u] = spans->head; @@ -803,8 +803,8 @@ H5S__hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(coords); + assert(iter); + assert(coords); /* Copy the offset of the current point */ @@ -833,7 +833,7 @@ H5S__hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) u = 0; /* Sanity check */ - HDassert(v >= 0); + assert(v >= 0); /* Compute the coords for the flattened dimensions */ H5VM_array_calc(iter->u.hyp.off[v], (unsigned)((begin - u) + 1), &(iter->dims[u]), @@ -847,7 +847,7 @@ H5S__hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) /* Walk up through as many non-flattened dimensions as possible */ while (u >= 0 && !iter->u.hyp.flattened[u]) { /* Sanity check */ - HDassert(v >= 0); + assert(v >= 0); /* Copy the coordinate */ coords[u] = iter->u.hyp.off[v]; @@ -858,7 +858,7 @@ H5S__hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) } /* end while */ } /* end else */ } /* end while */ - HDassert(v < 0); + assert(v < 0); } /* end if */ else H5MM_memcpy(coords, iter->u.hyp.off, sizeof(hsize_t) * iter->rank); @@ -893,9 +893,9 @@ H5S__hyper_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(start); - HDassert(end); + assert(iter); + assert(start); + assert(end); /* Copy the offset of the current point */ @@ -936,7 +936,7 @@ H5S__hyper_iter_nelmts(const H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(iter->elmt_left) } /* end H5S__hyper_iter_nelmts() */ @@ -967,7 +967,7 @@ H5S__hyper_iter_has_next_block(const H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); /* Check for a single "regular" hyperslab */ if (iter->u.hyp.diminfo_valid) { @@ -1179,9 +1179,9 @@ H5S__hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem) if (curr_dim >= 0) { /* Walk back down the iterator positions, resetting them */ while (curr_dim < fast_dim) { - HDassert(curr_span); - HDassert(curr_span->down); - HDassert(curr_span->down->head); + assert(curr_span); + assert(curr_span->down); + assert(curr_span->down->head); /* Increment current dimension */ curr_dim++; @@ -1197,7 +1197,7 @@ H5S__hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem) } /* end while */ /* Verify that the curr_span points to the fastest dim */ - HDassert(curr_span == ispan[fast_dim]); + assert(curr_span == ispan[fast_dim]); } /* end if */ } /* end while */ } /* end else */ @@ -1356,9 +1356,9 @@ H5S__hyper_iter_next_block(H5S_sel_iter_t *iter) if (curr_dim >= 0) { /* Walk back down the iterator positions, resetting them */ while (curr_dim < fast_dim) { - HDassert(curr_span); - HDassert(curr_span->down); - HDassert(curr_span->down->head); + assert(curr_span); + assert(curr_span->down); + assert(curr_span->down->head); /* Increment current dimension */ curr_dim++; @@ -1374,7 +1374,7 @@ H5S__hyper_iter_next_block(H5S_sel_iter_t *iter) } /* end while */ /* Verify that the curr_span points to the fastest dim */ - HDassert(curr_span == ispan[fast_dim]); + assert(curr_span == ispan[fast_dim]); } /* end if */ } /* end else */ @@ -1438,13 +1438,13 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max FUNC_ENTER_PACKAGE /* Check args */ - HDassert(iter); - HDassert(maxseq > 0); - HDassert(maxelem > 0); - HDassert(nseq); - HDassert(nelem); - HDassert(off); - HDassert(len); + assert(iter); + assert(maxseq > 0); + assert(maxelem > 0); + assert(nseq); + assert(nelem); + assert(off); + assert(len); /* Set the rank of the fastest changing dimension */ ndims = iter->rank; @@ -1517,7 +1517,7 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max /* Check if we are still within the span */ if (abs_arr[fast_dim] <= curr_span->high) { /* Sanity check */ - HDassert(ispan[fast_dim] == curr_span); + assert(ispan[fast_dim] == curr_span); /* Update byte offset */ loc_arr[fast_dim] += span_size; @@ -1594,9 +1594,9 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max if (curr_dim >= 0) { /* Walk back down the iterator positions, resetting them */ while ((unsigned)curr_dim < fast_dim) { - HDassert(curr_span); - HDassert(curr_span->down); - HDassert(curr_span->down->head); + assert(curr_span); + assert(curr_span->down); + assert(curr_span->down->head); /* Increment current dimension */ curr_dim++; @@ -1616,7 +1616,7 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max } /* end while */ /* Verify that the curr_span points to the fastest dim */ - HDassert(curr_span == ispan[fast_dim]); + assert(curr_span == ispan[fast_dim]); /* Reset the buffer offset */ for (u = 0, loc_off = 0; u < ndims; u++) @@ -1624,7 +1624,7 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max } /* end else */ else /* We had better be done with I/O or bad things are going to happen... */ - HDassert(io_elmts_left == 0); + assert(io_elmts_left == 0); } /* end if */ } /* end if */ @@ -1633,7 +1633,7 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max H5S_hyper_span_t *prev_span; /* Previous hyperslab span node */ /* Sanity check */ - HDassert(curr_span); + assert(curr_span); /* Set to current span, so the first adjustment to loc_off is 0 */ prev_span = curr_span; @@ -1796,15 +1796,15 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max /* Check if we are finished with the spans in the tree */ if (curr_dim < 0) { /* We had better be done with I/O or bad things are going to happen... */ - HDassert(io_elmts_left == 0); + assert(io_elmts_left == 0); break; } /* end if */ else { /* Walk back down the iterator positions, resetting them */ while ((unsigned)curr_dim < fast_dim) { - HDassert(curr_span); - HDassert(curr_span->down); - HDassert(curr_span->down->head); + assert(curr_span); + assert(curr_span->down); + assert(curr_span->down->head); /* Increment current dimension to the next dimension down */ curr_dim++; @@ -1824,7 +1824,7 @@ H5S__hyper_iter_get_seq_list_gen(H5S_sel_iter_t *iter, size_t maxseq, size_t max } /* end while */ /* Verify that the curr_span points to the fastest dim */ - HDassert(curr_span == ispan[fast_dim]); + assert(curr_span == ispan[fast_dim]); } /* end else */ /* Reset the buffer offset */ @@ -1911,13 +1911,13 @@ H5S__hyper_iter_get_seq_list_opt(H5S_sel_iter_t *iter, size_t maxseq, size_t max FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(maxseq > 0); - HDassert(maxelem > 0); - HDassert(nseq); - HDassert(nelem); - HDassert(off); - HDassert(len); + assert(iter); + assert(maxseq > 0); + assert(maxelem > 0); + assert(nseq); + assert(nelem); + assert(off); + assert(len); /* Set the local copy of the diminfo pointer */ tdiminfo = iter->u.hyp.diminfo; @@ -1954,8 +1954,8 @@ H5S__hyper_iter_get_seq_list_opt(H5S_sel_iter_t *iter, size_t maxseq, size_t max io_left = MIN((size_t)iter->elmt_left, maxelem); /* Sanity check that there aren't any "remainder" sequences in process */ - HDassert(!((iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start) % tdiminfo[fast_dim].stride != 0 || - ((iter->u.hyp.off[fast_dim] != tdiminfo[fast_dim].start) && tdiminfo[fast_dim].count == 1))); + assert(!((iter->u.hyp.off[fast_dim] - tdiminfo[fast_dim].start) % tdiminfo[fast_dim].stride != 0 || + ((iter->u.hyp.off[fast_dim] != tdiminfo[fast_dim].start) && tdiminfo[fast_dim].count == 1))); /* We've cleared the "remainder" of the previous fastest dimension * sequence before calling this routine, so we must be at the beginning of @@ -2138,7 +2138,7 @@ H5S__hyper_iter_get_seq_list_opt(H5S_sel_iter_t *iter, size_t maxseq, size_t max duffs_index = (fast_dim_count + 7) / 8; switch (fast_dim_count % 8) { default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); break; case 0: do { @@ -2274,7 +2274,7 @@ H5S__hyper_iter_get_seq_list_opt(H5S_sel_iter_t *iter, size_t maxseq, size_t max } /* end if */ /* don't bother checking slower dimensions */ - HDassert(io_left == 0 || curr_seq == maxseq); + assert(io_left == 0 || curr_seq == maxseq); } /* end if */ /* Update the iterator */ @@ -2350,13 +2350,13 @@ H5S__hyper_iter_get_seq_list_single(H5S_sel_iter_t *iter, size_t maxseq, size_t FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(maxseq > 0); - HDassert(maxelem > 0); - HDassert(nseq); - HDassert(nelem); - HDassert(off); - HDassert(len); + assert(iter); + assert(maxseq > 0); + assert(maxelem > 0); + assert(nseq); + assert(nelem); + assert(off); + assert(len); /* Set a local copy of the diminfo pointer */ tdiminfo = iter->u.hyp.diminfo; @@ -2429,8 +2429,8 @@ H5S__hyper_iter_get_seq_list_single(H5S_sel_iter_t *iter, size_t maxseq, size_t /* Check for 1-dim selection */ if (0 == fast_dim) { /* Sanity checks */ - HDassert(1 == tot_blk_count); - HDassert(io_left == actual_elem); + assert(1 == tot_blk_count); + assert(io_left == actual_elem); /* Store the sequence information */ *off++ = loc; @@ -2547,8 +2547,8 @@ H5S__hyper_iter_get_seq_list_single(H5S_sel_iter_t *iter, size_t maxseq, size_t /* Compute elements left */ elmt_remainder = io_left - (tot_blk_count * actual_elem); - HDassert(elmt_remainder < fast_dim_block); - HDassert(elmt_remainder > 0); + assert(elmt_remainder < fast_dim_block); + assert(elmt_remainder > 0); /* Store the sequence information */ *off++ = loc; @@ -2568,8 +2568,8 @@ H5S__hyper_iter_get_seq_list_single(H5S_sel_iter_t *iter, size_t maxseq, size_t } /* end if */ /* Sanity check */ - HDassert(*nseq > 0); - HDassert(*nelem > 0); + assert(*nseq > 0); + assert(*nelem > 0); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__hyper_iter_get_seq_list_single() */ @@ -2613,14 +2613,14 @@ H5S__hyper_iter_get_seq_list(H5S_sel_iter_t *iter, size_t maxseq, size_t maxelem FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(iter->elmt_left > 0); - HDassert(maxseq > 0); - HDassert(maxelem > 0); - HDassert(nseq); - HDassert(nelem); - HDassert(off); - HDassert(len); + assert(iter); + assert(iter->elmt_left > 0); + assert(maxseq > 0); + assert(maxelem > 0); + assert(nseq); + assert(nelem); + assert(off); + assert(len); /* Check for the special case of just one H5Sselect_hyperslab call made */ if (iter->u.hyp.diminfo_valid) { @@ -2766,7 +2766,7 @@ H5S__hyper_iter_release(H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(iter); + assert(iter); /* Free the copy of the hyperslab selection span tree */ if (iter->u.hyp.spans != NULL) @@ -2850,8 +2850,8 @@ H5S__hyper_new_span_info(unsigned rank) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(rank > 0); - HDassert(rank <= H5S_MAX_RANK); + assert(rank > 0); + assert(rank <= H5S_MAX_RANK); /* Allocate a new span info node */ if (NULL == (ret_value = (H5S_hyper_span_info_t *)H5FL_ARR_CALLOC(hbounds_t, rank * 2))) @@ -2897,7 +2897,7 @@ H5S__hyper_copy_span_helper(H5S_hyper_span_info_t *spans, unsigned rank, unsigne FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(spans); + assert(spans); /* Check if the span tree was already copied */ if (spans->op_info[op_info_i].op_gen == op_gen) { @@ -2988,7 +2988,7 @@ H5S__hyper_copy_span(H5S_hyper_span_info_t *spans, unsigned rank) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(spans); + assert(spans); /* Acquire an operation generation value for this operation */ op_gen = H5S__hyper_get_op_gen(); @@ -3052,8 +3052,8 @@ H5S__hyper_cmp_spans(const H5S_hyper_span_info_t *span_info1, const H5S_hyper_sp span2 = span_info2->head; /* Sanity checking */ - HDassert(span1); - HDassert(span2); + assert(span1); + assert(span2); /* infinite loop which must be broken out of */ while (1) { @@ -3185,7 +3185,7 @@ H5S__hyper_free_span(H5S_hyper_span_t *span) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(span); + assert(span); /* Decrement the reference count of the 'down spans', freeing them if appropriate */ if (span->down != NULL) @@ -3234,8 +3234,8 @@ H5S__hyper_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(src); - HDassert(dst); + assert(src); + assert(dst); /* Allocate space for the hyperslab selection information */ if (NULL == (dst->select.sel_info.hslab = H5FL_MALLOC(H5S_hyper_sel_t))) @@ -3303,7 +3303,7 @@ H5S__hyper_is_valid(const H5S_t *space) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); /* Check for unlimited selection */ if (space->select.sel_info.hslab->unlim_dim >= 0) @@ -3359,7 +3359,7 @@ H5S__hyper_span_nblocks_helper(H5S_hyper_span_info_t *spans, unsigned op_info_i, FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(spans); + assert(spans); /* Check if the span tree was already counted */ if (spans->op_info[op_info_i].op_gen == op_gen) @@ -3463,8 +3463,8 @@ H5S__get_select_hyper_nblocks(const H5S_t *space, hbool_t app_ref) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); - HDassert(space->select.sel_info.hslab->unlim_dim < 0); + assert(space); + assert(space->select.sel_info.hslab->unlim_dim < 0); /* Check for a "regular" hyperslab selection */ /* (No need to rebuild the dimension info yet -QAK) */ @@ -3705,7 +3705,7 @@ H5S__hyper_get_version_enc_size(H5S_t *space, hsize_t block_count, uint32_t *ver } /* end if */ else { hsize_t max_size = block_count; - HDassert(space->select.sel_info.hslab->unlim_dim < 0); + assert(space->select.sel_info.hslab->unlim_dim < 0); /* Find max for block_count and bounds_end[] */ for (u = 0; u < space->extent.rank; u++) @@ -3755,7 +3755,7 @@ H5S__hyper_serial_size(H5S_t *space) FUNC_ENTER_PACKAGE - HDassert(space); + assert(space); /* Determine the number of blocks */ if (space->select.sel_info.hslab->unlim_dim < 0) /* ! H5S_UNLIMITED */ @@ -3797,12 +3797,12 @@ H5S__hyper_serial_size(H5S_t *space) * (4 (start/stride/count/block) * * ) = * 17 + (4 * 8 * rank) bytes */ - HDassert(enc_size == 8); + assert(enc_size == 8); ret_value = (hssize_t)17 + ((hssize_t)4 * (hssize_t)8 * (hssize_t)space->extent.rank); } else { - HDassert(version == H5S_HYPER_VERSION_1); - HDassert(enc_size == 4); + assert(version == H5S_HYPER_VERSION_1); + assert(enc_size == 4); /* Version 1 */ /* Basic number of bytes required to serialize hyperslab selection: * + + + @@ -3852,11 +3852,11 @@ H5S__hyper_serialize_helper(const H5S_hyper_span_info_t *spans, hsize_t *start, FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(spans); - HDassert(start); - HDassert(end); - HDassert(rank < H5S_MAX_RANK); - HDassert(p && pp); + assert(spans); + assert(start); + assert(end); + assert(rank < H5S_MAX_RANK); + assert(p && pp); /* Walk through the list of spans, recursing or outputting them */ curr = spans->head; @@ -3924,7 +3924,7 @@ H5S__hyper_serialize_helper(const H5S_hyper_span_info_t *spans, hsize_t *start, break; default: - HDassert(0 && "Unknown enc size?!?"); + assert(0 && "Unknown enc size?!?"); } /* end switch */ } /* end else */ @@ -3985,10 +3985,10 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(space); - HDassert(p); + assert(space); + assert(p); pp = (*p); - HDassert(pp); + assert(pp); /* Set some convenience values */ ndims = space->extent.rank; @@ -4030,13 +4030,13 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) if (is_regular) { if (version >= H5S_HYPER_VERSION_2) { - HDassert(H5S_UNLIMITED == HSIZE_UNDEF); + assert(H5S_UNLIMITED == HSIZE_UNDEF); /* Iterate over dimensions */ /* Encode start/stride/block/count */ switch (enc_size) { case H5S_SELECT_INFO_ENC_SIZE_2: - HDassert(version == H5S_HYPER_VERSION_3); + assert(version == H5S_HYPER_VERSION_3); for (u = 0; u < space->extent.rank; u++) { UINT16ENCODE(pp, diminfo[u].start); UINT16ENCODE(pp, diminfo[u].stride); @@ -4052,7 +4052,7 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) break; case H5S_SELECT_INFO_ENC_SIZE_4: - HDassert(version == H5S_HYPER_VERSION_3); + assert(version == H5S_HYPER_VERSION_3); for (u = 0; u < space->extent.rank; u++) { UINT32ENCODE(pp, diminfo[u].start); UINT32ENCODE(pp, diminfo[u].stride); @@ -4068,7 +4068,7 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) break; case H5S_SELECT_INFO_ENC_SIZE_8: - HDassert(version == H5S_HYPER_VERSION_2 || version == H5S_HYPER_VERSION_3); + assert(version == H5S_HYPER_VERSION_2 || version == H5S_HYPER_VERSION_3); for (u = 0; u < space->extent.rank; u++) { UINT64ENCODE(pp, diminfo[u].start); UINT64ENCODE(pp, diminfo[u].stride); @@ -4091,7 +4091,7 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) } /* end switch */ } /* end if */ else { - HDassert(version == H5S_HYPER_VERSION_1); + assert(version == H5S_HYPER_VERSION_1); /* Set some convenience values */ fast_dim = ndims - 1; @@ -4172,19 +4172,19 @@ H5S__hyper_serialize(H5S_t *space, uint8_t **p) /* Encode number of hyperslabs */ switch (enc_size) { case H5S_SELECT_INFO_ENC_SIZE_2: - HDassert(version == H5S_HYPER_VERSION_3); + assert(version == H5S_HYPER_VERSION_3); H5_CHECK_OVERFLOW(block_count, hsize_t, uint16_t); UINT16ENCODE(pp, (uint16_t)block_count); break; case H5S_SELECT_INFO_ENC_SIZE_4: - HDassert(version == H5S_HYPER_VERSION_1 || version == H5S_HYPER_VERSION_3); + assert(version == H5S_HYPER_VERSION_1 || version == H5S_HYPER_VERSION_3); H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); UINT32ENCODE(pp, (uint32_t)block_count); break; case H5S_SELECT_INFO_ENC_SIZE_8: - HDassert(version == H5S_HYPER_VERSION_3); + assert(version == H5S_HYPER_VERSION_3); UINT64ENCODE(pp, block_count); break; @@ -4257,9 +4257,9 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hb FUNC_ENTER_PACKAGE /* Check args */ - HDassert(p); + assert(p); pp = (*p); - HDassert(pp); + assert(pp); /* As part of the efforts to push all selection-type specific coding to the callbacks, the coding for the allocation of a null dataspace @@ -4341,8 +4341,8 @@ H5S__hyper_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hb hsize_t count[H5S_MAX_RANK]; /* Hyperslab count information */ /* Sanity checks */ - HDassert(H5S_UNLIMITED == HSIZE_UNDEF); - HDassert(version >= H5S_HYPER_VERSION_2); + assert(H5S_UNLIMITED == HSIZE_UNDEF); + assert(version >= H5S_HYPER_VERSION_2); /* Decode start/stride/block/count */ switch (enc_size) { @@ -4566,13 +4566,13 @@ H5S__hyper_span_blocklist(const H5S_hyper_span_info_t *spans, hsize_t start[], h FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(spans); - HDassert(rank < H5S_MAX_RANK); - HDassert(start); - HDassert(end); - HDassert(startblock); - HDassert(numblocks && *numblocks > 0); - HDassert(buf && *buf); + assert(spans); + assert(rank < H5S_MAX_RANK); + assert(start); + assert(end); + assert(startblock); + assert(numblocks && *numblocks > 0); + assert(buf && *buf); /* Walk through the list of spans, recursing or outputting them */ curr = spans->head; @@ -4663,9 +4663,9 @@ H5S__get_select_hyper_blocklist(H5S_t *space, hsize_t startblock, hsize_t numblo FUNC_ENTER_PACKAGE_NOERR - HDassert(space); - HDassert(buf); - HDassert(space->select.sel_info.hslab->unlim_dim < 0); + assert(space); + assert(buf); + assert(space->select.sel_info.hslab->unlim_dim < 0); /* Attempt to rebuild diminfo if it is invalid and has not been confirmed * to be impossible. @@ -4738,7 +4738,7 @@ H5S__get_select_hyper_blocklist(H5S_t *space, hsize_t startblock, hsize_t numblo /* Iterate over the blocks in the fastest dimension */ while (tmp_count[fast_dim] > 0 && numblocks > 0) { /* Sanity check */ - HDassert(startblock == 0); + assert(startblock == 0); /* Copy the starting location */ H5MM_memcpy(buf, offset, sizeof(hsize_t) * ndims); @@ -4902,9 +4902,9 @@ H5S__hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(space); - HDassert(start); - HDassert(end); + assert(space); + assert(start); + assert(end); /* Check which set of low & high bounds we should be using */ if (space->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_YES) { @@ -4923,7 +4923,7 @@ H5S__hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) /* Loop over dimensions */ for (u = 0; u < space->extent.rank; u++) { /* Sanity check */ - HDassert(low_bounds[u] <= high_bounds[u]); + assert(low_bounds[u] <= high_bounds[u]); /* Check for offset moving selection negative */ if (((hssize_t)low_bounds[u] + space->select.offset[u]) < 0) @@ -4979,8 +4979,8 @@ H5S__hyper_offset(const H5S_t *space, hsize_t *offset) FUNC_ENTER_PACKAGE - HDassert(space && space->extent.rank > 0); - HDassert(offset); + assert(space && space->extent.rank > 0); + assert(offset); /* Start at linear offset 0 */ *offset = 0; @@ -5045,7 +5045,7 @@ H5S__hyper_offset(const H5S_t *space, hsize_t *offset) /* Advance to first span in "down" dimension */ if (span->down) { - HDassert(span->down->head); + assert(span->down->head); span = span->down->head; } /* end if */ else @@ -5112,8 +5112,8 @@ H5S__hyper_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unlim) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(space); - HDassert(num_elem_non_unlim); + assert(space); + assert(num_elem_non_unlim); /* Get number of elements in the non-unlimited dimensions */ if (space->select.sel_info.hslab->unlim_dim >= 0) @@ -5153,7 +5153,7 @@ H5S__hyper_is_contiguous(const H5S_t *space) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); /* Check for a "regular" hyperslab selection */ /* (No need to rebuild the dimension info yet -QAK) */ @@ -5338,7 +5338,7 @@ H5S__hyper_is_single(const H5S_t *space) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); /* Check for a "single" hyperslab selection */ /* (No need to rebuild the dimension info yet, since the span-tree @@ -5412,7 +5412,7 @@ H5S__hyper_is_regular(H5S_t *space) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); + assert(space); /* Attempt to rebuild diminfo if it is invalid and has not been confirmed * to be impossible. @@ -5464,10 +5464,10 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1, FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(span_info1); - HDassert(span_info2); - HDassert(offset); - HDassert(rest_zeros); + assert(span_info1); + assert(span_info2); + assert(offset); + assert(rest_zeros); /* Compare low & high bounds for this span list */ /* (Could compare lower dimensions also, but not certain if @@ -5486,8 +5486,8 @@ H5S__hyper_spans_shape_same_helper(const H5S_hyper_span_info_t *span_info1, span2 = span_info2->head; /* Sanity checking */ - HDassert(span1); - HDassert(span2); + assert(span1); + assert(span2); /* infinite loop which must be broken out of */ while (1) { @@ -5574,9 +5574,9 @@ H5S__hyper_spans_shape_same(const H5S_hyper_span_info_t *span_info1, const H5S_h FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(span_info1); - HDassert(span_info2); - HDassert(ndims > 0); + assert(span_info1); + assert(span_info2); + assert(ndims > 0); /* Initialize arrays */ HDmemset(offset, 0, sizeof(offset)); @@ -5598,7 +5598,7 @@ H5S__hyper_spans_shape_same(const H5S_hyper_span_info_t *span_info1, const H5S_h /* Sanity check */ /* (Both span trees must have the same depth) */ - HDassert((span1->down && span2->down) || (NULL == span1->down && NULL == span2->down)); + assert((span1->down && span2->down) || (NULL == span1->down && NULL == span2->down)); /* Advance to next dimension */ if (span1->down) { @@ -5620,7 +5620,7 @@ H5S__hyper_spans_shape_same(const H5S_hyper_span_info_t *span_info1, const H5S_h /* Sanity check */ /* (Must eventually have found a non-zero offset) */ - HDassert(i >= 0); + assert(i >= 0); } /* end if */ /* If the offset vector is all zero, we can use the faster span tree @@ -5669,16 +5669,16 @@ H5S__hyper_shape_same(H5S_t *space1, H5S_t *space2) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space1); - HDassert(space2); + assert(space1); + assert(space2); /* Get dataspace ranks */ space1_rank = space1->extent.rank; space2_rank = space2->extent.rank; /* Sanity check */ - HDassert(space1_rank >= space2_rank); - HDassert(space2_rank > 0); + assert(space1_rank >= space2_rank); + assert(space2_rank > 0); /* Rebuild diminfo if it is invalid and has not been confirmed to be * impossible */ @@ -5767,7 +5767,7 @@ H5S__hyper_shape_same(H5S_t *space1, H5S_t *space2) } /* end while */ /* Sanity check */ - HDassert(spans1); + assert(spans1); } /* end if */ else spans1 = space1->select.sel_info.hslab->span_lst; @@ -5807,7 +5807,7 @@ H5S__hyper_release(H5S_t *space) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); + assert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); /* Reset the number of points selected */ space->select.num_elem = 0; @@ -5853,8 +5853,8 @@ H5S__hyper_coord_to_span(unsigned rank, const hsize_t *coords) FUNC_ENTER_PACKAGE - HDassert(rank > 0); - HDassert(coords); + assert(rank > 0); + assert(coords); /* Search for location to insert new element in tree */ if (rank > 1) { @@ -5920,10 +5920,10 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(span_tree); - HDassert(rank > 0); - HDassert(coords); - HDassert(first_dim_modified); + assert(span_tree); + assert(rank > 0); + assert(coords); + assert(first_dim_modified); /* Get pointer to last span in span tree */ tail_span = span_tree->tail; @@ -5939,7 +5939,7 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra prev_down_tail_span_high = tail_span->down->tail->high; /* Drop down a dimension */ - HDassert(rank > 1); + assert(rank > 1); if (H5S__hyper_add_span_element_helper(tail_span->down, rank - 1, &coords[1], first_dim_modified) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert coordinate into span tree") @@ -5984,14 +5984,14 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra /* Determine which span to stop at */ if (tail_span->down->tail != prev_down_tail_span) { /* Sanity check */ - HDassert(prev_down_tail_span->next == tail_span->down->tail); + assert(prev_down_tail_span->next == tail_span->down->tail); /* Set the span to stop at */ stop_span = prev_down_tail_span; } /* end if */ else { /* Sanity check */ - HDassert(prev_down_tail_span_high != tail_span->down->tail->high); + assert(prev_down_tail_span_high != tail_span->down->tail->high); /* Set the span to stop at */ stop_span = tail_span->down->tail; @@ -6044,13 +6044,13 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra /* Update pointers appropriately */ if (stop_span == prev_down_tail_span) { /* Sanity check */ - HDassert(stop_span->next == tail_span->down->tail); + assert(stop_span->next == tail_span->down->tail); tmp_span->next = stop_span->next; } /* end if */ else { /* Sanity check */ - HDassert(tmp_span->next == tail_span->down->tail); + assert(tmp_span->next == tail_span->down->tail); tmp_span->next = NULL; tail_span->down->tail = tmp_span; @@ -6106,7 +6106,7 @@ H5S__hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ra } /* end else */ /* Update high bound for current span tree */ - HDassert(coords[0] > span_tree->high_bounds[0]); + assert(coords[0] > span_tree->high_bounds[0]); span_tree->high_bounds[0] = coords[0]; /* Update high bounds for dimensions below this one */ @@ -6168,10 +6168,10 @@ H5S_hyper_add_span_element(H5S_t *space, unsigned rank, const hsize_t *coords) FUNC_ENTER_NOAPI(FAIL) - HDassert(space); - HDassert(rank > 0); - HDassert(coords); - HDassert(space->extent.rank == rank); + assert(space); + assert(rank > 0); + assert(coords); + assert(space->extent.rank == rank); /* Check if this is the first element in the selection */ if (NULL == space->select.sel_info.hslab) { @@ -6264,9 +6264,9 @@ H5S__hyper_intersect_block_helper(H5S_hyper_span_info_t *spans, unsigned rank, c FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(spans); - HDassert(start); - HDassert(end); + assert(spans); + assert(start); + assert(end); /* Check if we've already visited this span tree */ if (spans->op_info[op_info_i].op_gen != op_gen) { @@ -6351,10 +6351,10 @@ H5S__hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *en FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(space); - HDassert(H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); - HDassert(start); - HDassert(end); + assert(space); + assert(H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); + assert(start); + assert(end); /* Attempt to rebuild diminfo if it is invalid and has not been confirmed * to be impossible. @@ -6401,7 +6401,7 @@ H5S__hyper_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *en nstride = 0; /* Sanity check */ - HDassert(nstride <= space->select.sel_info.hslab->diminfo.opt[u].count); + assert(nstride <= space->select.sel_info.hslab->diminfo.opt[u].count); /* "Rebase" the adjusted start coord into the same range * range of values as the selections's first block. @@ -6482,8 +6482,8 @@ H5S__hyper_adjust_u_helper(H5S_hyper_span_info_t *spans, unsigned rank, const hs FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(spans); - HDassert(offset); + assert(spans); + assert(offset); /* Check if we've already set this span tree */ if (spans->op_info[op_info_i].op_gen != op_gen) { @@ -6492,7 +6492,7 @@ H5S__hyper_adjust_u_helper(H5S_hyper_span_info_t *spans, unsigned rank, const hs /* Adjust the span tree's low & high bounds */ for (u = 0; u < rank; u++) { - HDassert(spans->low_bounds[u] >= offset[u]); + assert(spans->low_bounds[u] >= offset[u]); spans->low_bounds[u] -= offset[u]; spans->high_bounds[u] -= offset[u]; } /* end for */ @@ -6501,7 +6501,7 @@ H5S__hyper_adjust_u_helper(H5S_hyper_span_info_t *spans, unsigned rank, const hs span = spans->head; while (span != NULL) { /* Adjust span offset */ - HDassert(span->low >= *offset); + assert(span->low >= *offset); span->low -= *offset; span->high -= *offset; @@ -6547,8 +6547,8 @@ H5S__hyper_adjust_u(H5S_t *space, const hsize_t *offset) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); /* Check for an all-zero offset vector */ for (u = 0; u < space->extent.rank; u++) @@ -6563,11 +6563,11 @@ H5S__hyper_adjust_u(H5S_t *space, const hsize_t *offset) /* (No need to rebuild the dimension info yet -QAK) */ if (space->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_YES) { for (u = 0; u < space->extent.rank; u++) { - HDassert(space->select.sel_info.hslab->diminfo.opt[u].start >= offset[u]); + assert(space->select.sel_info.hslab->diminfo.opt[u].start >= offset[u]); space->select.sel_info.hslab->diminfo.opt[u].start -= offset[u]; /* Adjust the low & high bounds */ - HDassert(space->select.sel_info.hslab->diminfo.low_bounds[u] >= offset[u]); + assert(space->select.sel_info.hslab->diminfo.low_bounds[u] >= offset[u]); space->select.sel_info.hslab->diminfo.low_bounds[u] -= offset[u]; space->select.sel_info.hslab->diminfo.high_bounds[u] -= offset[u]; } /* end for */ @@ -6612,8 +6612,8 @@ H5S__hyper_project_scalar(const H5S_t *space, hsize_t *offset) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); - HDassert(offset); + assert(space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(space)); + assert(offset); /* Check for a "regular" hyperslab selection */ /* (No need to rebuild the dimension info yet -QAK) */ @@ -6625,11 +6625,11 @@ H5S__hyper_project_scalar(const H5S_t *space, hsize_t *offset) /* Build the table of the initial offset */ for (u = 0; u < space->extent.rank; u++) { /* Sanity check diminfo */ - HDassert(1 == diminfo[u].count); - HDassert(1 == diminfo[u].block); + assert(1 == diminfo[u].count); + assert(1 == diminfo[u].block); /* Sanity check bounds, while we're here */ - HDassert(diminfo[u].start == space->select.sel_info.hslab->diminfo.low_bounds[u]); + assert(diminfo[u].start == space->select.sel_info.hslab->diminfo.low_bounds[u]); /* Keep the offset for later */ block[u] = diminfo[u].start; @@ -6644,9 +6644,9 @@ H5S__hyper_project_scalar(const H5S_t *space, hsize_t *offset) curr_dim = 0; while (1) { /* Sanity checks */ - HDassert(NULL == curr->next); - HDassert(curr->low == curr->high); - HDassert(curr_dim < space->extent.rank); + assert(NULL == curr->next); + assert(curr->low == curr->high); + assert(curr_dim < space->extent.rank); /* Save the location of the selection in current dimension */ block[curr_dim] = curr->low; @@ -6690,16 +6690,16 @@ H5S__hyper_project_simple_lower(const H5S_t *base_space, H5S_t *new_space) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); - HDassert(new_space); - HDassert(new_space->extent.rank < base_space->extent.rank); + assert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); + assert(new_space); + assert(new_space->extent.rank < base_space->extent.rank); /* Walk down the span tree until we reach the selection to project */ down = base_space->select.sel_info.hslab->span_lst; curr_dim = 0; while (down && curr_dim < (base_space->extent.rank - new_space->extent.rank)) { /* Sanity check */ - HDassert(NULL == down->head->next); + assert(NULL == down->head->next); /* Advance down to next dimension */ down = down->head->down; @@ -6741,9 +6741,9 @@ H5S__hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); - HDassert(new_space); - HDassert(new_space->extent.rank > base_space->extent.rank); + assert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); + assert(new_space); + assert(new_space->extent.rank > base_space->extent.rank); /* Create nodes until reaching the correct # of dimensions */ new_space->select.sel_info.hslab->span_lst = NULL; @@ -6766,7 +6766,7 @@ H5S__hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space) /* Allocate a new node */ if (NULL == (new_span = H5S__hyper_new_span((hsize_t)0, (hsize_t)0, NULL, NULL))) { - HDassert(new_span_info); + assert(new_span_info); if (!prev_span) (void)H5FL_ARR_FREE(hbounds_t, new_span_info); HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate hyperslab span") @@ -6801,7 +6801,7 @@ H5S__hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space) } /* end while */ if (NULL == new_space->select.sel_info.hslab->span_lst) HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "NULL span list pointer") - HDassert(prev_span); + assert(prev_span); /* Share the underlying hyperslab span information */ prev_span->down = base_space->select.sel_info.hslab->span_lst; @@ -6841,9 +6841,9 @@ H5S__hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *of FUNC_ENTER_PACKAGE /* Check args */ - HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); - HDassert(new_space); - HDassert(offset); + assert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); + assert(new_space); + assert(offset); /* We are setting a new selection, remove any current selection in new dataspace */ if (H5S_SELECT_RELEASE(new_space) < 0) @@ -6880,7 +6880,7 @@ H5S__hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *of new_space_dim = 0; } /* end if */ else { - HDassert(new_space->extent.rank > base_space->extent.rank); + assert(new_space->extent.rank > base_space->extent.rank); /* The offset is zero when projected into higher dimensions */ *offset = 0; @@ -6976,7 +6976,7 @@ H5S__hyper_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *of "can't project hyperslab selection into less dimensions") } /* end if */ else { - HDassert(new_space->extent.rank > base_space->extent.rank); + assert(new_space->extent.rank > base_space->extent.rank); /* The offset is zero when projected into higher dimensions */ *offset = 0; @@ -7029,8 +7029,8 @@ H5S__hyper_adjust_s_helper(H5S_hyper_span_info_t *spans, unsigned rank, const hs FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(spans); - HDassert(offset); + assert(spans); + assert(offset); /* Check if we've already set this span tree */ if (spans->op_info[op_info_i].op_gen != op_gen) { @@ -7039,7 +7039,7 @@ H5S__hyper_adjust_s_helper(H5S_hyper_span_info_t *spans, unsigned rank, const hs /* Adjust the span tree's low & high bounds */ for (u = 0; u < rank; u++) { - HDassert((hssize_t)spans->low_bounds[u] >= offset[u]); + assert((hssize_t)spans->low_bounds[u] >= offset[u]); spans->low_bounds[u] = (hsize_t)((hssize_t)spans->low_bounds[u] - offset[u]); spans->high_bounds[u] = (hsize_t)((hssize_t)spans->high_bounds[u] - offset[u]); } /* end for */ @@ -7048,7 +7048,7 @@ H5S__hyper_adjust_s_helper(H5S_hyper_span_info_t *spans, unsigned rank, const hs span = spans->head; while (span != NULL) { /* Adjust span offset */ - HDassert((hssize_t)span->low >= *offset); + assert((hssize_t)span->low >= *offset); span->low = (hsize_t)((hssize_t)span->low - *offset); span->high = (hsize_t)((hssize_t)span->high - *offset); @@ -7094,8 +7094,8 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); /* Check for an all-zero offset vector */ for (u = 0; u < space->extent.rank; u++) @@ -7110,12 +7110,12 @@ H5S__hyper_adjust_s(H5S_t *space, const hssize_t *offset) /* (No need to rebuild the dimension info yet -QAK) */ if (space->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_YES) { for (u = 0; u < space->extent.rank; u++) { - HDassert((hssize_t)space->select.sel_info.hslab->diminfo.opt[u].start >= offset[u]); + assert((hssize_t)space->select.sel_info.hslab->diminfo.opt[u].start >= offset[u]); space->select.sel_info.hslab->diminfo.opt[u].start = (hsize_t)((hssize_t)space->select.sel_info.hslab->diminfo.opt[u].start - offset[u]); /* Adjust the low & high bounds */ - HDassert((hssize_t)space->select.sel_info.hslab->diminfo.low_bounds[u] >= offset[u]); + assert((hssize_t)space->select.sel_info.hslab->diminfo.low_bounds[u] >= offset[u]); space->select.sel_info.hslab->diminfo.low_bounds[u] = (hsize_t)((hssize_t)space->select.sel_info.hslab->diminfo.low_bounds[u] - offset[u]); space->select.sel_info.hslab->diminfo.high_bounds[u] = @@ -7170,8 +7170,8 @@ H5S_hyper_normalize_offset(H5S_t *space, hssize_t *old_offset) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(space); - HDassert(old_offset); + assert(space); + assert(old_offset); /* Check for hyperslab selection & offset changed */ if (H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS && space->select.offset_changed) { @@ -7227,8 +7227,8 @@ H5S_hyper_denormalize_offset(H5S_t *space, const hssize_t *old_offset) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(space); - HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); + assert(space); + assert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); /* Call the 'adjust' routine */ if (H5S__hyper_adjust_s(space, old_offset) < 0) @@ -7272,7 +7272,7 @@ H5S__hyper_append_span(H5S_hyper_span_info_t **span_tree, unsigned ndims, hsize_ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(span_tree); + assert(span_tree); /* Check for adding first node to merged spans */ if (*span_tree == NULL) { @@ -7296,7 +7296,7 @@ H5S__hyper_append_span(H5S_hyper_span_info_t **span_tree, unsigned ndims, hsize_ (*span_tree)->high_bounds[0] = high; if (down) { /* Sanity check */ - HDassert(ndims > 1); + assert(ndims > 1); H5MM_memcpy(&((*span_tree)->low_bounds[1]), down->low_bounds, sizeof(hsize_t) * (ndims - 1)); H5MM_memcpy(&((*span_tree)->high_bounds[1]), down->high_bounds, sizeof(hsize_t) * (ndims - 1)); @@ -7321,7 +7321,7 @@ H5S__hyper_append_span(H5S_hyper_span_info_t **span_tree, unsigned ndims, hsize_ /* Sanity check */ /* (If down_cmp was set to TRUE above, we won't be in this branch) */ - HDassert(down_cmp != TRUE); + assert(down_cmp != TRUE); /* Check if there is actually a down span */ if (down) { @@ -7346,8 +7346,8 @@ H5S__hyper_append_span(H5S_hyper_span_info_t **span_tree, unsigned ndims, hsize_ /* Update low & high bounds in lower dimensions, if there are any */ if (down) { /* Sanity checks */ - HDassert(ndims > 1); - HDassert(down_cmp >= 0); + assert(ndims > 1); + assert(down_cmp >= 0); /* Check if we are sharing down spans with a previous node */ /* (Only need to check for bounds changing if down spans aren't shared) */ @@ -7432,11 +7432,11 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s FUNC_ENTER_PACKAGE /* Check args */ - HDassert(a_spans); - HDassert(b_spans); - HDassert(a_not_b); - HDassert(a_and_b); - HDassert(b_not_a); + assert(a_spans); + assert(b_spans); + assert(a_not_b); + assert(a_and_b); + assert(b_not_a); /* Set which list(s) to be generated, based on selector */ need_a_not_b = ((selector & H5S_HYPER_COMPUTE_A_NOT_B) != 0); @@ -7540,8 +7540,8 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps between upper part of span 'a' and lower part of span 'b' */ /* Make certain both spans either have a down span or both don't have one */ - HDassert((span_a->down != NULL && span_b->down != NULL) || - (span_a->down == NULL && span_b->down == NULL)); + assert((span_a->down != NULL && span_b->down != NULL) || + (span_a->down == NULL && span_b->down == NULL)); /* If there are no down spans, just add the overlapping area to the a_and_b list */ if (span_a->down == NULL) { @@ -7570,7 +7570,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_not_b list */ if (down_a_not_b) { - HDassert(need_a_not_b == TRUE); + assert(need_a_not_b == TRUE); /* Merge/add overlapped part with/to a_not_b list */ if (H5S__hyper_append_span(a_not_b, ndims, span_b->low, span_a->high, @@ -7585,7 +7585,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_and_b list */ if (down_a_and_b) { - HDassert(need_a_and_b == TRUE); + assert(need_a_and_b == TRUE); /* Merge/add overlapped part with/to a_and_b list */ if (H5S__hyper_append_span(a_and_b, ndims, span_b->low, span_a->high, @@ -7600,7 +7600,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the b_not_a list */ if (down_b_not_a) { - HDassert(need_b_not_a == TRUE); + assert(need_b_not_a == TRUE); /* Merge/add overlapped part with/to b_not_a list */ if (H5S__hyper_append_span(b_not_a, ndims, span_b->low, span_a->high, @@ -7654,8 +7654,8 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps between middle part of span 'a' and span 'b' */ /* Make certain both spans either have a down span or both don't have one */ - HDassert((span_a->down != NULL && span_b->down != NULL) || - (span_a->down == NULL && span_b->down == NULL)); + assert((span_a->down != NULL && span_b->down != NULL) || + (span_a->down == NULL && span_b->down == NULL)); /* If there are no down spans, just add the overlapping area to the a_and_b list */ if (span_a->down == NULL) { @@ -7680,7 +7680,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_not_b list */ if (down_a_not_b) { - HDassert(need_a_not_b == TRUE); + assert(need_a_not_b == TRUE); /* Merge/add overlapped part with/to a_not_b list */ if (H5S__hyper_append_span(a_not_b, ndims, span_b->low, span_b->high, @@ -7695,7 +7695,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_and_b list */ if (down_a_and_b) { - HDassert(need_a_and_b == TRUE); + assert(need_a_and_b == TRUE); /* Merge/add overlapped part with/to a_and_b list */ if (H5S__hyper_append_span(a_and_b, ndims, span_b->low, span_b->high, @@ -7710,7 +7710,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the b_not_a list */ if (down_b_not_a) { - HDassert(need_b_not_a == TRUE); + assert(need_b_not_a == TRUE); /* Merge/add overlapped part with/to b_not_a list */ if (H5S__hyper_append_span(b_not_a, ndims, span_b->low, span_b->high, @@ -7761,8 +7761,8 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps between span 'a' and midle of span 'b' */ /* Make certain both spans either have a down span or both don't have one */ - HDassert((span_a->down != NULL && span_b->down != NULL) || - (span_a->down == NULL && span_b->down == NULL)); + assert((span_a->down != NULL && span_b->down != NULL) || + (span_a->down == NULL && span_b->down == NULL)); /* If there are no down spans, just add the overlapping area to the a_and_b list */ if (span_a->down == NULL) { @@ -7787,7 +7787,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_not_b list */ if (down_a_not_b) { - HDassert(need_a_not_b == TRUE); + assert(need_a_not_b == TRUE); /* Merge/add overlapped part with/to a_not_b list */ if (H5S__hyper_append_span(a_not_b, ndims, span_a->low, span_a->high, @@ -7802,7 +7802,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_and_b list */ if (down_a_and_b) { - HDassert(need_a_and_b == TRUE); + assert(need_a_and_b == TRUE); /* Merge/add overlapped part with/to a_and_b list */ if (H5S__hyper_append_span(a_and_b, ndims, span_a->low, span_a->high, @@ -7817,7 +7817,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the b_not_a list */ if (down_b_not_a) { - HDassert(need_b_not_a == TRUE); + assert(need_b_not_a == TRUE); /* Merge/add overlapped part with/to b_not_a list */ if (H5S__hyper_append_span(b_not_a, ndims, span_a->low, span_a->high, @@ -7878,8 +7878,8 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps between lower part of span 'a' and upper part of span 'b' */ /* Make certain both spans either have a down span or both don't have one */ - HDassert((span_a->down != NULL && span_b->down != NULL) || - (span_a->down == NULL && span_b->down == NULL)); + assert((span_a->down != NULL && span_b->down != NULL) || + (span_a->down == NULL && span_b->down == NULL)); /* If there are no down spans, just add the overlapping area to the a_and_b list */ if (span_a->down == NULL) { @@ -7904,7 +7904,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_not_b list */ if (down_a_not_b) { - HDassert(need_a_not_b == TRUE); + assert(need_a_not_b == TRUE); /* Merge/add overlapped part with/to a_not_b list */ if (H5S__hyper_append_span(a_not_b, ndims, span_a->low, span_b->high, @@ -7919,7 +7919,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the a_and_b list */ if (down_a_and_b) { - HDassert(need_a_and_b == TRUE); + assert(need_a_and_b == TRUE); /* Merge/add overlapped part with/to a_and_b list */ if (H5S__hyper_append_span(a_and_b, ndims, span_a->low, span_b->high, @@ -7934,7 +7934,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for additions to the b_not_a list */ if (down_b_not_a) { - HDassert(need_b_not_a == TRUE); + assert(need_b_not_a == TRUE); /* Merge/add overlapped part with/to b_not_a list */ if (H5S__hyper_append_span(b_not_a, ndims, span_a->low, span_b->high, @@ -8038,7 +8038,7 @@ H5S__hyper_clip_spans(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s } /* end if */ else /* Sanity check */ - HDassert(span_a == NULL && span_b == NULL); + assert(span_a == NULL && span_b == NULL); } /* end else */ } /* end else */ @@ -8078,7 +8078,7 @@ H5S__hyper_merge_spans_helper(H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf FUNC_ENTER_PACKAGE /* Make certain both 'a' & 'b' spans have down span trees or neither does */ - HDassert((a_spans != NULL && b_spans != NULL) || (a_spans == NULL && b_spans == NULL)); + assert((a_spans != NULL && b_spans != NULL) || (a_spans == NULL && b_spans == NULL)); /* Check if the span trees for the 'a' span and the 'b' span are the same */ if (H5S__hyper_cmp_spans(a_spans, b_spans)) { @@ -8411,8 +8411,8 @@ H5S__hyper_merge_spans(H5S_t *space, H5S_hyper_span_info_t *new_spans) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(space); - HDassert(new_spans); + assert(space); + assert(new_spans); /* If this is the first span tree in the hyperslab selection, just use it */ if (space->select.sel_info.hslab->span_lst == NULL) { @@ -8466,7 +8466,7 @@ H5S__hyper_spans_nelem_helper(H5S_hyper_span_info_t *spans, unsigned op_info_i, FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(spans); + assert(spans); /* Check if the span tree was already counted */ if (spans->op_info[op_info_i].op_gen == op_gen) @@ -8536,7 +8536,7 @@ H5S__hyper_spans_nelem(H5S_hyper_span_info_t *spans) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(spans); + assert(spans); /* Acquire an operation generation value for this operation */ op_gen = H5S__hyper_get_op_gen(); @@ -8580,8 +8580,8 @@ H5S__hyper_add_disjoint_spans(H5S_t *space, H5S_hyper_span_info_t *new_spans) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); - HDassert(new_spans); + assert(space); + assert(new_spans); /* Update the number of elements in the selection */ space->select.num_elem += H5S__hyper_spans_nelem(new_spans); @@ -8636,11 +8636,11 @@ H5S__hyper_make_spans(unsigned rank, const hsize_t *start, const hsize_t *stride FUNC_ENTER_PACKAGE /* Check args */ - HDassert(rank > 0); - HDassert(start); - HDassert(stride); - HDassert(count); - HDassert(block); + assert(rank > 0); + assert(start); + assert(stride); + assert(count); + assert(block); /* Start creating spans in fastest changing dimension */ for (i = (int)(rank - 1); i >= 0; i--) { @@ -8784,8 +8784,8 @@ H5S__hyper_update_diminfo(H5S_t *space, H5S_seloper_t op, const H5S_hyper_dim_t FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); - HDassert(new_hyper_diminfo); + assert(space); + assert(new_hyper_diminfo); /* Check for conditions that prevent us from using the fast algorithm here */ /* (and instead require H5S__hyper_rebuild) */ @@ -8940,13 +8940,13 @@ H5S__hyper_update_diminfo(H5S_t *space, H5S_seloper_t op, const H5S_hyper_dim_t /* Set the new diminfo values */ space->select.sel_info.hslab->diminfo.app[curr_dim].start = space->select.sel_info.hslab->diminfo.opt[curr_dim].start = tmp_diminfo[curr_dim].start; - HDassert(tmp_diminfo[curr_dim].stride > 0); + assert(tmp_diminfo[curr_dim].stride > 0); space->select.sel_info.hslab->diminfo.app[curr_dim].stride = space->select.sel_info.hslab->diminfo.opt[curr_dim].stride = tmp_diminfo[curr_dim].stride; - HDassert(tmp_diminfo[curr_dim].count > 0); + assert(tmp_diminfo[curr_dim].count > 0); space->select.sel_info.hslab->diminfo.app[curr_dim].count = space->select.sel_info.hslab->diminfo.opt[curr_dim].count = tmp_diminfo[curr_dim].count; - HDassert(tmp_diminfo[curr_dim].block > 0); + assert(tmp_diminfo[curr_dim].block > 0); space->select.sel_info.hslab->diminfo.app[curr_dim].block = space->select.sel_info.hslab->diminfo.opt[curr_dim].block = tmp_diminfo[curr_dim].block; @@ -9001,7 +9001,7 @@ H5S__hyper_rebuild_helper(const H5S_hyper_span_info_t *spans, H5S_hyper_dim_t sp FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(spans); + assert(spans); /* Initialization */ span = spans->head; @@ -9027,7 +9027,7 @@ H5S__hyper_rebuild_helper(const H5S_hyper_span_info_t *spans, H5S_hyper_dim_t sp hsize_t curr_block; /* Block size of current span */ /* Sanity check */ - HDassert(prev_span); + assert(prev_span); /* Check that down spans match current slab info */ /* (Can skip check if previous span's down pointer is same as current one) */ @@ -9100,8 +9100,8 @@ H5S__hyper_rebuild(H5S_t *space) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); - HDassert(space->select.sel_info.hslab->span_lst); + assert(space); + assert(space->select.sel_info.hslab->span_lst); /* Check whether the slab can be rebuilt */ /* (Only regular selection can be rebuilt. If yes, fill in correct values) */ @@ -9153,8 +9153,8 @@ H5S__hyper_generate_spans(H5S_t *space) FUNC_ENTER_PACKAGE - HDassert(space); - HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); + assert(space); + assert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); /* Get the diminfo */ for (u = 0; u < space->extent.rank; u++) { @@ -9207,8 +9207,8 @@ H5S__check_spans_overlap(const H5S_hyper_span_info_t *spans1, const H5S_hyper_sp FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(spans1); - HDassert(spans2); + assert(spans1); + assert(spans2); /* Use low & high bounds to try to avoid spinning through the span lists */ if (H5S_RANGE_OVERLAP(spans1->low_bounds[0], spans1->high_bounds[0], spans2->low_bounds[0], @@ -9224,7 +9224,7 @@ H5S__check_spans_overlap(const H5S_hyper_span_info_t *spans1, const H5S_hyper_sp /* Check for spans in lowest dimension already */ if (span1->down) { /* Sanity check */ - HDassert(span2->down); + assert(span2->down); /* Check lower dimensions for overlap */ if (H5S__check_spans_overlap(span1->down, span2->down)) @@ -9252,8 +9252,8 @@ H5S__check_spans_overlap(const H5S_hyper_span_info_t *spans1, const H5S_hyper_sp } /* end while */ /* Make certain we've exhausted our comparisons */ - HDassert((NULL == span1 && (NULL != span2 && NULL == span2->next)) || - ((NULL != span1 && NULL == span1->next) && NULL == span2)); + assert((NULL == span1 && (NULL != span2 && NULL == span2->next)) || + ((NULL != span1 && NULL == span1->next) && NULL == span2)); } /* end of */ done: @@ -9304,13 +9304,13 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s FUNC_ENTER_PACKAGE - HDassert(space1); - HDassert(space2_span_lst); - HDassert(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA); + assert(space1); + assert(space2_span_lst); + assert(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA); /* The result is either a to-be-created space or an empty one */ - HDassert(*result == NULL || *result == space1); - HDassert(space1->select.sel_info.hslab->span_lst); - HDassert(span2_owned); + assert(*result == NULL || *result == space1); + assert(space1->select.sel_info.hslab->span_lst); + assert(span2_owned); /* Reset flags to return */ *span2_owned = FALSE; @@ -9373,7 +9373,7 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s case H5S_SELECT_NOTA: if (!is_result_new) { - HDassert(space1 == *result); + assert(space1 == *result); /* Free the current selection */ if (H5S__hyper_free_span_info(space1->select.sel_info.hslab->span_lst) < 0) @@ -9456,7 +9456,7 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s case H5S_SELECT_NOTB: case H5S_SELECT_NOTA: if (!is_result_new) { - HDassert(space1 == *result); + assert(space1 == *result); /* Free the current selection */ if (H5S__hyper_free_span_info(space1->select.sel_info.hslab->span_lst) < 0) @@ -9483,7 +9483,7 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s /* Other than OR, the span_lst is set to NULL. And in OR, * a_not_b is not needed */ - HDassert(NULL == (*result)->select.sel_info.hslab->span_lst); + assert(NULL == (*result)->select.sel_info.hslab->span_lst); /* The results dataspace takes ownership of the spans */ /* (Since it must be NULL) */ @@ -9506,7 +9506,7 @@ H5S__fill_in_new_space(H5S_t *space1, H5S_seloper_t op, H5S_hyper_span_info_t *s * 2. a_not_b will never be computed together with a_and_b * because merging these two equals to a. */ - HDassert(NULL == (*result)->select.sel_info.hslab->span_lst); + assert(NULL == (*result)->select.sel_info.hslab->span_lst); /* The results dataspace takes ownership of the spans */ /* (Since it must be NULL) */ @@ -9589,12 +9589,12 @@ H5S__generate_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], c FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); - HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); - HDassert(start); - HDassert(stride); - HDassert(count); - HDassert(block); + assert(space); + assert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); + assert(start); + assert(stride); + assert(count); + assert(block); /* Generate span tree for new hyperslab information */ if (NULL == (new_spans = H5S__hyper_make_spans(space->extent.rank, start, stride, count, block))) @@ -9630,7 +9630,7 @@ H5S__generate_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], c unsigned u; /* Local index variable */ /* Sanity check */ - HDassert(space->select.sel_info.hslab->span_lst->head); + assert(space->select.sel_info.hslab->span_lst->head); /* Build diminfo struct */ for (u = 0; u < space->extent.rank; u++) { @@ -9681,14 +9681,14 @@ H5S__set_regular_hyperslab(H5S_t *space, const hsize_t start[], const hsize_t *a FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); - HDassert(start); - HDassert(app_stride); - HDassert(app_count); - HDassert(app_block); - HDassert(opt_stride); - HDassert(opt_count); - HDassert(opt_block); + assert(space); + assert(start); + assert(app_stride); + assert(app_count); + assert(app_block); + assert(opt_stride); + assert(opt_count); + assert(opt_block); /* If we are setting a new selection, remove current selection first */ if (H5S_SELECT_RELEASE(space) < 0) @@ -9782,9 +9782,9 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); - HDassert(start); - HDassert(block); + assert(space); + assert(start); + assert(block); /* Check for single block selection in dataspace */ single_block = TRUE; @@ -9940,7 +9940,7 @@ H5S__hyper_regular_and_single_block(H5S_t *space, const hsize_t start[], const h } /* end if */ /* Sanity check */ - HDassert(first_span_start <= last_span_start); + assert(first_span_start <= last_span_start); /* Compute new start / count / block values */ new_start[u] = first_span_start; @@ -10015,10 +10015,10 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(space); - HDassert(start); - HDassert(count); - HDassert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); + assert(space); + assert(start); + assert(count); + assert(op > H5S_SELECT_NOOP && op < H5S_SELECT_INVALID); /* Point to the correct stride values */ if (stride == NULL) @@ -10099,8 +10099,8 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons if (count[u] == 1) int_stride[u] = 1; else { - HDassert((stride[u] > block[u]) || - ((stride[u] == block[u]) && (count[u] == H5S_UNLIMITED))); + assert((stride[u] > block[u]) || + ((stride[u] == block[u]) && (count[u] == H5S_UNLIMITED))); int_stride[u] = stride[u]; } /* end else */ int_count[u] = count[u]; @@ -10118,7 +10118,7 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons "cannot modify unlimited selection with another unlimited selection") if (!((op == H5S_SELECT_AND) || (op == H5S_SELECT_NOTA))) HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "unsupported operation on unlimited selection") - HDassert(space->select.sel_info.hslab->diminfo_valid); + assert(space->select.sel_info.hslab->diminfo_valid); /* Clip unlimited selection to include new selection */ if (H5S_hyper_clip_unlim(space, @@ -10129,7 +10129,7 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "failed to clip unlimited selection") /* If an empty space was returned it must be "none" */ - HDassert((space->select.num_elem > (hsize_t)0) || (space->select.type->type == H5S_SEL_NONE)); + assert((space->select.num_elem > (hsize_t)0) || (space->select.type->type == H5S_SEL_NONE)); } /* end if */ /* Fixup operation for non-hyperslab selections */ @@ -10235,7 +10235,7 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons hbool_t single_block; /* Whether the selection is a single block */ /* Sanity check */ - HDassert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); + assert(H5S_GET_SELECT_TYPE(space) == H5S_SEL_HYPERSLABS); /* Handle unlimited selections */ if (unlim_dim >= 0) { @@ -10261,14 +10261,14 @@ H5S_select_hyperslab(H5S_t *space, H5S_seloper_t op, const hsize_t start[], cons */ H5S__hyper_get_clip_diminfo(start[unlim_dim], opt_stride[unlim_dim], &tmp_count, &tmp_block, bounds_end[unlim_dim] + (hsize_t)1); - HDassert((tmp_count == 1) || (opt_count != H5S_hyper_ones_g)); - HDassert((tmp_block == 1) || (opt_block != H5S_hyper_ones_g)); + assert((tmp_count == 1) || (opt_count != H5S_hyper_ones_g)); + assert((tmp_block == 1) || (opt_block != H5S_hyper_ones_g)); if (opt_count != H5S_hyper_ones_g) { - HDassert(opt_count == int_count); + assert(opt_count == int_count); int_count[unlim_dim] = tmp_count; } /* end if */ if (opt_block != H5S_hyper_ones_g) { - HDassert(opt_block == int_block); + assert(opt_block == int_block); int_block[unlim_dim] = tmp_block; } /* end if */ } /* end if */ @@ -10414,12 +10414,12 @@ H5S_combine_hyperslab(const H5S_t *old_space, H5S_seloper_t op, const hsize_t st FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(old_space); - HDassert(start); - HDassert(count); - HDassert(op >= H5S_SELECT_SET && op <= H5S_SELECT_NOTA); - HDassert(new_space); - HDassert(*new_space == NULL); + assert(old_space); + assert(start); + assert(count); + assert(op >= H5S_SELECT_SET && op <= H5S_SELECT_NOTA); + assert(new_space); + assert(*new_space == NULL); /* Point to the correct stride values */ if (stride == NULL) @@ -10604,14 +10604,14 @@ H5S__fill_in_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2, H5S_t **resu FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(space1); - HDassert(space2); - HDassert(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA); - HDassert(space1->extent.rank == space2->extent.rank); + assert(space1); + assert(space2); + assert(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA); + assert(space1->extent.rank == space2->extent.rank); /* The result is either a to-be-created space or an empty one */ - HDassert(NULL == *result || *result == space1); - HDassert(space1->select.sel_info.hslab->span_lst); - HDassert(space2->select.sel_info.hslab->span_lst); + assert(NULL == *result || *result == space1); + assert(space1->select.sel_info.hslab->span_lst); + assert(space2->select.sel_info.hslab->span_lst); /* Note: the offset of space2 is not considered here for bounding box */ if (H5S__fill_in_new_space(space1, op, space2->select.sel_info.hslab->span_lst, FALSE, &span2_owned, @@ -10620,7 +10620,7 @@ H5S__fill_in_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2, H5S_t **resu /* Update diminfo if space2's diminfo was valid, otherwise just mark it as * invalid if the spans were updated */ - HDassert(result); + assert(result); if (updated_spans) { if (space2->select.sel_info.hslab->diminfo_valid == H5S_DIMINFO_VALID_YES) { if (H5S__hyper_update_diminfo(*result, op, space2->select.sel_info.hslab->diminfo.opt) < 0) @@ -10718,9 +10718,9 @@ H5S__combine_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space1); - HDassert(space2); - HDassert(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA); + assert(space1); + assert(space2); + assert(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA); /* Check if space1 selections has span trees */ if (NULL == space1->select.sel_info.hslab->span_lst) @@ -10859,9 +10859,9 @@ H5S__modify_select(H5S_t *space1, H5S_seloper_t op, H5S_t *space2) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space1); - HDassert(space2); - HDassert(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA); + assert(space1); + assert(space2); + assert(op >= H5S_SELECT_OR && op <= H5S_SELECT_NOTA); /* Check that the space selections both have span trees */ if (NULL == space1->select.sel_info.hslab->span_lst) @@ -11009,14 +11009,14 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) FUNC_ENTER_PACKAGE - HDassert(udata->nelem > 0); + assert(udata->nelem > 0); /* * Skip over skipped elements */ if (udata->skip > 0) { /* Work upwards, finishing each span tree before moving up */ - HDassert(udata->ds_span[udata->depth]); + assert(udata->ds_span[udata->depth]); do { /* Check for lowest dimension */ if (udata->ds_span[udata->depth]->down) { @@ -11039,11 +11039,11 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) } /* end if */ } /* end if */ else { - HDassert(udata->ds_rank - udata->depth == 1); + assert(udata->ds_rank - udata->depth == 1); /* If we will run out of elements to skip in this span, * skip the remainder of the skipped elements and break out */ - HDassert(udata->ds_low[udata->depth] <= udata->ds_span[udata->depth]->high); + assert(udata->ds_low[udata->depth] <= udata->ds_span[udata->depth]->high); if (udata->skip < (udata->ds_span[udata->depth]->high - udata->ds_low[udata->depth] + 1)) { udata->ds_low[udata->depth] += udata->skip; udata->skip = 0; @@ -11074,7 +11074,7 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) /* Ran out of spans, move up one dimension */ udata->depth--; - HDassert(udata->ds_span[udata->depth]); + assert(udata->ds_span[udata->depth]); udata->ds_low[udata->depth]++; } else @@ -11083,9 +11083,9 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) } while ((udata->skip > 0) || (udata->ds_low[udata->depth] > udata->ds_span[udata->depth]->high)); /* Work downwards until skip is 0 */ - HDassert(udata->ds_span[udata->depth]); + assert(udata->ds_span[udata->depth]); while (udata->skip > 0) { - HDassert(udata->ds_span[udata->depth]->down); + assert(udata->ds_span[udata->depth]->down); udata->depth++; udata->ds_span[udata->depth] = udata->ds_span[udata->depth - 1]->down->head; udata->ds_low[udata->depth] = udata->ds_span[udata->depth]->low; @@ -11109,7 +11109,7 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) /* Advance to next span */ udata->ds_span[udata->depth] = udata->ds_span[udata->depth]->next; - HDassert(udata->ds_span[udata->depth]); + assert(udata->ds_span[udata->depth]); udata->ds_low[udata->depth] = udata->ds_span[udata->depth]->low; } while (udata->skip > 0); } /* end if */ @@ -11129,7 +11129,7 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) /* Advance to next span */ udata->ds_span[udata->depth] = udata->ds_span[udata->depth]->next; - HDassert(udata->ds_span[udata->depth]); + assert(udata->ds_span[udata->depth]); udata->ds_low[udata->depth] = udata->ds_span[udata->depth]->low; } while (udata->skip > 0); } /* end else */ @@ -11141,7 +11141,7 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) */ /* Work upwards, adding all elements of each span tree until it can't fit * all elements */ - HDassert(udata->ds_span[udata->depth]); + assert(udata->ds_span[udata->depth]); do { /* Check for lowest dimension */ if (udata->ds_span[udata->depth]->down) { @@ -11224,11 +11224,11 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) } /* end if */ } /* end if */ else { - HDassert(udata->ds_rank - udata->depth == 1); + assert(udata->ds_rank - udata->depth == 1); /* If we will run out of elements to add in this span, add the * remainder of the elements and break out */ - HDassert(udata->ds_low[udata->depth] <= udata->ds_span[udata->depth]->high); + assert(udata->ds_low[udata->depth] <= udata->ds_span[udata->depth]->high); if (udata->nelem < (udata->ds_span[udata->depth]->high - udata->ds_low[udata->depth] + 1)) { if (H5S__hyper_append_span(&udata->ps_span_info[udata->depth], 1, udata->ds_low[udata->depth], udata->ds_low[udata->depth] + udata->nelem - 1, NULL) < 0) @@ -11252,7 +11252,7 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) else if (udata->depth > 0) { /* Append this span tree to the higher dimension's, and release * ownership of it */ - HDassert(udata->ps_span_info[udata->depth]); + assert(udata->ps_span_info[udata->depth]); if (H5S__hyper_append_span(&udata->ps_span_info[udata->depth - 1], udata->ds_rank - udata->depth + 1, udata->ds_low[udata->depth - 1], udata->ds_low[udata->depth - 1], @@ -11264,7 +11264,7 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) /* Ran out of spans, move up one dimension */ udata->depth--; - HDassert(udata->ds_span[udata->depth]); + assert(udata->ds_span[udata->depth]); udata->ds_low[udata->depth]++; } /* end if */ else { @@ -11278,9 +11278,9 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) } while ((udata->nelem > 0) || (udata->ds_low[udata->depth] > udata->ds_span[udata->depth]->high)); /* Work downwards until nelem is 0 */ - HDassert(udata->ds_span[udata->depth] || (udata->nelem == 0)); + assert(udata->ds_span[udata->depth] || (udata->nelem == 0)); while (udata->nelem > 0) { - HDassert(udata->ds_span[udata->depth]->down); + assert(udata->ds_span[udata->depth]->down); udata->depth++; udata->ds_span[udata->depth] = udata->ds_span[udata->depth - 1]->down->head; udata->ds_low[udata->depth] = udata->ds_span[udata->depth]->low; @@ -11290,7 +11290,7 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) * any complete spans, advance to the first not fully added * span and continue down */ - HDassert(udata->ds_low[udata->depth] <= udata->ds_span[udata->depth]->high); + assert(udata->ds_low[udata->depth] <= udata->ds_span[udata->depth]->high); if (udata->nelem < H5S__hyper_spans_nelem_helper(udata->ds_span[udata->depth]->down, 0, udata->op_gen) * (udata->ds_span[udata->depth]->high - udata->ds_low[udata->depth] + 1)) { @@ -11365,16 +11365,16 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) /* Advance to next span */ udata->ds_span[udata->depth] = udata->ds_span[udata->depth]->next; - HDassert(udata->ds_span[udata->depth]); + assert(udata->ds_span[udata->depth]); udata->ds_low[udata->depth] = udata->ds_span[udata->depth]->low; } while (udata->nelem > 0); } /* end if */ else { - HDassert(udata->ds_rank - udata->depth == 1); + assert(udata->ds_rank - udata->depth == 1); do { /* If we will run out of elements to add in this span, add * the remainder of the elements and break out */ - HDassert(udata->ds_low[udata->depth] <= udata->ds_span[udata->depth]->high); + assert(udata->ds_low[udata->depth] <= udata->ds_span[udata->depth]->high); if (udata->nelem < (udata->ds_span[udata->depth]->high - udata->ds_low[udata->depth] + 1)) { if (H5S__hyper_append_span(&udata->ps_span_info[udata->depth], 1, udata->ds_low[udata->depth], @@ -11393,14 +11393,14 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) /* Advance to next span */ udata->ds_span[udata->depth] = udata->ds_span[udata->depth]->next; - HDassert(udata->ds_span[udata->depth]); + assert(udata->ds_span[udata->depth]); udata->ds_low[udata->depth] = udata->ds_span[udata->depth]->low; } while (udata->nelem > 0); } /* end else */ } /* end while */ - HDassert(udata->skip == 0); - HDassert(udata->nelem == 0); + assert(udata->skip == 0); + assert(udata->nelem == 0); /* Mark projected space as changed (for all ranks) */ udata->ps_clean_bitmap = 0; @@ -11408,7 +11408,7 @@ H5S__hyper_proj_int_build_proj(H5S_hyper_project_intersect_ud_t *udata) done: /* Cleanup on failure */ if (copied_span_info) { - HDassert(ret_value < 0); + assert(ret_value < 0); if (H5S__hyper_free_span_info(copied_span_info) < 0) HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "unable to free span info") copied_span_info = NULL; @@ -11485,7 +11485,7 @@ H5S__hyper_proj_int_iterate(H5S_hyper_span_info_t *ss_span_info, const H5S_hyper for (u = 0; u < count; u++) { ss_span = ss_span_info->head; sis_span = sis_span_info->head; - HDassert(ss_span && sis_span); + assert(ss_span && sis_span); ss_low = ss_span->low; sis_low = sis_span->low; @@ -11514,7 +11514,7 @@ H5S__hyper_proj_int_iterate(H5S_hyper_span_info_t *ss_span_info, const H5S_hyper "can't iterate over source selections") } /* end if */ else { - HDassert(depth == udata->ss_rank - 1); + assert(depth == udata->ss_rank - 1); /* Add skipped elements if there's a pre-gap */ if (ss_low < sis_low) { @@ -11540,7 +11540,7 @@ H5S__hyper_proj_int_iterate(H5S_hyper_span_info_t *ss_span_info, const H5S_hyper } /* end if */ else if (ss_span->high == high) { /* Advance source span */ - HDassert(ss_span->high < sis_span->high); + assert(ss_span->high < sis_span->high); sis_low = high + 1; ss_span = ss_span->next; if (ss_span) @@ -11548,7 +11548,7 @@ H5S__hyper_proj_int_iterate(H5S_hyper_span_info_t *ss_span_info, const H5S_hyper } /* end if */ else { /* Advance source intersect span */ - HDassert(ss_span->high > sis_span->high); + assert(ss_span->high > sis_span->high); ss_low = high + 1; sis_span = sis_span->next; if (sis_span) @@ -11575,7 +11575,7 @@ H5S__hyper_proj_int_iterate(H5S_hyper_span_info_t *ss_span_info, const H5S_hyper } /* end if */ else { /* Advance source intersect span */ - HDassert(ss_low > sis_span->high); + assert(ss_low > sis_span->high); sis_span = sis_span->next; if (sis_span) sis_low = sis_span->low; @@ -11615,18 +11615,18 @@ H5S__hyper_proj_int_iterate(H5S_hyper_span_info_t *ss_span_info, const H5S_hyper * first iteration of the loop, if so we do not need to continue * looping and can just copy the result */ if (udata->ps_clean_bitmap & (((uint32_t)1) << depth)) { - HDassert(u == 0); + assert(u == 0); if (udata->skip == old_skip) { /* First case: algorithm added only elements */ - HDassert(udata->nelem >= old_nelem); + assert(udata->nelem >= old_nelem); udata->nelem += (count - 1) * (udata->nelem - old_nelem); } /* end if */ else if (udata->nelem == 0) { /* Second case: algorithm added only skip. In this case, * nelem must be 0 since otherwise adding skip would have * triggered a change in the projected space */ - HDassert(old_nelem == 0); - HDassert(udata->skip > old_skip); + assert(old_nelem == 0); + assert(udata->skip > old_skip); udata->skip += (count - 1) * (udata->skip - old_skip); } /* end if */ else { @@ -11636,9 +11636,9 @@ H5S__hyper_proj_int_iterate(H5S_hyper_span_info_t *ss_span_info, const H5S_hyper hsize_t skip_add; hsize_t nelem_add; - HDassert(udata->nelem > 0); - HDassert(udata->skip > old_skip); - HDassert(old_nelem == 0); + assert(udata->nelem > 0); + assert(udata->skip > old_skip); + assert(old_nelem == 0); skip_add = udata->skip - old_skip; nelem_add = udata->nelem - old_nelem; @@ -11720,18 +11720,18 @@ H5S__hyper_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i FUNC_ENTER_PACKAGE /* Check parameters */ - HDassert(src_space); - HDassert(dst_space); - HDassert(src_intersect_space); - HDassert(proj_space); + assert(src_space); + assert(dst_space); + assert(src_intersect_space); + assert(proj_space); /* Assert that src_space and src_intersect_space have same rank and there * are no point selections */ - HDassert(H5S_GET_EXTENT_NDIMS(src_space) == H5S_GET_EXTENT_NDIMS(src_intersect_space)); - HDassert(H5S_GET_SELECT_NPOINTS(src_space) == H5S_GET_SELECT_NPOINTS(dst_space)); - HDassert(H5S_GET_SELECT_TYPE(src_space) != H5S_SEL_POINTS); - HDassert(H5S_GET_SELECT_TYPE(dst_space) != H5S_SEL_POINTS); - HDassert(H5S_GET_SELECT_TYPE(src_intersect_space) == H5S_SEL_HYPERSLABS); + assert(H5S_GET_EXTENT_NDIMS(src_space) == H5S_GET_EXTENT_NDIMS(src_intersect_space)); + assert(H5S_GET_SELECT_NPOINTS(src_space) == H5S_GET_SELECT_NPOINTS(dst_space)); + assert(H5S_GET_SELECT_TYPE(src_space) != H5S_SEL_POINTS); + assert(H5S_GET_SELECT_TYPE(dst_space) != H5S_SEL_POINTS); + assert(H5S_GET_SELECT_TYPE(src_intersect_space) == H5S_SEL_HYPERSLABS); /* Set up ss_span_info */ if (H5S_GET_SELECT_TYPE(src_space) == H5S_SEL_HYPERSLABS) { @@ -11746,7 +11746,7 @@ H5S__hyper_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i } /* end if */ else { /* Create temporary span tree from all selection */ - HDassert(H5S_GET_SELECT_TYPE(src_space) == H5S_SEL_ALL); + assert(H5S_GET_SELECT_TYPE(src_space) == H5S_SEL_ALL); if (NULL == (ss_span_info_buf = H5S__hyper_make_spans(H5S_GET_EXTENT_NDIMS(src_space), H5S_hyper_zeros_g, @@ -11768,7 +11768,7 @@ H5S__hyper_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i } /* end if */ else { /* Create temporary span tree from all selection */ - HDassert(H5S_GET_SELECT_TYPE(dst_space) == H5S_SEL_ALL); + assert(H5S_GET_SELECT_TYPE(dst_space) == H5S_SEL_ALL); if (NULL == (ds_span_info_buf = H5S__hyper_make_spans(H5S_GET_EXTENT_NDIMS(dst_space), H5S_hyper_zeros_g, @@ -11866,7 +11866,7 @@ done: unsigned u; for (u = 0; u < H5S_MAX_RANK; u++) - HDassert(!udata.ps_span_info[u]); + assert(!udata.ps_span_info[u]); } #endif /* NDEBUG */ @@ -11916,11 +11916,11 @@ H5S__hyper_get_clip_diminfo(hsize_t start, hsize_t stride, hsize_t *count, hsize *count = (hsize_t)1; } /* end if */ else { - HDassert(*count == H5S_UNLIMITED); + assert(*count == H5S_UNLIMITED); /* Calculate initial count (last block may be partial) */ *count = (clip_size - start + stride - (hsize_t)1) / stride; - HDassert(*count > (hsize_t)0); + assert(*count > (hsize_t)0); } /* end else */ FUNC_LEAVE_NOAPI_VOID @@ -11959,11 +11959,11 @@ H5S_hyper_clip_unlim(H5S_t *space, hsize_t clip_size) FUNC_ENTER_NOAPI(FAIL) /* Check parameters */ - HDassert(space); + assert(space); hslab = space->select.sel_info.hslab; - HDassert(hslab); - HDassert(hslab->unlim_dim >= 0); - HDassert(!hslab->span_lst); + assert(hslab); + assert(hslab->unlim_dim >= 0); + assert(!hslab->span_lst); /* Save original unlimited dimension */ orig_unlim_dim = hslab->unlim_dim; @@ -12004,7 +12004,7 @@ H5S_hyper_clip_unlim(H5S_t *space, hsize_t clip_size) /* Check if last block is partial. If superset is set, just keep the * last block complete to speed computation. */ - HDassert(clip_size > diminfo->start); + assert(clip_size > diminfo->start); if (((diminfo->stride * (diminfo->count - (hsize_t)1)) + diminfo->block) > (clip_size - diminfo->start)) { hsize_t start[H5S_MAX_RANK]; @@ -12090,9 +12090,9 @@ H5S__hyper_get_clip_extent_real(const H5S_t *clip_space, hsize_t num_slices, hbo FUNC_ENTER_PACKAGE_NOERR /* Check parameters */ - HDassert(clip_space); - HDassert(clip_space->select.sel_info.hslab); - HDassert(clip_space->select.sel_info.hslab->unlim_dim >= 0); + assert(clip_space); + assert(clip_space->select.sel_info.hslab); + assert(clip_space->select.sel_info.hslab->unlim_dim >= 0); diminfo = &clip_space->select.sel_info.hslab->diminfo.opt[clip_space->select.sel_info.hslab->unlim_dim]; @@ -12105,7 +12105,7 @@ H5S__hyper_get_clip_extent_real(const H5S_t *clip_space, hsize_t num_slices, hbo else { /* Unlimited count, need to match extent so a block (possibly) gets cut * off so the number of slices matches num_slices */ - HDassert(diminfo->count == H5S_UNLIMITED); + assert(diminfo->count == H5S_UNLIMITED); /* Calculate number of complete blocks in clip_space */ count = num_slices / diminfo->block; @@ -12157,20 +12157,20 @@ H5S_hyper_get_clip_extent(const H5S_t *clip_space, const H5S_t *match_space, hbo FUNC_ENTER_NOAPI_NOERR /* Check parameters */ - HDassert(clip_space); - HDassert(match_space); - HDassert(clip_space->select.sel_info.hslab->unlim_dim >= 0); + assert(clip_space); + assert(match_space); + assert(clip_space->select.sel_info.hslab->unlim_dim >= 0); /* Check for "none" match space */ if (match_space->select.type->type == H5S_SEL_NONE) num_slices = (hsize_t)0; else { - HDassert(match_space->select.type->type == H5S_SEL_HYPERSLABS); - HDassert(match_space->select.sel_info.hslab); + assert(match_space->select.type->type == H5S_SEL_HYPERSLABS); + assert(match_space->select.sel_info.hslab); /* Calculate number of slices */ num_slices = match_space->select.num_elem / clip_space->select.sel_info.hslab->num_elem_non_unlim; - HDassert((match_space->select.num_elem % clip_space->select.sel_info.hslab->num_elem_non_unlim) == 0); + assert((match_space->select.num_elem % clip_space->select.sel_info.hslab->num_elem_non_unlim) == 0); } /* end else */ /* Call "real" get_clip_extent function */ @@ -12214,14 +12214,14 @@ H5S_hyper_get_clip_extent_match(const H5S_t *clip_space, const H5S_t *match_spac FUNC_ENTER_NOAPI_NOERR /* Check parameters */ - HDassert(clip_space); - HDassert(match_space); - HDassert(clip_space->select.sel_info.hslab); - HDassert(match_space->select.sel_info.hslab); - HDassert(clip_space->select.sel_info.hslab->unlim_dim >= 0); - HDassert(match_space->select.sel_info.hslab->unlim_dim >= 0); - HDassert(clip_space->select.sel_info.hslab->num_elem_non_unlim == - match_space->select.sel_info.hslab->num_elem_non_unlim); + assert(clip_space); + assert(match_space); + assert(clip_space->select.sel_info.hslab); + assert(match_space->select.sel_info.hslab); + assert(clip_space->select.sel_info.hslab->unlim_dim >= 0); + assert(match_space->select.sel_info.hslab->unlim_dim >= 0); + assert(clip_space->select.sel_info.hslab->num_elem_non_unlim == + match_space->select.sel_info.hslab->num_elem_non_unlim); match_diminfo = &match_space->select.sel_info.hslab->diminfo.opt[match_space->select.sel_info.hslab->unlim_dim]; @@ -12243,12 +12243,12 @@ H5S_hyper_get_clip_extent_match(const H5S_t *clip_space, const H5S_t *match_spac num_slices = block * count; /* Check for partial last block */ - HDassert(match_clip_size >= match_diminfo->start); + assert(match_clip_size >= match_diminfo->start); if (((match_diminfo->stride * (count - (hsize_t)1)) + block) > (match_clip_size - match_diminfo->start)) { /* Subtract slices missing from last block */ - HDassert((((match_diminfo->stride * (count - (hsize_t)1)) + block) - - (match_clip_size - match_diminfo->start)) < num_slices); + assert((((match_diminfo->stride * (count - (hsize_t)1)) + block) - + (match_clip_size - match_diminfo->start)) < num_slices); num_slices -= ((match_diminfo->stride * (count - (hsize_t)1)) + block) - (match_clip_size - match_diminfo->start); } /* end if */ @@ -12297,11 +12297,11 @@ H5S_hyper_get_unlim_block(const H5S_t *space, hsize_t block_index) FUNC_ENTER_NOAPI(NULL) /* Check parameters */ - HDassert(space); + assert(space); hslab = space->select.sel_info.hslab; - HDassert(hslab); - HDassert(hslab->unlim_dim >= 0); - HDassert(hslab->diminfo.opt[hslab->unlim_dim].count == H5S_UNLIMITED); + assert(hslab); + assert(hslab->unlim_dim >= 0); + assert(hslab->diminfo.opt[hslab->unlim_dim].count == H5S_UNLIMITED); /* Set start to select block_indexth block in unlimited dimension and set * count to 1 in that dimension to only select that block. Copy all other @@ -12375,11 +12375,11 @@ H5S_hyper_get_first_inc_block(const H5S_t *space, hsize_t clip_size, hbool_t *pa FUNC_ENTER_NOAPI_NOERR /* Check parameters */ - HDassert(space); + assert(space); hslab = space->select.sel_info.hslab; - HDassert(hslab); - HDassert(hslab->unlim_dim >= 0); - HDassert(hslab->diminfo.opt[hslab->unlim_dim].count == H5S_UNLIMITED); + assert(hslab); + assert(hslab->unlim_dim >= 0); + assert(hslab->diminfo.opt[hslab->unlim_dim].count == H5S_UNLIMITED); diminfo = &hslab->diminfo.opt[hslab->unlim_dim]; diff --git a/src/H5Smpio.c b/src/H5Smpio.c index c1465d0..f0f55c4 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -126,7 +126,7 @@ H5S__mpio_all_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); + assert(space); /* Just treat the entire extent as a block of bytes */ if ((snelmts = (hssize_t)H5S_GET_EXTENT_NPOINTS(space)) < 0) @@ -380,7 +380,7 @@ H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_typ FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); + assert(space); /* Get the total number of points selected */ if ((snum_points = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0) @@ -520,7 +520,7 @@ H5S__mpio_permute_type(H5S_t *space, size_t elmt_size, hsize_t **permute, MPI_Da FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); + assert(space); /* Get the total number of points selected */ if ((snum_points = (hssize_t)H5S_GET_SELECT_NPOINTS(space)) < 0) @@ -681,8 +681,8 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); - HDassert(sizeof(MPI_Aint) >= sizeof(elmt_size)); + assert(space); + assert(sizeof(MPI_Aint) >= sizeof(elmt_size)); bigio_count = H5_mpi_get_bigio_count(); @@ -697,7 +697,7 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, /* Abbreviate args */ diminfo = sel_iter->u.hyp.diminfo; - HDassert(diminfo); + assert(diminfo); /* Make a local copy of the dimension info so we can operate with them */ @@ -731,9 +731,9 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, #endif /* Sanity check */ - HDassert(d[u].block > 0); - HDassert(d[u].count > 0); - HDassert(d[u].xtent > 0); + assert(d[u].block > 0); + assert(d[u].count > 0); + assert(d[u].xtent > 0); } /* end for */ } /* end if */ else { @@ -765,9 +765,9 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, #endif /* Sanity check */ - HDassert(d[u].block > 0); - HDassert(d[u].count > 0); - HDassert(d[u].xtent > 0); + assert(d[u].block > 0); + assert(d[u].count > 0); + assert(d[u].xtent > 0); } /* end for */ } /* end else */ @@ -943,7 +943,7 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, MPI_Datatype interm_type; int block_len = 1; - HDassert(0 == lb); + assert(0 == lb); mpi_code = MPI_Type_create_hindexed(1, &block_len, &start_disp, outer_type, &interm_type); MPI_Type_free(&outer_type); @@ -1021,10 +1021,10 @@ H5S__mpio_span_hyper_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *ne FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); - HDassert(space->extent.size); - HDassert(space->select.sel_info.hslab->span_lst); - HDassert(space->select.sel_info.hslab->span_lst->head); + assert(space); + assert(space->extent.size); + assert(space->select.sel_info.hslab->span_lst); + assert(space->select.sel_info.hslab->span_lst->head); bigio_count = H5_mpi_get_bigio_count(); /* Create the base type for an element */ @@ -1092,7 +1092,7 @@ H5S__release_datatype(H5S_mpio_mpitype_list_t *type_list) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(type_list); + assert(type_list); /* Iterate over the list, freeing the MPI data types */ curr = type_list->head; @@ -1151,8 +1151,8 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, size_t e FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(spans); - HDassert(type_list); + assert(spans); + assert(type_list); bigio_count = H5_mpi_get_bigio_count(); /* Check if we've visited this span tree before */ @@ -1396,8 +1396,8 @@ H5S_mpio_space_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(space); - HDassert(elmt_size); + assert(space); + assert(elmt_size); /* Create MPI type based on the kind of selection */ switch (H5S_GET_EXTENT_TYPE(space)) { @@ -1420,7 +1420,7 @@ H5S_mpio_space_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int case H5S_SEL_POINTS: case H5S_SEL_HYPERSLABS: /* Sanity check */ - HDassert(!do_permute); + assert(!do_permute); if (H5S__mpio_permute_type(space, elmt_size, permute_map, new_type, count, is_derived_type) < 0) @@ -1431,7 +1431,7 @@ H5S_mpio_space_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert("unknown selection type" && 0); + assert("unknown selection type" && 0); break; } /* end switch */ } /* end if */ @@ -1473,7 +1473,7 @@ H5S_mpio_space_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert("unknown selection type" && 0); + assert("unknown selection type" && 0); break; } /* end switch */ } /* end else */ @@ -1481,7 +1481,7 @@ H5S_mpio_space_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, int case H5S_NO_CLASS: default: - HDassert("unknown dataspace type" && 0); + assert("unknown dataspace type" && 0); break; } /* end switch */ diff --git a/src/H5Snone.c b/src/H5Snone.c index c6e862c..f7f0b8a 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -148,8 +148,8 @@ H5S__none_iter_init(H5S_t H5_ATTR_UNUSED *space, H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space)); - HDassert(iter); + assert(space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space)); + assert(iter); /* Initialize type of selection iterator */ iter->type = H5S_sel_iter_none; @@ -176,8 +176,8 @@ H5S__none_iter_coords(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(coords); + assert(iter); + assert(coords); FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_iter_coords() */ @@ -202,9 +202,9 @@ H5S__none_iter_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter, hsize_t H5_ATTR_ FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(start); - HDassert(end); + assert(iter); + assert(start); + assert(end); FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_iter_block() */ @@ -227,7 +227,7 @@ H5S__none_iter_nelmts(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(0) } /* end H5S__none_iter_nelmts() */ @@ -255,7 +255,7 @@ H5S__none_iter_has_next_block(const H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_iter_has_next_block() */ @@ -284,8 +284,8 @@ H5S__none_iter_next(H5S_sel_iter_t H5_ATTR_UNUSED *iter, size_t H5_ATTR_UNUSED n FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(nelem > 0); + assert(iter); + assert(nelem > 0); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_iter_next() */ @@ -313,7 +313,7 @@ H5S__none_iter_next_block(H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_iter_next_block() */ @@ -355,13 +355,13 @@ H5S__none_iter_get_seq_list(H5S_sel_iter_t H5_ATTR_UNUSED *iter, size_t H5_ATTR_ FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(maxseq > 0); - HDassert(maxelem > 0); - HDassert(nseq); - HDassert(nelem); - HDassert(off); - HDassert(len); + assert(iter); + assert(maxseq > 0); + assert(maxelem > 0); + assert(nseq); + assert(nelem); + assert(off); + assert(len); /* "none" selections don't generate sequences of bytes */ *nseq = 0; @@ -395,7 +395,7 @@ H5S__none_iter_release(H5S_sel_iter_t H5_ATTR_UNUSED *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_iter_release() */ @@ -423,7 +423,7 @@ H5S__none_release(H5S_t H5_ATTR_UNUSED *space) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_release() */ @@ -453,8 +453,8 @@ H5S__none_copy(H5S_t *dst, const H5S_t H5_ATTR_UNUSED *src, hbool_t H5_ATTR_UNUS { FUNC_ENTER_PACKAGE_NOERR - HDassert(src); - HDassert(dst); + assert(src); + assert(dst); /* Set number of elements in selection */ dst->select.num_elem = 0; @@ -487,7 +487,7 @@ H5S__none_is_valid(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__none_is_valid() */ @@ -516,7 +516,7 @@ H5S__none_serial_size(H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); /* Basic number of bytes required to serialize point selection: * + + + @@ -554,9 +554,9 @@ H5S__none_serialize(H5S_t *space, uint8_t **p) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); - HDassert(p); - HDassert(pp); + assert(space); + assert(p); + assert(pp); /* Store the preamble information */ UINT32ENCODE(pp, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ @@ -603,8 +603,8 @@ H5S__none_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hbo FUNC_ENTER_PACKAGE - HDassert(p); - HDassert(*p); + assert(p); + assert(*p); /* As part of the efforts to push all selection-type specific coding to the callbacks, the coding for the allocation of a null dataspace @@ -679,9 +679,9 @@ H5S__none_bounds(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *star { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); - HDassert(start); - HDassert(end); + assert(space); + assert(start); + assert(end); FUNC_LEAVE_NOAPI(FAIL) } /* end H5S_none_bounds() */ @@ -711,8 +711,8 @@ H5S__none_offset(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUSED *offs { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_offset() */ @@ -767,7 +767,7 @@ H5S__none_is_contiguous(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(FALSE) } /* end H5S__none_is_contiguous() */ @@ -795,7 +795,7 @@ H5S__none_is_single(const H5S_t H5_ATTR_UNUSED *space) { FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(FALSE) } /* end H5S__none_is_single() */ @@ -825,7 +825,7 @@ H5S__none_is_regular(H5S_t H5_ATTR_UNUSED *space) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__none_is_regular() */ @@ -855,8 +855,8 @@ H5S__none_shape_same(H5S_t H5_ATTR_UNUSED *space1, H5S_t H5_ATTR_UNUSED *space2) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space1); - HDassert(space2); + assert(space1); + assert(space2); FUNC_LEAVE_NOAPI(TRUE) } /* end H5S__none_shape_same() */ @@ -887,10 +887,10 @@ H5S__none_intersect_block(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNU FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(space); - HDassert(H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space)); - HDassert(start); - HDassert(end); + assert(space); + assert(H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space)); + assert(start); + assert(end); FUNC_LEAVE_NOAPI(FALSE) } /* end H5S__none_intersect_block() */ @@ -919,8 +919,8 @@ H5S__none_adjust_u(H5S_t H5_ATTR_UNUSED *space, const hsize_t H5_ATTR_UNUSED *of FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_adjust_u() */ @@ -949,8 +949,8 @@ H5S__none_adjust_s(H5S_t H5_ATTR_UNUSED *space, const hssize_t H5_ATTR_UNUSED *o FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5S__none_adjust_s() */ @@ -973,8 +973,8 @@ H5S__none_project_scalar(const H5S_t H5_ATTR_UNUSED *space, hsize_t H5_ATTR_UNUS FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space)); - HDassert(offset); + assert(space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(space)); + assert(offset); FUNC_LEAVE_NOAPI(FAIL) } /* end H5S__none_project_scalar() */ @@ -1001,9 +1001,9 @@ H5S__none_project_simple(const H5S_t H5_ATTR_UNUSED *base_space, H5S_t *new_spac FUNC_ENTER_PACKAGE /* Check args */ - HDassert(base_space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(base_space)); - HDassert(new_space); - HDassert(offset); + assert(base_space && H5S_SEL_NONE == H5S_GET_SELECT_TYPE(base_space)); + assert(new_space); + assert(offset); /* Select the entire new space */ if (H5S_select_none(new_space) < 0) @@ -1038,7 +1038,7 @@ H5S_select_none(H5S_t *space) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(space); + assert(space); /* Remove current selection first */ if (H5S_SELECT_RELEASE(space) < 0) diff --git a/src/H5Spoint.c b/src/H5Spoint.c index b393c8d..9e9d4c9 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -177,8 +177,8 @@ H5S__point_iter_init(H5S_t *space, H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space && H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(space)); - HDassert(iter); + assert(space && H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(space)); + assert(iter); /* If this iterator is created from an API call, by default we clone the * selection now, as the dataspace could be modified or go out of scope. @@ -228,8 +228,8 @@ H5S__point_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(coords); + assert(iter); + assert(coords); /* Copy the offset of the current point */ H5MM_memcpy(coords, iter->u.pnt.curr->pnt, sizeof(hsize_t) * iter->rank); @@ -256,9 +256,9 @@ H5S__point_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(start); - HDassert(end); + assert(iter); + assert(start); + assert(end); /* Copy the current point as a block */ H5MM_memcpy(start, iter->u.pnt.curr->pnt, sizeof(hsize_t) * iter->rank); @@ -285,7 +285,7 @@ H5S__point_iter_nelmts(const H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); FUNC_LEAVE_NOAPI(iter->elmt_left) } /* end H5S__point_iter_nelmts() */ @@ -315,7 +315,7 @@ H5S__point_iter_has_next_block(const H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); /* Check if there is another point in the list */ if (iter->u.pnt.curr->next == NULL) @@ -349,8 +349,8 @@ H5S__point_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(nelem > 0); + assert(iter); + assert(nelem > 0); /* Increment the iterator */ while (nelem > 0) { @@ -384,7 +384,7 @@ H5S__point_iter_next_block(H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); /* Increment the iterator */ iter->u.pnt.curr = iter->u.pnt.curr->next; @@ -438,13 +438,13 @@ H5S__point_iter_get_seq_list(H5S_sel_iter_t *iter, size_t maxseq, size_t maxelem FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); - HDassert(maxseq > 0); - HDassert(maxelem > 0); - HDassert(nseq); - HDassert(nelem); - HDassert(off); - HDassert(len); + assert(iter); + assert(maxseq > 0); + assert(maxelem > 0); + assert(nseq); + assert(nelem); + assert(off); + assert(len); /* Choose the minimum number of bytes to sequence through */ H5_CHECK_OVERFLOW(iter->elmt_left, hsize_t, size_t); @@ -545,7 +545,7 @@ H5S__point_iter_release(H5S_sel_iter_t *iter) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(iter); + assert(iter); /* If this iterator copied the point list, we must free it */ if ((iter->flags & H5S_SEL_ITER_API_CALL) && !(iter->flags & H5S_SEL_ITER_SHARE_WITH_DATASPACE)) @@ -583,10 +583,10 @@ H5S__point_add(H5S_t *space, H5S_seloper_t op, size_t num_elem, const hsize_t *c FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(space); - HDassert(num_elem > 0); - HDassert(coord); - HDassert(op == H5S_SELECT_SET || op == H5S_SELECT_APPEND || op == H5S_SELECT_PREPEND); + assert(space); + assert(num_elem > 0); + assert(coord); + assert(op == H5S_SELECT_SET || op == H5S_SELECT_APPEND || op == H5S_SELECT_PREPEND); for (u = 0; u < num_elem; u++) { unsigned dim; /* Counter for dimensions */ @@ -641,7 +641,7 @@ H5S__point_add(H5S_t *space, H5S_seloper_t op, size_t num_elem, const hsize_t *c tmp_node = space->select.sel_info.pnt_lst->head; if (tmp_node != NULL) { - HDassert(space->select.sel_info.pnt_lst->tail); + assert(space->select.sel_info.pnt_lst->tail); space->select.sel_info.pnt_lst->tail->next = top; } /* end if */ else @@ -695,7 +695,7 @@ H5S__point_release(H5S_t *space) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); + assert(space); /* Free the point list */ H5S__free_pnt_list(space->select.sel_info.pnt_lst); @@ -744,10 +744,10 @@ H5S_select_elements(H5S_t *space, H5S_seloper_t op, size_t num_elem, const hsize FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(space); - HDassert(num_elem); - HDassert(coord); - HDassert(op == H5S_SELECT_SET || op == H5S_SELECT_APPEND || op == H5S_SELECT_PREPEND); + assert(space); + assert(num_elem); + assert(coord); + assert(op == H5S_SELECT_SET || op == H5S_SELECT_APPEND || op == H5S_SELECT_PREPEND); /* If we are setting a new selection, remove current selection first */ if (op == H5S_SELECT_SET || H5S_GET_SELECT_TYPE(space) != H5S_SEL_POINTS) @@ -807,8 +807,8 @@ H5S__copy_pnt_list(const H5S_pnt_list_t *src, unsigned rank) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(src); - HDassert(rank > 0); + assert(src); + assert(rank > 0); /* Allocate room for the head of the point list */ if (NULL == (dst = H5FL_MALLOC(H5S_pnt_list_t))) @@ -882,7 +882,7 @@ H5S__free_pnt_list(H5S_pnt_list_t *pnt_lst) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(pnt_lst); + assert(pnt_lst); /* Traverse the list, freeing all memory */ curr = pnt_lst->head; @@ -926,8 +926,8 @@ H5S__point_copy(H5S_t *dst, const H5S_t *src, hbool_t H5_ATTR_UNUSED share_selec FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(src); - HDassert(dst); + assert(src); + assert(dst); /* Allocate room for the head of the point list */ if (NULL == @@ -966,7 +966,7 @@ H5S__point_is_valid(const H5S_t *space) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); /* Check each dimension */ for (u = 0; u < space->extent.rank; u++) { @@ -1167,7 +1167,7 @@ H5S__point_serial_size(H5S_t *space) FUNC_ENTER_PACKAGE - HDassert(space); + assert(space); /* Determine the version and encoded size for point selection */ if (H5S__point_get_version_enc_size(space, &version, &enc_size) < 0) @@ -1233,10 +1233,10 @@ H5S__point_serialize(H5S_t *space, uint8_t **p) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); - HDassert(p); + assert(space); + assert(p); pp = (*p); - HDassert(pp); + assert(pp); /* Determine the version and encoded size for point selection info */ if (H5S__point_get_version_enc_size(space, &version, &enc_size) < 0) @@ -1250,7 +1250,7 @@ H5S__point_serialize(H5S_t *space, uint8_t **p) *(pp)++ = enc_size; /* Store size of point info */ } else { - HDassert(version == H5S_POINT_VERSION_1); + assert(version == H5S_POINT_VERSION_1); UINT32ENCODE(pp, (uint32_t)0); /* Store the un-used padding */ lenp = pp; /* Keep the pointer to the length location for later */ pp += 4; /* Skip over space for length */ @@ -1262,7 +1262,7 @@ H5S__point_serialize(H5S_t *space, uint8_t **p) switch (enc_size) { case H5S_SELECT_INFO_ENC_SIZE_2: - HDassert(version == H5S_POINT_VERSION_2); + assert(version == H5S_POINT_VERSION_2); /* Encode number of elements */ UINT16ENCODE(pp, (uint16_t)space->select.num_elem); @@ -1278,7 +1278,7 @@ H5S__point_serialize(H5S_t *space, uint8_t **p) break; case H5S_SELECT_INFO_ENC_SIZE_4: - HDassert(version == H5S_POINT_VERSION_1 || version == H5S_POINT_VERSION_2); + assert(version == H5S_POINT_VERSION_1 || version == H5S_POINT_VERSION_2); /* Encode number of elements */ UINT32ENCODE(pp, (uint32_t)space->select.num_elem); @@ -1298,7 +1298,7 @@ H5S__point_serialize(H5S_t *space, uint8_t **p) break; case H5S_SELECT_INFO_ENC_SIZE_8: - HDassert(version == H5S_POINT_VERSION_2); + assert(version == H5S_POINT_VERSION_2); /* Encode number of elements */ UINT64ENCODE(pp, space->select.num_elem); @@ -1369,9 +1369,9 @@ H5S__point_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size, hb FUNC_ENTER_PACKAGE /* Check args */ - HDassert(p); + assert(p); pp = (*p); - HDassert(pp); + assert(pp); /* As part of the efforts to push all selection-type specific coding to the callbacks, the coding for the allocation of a null dataspace @@ -1563,8 +1563,8 @@ H5S__get_select_elem_pointlist(const H5S_t *space, hsize_t startpoint, hsize_t n FUNC_ENTER_PACKAGE_NOERR - HDassert(space); - HDassert(buf); + assert(space); + assert(buf); /* Get the dataspace extent rank */ rank = space->extent.rank; @@ -1687,15 +1687,15 @@ H5S__point_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(space); - HDassert(start); - HDassert(end); + assert(space); + assert(start); + assert(end); /* Loop over dimensions */ for (u = 0; u < space->extent.rank; u++) { /* Sanity check */ - HDassert(space->select.sel_info.pnt_lst->low_bounds[u] <= - space->select.sel_info.pnt_lst->high_bounds[u]); + assert(space->select.sel_info.pnt_lst->low_bounds[u] <= + space->select.sel_info.pnt_lst->high_bounds[u]); /* Check for offset moving selection negative */ if (((hssize_t)space->select.sel_info.pnt_lst->low_bounds[u] + space->select.offset[u]) < 0) @@ -1744,8 +1744,8 @@ H5S__point_offset(const H5S_t *space, hsize_t *offset) FUNC_ENTER_PACKAGE - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); /* Start at linear offset 0 */ *offset = 0; @@ -1831,7 +1831,7 @@ H5S__point_is_contiguous(const H5S_t *space) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); /* One point is definitely contiguous */ if (space->select.num_elem == 1) @@ -1868,7 +1868,7 @@ H5S__point_is_single(const H5S_t *space) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); + assert(space); /* One point is definitely 'single' :-) */ if (space->select.num_elem == 1) @@ -1908,7 +1908,7 @@ H5S__point_is_regular(H5S_t *space) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space); + assert(space); /* Only simple check for regular points for now... */ if (space->select.num_elem == 1) @@ -1952,16 +1952,16 @@ H5S__point_shape_same(H5S_t *space1, H5S_t *space2) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(space1); - HDassert(space2); + assert(space1); + assert(space2); /* Get dataspace ranks */ space1_rank = space1->extent.rank; space2_rank = space2->extent.rank; /* Sanity check */ - HDassert(space1_rank >= space2_rank); - HDassert(space2_rank > 0); + assert(space1_rank >= space2_rank); + assert(space2_rank > 0); /* Initialize dimensions */ space1_dim = (int)space1_rank - 1; @@ -2053,10 +2053,10 @@ H5S__point_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *en FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(space); - HDassert(H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(space)); - HDassert(start); - HDassert(end); + assert(space); + assert(H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(space)); + assert(start); + assert(end); /* Loop over points */ pnt = space->select.sel_info.pnt_lst->head; @@ -2108,8 +2108,8 @@ H5S__point_adjust_u(H5S_t *space, const hsize_t *offset) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); /* Check for an all-zero offset vector */ for (u = 0; u < space->extent.rank; u++) @@ -2127,7 +2127,7 @@ H5S__point_adjust_u(H5S_t *space, const hsize_t *offset) /* Adjust each coordinate for point node */ for (u = 0; u < rank; u++) { /* Check for offset moving selection negative */ - HDassert(node->pnt[u] >= offset[u]); + assert(node->pnt[u] >= offset[u]); /* Adjust node's coordinate location */ node->pnt[u] -= offset[u]; @@ -2175,8 +2175,8 @@ H5S__point_adjust_s(H5S_t *space, const hssize_t *offset) FUNC_ENTER_PACKAGE_NOERR - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); /* Check for an all-zero offset vector */ for (u = 0; u < space->extent.rank; u++) @@ -2194,7 +2194,7 @@ H5S__point_adjust_s(H5S_t *space, const hssize_t *offset) /* Adjust each coordinate for point node */ for (u = 0; u < rank; u++) { /* Check for offset moving selection negative */ - HDassert((hssize_t)node->pnt[u] >= offset[u]); + assert((hssize_t)node->pnt[u] >= offset[u]); /* Adjust node's coordinate location */ node->pnt[u] = (hsize_t)((hssize_t)node->pnt[u] - offset[u]); @@ -2206,7 +2206,7 @@ H5S__point_adjust_s(H5S_t *space, const hssize_t *offset) /* update the bound box of the selection */ for (u = 0; u < rank; u++) { - HDassert((hssize_t)space->select.sel_info.pnt_lst->low_bounds[u] >= offset[u]); + assert((hssize_t)space->select.sel_info.pnt_lst->low_bounds[u] >= offset[u]); space->select.sel_info.pnt_lst->low_bounds[u] = (hsize_t)((hssize_t)space->select.sel_info.pnt_lst->low_bounds[u] - offset[u]); space->select.sel_info.pnt_lst->high_bounds[u] = @@ -2239,8 +2239,8 @@ H5S__point_project_scalar(const H5S_t *space, hsize_t *offset) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space && H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(space)); - HDassert(offset); + assert(space && H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(space)); + assert(offset); /* Get the head of the point list */ node = space->select.sel_info.pnt_lst->head; @@ -2283,9 +2283,9 @@ H5S__point_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *of FUNC_ENTER_PACKAGE /* Check args */ - HDassert(base_space && H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(base_space)); - HDassert(new_space); - HDassert(offset); + assert(base_space && H5S_SEL_POINTS == H5S_GET_SELECT_TYPE(base_space)); + assert(new_space); + assert(offset); /* We are setting a new selection, remove any current selection in new dataspace */ if (H5S_SELECT_RELEASE(new_space) < 0) @@ -2341,7 +2341,7 @@ H5S__point_project_simple(const H5S_t *base_space, H5S_t *new_space, hsize_t *of } /* end for */ } /* end if */ else { - HDassert(new_space->extent.rank > base_space->extent.rank); + assert(new_space->extent.rank > base_space->extent.rank); /* Compute the difference in ranks */ rank_diff = new_space->extent.rank - base_space->extent.rank; diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 28c30ea..ebe6e89 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -95,9 +95,9 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); - HDassert(0 < space->extent.rank && space->extent.rank <= H5S_MAX_RANK); - HDassert(offset); + assert(space); + assert(0 < space->extent.rank && space->extent.rank <= H5S_MAX_RANK); + assert(offset); /* Copy the offset over */ H5MM_memcpy(space->select.offset, offset, sizeof(hssize_t) * space->extent.rank); @@ -228,8 +228,8 @@ H5S_select_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(dst); - HDassert(src); + assert(dst); + assert(src); /* Release the current selection */ if (H5S_SELECT_RELEASE(dst) < 0) @@ -269,7 +269,7 @@ H5S_select_release(H5S_t *ds) FUNC_ENTER_NOAPI_NOINIT - HDassert(ds); + assert(ds); /* Call the selection type's release function */ if ((ds->select.type) && ((ret_value = (*ds->select.type->release)(ds)) < 0)) @@ -303,7 +303,7 @@ H5S_select_serial_size(H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(space); + assert(space); /* Call the selection type's serial_size function */ ret_value = (*space->select.type->serial_size)(space); @@ -342,8 +342,8 @@ H5S_select_serialize(H5S_t *space, uint8_t **p) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(space); - HDassert(p); + assert(space); + assert(p); /* Call the selection type's serialize function */ ret_value = (*space->select.type->serialize)(space, p); @@ -413,7 +413,7 @@ H5S_get_select_npoints(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); + assert(space); FUNC_LEAVE_NOAPI(space->select.num_elem) } /* end H5S_get_select_npoints() */ @@ -487,7 +487,7 @@ H5S_select_valid(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(space); + assert(space); ret_value = (*space->select.type->is_valid)(space); @@ -529,7 +529,7 @@ H5S_select_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size) hbool_t skip = (p_size == SIZE_MAX ? TRUE : FALSE); /* If p_size is unknown, skip buffer checks */ FUNC_ENTER_NOAPI(FAIL) - HDassert(space); + assert(space); /* Selection-type specific coding is moved to the callbacks. */ @@ -653,9 +653,9 @@ H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); - HDassert(start); - HDassert(end); + assert(space); + assert(start); + assert(end); ret_value = (*space->select.type->bounds)(space, start, end); @@ -693,8 +693,8 @@ H5S_get_select_offset(const H5S_t *space, hsize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); ret_value = (*space->select.type->offset)(space, offset); @@ -731,7 +731,7 @@ H5S_get_select_unlim_dim(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); + assert(space); ret_value = (*space->select.type->unlim_dim)(space); @@ -766,8 +766,8 @@ H5S_get_select_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unli FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(space); - HDassert(num_elem_non_unlim); + assert(space); + assert(num_elem_non_unlim); /* Check for selection callback */ if (!space->select.type->num_elem_non_unlim) @@ -811,7 +811,7 @@ H5S_select_is_contiguous(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); + assert(space); ret_value = (*space->select.type->is_contiguous)(space); @@ -847,7 +847,7 @@ H5S_select_is_single(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); + assert(space); ret_value = (*space->select.type->is_single)(space); @@ -883,7 +883,7 @@ H5S_select_is_regular(H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); + assert(space); ret_value = (*space->select.type->is_regular)(space); @@ -919,8 +919,8 @@ H5S_select_adjust_u(H5S_t *space, const hsize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); /* Perform operation */ ret_value = (*space->select.type->adjust_u)(space, offset); @@ -957,8 +957,8 @@ H5S_select_adjust_s(H5S_t *space, const hssize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); /* Perform operation */ ret_value = (*space->select.type->adjust_s)(space, offset); @@ -1045,8 +1045,8 @@ H5S_select_project_scalar(const H5S_t *space, hsize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); - HDassert(offset); + assert(space); + assert(offset); ret_value = (*space->select.type->project_scalar)(space, offset); @@ -1084,9 +1084,9 @@ H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); - HDassert(new_space); - HDassert(offset); + assert(space); + assert(new_space); + assert(offset); ret_value = (*space->select.type->project_simple)(space, new_space, offset); @@ -1119,8 +1119,8 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, H5S_t *space, size_t elmt_size, u FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(sel_iter); - HDassert(space); + assert(sel_iter); + assert(space); /* Initialize common information */ @@ -1144,7 +1144,7 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, H5S_t *space, size_t elmt_size, u /* Call initialization routine for selection type */ ret_value = (*space->select.type->iter_init)(space, sel_iter); - HDassert(sel_iter->type); + assert(sel_iter->type); FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_iter_init() */ @@ -1179,8 +1179,8 @@ H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(sel_iter); - HDassert(coords); + assert(sel_iter); + assert(coords); /* Call iter_coords routine for selection type */ ret_value = (*sel_iter->type->iter_coords)(sel_iter, coords); @@ -1216,7 +1216,7 @@ H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(sel_iter); + assert(sel_iter); /* Call iter_nelmts routine for selection type */ ret_value = (*sel_iter->type->iter_nelmts)(sel_iter); @@ -1254,8 +1254,8 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(iter); - HDassert(nelem > 0); + assert(iter); + assert(nelem > 0); /* Call iter_next routine for selection type */ ret_value = (*iter->type->iter_next)(iter, nelem); @@ -1292,7 +1292,7 @@ H5S_select_iter_get_seq_list(H5S_sel_iter_t *iter, size_t maxseq, size_t maxelmt FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(iter); + assert(iter); /* Call the selection type's get_seq_list function */ if ((ret_value = (*iter->type->iter_get_seq_list)(iter, maxseq, maxelmts, nseq, nelmts, off, len)) < 0) @@ -1330,7 +1330,7 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(sel_iter); + assert(sel_iter); /* Call selection type-specific release routine */ ret_value = (*sel_iter->type->iter_release)(sel_iter); @@ -1384,10 +1384,10 @@ H5S_select_iterate(void *buf, const H5T_t *type, H5S_t *space, const H5S_sel_ite FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(buf); - HDassert(type); - HDassert(space); - HDassert(op); + assert(buf); + assert(type); + assert(space); + assert(op); /* Get the datatype size */ if (0 == (elmt_size = H5T_get_size(type))) @@ -1411,7 +1411,7 @@ H5S_select_iterate(void *buf, const H5T_t *type, H5S_t *space, const H5S_sel_ite if (ndims > 0) { /* Copy the size of the space */ - HDassert(space->extent.size); + assert(space->extent.size); H5MM_memcpy(space_size, space->extent.size, ndims * sizeof(hsize_t)); } /* end if */ space_size[ndims] = elmt_size; @@ -1576,7 +1576,7 @@ H5S_get_select_type(const H5S_t *space) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ - HDassert(space); + assert(space); /* Set return value */ ret_value = H5S_GET_SELECT_TYPE(space); @@ -1619,8 +1619,8 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(space1); - HDassert(space2); + assert(space1); + assert(space2); /* Check for different number of elements selected */ if (H5S_GET_SELECT_NPOINTS(space1) != H5S_GET_SELECT_NPOINTS(space2)) @@ -1662,8 +1662,8 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) } /* end else */ space_a_rank = space_a->extent.rank; space_b_rank = space_b->extent.rank; - HDassert(space_a_rank >= space_b_rank); - HDassert(space_b_rank > 0); + assert(space_a_rank >= space_b_rank); + assert(space_b_rank > 0); /* Get selection type for both dataspaces */ sel_a_type = H5S_GET_SELECT_TYPE(space_a); @@ -1689,8 +1689,8 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) space_b_dim = (int)space_b_rank - 1; while (space_b_dim >= 0) { /* Sanity check */ - HDassert(low_a[space_a_dim] <= high_a[space_a_dim]); - HDassert(low_a[space_b_dim] <= high_a[space_b_dim]); + assert(low_a[space_a_dim] <= high_a[space_a_dim]); + assert(low_a[space_b_dim] <= high_a[space_b_dim]); /* Verify that the ranges are the same */ if ((high_a[space_a_dim] - low_a[space_a_dim]) != (high_b[space_b_dim] - low_b[space_b_dim])) @@ -1704,7 +1704,7 @@ H5S_select_shape_same(H5S_t *space1, H5S_t *space2) /* Check that the rest of the ranges in space a are "flat" */ while (space_a_dim >= 0) { /* Sanity check */ - HDassert(low_a[space_a_dim] <= high_a[space_a_dim]); + assert(low_a[space_a_dim] <= high_a[space_a_dim]); /* This range should be flat to be the same in a lower dimension */ if (low_a[space_a_dim] != high_a[space_a_dim]) @@ -1939,9 +1939,9 @@ H5S_select_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *en FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(space); - HDassert(start); - HDassert(end); + assert(space); + assert(start); + assert(end); /* If selections aren't "none", compare their bounds */ if (H5S_SEL_NONE != H5S_GET_SELECT_TYPE(space)) { @@ -2091,19 +2091,19 @@ H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr, unsign FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(base_space != NULL); - HDassert((H5S_GET_EXTENT_TYPE(base_space) == H5S_SCALAR) || - (H5S_GET_EXTENT_TYPE(base_space) == H5S_SIMPLE)); - HDassert(new_space_ptr != NULL); - HDassert((new_space_rank != 0) || (H5S_GET_SELECT_NPOINTS(base_space) <= 1)); - HDassert(new_space_rank <= H5S_MAX_RANK); - HDassert(element_size > 0); + assert(base_space != NULL); + assert((H5S_GET_EXTENT_TYPE(base_space) == H5S_SCALAR) || + (H5S_GET_EXTENT_TYPE(base_space) == H5S_SIMPLE)); + assert(new_space_ptr != NULL); + assert((new_space_rank != 0) || (H5S_GET_SELECT_NPOINTS(base_space) <= 1)); + assert(new_space_rank <= H5S_MAX_RANK); + assert(element_size > 0); /* Get the extent info for the base dataspace */ if ((sbase_space_rank = H5S_get_simple_extent_dims(base_space, base_space_dims, base_space_maxdims)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimensionality of base space") base_space_rank = (unsigned)sbase_space_rank; - HDassert(base_space_rank != new_space_rank); + assert(base_space_rank != new_space_rank); /* Check if projected space is scalar */ if (new_space_rank == 0) { @@ -2112,7 +2112,7 @@ H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr, unsign /* Retrieve the number of elements selected */ if ((npoints = (hssize_t)H5S_GET_SELECT_NPOINTS(base_space)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get number of points selected") - HDassert(npoints <= 1); + assert(npoints <= 1); /* Create new scalar dataspace */ if (NULL == (new_space = H5S_create(H5S_SCALAR))) @@ -2146,7 +2146,7 @@ H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr, unsign HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "unable to project scalar selection") } /* end if */ else { - HDassert(0 == npoints); + assert(0 == npoints); if (H5S_select_none(new_space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't delete default selection") @@ -2254,7 +2254,7 @@ H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr, unsign /* If we have done the projection correctly, the following assertion * should hold. */ - HDassert(TRUE == H5S_select_shape_same(base_space, new_space)); + assert(TRUE == H5S_select_shape_same(base_space, new_space)); /* load the address of the new space into *new_space_ptr */ *new_space_ptr = new_space; @@ -2316,10 +2316,10 @@ H5S_select_fill(const void *fill, size_t fill_size, H5S_t *space, void *_buf) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(fill); - HDassert(fill_size > 0); - HDassert(space); - HDassert(_buf); + assert(fill); + assert(fill_size > 0); + assert(space); + assert(_buf); /* Allocate the selection iterator */ if (NULL == (iter = H5FL_MALLOC(H5S_sel_iter_t))) @@ -2362,7 +2362,7 @@ H5S_select_fill(const void *fill, size_t fill_size, H5S_t *space, void *_buf) buf = (uint8_t *)_buf + off[curr_seq]; /* Fill each sequence in memory with fill value */ - HDassert((len[curr_seq] % fill_size) == 0); + assert((len[curr_seq] % fill_size) == 0); H5VM_array_fill(buf, fill, fill_size, (len[curr_seq] / fill_size)); } /* end for */ @@ -2433,12 +2433,12 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(src_space); - HDassert(dst_space); - HDassert(src_intersect_space); - HDassert(new_space_ptr); - HDassert(H5S_GET_SELECT_NPOINTS(src_space) == H5S_GET_SELECT_NPOINTS(dst_space)); - HDassert(H5S_GET_EXTENT_NDIMS(src_space) == H5S_GET_EXTENT_NDIMS(src_intersect_space)); + assert(src_space); + assert(dst_space); + assert(src_intersect_space); + assert(new_space_ptr); + assert(H5S_GET_SELECT_NPOINTS(src_space) == H5S_GET_SELECT_NPOINTS(dst_space)); + assert(H5S_GET_EXTENT_NDIMS(src_space) == H5S_GET_EXTENT_NDIMS(src_intersect_space)); if (NULL == (ss_iter = H5FL_CALLOC(H5S_sel_iter_t))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate selection iterator") @@ -2473,8 +2473,8 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i * covered above, and the source intersect space must have the same * rank, so it also cannot be scalar, as scalar dataspaces have a rank * of 0. */ - HDassert(H5S_GET_EXTENT_TYPE(src_space) != H5S_SCALAR); - HDassert(H5S_GET_EXTENT_TYPE(src_intersect_space) != H5S_SCALAR); + assert(H5S_GET_EXTENT_TYPE(src_space) != H5S_SCALAR); + assert(H5S_GET_EXTENT_TYPE(src_intersect_space) != H5S_SCALAR); /* Check for scalar dst_space. In this case we simply check if the * (single) point selected in src_space intersects src_intersect_space, @@ -2487,8 +2487,8 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i /* Get source space bounds. Should be a single point. */ if (H5S_SELECT_BOUNDS(src_space, coords_start, coords_end) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get source space bounds") - HDassert(0 == HDmemcmp(coords_start, coords_end, - H5S_GET_EXTENT_NDIMS(src_space) * sizeof(coords_start[0]))); + assert(0 == HDmemcmp(coords_start, coords_end, + H5S_GET_EXTENT_NDIMS(src_space) * sizeof(coords_start[0]))); /* Check for intersection */ if ((intersect = H5S_SELECT_INTERSECT_BLOCK(src_intersect_space, coords_start, coords_end)) < 0) @@ -2536,7 +2536,7 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i } /* end for */ /* By this point, src_intersect_space must be a hyperslab selection */ - HDassert(H5S_GET_SELECT_TYPE(src_intersect_space) == H5S_SEL_HYPERSLABS); + assert(H5S_GET_SELECT_TYPE(src_intersect_space) == H5S_SEL_HYPERSLABS); /* If either the source space or the destination space is a point * selection, iterate element by element */ @@ -2561,8 +2561,8 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i /* Iterate over points */ do { - HDassert(ss_iter->elmt_left > 0); - HDassert(ss_iter->elmt_left > 0); + assert(ss_iter->elmt_left > 0); + assert(ss_iter->elmt_left > 0); /* Get SS coords */ if (H5S_SELECT_ITER_COORDS(ss_iter, coords) < 0) @@ -2596,11 +2596,11 @@ H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_i "can't advacne destination selection iterator") ds_iter->elmt_left--; } while (ss_iter->elmt_left > 0); - HDassert(H5S_SELECT_ITER_NELMTS(ds_iter) == 0); + assert(H5S_SELECT_ITER_NELMTS(ds_iter) == 0); } /* end if */ else { - HDassert(H5S_GET_SELECT_TYPE(src_space) != H5S_SEL_NONE); - HDassert(H5S_GET_SELECT_TYPE(dst_space) != H5S_SEL_NONE); + assert(H5S_GET_SELECT_TYPE(src_space) != H5S_SEL_NONE); + assert(H5S_GET_SELECT_TYPE(dst_space) != H5S_SEL_NONE); /* Source and destination selections are all or hyperslab, * intersecting selection is hyperslab. Call the hyperslab routine @@ -2746,8 +2746,8 @@ H5S_select_subtract(H5S_t *space, H5S_t *subtract_space) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(space); - HDassert(subtract_space); + assert(space); + assert(subtract_space); /* If either space is using the none selection, then we do not need to do * anything */ @@ -2788,8 +2788,8 @@ H5S_select_subtract(H5S_t *space, H5S_t *subtract_space) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't convert selection") } /* end if */ - HDassert(space->select.type->type == H5S_SEL_HYPERSLABS); - HDassert(subtract_space->select.type->type == H5S_SEL_HYPERSLABS); + assert(space->select.type->type == H5S_SEL_HYPERSLABS); + assert(subtract_space->select.type->type == H5S_SEL_HYPERSLABS); /* Both spaces are now hyperslabs, perform the operation */ if (H5S__modify_select(space, H5S_SELECT_NOTB, subtract_space) < 0) @@ -2980,7 +2980,7 @@ H5S_select_contig_block(H5S_t *space, hbool_t *is_contig, hsize_t *off, size_t * FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(space); + assert(space); /* Allocate and initialize the iterator */ if (NULL == (iter = H5FL_MALLOC(H5S_sel_iter_t))) @@ -3087,7 +3087,7 @@ H5S__sel_iter_close_cb(H5S_sel_iter_t *_sel_iter, void H5_ATTR_UNUSED **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(sel_iter); + assert(sel_iter); /* Close the selection iterator object */ if (H5S_sel_iter_close(sel_iter) < 0) @@ -3117,7 +3117,7 @@ H5S_sel_iter_close(H5S_sel_iter_t *sel_iter) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(sel_iter); + assert(sel_iter); /* Call selection type-specific release routine */ if (H5S_SELECT_ITER_RELEASE(sel_iter) < 0) diff --git a/src/H5Stest.c b/src/H5Stest.c index 520de76..4bbbf87 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -87,8 +87,8 @@ H5S__get_rebuild_status_test(hid_t space_id, H5S_diminfo_valid_t *status1, H5S_d FUNC_ENTER_PACKAGE - HDassert(status1); - HDassert(status2); + assert(status1); + assert(status2); /* Get dataspace structures */ if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) @@ -134,7 +134,7 @@ H5S__get_diminfo_status_test(hid_t space_id, H5S_diminfo_valid_t *status) FUNC_ENTER_PACKAGE - HDassert(status); + assert(status); /* Get dataspace structures */ if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) @@ -174,7 +174,7 @@ H5S__check_spans_tail_ptr(const H5S_hyper_span_info_t *span_lst) FUNC_ENTER_PACKAGE - HDassert(span_lst); + assert(span_lst); cur_elem = span_lst->head; while (cur_elem) { @@ -223,7 +223,7 @@ H5S__check_points_tail_ptr(const H5S_pnt_list_t *pnt_lst) FUNC_ENTER_PACKAGE - HDassert(pnt_lst); + assert(pnt_lst); cur_elem = pnt_lst->head; while (cur_elem) { @@ -268,7 +268,7 @@ H5S__check_internal_consistency(const H5S_t *space) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(space); + assert(space); if (space->select.type->type == H5S_SEL_NONE) HGOTO_DONE(ret_value); diff --git a/src/H5T.c b/src/H5T.c index 516000a..2d8b2ec 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1388,7 +1388,7 @@ H5T_init(void) /* Only register the default property list if it hasn't been created yet */ if (H5P_LST_DATATYPE_CREATE_ID_g == (-1)) { /* ========== Datatype Creation Property Class Initialization ============*/ - HDassert(H5P_CLS_DATATYPE_CREATE_g != NULL); + assert(H5P_CLS_DATATYPE_CREATE_g != NULL); /* Register the default datatype creation property list */ if ((H5P_LST_DATATYPE_CREATE_ID_g = H5P_create_id(H5P_CLS_DATATYPE_CREATE_g, FALSE)) < 0) @@ -1446,8 +1446,8 @@ H5T__unlock_cb(void *_dt, hid_t H5_ATTR_UNUSED id, void *_udata) FUNC_ENTER_PACKAGE_NOERR - HDassert(dt); - HDassert(dt->shared); + assert(dt); + assert(dt->shared); if (H5T_STATE_IMMUTABLE == dt->shared->state) { dt->shared->state = H5T_STATE_RDONLY; @@ -1486,7 +1486,7 @@ H5T_top_term_package(void) H5T_path_t *path; path = H5T_g.path[i]; - HDassert(path); + assert(path); if (path->conv.u.app_func) { H5T__print_stats(path, &nprint /*in,out*/); path->cdata.command = H5T_CONV_FREE; @@ -1680,7 +1680,7 @@ H5T_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(0 == H5I_nmembers(H5I_DATATYPE)); + assert(0 == H5I_nmembers(H5I_DATATYPE)); /* Destroy the datatype object id group */ n += (H5I_dec_type_ref(H5I_DATATYPE) > 0); @@ -1705,8 +1705,8 @@ H5T__close_cb(H5T_t *dt, void **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dt); - HDassert(dt->shared); + assert(dt); + assert(dt->shared); /* If this datatype is VOL-managed (i.e.: has a VOL object), * close it through the VOL connector. @@ -2105,7 +2105,7 @@ H5T_get_class(const H5T_t *dt, htri_t internal) FUNC_ENTER_NOAPI_NOERR - HDassert(dt); + assert(dt); /* Externally, a VL string is a string; internally, a VL string is a VL. */ if (internal) { @@ -2177,8 +2177,8 @@ H5T_detect_class(const H5T_t *dt, H5T_class_t cls, hbool_t from_api) FUNC_ENTER_NOAPI_NOERR - HDassert(dt); - HDassert(cls > H5T_NO_CLASS && cls < H5T_NCLASSES); + assert(dt); + assert(cls > H5T_NO_CLASS && cls < H5T_NCLASSES); /* Consider VL string as a string for API, as a VL for internal use. */ /* (note that this check must be performed before checking if the VL @@ -2438,7 +2438,7 @@ H5T_get_super(const H5T_t *dt) FUNC_ENTER_NOAPI(NULL) - HDassert(dt); + assert(dt); if (!dt->shared->parent) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "not a derived data type"); @@ -2469,11 +2469,11 @@ H5T__register_int(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T FUNC_ENTER_PACKAGE /* Check args */ - HDassert(H5T_PERS_HARD == pers || H5T_PERS_SOFT == pers); - HDassert(name && *name); - HDassert(src); - HDassert(dst); - HDassert(func); + assert(H5T_PERS_HARD == pers || H5T_PERS_SOFT == pers); + assert(name && *name); + assert(src); + assert(dst); + assert(func); /* Set up conversion function wrapper */ conv_func.is_app = FALSE; @@ -2520,11 +2520,11 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con FUNC_ENTER_PACKAGE /* Check args */ - HDassert(src); - HDassert(dst); - HDassert(conv); - HDassert(H5T_PERS_HARD == pers || H5T_PERS_SOFT == pers); - HDassert(name && *name); + assert(src); + assert(dst); + assert(conv); + assert(H5T_PERS_HARD == pers || H5T_PERS_SOFT == pers); + assert(name && *name); if (H5T_PERS_HARD == pers) { /* Only bother to register the path if it's not a no-op path (for this machine) */ @@ -2569,7 +2569,7 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con */ for (i = 1; i < H5T_g.npaths; i++) { old_path = H5T_g.path[i]; - HDassert(old_path); + assert(old_path); /* Does the new soft conversion function apply to this path? */ if (old_path->is_hard || old_path->src->shared->type != src->shared->type || @@ -2757,7 +2757,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c if (H5T_PERS_DONTCARE == pers || H5T_PERS_SOFT == pers) { for (i = H5T_g.nsoft - 1; i >= 0; --i) { soft = H5T_g.soft + i; - HDassert(soft); + assert(soft); if (name && *name && HDstrcmp(name, soft->name) != 0) continue; if (src && src->shared->type != soft->src) @@ -2776,7 +2776,7 @@ H5T__unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_c /* Remove matching conversion paths, except no-op path */ for (i = H5T_g.npaths - 1; i > 0; --i) { path = H5T_g.path[i]; - HDassert(path); + assert(path); /* Not a match */ if (((H5T_PERS_SOFT == pers && path->is_hard) || (H5T_PERS_HARD == pers && !path->is_hard)) || @@ -3562,7 +3562,7 @@ H5T__complete_copy(H5T_t *new_dt, const H5T_t *old_dt, H5T_shared_t *reopened_fo if (NULL == (tmp = (*copyfn)(old_dt->shared->u.compnd.memb[i].type))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "can't copy compound field's datatype") new_dt->shared->u.compnd.memb[i].type = tmp; - HDassert(tmp != NULL); + assert(tmp != NULL); /* Range check against compound member's offset */ if ((accum_change < 0) && @@ -3727,7 +3727,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) FUNC_ENTER_NOAPI(NULL) /* check args */ - HDassert(old_dt); + assert(old_dt); /* Allocate and copy core datatype information */ if (NULL == (new_dt = H5T__initiate_copy(old_dt))) @@ -3769,7 +3769,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) done: if (ret_value == NULL) if (new_dt) { - HDassert(new_dt->shared); + assert(new_dt->shared); if (new_dt->shared->owned_vol_obj && H5VL_free_object(new_dt->shared->owned_vol_obj) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close owned VOL object") new_dt->shared = H5FL_FREE(H5T_shared_t, new_dt->shared); @@ -3803,7 +3803,7 @@ H5T_copy_reopen(H5T_t *old_dt) FUNC_ENTER_NOAPI(NULL) /* check args */ - HDassert(old_dt); + assert(old_dt); /* Allocate and copy core datatype information */ if (NULL == (new_dt = H5T__initiate_copy(old_dt))) @@ -3876,7 +3876,7 @@ H5T_copy_reopen(H5T_t *old_dt) done: if (ret_value == NULL) if (new_dt) { - HDassert(new_dt->shared); + assert(new_dt->shared); if (new_dt->shared->owned_vol_obj && H5VL_free_object(new_dt->shared->owned_vol_obj) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close owned VOL object") new_dt->shared = H5FL_FREE(H5T_shared_t, new_dt->shared); @@ -3909,7 +3909,7 @@ H5T_lock(H5T_t *dt, hbool_t immutable) FUNC_ENTER_NOAPI(FAIL) - HDassert(dt); + assert(dt); switch (dt->shared->state) { case H5T_STATE_TRANSIENT: @@ -3974,7 +3974,7 @@ done: if (ret_value == NULL) if (dt) { if (dt->shared) { - HDassert(!dt->shared->owned_vol_obj); + assert(!dt->shared->owned_vol_obj); dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); } /* end if */ dt = H5FL_FREE(H5T_t, dt); @@ -4005,7 +4005,7 @@ H5T__free(H5T_t *dt) FUNC_ENTER_PACKAGE - HDassert(dt && dt->shared); + assert(dt && dt->shared); /* Free the ID to name info */ H5G_name_free(&(dt->path)); @@ -4053,7 +4053,7 @@ H5T__free(H5T_t *dt) dt->shared->type = H5T_NO_CLASS; /* Close the parent */ - HDassert(dt->shared->parent != dt); + assert(dt->shared->parent != dt); if (dt->shared->parent && H5T_close_real(dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type") dt->shared->parent = NULL; @@ -4090,14 +4090,14 @@ H5T_close_real(H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(dt && dt->shared); + assert(dt && dt->shared); /* Clean up resources, depending on shared state */ if (dt->shared->state != H5T_STATE_OPEN) { if (H5T__free(dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); - HDassert(!dt->shared->owned_vol_obj); + assert(!dt->shared->owned_vol_obj); dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); } /* end if */ else @@ -4132,8 +4132,8 @@ H5T_close(H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(dt); - HDassert(dt->shared); + assert(dt); + assert(dt->shared); /* Named datatype cleanups */ if (dt->shared->state == H5T_STATE_OPEN) { @@ -4141,9 +4141,9 @@ H5T_close(H5T_t *dt) dt->shared->fo_count--; /* Sanity checks */ - HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); - HDassert(H5_addr_defined(dt->sh_loc.u.loc.oh_addr)); - HDassert(H5_addr_defined(dt->oloc.addr)); + assert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); + assert(H5_addr_defined(dt->sh_loc.u.loc.oh_addr)); + assert(H5_addr_defined(dt->oloc.addr)); /* If a named type is being closed then close the object header and * remove from the list of open objects in the file. @@ -4231,11 +4231,11 @@ H5T__set_size(H5T_t *dt, size_t size) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dt); - HDassert(dt->shared); - HDassert(size != 0); - HDassert(H5T_REFERENCE != dt->shared->type); - HDassert(!(H5T_ENUM == dt->shared->type && 0 == dt->shared->u.enumer.nmembs)); + assert(dt); + assert(dt->shared); + assert(size != 0); + assert(H5T_REFERENCE != dt->shared->type); + assert(!(H5T_ENUM == dt->shared->type && 0 == dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { if (H5T__set_size(dt->shared->parent, size) < 0) @@ -4301,7 +4301,7 @@ H5T__set_size(H5T_t *dt, size_t size) /* Compound must not have been packed previously */ /* We will check if resizing changed the packed state of * this type at the end of this function */ - HDassert(!dt->shared->u.compnd.packed); + assert(!dt->shared->u.compnd.packed); } /* end if */ break; @@ -4366,16 +4366,16 @@ H5T__set_size(H5T_t *dt, size_t size) case H5T_VLEN: case H5T_ARRAY: case H5T_REFERENCE: - HDassert("can't happen" && 0); + assert("can't happen" && 0); break; case H5T_NO_CLASS: case H5T_NCLASSES: - HDassert("invalid type" && 0); + assert("invalid type" && 0); break; default: - HDassert("not implemented yet" && 0); + assert("not implemented yet" && 0); break; } /* end switch */ @@ -4419,8 +4419,8 @@ H5T_get_size(const H5T_t *dt) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(dt); - HDassert(dt->shared); + assert(dt); + assert(dt->shared); FUNC_LEAVE_NOAPI(dt->shared->size) } /* end H5T_get_size() */ @@ -4445,8 +4445,8 @@ H5T_get_force_conv(const H5T_t *dt) FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(dt); - HDassert(dt->shared); + assert(dt); + assert(dt->shared); FUNC_LEAVE_NOAPI(dt->shared->force_conv) } /* end H5T_get_force_conv() */ @@ -4480,15 +4480,15 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) FUNC_ENTER_NOAPI(0) /* Sanity check */ - HDassert(dt1); - HDassert(dt2); + assert(dt1); + assert(dt2); /* the easy case */ if (dt1 == dt2) HGOTO_DONE(0); - HDassert(dt1->shared); - HDassert(dt2->shared); + assert(dt1->shared); + assert(dt2->shared); /* compare */ if (dt1->shared->type < dt2->shared->type) @@ -4561,10 +4561,10 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #ifdef H5T_DEBUG /* I don't quite trust the code above yet :-) --RPM */ for (u = 0; u < dt1->shared->u.compnd.nmembs - 1; u++) { - HDassert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, - dt1->shared->u.compnd.memb[idx1[u + 1]].name)); - HDassert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name, - dt2->shared->u.compnd.memb[idx2[u + 1]].name)); + assert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name, + dt1->shared->u.compnd.memb[idx1[u + 1]].name)); + assert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name, + dt2->shared->u.compnd.memb[idx2[u + 1]].name)); } #endif @@ -4658,9 +4658,9 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) #ifdef H5T_DEBUG /* I don't quite trust the code above yet :-) --RPM */ for (u = 0; u < dt1->shared->u.enumer.nmembs - 1; u++) { - HDassert( + assert( HDstrcmp(dt1->shared->u.enumer.name[idx1[u]], dt1->shared->u.enumer.name[idx1[u + 1]])); - HDassert( + assert( HDstrcmp(dt2->shared->u.enumer.name[idx2[u]], dt2->shared->u.enumer.name[idx2[u + 1]])); } #endif @@ -4718,12 +4718,12 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) break; case H5T_VLEN: - HDassert(dt1->shared->u.vlen.type > H5T_VLEN_BADTYPE && - dt1->shared->u.vlen.type < H5T_VLEN_MAXTYPE); - HDassert(dt2->shared->u.vlen.type > H5T_VLEN_BADTYPE && - dt2->shared->u.vlen.type < H5T_VLEN_MAXTYPE); - HDassert(dt1->shared->u.vlen.loc >= H5T_LOC_BADLOC && dt1->shared->u.vlen.loc < H5T_LOC_MAXLOC); - HDassert(dt2->shared->u.vlen.loc >= H5T_LOC_BADLOC && dt2->shared->u.vlen.loc < H5T_LOC_MAXLOC); + assert(dt1->shared->u.vlen.type > H5T_VLEN_BADTYPE && + dt1->shared->u.vlen.type < H5T_VLEN_MAXTYPE); + assert(dt2->shared->u.vlen.type > H5T_VLEN_BADTYPE && + dt2->shared->u.vlen.type < H5T_VLEN_MAXTYPE); + assert(dt1->shared->u.vlen.loc >= H5T_LOC_BADLOC && dt1->shared->u.vlen.loc < H5T_LOC_MAXLOC); + assert(dt2->shared->u.vlen.loc >= H5T_LOC_BADLOC && dt2->shared->u.vlen.loc < H5T_LOC_MAXLOC); /* Arbitrarily sort sequence VL datatypes before string VL datatypes */ if (dt1->shared->u.vlen.type == H5T_VLEN_SEQUENCE && @@ -4909,7 +4909,7 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, hbool_t superset) case H5T_ARRAY: case H5T_NCLASSES: default: - HDassert("not implemented yet" && 0); + assert("not implemented yet" && 0); break; } break; @@ -4953,10 +4953,10 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst) FUNC_ENTER_NOAPI(NULL) /* Sanity check */ - HDassert(src); - HDassert(src->shared); - HDassert(dst); - HDassert(dst->shared); + assert(src); + assert(src->shared); + assert(dst); + assert(dst->shared); /* Set up conversion function wrapper */ conv_func.is_app = FALSE; @@ -5013,10 +5013,10 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(src); - HDassert(src->shared); - HDassert(dst); - HDassert(dst->shared); + assert(src); + assert(src->shared); + assert(dst); + assert(dst->shared); /* * Make sure the first entry in the table is the no-op conversion path. @@ -5065,7 +5065,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co while (cmp && lt < rt) { md = (lt + rt) / 2; - HDassert(H5T_g.path[md]); + assert(H5T_g.path[md]); cmp = H5T_cmp(src, H5T_g.path[md]->src, FALSE); if (0 == cmp) cmp = H5T_cmp(dst, H5T_g.path[md]->dst, FALSE); @@ -5114,8 +5114,8 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co */ if (conv->u.app_func && (!table || (table && conv->is_app) || (table && !table->is_hard && !conv->is_app))) { - HDassert(path != table); - HDassert(NULL == path->conv.u.app_func); + assert(path != table); + assert(NULL == path->conv.u.app_func); if (path->src && (src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), FALSE)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source conversion type for query") @@ -5146,7 +5146,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co * for an applicable function and add it to the path. This can't happen * for the no-op conversion path. */ - HDassert(path->conv.u.app_func || (src && dst)); + assert(path->conv.u.app_func || (src && dst)); for (i = H5T_g.nsoft - 1; i >= 0 && !path->conv.u.app_func; --i) { hbool_t path_init_error = FALSE; @@ -5198,7 +5198,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co while (cmp && lt < rt) { md = (lt + rt) / 2; - HDassert(H5T_g.path[md]); + assert(H5T_g.path[md]); cmp = H5T_cmp(src, H5T_g.path[md]->src, FALSE); if (0 == cmp) cmp = H5T_cmp(dst, H5T_g.path[md]->dst, FALSE); @@ -5213,7 +5213,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co /* Replace an existing table entry or add a new entry */ if (table && path != table) { - HDassert(table == H5T_g.path[md]); + assert(table == H5T_g.path[md]); H5T__print_stats(table, &nprint /*in,out*/); table->cdata.command = H5T_CONV_FREE; if (table->conv.is_app) { @@ -5245,7 +5245,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co H5T_g.path[md] = path; } /* end if */ else if (path != table) { - HDassert(cmp); + assert(cmp); if ((size_t)H5T_g.npaths >= H5T_g.apaths) { size_t na = MAX(128, 2 * H5T_g.apaths); H5T_path_t **x; @@ -5309,7 +5309,7 @@ H5T_path_noop(const H5T_path_t *p) { FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(p); + assert(p); FUNC_LEAVE_NOAPI(p->is_noop || (p->is_hard && 0 == H5T_cmp(p->src, p->dst, FALSE))) } /* end H5T_path_noop() */ @@ -5344,7 +5344,7 @@ H5T_path_compound_subset(const H5T_path_t *p) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(p); + assert(p); if (p->are_compounds) ret_value = H5T__conv_struct_subset(&(p->cdata)); @@ -5368,7 +5368,7 @@ H5T_path_bkg(const H5T_path_t *p) { FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(p); + assert(p); FUNC_LEAVE_NOAPI(p->cdata.need_bkg) } /* end H5T_path_bkg() */ @@ -5488,7 +5488,7 @@ H5T_oloc(H5T_t *dt) FUNC_ENTER_NOAPI(NULL) - HDassert(dt); + assert(dt); switch (dt->shared->state) { case H5T_STATE_TRANSIENT: @@ -5497,7 +5497,7 @@ H5T_oloc(H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "not a named datatype") case H5T_STATE_NAMED: case H5T_STATE_OPEN: - HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); + assert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); ret_value = &dt->oloc; break; default: @@ -5528,7 +5528,7 @@ H5T_nameof(H5T_t *dt) FUNC_ENTER_NOAPI(NULL) - HDassert(dt); + assert(dt); switch (dt->shared->state) { case H5T_STATE_TRANSIENT: @@ -5567,7 +5567,7 @@ H5T_is_immutable(const H5T_t *dt) FUNC_ENTER_NOAPI_NOERR - HDassert(dt); + assert(dt); if (dt->shared->state == H5T_STATE_IMMUTABLE) ret_value = TRUE; @@ -5591,7 +5591,7 @@ H5T_is_named(const H5T_t *dt) FUNC_ENTER_NOAPI_NOERR - HDassert(dt); + assert(dt); if (dt->vol_obj) ret_value = TRUE; @@ -5625,11 +5625,11 @@ H5T_convert_committed_datatype(H5T_t *dt, H5F_t *f) FUNC_ENTER_NOAPI(FAIL) - HDassert(dt); - HDassert(f); + assert(dt); + assert(f); if (H5T_is_named(dt) && (dt->sh_loc.file != f)) { - HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); + assert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); H5O_msg_reset_share(H5O_DTYPE_ID, dt); if (H5O_loc_free(&dt->oloc) < 0) @@ -5677,7 +5677,7 @@ H5T_get_ref_type(const H5T_t *dt) FUNC_ENTER_NOAPI_NOERR - HDassert(dt); + assert(dt); if (dt->shared->type == H5T_REFERENCE) ret_value = dt->shared->u.atomic.u.r.rtype; @@ -5706,7 +5706,7 @@ H5T_is_sensible(const H5T_t *dt) FUNC_ENTER_NOAPI_NOERR - HDassert(dt); + assert(dt); switch (dt->shared->type) { case H5T_COMPOUND: @@ -5776,8 +5776,8 @@ H5T_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) FUNC_ENTER_NOAPI(FAIL) - HDassert(dt); - HDassert(loc >= H5T_LOC_BADLOC && loc < H5T_LOC_MAXLOC); + assert(dt); + assert(loc >= H5T_LOC_BADLOC && loc < H5T_LOC_MAXLOC); /* Datatypes can't change in size if the force_conv flag is not set */ if (dt->shared->force_conv) { @@ -5937,7 +5937,7 @@ H5T_is_relocatable(const H5T_t *dt) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(dt); + assert(dt); /* VL and reference datatypes are relocatable */ if (H5T_detect_class(dt, H5T_VLEN, FALSE) || H5T_detect_class(dt, H5T_REFERENCE, FALSE)) @@ -5969,7 +5969,7 @@ H5T__detect_vlen_ref(const H5T_t *dt) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(dt); + assert(dt); /* Check if this datatype is a vlen reference */ /* TODO currently H5T_STD_REF is always considered as a vlen type */ @@ -6036,7 +6036,7 @@ H5T_is_vl_storage(const H5T_t *dt) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(dt); + assert(dt); /* VL and region reference datatypes are stored in variable-length form */ if (H5T_detect_class(dt, H5T_VLEN, FALSE)) @@ -6072,8 +6072,8 @@ H5T__upgrade_version_cb(H5T_t *dt, void *op_value) FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(dt); - HDassert(op_value); + assert(dt); + assert(op_value); /* Special behavior for each type of datatype */ switch (dt->shared->type) { @@ -6128,7 +6128,7 @@ H5T__upgrade_version(H5T_t *dt, unsigned new_version) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dt); + assert(dt); /* Iterate over entire datatype, upgrading the version of components, if it's useful */ if (H5T__visit(dt, (H5T_VISIT_SIMPLE | H5T_VISIT_COMPLEX_LAST), H5T__upgrade_version_cb, &new_version) < @@ -6161,8 +6161,8 @@ H5T_set_version(H5F_t *f, H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(f); - HDassert(dt); + assert(f); + assert(dt); vers = H5O_dtype_ver_bounds[H5F_LOW_BOUND(f)]; if (vers > dt->shared->version) { @@ -6202,8 +6202,8 @@ H5T_patch_file(H5T_t *dt, H5F_t *f) FUNC_ENTER_NOAPI_NOERR /* Sanity check */ - HDassert(dt); - HDassert(f); + assert(dt); + assert(f); if (H5T_STATE_OPEN == dt->shared->state || H5T_STATE_NAMED == dt->shared->state) { dt->oloc.file = f; @@ -6231,9 +6231,9 @@ H5T_patch_vlen_file(H5T_t *dt, H5VL_object_t *file) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(dt); - HDassert(dt->shared); - HDassert(file); + assert(dt); + assert(dt->shared); + assert(file); if ((dt->shared->type == H5T_VLEN) && dt->shared->u.vlen.file != file) dt->shared->u.vlen.file = file; @@ -6260,9 +6260,9 @@ H5T_own_vol_obj(H5T_t *dt, H5VL_object_t *vol_obj) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(dt); - HDassert(dt->shared); - HDassert(vol_obj); + assert(dt); + assert(dt->shared); + assert(vol_obj); /* Currently no support for owning multiple VOL objects, free the previous * owned object. Currently this is only used for holding open VOL objects diff --git a/src/H5Tarray.c b/src/H5Tarray.c index d3d4c8d..e52a461 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -143,9 +143,9 @@ H5T__array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]) FUNC_ENTER_PACKAGE - HDassert(base); - HDassert(ndims <= H5S_MAX_RANK); - HDassert(dim); + assert(base); + assert(ndims <= H5S_MAX_RANK); + assert(dim); /* Build new type */ if (NULL == (ret_value = H5T__alloc())) @@ -233,8 +233,8 @@ H5T__get_array_ndims(const H5T_t *dt) { FUNC_ENTER_PACKAGE_NOERR - HDassert(dt); - HDassert(dt->shared->type == H5T_ARRAY); + assert(dt); + assert(dt->shared->type == H5T_ARRAY); /* Retrieve the number of dimensions */ FUNC_LEAVE_NOAPI((int)dt->shared->u.array.ndims) @@ -296,8 +296,8 @@ H5T__get_array_dims(const H5T_t *dt, hsize_t dims[]) FUNC_ENTER_PACKAGE_NOERR - HDassert(dt); - HDassert(dt->shared->type == H5T_ARRAY); + assert(dt); + assert(dt->shared->type == H5T_ARRAY); /* Retrieve the sizes of the dimensions */ if (dims) diff --git a/src/H5Tbit.c b/src/H5Tbit.c index c663145..032ecb8 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -174,8 +174,8 @@ H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(buf); - HDassert(size); + assert(buf); + assert(size); if (shift_dist) { size_t abs_shift_dist = (size_t)ABS(shift_dist); @@ -240,7 +240,7 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) FUNC_ENTER_PACKAGE_NOERR - HDassert(8 * sizeof(val) >= size); + assert(8 * sizeof(val) >= size); H5T__bit_copy((uint8_t *)&val, (size_t)0, buf, offset, size); switch (H5T_native_order_g) { @@ -261,7 +261,7 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) case H5T_ORDER_MIXED: default: /* This function can't return errors */ - HDassert(0 && "unknown byte order"); + assert(0 && "unknown byte order"); } /* Set return value */ @@ -286,7 +286,7 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) FUNC_ENTER_PACKAGE_NOERR - HDassert(8 * sizeof(val) >= size); + assert(8 * sizeof(val) >= size); switch (H5T_native_order_g) { case H5T_ORDER_LE: @@ -394,7 +394,7 @@ H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t directi FUNC_ENTER_PACKAGE_NOERR /* Some functions call this with value=TRUE */ - HDassert(TRUE == 1); + assert(TRUE == 1); switch (direction) { case H5T_BIT_LSB: @@ -464,7 +464,7 @@ H5T__bit_find(const uint8_t *buf, size_t offset, size_t size, H5T_sdir_t directi break; default: - HDassert(0 && "Unknown bit search direction"); + assert(0 && "Unknown bit search direction"); } /* end switch */ done: @@ -491,7 +491,7 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ FUNC_ENTER_PACKAGE_NOERR - HDassert(buf); + assert(buf); start %= 8; @@ -556,8 +556,8 @@ H5T__bit_dec(uint8_t *buf, size_t start, size_t size) /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ FUNC_ENTER_PACKAGE_NOERR - HDassert(buf); - HDassert(size); + assert(buf); + assert(size); /* The first partial byte */ if ((size + start - 1) / 8 > idx) { @@ -631,8 +631,8 @@ H5T__bit_neg(uint8_t *buf, size_t start, size_t size) /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ FUNC_ENTER_PACKAGE_NOERR - HDassert(buf); - HDassert(size); + assert(buf); + assert(size); /* The first partial byte */ tmp[0] = (uint8_t)~buf[idx]; diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 2a65d5c..922b2f5 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -249,11 +249,11 @@ H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, hid_t lcpl_ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(loc); - HDassert(name && *name); - HDassert(dt); - HDassert(lcpl_id != H5P_DEFAULT); - HDassert(tcpl_id != H5P_DEFAULT); + assert(loc); + assert(name && *name); + assert(dt); + assert(lcpl_id != H5P_DEFAULT); + assert(tcpl_id != H5P_DEFAULT); /* Record the type's state so that we can revert to it if linking fails */ old_state = dt->shared->state; @@ -270,7 +270,7 @@ H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, hid_t lcpl_ /* Create the new named datatype and link it to its parent group */ if (H5L_link_object(loc, name, &ocrt_info, lcpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create and link to named datatype") - HDassert(ocrt_info.new_obj); + assert(ocrt_info.new_obj); done: /* If the datatype was committed but something failed after that, we need @@ -402,9 +402,9 @@ H5T__commit_anon(H5F_t *file, H5T_t *type, hid_t tcpl_id) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(file); - HDassert(type); - HDassert(tcpl_id != H5P_DEFAULT); + assert(file); + assert(type); + assert(tcpl_id != H5P_DEFAULT); /* Commit the type */ if (H5T__commit(file, type, tcpl_id) < 0) @@ -448,9 +448,9 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id) FUNC_ENTER_PACKAGE - HDassert(file); - HDassert(type); - HDassert(tcpl_id != H5P_DEFAULT); + assert(file); + assert(type); + assert(tcpl_id != H5P_DEFAULT); /* Check if we are allowed to write to this file */ if (0 == (H5F_INTENT(file) & H5F_ACC_RDWR)) @@ -489,7 +489,7 @@ H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id) /* Calculate message size information, for creating object header */ dtype_size = H5O_msg_size_f(file, tcpl_id, H5O_DTYPE_ID, type, (size_t)0); - HDassert(dtype_size); + assert(dtype_size); /* * Create the object header and open it for write access. Insert the data @@ -600,8 +600,8 @@ H5T_link(const H5T_t *type, int adjust) FUNC_ENTER_NOAPI((-1)) - HDassert(type); - HDassert(type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); + assert(type); + assert(type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); /* Adjust the link count on the named datatype */ if ((ret_value = H5O_link(&type->oloc, adjust)) < 0) @@ -937,7 +937,7 @@ H5T__get_create_plist(const H5T_t *type) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(type); + assert(type); /* Copy the default datatype creation property list */ if (NULL == (tcpl_plist = (H5P_genplist_t *)H5I_object(H5P_LST_DATATYPE_CREATE_ID_g))) @@ -992,8 +992,8 @@ H5T__open_name(const H5G_loc_t *loc, const char *name) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(loc); - HDassert(name); + assert(loc); + assert(name); /* Set up datatype location to fill in */ type_loc.oloc = &oloc; @@ -1053,7 +1053,7 @@ H5T_open(const H5G_loc_t *loc) FUNC_ENTER_NOAPI(NULL) - HDassert(loc); + assert(loc); /* Check if datatype was already open */ if (NULL == (shared_fo = (H5T_shared_t *)H5FO_opened(loc->oloc->file, loc->oloc->addr))) { @@ -1172,7 +1172,7 @@ H5T__open_oid(const H5G_loc_t *loc) FUNC_ENTER_PACKAGE_TAG(loc->oloc->addr) - HDassert(loc); + assert(loc); /* Open named datatype object in file */ if (H5O_open(loc->oloc) < 0) @@ -1224,7 +1224,7 @@ H5T_update_shared(H5T_t *dt) { FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(dt); + assert(dt); /* Set the shared location fields from the named datatype info */ H5O_UPDATE_SHARED(&(dt->sh_loc), H5O_SHARE_TYPE_COMMITTED, dt->oloc.file, H5O_DTYPE_ID, 0, dt->oloc.addr) @@ -1358,7 +1358,7 @@ H5T_save_refresh_state(hid_t tid, H5O_shared_t *cached_H5O_shared) FUNC_ENTER_NOAPI(FAIL) - HDassert(cached_H5O_shared); + assert(cached_H5O_shared); if (NULL == (dt = (H5T_t *)H5I_object_verify(tid, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid is not a datatype ID") @@ -1398,7 +1398,7 @@ H5T_restore_refresh_state(hid_t tid, H5O_shared_t *cached_H5O_shared) FUNC_ENTER_NOAPI(FAIL) - HDassert(cached_H5O_shared); + assert(cached_H5O_shared); if (NULL == (dt = (H5T_t *)H5I_object_verify(tid, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "tid not a datatype ID") @@ -1435,7 +1435,7 @@ H5T_already_vol_managed(const H5T_t *dt) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(dt); + assert(dt); FUNC_LEAVE_NOAPI(dt->vol_obj != NULL) } /* end H5T_already_vol_managed() */ diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 201d3ae..6c97d2e 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -130,8 +130,8 @@ H5T_get_member_offset(const H5T_t *dt, unsigned membno) { FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(dt); - HDassert(membno < dt->shared->u.compnd.nmembs); + assert(dt); + assert(membno < dt->shared->u.compnd.nmembs); FUNC_LEAVE_NOAPI(dt->shared->u.compnd.memb[membno].offset) } /* end H5T_get_member_offset() */ @@ -248,8 +248,8 @@ H5T_get_member_type(const H5T_t *dt, unsigned membno) FUNC_ENTER_NOAPI(NULL) /* Sanity checks */ - HDassert(dt); - HDassert(membno < dt->shared->u.compnd.nmembs); + assert(dt); + assert(membno < dt->shared->u.compnd.nmembs); /* Copy datatype */ if (NULL == (ret_value = H5T_copy(dt->shared->u.compnd.memb[membno].type, H5T_COPY_TRANSIENT))) @@ -284,8 +284,8 @@ H5T__reopen_member_type(const H5T_t *dt, unsigned membno) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dt); - HDassert(membno < dt->shared->u.compnd.nmembs); + assert(dt); + assert(membno < dt->shared->u.compnd.nmembs); /* Copy datatype, possibly re-opening it */ if (NULL == (ret_value = H5T_copy_reopen(dt->shared->u.compnd.memb[membno].type))) @@ -313,8 +313,8 @@ H5T__get_member_size(const H5T_t *dt, unsigned membno) { FUNC_ENTER_PACKAGE_NOERR - HDassert(dt); - HDassert(membno < dt->shared->u.compnd.nmembs); + assert(dt); + assert(membno < dt->shared->u.compnd.nmembs); FUNC_LEAVE_NOAPI(dt->shared->u.compnd.memb[membno].type->shared->size) } /* end H5T__get_member_size() */ @@ -433,10 +433,10 @@ H5T__insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member) FUNC_ENTER_PACKAGE /* check args */ - HDassert(parent && H5T_COMPOUND == parent->shared->type); - HDassert(H5T_STATE_TRANSIENT == parent->shared->state); - HDassert(member); - HDassert(name && *name); + assert(parent && H5T_COMPOUND == parent->shared->type); + assert(H5T_STATE_TRANSIENT == parent->shared->state); + assert(member); + assert(name && *name); /* Does NAME already exist in PARENT? */ for (i = 0; i < parent->shared->u.compnd.nmembs; i++) @@ -482,7 +482,7 @@ H5T__insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member) /* It should not be possible to get this far if the type is already packed * - the new member would overlap something */ - HDassert(!(parent->shared->u.compnd.packed)); + assert(!(parent->shared->u.compnd.packed)); /* Determine if the compound datatype becomes packed */ H5T__update_packed(parent); @@ -524,7 +524,7 @@ H5T__pack(const H5T_t *dt) FUNC_ENTER_PACKAGE - HDassert(dt); + assert(dt); if (H5T_detect_class(dt, H5T_COMPOUND, FALSE) > 0) { /* If datatype has been packed, skip packing it and indicate success */ @@ -599,7 +599,7 @@ H5T__is_packed(const H5T_t *dt) FUNC_ENTER_PACKAGE_NOERR - HDassert(dt); + assert(dt); /* Go up the chain as far as possible */ while (dt->shared->parent) @@ -634,8 +634,8 @@ H5T__update_packed(const H5T_t *dt) FUNC_ENTER_PACKAGE_NOERR - HDassert(dt); - HDassert(dt->shared->type == H5T_COMPOUND); + assert(dt); + assert(dt->shared->type == H5T_COMPOUND); /* First check if all space is used in the "top level" type */ if (dt->shared->size == dt->shared->u.compnd.memb_size) { diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 7c50a3c..937cad2 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -745,8 +745,8 @@ case H5T_CONV_CONV: \ /* Initialize source & destination strides */ \ if (buf_stride) { \ - HDassert(buf_stride >= sizeof(ST)); \ - HDassert(buf_stride >= sizeof(DT)); \ + assert(buf_stride >= sizeof(ST)); \ + assert(buf_stride >= sizeof(DT)); \ s_stride = d_stride = (ssize_t)buf_stride; \ } \ else { \ @@ -870,13 +870,13 @@ done: #define H5T_CONV_SET_PREC_Y \ /* Get source & destination precisions into a variable */ \ tclass = st->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + assert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ if (tclass == H5T_INTEGER) \ sprec = st->shared->u.atomic.prec; \ else \ sprec = 1 + st->shared->u.atomic.u.f.msize; \ tclass = dt->shared->type; \ - HDassert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ + assert(tclass == H5T_INTEGER || tclass == H5T_FLOAT); \ if (tclass == H5T_INTEGER) \ dprec = dt->shared->u.atomic.prec; \ else \ @@ -1773,11 +1773,11 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d == dbuf) - HDassert((dp >= sp && dp < sp + src->shared->size) || - (sp >= dp && sp < dp + dst->shared->size)); + assert((dp >= sp && dp < sp + src->shared->size) || + (sp >= dp && sp < dp + dst->shared->size)); else - HDassert((dp < sp && dp + dst->shared->size <= sp) || - (sp < dp && sp + src->shared->size <= dp)); + assert((dp < sp && dp + dst->shared->size <= sp) || + (sp < dp && sp + src->shared->size <= dp)); #endif /* @@ -1938,9 +1938,9 @@ H5T__conv_struct_free(H5T_conv_struct_t *priv) int H5_ATTR_NDEBUG_UNUSED status; status = H5I_dec_ref(src_memb_id[i]); - HDassert(status >= 0); + assert(status >= 0); status = H5I_dec_ref(dst_memb_id[src2dst[i]]); - HDassert(status >= 0); + assert(status >= 0); } /* end if */ H5MM_xfree(src2dst); @@ -2055,12 +2055,12 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) type = H5T_copy(src->shared->u.compnd.memb[i].type, H5T_COPY_ALL); tid = H5I_register(H5I_DATATYPE, type, FALSE); - HDassert(tid >= 0); + assert(tid >= 0); priv->src_memb_id[i] = tid; type = H5T_copy(dst->shared->u.compnd.memb[src2dst[i]].type, H5T_COPY_ALL); tid = H5I_register(H5I_DATATYPE, type, FALSE); - HDassert(tid >= 0); + assert(tid >= 0); priv->dst_memb_id[src2dst[i]] = tid; } /* end if */ } /* end for */ @@ -2182,8 +2182,8 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata) FUNC_ENTER_PACKAGE_NOERR - HDassert(cdata); - HDassert(cdata->priv); + assert(cdata); + assert(cdata->priv); priv = (H5T_conv_struct_t *)(cdata->priv); @@ -2271,8 +2271,8 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype") - HDassert(priv); - HDassert(bkg && cdata->need_bkg); + assert(priv); + assert(bkg && cdata->need_bkg); if (cdata->recalc && H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") @@ -2367,7 +2367,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, offset -= dst_memb->size; HDmemmove(xbkg + dst_memb->offset, xbuf + offset, dst_memb->size); } /* end for */ - HDassert(0 == offset); + assert(0 == offset); /* * Update pointers @@ -2543,9 +2543,9 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm if (cdata->recalc && H5T__conv_struct_init(src, dst, cdata) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data") priv = (H5T_conv_struct_t *)(cdata->priv); - HDassert(priv); + assert(priv); src2dst = priv->src2dst; - HDassert(bkg && cdata->need_bkg); + assert(bkg && cdata->need_bkg); /* * Insure that members are sorted. @@ -2769,7 +2769,7 @@ H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) } } /* end for */ - HDassert(domain[1] >= domain[0]); + assert(domain[1] >= domain[0]); length = (unsigned)(domain[1] - domain[0]) + 1; if (src->shared->u.enumer.nmembs < 2 || (double)length / src->shared->u.enumer.nmembs < (double)(1.2F)) { @@ -2789,8 +2789,8 @@ H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) n = *( (int *)((void *)((uint8_t *)src->shared->u.enumer.value + (i * src->shared->size)))); n -= priv->base; - HDassert(n >= 0 && (unsigned)n < priv->length); - HDassert(map[n] < 0); + assert(n >= 0 && (unsigned)n < priv->length); + assert(map[n] < 0); map[n] = priv->src2dst[i]; } /* end for */ @@ -2991,7 +2991,7 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si "can't handle conversion exception") } /* end if */ else { - HDassert(priv->src2dst[md] >= 0); + assert(priv->src2dst[md] >= 0); H5MM_memcpy(d, (uint8_t *)dst->shared->u.enumer.value + ((unsigned)priv->src2dst[md] * dst->shared->size), @@ -3189,8 +3189,8 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si /* Initialize source & destination strides */ if (buf_stride) { - HDassert(buf_stride >= src->shared->size); - HDassert(buf_stride >= dst->shared->size); + assert(buf_stride >= src->shared->size); + assert(buf_stride >= dst->shared->size); H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); s_stride = d_stride = (ssize_t)buf_stride; } /* end if */ @@ -3272,9 +3272,9 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si /* Check if we need to go backwards through the buffer */ if (d_stride > s_stride) { /* Sanity check */ - HDassert(s_stride > 0); - HDassert(d_stride > 0); - HDassert(b_stride >= 0); + assert(s_stride > 0); + assert(d_stride > 0); + assert(b_stride >= 0); /* Compute the number of "safe" destination elements at */ /* the end of the buffer (Those which don't overlap with */ @@ -3381,7 +3381,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si * the sequence into the background buffer */ if (nested) { /* Sanity check */ - HDassert(write_to_file); + assert(write_to_file); /* Get length of background element sequence */ if ((*(dst->shared->u.vlen.cls->getlen))(dst->shared->u.vlen.file, b, @@ -3431,7 +3431,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si size_t u; /* Sanity check */ - HDassert(write_to_file); + assert(write_to_file); tmp = (uint8_t *)tmp_buf + seq_len * dst_base_size; for (u = seq_len; u < bg_seq_len; u++, tmp += dst_base_size) { @@ -3523,8 +3523,8 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s */ if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - HDassert(H5T_ARRAY == src->shared->type); - HDassert(H5T_ARRAY == dst->shared->type); + assert(H5T_ARRAY == src->shared->type); + assert(H5T_ARRAY == dst->shared->type); /* Check the number and sizes of the dimensions */ if (src->shared->u.array.ndims != dst->shared->u.array.ndims) @@ -3696,12 +3696,12 @@ H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - HDassert(src->shared->u.atomic.u.r.cls); + assert(src->shared->u.atomic.u.r.cls); /* Initialize source & destination strides */ if (buf_stride) { - HDassert(buf_stride >= src->shared->size); - HDassert(buf_stride >= dst->shared->size); + assert(buf_stride >= src->shared->size); + assert(buf_stride >= dst->shared->size); H5_CHECK_OVERFLOW(buf_stride, size_t, ssize_t); s_stride = d_stride = (ssize_t)buf_stride; } /* end if */ @@ -3726,9 +3726,9 @@ H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* Check if we need to go backwards through the buffer */ if (d_stride > s_stride) { /* Sanity check */ - HDassert(s_stride > 0); - HDassert(d_stride > 0); - HDassert(b_stride >= 0); + assert(s_stride > 0); + assert(d_stride > 0); + assert(b_stride >= 0); /* Compute the number of "safe" destination elements at */ /* the end of the buffer (Those which don't overlap with */ @@ -3964,12 +3964,12 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d == dbuf) { - HDassert((dp >= sp && dp < sp + src->shared->size) || - (sp >= dp && sp < dp + dst->shared->size)); + assert((dp >= sp && dp < sp + src->shared->size) || + (sp >= dp && sp < dp + dst->shared->size)); } else { - HDassert((dp < sp && dp + dst->shared->size <= sp) || - (sp < dp && sp + src->shared->size <= dp)); + assert((dp < sp && dp + dst->shared->size <= sp) || + (sp < dp && sp + src->shared->size <= dp)); } #endif @@ -4231,14 +4231,14 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * Set padding areas in destination. */ if (dst->shared->u.atomic.offset > 0) { - HDassert(H5T_PAD_ZERO == dst->shared->u.atomic.lsb_pad || - H5T_PAD_ONE == dst->shared->u.atomic.lsb_pad); + assert(H5T_PAD_ZERO == dst->shared->u.atomic.lsb_pad || + H5T_PAD_ONE == dst->shared->u.atomic.lsb_pad); H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, (hbool_t)(H5T_PAD_ONE == dst->shared->u.atomic.lsb_pad)); } if (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec != 8 * dst->shared->size) { - HDassert(H5T_PAD_ZERO == dst->shared->u.atomic.msb_pad || - H5T_PAD_ONE == dst->shared->u.atomic.msb_pad); + assert(H5T_PAD_ZERO == dst->shared->u.atomic.msb_pad || + H5T_PAD_ONE == dst->shared->u.atomic.msb_pad); H5T__bit_set(d, dst->shared->u.atomic.offset + dst->shared->u.atomic.prec, 8 * dst->shared->size - (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec), @@ -4428,12 +4428,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d == dbuf) { - HDassert((dp >= sp && dp < sp + src_p->shared->size) || - (sp >= dp && sp < dp + dst_p->shared->size)); + assert((dp >= sp && dp < sp + src_p->shared->size) || + (sp >= dp && sp < dp + dst_p->shared->size)); } else { - HDassert((dp < sp && dp + dst_p->shared->size <= sp) || - (sp < dp && sp + src_p->shared->size <= dp)); + assert((dp < sp && dp + dst_p->shared->size <= sp) || + (sp < dp && sp + src_p->shared->size <= dp)); } #endif @@ -4452,7 +4452,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (H5T_ORDER_VAX == src.order) { tsize = src_p->shared->size; - HDassert(0 == tsize % 2); + assert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = s[i]; @@ -4633,7 +4633,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * the source exponent bias. */ if (0 == expo || H5T_NORM_NONE == src.u.f.norm) { - HDassert(bitno >= 0); + assert(bitno >= 0); expo -= (int64_t)((src.u.f.ebias - 1) + (src.u.f.msize - (size_t)bitno)); } else if (H5T_NORM_IMPLIED == src.u.f.norm) { @@ -4713,7 +4713,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz */ if (msize > 0 && mrsh <= dst.u.f.msize && mrsh + msize > dst.u.f.msize) { bitno = (ssize_t)(mrsh + msize - dst.u.f.msize); - HDassert(bitno >= 0 && (size_t)bitno <= msize); + assert(bitno >= 0 && (size_t)bitno <= msize); /* If the 1st bit being cut off is set and source isn't denormalized.*/ if (H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && !denormalized) { /* Don't do rounding if exponent is 111...110 and mantissa is 111...11. @@ -4807,11 +4807,11 @@ padding: * Set external padding areas */ if (dst.offset > 0) { - HDassert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); + assert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE == dst.lsb_pad)); } if (dst.offset + dst.prec != 8 * dst_p->shared->size) { - HDassert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); + assert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); H5T__bit_set(d, dst.offset + dst.prec, 8 * dst_p->shared->size - (dst.offset + dst.prec), (hbool_t)(H5T_PAD_ONE == dst.msb_pad)); } @@ -4830,7 +4830,7 @@ padding: } else if (H5T_ORDER_VAX == dst.order && reverse) { tsize = dst_p->shared->size; - HDassert(0 == tsize % 2); + assert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = d[i]; @@ -4995,15 +4995,15 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (src->shared->size == dst->shared->size || buf_stride) { - HDassert(s == d); + assert(s == d); } else if (d == dbuf) { - HDassert((dp >= sp && dp < sp + src->shared->size) || - (sp >= dp && sp < dp + dst->shared->size)); + assert((dp >= sp && dp < sp + src->shared->size) || + (sp >= dp && sp < dp + dst->shared->size)); } else { - HDassert((dp < sp && dp + dst->shared->size <= sp) || - (sp < dp && sp + src->shared->size <= dp)); + assert((dp < sp && dp + dst->shared->size <= sp) || + (sp < dp && sp + src->shared->size <= dp)); } #endif @@ -8528,12 +8528,12 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d == dbuf) { - HDassert((dp >= sp && dp < sp + src_p->shared->size) || - (sp >= dp && sp < dp + dst_p->shared->size)); + assert((dp >= sp && dp < sp + src_p->shared->size) || + (sp >= dp && sp < dp + dst_p->shared->size)); } else { - HDassert((dp < sp && dp + dst_p->shared->size <= sp) || - (sp < dp && sp + src_p->shared->size <= dp)); + assert((dp < sp && dp + dst_p->shared->size <= sp) || + (sp < dp && sp + src_p->shared->size <= dp)); } #endif /* @@ -8551,7 +8551,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (H5T_ORDER_VAX == src.order) { tsize = src_p->shared->size; - HDassert(0 == tsize % 2); + assert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = s[i]; @@ -8961,11 +8961,11 @@ padding: * Set padding areas in destination. */ if (dst.offset > 0) { - HDassert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); + assert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE == dst.lsb_pad)); } if (dst.offset + dst.prec != 8 * dst_p->shared->size) { - HDassert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); + assert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); H5T__bit_set(d, dst.offset + dst.prec, 8 * dst_p->shared->size - (dst.offset + dst.prec), (hbool_t)(H5T_PAD_ONE == dst.msb_pad)); } @@ -9161,12 +9161,12 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz #ifndef NDEBUG /* I don't quite trust the overlap calculations yet --rpm */ if (d == dbuf) { - HDassert((dp >= sp && dp < sp + src_p->shared->size) || - (sp >= dp && sp < dp + dst_p->shared->size)); + assert((dp >= sp && dp < sp + src_p->shared->size) || + (sp >= dp && sp < dp + dst_p->shared->size)); } else { - HDassert((dp < sp && dp + dst_p->shared->size <= sp) || - (sp < dp && sp + src_p->shared->size <= dp)); + assert((dp < sp && dp + dst_p->shared->size <= sp) || + (sp < dp && sp + src_p->shared->size <= dp)); } #endif @@ -9373,11 +9373,11 @@ padding: * Set padding areas in destination. */ if (dst.offset > 0) { - HDassert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); + assert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE == dst.lsb_pad)); } if (dst.offset + dst.prec != 8 * dst_p->shared->size) { - HDassert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); + assert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); H5T__bit_set(d, dst.offset + dst.prec, 8 * dst_p->shared->size - (dst.offset + dst.prec), (hbool_t)(H5T_PAD_ONE == dst.msb_pad)); } @@ -9396,7 +9396,7 @@ padding: } else if (H5T_ORDER_VAX == dst.order && reverse) { tsize = dst_p->shared->size; - HDassert(0 == tsize % 2); + assert(0 == tsize % 2); for (i = 0; i < tsize; i += 4) { tmp1 = d[i]; @@ -9466,8 +9466,8 @@ H5T__reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) FUNC_ENTER_PACKAGE_NOERR - HDassert(s); - HDassert(size); + assert(s); + assert(size); if (H5T_ORDER_VAX == order) { for (i = 0; i < size; i += 2) { @@ -9509,9 +9509,9 @@ H5T_reclaim(hid_t type_id, H5S_t *space, void *buf) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(H5I_DATATYPE == H5I_get_type(type_id)); - HDassert(space); - HDassert(buf); + assert(H5I_DATATYPE == H5I_get_type(type_id)); + assert(space); + assert(buf); if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") @@ -9549,15 +9549,15 @@ H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned H5_ATTR_UNUSED ndim, const FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(elem); - HDassert(dt); + assert(elem); + assert(dt); if (dt->shared->type == H5T_REFERENCE) { if (H5T__ref_reclaim(elem, dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't reclaim ref elements") } else { - HDassert(op_data); + assert(op_data); /* Allow vlen reclaim to recurse into that routine */ if (H5T__vlen_reclaim(elem, dt, (H5T_vlen_alloc_info_t *)op_data) < 0) diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 8b63878..2f14a0f 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -148,8 +148,8 @@ H5T_debug(const H5T_t *dt, FILE *stream) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - HDassert(dt); - HDassert(stream); + assert(dt); + assert(stream); switch (dt->shared->type) { case H5T_NO_CLASS: @@ -224,7 +224,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) s2 = "[named,open]"; break; default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); } /* end switch */ HDfprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); diff --git a/src/H5Tenum.c b/src/H5Tenum.c index bf9b671..15a8c91 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -92,14 +92,14 @@ H5T__enum_create(const H5T_t *parent) FUNC_ENTER_PACKAGE - HDassert(parent); + assert(parent); /* Build new type */ if (NULL == (ret_value = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") ret_value->shared->type = H5T_ENUM; ret_value->shared->parent = H5T_copy(parent, H5T_COPY_ALL); - HDassert(ret_value->shared->parent); + assert(ret_value->shared->parent); ret_value->shared->size = ret_value->shared->parent->shared->size; done: @@ -177,9 +177,9 @@ H5T__enum_insert(const H5T_t *dt, const char *name, const void *value) FUNC_ENTER_PACKAGE - HDassert(dt); - HDassert(name && *name); - HDassert(value); + assert(dt); + assert(name && *name); + assert(value); /* The name and value had better not already exist */ for (i = 0; i < dt->shared->u.enumer.nmembs; i++) { @@ -276,8 +276,8 @@ H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value /*out*/) { FUNC_ENTER_PACKAGE_NOERR - HDassert(dt); - HDassert(value); + assert(dt); + assert(value); H5MM_memcpy(value, (uint8_t *)dt->shared->u.enumer.value + (membno * dt->shared->size), dt->shared->size); @@ -365,9 +365,9 @@ H5T__enum_nameof(const H5T_t *dt, const void *value, char *name /*out*/, size_t FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dt && H5T_ENUM == dt->shared->type); - HDassert(value); - HDassert(name || 0 == size); + assert(dt && H5T_ENUM == dt->shared->type); + assert(value); + assert(name || 0 == size); if (name && size > 0) *name = '\0'; @@ -495,9 +495,9 @@ H5T__enum_valueof(const H5T_t *dt, const char *name, void *value /*out*/) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dt && H5T_ENUM == dt->shared->type); - HDassert(name && *name); - HDassert(value); + assert(dt && H5T_ENUM == dt->shared->type); + assert(name && *name); + assert(value); /* Sanity check */ if (dt->shared->u.enumer.nmembs == 0) diff --git a/src/H5Tfields.c b/src/H5Tfields.c index 9317ab9..b2e3075 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -85,7 +85,7 @@ H5T_get_nmembers(const H5T_t *dt) FUNC_ENTER_NOAPI(FAIL) - HDassert(dt); + assert(dt); if (H5T_COMPOUND == dt->shared->type) ret_value = (int)dt->shared->u.compnd.nmembs; @@ -161,7 +161,7 @@ H5T__get_member_name(H5T_t const *dt, unsigned membno) FUNC_ENTER_PACKAGE - HDassert(dt); + assert(dt); switch (dt->shared->type) { case H5T_COMPOUND: @@ -222,7 +222,7 @@ H5Tget_member_index(hid_t type_id, const char *name) H5TRACE2("Is", "i*s", type_id, name); /* Check arguments */ - HDassert(name); + assert(name); if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") @@ -287,8 +287,8 @@ H5T__sort_value(const H5T_t *dt, int *map) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(dt); - HDassert(H5T_COMPOUND == dt->shared->type || H5T_ENUM == dt->shared->type); + assert(dt); + assert(H5T_COMPOUND == dt->shared->type || H5T_ENUM == dt->shared->type); /* Use a bubble sort because we can short circuit */ if (H5T_COMPOUND == dt->shared->type) { @@ -314,7 +314,7 @@ H5T__sort_value(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i = 0; i < (nmembs - 1); i++) - HDassert(dt->shared->u.compnd.memb[i].offset < dt->shared->u.compnd.memb[i + 1].offset); + assert(dt->shared->u.compnd.memb[i].offset < dt->shared->u.compnd.memb[i + 1].offset); #endif } /* end if */ } @@ -323,7 +323,7 @@ H5T__sort_value(const H5T_t *dt, int *map) dt->shared->u.enumer.sorted = H5T_SORT_VALUE; nmembs = dt->shared->u.enumer.nmembs; size = dt->shared->size; - HDassert(size <= sizeof(tbuf)); + assert(size <= sizeof(tbuf)); for (i = (nmembs - 1), swapped = TRUE; i > 0 && swapped; --i) { for (j = 0, swapped = FALSE; j < i; j++) { if (HDmemcmp((uint8_t *)dt->shared->u.enumer.value + (j * size), @@ -354,8 +354,8 @@ H5T__sort_value(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i = 0; i < (nmembs - 1); i++) - HDassert(HDmemcmp((uint8_t *)dt->shared->u.enumer.value + (i * size), - (uint8_t *)dt->shared->u.enumer.value + ((i + 1) * size), size) < 0); + assert(HDmemcmp((uint8_t *)dt->shared->u.enumer.value + (i * size), + (uint8_t *)dt->shared->u.enumer.value + ((i + 1) * size), size) < 0); #endif } /* end if */ } /* end else */ @@ -390,8 +390,8 @@ H5T__sort_name(const H5T_t *dt, int *map) FUNC_ENTER_PACKAGE_NOERR /* Check args */ - HDassert(dt); - HDassert(H5T_COMPOUND == dt->shared->type || H5T_ENUM == dt->shared->type); + assert(dt); + assert(H5T_COMPOUND == dt->shared->type || H5T_ENUM == dt->shared->type); /* Use a bubble sort because we can short circuit */ if (H5T_COMPOUND == dt->shared->type) { @@ -417,8 +417,8 @@ H5T__sort_name(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i = 0; i < nmembs - 1; i++) { - HDassert(HDstrcmp(dt->shared->u.compnd.memb[i].name, dt->shared->u.compnd.memb[i + 1].name) < - 0); + assert(HDstrcmp(dt->shared->u.compnd.memb[i].name, dt->shared->u.compnd.memb[i + 1].name) < + 0); } #endif } @@ -428,7 +428,7 @@ H5T__sort_name(const H5T_t *dt, int *map) dt->shared->u.enumer.sorted = H5T_SORT_NAME; nmembs = dt->shared->u.enumer.nmembs; size = dt->shared->size; - HDassert(size <= sizeof(tbuf)); + assert(size <= sizeof(tbuf)); for (i = nmembs - 1, swapped = TRUE; i > 0 && swapped; --i) { for (j = 0, swapped = FALSE; j < i; j++) { if (HDstrcmp(dt->shared->u.enumer.name[j], dt->shared->u.enumer.name[j + 1]) > 0) { @@ -457,7 +457,7 @@ H5T__sort_name(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i = 0; i < nmembs - 1; i++) - HDassert(HDstrcmp(dt->shared->u.enumer.name[i], dt->shared->u.enumer.name[i + 1]) < 0); + assert(HDstrcmp(dt->shared->u.enumer.name[i], dt->shared->u.enumer.name[i + 1]) < 0); #endif } } diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index 9bf7da3..02b158b 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -77,7 +77,7 @@ H5T_get_sign(H5T_t const *dt) FUNC_ENTER_NOAPI(H5T_SGN_ERROR) - HDassert(dt); + assert(dt); /* Defer to parent */ while (dt->shared->parent) diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 5fe4998..71ff1ee 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -141,7 +141,7 @@ H5T__get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_ali FUNC_ENTER_PACKAGE - HDassert(dtype); + assert(dtype); if (H5T_NO_CLASS == (h5_class = H5T_get_class(dtype, FALSE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid class") @@ -668,7 +668,7 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, } /* end switch */ /* Create new native type */ - HDassert(tid >= 0); + assert(tid >= 0); if (NULL == (dt = (H5T_t *)H5I_object(tid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") @@ -724,7 +724,7 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali FUNC_ENTER_PACKAGE - HDassert(size > 0); + assert(size > 0); if (direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if (size <= sizeof(float)) { @@ -782,7 +782,7 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali } /* end switch */ /* Create new native type */ - HDassert(tid >= 0); + assert(tid >= 0); if (NULL == (dt = (H5T_t *)H5I_object(tid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") if ((ret_value = H5T_copy(dt, H5T_COPY_TRANSIENT)) == NULL) @@ -883,7 +883,7 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction, size_t *struct_ } /* Create new native type */ - HDassert(tid >= 0); + assert(tid >= 0); if (NULL == (dt = (H5T_t *)H5I_object(tid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") diff --git a/src/H5Toffset.c b/src/H5Toffset.c index 99f3aa0..a99aedb 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -232,12 +232,12 @@ H5T__set_offset(const H5T_t *dt, size_t offset) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dt); - HDassert(H5T_STRING != dt->shared->type || 0 == offset); - HDassert(H5T_REFERENCE != dt->shared->type); - HDassert(H5T_OPAQUE != dt->shared->type); - HDassert(H5T_COMPOUND != dt->shared->type); - HDassert(!(H5T_ENUM == dt->shared->type && 0 == dt->shared->u.enumer.nmembs)); + assert(dt); + assert(H5T_STRING != dt->shared->type || 0 == offset); + assert(H5T_REFERENCE != dt->shared->type); + assert(H5T_OPAQUE != dt->shared->type); + assert(H5T_COMPOUND != dt->shared->type); + assert(!(H5T_ENUM == dt->shared->type && 0 == dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { if (H5T__set_offset(dt->shared->parent, offset) < 0) diff --git a/src/H5Toh.c b/src/H5Toh.c index a1891a6..50c0236 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -93,7 +93,7 @@ H5O__dtype_isa(const H5O_t *oh) FUNC_ENTER_PACKAGE - HDassert(oh); + assert(oh); if ((ret_value = H5O_msg_exists_oh(oh, H5O_DTYPE_ID)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to read object header") @@ -123,7 +123,7 @@ H5O__dtype_open(const H5G_loc_t *obj_loc, H5I_type_t *opened_type) FUNC_ENTER_PACKAGE - HDassert(obj_loc); + assert(obj_loc); *opened_type = H5I_DATATYPE; @@ -163,9 +163,9 @@ H5O__dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(f); - HDassert(crt_info); - HDassert(obj_loc); + assert(f); + assert(crt_info); + assert(obj_loc); /* Commit the type to the file */ if (H5T__commit(f, crt_info->dt, crt_info->tcpl_id) < 0) diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index 4505ea3..b26168c 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -193,12 +193,12 @@ H5T__set_precision(const H5T_t *dt, size_t prec) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(dt); - HDassert(prec > 0); - HDassert(H5T_OPAQUE != dt->shared->type); - HDassert(H5T_COMPOUND != dt->shared->type); - HDassert(H5T_STRING != dt->shared->type); - HDassert(!(H5T_ENUM == dt->shared->type && 0 == dt->shared->u.enumer.nmembs)); + assert(dt); + assert(prec > 0); + assert(H5T_OPAQUE != dt->shared->type); + assert(H5T_COMPOUND != dt->shared->type); + assert(H5T_STRING != dt->shared->type); + assert(!(H5T_ENUM == dt->shared->type && 0 == dt->shared->u.enumer.nmembs)); if (dt->shared->parent) { if (H5T__set_precision(dt->shared->parent, prec) < 0) diff --git a/src/H5Tref.c b/src/H5Tref.c index c443d36..39e4774 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -164,9 +164,9 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG("loc=%d", (int)loc); - HDassert(dt); + assert(dt); /* f is NULL when loc == H5T_LOC_MEMORY */ - HDassert(loc >= H5T_LOC_BADLOC && loc < H5T_LOC_MAXLOC); + assert(loc >= H5T_LOC_BADLOC && loc < H5T_LOC_MAXLOC); /* Only change the location if it's different */ if (loc == dt->shared->u.atomic.u.r.loc && file == dt->shared->u.atomic.u.r.file) @@ -220,7 +220,7 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) break; case H5T_LOC_DISK: /* Disk based reference datatype */ - HDassert(file); + assert(file); /* Mark this type as being stored on disk */ dt->shared->u.atomic.u.r.loc = H5T_LOC_DISK; @@ -245,7 +245,7 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -273,7 +273,7 @@ H5T__ref_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -367,8 +367,8 @@ H5T__ref_mem_isnull(const H5VL_object_t H5_ATTR_UNUSED *src_file, const void *sr H5T_REF_LOG_DEBUG(""); /* Check parameters */ - HDassert(src_buf); - HDassert(isnull); + assert(src_buf); + assert(isnull); *isnull = (0 == HDmemcmp(src_buf, zeros, H5T_REF_MEM_SIZE)) ? TRUE : FALSE; @@ -421,8 +421,8 @@ H5T__ref_mem_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf H5T_REF_LOG_DEBUG(""); /* Sanity check */ - HDassert(src_buf); - HDassert(src_size == H5T_REF_MEM_SIZE); + assert(src_buf); + assert(src_size == H5T_REF_MEM_SIZE); if (NULL != dst_file) { hbool_t files_equal = TRUE; /* Whether src & dst references are in same file */ @@ -541,10 +541,10 @@ H5T__ref_mem_read(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, s H5T_REF_LOG_DEBUG(""); /* Sanity check */ - HDassert(src_buf); - HDassert(src_size == H5T_REF_MEM_SIZE); - HDassert(dst_buf); - HDassert(dst_size); + assert(src_buf); + assert(src_size == H5T_REF_MEM_SIZE); + assert(dst_buf); + assert(dst_size); /* Memory-to-memory conversion to support vlen conversion */ if (NULL == dst_file) { @@ -652,10 +652,10 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size H5T_REF_LOG_DEBUG(""); /* Sanity check */ - HDassert(src_buf); - HDassert(src_size); - HDassert(dst_buf); - HDassert(dst_size == H5T_REF_MEM_SIZE); + assert(src_buf); + assert(src_size); + assert(dst_buf); + assert(dst_size == H5T_REF_MEM_SIZE); HDcompile_assert(sizeof(*dst_ref) == sizeof(tmp_ref)); /* Memory-to-memory conversion to support vlen conversion */ @@ -673,7 +673,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -720,7 +720,7 @@ H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size case H5R_BADTYPE: case H5R_MAXTYPE: default: - HDassert("unknown reference type" && 0); + assert("unknown reference type" && 0); HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") } /* end switch */ @@ -773,9 +773,9 @@ H5T__ref_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbool_t H5T_REF_LOG_DEBUG(""); /* Check parameters */ - HDassert(src_file); - HDassert(src_buf); - HDassert(isnull); + assert(src_file); + assert(src_buf); + assert(isnull); /* Try to check encoded reference type */ ref_type = (H5R_type_t)*p++; @@ -823,8 +823,8 @@ H5T__ref_disk_setnull(H5VL_object_t *dst_file, void *dst_buf, void *bg_buf) FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG(""); - HDassert(dst_file); - HDassert(dst_buf); + assert(dst_file); + assert(dst_buf); /* TODO Should get rid of bg stuff */ if (p_bg) { @@ -878,7 +878,7 @@ H5T__ref_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_bu FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG(""); - HDassert(src_buf); + assert(src_buf); /* Set reference type */ ref_type = (H5R_type_t)*p++; @@ -927,10 +927,10 @@ H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_ FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG(""); - HDassert(src_file); - HDassert(src_buf); - HDassert(dst_buf); - HDassert(dst_size); + assert(src_file); + assert(src_buf); + assert(dst_buf); + assert(dst_size); /* Copy header manually */ H5MM_memcpy(q, p, H5R_ENCODE_HEADER_SIZE); @@ -940,7 +940,7 @@ H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_ /* Skip the size */ p += sizeof(uint32_t); - HDassert(src_size > (H5R_ENCODE_HEADER_SIZE + sizeof(uint32_t))); + assert(src_size > (H5R_ENCODE_HEADER_SIZE + sizeof(uint32_t))); /* Retrieve blob */ if (H5VL_blob_get(src_file, p, q, blob_size, NULL) < 0) @@ -972,10 +972,10 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG(""); - HDassert(src_buf); - HDassert(src_size); - HDassert(dst_file); - HDassert(dst_buf); + assert(src_buf); + assert(src_size); + assert(dst_file); + assert(dst_buf); /* TODO Should get rid of bg stuff */ if (p_bg) { @@ -986,7 +986,7 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, #ifndef NDEBUG size_t p_buf_size_left = dst_size; - HDassert(p_buf_size_left > (sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE)); + assert(p_buf_size_left > (sizeof(uint32_t) + H5R_ENCODE_HEADER_SIZE)); #endif /* Set up VOL callback arguments */ @@ -1005,7 +1005,7 @@ H5T__ref_disk_write(H5VL_object_t H5_ATTR_UNUSED *src_file, const void *src_buf, #ifndef NDEBUG size_t buf_size_left = dst_size - sizeof(uint32_t); - HDassert(buf_size_left > sizeof(uint32_t)); + assert(buf_size_left > sizeof(uint32_t)); #endif /* Set the size */ @@ -1040,9 +1040,9 @@ H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbo H5T_REF_LOG_DEBUG(""); /* Check parameters */ - HDassert(src_file); - HDassert(src_buf); - HDassert(isnull); + assert(src_file); + assert(src_buf); + assert(isnull); #ifndef NDEBUG { @@ -1053,7 +1053,7 @@ H5T__ref_obj_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, hbo HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -1091,8 +1091,8 @@ H5T__ref_obj_disk_getsize(H5VL_object_t *src_file, const void H5_ATTR_UNUSED *sr FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG(""); - HDassert(src_file); - HDassert(src_buf); + assert(src_file); + assert(src_buf); #ifndef NDEBUG { @@ -1103,7 +1103,7 @@ H5T__ref_obj_disk_getsize(H5VL_object_t *src_file, const void H5_ATTR_UNUSED *sr HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, 0, "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -1111,7 +1111,7 @@ H5T__ref_obj_disk_getsize(H5VL_object_t *src_file, const void H5_ATTR_UNUSED *sr if (NULL == (src_f = (H5F_t *)H5VL_object_data(src_file))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "invalid VOL object") - HDassert(src_size == H5T_REF_OBJ_DISK_SIZE(src_f)); + assert(src_size == H5T_REF_OBJ_DISK_SIZE(src_f)); ret_value = H5T_REF_OBJ_DISK_SIZE(src_f); @@ -1138,9 +1138,9 @@ H5T__ref_obj_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_ FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG(""); - HDassert(src_file); - HDassert(src_buf); - HDassert(dst_buf); + assert(src_file); + assert(src_buf); + assert(dst_buf); #ifndef NDEBUG { @@ -1151,7 +1151,7 @@ H5T__ref_obj_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_ HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -1159,8 +1159,8 @@ H5T__ref_obj_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_ if (NULL == (src_f = (H5F_t *)H5VL_object_data(src_file))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid VOL object") - HDassert(src_size == H5T_REF_OBJ_DISK_SIZE(src_f)); - HDassert(dst_size == H5F_SIZEOF_ADDR(src_f)); + assert(src_size == H5T_REF_OBJ_DISK_SIZE(src_f)); + assert(dst_size == H5F_SIZEOF_ADDR(src_f)); /* Get object address */ if (H5R__decode_token_obj_compat((const unsigned char *)src_buf, &src_size, (H5O_token_t *)dst_buf, @@ -1192,9 +1192,9 @@ H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, H5T_REF_LOG_DEBUG(""); /* Check parameters */ - HDassert(src_file); - HDassert(src_buf); - HDassert(isnull); + assert(src_file); + assert(src_buf); + assert(isnull); #ifndef NDEBUG { @@ -1205,7 +1205,7 @@ H5T__ref_dsetreg_disk_isnull(const H5VL_object_t *src_file, const void *src_buf, HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -1246,7 +1246,7 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void #endif H5T_REF_LOG_DEBUG(""); - HDassert(src_buf); + assert(src_buf); #ifndef NDEBUG { @@ -1258,13 +1258,13 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, const void HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, 0, "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); /* Retrieve file from VOL object */ if (NULL == (src_f = (H5F_t *)H5VL_object_data(src_file))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "invalid VOL object") - HDassert(src_size == H5T_REF_DSETREG_DISK_SIZE(src_f)); + assert(src_size == H5T_REF_DSETREG_DISK_SIZE(src_f)); } #endif /* NDEBUG */ @@ -1295,10 +1295,10 @@ H5T__ref_dsetreg_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t FUNC_ENTER_PACKAGE H5T_REF_LOG_DEBUG(""); - HDassert(src_file); - HDassert(src_buf); - HDassert(dst_buf); - HDassert(dst_size == sizeof(struct H5Tref_dsetreg)); + assert(src_file); + assert(src_buf); + assert(dst_buf); + assert(dst_size == sizeof(struct H5Tref_dsetreg)); #ifndef NDEBUG { @@ -1309,7 +1309,7 @@ H5T__ref_dsetreg_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "can't query if file uses native VOL connector") /* Must use native VOL connector for this operation */ - HDassert(is_native); + assert(is_native); } #endif /* NDEBUG */ @@ -1317,7 +1317,7 @@ H5T__ref_dsetreg_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t if (NULL == (src_f = (H5F_t *)H5VL_object_data(src_file))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid VOL object") - HDassert(src_size == H5T_REF_DSETREG_DISK_SIZE(src_f)); + assert(src_size == H5T_REF_DSETREG_DISK_SIZE(src_f)); /* Retrieve object address and space */ if (H5R__decode_token_region_compat(src_f, (const unsigned char *)src_buf, &src_size, &dst_reg->token, @@ -1346,8 +1346,8 @@ H5T__ref_reclaim(void *elem, const H5T_t *dt) H5T_REF_LOG_DEBUG(""); /* Sanity checks */ - HDassert(elem); - HDassert(dt && (dt->shared->type == H5T_REFERENCE)); + assert(elem); + assert(dt && (dt->shared->type == H5T_REFERENCE)); if (dt->shared->u.atomic.u.r.opaque && H5R__destroy((H5R_ref_priv_t *)elem) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTFREE, FAIL, "cannot free reference") diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c index f5ee19a..f5d1ec7 100644 --- a/src/H5Tvisit.c +++ b/src/H5Tvisit.c @@ -91,8 +91,8 @@ H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(dt); - HDassert(op); + assert(dt); + assert(op); /* Check for complex datatype */ is_complex = H5T_IS_COMPLEX(dt->shared->type); diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 0fcf8c9..450d61c 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -191,7 +191,7 @@ H5T__vlen_create(const H5T_t *base) FUNC_ENTER_PACKAGE /* Check args */ - HDassert(base); + assert(base); /* Build new type */ if (NULL == (dt = H5T__alloc())) @@ -251,14 +251,14 @@ H5T__vlen_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) FUNC_ENTER_PACKAGE /* check parameters */ - HDassert(dt); - HDassert(loc >= H5T_LOC_BADLOC && loc < H5T_LOC_MAXLOC); + assert(dt); + assert(loc >= H5T_LOC_BADLOC && loc < H5T_LOC_MAXLOC); /* Only change the location if it's different */ if (loc != dt->shared->u.vlen.loc || file != dt->shared->u.vlen.file) { switch (loc) { case H5T_LOC_MEMORY: /* Memory based VL datatype */ - HDassert(NULL == file); + assert(NULL == file); /* Mark this type as being stored in memory */ dt->shared->u.vlen.loc = H5T_LOC_MEMORY; @@ -278,7 +278,7 @@ H5T__vlen_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) dt->shared->u.vlen.cls = &H5T_vlen_mem_str_g; } /* end else-if */ else - HDassert(0 && "Invalid VL type"); + assert(0 && "Invalid VL type"); /* Release owned file */ if (dt->shared->owned_vol_obj) { @@ -296,7 +296,7 @@ H5T__vlen_set_loc(H5T_t *dt, H5VL_object_t *file, H5T_loc_t loc) H5VL_file_cont_info_t cont_info = {H5VL_CONTAINER_INFO_VERSION, 0, 0, 0}; H5VL_file_get_args_t vol_cb_args; /* Arguments to VOL callback */ - HDassert(file); + assert(file); /* Mark this type as being stored on disk */ dt->shared->u.vlen.loc = H5T_LOC_DISK; @@ -373,8 +373,8 @@ H5T__vlen_mem_seq_getlen(H5VL_object_t H5_ATTR_UNUSED *file, const void *_vl, si FUNC_ENTER_PACKAGE_NOERR /* Check parameter */ - HDassert(_vl); - HDassert(len); + assert(_vl); + assert(len); /* Copy to ensure correct alignment. memcpy is best here because * it optimizes to fast code. @@ -406,7 +406,7 @@ H5T__vlen_mem_seq_getptr(void *_vl) FUNC_ENTER_PACKAGE_NOERR /* check parameters, return result */ - HDassert(_vl); + assert(_vl); /* Copy to ensure correct alignment. */ HDmemcpy(&vl, _vl, sizeof(hvl_t)); @@ -433,7 +433,7 @@ H5T__vlen_mem_seq_isnull(const H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, hb FUNC_ENTER_PACKAGE_NOERR /* Check parameters */ - HDassert(_vl); + assert(_vl); /* Copy to ensure correct alignment. */ HDmemcpy(&vl, _vl, sizeof(hvl_t)); @@ -463,7 +463,7 @@ H5T__vlen_mem_seq_setnull(H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, void H5 FUNC_ENTER_PACKAGE_NOERR /* check parameters */ - HDassert(_vl); + assert(_vl); /* Set the "nil" hvl_t */ vl.len = 0; @@ -495,11 +495,11 @@ H5T__vlen_mem_seq_read(H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, void *buf, FUNC_ENTER_PACKAGE_NOERR /* check parameters, copy data */ - HDassert(buf); - HDassert(_vl); + assert(buf); + assert(_vl); /* Copy to ensure correct alignment. */ HDmemcpy(&vl, _vl, sizeof(hvl_t)); - HDassert(vl.p); + assert(vl.p); H5MM_memcpy(buf, vl.p, len); @@ -528,8 +528,8 @@ H5T__vlen_mem_seq_write(H5VL_object_t H5_ATTR_UNUSED *file, const H5T_vlen_alloc FUNC_ENTER_PACKAGE /* check parameters */ - HDassert(_vl); - HDassert(buf); + assert(_vl); + assert(buf); if (seq_len) { size_t len = seq_len * base_size; /* Sequence size */ @@ -580,7 +580,7 @@ H5T__vlen_mem_str_getlen(H5VL_object_t H5_ATTR_UNUSED *file, const void *_vl, si FUNC_ENTER_PACKAGE_NOERR /* check parameters */ - HDassert(_vl); + assert(_vl); /* Copy to ensure correct alignment. */ HDmemcpy(&s, _vl, sizeof(char *)); @@ -610,7 +610,7 @@ H5T__vlen_mem_str_getptr(void *_vl) FUNC_ENTER_PACKAGE_NOERR /* check parameters */ - HDassert(_vl); + assert(_vl); /* Copy to ensure correct alignment. */ HDmemcpy(&s, _vl, sizeof(char *)); @@ -690,8 +690,8 @@ H5T__vlen_mem_str_read(H5VL_object_t H5_ATTR_UNUSED *file, void *_vl, void *buf, if (len > 0) { /* check parameters */ - HDassert(buf); - HDassert(_vl); + assert(buf); + assert(_vl); /* Copy to ensure correct alignment. */ HDmemcpy(&s, _vl, sizeof(char *)); @@ -724,7 +724,7 @@ H5T__vlen_mem_str_write(H5VL_object_t H5_ATTR_UNUSED *file, const H5T_vlen_alloc FUNC_ENTER_PACKAGE /* check parameters */ - HDassert(buf); + assert(buf); /* Use the user's memory allocation routine if one is defined */ if (vl_alloc_info->alloc_func != NULL) { @@ -769,8 +769,8 @@ H5T__vlen_disk_getlen(H5VL_object_t H5_ATTR_UNUSED *file, const void *_vl, size_ FUNC_ENTER_PACKAGE_NOERR /* Check parameters */ - HDassert(vl); - HDassert(seq_len); + assert(vl); + assert(seq_len); /* Get length of sequence (different from blob size) */ UINT32DECODE(vl, *seq_len); @@ -800,9 +800,9 @@ H5T__vlen_disk_isnull(const H5VL_object_t *file, void *_vl, hbool_t *isnull) FUNC_ENTER_PACKAGE /* Check parameters */ - HDassert(file); - HDassert(vl); - HDassert(isnull); + assert(file); + assert(vl); + assert(isnull); /* Skip the sequence's length */ vl += 4; @@ -841,8 +841,8 @@ H5T__vlen_disk_setnull(H5VL_object_t *file, void *_vl, void *bg) FUNC_ENTER_PACKAGE /* check parameters */ - HDassert(file); - HDassert(vl); + assert(file); + assert(vl); /* Free heap object for old data */ if (bg != NULL) @@ -885,9 +885,9 @@ H5T__vlen_disk_read(H5VL_object_t *file, void *_vl, void *buf, size_t len) FUNC_ENTER_PACKAGE /* Check parameters */ - HDassert(file); - HDassert(vl); - HDassert(buf); + assert(file); + assert(vl); + assert(buf); /* Skip the length of the sequence */ vl += 4; @@ -923,9 +923,9 @@ H5T__vlen_disk_write(H5VL_object_t *file, const H5T_vlen_alloc_info_t H5_ATTR_UN FUNC_ENTER_PACKAGE /* check parameters */ - HDassert(vl); - HDassert(seq_len == 0 || buf); - HDassert(file); + assert(vl); + assert(seq_len == 0 || buf); + assert(file); /* Free heap object for old data, if non-NULL */ if (bg != NULL) @@ -964,7 +964,7 @@ H5T__vlen_disk_delete(H5VL_object_t *file, void *_vl) FUNC_ENTER_PACKAGE /* Check parameters */ - HDassert(file); + assert(file); /* Free heap object for old data */ if (vl != NULL) { @@ -1012,9 +1012,9 @@ H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(elem); - HDassert(dt); - HDassert(alloc_info); + assert(elem); + assert(dt); + assert(alloc_info); free_func = alloc_info->free_func; free_info = alloc_info->free_info; @@ -1085,7 +1085,7 @@ H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info HDfree(*(char **)elem); } else { - HDassert(0 && "Invalid VL type"); + assert(0 && "Invalid VL type"); } /* end else */ break; @@ -1135,8 +1135,8 @@ H5T_vlen_reclaim_elmt(void *elem, H5T_t *dt) H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */ herr_t ret_value = SUCCEED; /* return value */ - HDassert(dt); - HDassert(elem); + assert(dt); + assert(elem); FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5UC.c b/src/H5UC.c index 22e35e5..60a4456 100644 --- a/src/H5UC.c +++ b/src/H5UC.c @@ -58,8 +58,8 @@ H5UC_create(void *o, H5UC_free_func_t free_func) FUNC_ENTER_NOAPI(NULL) /* Sanity check */ - HDassert(o); - HDassert(free_func); + assert(o); + assert(free_func); /* Allocate ref-counted string structure */ if (NULL == (ret_value = H5FL_MALLOC(H5UC_t))) @@ -101,10 +101,10 @@ H5UC_decr(H5UC_t *rc) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(rc); - HDassert(rc->o); - HDassert(rc->n > 0); - HDassert(rc->free_func); + assert(rc); + assert(rc->o); + assert(rc->n > 0); + assert(rc->free_func); /* Decrement reference count */ rc->n--; diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index c078579..18649eb 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -392,7 +392,7 @@ H5VL_copy_connector_info(const H5VL_class_t *connector, void **dst_info, const v FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(connector); + assert(connector); /* Check for actual source info */ if (src_info) { @@ -469,8 +469,8 @@ H5VL_cmp_connector_info(const H5VL_class_t *connector, int *cmp_value, const voi FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(connector); - HDassert(cmp_value); + assert(connector); + assert(cmp_value); /* Take care of cases where one or both pointers is NULL */ if (info1 == NULL && info2 != NULL) { @@ -495,7 +495,7 @@ H5VL_cmp_connector_info(const H5VL_class_t *connector, int *cmp_value, const voi HGOTO_ERROR(H5E_VOL, H5E_CANTCOMPARE, FAIL, "can't compare connector info") } /* end if */ else { - HDassert(connector->info_cls.size > 0); + assert(connector->info_cls.size > 0); *cmp_value = HDmemcmp(info1, info2, connector->info_cls.size); } /* end else */ @@ -558,7 +558,7 @@ H5VL_free_connector_info(hid_t connector_id, const void *info) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(connector_id > 0); + assert(connector_id > 0); /* Check args and get class pointer */ if (NULL == (cls = (H5VL_class_t *)H5I_object_verify(connector_id, H5I_VOL))) @@ -726,14 +726,14 @@ H5VL_get_wrap_ctx(const H5VL_class_t *connector, void *obj, void **wrap_ctx) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(connector); - HDassert(obj); - HDassert(wrap_ctx); + assert(connector); + assert(obj); + assert(wrap_ctx); /* Allow the connector to copy or do it ourselves */ if (connector->wrap_cls.get_wrap_ctx) { /* Sanity check */ - HDassert(connector->wrap_cls.free_wrap_ctx); + assert(connector->wrap_cls.free_wrap_ctx); /* Invoke connector's callback */ if ((connector->wrap_cls.get_wrap_ctx)(obj, wrap_ctx) < 0) @@ -795,8 +795,8 @@ H5VL_wrap_object(const H5VL_class_t *connector, void *wrap_ctx, void *obj, H5I_t FUNC_ENTER_NOAPI(NULL) /* Sanity checks */ - HDassert(connector); - HDassert(obj); + assert(connector); + assert(obj); /* Only wrap object if there's a wrap context */ if (wrap_ctx) { @@ -862,8 +862,8 @@ H5VL_unwrap_object(const H5VL_class_t *connector, void *obj) FUNC_ENTER_NOAPI(NULL) /* Sanity checks */ - HDassert(connector); - HDassert(obj); + assert(connector); + assert(obj); /* Only unwrap object if there's an unwrap callback */ if (connector->wrap_cls.wrap_object) { @@ -929,7 +929,7 @@ H5VL_free_wrap_ctx(const H5VL_class_t *connector, void *wrap_ctx) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(connector); + assert(connector); /* Only free wrap context, if it's non-NULL */ if (wrap_ctx) { @@ -1769,7 +1769,7 @@ H5VL_attr_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); /* Call the corresponding internal VOL routine */ if (H5VL__attr_close(vol_obj->data, vol_obj->connector->cls, dxpl_id, req) < 0) @@ -2075,8 +2075,8 @@ H5VL_dataset_read_direct(size_t count, void *obj[], H5VL_t *connector, hid_t mem FUNC_ENTER_NOAPI(FAIL) - HDassert(obj); - HDassert(connector); + assert(obj); + assert(connector); /* Set wrapper info in API context */ tmp_vol_obj.data = obj[0]; @@ -2121,8 +2121,8 @@ H5VL_dataset_read(size_t count, const H5VL_object_t *vol_obj[], hid_t mem_type_i FUNC_ENTER_NOAPI(FAIL) - HDassert(vol_obj); - HDassert(vol_obj[0]); + assert(vol_obj); + assert(vol_obj[0]); /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj[0]) < 0) @@ -2265,8 +2265,8 @@ H5VL_dataset_write_direct(size_t count, void *obj[], H5VL_t *connector, hid_t me FUNC_ENTER_NOAPI(FAIL) - HDassert(obj); - HDassert(connector); + assert(obj); + assert(connector); /* Set wrapper info in API context */ tmp_vol_obj.data = obj[0]; @@ -2311,8 +2311,8 @@ H5VL_dataset_write(size_t count, const H5VL_object_t *vol_obj[], hid_t mem_type_ FUNC_ENTER_NOAPI(FAIL) - HDassert(vol_obj); - HDassert(vol_obj[0]); + assert(vol_obj); + assert(vol_obj[0]); /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj[0]) < 0) @@ -2759,8 +2759,8 @@ H5VL__dataset_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **re FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(obj); - HDassert(cls); + assert(obj); + assert(cls); /* Check if the corresponding VOL callback exists */ if (NULL == cls->dataset_cls.close) @@ -2793,10 +2793,10 @@ H5VL_dataset_close(const H5VL_object_t *vol_obj, hid_t dxpl_id, void **req) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(vol_obj->data); - HDassert(vol_obj->connector); - HDassert(vol_obj->connector->cls); + assert(vol_obj); + assert(vol_obj->data); + assert(vol_obj->connector); + assert(vol_obj->connector->cls); /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) @@ -3341,7 +3341,7 @@ H5VL_datatype_optional_op(H5VL_object_t *vol_obj, H5VL_optional_args_t *args, hi FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); /* Set up vol_obj_ptr */ *vol_obj_ptr = vol_obj; @@ -3712,11 +3712,11 @@ H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_in FUNC_ENTER_PACKAGE - HDassert(udata); - HDassert(udata->filename); - HDassert(udata->connector_prop); - HDassert(cls); - HDassert(plugin_type == H5PL_TYPE_VOL); + assert(udata); + assert(udata->filename); + assert(udata->connector_prop); + assert(cls); + assert(plugin_type == H5PL_TYPE_VOL); /* Silence compiler */ (void)plugin_type; @@ -4066,7 +4066,7 @@ H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_args_t *args if (args->op_type == H5VL_FILE_IS_ACCESSIBLE) fapl_id = args->args.is_accessible.fapl_id; else { - HDassert(args->op_type == H5VL_FILE_DELETE); + assert(args->op_type == H5VL_FILE_DELETE); fapl_id = args->args.del.fapl_id; } @@ -4083,7 +4083,7 @@ H5VL_file_specific(const H5VL_object_t *vol_obj, H5VL_file_specific_args_t *args /* Set wrapper info in API context, for all other operations */ else { /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); if (H5VL_set_vol_wrapper(vol_obj) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTSET, FAIL, "can't set VOL wrapper info") @@ -4298,8 +4298,8 @@ H5VL__file_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(obj); - HDassert(cls); + assert(obj); + assert(cls); /* Check if the corresponding VOL callback exists */ if (NULL == cls->file_cls.close) @@ -4943,8 +4943,8 @@ H5VL__group_close(void *obj, const H5VL_class_t *cls, hid_t dxpl_id, void **req) herr_t ret_value = SUCCEED; /* Return value */ /* Sanity check */ - HDassert(obj); - HDassert(cls); + assert(obj); + assert(cls); FUNC_ENTER_PACKAGE @@ -6319,10 +6319,10 @@ H5VL__introspect_get_conn_cls(void *obj, const H5VL_class_t *cls, H5VL_get_conn_ FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(obj); - HDassert(cls); - HDassert(lvl >= H5VL_GET_CONN_LVL_CURR && lvl <= H5VL_GET_CONN_LVL_TERM); - HDassert(conn_cls); + assert(obj); + assert(cls); + assert(lvl >= H5VL_GET_CONN_LVL_CURR && lvl <= H5VL_GET_CONN_LVL_TERM); + assert(conn_cls); /* Check if the corresponding VOL callback exists */ if (NULL == cls->introspect_cls.get_conn_cls) @@ -6431,8 +6431,8 @@ H5VL_introspect_get_cap_flags(const void *info, const H5VL_class_t *cls, uint64_ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(cls); - HDassert(cap_flags); + assert(cls); + assert(cap_flags); /* Check if the corresponding VOL callback exists */ if (NULL == cls->introspect_cls.get_cap_flags) @@ -6600,9 +6600,9 @@ H5VL__request_wait(void *req, const H5VL_class_t *cls, uint64_t timeout, H5VL_re FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(req); - HDassert(cls); - HDassert(status); + assert(req); + assert(cls); + assert(status); /* Check if the corresponding VOL callback exists */ if (NULL == cls->request_cls.wait) @@ -6635,7 +6635,7 @@ H5VL_request_wait(const H5VL_object_t *vol_obj, uint64_t timeout, H5VL_request_s FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(vol_obj); + assert(vol_obj); /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) @@ -6704,8 +6704,8 @@ H5VL__request_notify(void *req, const H5VL_class_t *cls, H5VL_request_notify_t c FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(req); - HDassert(cls); + assert(req); + assert(cls); /* Check if the corresponding VOL callback exists */ if (NULL == cls->request_cls.notify) @@ -6739,7 +6739,7 @@ H5VL_request_notify(const H5VL_object_t *vol_obj, H5VL_request_notify_t cb, void FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) @@ -6808,8 +6808,8 @@ H5VL__request_cancel(void *req, const H5VL_class_t *cls, H5VL_request_status_t * FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(req); - HDassert(cls); + assert(req); + assert(cls); /* Check if the corresponding VOL callback exists */ if (NULL == cls->request_cls.cancel) @@ -6842,7 +6842,7 @@ H5VL_request_cancel(const H5VL_object_t *vol_obj, H5VL_request_status_t *status) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) @@ -6910,8 +6910,8 @@ H5VL__request_specific(void *req, const H5VL_class_t *cls, H5VL_request_specific FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(req); - HDassert(cls); + assert(req); + assert(cls); /* Check if the corresponding VOL callback exists */ if (NULL == cls->request_cls.specific) @@ -6945,7 +6945,7 @@ H5VL_request_specific(const H5VL_object_t *vol_obj, H5VL_request_specific_args_t FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) @@ -7015,8 +7015,8 @@ H5VL__request_optional(void *req, const H5VL_class_t *cls, H5VL_optional_args_t FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(req); - HDassert(cls); + assert(req); + assert(cls); /* Check if the corresponding VOL callback exists */ if (NULL == cls->request_cls.optional) @@ -7050,7 +7050,7 @@ H5VL_request_optional(const H5VL_object_t *vol_obj, H5VL_optional_args_t *args) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) @@ -7157,8 +7157,8 @@ H5VL__request_free(void *req, const H5VL_class_t *cls) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(req); - HDassert(cls); + assert(req); + assert(cls); /* Check if the corresponding VOL callback exists */ if (NULL == cls->request_cls.free) @@ -7191,7 +7191,7 @@ H5VL_request_free(const H5VL_object_t *vol_obj) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) @@ -7258,10 +7258,10 @@ H5VL__blob_put(void *obj, const H5VL_class_t *cls, const void *buf, size_t size, FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(obj); - HDassert(cls); - HDassert(size == 0 || buf); - HDassert(blob_id); + assert(obj); + assert(cls); + assert(size == 0 || buf); + assert(blob_id); /* Check if the corresponding VOL callback exists */ if (NULL == cls->blob_cls.put) @@ -7295,9 +7295,9 @@ H5VL_blob_put(const H5VL_object_t *vol_obj, const void *buf, size_t size, void * FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(size == 0 || buf); - HDassert(blob_id); + assert(vol_obj); + assert(size == 0 || buf); + assert(blob_id); /* Call the corresponding VOL callback */ if (H5VL__blob_put(vol_obj->data, vol_obj->connector->cls, buf, size, blob_id, ctx) < 0) @@ -7356,10 +7356,10 @@ H5VL__blob_get(void *obj, const H5VL_class_t *cls, const void *blob_id, void *bu FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(obj); - HDassert(cls); - HDassert(blob_id); - HDassert(buf); + assert(obj); + assert(cls); + assert(blob_id); + assert(buf); /* Check if the corresponding VOL callback exists */ if (NULL == cls->blob_cls.get) @@ -7390,9 +7390,9 @@ H5VL_blob_get(const H5VL_object_t *vol_obj, const void *blob_id, void *buf, size FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(blob_id); - HDassert(buf); + assert(vol_obj); + assert(blob_id); + assert(buf); /* Call the corresponding VOL callback */ if (H5VL__blob_get(vol_obj->data, vol_obj->connector->cls, blob_id, buf, size, ctx) < 0) @@ -7454,9 +7454,9 @@ H5VL__blob_specific(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_blob FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(obj); - HDassert(cls); - HDassert(blob_id); + assert(obj); + assert(cls); + assert(blob_id); /* Check if the corresponding VOL callback exists */ if (NULL == cls->blob_cls.specific) @@ -7488,8 +7488,8 @@ H5VL_blob_specific(const H5VL_object_t *vol_obj, void *blob_id, H5VL_blob_specif FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(blob_id); + assert(vol_obj); + assert(blob_id); /* Call the corresponding internal VOL routine */ if (H5VL__blob_specific(vol_obj->data, vol_obj->connector->cls, blob_id, args) < 0) @@ -7551,9 +7551,9 @@ H5VL__blob_optional(void *obj, const H5VL_class_t *cls, void *blob_id, H5VL_opti FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(obj); - HDassert(cls); - HDassert(blob_id); + assert(obj); + assert(cls); + assert(blob_id); /* Check if the corresponding VOL callback exists */ if (NULL == cls->blob_cls.optional) @@ -7585,8 +7585,8 @@ H5VL_blob_optional(const H5VL_object_t *vol_obj, void *blob_id, H5VL_optional_ar FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(blob_id); + assert(vol_obj); + assert(blob_id); /* Call the corresponding internal VOL routine */ if (H5VL__blob_optional(vol_obj->data, vol_obj->connector->cls, blob_id, args) < 0) @@ -7650,9 +7650,9 @@ H5VL__token_cmp(void *obj, const H5VL_class_t *cls, const H5O_token_t *token1, c FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(obj); - HDassert(cls); - HDassert(cmp_value); + assert(obj); + assert(cls); + assert(cmp_value); /* Take care of cases where one or both pointers is NULL */ if (token1 == NULL && token2 != NULL) @@ -7700,8 +7700,8 @@ H5VL_token_cmp(const H5VL_object_t *vol_obj, const H5O_token_t *token1, const H5 FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(vol_obj); - HDassert(cmp_value); + assert(vol_obj); + assert(cmp_value); /* Call the corresponding internal VOL routine */ if (H5VL__token_cmp(vol_obj->data, vol_obj->connector->cls, token1, token2, cmp_value) < 0) @@ -7771,10 +7771,10 @@ H5VL__token_to_str(void *obj, H5I_type_t obj_type, const H5VL_class_t *cls, cons FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(obj); - HDassert(cls); - HDassert(token); - HDassert(token_str); + assert(obj); + assert(cls); + assert(token); + assert(token_str); /* Use the class's token serialization routine on the token if there is a * callback, otherwise just set the token_str to NULL. @@ -7809,9 +7809,9 @@ H5VL_token_to_str(const H5VL_object_t *vol_obj, H5I_type_t obj_type, const H5O_t FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(vol_obj); - HDassert(token); - HDassert(token_str); + assert(vol_obj); + assert(token); + assert(token_str); /* Call the corresponding internal VOL routine */ if (H5VL__token_to_str(vol_obj->data, obj_type, vol_obj->connector->cls, token, token_str) < 0) @@ -7878,10 +7878,10 @@ H5VL__token_from_str(void *obj, H5I_type_t obj_type, const H5VL_class_t *cls, co FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(obj); - HDassert(cls); - HDassert(token_str); - HDassert(token); + assert(obj); + assert(cls); + assert(token_str); + assert(token); /* Use the class's token deserialization routine on the token if there is a * callback, otherwise just set the token to H5_TOKEN_UNDEF. @@ -7916,9 +7916,9 @@ H5VL_token_from_str(const H5VL_object_t *vol_obj, H5I_type_t obj_type, const cha FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(vol_obj); - HDassert(token); - HDassert(token_str); + assert(vol_obj); + assert(token); + assert(token_str); /* Call the corresponding internal VOL routine */ if (H5VL__token_from_str(vol_obj->data, obj_type, vol_obj->connector->cls, token_str, token) < 0) diff --git a/src/H5VLdyn_ops.c b/src/H5VLdyn_ops.c index d3d4fda..3f6a3d7 100644 --- a/src/H5VLdyn_ops.c +++ b/src/H5VLdyn_ops.c @@ -195,8 +195,8 @@ H5VL__register_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *o FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(op_val); - HDassert(op_name && *op_name); + assert(op_val); + assert(op_name && *op_name); /* Check for duplicate operation */ if (H5VL_opt_ops_g[subcls]) { @@ -270,8 +270,8 @@ H5VL__find_opt_operation(H5VL_subclass_t subcls, const char *op_name, int *op_va FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(op_val); - HDassert(op_name && *op_name); + assert(op_val); + assert(op_name && *op_name); /* Check for dynamic operations in the VOL subclass */ if (H5VL_opt_ops_g[subcls]) { @@ -309,7 +309,7 @@ H5VL__unregister_opt_operation(H5VL_subclass_t subcls, const char *op_name) FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(op_name && *op_name); + assert(op_name && *op_name); /* Check for dynamic operations in the VOL subclass */ if (H5VL_opt_ops_g[subcls]) { diff --git a/src/H5VLint.c b/src/H5VLint.c index 2bd3919..6edea59 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -205,8 +205,8 @@ H5VL_init_phase2(void) /* clang-format on */ /* Sanity check default VOL connector */ - HDassert(H5VL_def_conn_s.connector_id == (-1)); - HDassert(H5VL_def_conn_s.connector_info == NULL); + assert(H5VL_def_conn_s.connector_id == (-1)); + assert(H5VL_def_conn_s.connector_info == NULL); /* Set up the default VOL connector in the default FAPL */ if (H5VL__set_def_conn() < 0) @@ -283,7 +283,7 @@ H5VL__free_cls(H5VL_class_t *cls, void H5_ATTR_UNUSED **request) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(cls); + assert(cls); /* Shut down the VOL connector */ if (cls->terminate && cls->terminate() < 0) @@ -327,7 +327,7 @@ H5VL__get_connector_cb(void *obj, hid_t id, void *_op_data) } /* end if */ } /* end if */ else { - HDassert(H5VL_GET_CONNECTOR_BY_VALUE == op_data->key.kind); + assert(H5VL_GET_CONNECTOR_BY_VALUE == op_data->key.kind); if (cls->value == op_data->key.u.value) { op_data->found_id = id; ret_value = H5_ITER_STOP; @@ -501,7 +501,7 @@ H5VL__wrap_obj(void *obj, H5I_type_t obj_type) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(obj); + assert(obj); /* Retrieve the VOL object wrapping context */ if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) @@ -544,8 +544,8 @@ H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(object); - HDassert(vol_connector); + assert(object); + assert(vol_connector); /* Make sure type number is valid */ if (type != H5I_ATTR && type != H5I_DATASET && type != H5I_DATATYPE && type != H5I_FILE && @@ -693,8 +693,8 @@ H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Check arguments */ - HDassert(object); - HDassert(vol_connector); + assert(object); + assert(vol_connector); /* Set up VOL object for the passed-in data */ /* (Does not wrap object, since it's from a VOL callback) */ @@ -737,8 +737,8 @@ H5VL_register_using_existing_id(H5I_type_t type, void *object, H5VL_t *vol_conne FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(object); - HDassert(vol_connector); + assert(object); + assert(vol_connector); /* Set up VOL object for the passed-in data */ /* (Wraps object, since it's a library object) */ @@ -865,8 +865,8 @@ H5VL_create_object(void *object, H5VL_t *vol_connector) FUNC_ENTER_NOAPI(NULL) /* Check arguments */ - HDassert(object); - HDassert(vol_connector); + assert(object); + assert(vol_connector); /* Set up VOL object for the passed-in data */ /* (Does not wrap object, since it's from a VOL callback) */ @@ -958,7 +958,7 @@ H5VL_conn_inc_rc(H5VL_t *connector) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(connector); + assert(connector); /* Increment refcount for connector */ connector->nrefs++; @@ -988,7 +988,7 @@ H5VL_conn_dec_rc(H5VL_t *connector) FUNC_ENTER_NOAPI(-1) /* Check arguments */ - HDassert(connector); + assert(connector); /* Decrement refcount for connector */ connector->nrefs--; @@ -1025,7 +1025,7 @@ H5VL_object_inc_rc(H5VL_object_t *vol_obj) FUNC_ENTER_NOAPI_NOERR /* Check arguments */ - HDassert(vol_obj); + assert(vol_obj); /* Increment refcount for object and return */ FUNC_LEAVE_NOAPI(++vol_obj->rc) @@ -1049,7 +1049,7 @@ H5VL_free_object(H5VL_object_t *vol_obj) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(vol_obj); + assert(vol_obj); if (--vol_obj->rc == 0) { /* Decrement refcount on connector */ @@ -1087,8 +1087,8 @@ H5VL_object_is_native(const H5VL_object_t *obj, hbool_t *is_native) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(obj); - HDassert(is_native); + assert(obj); + assert(is_native); /* Retrieve the terminal connector class for the object */ cls = NULL; @@ -1133,9 +1133,9 @@ H5VL_file_is_same(const H5VL_object_t *vol_obj1, const H5VL_object_t *vol_obj2, FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - HDassert(vol_obj1); - HDassert(vol_obj2); - HDassert(same_file); + assert(vol_obj1); + assert(vol_obj2); + assert(same_file); /* Retrieve the terminal connectors for each object */ cls1 = NULL; @@ -1200,7 +1200,7 @@ H5VL__register_connector(const void *_cls, hbool_t app_ref, hid_t vipl_id) FUNC_ENTER_PACKAGE /* Check arguments */ - HDassert(cls); + assert(cls); /* Copy the class structure so the caller can reuse or free it */ if (NULL == (saved = H5FL_MALLOC(H5VL_class_t))) @@ -1989,8 +1989,8 @@ H5VL_cmp_connector_cls(int *cmp_value, const H5VL_class_t *cls1, const H5VL_clas FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(cls1); - HDassert(cls2); + assert(cls1); + assert(cls2); /* If the pointers are the same the classes are the same */ if (cls1 == cls2) { @@ -2007,7 +2007,7 @@ H5VL_cmp_connector_cls(int *cmp_value, const H5VL_class_t *cls1, const H5VL_clas *cmp_value = 1; HGOTO_DONE(SUCCEED) } /* end if */ - HDassert(cls1->value == cls2->value); + assert(cls1->value == cls2->value); /* Compare connector names */ if (cls1->name == NULL && cls2->name != NULL) { @@ -2030,7 +2030,7 @@ H5VL_cmp_connector_cls(int *cmp_value, const H5VL_class_t *cls1, const H5VL_clas *cmp_value = 1; HGOTO_DONE(SUCCEED) } /* end if */ - HDassert(cls1->version == cls2->version); + assert(cls1->version == cls2->version); /* Compare connector info */ if (cls1->info_cls.size < cls2->info_cls.size) { @@ -2041,7 +2041,7 @@ H5VL_cmp_connector_cls(int *cmp_value, const H5VL_class_t *cls1, const H5VL_clas *cmp_value = 1; HGOTO_DONE(SUCCEED) } /* end if */ - HDassert(cls1->info_cls.size == cls2->info_cls.size); + assert(cls1->info_cls.size == cls2->info_cls.size); /* Set comparison value to 'equal' */ *cmp_value = 0; @@ -2071,7 +2071,7 @@ H5VL_retrieve_lib_state(void **state) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(state); + assert(state); /* Retrieve the API context state */ if (H5CX_retrieve_state((H5CX_state_t **)state) < 0) @@ -2134,7 +2134,7 @@ H5VL_restore_lib_state(const void *state) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(state); + assert(state); /* Restore the API context state */ if (H5CX_restore_state((const H5CX_state_t *)state) < 0) @@ -2202,7 +2202,7 @@ H5VL_free_lib_state(void *state) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(state); + assert(state); /* Free the API context state */ if (H5CX_free_state((H5CX_state_t *)state) < 0) @@ -2232,10 +2232,10 @@ H5VL__free_vol_wrapper(H5VL_wrap_ctx_t *vol_wrap_ctx) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(vol_wrap_ctx); - HDassert(0 == vol_wrap_ctx->rc); - HDassert(vol_wrap_ctx->connector); - HDassert(vol_wrap_ctx->connector->cls); + assert(vol_wrap_ctx); + assert(0 == vol_wrap_ctx->rc); + assert(vol_wrap_ctx->connector); + assert(vol_wrap_ctx->connector->cls); /* If there is a VOL connector object wrapping context, release it */ if (vol_wrap_ctx->obj_wrap_ctx) @@ -2273,7 +2273,7 @@ H5VL_set_vol_wrapper(const H5VL_object_t *vol_obj) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); /* Retrieve the VOL object wrap context */ if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) @@ -2284,13 +2284,13 @@ H5VL_set_vol_wrapper(const H5VL_object_t *vol_obj) void *obj_wrap_ctx = NULL; /* VOL connector's wrapping context */ /* Sanity checks */ - HDassert(vol_obj->data); - HDassert(vol_obj->connector); + assert(vol_obj->data); + assert(vol_obj->connector); /* Check if the connector can create a wrap context */ if (vol_obj->connector->cls->wrap_cls.get_wrap_ctx) { /* Sanity check */ - HDassert(vol_obj->connector->cls->wrap_cls.free_wrap_ctx); + assert(vol_obj->connector->cls->wrap_cls.free_wrap_ctx); /* Get the wrap context from the connector */ if ((vol_obj->connector->cls->wrap_cls.get_wrap_ctx)(vol_obj->data, &obj_wrap_ctx) < 0) @@ -2463,7 +2463,7 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref) FUNC_ENTER_NOAPI(H5I_INVALID_HID) /* Sanity check */ - HDassert(obj); + assert(obj); /* Retrieve the VOL object wrapping context */ if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0) @@ -2517,9 +2517,9 @@ H5VL_check_plugin_load(const H5VL_class_t *cls, const H5PL_key_t *key, hbool_t * FUNC_ENTER_NOAPI_NOERR /* Sanity checks */ - HDassert(cls); - HDassert(key); - HDassert(success); + assert(cls); + assert(key); + assert(success); /* Which kind of key are we looking for? */ if (key->vol.kind == H5VL_GET_CONNECTOR_BY_NAME) { @@ -2529,7 +2529,7 @@ H5VL_check_plugin_load(const H5VL_class_t *cls, const H5PL_key_t *key, hbool_t * } /* end if */ else { /* Sanity check */ - HDassert(key->vol.kind == H5VL_GET_CONNECTOR_BY_VALUE); + assert(key->vol.kind == H5VL_GET_CONNECTOR_BY_VALUE); /* Check if plugin value matches VOL connector class value */ if (cls->value == key->vol.u.value) @@ -2558,7 +2558,7 @@ H5VL__is_default_conn(hid_t fapl_id, hid_t connector_id, hbool_t *is_default) FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ - HDassert(is_default); + assert(is_default); /* Determine if the default VOL connector will be used, based on non-default * values in the FAPL, connector ID, or the HDF5_VOL_CONNECTOR environment @@ -2587,7 +2587,7 @@ H5VL_setup_args(hid_t loc_id, H5I_type_t id_type, H5VL_object_t **vol_obj) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); + assert(vol_obj); /* Get attribute pointer */ if (NULL == (*vol_obj = (H5VL_object_t *)H5I_object_verify(loc_id, id_type))) @@ -2618,8 +2618,8 @@ H5VL_setup_loc_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *lo FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(loc_params); + assert(vol_obj); + assert(loc_params); /* Get the location object */ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id))) @@ -2655,10 +2655,10 @@ H5VL_setup_acc_args(hid_t loc_id, const H5P_libclass_t *libclass, hbool_t is_col FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(libclass); - HDassert(acspl_id); - HDassert(vol_obj); - HDassert(loc_params); + assert(libclass); + assert(acspl_id); + assert(vol_obj); + assert(loc_params); /* Verify access property list and set up collective metadata if appropriate */ if (H5CX_set_apl(acspl_id, libclass, loc_id, is_collective) < 0) @@ -2693,8 +2693,8 @@ H5VL_setup_self_args(hid_t loc_id, H5VL_object_t **vol_obj, H5VL_loc_params_t *l FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(loc_params); + assert(vol_obj); + assert(loc_params); /* Get the location object */ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id))) @@ -2726,8 +2726,8 @@ H5VL_setup_name_args(hid_t loc_id, const char *name, hbool_t is_collective, hid_ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(loc_params); + assert(vol_obj); + assert(loc_params); /* Check args */ if (!name) @@ -2772,8 +2772,8 @@ H5VL_setup_idx_args(hid_t loc_id, const char *name, H5_index_t idx_type, H5_iter FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(loc_params); + assert(vol_obj); + assert(loc_params); /* Check args */ if (!name) @@ -2824,8 +2824,8 @@ H5VL_setup_token_args(hid_t loc_id, H5O_token_t *obj_token, H5VL_object_t **vol_ FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(vol_obj); - HDassert(loc_params); + assert(vol_obj); + assert(loc_params); /* Get the location object */ if (NULL == (*vol_obj = (H5VL_object_t *)H5VL_vol_object(loc_id))) @@ -2861,7 +2861,7 @@ H5VL_get_cap_flags(const H5VL_connector_prop_t *connector_prop, uint64_t *cap_fl FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(connector_prop); + assert(connector_prop); /* Copy the connector ID & info, if there is one */ if (connector_prop->connector_id > 0) { diff --git a/src/H5VLnative.c b/src/H5VLnative.c index f686219..2ee8d16 100644 --- a/src/H5VLnative.c +++ b/src/H5VLnative.c @@ -250,7 +250,7 @@ H5VL__native_introspect_get_conn_cls(void H5_ATTR_UNUSED *obj, H5VL_get_conn_lvl FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(conn_cls); + assert(conn_cls); /* Retrieve the native VOL connector class */ *conn_cls = &H5VL_native_cls_g; @@ -276,7 +276,7 @@ H5VL__native_introspect_get_cap_flags(const void H5_ATTR_UNUSED *info, uint64_t FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ - HDassert(cap_flags); + assert(cap_flags); /* Set the flags from the connector's field */ *cap_flags = H5VL_native_cls_g.cap_flags; @@ -305,7 +305,7 @@ H5VL_native_get_file_addr_len(hid_t loc_id, size_t *addr_len) FUNC_ENTER_NOAPI(FAIL) /* check arguments */ - HDassert(addr_len); + assert(addr_len); /* Get object type */ if ((vol_obj_type = H5I_get_type(loc_id)) < 0) @@ -343,8 +343,8 @@ H5VL__native_get_file_addr_len(void *obj, H5I_type_t obj_type, size_t *addr_len) FUNC_ENTER_NOAPI(FAIL) /* check arguments */ - HDassert(obj); - HDassert(addr_len); + assert(obj); + assert(addr_len); /* Retrieve file from the VOL object */ if (H5VL_native_get_file_struct(obj, obj_type, &file) < 0) @@ -402,7 +402,7 @@ H5VLnative_addr_to_token(hid_t loc_id, haddr_t addr, H5O_token_t *token) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't determine if VOL object is native connector object") - HDassert(is_native_vol_obj && "not a native VOL connector object"); + assert(is_native_vol_obj && "not a native VOL connector object"); } #endif @@ -433,8 +433,8 @@ H5VL_native_addr_to_token(void *obj, H5I_type_t obj_type, haddr_t addr, H5O_toke FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(obj); - HDassert(token); + assert(obj); + assert(token); /* Get the length of an haddr_t in the file */ if (H5VL__native_get_file_addr_len(obj, obj_type, &addr_len) < 0) @@ -496,7 +496,7 @@ H5VLnative_token_to_addr(hid_t loc_id, H5O_token_t token, haddr_t *addr) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't determine if VOL object is native connector object") - HDassert(is_native_vol_obj && "not a native VOL connector object"); + assert(is_native_vol_obj && "not a native VOL connector object"); } #endif @@ -527,8 +527,8 @@ H5VL_native_token_to_addr(void *obj, H5I_type_t obj_type, H5O_token_t token, had FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(obj); - HDassert(addr); + assert(obj); + assert(addr); /* Get the length of an haddr_t in the file */ if (H5VL__native_get_file_addr_len(obj, obj_type, &addr_len) < 0) diff --git a/src/H5VLnative_blob.c b/src/H5VLnative_blob.c index 606bdeb..b70f09d 100644 --- a/src/H5VLnative_blob.c +++ b/src/H5VLnative_blob.c @@ -70,9 +70,9 @@ H5VL__native_blob_put(void *obj, const void *buf, size_t size, void *blob_id, vo FUNC_ENTER_PACKAGE /* Check parameters */ - HDassert(f); - HDassert(size == 0 || buf); - HDassert(id); + assert(f); + assert(size == 0 || buf); + assert(id); /* Write the VL information to disk (allocates space also) */ if (H5HG_insert(f, size, buf, &hobjid) < 0) @@ -110,9 +110,9 @@ H5VL__native_blob_get(void *obj, const void *blob_id, void *buf, size_t size, vo FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(id); - HDassert(buf); + assert(f); + assert(id); + assert(buf); /* Get the heap information */ H5F_addr_decode(f, &id, &hobjid.addr); @@ -153,8 +153,8 @@ H5VL__native_blob_specific(void *obj, void *blob_id, H5VL_blob_specific_args_t * FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(f); - HDassert(blob_id); + assert(f); + assert(blob_id); switch (args->op_type) { case H5VL_BLOB_ISNULL: { diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c index f343761..647e422 100644 --- a/src/H5VLnative_dataset.c +++ b/src/H5VLnative_dataset.c @@ -90,7 +90,7 @@ H5VL__native_dataset_io_setup(size_t count, void *obj[], hid_t mem_type_id[], hi FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dinfo); + assert(dinfo); /* Get shared file */ f_sh = H5F_SHARED(((H5D_t *)obj[0])->oloc.file); @@ -99,7 +99,7 @@ H5VL__native_dataset_io_setup(size_t count, void *obj[], hid_t mem_type_id[], hi for (i = 0; i < count; i++) { /* Set up dset */ dinfo[i].dset = (H5D_t *)obj[i]; - HDassert(dinfo[i].dset); + assert(dinfo[i].dset); /* Check dataset's file pointer is valid */ if (NULL == dinfo[i].dset->oloc.file) @@ -206,7 +206,7 @@ H5VL__native_dataset_io_cleanup(size_t count, hid_t mem_space_id[], hid_t file_s FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dinfo); + assert(dinfo); /* Iterate over datasets */ for (i = 0; i < count; i++) { @@ -562,7 +562,7 @@ H5VL__native_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_ FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(dset); + assert(dset); /* Set DXPL for operation */ H5CX_set_dxpl(dxpl_id); @@ -635,8 +635,8 @@ H5VL__native_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_ H5VL_native_dataset_get_num_chunks_t *gnc_args = &opt_args->get_num_chunks; const H5S_t *space = NULL; - HDassert(dset->shared); - HDassert(dset->shared->space); + assert(dset->shared); + assert(dset->shared->space); /* When default dataspace is given, use the dataset's dataspace */ if (gnc_args->space_id == H5S_ALL) @@ -661,8 +661,8 @@ H5VL__native_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_ H5VL_native_dataset_get_chunk_info_by_idx_t *gcibi_args = &opt_args->get_chunk_info_by_idx; const H5S_t *space; - HDassert(dset->shared); - HDassert(dset->shared->space); + assert(dset->shared); + assert(dset->shared->space); /* When default dataspace is given, use the dataset's dataspace */ if (gcibi_args->space_id == H5S_ALL) @@ -687,7 +687,7 @@ H5VL__native_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_ case H5VL_NATIVE_DATASET_GET_CHUNK_INFO_BY_COORD: { H5VL_native_dataset_get_chunk_info_by_coord_t *gcibc_args = &opt_args->get_chunk_info_by_coord; - HDassert(dset->shared); + assert(dset->shared); /* Make sure the dataset is chunked */ if (H5D_CHUNKED != dset->shared->layout.type) @@ -771,7 +771,7 @@ H5VL__native_dataset_optional(void *obj, H5VL_optional_args_t *args, hid_t dxpl_ /* H5Dchunk_iter */ case H5VL_NATIVE_DATASET_CHUNK_ITER: { /* Sanity check */ - HDassert(dset->shared); + assert(dset->shared); /* Make sure the dataset is chunked */ if (H5D_CHUNKED != dset->shared->layout.type) diff --git a/src/H5VLnative_file.c b/src/H5VLnative_file.c index f2f0ea7..ba6d16d 100644 --- a/src/H5VLnative_file.c +++ b/src/H5VLnative_file.c @@ -753,7 +753,7 @@ H5VL__native_file_close(void *file, hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_U FUNC_ENTER_PACKAGE /* This routine should only be called when a file ID's ref count drops to zero */ - HDassert(f->shared == NULL || H5F_ID_EXISTS(f)); + assert(f->shared == NULL || H5F_ID_EXISTS(f)); if (f->shared == NULL) f = H5FL_FREE(H5F_t, f); diff --git a/src/H5VLnative_introspect.c b/src/H5VLnative_introspect.c index 0cc6ee4..e322395 100644 --- a/src/H5VLnative_introspect.c +++ b/src/H5VLnative_introspect.c @@ -75,7 +75,7 @@ H5VL__native_introspect_opt_query(void H5_ATTR_UNUSED *obj, H5VL_subclass_t subc FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(flags); + assert(flags); /* The native VOL connector supports all optional operations */ *flags = H5VL_OPT_QUERY_SUPPORTED; diff --git a/src/H5VLnative_token.c b/src/H5VLnative_token.c index b5bd7b8..4091c1d 100644 --- a/src/H5VLnative_token.c +++ b/src/H5VLnative_token.c @@ -70,8 +70,8 @@ H5VL__native_token_cmp(void H5_ATTR_UNUSED *obj, const H5O_token_t *token1, cons FUNC_ENTER_PACKAGE_NOERR /* Check parameters */ - HDassert(token1); - HDassert(token2); + assert(token1); + assert(token2); *cmp_value = HDmemcmp(token1, token2, sizeof(H5O_token_t)); @@ -98,8 +98,8 @@ H5VL__native_token_to_str(void *obj, H5I_type_t obj_type, const H5O_token_t *tok FUNC_ENTER_PACKAGE /* Check parameters */ - HDassert(obj); - HDassert(token); + assert(obj); + assert(token); if (H5VL_native_token_to_addr(obj, obj_type, *token, &addr) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, FAIL, "can't convert object token to address") @@ -137,7 +137,7 @@ H5VL__native_str_to_token(void *obj, H5I_type_t obj_type, const char *token_str, FUNC_ENTER_PACKAGE /* Check parameters */ - HDassert(token_str); + assert(token_str); HDsscanf(token_str, "%" PRIuHADDR, &addr); diff --git a/src/H5VM.c b/src/H5VM.c index f67917d..14b157e 100644 --- a/src/H5VM.c +++ b/src/H5VM.c @@ -63,7 +63,7 @@ H5VM__stride_optimize1(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c /* This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM_vector_reduce_product(0, NULL)); + assert(1 == H5VM_vector_reduce_product(0, NULL)); /* Combine adjacent memory accesses */ while (*np && stride1[*np - 1] > 0 && (hsize_t)(stride1[*np - 1]) == *elmt_size) { @@ -102,8 +102,8 @@ H5VM__stride_optimize2(unsigned *np /*in,out*/, hsize_t *elmt_size /*in,out*/, c /* This has to be true because if we optimize the dimensionality down to * zero we still must make one reference. */ - HDassert(1 == H5VM_vector_reduce_product(0, NULL)); - HDassert(*elmt_size > 0); + assert(1 == H5VM_vector_reduce_product(0, NULL)); + assert(*elmt_size > 0); /* Combine adjacent memory accesses */ @@ -228,48 +228,48 @@ H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, co FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(n <= H5VM_HYPER_NDIMS); - HDassert(size); - HDassert(total_size); - HDassert(stride); + assert(n <= H5VM_HYPER_NDIMS); + assert(size); + assert(total_size); + assert(stride); /* init */ - HDassert(n > 0); + assert(n > 0); stride[n - 1] = 1; skip = offset ? offset[n - 1] : 0; switch (n) { case 2: /* 1-D dataset */ - HDassert(total_size[1] >= size[1]); + assert(total_size[1] >= size[1]); stride[0] = total_size[1] - size[1]; /*overflow checked*/ acc = total_size[1]; skip += acc * (offset ? offset[0] : 0); break; case 3: /* 2-D dataset */ - HDassert(total_size[2] >= size[2]); + assert(total_size[2] >= size[2]); stride[1] = total_size[2] - size[2]; /*overflow checked*/ acc = total_size[2]; skip += acc * (offset ? (hsize_t)offset[1] : 0); - HDassert(total_size[1] >= size[1]); + assert(total_size[1] >= size[1]); stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/ acc *= total_size[1]; skip += acc * (offset ? (hsize_t)offset[0] : 0); break; case 4: /* 3-D dataset */ - HDassert(total_size[3] >= size[3]); + assert(total_size[3] >= size[3]); stride[2] = total_size[3] - size[3]; /*overflow checked*/ acc = total_size[3]; skip += acc * (offset ? (hsize_t)offset[2] : 0); - HDassert(total_size[2] >= size[2]); + assert(total_size[2] >= size[2]); stride[1] = acc * (total_size[2] - size[2]); /*overflow checked*/ acc *= total_size[2]; skip += acc * (offset ? (hsize_t)offset[1] : 0); - HDassert(total_size[1] >= size[1]); + assert(total_size[1] >= size[1]); stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/ acc *= total_size[1]; skip += acc * (offset ? (hsize_t)offset[0] : 0); @@ -278,7 +278,7 @@ H5VM_hyper_stride(unsigned n, const hsize_t *size, const hsize_t *total_size, co default: /* others */ for (i = (int)(n - 2), acc = 1; i >= 0; --i) { - HDassert(total_size[i + 1] >= size[i + 1]); + assert(total_size[i + 1] >= size[i + 1]); stride[i] = acc * (total_size[i + 1] - size[i + 1]); /*overflow checked*/ acc *= total_size[i + 1]; skip += acc * (offset ? (hsize_t)offset[i] : 0); @@ -377,14 +377,14 @@ H5VM_hyper_fill(unsigned n, const hsize_t *_size, const hsize_t *total_size, con FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(n > 0 && n <= H5VM_HYPER_NDIMS); - HDassert(_size); - HDassert(total_size); - HDassert(dst); + assert(n > 0 && n <= H5VM_HYPER_NDIMS); + assert(_size); + assert(total_size); + assert(dst); #ifndef NDEBUG for (u = 0; u < n; u++) { - HDassert(_size[u] > 0); - HDassert(total_size[u] > 0); + assert(_size[u] > 0); + assert(total_size[u] > 0); } #endif @@ -449,17 +449,17 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const FUNC_ENTER_NOAPI_NOINIT_NOERR /* check args */ - HDassert(n > 0 && n <= H5VM_HYPER_NDIMS); - HDassert(_size); - HDassert(dst_size); - HDassert(src_size); - HDassert(dst); - HDassert(src); + assert(n > 0 && n <= H5VM_HYPER_NDIMS); + assert(_size); + assert(dst_size); + assert(src_size); + assert(dst); + assert(src); #ifndef NDEBUG for (u = 0; u < n; u++) { - HDassert(_size[u] > 0); - HDassert(dst_size[u] > 0); - HDassert(src_size[u] > 0); + assert(_size[u] > 0); + assert(dst_size[u] > 0); + assert(src_size[u] > 0); } #endif @@ -478,7 +478,7 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const int ii; /*counter */ /* init */ - HDassert(n > 0); + assert(n > 0); dst_stride[n - 1] = 1; src_stride[n - 1] = 1; dst_start = dst_offset ? dst_offset[n - 1] : 0; @@ -487,8 +487,8 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const /* Unroll loop for common cases */ switch (n) { case 2: - HDassert(dst_size[1] >= size[1]); - HDassert(src_size[1] >= size[1]); + assert(dst_size[1] >= size[1]); + assert(src_size[1] >= size[1]); dst_stride[0] = dst_size[1] - size[1]; /*overflow checked*/ src_stride[0] = src_size[1] - size[1]; /*overflow checked*/ dst_acc = dst_size[1]; @@ -498,8 +498,8 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const break; case 3: - HDassert(dst_size[2] >= size[2]); - HDassert(src_size[2] >= size[2]); + assert(dst_size[2] >= size[2]); + assert(src_size[2] >= size[2]); dst_stride[1] = dst_size[2] - size[2]; /*overflow checked*/ src_stride[1] = src_size[2] - size[2]; /*overflow checked*/ dst_acc = dst_size[2]; @@ -507,8 +507,8 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0); src_start += src_acc * (src_offset ? src_offset[1] : 0); - HDassert(dst_size[1] >= size[1]); - HDassert(src_size[1] >= size[1]); + assert(dst_size[1] >= size[1]); + assert(src_size[1] >= size[1]); dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/ dst_acc *= dst_size[1]; @@ -518,8 +518,8 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const break; case 4: - HDassert(dst_size[3] >= size[3]); - HDassert(src_size[3] >= size[3]); + assert(dst_size[3] >= size[3]); + assert(src_size[3] >= size[3]); dst_stride[2] = dst_size[3] - size[3]; /*overflow checked*/ src_stride[2] = src_size[3] - size[3]; /*overflow checked*/ dst_acc = dst_size[3]; @@ -527,8 +527,8 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const dst_start += dst_acc * (dst_offset ? dst_offset[2] : 0); src_start += src_acc * (src_offset ? src_offset[2] : 0); - HDassert(dst_size[2] >= size[2]); - HDassert(src_size[2] >= size[2]); + assert(dst_size[2] >= size[2]); + assert(src_size[2] >= size[2]); dst_stride[1] = dst_acc * (dst_size[2] - size[2]); /*overflow checked*/ src_stride[1] = src_acc * (src_size[2] - size[2]); /*overflow checked*/ dst_acc *= dst_size[2]; @@ -536,8 +536,8 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0); src_start += src_acc * (src_offset ? src_offset[1] : 0); - HDassert(dst_size[1] >= size[1]); - HDassert(src_size[1] >= size[1]); + assert(dst_size[1] >= size[1]); + assert(src_size[1] >= size[1]); dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/ dst_acc *= dst_size[1]; @@ -549,8 +549,8 @@ H5VM_hyper_copy(unsigned n, const hsize_t *_size, const hsize_t *dst_size, const default: /* others */ for (ii = (int)(n - 2), dst_acc = 1, src_acc = 1; ii >= 0; --ii) { - HDassert(dst_size[ii + 1] >= size[ii + 1]); - HDassert(src_size[ii + 1] >= size[ii + 1]); + assert(dst_size[ii + 1] >= size[ii + 1]); + assert(src_size[ii + 1] >= size[ii + 1]); dst_stride[ii] = dst_acc * (dst_size[ii + 1] - size[ii + 1]); /*overflow checked*/ src_stride[ii] = src_acc * (src_size[ii + 1] - size[ii + 1]); /*overflow checked*/ dst_acc *= dst_size[ii + 1]; @@ -599,7 +599,7 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(elmt_size < SIZE_MAX); + assert(elmt_size < SIZE_MAX); H5VM_vector_cpy(n, idx, size); nelmts = H5VM_vector_reduce_product(n, size); @@ -615,7 +615,7 @@ H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize if (--idx[j]) carry = FALSE; else { - HDassert(size); + assert(size); idx[j] = size[j]; } /* end else */ } @@ -657,7 +657,7 @@ H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(elmt_size < SIZE_MAX); + assert(elmt_size < SIZE_MAX); if (n) { H5VM_vector_cpy(n, idx, size); @@ -676,7 +676,7 @@ H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size, const hsize if (--idx[j]) carry = FALSE; else { - HDassert(size); + assert(size); idx[j] = size[j]; } } @@ -723,7 +723,7 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(elmt_size < SIZE_MAX); + assert(elmt_size < SIZE_MAX); if (n) { H5VM_vector_cpy(n, idx, size); @@ -742,7 +742,7 @@ H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size, const hss if (--idx[j]) carry = FALSE; else { - HDassert(size); + assert(size); idx[j] = size[j]; } } @@ -780,10 +780,10 @@ H5VM_array_fill(void *_dst, const void *src, size_t size, size_t count) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(dst); - HDassert(src); - HDassert(size < SIZE_MAX && size > 0); - HDassert(count < SIZE_MAX && count > 0); + assert(dst); + assert(src); + assert(size < SIZE_MAX && size > 0); + assert(count < SIZE_MAX && count > 0); H5MM_memcpy(dst, src, size); /* copy first item */ @@ -831,9 +831,9 @@ H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(n <= H5VM_HYPER_NDIMS); - HDassert(total_size); - HDassert(down); + assert(n <= H5VM_HYPER_NDIMS); + assert(total_size); + assert(down); /* Build the sizes of each dimension in the array * (From fastest to slowest) @@ -871,9 +871,9 @@ H5VM_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset) FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(n <= H5VM_HYPER_NDIMS); - HDassert(acc); - HDassert(offset); + assert(n <= H5VM_HYPER_NDIMS); + assert(acc); + assert(offset); /* Compute offset in array */ for (u = 0, ret_value = 0; u < n; u++) @@ -907,9 +907,9 @@ H5VM_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset) FUNC_ENTER_NOAPI_NOERR - HDassert(n <= H5VM_HYPER_NDIMS); - HDassert(total_size); - HDassert(offset); + assert(n <= H5VM_HYPER_NDIMS); + assert(total_size); + assert(offset); /* Build the sizes of each dimension in the array */ H5VM_array_down(n, total_size, acc_arr); @@ -946,8 +946,8 @@ H5VM_array_calc_pre(hsize_t offset, unsigned n, const hsize_t *down, hsize_t *co FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(n <= H5VM_HYPER_NDIMS); - HDassert(coords); + assert(n <= H5VM_HYPER_NDIMS); + assert(coords); /* Compute the coordinates from the offset */ for (u = 0; u < n; u++) { @@ -985,9 +985,9 @@ H5VM_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t * FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(n <= H5VM_HYPER_NDIMS); - HDassert(total_size); - HDassert(coords); + assert(n <= H5VM_HYPER_NDIMS); + assert(total_size); + assert(coords); /* Build the sizes of each dimension in the array */ H5VM_array_down(n, total_size, idx); @@ -1049,10 +1049,10 @@ H5VM_chunk_index(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, co FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(ndims <= H5VM_HYPER_NDIMS); - HDassert(coord); - HDassert(chunk); - HDassert(down_nchunks); + assert(ndims <= H5VM_HYPER_NDIMS); + assert(coord); + assert(chunk); + assert(down_nchunks); /* Defer to H5VM_chunk_index_scaled */ chunk_idx = H5VM_chunk_index_scaled(ndims, coord, chunk, down_nchunks, scaled_coord); @@ -1080,10 +1080,10 @@ H5VM_chunk_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *chunk, h FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(ndims <= H5VM_HYPER_NDIMS); - HDassert(coord); - HDassert(chunk); - HDassert(scaled); + assert(ndims <= H5VM_HYPER_NDIMS); + assert(coord); + assert(chunk); + assert(scaled); /* Compute the scaled coordinates for actual coordinates */ /* (Note that the 'scaled' array is an 'OUT' parameter) */ @@ -1146,11 +1146,11 @@ H5VM_chunk_index_scaled(unsigned ndims, const hsize_t *coord, const uint32_t *ch FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(ndims <= H5VM_HYPER_NDIMS); - HDassert(coord); - HDassert(chunk); - HDassert(down_nchunks); - HDassert(scaled); + assert(ndims <= H5VM_HYPER_NDIMS); + assert(coord); + assert(chunk); + assert(down_nchunks); + assert(scaled); /* Compute the scaled coordinates for actual coordinates */ /* (Note that the 'scaled' array is an 'OUT' parameter) */ @@ -1202,15 +1202,15 @@ H5VM_opvv(size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(dst_curr_seq); - HDassert(*dst_curr_seq < dst_max_nseq); - HDassert(dst_len_arr); - HDassert(dst_off_arr); - HDassert(src_curr_seq); - HDassert(*src_curr_seq < src_max_nseq); - HDassert(src_len_arr); - HDassert(src_off_arr); - HDassert(op); + assert(dst_curr_seq); + assert(*dst_curr_seq < dst_max_nseq); + assert(dst_len_arr); + assert(dst_off_arr); + assert(src_curr_seq); + assert(*src_curr_seq < src_max_nseq); + assert(src_len_arr); + assert(src_off_arr); + assert(op); /* Set initial offset & length pointers */ dst_len_ptr = dst_len_arr + *dst_curr_seq; @@ -1408,16 +1408,16 @@ H5VM_memcpyvv(void *_dst, size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_ FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(_dst); - HDassert(dst_curr_seq); - HDassert(*dst_curr_seq < dst_max_nseq); - HDassert(dst_len_arr); - HDassert(dst_off_arr); - HDassert(_src); - HDassert(src_curr_seq); - HDassert(*src_curr_seq < src_max_nseq); - HDassert(src_len_arr); - HDassert(src_off_arr); + assert(_dst); + assert(dst_curr_seq); + assert(*dst_curr_seq < dst_max_nseq); + assert(dst_len_arr); + assert(dst_off_arr); + assert(_src); + assert(src_curr_seq); + assert(*src_curr_seq < src_max_nseq); + assert(src_len_arr); + assert(src_off_arr); /* Set initial offset & length pointers */ dst_len_ptr = dst_len_arr + *dst_curr_seq; diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 0c96fef..a81ef0d 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -36,7 +36,7 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len, /* Other functions */ #define H5VM_vector_cpy(N, DST, SRC) \ do { \ - HDassert(sizeof(*(DST)) == sizeof(*(SRC))); \ + assert(sizeof(*(DST)) == sizeof(*(SRC))); \ if (SRC) \ H5MM_memcpy(DST, SRC, (N) * sizeof(*(DST))); \ else \ @@ -51,7 +51,7 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len, #define H5VM_swizzle_coords(TYPE, COORDS, UNLIM_DIM) \ do { \ /* COORDS must be an array of type TYPE */ \ - HDassert(sizeof(COORDS[0]) == sizeof(TYPE)); \ + assert(sizeof(COORDS[0]) == sizeof(TYPE)); \ \ /* Nothing to do when unlimited dimension is at position 0 */ \ if (0 != (UNLIM_DIM)) { \ @@ -69,7 +69,7 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, size_t len, #define H5VM_unswizzle_coords(TYPE, COORDS, UNLIM_DIM) \ do { \ /* COORDS must be an array of type TYPE */ \ - HDassert(sizeof(COORDS[0]) == sizeof(TYPE)); \ + assert(sizeof(COORDS[0]) == sizeof(TYPE)); \ \ /* Nothing to do when unlimited dimension is at position 0 */ \ if (0 != (UNLIM_DIM)) { \ @@ -402,7 +402,7 @@ static inline H5_ATTR_PURE unsigned H5VM_log2_of2(uint32_t n) { #ifndef NDEBUG - HDassert(POWER_OF_TWO(n)); + assert(POWER_OF_TWO(n)); #endif /* NDEBUG */ return (MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); } /* H5VM_log2_of2() */ diff --git a/src/H5WB.c b/src/H5WB.c index 2f89807..b9e11d9 100644 --- a/src/H5WB.c +++ b/src/H5WB.c @@ -102,8 +102,8 @@ H5WB_wrap(void *buf, size_t buf_size) /* * Check arguments. */ - HDassert(buf); - HDassert(buf_size); + assert(buf); + assert(buf_size); /* Create wrapped buffer info */ if (NULL == (wb = H5FL_MALLOC(H5WB_t))) @@ -153,13 +153,13 @@ H5WB_actual(H5WB_t *wb, size_t need) /* * Check arguments. */ - HDassert(wb); - HDassert(wb->wrapped_buf); + assert(wb); + assert(wb->wrapped_buf); /* Check for previously allocated buffer */ if (wb->actual_buf && wb->actual_buf != wb->wrapped_buf) { /* Sanity check */ - HDassert(wb->actual_size > wb->wrapped_size); + assert(wb->actual_size > wb->wrapped_size); /* Check if we can re-use existing buffer */ if (need <= wb->alloc_size) @@ -219,8 +219,8 @@ H5WB_actual_clear(H5WB_t *wb, size_t need) /* * Check arguments. */ - HDassert(wb); - HDassert(wb->wrapped_buf); + assert(wb); + assert(wb->wrapped_buf); /* Get a pointer to an actual buffer */ if (NULL == (ret_value = H5WB_actual(wb, need))) @@ -253,13 +253,13 @@ H5WB_unwrap(H5WB_t *wb) /* * Check arguments. */ - HDassert(wb); - HDassert(wb->wrapped_buf); + assert(wb); + assert(wb->wrapped_buf); /* Release any extra buffers allocated */ if (wb->actual_buf && wb->actual_buf != wb->wrapped_buf) { /* Sanity check */ - HDassert(wb->actual_size > wb->wrapped_size); + assert(wb->actual_size > wb->wrapped_size); wb->actual_buf = H5FL_BLK_FREE(extra_buf, wb->actual_buf); } /* end if */ diff --git a/src/H5Z.c b/src/H5Z.c index 8631b04..dcb2d36 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -294,8 +294,8 @@ H5Z_register(const H5Z_class2_t *cls) FUNC_ENTER_NOAPI(FAIL) - HDassert(cls); - HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); + assert(cls); + assert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ for (i = 0; i < H5Z_table_used_g; i++) @@ -388,7 +388,7 @@ H5Z__unregister(H5Z_filter_t filter_id) FUNC_ENTER_PACKAGE - HDassert(filter_id >= 0 && filter_id <= H5Z_FILTER_MAX); + assert(filter_id >= 0 && filter_id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ for (filter_index = 0; filter_index < H5Z_table_used_g; filter_index++) @@ -495,7 +495,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void FUNC_ENTER_PACKAGE - HDassert(obj_ptr); + assert(obj_ptr); /* Get the group creation property */ if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) @@ -545,7 +545,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * FUNC_ENTER_PACKAGE - HDassert(obj_ptr); + assert(obj_ptr); /* Get the dataset creation property */ if ((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) @@ -593,8 +593,8 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_PARA FUNC_ENTER_PACKAGE /* Sanity checks */ - HDassert(obj_ptr); - HDassert(key); + assert(obj_ptr); + assert(key); /* Do a global flush if the file is opened for write */ if (H5F_ACC_RDWR & H5F_INTENT(f)) { @@ -717,7 +717,7 @@ H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hi FUNC_ENTER_PACKAGE - HDassert(pline->nused > 0); + assert(pline->nused > 0); /* Iterate over filters */ for (u = 0; u < pline->nused; u++) { @@ -765,7 +765,7 @@ H5Z__prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, hi break; default: - HDassert("invalid prelude type" && 0); + assert("invalid prelude type" && 0); } /* end switch */ } /* end else */ } /* end for */ @@ -797,8 +797,8 @@ H5Z__prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_typ FUNC_ENTER_PACKAGE - HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert(H5I_DATATYPE == H5I_get_type(type_id)); + assert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + assert(H5I_DATATYPE == H5I_get_type(type_id)); /* Check if the property list is non-default */ if (dcpl_id != H5P_DATASET_CREATE_DEFAULT) { @@ -937,7 +937,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + assert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) @@ -969,7 +969,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + assert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ if (H5Z__prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) @@ -1061,10 +1061,10 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + assert(pline); + assert(filter >= 0 && filter <= H5Z_FILTER_MAX); + assert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + assert(0 == cd_nelmts || cd_values); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1125,10 +1125,10 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t cd_ne FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + assert(pline); + assert(filter >= 0 && filter <= H5Z_FILTER_MAX); + assert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + assert(0 == cd_nelmts || cd_values); /* * Check filter limit. We do it here for early warnings although we may @@ -1304,12 +1304,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask /*i FUNC_ENTER_NOAPI(FAIL) - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); - HDassert(filter_mask); - HDassert(nbytes && *nbytes > 0); - HDassert(buf_size && *buf_size > 0); - HDassert(buf && *buf); - HDassert(!pline || pline->nused < H5Z_MAX_NFILTERS); + assert(0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); + assert(filter_mask); + assert(nbytes && *nbytes > 0); + assert(buf_size && *buf_size > 0); + assert(buf && *buf); + assert(!pline || pline->nused < H5Z_MAX_NFILTERS); #ifdef H5Z_DEBUG H5_timer_init(&timer); @@ -1474,8 +1474,8 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + assert(pline); + assert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1512,8 +1512,8 @@ H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI_NOERR - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + assert(pline); + assert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1546,7 +1546,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) FUNC_ENTER_NOAPI_NOERR /* Check args */ - HDassert(pline); + assert(pline); /* Iterate through all the filters in pipeline */ for (i = 0; i < pline->nused; i++) { @@ -1582,8 +1582,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + assert(pline); + assert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ if (pline->nused == 0) @@ -1612,11 +1612,11 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) /* Free information for deleted filter */ if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) - HDassert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); + assert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); if (pline->filter[idx].name != pline->filter[idx]._name) pline->filter[idx].name = (char *)H5MM_xfree(pline->filter[idx].name); if (pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - HDassert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); + assert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); if (pline->filter[idx].cd_values != pline->filter[idx]._cd_values) pline->filter[idx].cd_values = (unsigned *)H5MM_xfree(pline->filter[idx].cd_values); diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index b446073..520b26a 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -74,9 +74,9 @@ H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(*buf_size > 0); - HDassert(buf); - HDassert(*buf); + assert(*buf_size > 0); + assert(buf); + assert(*buf); /* Check arguments */ if (cd_nelmts != 1 || cd_values[0] > 9) diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index bdf3759..19f24c4 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -68,7 +68,7 @@ H5Z__filter_fletcher32(unsigned flags, size_t H5_ATTR_UNUSED cd_nelmts, FUNC_ENTER_PACKAGE - HDassert(sizeof(uint32_t) >= 4); + assert(sizeof(uint32_t) >= 4); if (flags & H5Z_FLAG_REVERSE) { /* Read */ /* Do checksum if it's enabled for read; otherwise skip it diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 2088ddf..90f8604 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -866,7 +866,7 @@ H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get total number of elements in the chunk */ if ((npoints = H5S_GET_EXTENT_NPOINTS(ds)) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get number of points in the dataspace") - HDassert(npoints); + assert(npoints); /* Initialize index for cd_values array starting from the third entry */ cd_values_index = 2; @@ -915,7 +915,7 @@ H5Z__set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) } /* end switch */ /* Check if calculation of parameters matches with setting of parameters */ - HDassert(cd_values_actual_nparms == cd_values_index); + assert(cd_values_actual_nparms == cd_values_index); /* Finally set the first two entries of cd_values[] */ H5_CHECK_OVERFLOW(cd_values_actual_nparms, size_t, unsigned); @@ -986,7 +986,7 @@ H5Z__filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s } /* end if */ /* output; compress */ else { - HDassert(nbytes == d_nelmts * cd_values[4]); + assert(nbytes == d_nelmts * cd_values[4]); size_out = nbytes; @@ -1128,7 +1128,7 @@ H5Z__nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigne } else { /* big endian */ /* Sanity check */ - HDassert(p->order == H5Z_NBIT_ORDER_BE); + assert(p->order == H5Z_NBIT_ORDER_BE); /* calculate begin_i and end_i */ begin_i = ((unsigned)datatype_len - p->precision - p->offset) / 8; @@ -1203,7 +1203,7 @@ H5Z__nbit_decompress_one_array(unsigned char *data, size_t data_offset, unsigned break; default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); } /* end switch */ done: @@ -1268,7 +1268,7 @@ H5Z__nbit_decompress_one_compound(unsigned char *data, size_t data_offset, unsig break; default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); } /* end switch */ } @@ -1335,7 +1335,7 @@ H5Z__nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buff break; default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); } /* end switch */ done: @@ -1435,7 +1435,7 @@ H5Z__nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned } else { /* big endian */ /* Sanity check */ - HDassert(p->order == H5Z_NBIT_ORDER_BE); + assert(p->order == H5Z_NBIT_ORDER_BE); /* calculate begin_i and end_i */ begin_i = ((unsigned)datatype_len - p->precision - p->offset) / 8; @@ -1499,7 +1499,7 @@ H5Z__nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned c break; default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); } /* end switch */ } @@ -1542,7 +1542,7 @@ H5Z__nbit_compress_one_compound(unsigned char *data, size_t data_offset, unsigne break; default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); } /* end switch */ } } @@ -1598,7 +1598,7 @@ H5Z__nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer break; default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); } /* end switch */ /* Update the size to the new value after compression. If there are any bits hanging over in diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 6ef559e..4266985 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -164,7 +164,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } while (_size_rem); \ } /* end if */ \ else { \ - HDassert(H5T_native_order_g == H5T_ORDER_BE); \ + assert(H5T_native_order_g == H5T_ORDER_BE); \ \ /* Copy 4 bytes at a time to each cd value, but start at the end \ * (highest address) of fill_val */ \ @@ -183,7 +183,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ _fv_p -= _size_rem; \ } /* end while */ \ \ - HDassert(_fv_p == (char *)&(fill_val)); \ + assert(_fv_p == (char *)&(fill_val)); \ if (_size_rem) { \ /* Amount left to copy is smaller than a cd_value, initialize \ * _cd_value as it will not be fully overwritten and copy to the end \ @@ -291,7 +291,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ } while (_size_rem); \ } /* end if */ \ else { \ - HDassert(H5T_native_order_g == H5T_ORDER_BE); \ + assert(H5T_native_order_g == H5T_ORDER_BE); \ \ /* Copy 4 bytes at a time to each cd value, but start at the end \ * (highest address) of fill_val */ \ @@ -310,7 +310,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ _fv_p -= _size_rem; \ } /* end while */ \ \ - HDassert(_fv_p == (char *)&(fill_val)); \ + assert(_fv_p == (char *)&(fill_val)); \ if (_size_rem) { \ /* Amount left to copy is smaller than a cd_value, initialize \ * _cd_value as it will not be fully overwritten and copy to the end \ @@ -586,7 +586,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ if (H5T_native_order_g == H5T_ORDER_LE) \ H5MM_memcpy(minval, &min, sizeof(type)); \ else { \ - HDassert(H5T_native_order_g == H5T_ORDER_BE); \ + assert(H5T_native_order_g == H5T_ORDER_BE); \ H5MM_memcpy(((char *)minval) + (sizeof(long long) - sizeof(type)), &min, sizeof(type)); \ } /* end else */ \ else \ @@ -673,7 +673,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ if (H5T_native_order_g == H5T_ORDER_LE) \ H5MM_memcpy(&min, &minval, sizeof(type)); \ else { \ - HDassert(H5T_native_order_g == H5T_ORDER_BE); \ + assert(H5T_native_order_g == H5T_ORDER_BE); \ H5MM_memcpy(&min, ((char *)&minval) + (sizeof(long long) - sizeof(type)), sizeof(type)); \ } /* end else */ \ else \ @@ -1240,7 +1240,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu minval |= minval_mask; } - HDassert(minbits <= p.size * 8); + assert(minbits <= p.size * 8); p.minbits = minbits; /* calculate size of output buffer after decompression */ @@ -1298,7 +1298,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu } /* output; compress */ else { - HDassert(nbytes == d_nelmts * p.size); + assert(nbytes == d_nelmts * p.size); /* before preprocess, convert to memory endianness order if needed */ if (need_convert) @@ -1319,7 +1319,7 @@ H5Z__filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_valu HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed") } - HDassert(minbits <= p.size * 8); + assert(minbits <= p.size * 8); /* calculate buffer size after compression * minbits and minval are stored in the front of the compressed buffer @@ -1655,7 +1655,7 @@ H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned dtype_len; int k; - HDassert(p.minbits > 0); + assert(p.minbits > 0); dtype_len = p.size * 8; @@ -1667,7 +1667,7 @@ H5Z__scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, p, dtype_len); } else { /* big endian */ - HDassert(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE); + assert(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE); begin_i = (dtype_len - p.minbits) / 8; @@ -1739,7 +1739,7 @@ H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, un unsigned dtype_len; int k; - HDassert(p.minbits > 0); + assert(p.minbits > 0); dtype_len = p.size * 8; @@ -1751,7 +1751,7 @@ H5Z__scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, un dtype_len); } else { /* big endian */ - HDassert(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE); + assert(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE); begin_i = (dtype_len - p.minbits) / 8; for (k = (int)begin_i; k <= (int)(p.size - 1); k++) diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 4537110..99b33cc 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -171,7 +171,7 @@ H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] duffs_index = (numofelements + 7) / 8; switch (numofelements % 8) { default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); break; case 0: do { @@ -242,7 +242,7 @@ H5Z__filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] duffs_index = (numofelements + 7) / 8; switch (numofelements % 8) { default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); break; case 0: do { diff --git a/src/H5Zszip.c b/src/H5Zszip.c index b03ca38..6ebb528 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -181,7 +181,7 @@ H5Z__set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Set "local" parameter for this dataset's "pixels-per-scanline" */ /* (Use the chunk's fastest changing dimension size) */ - HDassert(ndims > 0); + assert(ndims > 0); scanline = dims[ndims - 1]; /* Adjust scanline if it is smaller than number of pixels per block or @@ -271,13 +271,13 @@ H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s /* Sanity check to make certain that we haven't drifted out of date with * the mask options from the szlib.h header */ - HDassert(H5_SZIP_ALLOW_K13_OPTION_MASK == SZ_ALLOW_K13_OPTION_MASK); - HDassert(H5_SZIP_CHIP_OPTION_MASK == SZ_CHIP_OPTION_MASK); - HDassert(H5_SZIP_EC_OPTION_MASK == SZ_EC_OPTION_MASK); - HDassert(H5_SZIP_LSB_OPTION_MASK == SZ_LSB_OPTION_MASK); - HDassert(H5_SZIP_MSB_OPTION_MASK == SZ_MSB_OPTION_MASK); - HDassert(H5_SZIP_NN_OPTION_MASK == SZ_NN_OPTION_MASK); - HDassert(H5_SZIP_RAW_OPTION_MASK == SZ_RAW_OPTION_MASK); + assert(H5_SZIP_ALLOW_K13_OPTION_MASK == SZ_ALLOW_K13_OPTION_MASK); + assert(H5_SZIP_CHIP_OPTION_MASK == SZ_CHIP_OPTION_MASK); + assert(H5_SZIP_EC_OPTION_MASK == SZ_EC_OPTION_MASK); + assert(H5_SZIP_LSB_OPTION_MASK == SZ_LSB_OPTION_MASK); + assert(H5_SZIP_MSB_OPTION_MASK == SZ_MSB_OPTION_MASK); + assert(H5_SZIP_NN_OPTION_MASK == SZ_NN_OPTION_MASK); + assert(H5_SZIP_RAW_OPTION_MASK == SZ_RAW_OPTION_MASK); /* Check arguments */ if (cd_nelmts != 4) @@ -307,7 +307,7 @@ H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s size_out = nalloc; if (SZ_BufftoBuffDecompress(outbuf, &size_out, newbuf, nbytes - 4, &sz_param) != SZ_OK) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "szip_filter: decompression failed") - HDassert(size_out == nalloc); + assert(size_out == nalloc); /* Free the input buffer */ H5MM_xfree(*buf); @@ -334,7 +334,7 @@ H5Z__filter_szip(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], s size_out = nbytes; if (SZ_OK != SZ_BufftoBuffCompress(dst, &size_out, *buf, nbytes, &sz_param)) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow") - HDassert(size_out <= nbytes); + assert(size_out <= nbytes); /* Free the input buffer */ H5MM_xfree(*buf); diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index cd19a39..7734e8f 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -345,7 +345,7 @@ H5Z__unget_token(H5Z_token *current) FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(current); + assert(current); current->tok_type = current->tok_last_type; current->tok_begin = current->tok_last_begin; @@ -380,7 +380,7 @@ H5Z__get_token(H5Z_token *current) FUNC_ENTER_PACKAGE /* check args */ - HDassert(current); + assert(current); /* Save the last position for possible ungets */ current->tok_last_type = current->tok_type; @@ -952,7 +952,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void *array, size_t array_size FUNC_ENTER_NOAPI(FAIL) - HDassert(data_xform_prop); + assert(data_xform_prop); tree = data_xform_prop->parse_root; @@ -1070,7 +1070,7 @@ H5Z__xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ FUNC_ENTER_PACKAGE /* check args */ - HDassert(tree); + assert(tree); HDmemset(&resl, 0, sizeof(H5Z_result)); HDmemset(&resr, 0, sizeof(H5Z_result)); @@ -1163,7 +1163,7 @@ H5Z__xform_find_type(const H5T_t *type) FUNC_ENTER_PACKAGE - HDassert(type); + assert(type); /* Check for SHORT type */ if ((tmp = (H5T_t *)H5I_object(H5T_NATIVE_SHORT)) && 0 == H5T_cmp(type, tmp, FALSE)) @@ -1234,7 +1234,7 @@ H5Z__xform_copy_tree(H5Z_node *tree, H5Z_datval_ptrs *dat_val_pointers, H5Z_datv FUNC_ENTER_PACKAGE - HDassert(tree); + assert(tree); if (tree->type == H5Z_XFORM_INTEGER) { if ((ret_value = (H5Z_node *)H5MM_malloc(sizeof(H5Z_node))) == NULL) @@ -1303,7 +1303,7 @@ H5Z__op_is_numbs(H5Z_node *_tree) FUNC_ENTER_PACKAGE_NOERR - HDassert(_tree); + assert(_tree); if (((_tree->lchild->type == H5Z_XFORM_INTEGER) || (_tree->lchild->type == H5Z_XFORM_FLOAT)) && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) @@ -1334,7 +1334,7 @@ H5Z__op_is_numbs2(H5Z_node *_tree) FUNC_ENTER_PACKAGE_NOERR - HDassert(_tree); + assert(_tree); if ((!_tree->lchild && ((_tree->rchild->type == H5Z_XFORM_INTEGER) || (_tree->rchild->type == H5Z_XFORM_FLOAT))) || @@ -1457,7 +1457,7 @@ H5Z_xform_create(const char *expr) FUNC_ENTER_NOAPI(NULL) - HDassert(expr); + assert(expr); /* Allocate space for the data transform information */ if (NULL == (data_xform_prop = (H5Z_data_xform_t *)H5MM_calloc(sizeof(H5Z_data_xform_t)))) @@ -1723,7 +1723,7 @@ H5Z_xform_extract_xform_str(const H5Z_data_xform_t *data_xform_prop) /* There should be no way that this can be NULL since the function * that calls this one checks to make sure it isn't before * passing them */ - HDassert(data_xform_prop); + assert(data_xform_prop); FUNC_LEAVE_NOAPI(data_xform_prop->xform_exp) } /* H5Z_xform_extract_xform_str() */ diff --git a/src/H5checksum.c b/src/H5checksum.c index cd3fb4c..8692579 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -106,8 +106,8 @@ H5_checksum_fletcher32(const void *_data, size_t _len) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(_data); - HDassert(_len > 0); + assert(_data); + assert(_len > 0); /* Compute checksum for pairs of bytes */ /* (the magic "360" value is the largest number of sums that can be @@ -231,8 +231,8 @@ H5_checksum_crc(const void *_data, size_t len) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(_data); - HDassert(len > 0); + assert(_data); + assert(len > 0); FUNC_LEAVE_NOAPI(H5__checksum_crc_update((uint32_t)0xffffffffL, (const uint8_t *)_data, len) ^ 0xffffffffL) @@ -384,8 +384,8 @@ H5_checksum_lookup3(const void *key, size_t length, uint32_t initval) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(key); - HDassert(length > 0); + assert(key); + assert(length > 0); /* Set up the internal state */ a = b = c = 0xdeadbeef + ((uint32_t)length) + initval; @@ -462,7 +462,7 @@ H5_checksum_lookup3(const void *key, size_t length, uint32_t initval) case 0: goto done; default: - HDassert(0 && "This Should never be executed!"); + assert(0 && "This Should never be executed!"); } H5_lookup3_final(a, b, c); @@ -491,8 +491,8 @@ H5_checksum_metadata(const void *data, size_t len, uint32_t initval) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(data); - HDassert(len > 0); + assert(data); + assert(len > 0); /* Choose the appropriate checksum routine */ /* (use Bob Jenkin's "lookup3" algorithm for all buffer sizes) */ @@ -523,7 +523,7 @@ H5_hash_string(const char *str) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(str); + assert(str); while ((c = *str++)) hash = ((hash << 5) + hash) + (uint32_t)c; /* hash * 33 + c */ diff --git a/src/H5dbg.c b/src/H5dbg.c index 08ebbb0..ddf33ad 100644 --- a/src/H5dbg.c +++ b/src/H5dbg.c @@ -78,11 +78,11 @@ H5_buffer_dump(FILE *stream, int indent, const uint8_t *buf, const uint8_t *mark /* * Check arguments. */ - HDassert(stream); - HDassert(indent >= 0); - HDassert(buf); - HDassert(marker); - HDassert(buf_size > 0); + assert(stream); + assert(indent >= 0); + assert(buf); + assert(marker); + assert(buf_size > 0); /* * Print the buffer in a VMS-style octal dump. diff --git a/src/H5encode.h b/src/H5encode.h index 3ec12b6..1dd7abe 100644 --- a/src/H5encode.h +++ b/src/H5encode.h @@ -263,7 +263,7 @@ UINT16ENCODE(p, l); \ break; \ default: \ - HDassert("bad sizeof size" && 0); \ + assert("bad sizeof size" && 0); \ } \ } while (0) @@ -280,7 +280,7 @@ UINT16DECODE(p, l); \ break; \ default: \ - HDassert("bad sizeof size" && 0); \ + assert("bad sizeof size" && 0); \ } \ } while (0) diff --git a/src/H5mpi.c b/src/H5mpi.c index 31ad036..294fd11 100644 --- a/src/H5mpi.c +++ b/src/H5mpi.c @@ -639,9 +639,9 @@ H5_mpio_gatherv_alloc(void *send_buf, int send_count, MPI_Datatype send_type, co FUNC_ENTER_NOAPI(FAIL) - HDassert(send_buf || send_count == 0); + assert(send_buf || send_count == 0); if (allgather || (mpi_rank == root)) - HDassert(out_buf && out_buf_num_entries); + assert(out_buf && out_buf_num_entries); /* Retrieve the extent of the MPI Datatype being used */ #if H5_CHECK_MPI_VERSION(3, 0) @@ -725,9 +725,9 @@ H5_mpio_gatherv_alloc_simple(void *send_buf, int send_count, MPI_Datatype send_t FUNC_ENTER_NOAPI(FAIL) - HDassert(send_buf || send_count == 0); + assert(send_buf || send_count == 0); if (allgather || (mpi_rank == root)) - HDassert(out_buf && out_buf_num_entries); + assert(out_buf && out_buf_num_entries); /* * Allocate array to store the receive counts of each rank, as well as @@ -808,7 +808,7 @@ H5_mpio_get_file_sync_required(MPI_File fh, hbool_t *file_sync_required) FUNC_ENTER_NOAPI(FAIL) - HDassert(file_sync_required); + assert(file_sync_required); *file_sync_required = FALSE; diff --git a/src/H5private.h b/src/H5private.h index 82ed044..d8c8aee 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -623,9 +623,6 @@ typedef off_t h5_stat_size_t; #ifndef HDasprintf #define HDasprintf asprintf /*varargs*/ #endif -#ifndef HDassert -#define HDassert(X) assert(X) -#endif #ifndef HDatexit #define HDatexit(F) atexit(F) #endif @@ -1233,7 +1230,7 @@ H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap); #define H5_CHECK_OVERFLOW(var, vartype, casttype) \ { \ casttype _tmp_overflow = (casttype)(var); \ - HDassert((var) == (vartype)_tmp_overflow); \ + assert((var) == (vartype)_tmp_overflow); \ } #else /* NDEBUG */ #define H5_CHECK_OVERFLOW(var, vartype, casttype) @@ -1247,7 +1244,7 @@ H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap); { \ srctype _tmp_src = (srctype)(src); \ dsttype _tmp_dst = (dsttype)(_tmp_src); \ - HDassert(_tmp_src == (srctype)_tmp_dst); \ + assert(_tmp_src == (srctype)_tmp_dst); \ (dst) = _tmp_dst; \ } @@ -1257,8 +1254,8 @@ H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap); { \ srctype _tmp_src = (srctype)(src); \ dsttype _tmp_dst = (dsttype)(_tmp_src); \ - HDassert(_tmp_src >= 0); \ - HDassert(_tmp_src == (srctype)_tmp_dst); \ + assert(_tmp_src >= 0); \ + assert(_tmp_src == (srctype)_tmp_dst); \ (dst) = _tmp_dst; \ } @@ -1268,8 +1265,8 @@ H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap); { \ srctype _tmp_src = (srctype)(src); \ dsttype _tmp_dst = (dsttype)(_tmp_src); \ - HDassert(_tmp_dst >= 0); \ - HDassert(_tmp_src == (srctype)_tmp_dst); \ + assert(_tmp_dst >= 0); \ + assert(_tmp_src == (srctype)_tmp_dst); \ (dst) = _tmp_dst; \ } @@ -1277,8 +1274,8 @@ H5_DLL int HDvasprintf(char **bufp, const char *fmt, va_list _ap); { \ srctype _tmp_src = (srctype)(src); \ dsttype _tmp_dst = (dsttype)(_tmp_src); \ - HDassert(_tmp_src >= 0); \ - HDassert(_tmp_src == (srctype)_tmp_dst); \ + assert(_tmp_src >= 0); \ + assert(_tmp_src == (srctype)_tmp_dst); \ (dst) = _tmp_dst; \ } @@ -1670,9 +1667,9 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); \ if (!func_check) { \ /* Check function naming status */ \ - HDassert(asrt && \ - "Function naming conventions are incorrect - check H5_IS_API|PUB|PRIV|PKG macros in " \ - "H5private.h (this is usually due to an incorrect number of underscores)"); \ + assert(asrt && \ + "Function naming conventions are incorrect - check H5_IS_API|PUB|PRIV|PKG macros in " \ + "H5private.h (this is usually due to an incorrect number of underscores)"); \ \ /* Don't check again */ \ func_check = TRUE; \ diff --git a/src/H5system.c b/src/H5system.c index 25d381b..e9cfd79 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -227,7 +227,7 @@ H5_make_time(struct tm *tm) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(tm); + assert(tm); /* Initialize timezone information */ if (!H5_ntzset) { @@ -398,7 +398,7 @@ H5_get_win32_times(H5_timevals_t *tvs /*in,out*/) static hbool_t is_initialized = FALSE; BOOL err; - HDassert(tvs); + assert(tvs); if (!is_initialized) { /* NOTE: This is just a pseudo handle and does not need to be closed. */ @@ -650,8 +650,8 @@ H5_build_extpath(const char *name, char **extpath /*out*/) FUNC_ENTER_NOAPI_NOINIT /* Sanity check */ - HDassert(name); - HDassert(extpath); + assert(name); + assert(extpath); /* Clear external path pointer to begin with */ *extpath = NULL; @@ -705,10 +705,10 @@ H5_build_extpath(const char *name, char **extpath /*out*/) size_t cwdlen; size_t path_len; - HDassert(cwdpath); + assert(cwdpath); cwdlen = HDstrlen(cwdpath); - HDassert(cwdlen); - HDassert(new_name); + assert(cwdlen); + assert(new_name); path_len = cwdlen + HDstrlen(new_name) + 2; if (NULL == (full_path = (char *)H5MM_malloc(path_len))) HGOTO_ERROR(H5E_INTERNAL, H5E_NOSPACE, FAIL, "memory allocation failed") @@ -725,7 +725,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) char *ptr = NULL; H5_GET_LAST_DELIMITER(full_path, ptr) - HDassert(ptr); + assert(ptr); *++ptr = '\0'; *extpath = full_path; } /* end if */ @@ -762,7 +762,7 @@ H5_combine_path(const char *path1, const char *path2, char **full_name /*out*/) FUNC_ENTER_NOAPI_NOINIT - HDassert(path2); + assert(path2); if (path1) path1_len = HDstrlen(path1); @@ -1084,7 +1084,7 @@ H5_dirname(const char *path, char **dirname) else { /* Pathname of form "dir/filename" */ len = sep - path; - HDassert(len >= 0); + assert(len >= 0); out = H5MM_strndup(path, (size_t)len); } @@ -1186,7 +1186,7 @@ H5_basename(const char *path, char **basename) c_ptr--; len = sep - c_ptr; - HDassert(len >= 0); + assert(len >= 0); out = H5MM_strndup(c_ptr, (size_t)len); } @@ -1388,8 +1388,8 @@ char * H5_strcasestr(const char *haystack, const char *needle) { /* Check arguments. */ - HDassert(haystack); - HDassert(needle); + assert(haystack); + assert(needle); /* begin once from each character of haystack, until needle is found */ do { diff --git a/src/H5timer.c b/src/H5timer.c index 7065814..7690c57 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -275,7 +275,7 @@ static herr_t H5__timer_get_timevals(H5_timevals_t *times /*in,out*/) { /* Sanity check */ - HDassert(times); + assert(times); /* Windows call handles both system/user and elapsed times */ #ifdef H5_HAVE_WIN32_API @@ -375,7 +375,7 @@ herr_t H5_timer_init(H5_timer_t *timer /*in,out*/) { /* Sanity check */ - HDassert(timer); + assert(timer); /* Initialize everything */ HDmemset(timer, 0, sizeof(H5_timer_t)); @@ -400,7 +400,7 @@ herr_t H5_timer_start(H5_timer_t *timer /*in,out*/) { /* Sanity check */ - HDassert(timer); + assert(timer); /* Start the timer * This sets the "initial" times to the system-defined start times. @@ -430,7 +430,7 @@ herr_t H5_timer_stop(H5_timer_t *timer /*in,out*/) { /* Sanity check */ - HDassert(timer); + assert(timer); /* Stop the timer */ if (H5__timer_get_timevals(&(timer->final_interval)) < 0) @@ -481,7 +481,7 @@ herr_t H5_timer_get_times(H5_timer_t timer, H5_timevals_t *times /*in,out*/) { /* Sanity check */ - HDassert(times); + assert(times); if (timer.is_running) { H5_timevals_t now; @@ -536,7 +536,7 @@ herr_t H5_timer_get_total_times(H5_timer_t timer, H5_timevals_t *times /*in,out*/) { /* Sanity check */ - HDassert(times); + assert(times); if (timer.is_running) { H5_timevals_t now; diff --git a/src/H5trace.c b/src/H5trace.c index 7b3d354..6608a52 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -259,13 +259,13 @@ H5_trace_args(H5RS_str_t *rs, const char *type, va_list ap) if ('a' == type[1]) { asize_idx = (int)HDstrtol(type + 2, &rest, 10); - HDassert(0 <= asize_idx && asize_idx < (int)NELMTS(asize)); - HDassert(']' == *rest); + assert(0 <= asize_idx && asize_idx < (int)NELMTS(asize)); + assert(']' == *rest); type = rest + 1; } else { rest = (char *)HDstrchr(type, ']'); - HDassert(rest); + assert(rest); type = rest + 1; asize_idx = -1; } @@ -4033,7 +4033,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) * since the one for the function call, then we're continuing * the same line. */ if (returning) { - HDassert(current_depth > 0); + assert(current_depth > 0); --current_depth; if (current_depth < last_call_depth) { /* We are at the beginning of a line */ diff --git a/test/API/tattr.c b/test/API/tattr.c index 4e905b0..476e32b 100644 --- a/test/API/tattr.c +++ b/test/API/tattr.c @@ -4717,7 +4717,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -4801,7 +4801,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -4924,7 +4924,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -5036,7 +5036,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -5269,7 +5269,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -5324,7 +5324,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create several attributes, but keep storage in compact form */ @@ -5488,7 +5488,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -5707,7 +5707,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -6046,7 +6046,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -6575,7 +6575,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -6647,7 +6647,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Delete attributes from compact storage */ @@ -6707,7 +6707,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ @@ -6780,7 +6780,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Delete attributes from dense storage */ @@ -6850,7 +6850,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create attributes, to push into dense form */ @@ -6897,7 +6897,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Delete every other attribute from dense storage, in appropriate order */ @@ -6950,7 +6950,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Delete remaining attributes from dense storage, in appropriate order */ @@ -7252,7 +7252,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_attrs; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -7283,7 +7283,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_attrs; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -7314,7 +7314,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_attrs; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -7347,7 +7347,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_attrs; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -7589,7 +7589,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -7694,7 +7694,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ @@ -7996,7 +7996,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -8074,7 +8074,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ @@ -8338,7 +8338,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -8444,7 +8444,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ @@ -8635,7 +8635,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ #if 0 /* Check on dataset's attribute storage status */ @@ -8698,7 +8698,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ diff --git a/test/API/testhdf5.c b/test/API/testhdf5.c index d015933..58cbfdf 100644 --- a/test/API/testhdf5.c +++ b/test/API/testhdf5.c @@ -117,7 +117,7 @@ getenv_all(MPI_Comm comm, int root, const char *name) int len; static char *env = NULL; - HDassert(name); + assert(name); MPI_Initialized(&mpi_initialized); MPI_Finalized(&mpi_finalized); @@ -125,7 +125,7 @@ getenv_all(MPI_Comm comm, int root, const char *name) if (mpi_initialized && !mpi_finalized) { MPI_Comm_rank(comm, &mpi_rank); MPI_Comm_size(comm, &mpi_size); - HDassert(root < mpi_size); + assert(root < mpi_size); /* The root task does the getenv call * and sends the result to the other tasks */ @@ -515,7 +515,7 @@ h5_using_default_driver(const char *drv_name) { hbool_t ret_val = TRUE; - HDassert(H5_DEFAULT_VFD == H5FD_SEC2); + assert(H5_DEFAULT_VFD == H5FD_SEC2); if (!drv_name) drv_name = HDgetenv(HDF5_DRIVER); @@ -533,8 +533,8 @@ h5_driver_is_default_vfd_compatible(hid_t fapl_id, hbool_t *default_vfd_compatib hid_t driver_id = H5I_INVALID_HID; herr_t ret_value = SUCCEED; - HDassert(fapl_id >= 0); - HDassert(default_vfd_compatible); + assert(fapl_id >= 0); + assert(default_vfd_compatible); if (fapl_id == H5P_DEFAULT) fapl_id = H5P_FILE_ACCESS_DEFAULT; diff --git a/test/API/tfile.c b/test/API/tfile.c index c0b2921..12c57e6 100644 --- a/test/API/tfile.c +++ b/test/API/tfile.c @@ -4486,7 +4486,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t split) hbool_t relax; H5FD_mem_t mt; - HDassert(split); + assert(split); HDmemset(memb_name, 0, sizeof memb_name); diff --git a/test/API/th5s.c b/test/API/th5s.c index f09cfeb..d27e57c 100644 --- a/test/API/th5s.c +++ b/test/API/th5s.c @@ -1790,7 +1790,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) break; default: - HDassert(0); + assert(0); break; } /* end switch */ @@ -1815,7 +1815,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8); break; default: - HDassert(0); + assert(0); break; } /* end switch */ @@ -1840,7 +1840,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) expected_enc_size = 8; break; default: - HDassert(0); + assert(0); break; } @@ -1865,7 +1865,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) expected_enc_size = 8; break; default: - HDassert(0); + assert(0); break; } /* end switch */ @@ -1890,7 +1890,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) expected_enc_size = 8; break; default: - HDassert(0); + assert(0); break; } @@ -1984,7 +1984,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) break; default: - HDassert(0); + assert(0); break; } @@ -2013,7 +2013,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) break; default: - HDassert(0); + assert(0); break; } @@ -2026,7 +2026,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) VERIFY(is_regular, FALSE, "H5Sis_regular_hyperslab"); /* Verify the version and encoded size expected for the configuration */ - HDassert(expected_enc_size <= 255); + assert(expected_enc_size <= 255); ret = test_h5s_check_encoding(fapl, sid, expected_version, (uint8_t)expected_enc_size, expected_to_fail); CHECK(ret, FAIL, "test_h5s_check_encoding"); diff --git a/test/API/tselect.c b/test/API/tselect.c index 292bf84..619df42 100644 --- a/test/API/tselect.c +++ b/test/API/tselect.c @@ -1886,8 +1886,8 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, size_t cube_si size_t s; /* Local index variable */ hbool_t mis_match; /* Flag to indicate mismatch in expected value */ - HDassert(cube_buf); - HDassert(cube_size > 0); + assert(cube_buf); + assert(cube_size > 0); expected_value = 0; mis_match = FALSE; @@ -1904,7 +1904,7 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, size_t cube_si m = 0; do { /* Sanity check */ - HDassert(s < cube_size); + assert(s < cube_size); /* Check for correct value */ if (*cube_ptr != expected_value) @@ -1980,12 +1980,12 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co MESSAGE(7, ("\tranks = %u/%u, edge_size = %u, chunk_edge_size = %u.\n", small_rank, large_rank, edge_size, chunk_edge_size)); - HDassert(edge_size >= 6); - HDassert(edge_size >= chunk_edge_size); - HDassert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); - HDassert(small_rank > 0); - HDassert(small_rank < large_rank); - HDassert(large_rank <= SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(edge_size >= chunk_edge_size); + assert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); + assert(small_rank > 0); + assert(small_rank < large_rank); + assert(large_rank <= SS_DR_MAX_RANK); /* Compute cube sizes */ small_cube_size = large_cube_size = (size_t)1; @@ -1996,7 +1996,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co large_cube_size *= (size_t)edge_size; } /* end for */ - HDassert(large_cube_size < (size_t)UINT_MAX); + assert(large_cube_size < (size_t)UINT_MAX); /* set up the start, stride, count, and block pointers */ start_ptr = &(start[SS_DR_MAX_RANK - large_rank]); @@ -2242,8 +2242,8 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co (x * edge_size); stop_index = start_index + small_cube_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= large_cube_size); + assert(start_index < stop_index); + assert(stop_index <= large_cube_size); mis_match = FALSE; ptr_1 = large_cube_buf_1; @@ -2436,8 +2436,8 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co (x * edge_size); stop_index = start_index + small_cube_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= large_cube_size); + assert(start_index < stop_index); + assert(stop_index <= large_cube_size); mis_match = FALSE; ptr_1 = large_cube_buf_1; @@ -2603,16 +2603,16 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, u unsigned u; /* Local index variables */ herr_t ret; /* Generic return value */ - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(0 < sel_rank); - HDassert(sel_rank <= tgt_n_cube_rank); - HDassert(tgt_n_cube_rank <= SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(0 < sel_rank); + assert(sel_rank <= tgt_n_cube_rank); + assert(tgt_n_cube_rank <= SS_DR_MAX_RANK); sel_offset = SS_DR_MAX_RANK - sel_rank; n_cube_offset = SS_DR_MAX_RANK - tgt_n_cube_rank; - HDassert(n_cube_offset <= sel_offset); + assert(n_cube_offset <= sel_offset); /* First, compute the base count (which assumes start == 0 * for the associated offset) and offset_count (which @@ -2827,13 +2827,13 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t *buf_ptr, unsigned rank unsigned v, w, x, y, z; /* to track position in checker */ const unsigned test_max_rank = 5; /* code changes needed if this is increased */ - HDassert(buf_ptr != NULL); - HDassert(0 < rank); - HDassert(rank <= test_max_rank); - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(test_max_rank <= SS_DR_MAX_RANK); + assert(buf_ptr != NULL); + assert(0 < rank); + assert(rank <= test_max_rank); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(test_max_rank <= SS_DR_MAX_RANK); val_ptr = buf_ptr; expected_value = first_expected_val; @@ -2966,15 +2966,15 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ MESSAGE(7, ("\tranks = %d/%d, edge_size = %d, checker_edge_size = %d, chunk_edge_size = %d.\n", small_rank, large_rank, edge_size, checker_edge_size, chunk_edge_size)); - HDassert(edge_size >= 6); - HDassert(checker_edge_size > 0); - HDassert(checker_edge_size <= edge_size); - HDassert(edge_size >= chunk_edge_size); - HDassert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); - HDassert(small_rank > 0); - HDassert(small_rank < large_rank); - HDassert(large_rank <= test_max_rank); - HDassert(test_max_rank <= SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(checker_edge_size > 0); + assert(checker_edge_size <= edge_size); + assert(edge_size >= chunk_edge_size); + assert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); + assert(small_rank > 0); + assert(small_rank < large_rank); + assert(large_rank <= test_max_rank); + assert(test_max_rank <= SS_DR_MAX_RANK); /* Compute cube sizes */ small_cube_size = large_cube_size = (size_t)1; @@ -2984,16 +2984,16 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ large_cube_size *= (size_t)edge_size; } /* end for */ - HDassert(large_cube_size < (size_t)(UINT_MAX)); + assert(large_cube_size < (size_t)(UINT_MAX)); small_rank_offset = test_max_rank - small_rank; - HDassert(small_rank_offset >= 1); + assert(small_rank_offset >= 1); /* also, at present, we use 16 bit values in this test -- * hence the following assertion. Delete it if we convert * to 32 bit values. */ - HDassert(large_cube_size < (size_t)(64 * 1024)); + assert(large_cube_size < (size_t)(64 * 1024)); /* Allocate & initialize buffers */ small_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), small_cube_size); @@ -3160,11 +3160,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * need for another inner loop. */ - HDassert((sel_start[0] == 0) || (0 < small_rank_offset)); - HDassert((sel_start[1] == 0) || (1 < small_rank_offset)); - HDassert((sel_start[2] == 0) || (2 < small_rank_offset)); - HDassert((sel_start[3] == 0) || (3 < small_rank_offset)); - HDassert((sel_start[4] == 0) || (4 < small_rank_offset)); + assert((sel_start[0] == 0) || (0 < small_rank_offset)); + assert((sel_start[1] == 0) || (1 < small_rank_offset)); + assert((sel_start[2] == 0) || (2 < small_rank_offset)); + assert((sel_start[3] == 0) || (3 < small_rank_offset)); + assert((sel_start[4] == 0) || (4 < small_rank_offset)); test_select_hyper_checker_board_dr__select_checker_board( file_large_cube_sid, large_rank, edge_size, checker_edge_size, small_rank, sel_start); @@ -3240,11 +3240,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * need for another inner loop. */ - HDassert((sel_start[0] == 0) || (0 < small_rank_offset)); - HDassert((sel_start[1] == 0) || (1 < small_rank_offset)); - HDassert((sel_start[2] == 0) || (2 < small_rank_offset)); - HDassert((sel_start[3] == 0) || (3 < small_rank_offset)); - HDassert((sel_start[4] == 0) || (4 < small_rank_offset)); + assert((sel_start[0] == 0) || (0 < small_rank_offset)); + assert((sel_start[1] == 0) || (1 < small_rank_offset)); + assert((sel_start[2] == 0) || (2 < small_rank_offset)); + assert((sel_start[3] == 0) || (3 < small_rank_offset)); + assert((sel_start[4] == 0) || (4 < small_rank_offset)); test_select_hyper_checker_board_dr__select_checker_board( mem_large_cube_sid, large_rank, edge_size, checker_edge_size, small_rank, sel_start); @@ -3274,8 +3274,8 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ (x * edge_size); stop_index = start_index + small_cube_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= large_cube_size); + assert(start_index < stop_index); + assert(stop_index <= large_cube_size); /* verify that the large cube contains only zeros before the slice */ for (s = 0; s < start_index; s++) { @@ -3283,7 +3283,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ data_ok = FALSE; ptr_1++; } /* end for */ - HDassert(s == start_index); + assert(s == start_index); data_ok &= test_select_hyper_checker_board_dr__verify_data( ptr_1, small_rank, edge_size, checker_edge_size, (uint16_t)0, (hbool_t)TRUE); @@ -3291,7 +3291,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ ptr_1 += small_cube_size; s += small_cube_size; - HDassert(s == stop_index + 1); + assert(s == stop_index + 1); /* verify that the large cube contains only zeros after the slice */ for (s = stop_index + 1; s < large_cube_size; s++) { @@ -3360,11 +3360,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * need for another inner loop. */ - HDassert((sel_start[0] == 0) || (0 < small_rank_offset)); - HDassert((sel_start[1] == 0) || (1 < small_rank_offset)); - HDassert((sel_start[2] == 0) || (2 < small_rank_offset)); - HDassert((sel_start[3] == 0) || (3 < small_rank_offset)); - HDassert((sel_start[4] == 0) || (4 < small_rank_offset)); + assert((sel_start[0] == 0) || (0 < small_rank_offset)); + assert((sel_start[1] == 0) || (1 < small_rank_offset)); + assert((sel_start[2] == 0) || (2 < small_rank_offset)); + assert((sel_start[3] == 0) || (3 < small_rank_offset)); + assert((sel_start[4] == 0) || (4 < small_rank_offset)); test_select_hyper_checker_board_dr__select_checker_board( mem_large_cube_sid, large_rank, edge_size, checker_edge_size, small_rank, sel_start); @@ -3455,11 +3455,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * need for another inner loop. */ - HDassert((sel_start[0] == 0) || (0 < small_rank_offset)); - HDassert((sel_start[1] == 0) || (1 < small_rank_offset)); - HDassert((sel_start[2] == 0) || (2 < small_rank_offset)); - HDassert((sel_start[3] == 0) || (3 < small_rank_offset)); - HDassert((sel_start[4] == 0) || (4 < small_rank_offset)); + assert((sel_start[0] == 0) || (0 < small_rank_offset)); + assert((sel_start[1] == 0) || (1 < small_rank_offset)); + assert((sel_start[2] == 0) || (2 < small_rank_offset)); + assert((sel_start[3] == 0) || (3 < small_rank_offset)); + assert((sel_start[4] == 0) || (4 < small_rank_offset)); test_select_hyper_checker_board_dr__select_checker_board( file_large_cube_sid, large_rank, edge_size, checker_edge_size, small_rank, sel_start); @@ -3498,8 +3498,8 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ (x * edge_size); stop_index = start_index + small_cube_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= large_cube_size); + assert(start_index < stop_index); + assert(stop_index <= large_cube_size); /* verify that the large cube contains only zeros before the slice */ for (s = 0; s < start_index; s++) { @@ -3507,7 +3507,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ data_ok = FALSE; ptr_1++; } /* end for */ - HDassert(s == start_index); + assert(s == start_index); /* verify that the slice contains the expected data */ data_ok &= test_select_hyper_checker_board_dr__verify_data( @@ -3516,7 +3516,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ ptr_1 += small_cube_size; s += small_cube_size; - HDassert(s == stop_index + 1); + assert(s == stop_index + 1); /* verify that the large cube contains only zeros after the slice */ for (s = stop_index + 1; s < large_cube_size; s++) { @@ -5569,7 +5569,7 @@ test_select_hyper_valid_combination(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Selection Combination Validity\n")); - HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); + assert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for single point selection */ single_pt_sid = H5Screate_simple(SPACE9_RANK, dims2D, NULL); @@ -8459,7 +8459,7 @@ test_shape_same(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Same Shape Comparisons\n")); - HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); + assert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for "all" selection */ all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); @@ -10912,13 +10912,13 @@ test_shape_same_dr__full_space_vs_slice(int test_num, int small_rank, int large_ htri_t check; /* Shape comparison return value */ herr_t ret; /* Generic return value */ - HDassert(0 < small_rank); - HDassert(small_rank <= large_rank); - HDassert(large_rank <= SS_DR_MAX_RANK); - HDassert(0 <= offset); - HDassert(offset < large_rank); - HDassert(edge_size > 0); - HDassert(edge_size <= 1000); + assert(0 < small_rank); + assert(small_rank <= large_rank); + assert(large_rank <= SS_DR_MAX_RANK); + assert(0 <= offset); + assert(offset < large_rank); + assert(edge_size > 0); + assert(edge_size <= 1000); HDsnprintf(test_desc_0, sizeof(test_desc_0), "\tn-cube slice through m-cube (n <= m) test %d.\n", test_num); @@ -10970,7 +10970,7 @@ test_shape_same_dr__full_space_vs_slice(int test_num, int small_rank, int large_ */ i = SS_DR_MAX_RANK - large_rank; - HDassert(i >= 0); + assert(i >= 0); start_ptr = &(start[i]); stride_ptr = &(stride[i]); @@ -11164,21 +11164,21 @@ test_shape_same_dr__checkerboard(int test_num, int small_rank, int large_rank, i htri_t check; /* Shape comparison return value */ herr_t ret; /* Generic return value */ - HDassert(0 < small_rank); - HDassert(small_rank <= large_rank); - HDassert(large_rank <= SS_DR_MAX_RANK); - HDassert(0 < checker_size); - HDassert(checker_size <= edge_size); - HDassert(edge_size <= 1000); - HDassert(0 <= offset); - HDassert(offset < (int)edge_size); + assert(0 < small_rank); + assert(small_rank <= large_rank); + assert(large_rank <= SS_DR_MAX_RANK); + assert(0 < checker_size); + assert(checker_size <= edge_size); + assert(edge_size <= 1000); + assert(0 <= offset); + assert(offset < (int)edge_size); for (i = SS_DR_MAX_RANK - large_rank; i < SS_DR_MAX_RANK; i++) if (dim_selected[i] == TRUE) dims_selected++; - HDassert(dims_selected >= 0); - HDassert(dims_selected <= large_rank); + assert(dims_selected >= 0); + assert(dims_selected <= large_rank); HDsnprintf(test_desc_0, sizeof(test_desc_0), "\tcheckerboard n-cube slice through m-cube (n <= m) test %d.\n", test_num); @@ -11367,7 +11367,7 @@ test_shape_same_dr__checkerboard(int test_num, int small_rank, int large_rank, i */ i = SS_DR_MAX_RANK - large_rank; - HDassert(i >= 0); + assert(i >= 0); start_ptr = &(start[i]); stride_ptr = &(stride[i]); @@ -11708,22 +11708,22 @@ test_shape_same_dr__irregular(int test_num, int small_rank, int large_rank, int htri_t check; /* Shape comparison return value */ herr_t ret; /* Generic return value */ - HDassert(0 < small_rank); - HDassert(small_rank <= large_rank); - HDassert(large_rank <= SS_DR_MAX_RANK); - HDassert(9 <= edge_size); - HDassert(edge_size <= 1000); - HDassert(0 <= slice_offset); - HDassert(slice_offset < edge_size); - HDassert(-2 <= pattern_offset); - HDassert(pattern_offset <= 2); + assert(0 < small_rank); + assert(small_rank <= large_rank); + assert(large_rank <= SS_DR_MAX_RANK); + assert(9 <= edge_size); + assert(edge_size <= 1000); + assert(0 <= slice_offset); + assert(slice_offset < edge_size); + assert(-2 <= pattern_offset); + assert(pattern_offset <= 2); for (i = SS_DR_MAX_RANK - large_rank; i < SS_DR_MAX_RANK; i++) if (dim_selected[i] == TRUE) dims_selected++; - HDassert(dims_selected >= 0); - HDassert(dims_selected <= large_rank); + assert(dims_selected >= 0); + assert(dims_selected <= large_rank); HDsnprintf(test_desc_0, sizeof(test_desc_0), "\tirregular sub set of n-cube slice through m-cube (n <= m) test %d.\n", test_num); @@ -11821,7 +11821,7 @@ test_shape_same_dr__irregular(int test_num, int small_rank, int large_rank, int */ i = SS_DR_MAX_RANK - large_rank; - HDassert(i >= 0); + assert(i >= 0); start_ptr = &(start[i]); stride_ptr = &(stride[i]); @@ -14327,7 +14327,7 @@ test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t endpoints, hssize_t en hsize_t blocklist[12]; herr_t ret; - HDassert(enblocks <= 2); + assert(enblocks <= 2); /* Copy sid to lim_sid */ lim_sid = H5Scopy(sid); @@ -14365,7 +14365,7 @@ test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t endpoints, hssize_t en ERROR("H5Sget_select_hyper_blocklist"); } /* end if */ else { - HDassert(nblocks == (hssize_t)2); + assert(nblocks == (hssize_t)2); if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0) { if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); @@ -14795,7 +14795,7 @@ test_internal_consistency(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Consistency of Internal States\n")); - HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); + assert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for "all" selection */ all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); @@ -15362,7 +15362,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ @@ -15410,7 +15410,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ @@ -15481,7 +15481,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ @@ -15529,7 +15529,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ @@ -15567,7 +15567,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ diff --git a/test/API/tunicode.c b/test/API/tunicode.c index fa59456..04d0d8b 100644 --- a/test/API/tunicode.c +++ b/test/API/tunicode.c @@ -152,7 +152,7 @@ test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string) /* Create a src_type that holds the UTF-8 string and its final NULL */ big_len = length + 1; /* +1 byte for final NULL */ - HDassert((2 * big_len) <= sizeof(cmpbuf)); + assert((2 * big_len) <= sizeof(cmpbuf)); src_type = mkstr(big_len, H5T_STR_NULLTERM); CHECK(src_type, FAIL, "mkstr"); /* Create a dst_type that holds half of the UTF-8 string and a final @@ -215,7 +215,7 @@ test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string) /* Create a src_type that holds the UTF-8 string */ big_len = length; - HDassert((2 * big_len) <= sizeof(cmpbuf)); + assert((2 * big_len) <= sizeof(cmpbuf)); src_type = mkstr(big_len, H5T_STR_NULLPAD); CHECK(src_type, FAIL, "mkstr"); /* Create a dst_type that holds half of the UTF-8 string */ diff --git a/test/API/tvltypes.c b/test/API/tvltypes.c index eca534b..a17589b 100644 --- a/test/API/tvltypes.c +++ b/test/API/tvltypes.c @@ -2693,13 +2693,13 @@ test_vltypes_fill_value(void) } break; case H5D_VIRTUAL: - HDassert(0 && "Invalid layout type!"); + assert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert(0 && "Unknown layout type!"); + assert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -2801,13 +2801,13 @@ test_vltypes_fill_value(void) break; case H5D_VIRTUAL: - HDassert(0 && "Invalid layout type!"); + assert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert(0 && "Unknown layout type!"); + assert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -2988,13 +2988,13 @@ test_vltypes_fill_value(void) break; case H5D_VIRTUAL: - HDassert(0 && "Invalid layout type!"); + assert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert(0 && "Unknown layout type!"); + assert(0 && "Unknown layout type!"); break; } /* end switch */ diff --git a/test/accum.c b/test/accum.c index 80a8353..ebd7a90 100644 --- a/test/accum.c +++ b/test/accum.c @@ -193,9 +193,9 @@ test_write_read(H5F_t *f) /* Allocate buffers */ write_buf = (int *)HDmalloc(1024 * sizeof(int)); - HDassert(write_buf); + assert(write_buf); read_buf = (int *)HDcalloc((size_t)1024, sizeof(int)); - HDassert(read_buf); + assert(read_buf); /* Fill buffer with data, zero out read buffer */ for (i = 0; i < 1024; i++) @@ -252,9 +252,9 @@ test_write_read_nonacc_front(H5F_t *f) /* Allocate buffers */ write_buf = (int *)HDmalloc(2048 * sizeof(int)); - HDassert(write_buf); + assert(write_buf); read_buf = (int *)HDcalloc((size_t)2048, sizeof(int)); - HDassert(read_buf); + assert(read_buf); /* Fill buffer with data, zero out read buffer */ for (i = 0; i < 2048; i++) @@ -317,9 +317,9 @@ test_write_read_nonacc_end(H5F_t *f) /* Allocate buffers */ write_buf = (int *)HDmalloc(2048 * sizeof(int)); - HDassert(write_buf); + assert(write_buf); read_buf = (int *)HDcalloc((size_t)2048, sizeof(int)); - HDassert(read_buf); + assert(read_buf); /* Fill buffer with data, zero out read buffer */ for (i = 0; i < 2048; i++) @@ -384,11 +384,11 @@ test_free(H5F_t *f) /* Write and free the whole accumulator. */ wbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t)); - HDassert(wbuf); + assert(wbuf); rbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t)); - HDassert(rbuf); + assert(rbuf); expect = (int32_t *)HDmalloc(256 * sizeof(int32_t)); - HDassert(expect); + assert(expect); /* Fill buffer with data */ for (i = 0; i < 256; i++) @@ -615,9 +615,9 @@ test_accum_overlap(H5F_t *f) /* Allocate buffers */ wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t)); - HDassert(wbuf); + assert(wbuf); rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t)); - HDassert(rbuf); + assert(rbuf); /* Case 1: No metadata in accumulator */ /* Write 10 1's at address 40 */ @@ -822,9 +822,9 @@ test_accum_overlap_clean(H5F_t *f) /* Allocate buffers */ wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t)); - HDassert(wbuf); + assert(wbuf); rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t)); - HDassert(rbuf); + assert(rbuf); /* Case 1: No metadata in accumulator */ /* Write 10 1's at address 40 */ @@ -1041,9 +1041,9 @@ test_accum_non_overlap_size(H5F_t *f) /* Allocate buffers */ wbuf = (int *)HDmalloc(4096 * sizeof(int32_t)); - HDassert(wbuf); + assert(wbuf); rbuf = (int *)HDcalloc((size_t)4096, sizeof(int32_t)); - HDassert(rbuf); + assert(rbuf); /* Case 1: No metadata in accumulator */ /* Write 10 1's at address 140 */ @@ -1115,9 +1115,9 @@ test_accum_overlap_size(H5F_t *f) /* Allocate buffers */ wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t)); - HDassert(wbuf); + assert(wbuf); rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t)); - HDassert(rbuf); + assert(rbuf); /* Case 1: No metadata in accumulator */ /* Write 10 1's at address 64 */ @@ -1200,9 +1200,9 @@ test_accum_adjust(H5F_t *f) /* Allocate buffers */ wbuf = (int32_t *)HDmalloc((size_t)s * sizeof(int32_t)); - HDassert(wbuf); + assert(wbuf); rbuf = (int32_t *)HDcalloc((size_t)s, sizeof(int32_t)); - HDassert(rbuf); + assert(rbuf); /* Fill up write buffer */ for (i = 0; i < s; i++) @@ -1498,9 +1498,9 @@ test_read_after(H5F_t *f) /* Allocate buffers */ wbuf = (int32_t *)HDmalloc((size_t)s * sizeof(int32_t)); - HDassert(wbuf); + assert(wbuf); rbuf = (int32_t *)HDcalloc((size_t)s, sizeof(int32_t)); - HDassert(rbuf); + assert(rbuf); /* Fill up write buffer with 1s */ for (i = 0; i < s; i++) @@ -1580,13 +1580,13 @@ test_big(H5F_t *f) /* Allocate space for the write & read buffers */ wbuf = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE); - HDassert(wbuf); + assert(wbuf); wbuf2 = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE); - HDassert(wbuf2); + assert(wbuf2); rbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1); - HDassert(rbuf); + assert(rbuf); zbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1); - HDassert(zbuf); + assert(zbuf); /* Initialize write buffers */ for (u = 0; u < BIG_BUF_SIZE; u++) { @@ -1951,9 +1951,9 @@ test_random_write(H5F_t *f) /* Allocate space for the write & read buffers */ wbuf = (uint8_t *)HDmalloc((size_t)RANDOM_BUF_SIZE); - HDassert(wbuf); + assert(wbuf); rbuf = (uint8_t *)HDcalloc((size_t)RANDOM_BUF_SIZE, (size_t)1); - HDassert(rbuf); + assert(rbuf); /* Initialize write buffer */ for (u = 0; u < RANDOM_BUF_SIZE; u++) @@ -1971,9 +1971,9 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed); /* Allocate space for the segment length buffer */ off = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); - HDassert(off); + assert(off); len = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); - HDassert(len); + assert(len); /* Randomly choose lengths of segments */ cur_off = 0; diff --git a/test/big.c b/test/big.c index ca8ba1f..0311a93 100644 --- a/test/big.c +++ b/test/big.c @@ -270,7 +270,7 @@ enough_room(hid_t fapl) fd[i] = -1; /* Get file name template */ - HDassert(H5FD_FAMILY == H5Pget_driver(fapl)); + assert(H5FD_FAMILY == H5Pget_driver(fapl)); h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); /* Create files */ diff --git a/test/btree2.c b/test/btree2.c index 2a38675..aebdebe 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -476,8 +476,8 @@ index_rec_cb(const void *_record, void *_op_data) const H5B2_test_rec_t *record = (const H5B2_test_rec_t *)_record; H5B2_test_rec_t *search = (H5B2_test_rec_t *)_op_data; - HDassert(record); - HDassert(search); + assert(record); + assert(search); search->key = record->key; search->val = record->val; @@ -554,7 +554,7 @@ modify_rec_cb(void *_record, void *_op_data, hbool_t *changed) H5B2_test_rec_t *record = (H5B2_test_rec_t *)_record; H5B2_test_rec_t *modify = (H5B2_test_rec_t *)_op_data; - HDassert(record->key == modify->key); + assert(record->key == modify->key); record->val = modify->val; *changed = TRUE; diff --git a/test/cache.c b/test/cache.c index 80052a4..b1eb744 100644 --- a/test/cache.c +++ b/test/cache.c @@ -4780,8 +4780,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 2; size_t expected_index_size = 2 * PICO_ENTRY_SIZE; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -4874,8 +4874,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 0; size_t expected_index_size = 0; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -4965,8 +4965,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5031,8 +5031,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 0; size_t expected_index_size = 0; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5104,8 +5104,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5201,8 +5201,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5294,8 +5294,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5385,8 +5385,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 1; size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5478,8 +5478,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 3; size_t expected_index_size = 3 * PICO_ENTRY_SIZE; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5560,8 +5560,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 0; size_t expected_index_size = (size_t)0; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5640,8 +5640,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) size_t expected_index_size = VARIABLE_ENTRY_SIZE + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2); - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5721,8 +5721,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 0; size_t expected_index_size = (size_t)0; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5801,8 +5801,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) size_t expected_index_size = VARIABLE_ENTRY_SIZE + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2); - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -5905,8 +5905,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) size_t expected_index_size = VARIABLE_ENTRY_SIZE + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2); - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -6020,8 +6020,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (VARIABLE_ENTRY_SIZE / 4) + (VARIABLE_ENTRY_SIZE / 2) + (2 * PICO_ENTRY_SIZE); - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -6208,8 +6208,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * (VARIABLE_ENTRY_SIZE / 4)) + (2 * (VARIABLE_ENTRY_SIZE / 2)) + (4 * PICO_ENTRY_SIZE); - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -6451,8 +6451,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 0; size_t expected_index_size = 0; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -6690,8 +6690,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 3; size_t expected_index_size = 3 * PICO_ENTRY_SIZE; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -6809,8 +6809,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 0; size_t expected_index_size = (size_t)0; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -6998,8 +6998,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 13; size_t expected_index_size = 9 * VARIABLE_ENTRY_SIZE; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -7406,8 +7406,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 0; size_t expected_index_size = (size_t)0; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -7739,8 +7739,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 5; size_t expected_index_size = 4 * VARIABLE_ENTRY_SIZE; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -7915,8 +7915,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) unsigned expected_index_len = 0; size_t expected_index_size = 0; - HDassert(spec_size <= max_num_spec); - HDassert(check_size <= max_num_check); + assert(spec_size <= max_num_spec); + assert(check_size <= max_num_check); spec[0] = (struct fo_flush_cache_test_spec){ /* entry_num = */ 0, @@ -8475,7 +8475,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t *file_ptr) expected[i].is_corked = FALSE; } - HDassert(i == num_total_entries); + assert(i == num_total_entries); pass = TRUE; } @@ -15276,7 +15276,7 @@ check_protect_retries(unsigned paged) } else { - HDassert((entry_ptr->cache_ptr == NULL) || (entry_ptr->cache_ptr == cache_ptr)); + assert((entry_ptr->cache_ptr == NULL) || (entry_ptr->cache_ptr == cache_ptr)); entry_ptr->cache_ptr = cache_ptr; entry_ptr->file_ptr = file_ptr; @@ -15285,7 +15285,7 @@ check_protect_retries(unsigned paged) entry_ptr->ro_ref_count++; } - HDassert(((entry_ptr->header).type)->id == type); + assert(((entry_ptr->header).type)->id == type); } if (pass) @@ -33016,7 +33016,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t *file_ptr) entry_ptr = &(base_addr[0]); entry_addr = entry_ptr->header.addr; - HDassert(entry_addr == entry_ptr->addr); + assert(entry_addr == entry_ptr->addr); expected_hash_bucket = H5C__HASH_FCN(entry_addr); @@ -33683,7 +33683,7 @@ check_stats__smoke_check_1(H5F_t *file_ptr) static herr_t check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr) { - HDassert(write_permitted_ptr); + assert(write_permitted_ptr); *write_permitted_ptr = write_permitted; @@ -33832,7 +33832,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { - HDassert(fid >= 0); + assert(fid >= 0); saved_fid = fid; if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) { pass = FALSE; @@ -33886,7 +33886,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) * instance, and then close the file normally. */ - HDassert(saved_cache == NULL); + assert(saved_cache == NULL); saved_cache = file_ptr->shared->cache; file_ptr->shared->cache = NULL; @@ -34018,7 +34018,7 @@ takedown_cache(H5F_t *file_ptr, hbool_t dump_stats, hbool_t dump_detailed_stats) if (NULL == file_ptr) { file_ptr = (H5F_t *)H5VL_object_verify(saved_fid, H5I_FILE); - HDassert(file_ptr); + assert(file_ptr); } H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, saved_actual_base_addr, diff --git a/test/cache_common.c b/test/cache_common.c index 82ef9e4..e4135b0 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -389,8 +389,8 @@ addr_to_type_and_index(haddr_t addr, int32_t *type_ptr, int32_t *index_ptr) int32_t type; int32_t idx; - HDassert(type_ptr); - HDassert(index_ptr); + assert(type_ptr); + assert(index_ptr); /* we only have a small number of entry types, so just do a * linear search. If NUMBER_OF_ENTRY_TYPES grows, we may want @@ -412,24 +412,24 @@ addr_to_type_and_index(haddr_t addr, int32_t *type_ptr, int32_t *index_ptr) type = i - 1; - HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); if (addr >= PICO_ALT_BASE_ADDR) { idx = (int32_t)((addr - alt_base_addrs[type]) / entry_sizes[type]); - HDassert((idx >= 0) && (idx <= max_indices[type])); - HDassert(!((entries[type])[idx].at_main_addr)); - HDassert(addr == (entries[type])[idx].alt_addr); + assert((idx >= 0) && (idx <= max_indices[type])); + assert(!((entries[type])[idx].at_main_addr)); + assert(addr == (entries[type])[idx].alt_addr); } else { idx = (int32_t)((addr - base_addrs[type]) / entry_sizes[type]); - HDassert((idx >= 0) && (idx <= max_indices[type])); - HDassert((entries[type])[idx].at_main_addr); - HDassert(addr == (entries[type])[idx].main_addr); + assert((idx >= 0) && (idx <= max_indices[type])); + assert((entries[type])[idx].at_main_addr); + assert(addr == (entries[type])[idx].main_addr); } - HDassert(addr == (entries[type])[idx].addr); + assert(addr == (entries[type])[idx].addr); *type_ptr = type; *index_ptr = idx; @@ -465,15 +465,15 @@ get_initial_load_size(void *udata, size_t *image_length, int32_t H5_ATTR_NDEBUG_ base_addr = entries[type]; entry = &(base_addr[idx]); - HDassert(entry->type >= 0); - HDassert(entry->type == type); - HDassert(entry->type == entry_type); - HDassert(entry->type < NUMBER_OF_ENTRY_TYPES); - HDassert(entry->index == idx); - HDassert(entry->index >= 0); - HDassert(entry->index <= max_indices[type]); - HDassert(entry == entry->self); - HDassert(entry->addr == addr); + assert(entry->type >= 0); + assert(entry->type == type); + assert(entry->type == entry_type); + assert(entry->type < NUMBER_OF_ENTRY_TYPES); + assert(entry->index == idx); + assert(entry->index >= 0); + assert(entry->index <= max_indices[type]); + assert(entry == entry->self); + assert(entry->addr == addr); *image_length = entry->size; @@ -574,16 +574,16 @@ get_final_load_size(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED imag base_addr = entries[type]; entry = &(base_addr[idx]); - HDassert(entry->type >= 0); - HDassert(entry->type == type); - HDassert(entry->type == entry_type); - HDassert(entry->type < NUMBER_OF_ENTRY_TYPES); - HDassert(entry->index == idx); - HDassert(entry->index >= 0); - HDassert(entry->index <= max_indices[type]); - HDassert(entry == entry->self); - HDassert(entry->addr == addr); - HDassert(type == VARIABLE_ENTRY_TYPE); + assert(entry->type >= 0); + assert(entry->type == type); + assert(entry->type == entry_type); + assert(entry->type < NUMBER_OF_ENTRY_TYPES); + assert(entry->index == idx); + assert(entry->index >= 0); + assert(entry->index <= max_indices[type]); + assert(entry == entry->self); + assert(entry->addr == addr); + assert(type == VARIABLE_ENTRY_TYPE); /* Simulate SPECULATIVE read with a specified actual_len */ if (entry->actual_len) { @@ -633,16 +633,16 @@ verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void base_addr = entries[type]; entry = &(base_addr[idx]); - HDassert(entry->type >= 0); - HDassert(entry->type == type); - HDassert(entry->type == entry_type); - HDassert(entry->type < NUMBER_OF_ENTRY_TYPES); - HDassert(type == VARIABLE_ENTRY_TYPE); - HDassert(entry->index == idx); - HDassert(entry->index >= 0); - HDassert(entry->index <= max_indices[type]); - HDassert(entry == entry->self); - HDassert(entry->addr == addr); + assert(entry->type >= 0); + assert(entry->type == type); + assert(entry->type == entry_type); + assert(entry->type < NUMBER_OF_ENTRY_TYPES); + assert(type == VARIABLE_ENTRY_TYPE); + assert(entry->index == idx); + assert(entry->index >= 0); + assert(entry->index <= max_indices[type]); + assert(entry == entry->self); + assert(entry->addr == addr); if (++entry->verify_ct >= entry->max_verify_ct) return (TRUE); @@ -686,26 +686,26 @@ deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *udata, hb base_addr = entries[type]; entry = &(base_addr[idx]); - HDassert(entry->type >= 0); - HDassert(entry->type == type); - HDassert(entry->type == entry_type); - HDassert(entry->type < NUMBER_OF_ENTRY_TYPES); - HDassert(entry->index == idx); - HDassert(entry->index >= 0); - HDassert(entry->index <= max_indices[type]); - HDassert(entry == entry->self); - HDassert(entry->addr == addr); - HDassert(entry->size == len); - HDassert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[type])); - HDassert(dirty != NULL); - HDassert(entry->flush_dep_npar == 0); - HDassert(entry->flush_dep_nchd == 0); + assert(entry->type >= 0); + assert(entry->type == type); + assert(entry->type == entry_type); + assert(entry->type < NUMBER_OF_ENTRY_TYPES); + assert(entry->index == idx); + assert(entry->index >= 0); + assert(entry->index <= max_indices[type]); + assert(entry == entry->self); + assert(entry->addr == addr); + assert(entry->size == len); + assert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[type])); + assert(dirty != NULL); + assert(entry->flush_dep_npar == 0); + assert(entry->flush_dep_nchd == 0); /* for now *dirty will always be FALSE */ *dirty = FALSE; /* verify that the image contains the expected data. */ - HDassert(image != NULL); + assert(image != NULL); if ((entry->at_main_addr && entry->written_to_main_addr) || (!entry->at_main_addr && entry->written_to_alt_addr)) { if ((type == PICO_ENTRY_TYPE) || (type == VARIABLE_ENTRY_TYPE) || (type == NOTIFY_ENTRY_TYPE)) { @@ -714,7 +714,7 @@ deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *udata, hb HDfprintf(stdout, "*image = 0x%x\n", (int)(*((const char *)image))); HDfprintf(stdout, "expected *image = 0x%x\n", (int)(idx & 0xFF)); } /* end if */ - HDassert((*((const char *)image)) == (char)(idx & 0xFF)); + assert((*((const char *)image)) == (char)(idx & 0xFF)); } /* end if */ else { if ((*(((const char *)image) + 2)) != (char)(idx & 0xFF)) { @@ -725,9 +725,9 @@ deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *udata, hb HDfprintf(stdout, "expected *image = 0x%02" PRIx32 "%02" PRIx32 "\n", (uint32_t)idx & 0xFF, (((uint32_t)idx & 0xFF00) >> 8)); } /* end if */ - HDassert((*((const char *)image)) == (char)(type & 0xFF)); - HDassert((*(((const char *)image) + 1)) == (char)((idx & 0xFF00) >> 8)); - HDassert((*(((const char *)image) + 2)) == (char)(idx & 0xFF)); + assert((*((const char *)image)) == (char)(type & 0xFF)); + assert((*(((const char *)image) + 1)) == (char)((idx & 0xFF00) >> 8)); + assert((*(((const char *)image) + 2)) == (char)(idx & 0xFF)); } /* end else */ } /* end if */ @@ -826,26 +826,26 @@ image_len(const void *thing, size_t *image_length, int32_t H5_ATTR_NDEBUG_UNUSED const test_entry_t *entry; int32_t type; - HDassert(thing); - HDassert(image_length); + assert(thing); + assert(image_length); entry = (const test_entry_t *)thing; - HDassert(entry->self == entry); + assert(entry->self == entry); type = entry->type; - HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert(type == entry_type); - HDassert((entry->index >= 0) && (entry->index <= max_indices[type])); + assert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + assert(type == entry_type); + assert((entry->index >= 0) && (entry->index <= max_indices[type])); - HDassert(entry == &(entries[type][entry->index])); + assert(entry == &(entries[type][entry->index])); if (type != VARIABLE_ENTRY_TYPE) - HDassert(entry->size == entry_sizes[type]); + assert(entry->size == entry_sizes[type]); else { - HDassert(entry->size <= entry_sizes[type]); - HDassert(entry->size > 0); + assert(entry->size <= entry_sizes[type]); + assert(entry->size > 0); } /* end else */ *image_length = entry->size; @@ -945,32 +945,32 @@ pre_serialize(H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *thing, haddr_t H5_ATTR_NDEBU test_entry_t *entry; int32_t i; - HDassert(f); - HDassert(thing); - HDassert(flags_ptr); + assert(f); + assert(thing); + assert(flags_ptr); *flags_ptr = H5C__SERIALIZE_NO_FLAGS_SET; - HDassert(new_addr_ptr); - HDassert(new_len_ptr); + assert(new_addr_ptr); + assert(new_len_ptr); entry = (test_entry_t *)thing; - HDassert(entry->self == entry); - HDassert(entry->addr == addr); - HDassert(entry->size == len); + assert(entry->self == entry); + assert(entry->addr == addr); + assert(entry->size == len); /* shouldn't serialize the entry unless it is dirty */ - HDassert(entry->is_dirty); - HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES)); - HDassert((entry->index >= 0) && (entry->index <= max_indices[entry->type])); - HDassert(entry == &(entries[entry->type][entry->index])); - HDassert(entry->num_flush_ops >= 0); - HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); + assert(entry->is_dirty); + assert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES)); + assert((entry->index >= 0) && (entry->index <= max_indices[entry->type])); + assert(entry == &(entries[entry->type][entry->index])); + assert(entry->num_flush_ops >= 0); + assert(entry->num_flush_ops < MAX_FLUSH_OPS); if (entry->num_flush_ops > 0) { for (i = 0; i < entry->num_flush_ops; i++) { - HDassert(entry->file_ptr); + assert(entry->file_ptr); execute_flush_op(entry->file_ptr, entry, &((entry->flush_ops)[i]), flags_ptr); } /* end for */ @@ -986,16 +986,16 @@ pre_serialize(H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *thing, haddr_t H5_ATTR_NDEBU /* set *new_len_ptr to the new length. */ - HDassert(entry->type == VARIABLE_ENTRY_TYPE); - HDassert(entry->size > 0); - HDassert(entry->size <= VARIABLE_ENTRY_SIZE); + assert(entry->type == VARIABLE_ENTRY_TYPE); + assert(entry->size > 0); + assert(entry->size <= VARIABLE_ENTRY_SIZE); *new_len_ptr = entry->size; } /* end if */ if (((*flags_ptr) & H5C__SERIALIZE_MOVED_FLAG) != 0) { - HDassert(((*flags_ptr) | H5C__SERIALIZE_RESIZED_FLAG) != 0); + assert(((*flags_ptr) | H5C__SERIALIZE_RESIZED_FLAG) != 0); /* place the new address in *new_addr */ *new_addr_ptr = entry->addr; @@ -1109,35 +1109,35 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin test_entry_t *entry; int32_t type; - HDassert(image_ptr); - HDassert(thing); + assert(image_ptr); + assert(thing); entry = (test_entry_t *)thing; - HDassert(entry->self == entry); - HDassert(entry->size == len); + assert(entry->self == entry); + assert(entry->size == len); /* shouldn't serialize the entry unless it is dirty */ - HDassert(entry->is_dirty); + assert(entry->is_dirty); type = entry->type; - HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((entry->index >= 0) && (entry->index <= max_indices[type])); + assert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((entry->index >= 0) && (entry->index <= max_indices[type])); - HDassert(entry == &(entries[type][entry->index])); - HDassert(entry->num_flush_ops >= 0); - HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); + assert(entry == &(entries[type][entry->index])); + assert(entry->num_flush_ops >= 0); + assert(entry->num_flush_ops < MAX_FLUSH_OPS); /* null out the image to avoid spurious failures */ HDmemset(image_ptr, 0, len); if ((type == PICO_ENTRY_TYPE) || (type == VARIABLE_ENTRY_TYPE) || (type == NOTIFY_ENTRY_TYPE)) { - HDassert(entry->size >= PICO_ENTRY_SIZE); + assert(entry->size >= PICO_ENTRY_SIZE); *((char *)image_ptr) = (char)((entry->index) & 0xFF); } /* end if */ else { - HDassert(entry->size >= NANO_ENTRY_SIZE); + assert(entry->size >= NANO_ENTRY_SIZE); *((char *)image_ptr) = (char)((entry->type) & 0xFF); *(((char *)image_ptr) + 1) = (char)(((entry->index) & 0xFF00) >> 8); *(((char *)image_ptr) + 2) = (char)((entry->index) & 0xFF); @@ -1150,7 +1150,7 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin entry->is_dirty = FALSE; if (entry->flush_dep_npar > 0) { - HDassert(entry->flush_dep_ndirty_chd == 0); + assert(entry->flush_dep_ndirty_chd == 0); mark_flush_dep_clean(entry); } /* end if */ @@ -1254,19 +1254,19 @@ notify(H5C_notify_action_t action, void *thing, int32_t H5_ATTR_NDEBUG_UNUSED en { test_entry_t *entry; - HDassert(thing); + assert(thing); entry = (test_entry_t *)thing; - HDassert(entry->index >= 0); - HDassert(entry->index <= max_indices[entry->type]); - HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES)); - HDassert(entry->type == entry_type); - HDassert(entry == &(entries[entry->type][entry->index])); - HDassert(entry == entry->self); + assert(entry->index >= 0); + assert(entry->index <= max_indices[entry->type]); + assert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES)); + assert(entry->type == entry_type); + assert(entry == &(entries[entry->type][entry->index])); + assert(entry == entry->self); if (!(action == H5C_NOTIFY_ACTION_ENTRY_DIRTIED && entry->action == TEST_ENTRY_ACTION_MOVE)) - HDassert(entry->header.addr == entry->addr); - HDassert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[entry->type])); + assert(entry->header.addr == entry->addr); + assert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[entry->type])); /* Increment count for appropriate action */ switch (action) { @@ -1290,7 +1290,7 @@ notify(H5C_notify_action_t action, void *thing, int32_t H5_ATTR_NDEBUG_UNUSED en break; default: - HDassert(0 && "Unknown notify action!?!"); + assert(0 && "Unknown notify action!?!"); } /* end switch */ return (SUCCEED); @@ -1327,19 +1327,19 @@ notify_notify(H5C_notify_action_t action, void *thing) herr_t free_icr(test_entry_t *entry, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { - HDassert(entry); - - HDassert(entry->type == entry_type); - HDassert(entry->index >= 0); - HDassert(entry->index <= max_indices[entry->type]); - HDassert(entry == &(entries[entry->type][entry->index])); - HDassert(entry == entry->self); - HDassert(entry->cache_ptr != NULL); - HDassert((entry->header.destroy_in_progress) || (entry->header.addr == entry->addr)); - HDassert(entry->header.size == entry->size); - HDassert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[entry->type])); - HDassert(entry->header.tl_next == NULL); - HDassert(entry->header.tl_prev == NULL); + assert(entry); + + assert(entry->type == entry_type); + assert(entry->index >= 0); + assert(entry->index <= max_indices[entry->type]); + assert(entry == &(entries[entry->type][entry->index])); + assert(entry == entry->self); + assert(entry->cache_ptr != NULL); + assert((entry->header.destroy_in_progress) || (entry->header.addr == entry->addr)); + assert(entry->header.size == entry->size); + assert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[entry->type])); + assert(entry->header.tl_next == NULL); + assert(entry->header.tl_prev == NULL); if (entry->num_pins > 0) { int i; @@ -1351,21 +1351,21 @@ free_icr(test_entry_t *entry, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) pinned_base_addr = entries[entry->pin_type[i]]; pinned_entry = &(pinned_base_addr[entry->pin_idx[i]]); - HDassert(0 <= pinned_entry->type); - HDassert(pinned_entry->type < NUMBER_OF_ENTRY_TYPES); - HDassert(pinned_entry->type == entry->pin_type[i]); - HDassert(pinned_entry->index >= 0); - HDassert(pinned_entry->index <= max_indices[pinned_entry->type]); - HDassert(pinned_entry->index == entry->pin_idx[i]); - HDassert(pinned_entry == pinned_entry->self); - HDassert(pinned_entry->header.is_pinned); - HDassert(pinned_entry->is_pinned); - HDassert(pinned_entry->pinning_ref_count > 0); + assert(0 <= pinned_entry->type); + assert(pinned_entry->type < NUMBER_OF_ENTRY_TYPES); + assert(pinned_entry->type == entry->pin_type[i]); + assert(pinned_entry->index >= 0); + assert(pinned_entry->index <= max_indices[pinned_entry->type]); + assert(pinned_entry->index == entry->pin_idx[i]); + assert(pinned_entry == pinned_entry->self); + assert(pinned_entry->header.is_pinned); + assert(pinned_entry->is_pinned); + assert(pinned_entry->pinning_ref_count > 0); pinned_entry->pinning_ref_count--; if (pinned_entry->pinning_ref_count <= 0) { - HDassert(pinned_entry->file_ptr); + assert(pinned_entry->file_ptr); unpin_entry(pinned_entry->type, pinned_entry->index); } /* end if */ @@ -1478,23 +1478,23 @@ add_flush_op(int target_type, int target_idx, int op_code, int type, int idx, hb test_entry_t *target_base_addr; test_entry_t *target_entry_ptr; - HDassert((0 <= target_type) && (target_type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= target_idx) && (target_idx <= max_indices[target_type])); - HDassert((0 <= op_code) && (op_code <= FLUSH_OP__MAX_OP)); - HDassert((op_code != FLUSH_OP__RESIZE) || (type == VARIABLE_ENTRY_TYPE)); - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); - HDassert(new_size <= VARIABLE_ENTRY_SIZE); + assert((0 <= target_type) && (target_type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= target_idx) && (target_idx <= max_indices[target_type])); + assert((0 <= op_code) && (op_code <= FLUSH_OP__MAX_OP)); + assert((op_code != FLUSH_OP__RESIZE) || (type == VARIABLE_ENTRY_TYPE)); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); + assert(new_size <= VARIABLE_ENTRY_SIZE); if (pass) { target_base_addr = entries[target_type]; target_entry_ptr = &(target_base_addr[target_idx]); - HDassert(target_entry_ptr->index == target_idx); - HDassert(target_entry_ptr->type == target_type); - HDassert(target_entry_ptr == target_entry_ptr->self); - HDassert(target_entry_ptr->num_flush_ops < MAX_FLUSH_OPS); + assert(target_entry_ptr->index == target_idx); + assert(target_entry_ptr->type == target_type); + assert(target_entry_ptr == target_entry_ptr->self); + assert(target_entry_ptr->num_flush_ops < MAX_FLUSH_OPS); i = (target_entry_ptr->num_flush_ops)++; (target_entry_ptr->flush_ops)[i].op_code = op_code; @@ -1540,10 +1540,10 @@ create_pinned_entry_dependency(H5F_t *file_ptr, int pinning_type, int pinning_id if (pass) { - HDassert((0 <= pinning_type) && (pinning_type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= pinning_idx) && (pinning_idx <= max_indices[pinning_type])); - HDassert((0 <= pinned_type) && (pinned_type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= pinned_idx) && (pinned_idx <= max_indices[pinned_type])); + assert((0 <= pinning_type) && (pinning_type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= pinning_idx) && (pinning_idx <= max_indices[pinning_type])); + assert((0 <= pinned_type) && (pinned_type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= pinned_idx) && (pinned_idx <= max_indices[pinned_type])); pinning_base_addr = entries[pinning_type]; pinning_entry_ptr = &(pinning_base_addr[pinning_idx]); @@ -1551,15 +1551,15 @@ create_pinned_entry_dependency(H5F_t *file_ptr, int pinning_type, int pinning_id pinned_base_addr = entries[pinned_type]; pinned_entry_ptr = &(pinned_base_addr[pinned_idx]); - HDassert(pinning_entry_ptr->index == pinning_idx); - HDassert(pinning_entry_ptr->type == pinning_type); - HDassert(pinning_entry_ptr == pinning_entry_ptr->self); - HDassert(pinning_entry_ptr->num_pins < MAX_PINS); + assert(pinning_entry_ptr->index == pinning_idx); + assert(pinning_entry_ptr->type == pinning_type); + assert(pinning_entry_ptr == pinning_entry_ptr->self); + assert(pinning_entry_ptr->num_pins < MAX_PINS); - HDassert(pinning_entry_ptr->index == pinning_idx); - HDassert(pinning_entry_ptr->type == pinning_type); - HDassert(pinning_entry_ptr == pinning_entry_ptr->self); - HDassert(!(pinning_entry_ptr->is_protected)); + assert(pinning_entry_ptr->index == pinning_idx); + assert(pinning_entry_ptr->type == pinning_type); + assert(pinning_entry_ptr == pinning_entry_ptr->self); + assert(!(pinning_entry_ptr->is_protected)); pinning_entry_ptr->pin_type[pinning_entry_ptr->num_pins] = pinned_type; pinning_entry_ptr->pin_idx[pinning_entry_ptr->num_pins] = pinned_idx; @@ -1603,16 +1603,16 @@ dirty_entry(H5F_t *file_ptr, int32_t type, int32_t idx, hbool_t dirty_pin) test_entry_t *base_addr; test_entry_t *entry_ptr; - HDassert(file_ptr); - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert(file_ptr); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); if (pass) { if (dirty_pin) { H5C_t *cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); if (!entry_in_cache(cache_ptr, type, idx)) { @@ -1624,9 +1624,9 @@ dirty_entry(H5F_t *file_ptr, int32_t type, int32_t idx, hbool_t dirty_pin) base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); if (!((entry_ptr->header).is_pinned)) { @@ -1670,19 +1670,19 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o { H5C_t *cache_ptr; - HDassert(file_ptr); + assert(file_ptr); cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr != NULL); - HDassert(entry_ptr != NULL); - HDassert(entry_ptr == entry_ptr->self); - HDassert(entry_ptr->header.addr == entry_ptr->addr); - HDassert((entry_ptr->flush_op_self_resize_in_progress) || (entry_ptr->header.size == entry_ptr->size)); - HDassert(op_ptr != NULL); - HDassert((0 <= entry_ptr->type) && (entry_ptr->type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= entry_ptr->index) && (entry_ptr->index <= max_indices[entry_ptr->type])); - HDassert((0 <= op_ptr->type) && (op_ptr->type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= op_ptr->idx) && (op_ptr->idx <= max_indices[op_ptr->type])); - HDassert(flags_ptr != NULL); + assert(cache_ptr != NULL); + assert(entry_ptr != NULL); + assert(entry_ptr == entry_ptr->self); + assert(entry_ptr->header.addr == entry_ptr->addr); + assert((entry_ptr->flush_op_self_resize_in_progress) || (entry_ptr->header.size == entry_ptr->size)); + assert(op_ptr != NULL); + assert((0 <= entry_ptr->type) && (entry_ptr->type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= entry_ptr->index) && (entry_ptr->index <= max_indices[entry_ptr->type])); + assert((0 <= op_ptr->type) && (op_ptr->type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= op_ptr->idx) && (op_ptr->idx <= max_indices[op_ptr->type])); + assert(flags_ptr != NULL); if (pass) { @@ -1691,7 +1691,7 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o break; case FLUSH_OP__DIRTY: - HDassert((entry_ptr->type != op_ptr->type) || (entry_ptr->index != op_ptr->idx)); + assert((entry_ptr->type != op_ptr->type) || (entry_ptr->index != op_ptr->idx)); dirty_entry(file_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); break; @@ -1702,9 +1702,9 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o /* the flush operation is acting on the entry to * which it is attached. Handle this here: */ - HDassert(entry_ptr->type == VARIABLE_ENTRY_TYPE); - HDassert(op_ptr->size > 0); - HDassert(op_ptr->size <= VARIABLE_ENTRY_SIZE); + assert(entry_ptr->type == VARIABLE_ENTRY_TYPE); + assert(op_ptr->size > 0); + assert(op_ptr->size <= VARIABLE_ENTRY_SIZE); entry_ptr->size = op_ptr->size; @@ -1727,16 +1727,16 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o * which it is attached. Handle this here: */ - HDassert(((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0); + assert(((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0); (*flags_ptr) |= H5C__SERIALIZE_MOVED_FLAG; if (op_ptr->flag) { - HDassert(entry_ptr->addr == entry_ptr->alt_addr); + assert(entry_ptr->addr == entry_ptr->alt_addr); entry_ptr->addr = entry_ptr->main_addr; entry_ptr->at_main_addr = TRUE; } /* end if */ else { - HDassert(entry_ptr->addr == entry_ptr->main_addr); + assert(entry_ptr->addr == entry_ptr->main_addr); entry_ptr->addr = entry_ptr->alt_addr; entry_ptr->at_main_addr = FALSE; } /* end else */ @@ -1746,7 +1746,7 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o break; case FLUSH_OP__ORDER: - HDassert(op_ptr->order_ptr); + assert(op_ptr->order_ptr); entry_ptr->flush_order = *op_ptr->order_ptr; (*op_ptr->order_ptr)++; break; @@ -1766,12 +1766,12 @@ execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, struct flush_o * must always be executed on an entry other than the * entry being flushed. */ - HDassert((entry_ptr->type != op_ptr->type) || (entry_ptr->index != op_ptr->idx)); + assert((entry_ptr->type != op_ptr->type) || (entry_ptr->index != op_ptr->idx)); expunge_entry(file_ptr, op_ptr->type, op_ptr->idx); break; case FLUSH_OP__DEST_FLUSH_DEP: - HDassert((entry_ptr->type != op_ptr->type) || (entry_ptr->index != op_ptr->idx)); + assert((entry_ptr->type != op_ptr->type) || (entry_ptr->index != op_ptr->idx)); destroy_flush_dependency(op_ptr->type, op_ptr->idx, entry_ptr->type, entry_ptr->index); break; @@ -1806,24 +1806,24 @@ entry_in_cache(H5C_t *cache_ptr, int32_t type, int32_t idx) test_entry_t *entry_ptr; H5C_cache_entry_t *test_ptr = NULL; - HDassert(cache_ptr); - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert(cache_ptr); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); H5C_TEST__SEARCH_INDEX(cache_ptr, entry_ptr->addr, test_ptr) if (test_ptr != NULL) { in_cache = TRUE; - HDassert(test_ptr == (H5C_cache_entry_t *)entry_ptr); - HDassert(entry_ptr->addr == entry_ptr->header.addr); + assert(test_ptr == (H5C_cache_entry_t *)entry_ptr); + assert(entry_ptr->addr == entry_ptr->header.addr); } return (in_cache); @@ -2044,8 +2044,8 @@ reset_entries(void) base_addr = entries[i]; orig_base_addr = orig_entries[i]; - HDassert(base_addr); - HDassert(orig_base_addr); + assert(base_addr); + assert(orig_base_addr); for (j = 0; j <= max_index; j++) { int k; @@ -2178,17 +2178,17 @@ resize_entry(H5F_t *file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_ test_entry_t *entry_ptr; herr_t result; - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert(type == VARIABLE_ENTRY_TYPE); - HDassert((0 <= idx) && (idx <= max_indices[type])); - HDassert((0 < new_size) && (new_size <= entry_sizes[type])); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert(type == VARIABLE_ENTRY_TYPE); + assert((0 <= idx) && (idx <= max_indices[type])); + assert((0 < new_size) && (new_size <= entry_sizes[type])); if (pass) { if (in_cache) { H5C_t *cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); if (!entry_in_cache(cache_ptr, type, idx)) { @@ -2200,10 +2200,10 @@ resize_entry(H5F_t *file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_ base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr->cache_ptr == cache_ptr); - HDassert(entry_ptr == entry_ptr->self); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr->cache_ptr == cache_ptr); + assert(entry_ptr == entry_ptr->self); if (!(entry_ptr->header.is_pinned || entry_ptr->header.is_protected)) { @@ -2228,7 +2228,7 @@ resize_entry(H5F_t *file_ptr, int32_t type, int32_t idx, size_t new_size, hbool_ } else { - HDassert(entry_ptr->size == (entry_ptr->header).size); + assert(entry_ptr->size == (entry_ptr->header).size); } } } @@ -2275,7 +2275,7 @@ verify_clean(void) max_index = max_indices[i]; base_addr = entries[i]; - HDassert(base_addr); + assert(base_addr); for (j = 0; j <= max_index; j++) { if ((base_addr[j].header.is_dirty) || (base_addr[j].is_dirty)) { @@ -2642,10 +2642,10 @@ verify_unprotected(void) max_index = max_indices[i]; base_addr = entries[i]; - HDassert(base_addr); + assert(base_addr); for (j = 0; j <= max_index; j++) { - HDassert(base_addr[j].header.is_protected == base_addr[j].is_protected); + assert(base_addr[j].header.is_protected == base_addr[j].is_protected); if ((base_addr[j].header.is_protected) || (base_addr[j].is_protected)) { @@ -2688,23 +2688,23 @@ expunge_entry(H5F_t *file_ptr, int32_t type, int32_t idx) #ifndef NDEBUG H5C_t *cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); #endif /* NDEBUG */ - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); - HDassert(entry_ptr->cache_ptr == cache_ptr); - HDassert(!(entry_ptr->header.is_protected)); - HDassert(!(entry_ptr->is_protected)); - HDassert(!(entry_ptr->header.is_pinned)); - HDassert(!(entry_ptr->is_pinned)); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); + assert(entry_ptr->cache_ptr == cache_ptr); + assert(!(entry_ptr->header.is_protected)); + assert(!(entry_ptr->is_protected)); + assert(!(entry_ptr->header.is_pinned)); + assert(!(entry_ptr->is_pinned)); result = H5C_expunge_entry(file_ptr, types[type], entry_ptr->addr, H5C__NO_FLAGS_SET); @@ -2745,7 +2745,7 @@ flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_ if (pass) { H5C_t *cache_ptr; - HDassert(file_ptr); + assert(file_ptr); cache_ptr = file_ptr->shared->cache; @@ -2803,8 +2803,8 @@ cork_entry_type(H5F_t *file_ptr, int32_t type) cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr); - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert(cache_ptr); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); baddrs = base_addrs[type]; if (H5C_cork(cache_ptr, baddrs, H5C__SET_CORK, NULL) < 0) { @@ -2838,8 +2838,8 @@ uncork_entry_type(H5F_t *file_ptr, int32_t type) cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr); - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert(cache_ptr); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); baddrs = base_addrs[type]; if (H5C_cork(cache_ptr, baddrs, H5C__UNCORK, NULL) < 0) { @@ -2879,20 +2879,20 @@ insert_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags) cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr); - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert(cache_ptr); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); baddrs = base_addrs[type]; - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); - HDassert(!(entry_ptr->is_protected)); - HDassert(entry_ptr->flush_dep_npar == 0); - HDassert(entry_ptr->flush_dep_nchd == 0); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); + assert(!(entry_ptr->is_protected)); + assert(entry_ptr->flush_dep_npar == 0); + assert(entry_ptr->flush_dep_nchd == 0); insert_pinned = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0); @@ -2926,23 +2926,23 @@ insert_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags) (int)(entry_ptr->addr != entry_ptr->header.addr)); #endif } /* end if */ - HDassert(entry_ptr->cache_ptr == NULL); + assert(entry_ptr->cache_ptr == NULL); entry_ptr->file_ptr = file_ptr; entry_ptr->cache_ptr = cache_ptr; if (insert_pinned) - HDassert(entry_ptr->header.is_pinned); + assert(entry_ptr->header.is_pinned); else - HDassert(!(entry_ptr->header.is_pinned)); + assert(!(entry_ptr->header.is_pinned)); entry_ptr->is_pinned = insert_pinned; entry_ptr->pinned_from_client = insert_pinned; if (entry_ptr->header.tag_info && entry_ptr->header.tag_info->corked) entry_ptr->is_corked = TRUE; - HDassert(entry_ptr->header.is_dirty); - HDassert(((entry_ptr->header).type)->id == type); + assert(entry_ptr->header.is_dirty); + assert(((entry_ptr->header).type)->id == type); } /* end if */ } /* insert_entry() */ @@ -2972,16 +2972,16 @@ mark_entry_dirty(int32_t type, int32_t idx) if (pass) { - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); - HDassert(entry_ptr->header.is_protected || entry_ptr->header.is_pinned); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); + assert(entry_ptr->header.is_protected || entry_ptr->header.is_pinned); was_dirty = entry_ptr->is_dirty; entry_ptr->is_dirty = TRUE; @@ -3001,7 +3001,7 @@ mark_entry_dirty(int32_t type, int32_t idx) failure_mssg = "error in H5C_mark_entry_dirty()."; } - HDassert(((entry_ptr->header).type)->id == type); + assert(((entry_ptr->header).type)->id == type); } } /* mark_entry_dirty() */ @@ -3033,25 +3033,25 @@ move_entry(H5C_t *cache_ptr, int32_t type, int32_t idx, hbool_t main_addr) if (pass) { - HDassert(cache_ptr); - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert(cache_ptr); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); - HDassert(entry_ptr->cache_ptr == cache_ptr); - HDassert(!entry_ptr->is_read_only); - HDassert(!entry_ptr->header.is_read_only); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); + assert(entry_ptr->cache_ptr == cache_ptr); + assert(!entry_ptr->is_read_only); + assert(!entry_ptr->header.is_read_only); if (entry_ptr->at_main_addr && !main_addr) { /* move to alt addr */ - HDassert(entry_ptr->addr == entry_ptr->main_addr); + assert(entry_ptr->addr == entry_ptr->main_addr); done = FALSE; old_addr = entry_ptr->addr; @@ -3061,7 +3061,7 @@ move_entry(H5C_t *cache_ptr, int32_t type, int32_t idx, hbool_t main_addr) /* move to main addr */ - HDassert(entry_ptr->addr == entry_ptr->alt_addr); + assert(entry_ptr->addr == entry_ptr->alt_addr); done = FALSE; old_addr = entry_ptr->addr; @@ -3096,10 +3096,10 @@ move_entry(H5C_t *cache_ptr, int32_t type, int32_t idx, hbool_t main_addr) } } - HDassert(((entry_ptr->header).type)->id == type); + assert(((entry_ptr->header).type)->id == type); - HDassert(entry_ptr->header.is_dirty); - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->header.is_dirty); + assert(entry_ptr->is_dirty); } } /* move_entry() */ @@ -3130,18 +3130,18 @@ protect_entry(H5F_t *file_ptr, int32_t type, int32_t idx) if (pass) { cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr); - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert(cache_ptr); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); baddrs = base_addrs[type]; - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); - HDassert(!(entry_ptr->is_protected)); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); + assert(!(entry_ptr->is_protected)); /* Set the base address of the entry type into the property list as tag */ /* Use to cork entries for the object */ @@ -3186,7 +3186,7 @@ protect_entry(H5F_t *file_ptr, int32_t type, int32_t idx) } /* end if */ else { - HDassert((entry_ptr->cache_ptr == NULL) || (entry_ptr->cache_ptr == cache_ptr)); + assert((entry_ptr->cache_ptr == NULL) || (entry_ptr->cache_ptr == cache_ptr)); entry_ptr->cache_ptr = cache_ptr; entry_ptr->file_ptr = file_ptr; @@ -3197,7 +3197,7 @@ protect_entry(H5F_t *file_ptr, int32_t type, int32_t idx) if (entry_ptr->header.tag_info && entry_ptr->header.tag_info->corked) entry_ptr->is_corked = TRUE; - HDassert(((entry_ptr->header).type)->id == type); + assert(((entry_ptr->header).type)->id == type); } /* end if */ } /* protect_entry() */ @@ -3230,18 +3230,17 @@ protect_entry_ro(H5F_t *file_ptr, int32_t type, int32_t idx) cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr); - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert(cache_ptr); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); - HDassert((!(entry_ptr->is_protected)) || - ((entry_ptr->is_read_only) && (entry_ptr->ro_ref_count > 0))); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); + assert((!(entry_ptr->is_protected)) || ((entry_ptr->is_read_only) && (entry_ptr->ro_ref_count > 0))); cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, types[type], entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); @@ -3256,7 +3255,7 @@ protect_entry_ro(H5F_t *file_ptr, int32_t type, int32_t idx) } else { - HDassert((entry_ptr->cache_ptr == NULL) || (entry_ptr->cache_ptr == cache_ptr)); + assert((entry_ptr->cache_ptr == NULL) || (entry_ptr->cache_ptr == cache_ptr)); entry_ptr->cache_ptr = cache_ptr; entry_ptr->file_ptr = file_ptr; @@ -3265,7 +3264,7 @@ protect_entry_ro(H5F_t *file_ptr, int32_t type, int32_t idx) entry_ptr->ro_ref_count++; } - HDassert(((entry_ptr->header).type)->id == type); + assert(((entry_ptr->header).type)->id == type); } } /* protect_entry_ro() */ @@ -3288,8 +3287,8 @@ protect_entry_ro(H5F_t *file_ptr, int32_t type, int32_t idx) void pin_entry(int32_t type, int32_t idx) { - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); if (pass) { test_entry_t *base_addr; @@ -3299,11 +3298,11 @@ pin_entry(int32_t type, int32_t idx) base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); - HDassert(entry_ptr->is_protected); - HDassert(!(entry_ptr->pinned_from_client)); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); + assert(entry_ptr->is_protected); + assert(!(entry_ptr->pinned_from_client)); result = H5C_pin_protected_entry((void *)entry_ptr); @@ -3349,19 +3348,19 @@ unpin_entry(int32_t type, int32_t idx) test_entry_t *entry_ptr; if (pass) { - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); - HDassert(entry_ptr->header.is_pinned); - HDassert(entry_ptr->header.pinned_from_client); - HDassert(entry_ptr->is_pinned); - HDassert(entry_ptr->pinned_from_client); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); + assert(entry_ptr->header.is_pinned); + assert(entry_ptr->header.pinned_from_client); + assert(entry_ptr->is_pinned); + assert(entry_ptr->pinned_from_client); result = H5C_unpin_entry(entry_ptr); @@ -3378,7 +3377,7 @@ unpin_entry(int32_t type, int32_t idx) entry_ptr->is_pinned = entry_ptr->pinned_from_cache; - HDassert(((entry_ptr->header).type)->id == type); + assert(((entry_ptr->header).type)->id == type); } } /* unpin_entry() */ @@ -3408,24 +3407,24 @@ unprotect_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags) test_entry_t *entry_ptr; if (pass) { - HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= idx) && (idx <= max_indices[type])); + assert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert(entry_ptr->index == idx); - HDassert(entry_ptr->type == type); - HDassert(entry_ptr == entry_ptr->self); - HDassert(entry_ptr->header.is_protected); - HDassert(entry_ptr->is_protected); + assert(entry_ptr->index == idx); + assert(entry_ptr->type == type); + assert(entry_ptr == entry_ptr->self); + assert(entry_ptr->header.is_protected); + assert(entry_ptr->is_protected); pin_flag_set = (hbool_t)((flags & H5C__PIN_ENTRY_FLAG) != 0); unpin_flag_set = (hbool_t)((flags & H5C__UNPIN_ENTRY_FLAG) != 0); - HDassert(!(pin_flag_set && unpin_flag_set)); - HDassert((!pin_flag_set) || (!(entry_ptr->is_pinned))); - HDassert((!unpin_flag_set) || (entry_ptr->is_pinned)); + assert(!(pin_flag_set && unpin_flag_set)); + assert((!pin_flag_set) || (!(entry_ptr->is_pinned))); + assert((!unpin_flag_set) || (entry_ptr->is_pinned)); if (flags & H5C__DIRTIED_FLAG) { hbool_t was_dirty = entry_ptr->is_dirty; @@ -3465,29 +3464,29 @@ unprotect_entry(H5F_t *file_ptr, int32_t type, int32_t idx, unsigned int flags) if (pin_flag_set) { - HDassert(entry_ptr->header.is_pinned); + assert(entry_ptr->header.is_pinned); entry_ptr->pinned_from_client = TRUE; entry_ptr->is_pinned = TRUE; } else if (unpin_flag_set) { - HDassert(entry_ptr->header.is_pinned == entry_ptr->header.pinned_from_cache); + assert(entry_ptr->header.is_pinned == entry_ptr->header.pinned_from_cache); entry_ptr->pinned_from_client = FALSE; entry_ptr->is_pinned = entry_ptr->pinned_from_cache; } } - HDassert(((entry_ptr->header).type)->id == type); + assert(((entry_ptr->header).type)->id == type); if ((flags & H5C__DIRTIED_FLAG) != 0 && ((flags & H5C__DELETED_FLAG) == 0)) { - HDassert(entry_ptr->header.is_dirty); - HDassert(entry_ptr->is_dirty); + assert(entry_ptr->header.is_dirty); + assert(entry_ptr->is_dirty); } - HDassert(entry_ptr->header.is_protected == entry_ptr->is_protected); - HDassert(entry_ptr->header.is_read_only == entry_ptr->is_read_only); - HDassert(entry_ptr->header.ro_ref_count == entry_ptr->ro_ref_count); + assert(entry_ptr->header.is_protected == entry_ptr->is_protected); + assert(entry_ptr->header.is_read_only == entry_ptr->is_read_only); + assert(entry_ptr->header.ro_ref_count == entry_ptr->ro_ref_count); } } /* unprotect_entry() */ @@ -3522,8 +3521,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t if (pass) { cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr != NULL); - HDassert(lag >= 10); + assert(cache_ptr != NULL); + assert(lag >= 10); if (reset_stats) H5C_stats__reset(cache_ptr); @@ -3548,8 +3547,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t insert_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx--; @@ -3560,8 +3558,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t protect_entry(file_ptr, type, tmp_idx); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx--; @@ -3572,8 +3569,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ /* (don't decrement tmp_idx) */ @@ -3584,8 +3580,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t move_entry(cache_ptr, type, tmp_idx, move_to_main_addr); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx--; @@ -3596,8 +3591,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t protect_entry(file_ptr, type, tmp_idx); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx -= 2; @@ -3608,8 +3602,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ if (do_mult_ro_protects) { @@ -3621,8 +3614,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t protect_entry_ro(file_ptr, type, tmp_idx); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx--; @@ -3633,8 +3626,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t protect_entry_ro(file_ptr, type, tmp_idx); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx--; @@ -3645,8 +3638,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t protect_entry_ro(file_ptr, type, tmp_idx); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ /* (don't decrement tmp_idx) */ @@ -3657,8 +3650,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx--; @@ -3669,8 +3662,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx--; @@ -3681,8 +3674,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ } /* if ( do_mult_ro_protects ) */ @@ -3692,8 +3685,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t protect_entry(file_ptr, type, idx); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx = idx - lag + 2; @@ -3704,8 +3696,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ tmp_idx--; @@ -3716,8 +3707,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t protect_entry(file_ptr, type, tmp_idx); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ if (do_destroys) { @@ -3730,8 +3720,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); break; case 1: @@ -3741,8 +3731,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ else { if (verbose) @@ -3751,8 +3741,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end else */ break; @@ -3762,8 +3752,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); break; case 3: @@ -3773,8 +3763,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ else { if (verbose) @@ -3784,13 +3774,13 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t (dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | H5C__DELETED_FLAG); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end else */ break; default: - HDassert(0); /* this can't happen... */ + assert(0); /* this can't happen... */ break; } /* end switch */ } /* end if */ @@ -3804,8 +3794,8 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); - HDassert((!cache_ptr->slist_enabled) || - (cache_ptr->slist_size == cache_ptr->dirty_index_size)); + assert((!cache_ptr->slist_enabled) || + (cache_ptr->slist_size == cache_ptr->dirty_index_size)); } /* end if */ } /* end elseif */ @@ -3856,10 +3846,10 @@ hl_row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr != NULL); - HDassert(lag > 5); - HDassert(max_index >= 200); - HDassert(max_index <= MAX_ENTRIES); + assert(cache_ptr != NULL); + assert(lag > 5); + assert(max_index >= 200); + assert(max_index <= MAX_ENTRIES); if (reset_stats) { @@ -3948,8 +3938,8 @@ row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr != NULL); - HDassert(lag >= 10); + assert(cache_ptr != NULL); + assert(lag >= 10); if (reset_stats) { @@ -4143,7 +4133,7 @@ row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t break; default: - HDassert(0); /* this can't happen... */ + assert(0); /* this can't happen... */ break; } } @@ -4208,10 +4198,10 @@ hl_row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr != NULL); - HDassert(lag > 5); - HDassert(max_index >= 200); - HDassert(max_index <= MAX_ENTRIES); + assert(cache_ptr != NULL); + assert(lag > 5); + assert(max_index >= 200); + assert(max_index <= MAX_ENTRIES); if (reset_stats) { @@ -4303,7 +4293,7 @@ col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t for (i = 0; i < NUMBER_OF_ENTRY_TYPES; i++) local_max_index[i] = MIN(max_index, max_indices[i]); - HDassert(lag > 5); + assert(lag > 5); if (reset_stats) { @@ -4393,10 +4383,10 @@ hl_col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr != NULL); - HDassert(lag > 5); - HDassert(max_index >= 500); - HDassert(max_index <= MAX_ENTRIES); + assert(cache_ptr != NULL); + assert(lag > 5); + assert(max_index >= 500); + assert(max_index <= MAX_ENTRIES); if (reset_stats) { @@ -4496,12 +4486,12 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr != NULL); + assert(cache_ptr != NULL); for (i = 0; i < NUMBER_OF_ENTRY_TYPES; i++) local_max_index[i] = MIN(max_index, max_indices[i]); - HDassert(lag > 5); + assert(lag > 5); if (reset_stats) { @@ -4600,10 +4590,10 @@ hl_col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr != NULL); - HDassert(lag > 5); - HDassert(max_index >= 500); - HDassert(max_index <= MAX_ENTRIES); + assert(cache_ptr != NULL); + assert(lag > 5); + assert(max_index >= 500); + assert(max_index <= MAX_ENTRIES); local_max_index = MIN(max_index, MAX_ENTRIES); @@ -4687,10 +4677,10 @@ hl_col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, void create_flush_dependency(int32_t par_type, int32_t par_idx, int32_t chd_type, int32_t chd_idx) { - HDassert((0 <= par_type) && (par_type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= par_idx) && (par_idx <= max_indices[par_type])); - HDassert((0 <= chd_type) && (chd_type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= chd_idx) && (chd_idx <= max_indices[chd_type])); + assert((0 <= par_type) && (par_type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= par_idx) && (par_idx <= max_indices[par_type])); + assert((0 <= chd_type) && (chd_type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= chd_idx) && (chd_idx <= max_indices[chd_type])); if (pass) { test_entry_t *par_base_addr; /* Base entry of parent's entry array */ @@ -4706,19 +4696,19 @@ create_flush_dependency(int32_t par_type, int32_t par_idx, int32_t chd_type, int par_is_pinned = par_entry_ptr->header.is_pinned; /* Sanity check parent entry */ - HDassert(par_entry_ptr->index == par_idx); - HDassert(par_entry_ptr->type == par_type); - HDassert(par_entry_ptr->header.is_protected); - HDassert(par_entry_ptr == par_entry_ptr->self); + assert(par_entry_ptr->index == par_idx); + assert(par_entry_ptr->type == par_type); + assert(par_entry_ptr->header.is_protected); + assert(par_entry_ptr == par_entry_ptr->self); /* Get parent entry */ chd_base_addr = entries[chd_type]; chd_entry_ptr = &(chd_base_addr[chd_idx]); /* Sanity check child entry */ - HDassert(chd_entry_ptr->index == chd_idx); - HDassert(chd_entry_ptr->type == chd_type); - HDassert(chd_entry_ptr == chd_entry_ptr->self); + assert(chd_entry_ptr->index == chd_idx); + assert(chd_entry_ptr->type == chd_type); + assert(chd_entry_ptr == chd_entry_ptr->self); result = H5C_create_flush_dependency(par_entry_ptr, chd_entry_ptr); @@ -4730,13 +4720,13 @@ create_flush_dependency(int32_t par_type, int32_t par_idx, int32_t chd_type, int } /* end if */ /* Update information about entries */ - HDassert(chd_entry_ptr->flush_dep_npar < MAX_FLUSH_DEP_PARS); + assert(chd_entry_ptr->flush_dep_npar < MAX_FLUSH_DEP_PARS); chd_entry_ptr->flush_dep_par_type[chd_entry_ptr->flush_dep_npar] = par_type; chd_entry_ptr->flush_dep_par_idx[chd_entry_ptr->flush_dep_npar] = par_idx; chd_entry_ptr->flush_dep_npar++; par_entry_ptr->flush_dep_nchd++; if (chd_entry_ptr->is_dirty || chd_entry_ptr->flush_dep_ndirty_chd > 0) { - HDassert(par_entry_ptr->flush_dep_ndirty_chd < par_entry_ptr->flush_dep_nchd); + assert(par_entry_ptr->flush_dep_ndirty_chd < par_entry_ptr->flush_dep_nchd); par_entry_ptr->flush_dep_ndirty_chd++; } /* end if */ par_entry_ptr->pinned_from_cache = TRUE; @@ -4763,10 +4753,10 @@ create_flush_dependency(int32_t par_type, int32_t par_idx, int32_t chd_type, int void destroy_flush_dependency(int32_t par_type, int32_t par_idx, int32_t chd_type, int32_t chd_idx) { - HDassert((0 <= par_type) && (par_type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= par_idx) && (par_idx <= max_indices[par_type])); - HDassert((0 <= chd_type) && (chd_type < NUMBER_OF_ENTRY_TYPES)); - HDassert((0 <= chd_idx) && (chd_idx <= max_indices[chd_type])); + assert((0 <= par_type) && (par_type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= par_idx) && (par_idx <= max_indices[par_type])); + assert((0 <= chd_type) && (chd_type < NUMBER_OF_ENTRY_TYPES)); + assert((0 <= chd_idx) && (chd_idx <= max_indices[chd_type])); if (pass) { test_entry_t *par_base_addr; /* Base entry of parent's entry array */ @@ -4780,20 +4770,20 @@ destroy_flush_dependency(int32_t par_type, int32_t par_idx, int32_t chd_type, in par_entry_ptr = &(par_base_addr[par_idx]); /* Sanity check parent entry */ - HDassert(par_entry_ptr->is_pinned); - HDassert(par_entry_ptr->pinned_from_cache); - HDassert(par_entry_ptr->flush_dep_nchd > 0); - HDassert(par_entry_ptr == par_entry_ptr->self); + assert(par_entry_ptr->is_pinned); + assert(par_entry_ptr->pinned_from_cache); + assert(par_entry_ptr->flush_dep_nchd > 0); + assert(par_entry_ptr == par_entry_ptr->self); /* Get parent entry */ chd_base_addr = entries[chd_type]; chd_entry_ptr = &(chd_base_addr[chd_idx]); /* Sanity check child entry */ - HDassert(chd_entry_ptr->index == chd_idx); - HDassert(chd_entry_ptr->type == chd_type); - HDassert(chd_entry_ptr->flush_dep_npar > 0); - HDassert(chd_entry_ptr == chd_entry_ptr->self); + assert(chd_entry_ptr->index == chd_idx); + assert(chd_entry_ptr->type == chd_type); + assert(chd_entry_ptr->flush_dep_npar > 0); + assert(chd_entry_ptr == chd_entry_ptr->self); if (H5C_destroy_flush_dependency(par_entry_ptr, chd_entry_ptr) < 0) { pass = FALSE; @@ -4805,7 +4795,7 @@ destroy_flush_dependency(int32_t par_type, int32_t par_idx, int32_t chd_type, in if (chd_entry_ptr->flush_dep_par_type[i] == par_type && chd_entry_ptr->flush_dep_par_idx[i] == par_idx) break; - HDassert(i < chd_entry_ptr->flush_dep_npar); + assert(i < chd_entry_ptr->flush_dep_npar); if (i < chd_entry_ptr->flush_dep_npar - 1) HDmemmove(&chd_entry_ptr->flush_dep_par_type[i], &chd_entry_ptr->flush_dep_par_type[i + 1], (chd_entry_ptr->flush_dep_npar - i - 1) * sizeof(chd_entry_ptr->flush_dep_par_type[0])); @@ -4819,7 +4809,7 @@ destroy_flush_dependency(int32_t par_type, int32_t par_idx, int32_t chd_type, in par_entry_ptr->is_pinned = par_entry_ptr->pinned_from_client; } /* end if */ if (chd_entry_ptr->is_dirty || chd_entry_ptr->flush_dep_ndirty_chd > 0) { - HDassert(par_entry_ptr->flush_dep_ndirty_chd > 0); + assert(par_entry_ptr->flush_dep_ndirty_chd > 0); par_entry_ptr->flush_dep_ndirty_chd--; if (!par_entry_ptr->is_dirty && par_entry_ptr->flush_dep_ndirty_chd == 0) mark_flush_dep_clean(par_entry_ptr); @@ -4846,7 +4836,7 @@ static void mark_flush_dep_dirty(test_entry_t *entry_ptr) { /* Sanity checks */ - HDassert(entry_ptr); + assert(entry_ptr); /* Iterate over the parent entries */ if (entry_ptr->flush_dep_npar) { @@ -4860,7 +4850,7 @@ mark_flush_dep_dirty(test_entry_t *entry_ptr) par_entry_ptr = &(par_base_addr[entry_ptr->flush_dep_par_idx[u]]); /* Sanity check */ - HDassert(par_entry_ptr->flush_dep_ndirty_chd < par_entry_ptr->flush_dep_nchd); + assert(par_entry_ptr->flush_dep_ndirty_chd < par_entry_ptr->flush_dep_nchd); /* Adjust the parent's number of dirty children */ par_entry_ptr->flush_dep_ndirty_chd++; @@ -4887,8 +4877,8 @@ static void mark_flush_dep_clean(test_entry_t *entry_ptr) { /* Sanity checks */ - HDassert(entry_ptr); - HDassert(!entry_ptr->is_dirty && entry_ptr->flush_dep_ndirty_chd == 0); + assert(entry_ptr); + assert(!entry_ptr->is_dirty && entry_ptr->flush_dep_ndirty_chd == 0); /* Iterate over the parent entries */ if (entry_ptr->flush_dep_npar) { @@ -4902,7 +4892,7 @@ mark_flush_dep_clean(test_entry_t *entry_ptr) par_entry_ptr = &(par_base_addr[entry_ptr->flush_dep_par_idx[u]]); /* Sanity check */ - HDassert(par_entry_ptr->flush_dep_ndirty_chd > 0); + assert(par_entry_ptr->flush_dep_ndirty_chd > 0); /* Adjust the parent's number of dirty children */ par_entry_ptr->flush_dep_ndirty_chd--; @@ -5327,7 +5317,7 @@ dump_LRU(H5F_t * file_ptr) H5C_cache_entry_t * entry_ptr = NULL; H5C_t *cache_ptr = file_ptr->shared->cache; - HDassert(cache_ptr); + assert(cache_ptr); entry_ptr = cache_ptr->LRU_head_ptr; diff --git a/test/cache_common.h b/test/cache_common.h index 83c5e6a..b49601b 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -429,7 +429,7 @@ typedef struct test_entry_t { if ((entry_ptr) != (cache_ptr)->index[k]) { \ if ((entry_ptr)->ht_next) \ (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \ - HDassert((entry_ptr)->ht_prev != NULL); \ + assert((entry_ptr)->ht_prev != NULL); \ (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \ (cache_ptr)->index[k]->ht_prev = (entry_ptr); \ (entry_ptr)->ht_next = (cache_ptr)->index[k]; \ diff --git a/test/cache_image.c b/test/cache_image.c index b9b5a29..fc76ed6 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -112,9 +112,9 @@ create_datasets(hid_t file_id, int min_dset, int max_dset) if (show_progress) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - HDassert(0 <= min_dset); - HDassert(min_dset <= max_dset); - HDassert(max_dset < MAX_NUM_DSETS); + assert(0 <= min_dset); + assert(min_dset <= max_dset); + assert(max_dset < MAX_NUM_DSETS); /* create the datasets */ @@ -423,9 +423,9 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset) if (show_progress) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - HDassert(0 <= min_dset); - HDassert(min_dset <= max_dset); - HDassert(max_dset < MAX_NUM_DSETS); + assert(0 <= min_dset); + assert(min_dset <= max_dset); + assert(max_dset < MAX_NUM_DSETS); if (show_progress) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); @@ -1004,9 +1004,9 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) if (show_progress) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - HDassert(0 <= min_dset); - HDassert(min_dset <= max_dset); - HDassert(max_dset < MAX_NUM_DSETS); + assert(0 <= min_dset); + assert(min_dset <= max_dset); + assert(max_dset < MAX_NUM_DSETS); /* open the datasets */ @@ -6625,7 +6625,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) #if H5C_COLLECT_CACHE_STATS if (pass) { - HDassert(cache_ptr); + assert(cache_ptr); if (cache_ptr->images_loaded != 0) { @@ -7658,7 +7658,7 @@ evict_on_close_test(hbool_t H5_ATTR_PARALLEL_UNUSED single_file_vfd) if (verbose) { - HDassert(cache_ptr); + assert(cache_ptr); HDfprintf(stdout, "index size / index dirty size = %lld / %lld\n", (long long)(cache_ptr->index_size), (long long)(cache_ptr->dirty_index_size)); diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 226b526..1155110 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -582,7 +582,7 @@ test_compound(char *filename, hid_t fapl) /* Read the dataset */ s8 = (s1_t *)HDcalloc((size_t)(h_size[0] * h_size[1]), sizeof(s1_t)); - HDassert(s8); + assert(s8); if (H5Dread(dataset, s1_tid, s8_m_sid, s8_f_sid, H5P_DEFAULT, s8) < 0) { goto error; } @@ -715,7 +715,7 @@ test_compound(char *filename, hid_t fapl) h_size[0] = 2 * NX / 3 - f_offset[0]; h_size[1] = 2 * NY / 3 - f_offset[1]; s11 = (s4_t *)HDmalloc((size_t)h_size[0] * (size_t)h_size[1] * sizeof(s4_t)); - HDassert(s11); + assert(s11); /* Initialize */ for (i = 0; i < h_size[0] * h_size[1]; i++) { diff --git a/test/dsets.c b/test/dsets.c index c4693d1..d44a7ad 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -380,13 +380,13 @@ test_create(hid_t file) dims[0] = 256; dims[1] = 512; space = H5Screate_simple(2, dims, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create a small data space for compact dataset */ small_dims[0] = 16; small_dims[1] = 8; small_space = H5Screate_simple(2, small_dims, NULL); - HDassert(space >= 0); + assert(space >= 0); /* * Create a dataset using the default dataset creation properties. We're @@ -455,13 +455,13 @@ test_create(hid_t file) * layout. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - HDassert(create_parms >= 0); + assert(create_parms >= 0); /* Attempt to create a dataset with invalid chunk sizes */ csize[0] = dims[0] * 2; csize[1] = dims[1] * 2; status = H5Pset_chunk(create_parms, 2, csize); - HDassert(status >= 0); + assert(status >= 0); H5E_BEGIN_TRY { dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, create_parms, @@ -477,7 +477,7 @@ test_create(hid_t file) csize[0] = 5; csize[1] = 100; status = H5Pset_chunk(create_parms, 2, csize); - HDassert(status >= 0); + assert(status >= 0); dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, create_parms, H5P_DEFAULT); @@ -499,11 +499,11 @@ test_create(hid_t file) * Create a compact dataset, then close it. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - HDassert(create_parms >= 0); + assert(create_parms >= 0); status = H5Pset_layout(create_parms, H5D_COMPACT); - HDassert(status >= 0); + assert(status >= 0); status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); - HDassert(status >= 0); + assert(status >= 0); dataset = H5Dcreate2(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT, create_parms, H5P_DEFAULT); @@ -576,7 +576,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) /* Create a small conversion buffer to test strip mining */ tconv_buf = HDmalloc((size_t)1000); xfer = H5Pcreate(H5P_DATASET_XFER); - HDassert(xfer >= 0); + assert(xfer >= 0); if (H5Pset_buffer(xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error; @@ -7850,7 +7850,7 @@ make_random_offset_and_increment(long nelts, long *offsetp, long *incp) long inc; long maxinc; - HDassert(0 < nelts); + assert(0 < nelts); *offsetp = HDrandom() % nelts; @@ -7907,7 +7907,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) TESTING(testname); - HDassert(NPOINTS < 100); + assert(NPOINTS < 100); h5_fixname(FILENAME[6], fapl, filename, sizeof filename); @@ -7953,7 +7953,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long); H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long); ofs = (ofs + inc) % (rows * cols); - HDassert(!check2[chunk_row][chunk_col]); + assert(!check2[chunk_row][chunk_col]); wbuf[i] = check2[chunk_row][chunk_col] = chunk_row + chunk_col + 1; coord[i][0] = (hsize_t)chunk_row * csize[0]; @@ -8113,7 +8113,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long); H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long); ofs = (ofs + inc) % (rows * cols); - HDassert(!check2[chunk_row][chunk_col]); + assert(!check2[chunk_row][chunk_col]); wbuf[i] = check2[chunk_row][chunk_col] = chunk_row + chunk_col + 1; coord[i][0] = (hsize_t)chunk_row * csize[0]; @@ -8251,7 +8251,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long); H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long); ofs = (ofs + inc) % (rows * cols); - HDassert(!check2[chunk_row][chunk_col]); + assert(!check2[chunk_row][chunk_col]); wbuf[i] = check2[chunk_row][chunk_col] = chunk_row + chunk_col + 1; coord[i][0] = (hsize_t)chunk_row * csize[0]; @@ -8428,13 +8428,13 @@ test_deprec(hid_t file) dims[0] = 256; dims[1] = 512; space = H5Screate_simple(2, dims, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create a small data space for compact dataset */ small_dims[0] = 16; small_dims[1] = 8; small_space = H5Screate_simple(2, small_dims, NULL); - HDassert(space >= 0); + assert(space >= 0); /* * Create a dataset using the default dataset creation properties. We're @@ -8493,7 +8493,7 @@ test_deprec(hid_t file) * layout. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - HDassert(create_parms >= 0); + assert(create_parms >= 0); /* Add the deflate filter, if available */ #if defined H5_HAVE_FILTER_DEFLATE @@ -8529,7 +8529,7 @@ test_deprec(hid_t file) csize[0] = dims[0] * 2; csize[1] = dims[1] * 2; status = H5Pset_chunk(create_parms, 2, csize); - HDassert(status >= 0); + assert(status >= 0); H5E_BEGIN_TRY { dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms); @@ -8544,7 +8544,7 @@ test_deprec(hid_t file) csize[0] = 5; csize[1] = 100; status = H5Pset_chunk(create_parms, 2, csize); - HDassert(status >= 0); + assert(status >= 0); if ((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms)) < 0) goto error; @@ -8569,11 +8569,11 @@ test_deprec(hid_t file) * Create a compact dataset, then close it. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); - HDassert(create_parms >= 0); + assert(create_parms >= 0); status = H5Pset_layout(create_parms, H5D_COMPACT); - HDassert(status >= 0); + assert(status >= 0); status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); - HDassert(status >= 0); + assert(status >= 0); if ((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_COMPACT, H5T_NATIVE_DOUBLE, small_space, create_parms)) < 0) @@ -10881,7 +10881,7 @@ test_fixed_array(hid_t fapl) H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long); H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long); ofs = (ofs + inc) % (rows * cols); - HDassert(!chunks[chunk_row][chunk_col]); + assert(!chunks[chunk_row][chunk_col]); wbuf[i] = chunks[chunk_row][chunk_col] = chunk_row + chunk_col + 1; coord[i][0] = (hsize_t)chunk_row * chunk_dim2[0]; @@ -11031,7 +11031,7 @@ test_fixed_array(hid_t fapl) H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long); H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long); ofs = (ofs + inc) % (rows * cols); - HDassert(!chunks_big[chunk_row][chunk_col]); + assert(!chunks_big[chunk_row][chunk_col]); wbuf_big[i] = chunks_big[chunk_row][chunk_col] = chunk_row + chunk_col + 1; coord_big[i][0] = (hsize_t)chunk_row * chunk_dim2[0]; @@ -13254,7 +13254,7 @@ scatter_cb(void **src_buf /*out*/, size_t *src_buf_bytes_used /*out*/, void *_sc /* Calculate number of elements */ nelmts = MIN(scatter_info->block, scatter_info->size); - HDassert(nelmts > 0); + assert(nelmts > 0); /* Set output variables */ *src_buf = (void *)scatter_info->src_buf; @@ -13553,7 +13553,7 @@ gather_cb(const void *dst_buf, size_t dst_buf_bytes_used, void *_gather_info) size_t nelmts; /* Number of elements in src_buf */ int i; /* Local index variable */ - HDassert(dst_buf_bytes_used > 0); + assert(dst_buf_bytes_used > 0); /* Calculate number of elements */ nelmts = dst_buf_bytes_used / sizeof(gather_info->expect_dst_buf[0]); @@ -13915,7 +13915,7 @@ scatter_error_cb_fail(void **src_buf /*out*/, size_t *src_buf_bytes_used /*out*/ /* Calculate number of elements */ nelmts = MIN(scatter_info->block, scatter_info->size); - HDassert(nelmts > 0); + assert(nelmts > 0); /* Set output variables */ *src_buf = (void *)scatter_info->src_buf; @@ -13932,7 +13932,7 @@ scatter_error_cb_null(void **src_buf /*out*/, size_t *src_buf_bytes_used /*out*/ /* Calculate number of elements */ nelmts = MIN(scatter_info->block, scatter_info->size); - HDassert(nelmts > 0); + assert(nelmts > 0); /* Set output variables */ *src_buf = NULL; diff --git a/test/dt_arith.c b/test/dt_arith.c index 842aca7..af4078e 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -1805,7 +1805,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -1857,7 +1857,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -1910,7 +1910,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -1962,7 +1962,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2014,7 +2014,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2066,7 +2066,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2118,7 +2118,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2170,7 +2170,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2222,7 +2222,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -2274,13 +2274,13 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } /* Make certain that there isn't some weird number of destination bits */ - HDassert(dst_nbits % 8 == 0); + assert(dst_nbits % 8 == 0); /* Are the two results the same? */ for (k = (dst_size - (dst_nbits / 8)); k < dst_size; k++) @@ -2456,7 +2456,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } @@ -2510,7 +2510,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } @@ -2554,7 +2554,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } @@ -2625,7 +2625,7 @@ test_conv_int_2(void) HDfflush(stdout); buf = (char *)HDcalloc(TMP_BUF_DIM1, TMP_BUF_DIM2); - HDassert(buf); + assert(buf); for (i = 1; i <= TMP_BUF_DIM1; i++) { for (j = 1; j <= TMP_BUF_DIM1; j++) { @@ -3308,7 +3308,7 @@ done: HDexit(MIN((int)fails_all_tests, 254)); else if (run_test == TEST_DENORM || run_test == TEST_SPECIAL) HDexit(EXIT_SUCCESS); - HDassert(0 && "Should not reach this point!"); + assert(0 && "Should not reach this point!"); return 1; #else /* Restore the default error handler (set in h5_reset()) */ @@ -3337,7 +3337,7 @@ error: HDexit(MIN(MAX((int)fails_all_tests, 1), 254)); else if (run_test == TEST_DENORM || run_test == TEST_SPECIAL) HDexit(EXIT_FAILURE); - HDassert(0 && "Should not reach this point!"); + assert(0 && "Should not reach this point!"); return 1; #else /* Restore the default error handler (set in h5_reset()) */ @@ -3765,7 +3765,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3817,7 +3817,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3869,7 +3869,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3900,7 +3900,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3931,7 +3931,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3962,7 +3962,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -3993,7 +3993,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4024,7 +4024,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4055,7 +4055,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4086,7 +4086,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4117,7 +4117,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4148,7 +4148,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } @@ -4179,13 +4179,13 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } } /* Make certain that there isn't some weird number of destination bits */ - HDassert(dst_nbits % 8 == 0); + assert(dst_nbits % 8 == 0); /* For Intel machines, the size of "long double" is 12 bytes, precision * is 80 bits; for AMD processors, the size of "long double" is 16 bytes, @@ -4382,7 +4382,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } @@ -4445,7 +4445,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } @@ -4495,7 +4495,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; case OTHER: default: - HDassert(0 && "Unknown type"); + assert(0 && "Unknown type"); break; } @@ -4552,7 +4552,7 @@ error: if (run_test == TEST_NORMAL) return MAX((int)fails_all_tests, 1); else { - HDassert(run_test == TEST_DENORM || run_test == TEST_SPECIAL); + assert(run_test == TEST_DENORM || run_test == TEST_SPECIAL); return 1; } } diff --git a/test/dtypes.c b/test/dtypes.c index ead76de..f6f99da 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -3766,7 +3766,7 @@ test_compound_18(void) /* Create compound datatype, but don't insert fields */ tid = H5Tcreate(H5T_COMPOUND, (size_t)8); - HDassert(tid > 0); + assert(tid > 0); /* Attempt to create file with compound datatype that has no fields */ /* Create File */ @@ -3776,7 +3776,7 @@ test_compound_18(void) /* Create a dataspace to use */ sid = H5Screate_simple(1, &dim, NULL); - HDassert(sid > 0); + assert(sid > 0); /* Create a dataset with the bad compound datatype */ H5E_BEGIN_TRY @@ -3791,7 +3791,7 @@ test_compound_18(void) /* Create a group */ gid = H5Gcreate2(file, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(gid > 0); + assert(gid > 0); /* Create an attribute with the bad compound datatype */ H5E_BEGIN_TRY @@ -5352,7 +5352,7 @@ test_conv_enum_2(void) /* Destination enum type */ dsttype = H5Tenum_create(H5T_NATIVE_INT); - HDassert(H5Tget_size(dsttype) > H5Tget_size(srctype)); + assert(H5Tget_size(dsttype) > H5Tget_size(srctype)); for (i = 0; i < 8; i++) H5Tenum_insert(dsttype, mname[i], &i); @@ -7608,11 +7608,11 @@ create_del_obj_named_test_file(const char *filename, hid_t fapl, H5F_libver_t lo /* Make copy of FAPL */ my_fapl = H5Pcopy(fapl); - HDassert(my_fapl > 0); + assert(my_fapl > 0); /* Use low/high version of file format */ status = H5Pset_libver_bounds(my_fapl, low, high); - HDassert(status >= 0); + assert(status >= 0); /* Set new format flag. Note: the case high < low should be caught in the caller */ use_at_least_v18 = 0; @@ -7621,80 +7621,80 @@ create_del_obj_named_test_file(const char *filename, hid_t fapl, H5F_libver_t lo /* Create a file creation property list (used for the root group's creation property list) */ fcpl = H5Pcreate(H5P_FILE_CREATE); - HDassert(fcpl > 0); + assert(fcpl > 0); if (use_at_least_v18) { /* Use dense link storage for all links in root group */ status = H5Pset_link_phase_change(fcpl, 0, 0); - HDassert(status >= 0); + assert(status >= 0); } /* end if */ /* Create file with attribute that uses committed datatype */ file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, my_fapl); - HDassert(file > 0); + assert(file > 0); /* Close FCPL */ status = H5Pclose(fcpl); - HDassert(status >= 0); + assert(status >= 0); /* Close FAPL */ status = H5Pclose(my_fapl); - HDassert(status >= 0); + assert(status >= 0); /* Create datatype to commit */ type = H5Tvlen_create(H5T_NATIVE_INT); - HDassert(type > 0); + assert(type > 0); /* Commit datatype */ status = H5Tcommit2(file, DEL_OBJ_NAMED_NAMED_DTYPE, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(status >= 0); + assert(status >= 0); /* Create scalar dataspace */ space = H5Screate(H5S_SCALAR); - HDassert(space > 0); + assert(space > 0); /* Create a dataset creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - HDassert(dcpl > 0); + assert(dcpl > 0); if (use_at_least_v18) { /* Use dense attribute storage for all attributes on dataset */ status = H5Pset_attr_phase_change(dcpl, 0, 0); - HDassert(status >= 0); + assert(status >= 0); } /* end if */ /* Create dataset */ dset = H5Dcreate2(file, DEL_OBJ_NAMED_DATASET, type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); - HDassert(dset > 0); + assert(dset > 0); /* Close DCPL */ status = H5Pclose(dcpl); - HDassert(status >= 0); + assert(status >= 0); /* Close dataset */ status = H5Dclose(dset); - HDassert(status >= 0); + assert(status >= 0); /* Create attribute */ attr = H5Acreate_by_name(file, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(attr > 0); + assert(attr > 0); /* Close dataspace */ status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); /* Close datatype */ status = H5Tclose(type); - HDassert(status >= 0); + assert(status >= 0); /* Close attribute */ status = H5Aclose(attr); - HDassert(status >= 0); + assert(status >= 0); /* Close file */ status = H5Fclose(file); - HDassert(status >= 0); + assert(status >= 0); } /* end create_del_obj_named_test_file() */ /*------------------------------------------------------------------------- diff --git a/test/earray.c b/test/earray.c index 5e0fdef..0ce1b32 100644 --- a/test/earray.c +++ b/test/earray.c @@ -230,7 +230,7 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) /* Allocate information for each super block */ tparam->sblk_info = (H5EA_sblk_info_t *)HDmalloc(sizeof(H5EA_sblk_info_t) * tparam->nsblks); - HDassert(tparam->sblk_info); + assert(tparam->sblk_info); /* Compute information about each super block */ start_idx = 0; @@ -1301,7 +1301,7 @@ eiter_fw_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_para /* Allocate space for the element iteration object */ eiter = (eiter_fw_t *)HDmalloc(sizeof(eiter_fw_t)); - HDassert(eiter); + assert(eiter); /* Initialize the element iteration object */ eiter->idx = 0; @@ -1331,7 +1331,7 @@ eiter_fw_next(void *in_eiter) hssize_t ret_val; /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Get the next array index to test */ ret_val = (hssize_t)eiter->idx++; @@ -1358,7 +1358,7 @@ eiter_fw_max(const void *in_eiter) const eiter_fw_t *eiter = (const eiter_fw_t *)in_eiter; /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Return the max. array index used */ return ((hssize_t)(eiter->idx - 1)); @@ -1384,10 +1384,10 @@ eiter_fw_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_pa eiter_fw_t *eiter = (eiter_fw_t *)in_eiter; /* Sanity check */ - HDassert(eiter); - HDassert(cparam); - HDassert(tparam); - HDassert(state); + assert(eiter); + assert(cparam); + assert(tparam); + assert(state); /* Compute the state of the extensible array */ state->hdr_size = EA_HDR_SIZE; @@ -1441,7 +1441,7 @@ static int eiter_fw_term(void *eiter) { /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Free iteration object */ HDfree(eiter); @@ -1488,7 +1488,7 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, hs /* Allocate space for the element iteration object */ eiter = (eiter_rv_t *)HDmalloc(sizeof(eiter_rv_t)); - HDassert(eiter); + assert(eiter); /* Initialize reverse iteration info */ eiter->idx = cnt - 1; @@ -1531,7 +1531,7 @@ eiter_rv_next(void *in_eiter) hssize_t ret_val; /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Get the next array index to test */ ret_val = (hssize_t)eiter->idx--; @@ -1558,7 +1558,7 @@ eiter_rv_max(const void *in_eiter) const eiter_rv_t *eiter = (const eiter_rv_t *)in_eiter; /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Return the max. array index used */ return ((hssize_t)eiter->max); @@ -1584,10 +1584,10 @@ eiter_rv_state(void *in_eiter, const H5EA_create_t *cparam, const earray_test_pa eiter_rv_t *eiter = (eiter_rv_t *)in_eiter; /* Sanity check */ - HDassert(eiter); - HDassert(cparam); - HDassert(tparam); - HDassert(state); + assert(eiter); + assert(cparam); + assert(tparam); + assert(state); /* Compute the state of the extensible array */ state->hdr_size = EA_HDR_SIZE; @@ -1666,7 +1666,7 @@ static int eiter_rv_term(void *eiter) { /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Free iteration object */ HDfree(eiter); @@ -1712,11 +1712,11 @@ eiter_rnd_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par /* Allocate space for the element iteration object */ eiter = (eiter_rnd_t *)HDmalloc(sizeof(eiter_rnd_t)); - HDassert(eiter); + assert(eiter); /* Allocate space for the array of shuffled indices */ eiter->idx = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)cnt); - HDassert(eiter->idx); + assert(eiter->idx); /* Initialize reverse iteration info */ eiter->max = 0; @@ -1761,7 +1761,7 @@ eiter_rnd_next(void *in_eiter) hssize_t ret_val; /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Get the next array index to test */ ret_val = (hssize_t)eiter->idx[eiter->pos]; @@ -1793,7 +1793,7 @@ eiter_rnd_max(const void *in_eiter) const eiter_rnd_t *eiter = (const eiter_rnd_t *)in_eiter; /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Return the max. array index used */ return ((hssize_t)eiter->max); @@ -1818,8 +1818,8 @@ eiter_rnd_term(void *in_eiter) eiter_rnd_t *eiter = (eiter_rnd_t *)in_eiter; /* Sanity check */ - HDassert(eiter); - HDassert(eiter->idx); + assert(eiter); + assert(eiter->idx); /* Free shuffled index array */ HDfree(eiter->idx); @@ -1861,11 +1861,11 @@ eiter_rnd2_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_pa /* Allocate space for the element iteration object */ eiter = (eiter_rnd_t *)HDmalloc(sizeof(eiter_rnd_t)); - HDassert(eiter); + assert(eiter); /* Allocate space for the array of shuffled indices */ eiter->idx = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)cnt); - HDassert(eiter->idx); + assert(eiter->idx); /* Initialize reverse iteration info */ eiter->max = 0; @@ -1878,7 +1878,7 @@ eiter_rnd2_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_pa /* Allocate temporary index array */ tmp_idx = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)sparse_cnt); - HDassert(tmp_idx); + assert(tmp_idx); /* Initialize temporary index array, for shuffling */ for (u = 0; u < (size_t)sparse_cnt; u++) @@ -1943,7 +1943,7 @@ eiter_cyc_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par /* Allocate space for the element iteration object */ eiter = (eiter_cyc_t *)HDmalloc(sizeof(eiter_cyc_t)); - HDassert(eiter); + assert(eiter); /* Initialize reverse iteration info */ eiter->max = 0; @@ -1975,7 +1975,7 @@ eiter_cyc_next(void *in_eiter) hssize_t ret_val; /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Get the next array index to test */ ret_val = (hssize_t)eiter->pos; @@ -2009,7 +2009,7 @@ eiter_cyc_max(const void *in_eiter) const eiter_cyc_t *eiter = (const eiter_cyc_t *)in_eiter; /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Return the max. array index used */ return ((hssize_t)eiter->max); @@ -2034,7 +2034,7 @@ eiter_cyc_term(void *in_eiter) eiter_cyc_t *eiter = (eiter_cyc_t *)in_eiter; /* Sanity check */ - HDassert(eiter); + assert(eiter); /* Free iteration object */ HDfree(eiter); diff --git a/test/farray.c b/test/farray.c index 5448865..6a19e34 100644 --- a/test/farray.c +++ b/test/farray.c @@ -216,8 +216,8 @@ set_fa_state(const H5FA_create_t *cparam, farray_state_t *state) size_t dblk_page_nelmts; /* # of elements per page */ /* Sanity check */ - HDassert(cparam); - HDassert(state); + assert(cparam); + assert(state); /* Compute the state of the fixed array */ state->hdr_size = FA_HDR_SIZE; @@ -983,7 +983,7 @@ fiter_fw_init(const H5FA_create_t H5_ATTR_UNUSED *cparam, const farray_test_para /* Allocate space for the element iteration object */ fiter = (fiter_fw_t *)HDmalloc(sizeof(fiter_fw_t)); - HDassert(fiter); + assert(fiter); /* Initialize the element iteration object */ fiter->idx = 0; @@ -1009,7 +1009,7 @@ fiter_fw_next(void *_fiter) hssize_t ret_val; /* Sanity check */ - HDassert(fiter); + assert(fiter); /* Get the next array index to test */ ret_val = (hssize_t)fiter->idx++; @@ -1031,7 +1031,7 @@ static int fiter_term(void *fiter) { /* Sanity check */ - HDassert(fiter); + assert(fiter); /* Free iteration object */ HDfree(fiter); @@ -1069,7 +1069,7 @@ fiter_rv_init(const H5FA_create_t *cparam, const farray_test_param_t H5_ATTR_UNU /* Allocate space for the element iteration object */ fiter = (fiter_rv_t *)HDmalloc(sizeof(fiter_rv_t)); - HDassert(fiter); + assert(fiter); /* Initialize reverse iteration info */ fiter->idx = cparam->nelmts - 1; @@ -1095,7 +1095,7 @@ fiter_rv_next(void *_fiter) hssize_t ret_val; /* Sanity check */ - HDassert(fiter); + assert(fiter); /* Get the next array index to test */ ret_val = (hssize_t)fiter->idx--; @@ -1135,11 +1135,11 @@ fiter_rnd_init(const H5FA_create_t H5_ATTR_UNUSED *cparam, const farray_test_par /* Allocate space for the element iteration object */ fiter = (fiter_rnd_t *)HDmalloc(sizeof(fiter_rnd_t)); - HDassert(fiter); + assert(fiter); /* Allocate space for the array of shuffled indices */ fiter->idx = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)cnt); - HDassert(fiter->idx); + assert(fiter->idx); /* Initialize reverse iteration info */ fiter->pos = 0; @@ -1180,7 +1180,7 @@ fiter_rnd_next(void *_fiter) hssize_t ret_val; /* Sanity check */ - HDassert(fiter); + assert(fiter); /* Get the next array index to test */ ret_val = (hssize_t)fiter->idx[fiter->pos]; @@ -1205,8 +1205,8 @@ fiter_rnd_term(void *_fiter) fiter_rnd_t *fiter = (fiter_rnd_t *)_fiter; /* Sanity check */ - HDassert(fiter); - HDassert(fiter->idx); + assert(fiter); + assert(fiter->idx); /* Free shuffled index array */ HDfree(fiter->idx); @@ -1249,7 +1249,7 @@ fiter_cyc_init(const H5FA_create_t H5_ATTR_UNUSED *cparam, const farray_test_par /* Allocate space for the element iteration object */ fiter = (fiter_cyc_t *)HDmalloc(sizeof(fiter_cyc_t)); - HDassert(fiter); + assert(fiter); /* Initialize reverse iteration info */ fiter->pos = 0; @@ -1277,7 +1277,7 @@ fiter_cyc_next(void *_fiter) hssize_t ret_val; /* Sanity check */ - HDassert(fiter); + assert(fiter); /* Get the next array index to test */ ret_val = (hssize_t)fiter->pos; @@ -1356,7 +1356,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam, h hsize_t fa_nelmts; /* # of elements in fixed array */ haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */ - HDassert(nelmts); + assert(nelmts); /* * Display testing message */ diff --git a/test/fheap.c b/test/fheap.c index fb1c569..e9ce0a2 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -376,7 +376,7 @@ add_obj(H5HF_t *fh, size_t obj_off, size_t obj_size, fheap_heap_state_t *state, size_t robj_size; /* Object size read in */ /* Sanity check */ - HDassert(fh); + assert(fh); /* Initialize object buffer */ obj = &shared_wobj_g[obj_off]; @@ -510,7 +510,7 @@ get_fill_size(const fheap_test_param_t *tparam) case FHEAP_TEST_FILL_N: default: - HDassert(0 && "Unknown bulk fill type?!?"); + assert(0 && "Unknown bulk fill type?!?"); } /* end switch */ return (0); @@ -849,9 +849,9 @@ del_objs_half_refill(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_he size_t u; /* Local index variable */ /* Sanity check */ - HDassert(fh); - HDassert(*fh); - HDassert(keep_ids); + assert(fh); + assert(*fh); + assert(keep_ids); /* Check for closing & re-opening the heap */ if (tparam->reopen_heap) { @@ -940,10 +940,10 @@ del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_heap_state_t * size_t u; /* Local index variable */ /* Sanity check */ - HDassert(fh); - HDassert(*fh); - HDassert(state); - HDassert(keep_ids); + assert(fh); + assert(*fh); + assert(state); + assert(keep_ids); /* Check for first deleting half of objects & then re-inserting them */ if (tparam->drain_half == FHEAP_DEL_DRAIN_HALF) @@ -1037,9 +1037,9 @@ fill_heap(H5HF_t *fh, unsigned block_row, size_t obj_size, fheap_heap_state_t *s unsigned u; /* Local index variable */ /* Sanity check */ - HDassert(fh); - HDassert(state); - HDassert(obj_size + 256 < shared_obj_size_g); + assert(fh); + assert(state); + assert(obj_size + 256 < shared_obj_size_g); /* Initialize starting information */ data_size = (size_t)DBLOCK_FREE(fh, block_row); @@ -1236,8 +1236,8 @@ fill_root_row(H5HF_t *fh, unsigned row, size_t obj_size, fheap_heap_state_t *sta unsigned u; /* Local index variable */ /* Sanity check */ - HDassert(fh); - HDassert(state); + assert(fh); + assert(state); /* Get some information for the heap */ block_size = (size_t)DBLOCK_SIZE(fh, row); @@ -1325,8 +1325,8 @@ fill_partial_row(H5HF_t *fh, unsigned row, unsigned width, size_t obj_size, fhea unsigned u; /* Local index variable */ /* Sanity check */ - HDassert(fh); - HDassert(state); + assert(fh); + assert(state); /* Get some information for the heap */ block_size = (size_t)DBLOCK_SIZE(fh, row); @@ -1366,8 +1366,8 @@ static int fill_row(H5HF_t *fh, unsigned row, size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids) { /* Sanity check */ - HDassert(fh); - HDassert(state); + assert(fh); + assert(state); /* Fill the entire row (with the partial row fill routine) */ if (fill_partial_row(fh, row, DTABLE_WIDTH(fh), obj_size, state, keep_ids)) @@ -1405,7 +1405,7 @@ fill_root_direct(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_h /* Get heap info */ max_dblock_rows = DTABLE_MAX_DROWS(fh); - HDassert(max_dblock_rows); + assert(max_dblock_rows); /* Loop over rows */ for (row = 0; row < max_dblock_rows; row++) @@ -1444,7 +1444,7 @@ fill_2nd_indirect(H5HF_t *fh, unsigned pos, size_t obj_size, fheap_heap_state_t /* Get some information for the heap */ max_dblock_rows = IBLOCK_MAX_DROWS(fh, pos); - HDassert(max_dblock_rows); + assert(max_dblock_rows); /* Loop over rows */ for (row = 0; row < max_dblock_rows; row++) @@ -1481,7 +1481,7 @@ fill_all_direct(H5HF_t *fh, size_t obj_size, fheap_heap_state_t *state, fheap_he /* Get heap info */ max_dblock_rows = DTABLE_MAX_DROWS(fh); - HDassert(max_dblock_rows); + assert(max_dblock_rows); /* Loop over rows */ for (row = 0; row < max_dblock_rows; row++) @@ -15956,7 +15956,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) ret = H5HF_write(fh, huge_heap_id, &id_changed, shared_wobj_g); } H5E_END_TRY - HDassert(!id_changed); + assert(!id_changed); if (tparam->comp == FHEAP_TEST_COMPRESS) { if (ret >= 0) TEST_ERROR; @@ -15972,7 +15972,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) ret = H5HF_write(fh, tiny_heap_id, &id_changed, shared_wobj_g); } H5E_END_TRY - HDassert(!id_changed); + assert(!id_changed); if (ret >= 0) TEST_ERROR; @@ -16028,7 +16028,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) /* Overwrite data just written */ if (H5HF_write(fh, &keep_ids.ids[id_len * u], &id_changed, rewrite_obj) < 0) FAIL_STACK_ERROR; - HDassert(!id_changed); + assert(!id_changed); /* Read data back in */ if (H5HF_read(fh, &keep_ids.ids[id_len * u], shared_robj_g) < 0) diff --git a/test/fillval.c b/test/fillval.c index 52b15ff..d701521 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -970,7 +970,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f /* case for atomic datatype */ if (datatype == H5T_INTEGER) { /*check for overflow*/ - HDassert((nelmts * sizeof(int)) == (hsize_t)((size_t)(nelmts * sizeof(int)))); + assert((nelmts * sizeof(int)) == (hsize_t)((size_t)(nelmts * sizeof(int)))); buf = (int *)HDmalloc((size_t)(nelmts * sizeof(int))); if (H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0) @@ -996,7 +996,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f /* case for compound datatype */ else if (datatype == H5T_COMPOUND) { /*check for overflow*/ - HDassert((nelmts * sizeof(comp_datatype)) == (hsize_t)((size_t)(nelmts * sizeof(comp_datatype)))); + assert((nelmts * sizeof(comp_datatype)) == (hsize_t)((size_t)(nelmts * sizeof(comp_datatype)))); buf_c = (comp_datatype *)HDmalloc((size_t)nelmts * sizeof(comp_datatype)); if (H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, buf_c) < 0) @@ -1640,7 +1640,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t } /* end if */ else { /* Sanity check */ - HDassert(dtype_class == H5T_COMPOUND); + assert(dtype_class == H5T_COMPOUND); /* Initialize specific values for this datatype */ val_size = sizeof(comp_vl_datatype); @@ -1692,7 +1692,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t } /* end for */ /* Check for overflow */ - HDassert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size))); + assert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size))); /* Allocate & initialize buffer */ buf = HDmalloc((size_t)(nelmts * val_size)); diff --git a/test/freespace.c b/test/freespace.c index bd1737a..ad53693 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -198,8 +198,8 @@ TEST_sect_init_cls(H5FS_section_class_t *cls, void *_udata) unsigned *init_flags; /* Check arguments. */ - HDassert(cls); - HDassert(_udata); + assert(cls); + assert(_udata); init_flags = (unsigned *)_udata; cls->flags |= *init_flags; @@ -220,10 +220,10 @@ TEST_sect_can_merge(const H5FS_section_info_t *_sect1, const H5FS_section_info_t htri_t ret_value; /* Return value */ /* Check arguments. */ - HDassert(sect1); - HDassert(sect2); - HDassert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ - HDassert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); + assert(sect1); + assert(sect2); + assert(sect1->sect_info.type == sect2->sect_info.type); /* Checks "MERGE_SYM" flag */ + assert(H5_addr_lt(sect1->sect_info.addr, sect2->sect_info.addr)); /* Check if second section adjoins first section */ ret_value = H5_addr_eq(sect1->sect_info.addr + sect1->sect_info.size, sect2->sect_info.addr); @@ -242,15 +242,15 @@ TEST_sect_merging(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2, voi herr_t ret_value = SUCCEED; /* Return value */ /* Check arguments. */ - HDassert(sect1); - HDassert(((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE) || - ((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE_NEW) || - ((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE_NONE)); - HDassert(sect2); - HDassert((sect2->sect_info.type == TEST_FSPACE_SECT_TYPE) || - (sect2->sect_info.type == TEST_FSPACE_SECT_TYPE_NEW) || - (sect2->sect_info.type == TEST_FSPACE_SECT_TYPE_NONE)); - HDassert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); + assert(sect1); + assert(((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE) || + ((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE_NEW) || + ((*sect1)->sect_info.type == TEST_FSPACE_SECT_TYPE_NONE)); + assert(sect2); + assert((sect2->sect_info.type == TEST_FSPACE_SECT_TYPE) || + (sect2->sect_info.type == TEST_FSPACE_SECT_TYPE_NEW) || + (sect2->sect_info.type == TEST_FSPACE_SECT_TYPE_NONE)); + assert(H5_addr_eq((*sect1)->sect_info.addr + (*sect1)->sect_info.size, sect2->sect_info.addr)); /* Add second section's size to first section */ (*sect1)->sect_info.size += sect2->sect_info.size; @@ -334,8 +334,8 @@ TEST_sects_cb(H5FS_section_info_t *_sect, void *_udata) TEST_iter_ud_t *udata = (TEST_iter_ud_t *)_udata; herr_t ret_value = SUCCEED; /* Return value */ - HDassert(sect); - HDassert(udata); + assert(sect); + assert(udata); udata->tot_size += sect->sect_info.size; udata->tot_sect_count += 1; diff --git a/test/gen_cross.c b/test/gen_cross.c index 143451d..0d07ad1 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -1258,8 +1258,8 @@ main(void) /* Create memory space. This does not include the extra row for fill * values. */ - HDassert(dimsf[0] == NX); - HDassert(dimsf[1] == NY); + assert(dimsf[0] == NX); + assert(dimsf[1] == NY); if ((memspace = H5Screate_simple(RANK, dimsf, NULL)) < 0) TEST_ERROR; diff --git a/test/gen_new_super.c b/test/gen_new_super.c index 47d6d47..46855e7 100644 --- a/test/gen_new_super.c +++ b/test/gen_new_super.c @@ -48,10 +48,10 @@ main(void) /* Create a file creation property list */ fcpl = H5Pcreate(H5P_FILE_CREATE); - HDassert(fcpl >= 0); + assert(fcpl >= 0); ret = H5Pset_istore_k(fcpl, ISTORE_IK); - HDassert(ret >= 0); + assert(ret >= 0); /* Creating a file with the non-default file creation property list should * create a version 1 superblock @@ -59,15 +59,15 @@ main(void) /* Create file with custom file creation property list */ file = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT); - HDassert(file >= 0); + assert(file >= 0); /* Close FCPL */ ret = H5Pclose(fcpl); - HDassert(ret >= 0); + assert(ret >= 0); /* Close file */ ret = H5Fclose(file); - HDassert(ret >= 0); + assert(ret >= 0); return EXIT_SUCCESS; } diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c index 12e00d4..84e7398 100644 --- a/test/gen_nullspace.c +++ b/test/gen_nullspace.c @@ -41,42 +41,42 @@ main(void) /* Create the file */ fid = H5Fcreate(NULLFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid > 0); + assert(fid > 0); sid = H5Screate(H5S_NULL); - HDassert(sid > 0); + assert(sid > 0); /* Create dataset */ did = H5Dcreate2(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(did > 0); + assert(did > 0); /* Close the dataset */ ret = H5Dclose(did); - HDassert(ret >= 0); + assert(ret >= 0); /* Open the root group */ gid = H5Gopen2(fid, "/", H5P_DEFAULT); - HDassert(gid > 0); + assert(gid > 0); /* Create an attribute for the group */ attr = H5Acreate2(gid, NULLATTR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(attr > 0); + assert(attr > 0); /* Close attribute */ ret = H5Aclose(attr); - HDassert(ret >= 0); + assert(ret >= 0); /* Close the group */ ret = H5Gclose(gid); - HDassert(ret >= 0); + assert(ret >= 0); /* Close the dataspace */ ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); /* Close the file */ ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); return EXIT_SUCCESS; } diff --git a/test/gen_plist.c b/test/gen_plist.c index 5302dc7..0892755 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -457,23 +457,23 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil /* Generate filename */ if ((ret = HDsnprintf(filename, sizeof(filename), "%s%d%s", filename_prefix, word_length, little_endian ? "le" : "be")) < 0) - HDassert(ret > 0); + assert(ret > 0); /* first call to encode returns only the size of the buffer needed */ if ((ret = H5Pencode2(plist_id, NULL, &temp_size, H5P_DEFAULT)) < 0) - HDassert(ret > 0); + assert(ret > 0); temp_buf = (void *)HDmalloc(temp_size); - HDassert(temp_buf); + assert(temp_buf); if ((ret = H5Pencode2(plist_id, temp_buf, &temp_size, H5P_DEFAULT)) < 0) - HDassert(ret > 0); + assert(ret > 0); fd = HDopen(filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW); - HDassert(fd >= 0); + assert(fd >= 0); write_size = HDwrite(fd, temp_buf, temp_size); - HDassert(write_size == (ssize_t)temp_size); + assert(write_size == (ssize_t)temp_size); HDclose(fd); diff --git a/test/genall5.c b/test/genall5.c index 648dc92..64764c0 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -59,7 +59,7 @@ ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "ns_grp_0: H5Pcreate() failed"; } - HDassert(gcpl > 0); + assert(gcpl > 0); } if (pass) { @@ -69,7 +69,7 @@ ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -79,7 +79,7 @@ ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "ns_grp_0: H5Gcreate2() failed"; } - HDassert(gid > 0); + assert(gid > 0); } if (pass) { @@ -89,7 +89,7 @@ ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -99,7 +99,7 @@ ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "ns_grp_0: H5Gclose(gid) failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* ns_grp_0 */ @@ -139,7 +139,7 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed"; } - HDassert(gid > 0); + assert(gid > 0); } if (pass) { @@ -149,7 +149,7 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed"; } - HDassert(gcpl > 0); + assert(gcpl > 0); } if (pass) { @@ -163,8 +163,8 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags"; } - HDassert(ret >= 0); - HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags); + assert(ret >= 0); + assert(H5P_CRT_ORDER_TRACKED == crt_order_flags); } if (pass) { @@ -174,7 +174,7 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -202,11 +202,11 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) failure_mssg = "vrfy_ns_grp_0: FALSE != grp_info.mounted"; } - HDassert(ret >= 0); - HDassert(H5G_STORAGE_TYPE_COMPACT == grp_info.storage_type); - HDassert(0 == grp_info.nlinks); - HDassert(0 == grp_info.max_corder); - HDassert(FALSE == grp_info.mounted); + assert(ret >= 0); + assert(H5G_STORAGE_TYPE_COMPACT == grp_info.storage_type); + assert(0 == grp_info.nlinks); + assert(0 == grp_info.max_corder); + assert(FALSE == grp_info.mounted); } if (pass) { @@ -216,7 +216,7 @@ vrfy_ns_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_ns_grp_0: H5Gclose() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* vrfy_ns_grp_0() */ @@ -256,7 +256,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_c: H5Pcreate(H5P_GROUP_CREATE) failed"; } - HDassert(gcpl > 0); + assert(gcpl > 0); } if (pass) { @@ -266,7 +266,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_c: H5Pset_link_creation_order() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -276,7 +276,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_c: H5Gcreate2() failed"; } - HDassert(gid > 0); + assert(gid > 0); } if (pass) { @@ -296,9 +296,9 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) failure_mssg = "ns_grp_c: nlinks >= max_compact"; } - HDassert(ret >= 0); - HDassert(nlinks > 0); - HDassert(nlinks < max_compact); + assert(ret >= 0); + assert(nlinks > 0); + assert(nlinks < max_compact); } u = 0; @@ -314,7 +314,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_c: H5Lcreate_soft() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } /* end if */ else if (1 == (u % 3)) { ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT); @@ -323,17 +323,17 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_c: H5Lcreate_hard() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } /* end else-if */ else { - HDassert(2 == (u % 3)); + assert(2 == (u % 3)); ret = H5Lcreate_external("external.h5", "/ext", gid, linkname, H5P_DEFAULT, H5P_DEFAULT); if (ret < 0) { pass = FALSE; failure_mssg = "ns_grp_c: H5Lcreate_external() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } /* end else */ u++; @@ -346,7 +346,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_c: H5Pclose(gcpl) failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -356,7 +356,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_c: H5Gclose(gid) failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* ns_grp_c() */ @@ -397,7 +397,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5Gopen2() failed"; } - HDassert(gid > 0); + assert(gid > 0); } if (pass) { @@ -407,7 +407,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5Gget_create_plist(gid) failed"; } - HDassert(gcpl > 0); + assert(gcpl > 0); } if (pass) { @@ -421,8 +421,8 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags"; } - HDassert(ret >= 0); - HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags); + assert(ret >= 0); + assert(H5P_CRT_ORDER_TRACKED == crt_order_flags); } if (pass) { @@ -432,7 +432,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5Pclose() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -460,11 +460,11 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) failure_mssg = "vrfy_ns_grp_c: FALSE != grp_info.mounted"; } - HDassert(ret >= 0); - HDassert(H5G_STORAGE_TYPE_COMPACT == grp_info.storage_type); - HDassert(nlinks == grp_info.nlinks); - HDassert(nlinks == grp_info.max_corder); - HDassert(FALSE == grp_info.mounted); + assert(ret >= 0); + assert(H5G_STORAGE_TYPE_COMPACT == grp_info.storage_type); + assert(nlinks == grp_info.nlinks); + assert(nlinks == grp_info.max_corder); + assert(FALSE == grp_info.mounted); } u = 0; @@ -480,7 +480,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5Lexists() failed"; } - HDassert(link_exists >= 0); + assert(link_exists >= 0); HDmemset(&lnk_info, 0, sizeof(grp_info)); ret = H5Lget_info2(gid, linkname, &lnk_info, H5P_DEFAULT); @@ -501,10 +501,10 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5T_CSET_ASCII != lnk_info.cset"; } - HDassert(ret >= 0); - HDassert(TRUE == lnk_info.corder_valid); - HDassert(u == lnk_info.corder); - HDassert(H5T_CSET_ASCII == lnk_info.cset); + assert(ret >= 0); + assert(TRUE == lnk_info.corder_valid); + assert(u == lnk_info.corder); + assert(H5T_CSET_ASCII == lnk_info.cset); if (0 == (u % 3)) { char *slinkval; @@ -517,8 +517,8 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: (HDstrlen(group_name) + 1) != lnk_info.u.val_size"; } - HDassert(H5L_TYPE_SOFT == lnk_info.type); - HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size); + assert(H5L_TYPE_SOFT == lnk_info.type); + assert((HDstrlen(group_name) + 1) == lnk_info.u.val_size); slinkval = (char *)HDmalloc(lnk_info.u.val_size); @@ -526,7 +526,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: HDmalloc of slinkval failed"; } - HDassert(slinkval); + assert(slinkval); ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size, H5P_DEFAULT); if (ret < 0) { @@ -537,8 +537,8 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(slinkval, group_name)"; } - HDassert(ret >= 0); - HDassert(0 == HDstrcmp(slinkval, group_name)); + assert(ret >= 0); + assert(0 == HDstrcmp(slinkval, group_name)); HDfree(slinkval); } /* end if */ @@ -550,7 +550,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_HARD != lnk_info.type"; } - HDassert(H5L_TYPE_HARD == lnk_info.type); + assert(H5L_TYPE_HARD == lnk_info.type); HDmemset(&root_oinfo, 0, sizeof(root_oinfo)); ret = H5Oget_info3(fid, &root_oinfo, H5O_INFO_BASIC); @@ -570,21 +570,21 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) failure_mssg = "vrfy_ns_grp_c: root_oinfo.token != lnk_info.u.token"; } } - HDassert(ret >= 0); - HDassert(!token_cmp); + assert(ret >= 0); + assert(!token_cmp); } /* end else-if */ else { void *elinkval; const char *file = NULL; const char *path = NULL; - HDassert(2 == (u % 3)); + assert(2 == (u % 3)); if (H5L_TYPE_EXTERNAL != lnk_info.type) { pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type"; } - HDassert(H5L_TYPE_EXTERNAL == lnk_info.type); + assert(H5L_TYPE_EXTERNAL == lnk_info.type); elinkval = HDmalloc(lnk_info.u.val_size); @@ -592,14 +592,14 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: HDmalloc of elinkval failed."; } - HDassert(elinkval); + assert(elinkval); ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size, H5P_DEFAULT); if (ret < 0) { pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path); if (ret < 0) { @@ -614,9 +614,9 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(path, \"/ext\")"; } - HDassert(ret >= 0); - HDassert(0 == HDstrcmp(file, "external.h5")); - HDassert(0 == HDstrcmp(path, "/ext")); + assert(ret >= 0); + assert(0 == HDstrcmp(file, "external.h5")); + assert(0 == HDstrcmp(path, "/ext")); HDfree(elinkval); } /* end else */ @@ -631,7 +631,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_c: H5Gclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* vrfy_ns_grp_c() */ @@ -671,7 +671,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_d: H5Pcreate() failed."; } - HDassert(gcpl > 0); + assert(gcpl > 0); } if (pass) { @@ -681,7 +681,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -691,7 +691,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_d: H5Gcreate2() failed."; } - HDassert(gid > 0); + assert(gid > 0); } if (pass) { @@ -706,8 +706,8 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_d: nlinks <= max_compact"; } - HDassert(ret >= 0); - HDassert(nlinks > max_compact); + assert(ret >= 0); + assert(nlinks > max_compact); } u = 0; @@ -723,7 +723,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_d: H5Lcreate_soft() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } /* end if */ else if (1 == (u % 3)) { ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT); @@ -732,10 +732,10 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_d: H5Lcreate_hard() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } /* end else-if */ else { - HDassert(2 == (u % 3)); + assert(2 == (u % 3)); ret = H5Lcreate_external("external.h5", "/ext", gid, linkname, H5P_DEFAULT, H5P_DEFAULT); @@ -743,7 +743,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_d: H5Lcreate_external() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } /* end else */ u++; @@ -756,7 +756,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_d: H5Pclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -766,7 +766,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "ns_grp_d: H5Gclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* ns_grp_d() */ @@ -807,7 +807,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed."; } - HDassert(gid > 0); + assert(gid > 0); } if (pass) { @@ -817,7 +817,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed."; } - HDassert(gcpl > 0); + assert(gcpl > 0); } if (pass) { @@ -831,8 +831,8 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags"; } - HDassert(ret >= 0); - HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags); + assert(ret >= 0); + assert(H5P_CRT_ORDER_TRACKED == crt_order_flags); } if (pass) { @@ -842,7 +842,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -869,11 +869,11 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted"; } - HDassert(ret >= 0); - HDassert(H5G_STORAGE_TYPE_DENSE == grp_info.storage_type); - HDassert(nlinks == grp_info.nlinks); - HDassert(nlinks == grp_info.max_corder); - HDassert(FALSE == grp_info.mounted); + assert(ret >= 0); + assert(H5G_STORAGE_TYPE_DENSE == grp_info.storage_type); + assert(nlinks == grp_info.nlinks); + assert(nlinks == grp_info.max_corder); + assert(FALSE == grp_info.mounted); } u = 0; @@ -889,7 +889,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed."; } - HDassert(link_exists >= 0); + assert(link_exists >= 0); HDmemset(&lnk_info, 0, sizeof(grp_info)); ret = H5Lget_info2(gid, linkname, &lnk_info, H5P_DEFAULT); @@ -910,10 +910,10 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset"; } - HDassert(ret >= 0); - HDassert(TRUE == lnk_info.corder_valid); - HDassert(u == lnk_info.corder); - HDassert(H5T_CSET_ASCII == lnk_info.cset); + assert(ret >= 0); + assert(TRUE == lnk_info.corder_valid); + assert(u == lnk_info.corder); + assert(H5T_CSET_ASCII == lnk_info.cset); if (0 == (u % 3)) { char *slinkval; @@ -926,8 +926,8 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type"; } - HDassert(H5L_TYPE_SOFT == lnk_info.type); - HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size); + assert(H5L_TYPE_SOFT == lnk_info.type); + assert((HDstrlen(group_name) + 1) == lnk_info.u.val_size); slinkval = (char *)HDmalloc(lnk_info.u.val_size); @@ -935,7 +935,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: HDmalloc of slinkval failed"; } - HDassert(slinkval); + assert(slinkval); ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size, H5P_DEFAULT); if (ret < 0) { @@ -946,8 +946,8 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(slinkval, group_name)"; } - HDassert(ret >= 0); - HDassert(0 == HDstrcmp(slinkval, group_name)); + assert(ret >= 0); + assert(0 == HDstrcmp(slinkval, group_name)); HDfree(slinkval); } /* end if */ @@ -959,7 +959,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type"; } - HDassert(H5L_TYPE_HARD == lnk_info.type); + assert(H5L_TYPE_HARD == lnk_info.type); HDmemset(&root_oinfo, 0, sizeof(root_oinfo)); ret = H5Oget_info3(fid, &root_oinfo, H5O_INFO_BASIC); @@ -978,21 +978,21 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) failure_mssg = "vrfy_ns_grp_d: root_oinfo.token != lnk_info.u.token"; } } - HDassert(ret >= 0); - HDassert(!token_cmp); + assert(ret >= 0); + assert(!token_cmp); } /* end else-if */ else { void *elinkval; const char *file = NULL; const char *path = NULL; - HDassert(2 == (u % 3)); + assert(2 == (u % 3)); if (H5L_TYPE_EXTERNAL != lnk_info.type) { pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type"; } - HDassert(H5L_TYPE_EXTERNAL == lnk_info.type); + assert(H5L_TYPE_EXTERNAL == lnk_info.type); elinkval = HDmalloc(lnk_info.u.val_size); @@ -1000,14 +1000,14 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: HDmalloc of elinkval failed."; } - HDassert(elinkval); + assert(elinkval); ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size, H5P_DEFAULT); if (ret < 0) { pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5Lget_val failed."; } - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path); if (ret < 0) { @@ -1022,9 +1022,9 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(path, \"/ext\")"; } - HDassert(ret >= 0); - HDassert(0 == HDstrcmp(file, "external.h5")); - HDassert(0 == HDstrcmp(path, "/ext")); + assert(ret >= 0); + assert(0 == HDstrcmp(file, "external.h5")); + assert(0 == HDstrcmp(path, "/ext")); HDfree(elinkval); } /* end else */ @@ -1039,7 +1039,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* vrfy_ns_grp_d() */ @@ -1077,7 +1077,7 @@ os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "os_grp_0: H5Fget_access_plist() failed."; } - HDassert(fapl > 0); + assert(fapl > 0); } if (pass) { /* get low and high bounds from fapl */ @@ -1086,7 +1086,7 @@ os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1)."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { /* turn file format latest off */ @@ -1096,7 +1096,7 @@ os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; } - HDassert(ret >= 0); + assert(ret >= 0); } } @@ -1106,7 +1106,7 @@ os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "os_grp_0: H5Gcreate2() failed."; } - HDassert(gid > 0); + assert(gid > 0); } if (pass) { @@ -1116,7 +1116,7 @@ os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "os_grp_0: H5Gclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { /* restore low and high bounds */ @@ -1126,7 +1126,7 @@ os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; } - HDassert(ret >= 0); + assert(ret >= 0); } } @@ -1166,7 +1166,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed."; } - HDassert(gid > 0); + assert(gid > 0); } if (pass) { @@ -1176,7 +1176,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed."; } - HDassert(gcpl > 0); + assert(gcpl > 0); } if (pass) { @@ -1191,8 +1191,8 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags"; } - HDassert(ret >= 0); - HDassert(0 == crt_order_flags); + assert(ret >= 0); + assert(0 == crt_order_flags); } if (pass) { @@ -1202,7 +1202,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_os_grp_0: H5Pclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -1229,11 +1229,11 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted"; } - HDassert(ret >= 0); - HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type); - HDassert(0 == grp_info.nlinks); - HDassert(0 == grp_info.max_corder); - HDassert(FALSE == grp_info.mounted); + assert(ret >= 0); + assert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type); + assert(0 == grp_info.nlinks); + assert(0 == grp_info.max_corder); + assert(FALSE == grp_info.mounted); } if (pass) { @@ -1243,7 +1243,7 @@ vrfy_os_grp_0(hid_t fid, const char *group_name) pass = FALSE; failure_mssg = "vrfy_os_grp_0: H5Gclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* vrfy_os_grp_0() */ @@ -1282,7 +1282,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "os_grp_n: H5Fget_access_plist() failed."; } - HDassert(fapl > 0); + assert(fapl > 0); } if (pass) { /* get low and high bounds from fapl */ @@ -1291,7 +1291,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1)."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { /* turn file format latest off */ @@ -1301,7 +1301,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1)."; } - HDassert(ret >= 0); + assert(ret >= 0); } } @@ -1311,10 +1311,10 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "os_grp_n: H5Gcreate2() failed."; } - HDassert(gid > 0); + assert(gid > 0); } - HDassert(nlinks > 0); + assert(nlinks > 0); u = 0; while ((pass) && (u < nlinks)) { @@ -1328,17 +1328,17 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "os_grp_n: H5Lcreate_soft() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } /* end if */ else { - HDassert(1 == (u % 2)); + assert(1 == (u % 2)); ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT); if (ret < 0) { pass = FALSE; failure_mssg = "os_grp_n: H5Lcreate_hard() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } /* end else */ u++; @@ -1351,7 +1351,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "os_grp_n: H5Gclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { /* restore low and high bounds */ @@ -1361,7 +1361,7 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2)."; } - HDassert(ret >= 0); + assert(ret >= 0); } } @@ -1402,7 +1402,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed"; } - HDassert(gid > 0); + assert(gid > 0); } if (pass) { @@ -1412,7 +1412,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed"; } - HDassert(gcpl > 0); + assert(gcpl > 0); } if (pass) { @@ -1426,8 +1426,8 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags"; } - HDassert(ret >= 0); - HDassert(0 == crt_order_flags); + assert(ret >= 0); + assert(0 == crt_order_flags); } if (pass) { @@ -1437,7 +1437,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: H5Pclose() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -1465,11 +1465,11 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted"; } - HDassert(ret >= 0); - HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type); - HDassert(nlinks == grp_info.nlinks); - HDassert(0 == grp_info.max_corder); - HDassert(FALSE == grp_info.mounted); + assert(ret >= 0); + assert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type); + assert(nlinks == grp_info.nlinks); + assert(0 == grp_info.max_corder); + assert(FALSE == grp_info.mounted); } u = 0; @@ -1485,7 +1485,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: H5Lexists() failed"; } - HDassert(link_exists >= 0); + assert(link_exists >= 0); HDmemset(&lnk_info, 0, sizeof(grp_info)); ret = H5Lget_info2(gid, linkname, &lnk_info, H5P_DEFAULT); @@ -1502,9 +1502,9 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset"; } - HDassert(ret >= 0); - HDassert(FALSE == lnk_info.corder_valid); - HDassert(H5T_CSET_ASCII == lnk_info.cset); + assert(ret >= 0); + assert(FALSE == lnk_info.corder_valid); + assert(H5T_CSET_ASCII == lnk_info.cset); if (0 == (u % 2)) { char *slinkval; @@ -1517,8 +1517,8 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: (HDstrlen(group_name) + 1) != lnk_info.u.val_size"; } - HDassert(H5L_TYPE_SOFT == lnk_info.type); - HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size); + assert(H5L_TYPE_SOFT == lnk_info.type); + assert((HDstrlen(group_name) + 1) == lnk_info.u.val_size); slinkval = (char *)HDmalloc(lnk_info.u.val_size); @@ -1526,7 +1526,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: HDmalloc of slinkval failed"; } - HDassert(slinkval); + assert(slinkval); ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size, H5P_DEFAULT); @@ -1538,8 +1538,8 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: 0 != HDstrcmp(slinkval, group_name)"; } - HDassert(ret >= 0); - HDassert(0 == HDstrcmp(slinkval, group_name)); + assert(ret >= 0); + assert(0 == HDstrcmp(slinkval, group_name)); HDfree(slinkval); } /* end if */ @@ -1547,13 +1547,13 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) H5O_info2_t root_oinfo; int token_cmp = 0; - HDassert(1 == (u % 2)); + assert(1 == (u % 2)); if (H5L_TYPE_HARD != lnk_info.type) { pass = FALSE; failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type"; } - HDassert(H5L_TYPE_HARD == lnk_info.type); + assert(H5L_TYPE_HARD == lnk_info.type); HDmemset(&root_oinfo, 0, sizeof(root_oinfo)); ret = H5Oget_info3(fid, &root_oinfo, H5O_INFO_BASIC); @@ -1573,8 +1573,8 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) failure_mssg = "vrfy_os_grp_n: root_oinfo.token != lnk_info.u.token"; } } - HDassert(ret >= 0); - HDassert(!token_cmp); + assert(ret >= 0); + assert(!token_cmp); } /* end else */ u++; @@ -1587,7 +1587,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) pass = FALSE; failure_mssg = "vrfy_os_grp_n: H5Gclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* vrfy_os_grp_n() */ @@ -1628,7 +1628,7 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_i: H5Screate_simple() failed"; } - HDassert(sid > 0); + assert(sid > 0); } if (pass) { @@ -1638,7 +1638,7 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_i: H5Dcreate2() failed"; } - HDassert(dsid > 0); + assert(dsid > 0); } if (pass) { @@ -1648,7 +1648,7 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_i: H5Sclose() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -1658,7 +1658,7 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_i: HDmalloc of wdata failed."; } - HDassert(wdata); + assert(wdata); } if ((pass) && (write_data)) { @@ -1671,7 +1671,7 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_i: H5Dwrite() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } HDfree(wdata); @@ -1683,7 +1683,7 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_i: H5Dclose() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* ds_ctg_i */ @@ -1729,7 +1729,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed."; } - HDassert(dsid > 0); + assert(dsid > 0); } if (pass) { @@ -1739,7 +1739,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed."; } - HDassert(sid > 0); + assert(sid > 0); } if (pass) { @@ -1749,7 +1749,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: 1 != ndims"; } - HDassert(1 == ndims); + assert(1 == ndims); } if (pass) { @@ -1767,9 +1767,9 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]"; } - HDassert(ret >= 0); - HDassert(DSET_DIMS == dims[0]); - HDassert(DSET_DIMS == max_dims[0]); + assert(ret >= 0); + assert(DSET_DIMS == dims[0]); + assert(DSET_DIMS == max_dims[0]); } if (pass) { @@ -1779,7 +1779,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -1789,7 +1789,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed."; } - HDassert(tid > 0); + assert(tid > 0); } if (pass) { @@ -1799,7 +1799,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT"; } - HDassert(1 == type_equal); + assert(1 == type_equal); } if (pass) { @@ -1809,7 +1809,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -1827,9 +1827,9 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED"; } - HDassert(ret >= 0); - HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) || - (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED)); + assert(ret >= 0); + assert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) || + (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED)); } if (pass) { @@ -1839,7 +1839,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed."; } - HDassert(dcpl > 0); + assert(dcpl > 0); } if (pass) { @@ -1849,7 +1849,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout"; } - HDassert(H5D_CONTIGUOUS == layout); + assert(H5D_CONTIGUOUS == layout); } if (pass) { @@ -1859,7 +1859,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -1869,7 +1869,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: HDmalloc of rdata failed."; } - HDassert(rdata); + assert(rdata); } if ((pass) && (write_data)) { @@ -1878,7 +1878,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -1888,7 +1888,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) failure_mssg = "vrfy_ds_ctg_i: u != rdata[u]."; break; } - HDassert((int)u == rdata[u]); + assert((int)u == rdata[u]); } } /* end if */ @@ -1901,7 +1901,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed"; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* vrfy_ds_ctg_i() */ @@ -1944,7 +1944,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_chk_i: H5Screate_simple() failed."; } - HDassert(sid > 0); + assert(sid > 0); } if (pass) { @@ -1954,7 +1954,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_chk_i: H5Pcreate() failed."; } - HDassert(dcpl > 0); + assert(dcpl > 0); } if (pass) { @@ -1964,7 +1964,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_chk_i: H5Pset_chunk() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -1974,7 +1974,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_chk_i: H5Dcreate2() failed"; } - HDassert(dsid > 0); + assert(dsid > 0); } if (pass) { @@ -1984,7 +1984,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_chk_i: H5Pclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -1994,7 +1994,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_chk_i: H5Sclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -2004,7 +2004,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_chk_i: HDmalloc of wdata failed."; } - HDassert(wdata); + assert(wdata); } if ((pass) && (write_data)) { @@ -2016,7 +2016,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_chk_i: H5Dwrite() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); HDfree(wdata); } /* end if */ @@ -2027,7 +2027,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_chk_i: H5Dclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* ds_chk_i */ @@ -2073,7 +2073,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed."; } - HDassert(dsid > 0); + assert(dsid > 0); } if (pass) { @@ -2083,7 +2083,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed."; } - HDassert(sid > 0); + assert(sid > 0); } if (pass) { @@ -2093,7 +2093,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: 1 != ndims"; } - HDassert(1 == ndims); + assert(1 == ndims); } if (pass) { @@ -2111,9 +2111,9 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]"; } - HDassert(ret >= 0); - HDassert(DSET_DIMS == dims[0]); - HDassert(DSET_DIMS == max_dims[0]); + assert(ret >= 0); + assert(DSET_DIMS == dims[0]); + assert(DSET_DIMS == max_dims[0]); } if (pass) { @@ -2123,7 +2123,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -2133,7 +2133,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed."; } - HDassert(tid > 0); + assert(tid > 0); } if (pass) { @@ -2143,7 +2143,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT"; } - HDassert(1 == type_equal); + assert(1 == type_equal); } if (pass) { @@ -2153,7 +2153,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -2171,9 +2171,9 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED"; } - HDassert(ret >= 0); - HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) || - (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED)); + assert(ret >= 0); + assert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) || + (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED)); } if (pass) { @@ -2183,7 +2183,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed."; } - HDassert(dcpl > 0); + assert(dcpl > 0); } if (pass) { @@ -2193,7 +2193,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout"; } - HDassert(H5D_CHUNKED == layout); + assert(H5D_CHUNKED == layout); } if (pass) { @@ -2207,8 +2207,8 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: "; } - HDassert(ret >= 0); - HDassert(DSET_CHUNK_DIMS == chunk_dims[0]); + assert(ret >= 0); + assert(DSET_CHUNK_DIMS == chunk_dims[0]); } if (pass) { @@ -2218,7 +2218,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -2228,7 +2228,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: HDmalloc of rdata failed."; } - HDassert(rdata); + assert(rdata); } if ((pass) && (write_data)) { @@ -2237,7 +2237,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5Dread() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -2247,7 +2247,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) failure_mssg = "vrfy_ds_chk_i: u != rdata[u]"; break; } - HDassert((int)u == rdata[u]); + assert((int)u == rdata[u]); } } /* end if */ @@ -2260,7 +2260,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* vrfy_ds_chk_i() */ @@ -2302,7 +2302,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_cpt_i: H5Screate_simple() failed."; } - HDassert(sid > 0); + assert(sid > 0); } if (pass) { @@ -2312,7 +2312,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_cpt_i: H5Pcreate() failed."; } - HDassert(dcpl > 0); + assert(dcpl > 0); } if (pass) { @@ -2322,7 +2322,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_cpt_i: H5Pset_layout() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -2332,7 +2332,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_cpt_i: H5Dcreate2() failed."; } - HDassert(dsid > 0); + assert(dsid > 0); } if (pass) { @@ -2342,7 +2342,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_cpt_i: H5Pclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -2352,7 +2352,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_cpt_i: H5Sclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -2362,7 +2362,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_cpt_i: HDmalloc of wdata failed."; } - HDassert(wdata); + assert(wdata); } if ((pass) && (write_data)) { @@ -2375,7 +2375,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_cpt_i: H5Dwrite() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); HDfree(wdata); } /* end if */ @@ -2387,7 +2387,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_cpt_i: H5Dclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* ds_cpt_i() */ @@ -2433,7 +2433,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed."; } - HDassert(dsid > 0); + assert(dsid > 0); } if (pass) { @@ -2443,7 +2443,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed."; } - HDassert(sid > 0); + assert(sid > 0); } if (pass) { @@ -2453,7 +2453,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: 1 != ndims"; } - HDassert(1 == ndims); + assert(1 == ndims); } if (pass) { @@ -2471,9 +2471,9 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]"; } - HDassert(ret >= 0); - HDassert(DSET_COMPACT_DIMS == dims[0]); - HDassert(DSET_COMPACT_DIMS == max_dims[0]); + assert(ret >= 0); + assert(DSET_COMPACT_DIMS == dims[0]); + assert(DSET_COMPACT_DIMS == max_dims[0]); } if (pass) { @@ -2483,7 +2483,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -2493,7 +2493,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed."; } - HDassert(tid > 0); + assert(tid > 0); } if (pass) { @@ -2503,7 +2503,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT"; } - HDassert(1 == type_equal); + assert(1 == type_equal); } if (pass) { @@ -2513,7 +2513,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -2527,8 +2527,8 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation"; } - HDassert(ret >= 0); - HDassert(H5D_SPACE_STATUS_ALLOCATED == allocation); + assert(ret >= 0); + assert(H5D_SPACE_STATUS_ALLOCATED == allocation); } if (pass) { @@ -2538,7 +2538,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed."; } - HDassert(dcpl > 0); + assert(dcpl > 0); } if (pass) { @@ -2548,7 +2548,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout"; } - HDassert(H5D_COMPACT == layout); + assert(H5D_COMPACT == layout); } if (pass) { @@ -2558,7 +2558,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -2568,7 +2568,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: HDmalloc of rdata failed."; } - HDassert(rdata); + assert(rdata); } if ((pass) && (write_data)) { @@ -2577,7 +2577,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -2587,7 +2587,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]"; break; } - HDassert((int)u == rdata[u]); + assert((int)u == rdata[u]); } } /* end if */ @@ -2600,7 +2600,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* vrfy_ds_cpt_i() */ @@ -2642,7 +2642,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_v: H5Screate_simple"; } - HDassert(sid > 0); + assert(sid > 0); } if (pass) { @@ -2652,7 +2652,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_v: H5Tvlen_create() failed."; } - HDassert(tid > 0); + assert(tid > 0); } if (pass) { @@ -2662,7 +2662,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_v: H5Dcreate2() failed."; } - HDassert(dsid > 0); + assert(dsid > 0); } if ((pass) && (write_data)) { @@ -2672,7 +2672,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_v: HDmalloc of wdata failed."; } - HDassert(wdata); + assert(wdata); } if ((pass) && (write_data)) { @@ -2689,7 +2689,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) failure_mssg = "ds_ctg_v: HDmalloc of tdata failed."; break; } - HDassert(tdata); + assert(tdata); for (v = 0; v < len; v++) tdata[v] = (int)(u + v); @@ -2706,7 +2706,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_v: H5Dwrite() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -2716,7 +2716,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_v: H5Treclaim() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); HDfree(wdata); } /* end if */ @@ -2728,7 +2728,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_v: H5Sclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -2738,7 +2738,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_v: H5Tclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -2748,7 +2748,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "ds_ctg_v: H5Dclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* ds_ctg_v() */ @@ -2795,7 +2795,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed."; } - HDassert(dsid > 0); + assert(dsid > 0); } if (pass) { @@ -2805,7 +2805,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed"; } - HDassert(sid > 0); + assert(sid > 0); } if (pass) { @@ -2815,7 +2815,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: 1 != ndims"; } - HDassert(1 == ndims); + assert(1 == ndims); } if (pass) { @@ -2833,9 +2833,9 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]"; } - HDassert(ret >= 0); - HDassert(DSET_SMALL_DIMS == dims[0]); - HDassert(DSET_SMALL_DIMS == max_dims[0]); + assert(ret >= 0); + assert(DSET_SMALL_DIMS == dims[0]); + assert(DSET_SMALL_DIMS == max_dims[0]); } if (pass) { @@ -2845,7 +2845,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed."; } - HDassert(tid > 0); + assert(tid > 0); } if (pass) { @@ -2855,7 +2855,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed."; } - HDassert(tmp_tid > 0); + assert(tmp_tid > 0); } if (pass) { @@ -2865,7 +2865,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT"; } - HDassert(1 == type_equal); + assert(1 == type_equal); } if (pass) { @@ -2875,7 +2875,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -2893,9 +2893,9 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED"; } - HDassert(ret >= 0); - HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) || - (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED)); + assert(ret >= 0); + assert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) || + (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED)); } if (pass) { @@ -2905,7 +2905,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed."; } - HDassert(dcpl > 0); + assert(dcpl > 0); } if (pass) { @@ -2915,7 +2915,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout"; } - HDassert(H5D_CONTIGUOUS == layout); + assert(H5D_CONTIGUOUS == layout); } if (pass) { @@ -2925,7 +2925,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -2935,7 +2935,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: HDmalloc of rdata failed."; } - HDassert(rdata); + assert(rdata); } if ((pass) && (write_data)) { @@ -2945,7 +2945,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if ((pass) && (write_data)) { @@ -2967,8 +2967,8 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]"; break; } - HDassert(tdata); - HDassert((int)(u + v) == tdata[v]); + assert(tdata); + assert((int)(u + v) == tdata[v]); } /* end for */ } /* end for */ } @@ -2980,7 +2980,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Treclaim() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } /* end if */ HDfree(rdata); @@ -2992,7 +2992,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -3002,7 +3002,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } if (pass) { @@ -3012,7 +3012,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) pass = FALSE; failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed."; } - HDassert(ret >= 0); + assert(ret >= 0); } } /* vrfy_ds_ctg_v() */ @@ -3051,31 +3051,31 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) { char full_path[1024]; - HDassert(base_path); + assert(base_path); /* Add & verify an empty "new style" group */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/A", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ns_grp_0(fid, full_path); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/A", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ns_grp_0(fid, full_path); } /* Add & verify a compact "new style" group (3 link messages) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/B", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ns_grp_c(fid, full_path, 3); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/B", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ns_grp_c(fid, full_path, 3); } @@ -3084,26 +3084,26 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/C", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ns_grp_d(fid, full_path, 300); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/C", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ns_grp_d(fid, full_path, 300); } /* Add & verify an empty "old style" group to file */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/D", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); os_grp_0(fid, full_path); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/D", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_os_grp_0(fid, full_path); } @@ -3112,13 +3112,13 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/E", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); os_grp_n(fid, full_path, proc_num, 300); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/E", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_os_grp_n(fid, full_path, proc_num, 300); } @@ -3127,13 +3127,13 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/F", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ds_ctg_i(fid, full_path, FALSE); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/F", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_ctg_i(fid, full_path, FALSE); } @@ -3142,13 +3142,13 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/G", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ds_ctg_i(fid, full_path, TRUE); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/G", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_ctg_i(fid, full_path, TRUE); } @@ -3157,13 +3157,13 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/H", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ds_chk_i(fid, full_path, FALSE); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/H", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_chk_i(fid, full_path, FALSE); } @@ -3172,13 +3172,13 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/I", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ds_chk_i(fid, full_path, TRUE); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/I", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_chk_i(fid, full_path, TRUE); } @@ -3187,13 +3187,13 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/J", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ds_cpt_i(fid, full_path, FALSE); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/J", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_cpt_i(fid, full_path, FALSE); } @@ -3202,13 +3202,13 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/K", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ds_cpt_i(fid, full_path, TRUE); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/K", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_cpt_i(fid, full_path, TRUE); } @@ -3217,13 +3217,13 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/L", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ds_ctg_v(fid, full_path, FALSE); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/L", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_ctg_v(fid, full_path, FALSE); } @@ -3232,13 +3232,13 @@ create_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/M", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); ds_ctg_v(fid, full_path, TRUE); } if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/M", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_ctg_v(fid, full_path, TRUE); } @@ -3276,19 +3276,19 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) { char full_path[1024]; - HDassert(base_path); + assert(base_path); /* validate an empty "new style" group */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/A", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ns_grp_0(fid, full_path); } /* validate a compact "new style" group (3 link messages) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/B", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ns_grp_c(fid, full_path, 3); } @@ -3297,14 +3297,14 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/C", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ns_grp_d(fid, full_path, 300); } /* validate an empty "old style" group in file */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/D", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_os_grp_0(fid, full_path); } @@ -3313,7 +3313,7 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/E", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_os_grp_n(fid, full_path, proc_num, 300); } @@ -3322,7 +3322,7 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/F", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_ctg_i(fid, full_path, FALSE); } @@ -3331,7 +3331,7 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/G", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_ctg_i(fid, full_path, TRUE); } @@ -3340,7 +3340,7 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/H", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_chk_i(fid, full_path, FALSE); } @@ -3349,7 +3349,7 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/I", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_chk_i(fid, full_path, TRUE); } @@ -3358,7 +3358,7 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/J", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_cpt_i(fid, full_path, FALSE); } @@ -3367,7 +3367,7 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/K", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_cpt_i(fid, full_path, TRUE); } @@ -3376,7 +3376,7 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/L", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_ctg_v(fid, full_path, FALSE); } @@ -3385,7 +3385,7 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num) */ if (pass) { HDsnprintf(full_path, sizeof(full_path), "%s/M", base_path); - HDassert(HDstrlen(full_path) < 1024); + assert(HDstrlen(full_path) < 1024); vrfy_ds_ctg_v(fid, full_path, TRUE); } diff --git a/test/gheap.c b/test/gheap.c index f8766df..cca5289 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -517,8 +517,8 @@ test_ooo_indices(hid_t fapl) } /* The indices should have "wrapped around" on the last iteration */ - HDassert(obj[534].idx == 65535); - HDassert(obj[535].idx == 1); + assert(obj[534].idx == 65535); + assert(obj[535].idx == 1); /* Reopen the file */ if (H5Fclose(file) < 0) diff --git a/test/h5test.c b/test/h5test.c index 7e36315..7011121 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -314,7 +314,7 @@ void h5_restore_err(void) { /* Restore the original error reporting routine */ - HDassert(err_func != NULL); + assert(err_func != NULL); H5Eset_auto2(H5E_DEFAULT, err_func, NULL); err_func = NULL; } @@ -335,7 +335,7 @@ h5_reset(void) H5close(); /* Save current error stack reporting routine and redirect to our local one */ - HDassert(err_func == NULL); + assert(err_func == NULL); H5Eget_auto2(H5E_DEFAULT, &err_func, NULL); H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL); } @@ -365,7 +365,7 @@ h5_test_init(void) H5close(); /* Save current error stack reporting routine and redirect to our local one */ - HDassert(err_func == NULL); + assert(err_func == NULL); H5Eget_auto2(H5E_DEFAULT, &err_func, NULL); H5Eset_auto2(H5E_DEFAULT, h5_errors, NULL); } /* end h5_test_init() */ @@ -1178,7 +1178,7 @@ h5_get_file_size(const char *filename, hid_t fapl) } /* end for */ } else { - HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { /* Create the filename to query */ HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]); @@ -1358,7 +1358,7 @@ getenv_all(MPI_Comm comm, int root, const char *name) int len; static char *env = NULL; - HDassert(name); + assert(name); MPI_Initialized(&mpi_initialized); MPI_Finalized(&mpi_finalized); @@ -1366,7 +1366,7 @@ getenv_all(MPI_Comm comm, int root, const char *name) if (mpi_initialized && !mpi_finalized) { MPI_Comm_rank(comm, &mpi_rank); MPI_Comm_size(comm, &mpi_size); - HDassert(root < mpi_size); + assert(root < mpi_size); /* The root task does the getenv call * and sends the result to the other tasks */ @@ -1599,16 +1599,16 @@ h5_send_message(const char *send, const char *arg1, const char *arg2) /* Write messages to signal file, if provided */ if (arg2 != NULL) { - HDassert(arg1); + assert(arg1); HDfprintf(signalfile, "%s\n%s\n", arg1, arg2); } /* end if */ else if (arg1 != NULL) { - HDassert(arg2 == NULL); + assert(arg2 == NULL); HDfprintf(signalfile, "%s\n", arg1); } /* end if */ else { - HDassert(arg1 == NULL); - HDassert(arg2 == NULL); + assert(arg1 == NULL); + assert(arg2 == NULL); } /* end else */ HDfclose(signalfile); @@ -2162,7 +2162,7 @@ h5_using_default_driver(const char *drv_name) { hbool_t ret_val = TRUE; - HDassert(H5_DEFAULT_VFD == H5FD_SEC2); + assert(H5_DEFAULT_VFD == H5FD_SEC2); if (!drv_name) drv_name = HDgetenv(HDF5_DRIVER); @@ -2194,8 +2194,8 @@ h5_using_parallel_driver(hid_t fapl_id, hbool_t *driver_is_parallel) hid_t driver_id = H5I_INVALID_HID; herr_t ret_value = SUCCEED; - HDassert(fapl_id >= 0); - HDassert(driver_is_parallel); + assert(fapl_id >= 0); + assert(driver_is_parallel); if (fapl_id == H5P_DEFAULT) fapl_id = H5P_FILE_ACCESS_DEFAULT; @@ -2237,8 +2237,8 @@ h5_driver_is_default_vfd_compatible(hid_t fapl_id, hbool_t *default_vfd_compatib hid_t driver_id = H5I_INVALID_HID; herr_t ret_value = SUCCEED; - HDassert(fapl_id >= 0); - HDassert(default_vfd_compatible); + assert(fapl_id >= 0); + assert(default_vfd_compatible); if (fapl_id == H5P_DEFAULT) fapl_id = H5P_FILE_ACCESS_DEFAULT; diff --git a/test/links.c b/test/links.c index b865275..fcafbf8 100644 --- a/test/links.c +++ b/test/links.c @@ -955,7 +955,7 @@ toomany(hid_t fapl, hbool_t new_format) /* XXX: should probably make a "generic" test that creates the proper * # of links based on this value - QAK */ - HDassert(H5L_NUM_LINKS == 16); + assert(H5L_NUM_LINKS == 16); /* Create file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); @@ -4148,7 +4148,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format) /* XXX: should probably make a "generic" test that creates the proper * # of links based on this value - QAK */ - HDassert(H5L_NUM_LINKS == 16); + assert(H5L_NUM_LINKS == 16); /* Create file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); @@ -6349,7 +6349,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_links; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -6384,7 +6384,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_links; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -6510,7 +6510,7 @@ link_iterate_deprec(hid_t fapl) "creation order index using deprecated routines"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING("iterating over links by creation order index in native order w/creation " "order index using deprecated routines"); @@ -6537,7 +6537,7 @@ link_iterate_deprec(hid_t fapl) "order index using deprecated routines"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING("iterating over links by name index in native order w/creation order " "index using deprecated routines"); @@ -6832,7 +6832,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_links; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -6867,7 +6867,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_links; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -6980,7 +6980,7 @@ link_iterate_old_deprec(hid_t fapl) "deprecated routines"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); TESTING("iterating over links by name index in native order in old-style group using deprecated " "routines"); } /* end else */ @@ -7986,7 +7986,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format) /* XXX: should probably make a "generic" test that creates the proper * # of links based on this value - QAK */ - HDassert(H5L_NUM_LINKS == 16); + assert(H5L_NUM_LINKS == 16); /* Set up filenames */ h5_fixname(FILENAME[3], fapl, filename1, sizeof filename1); @@ -15244,7 +15244,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* XXX: should probably make a "generic" test that creates the proper * # of links based on this value - QAK */ - HDassert(H5L_NUM_LINKS == 16); + assert(H5L_NUM_LINKS == 16); /* Create file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); @@ -19534,7 +19534,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_links; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -19570,7 +19570,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_links; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -19699,7 +19699,7 @@ link_iterate(hid_t fapl) "creation order index"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING("iterating over links by creation order index in native order w/creation " "order index"); @@ -19726,7 +19726,7 @@ link_iterate(hid_t fapl) "order index"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING( "iterating over links by name index in native order w/creation order index"); @@ -20031,7 +20031,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_links; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -20067,7 +20067,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_links; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -20183,7 +20183,7 @@ link_iterate_old(hid_t fapl) TESTING("iterating over links by name index in decreasing order in old-style group"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); TESTING("iterating over links by name index in native order in old-style group"); } /* end else */ @@ -20461,7 +20461,7 @@ open_by_idx(hid_t fapl) "order index"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING( "open object by creation order index in native order w/creation order index"); @@ -20484,7 +20484,7 @@ open_by_idx(hid_t fapl) TESTING("open object by name index in decreasing order w/o creation order index"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING("open object by name index in native order w/creation order index"); else @@ -20810,7 +20810,7 @@ open_by_idx_old(hid_t fapl) TESTING("open object by name index in decreasing order in old-style group"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); TESTING("open object by name index in native order in old-style group"); } /* end else */ @@ -21078,7 +21078,7 @@ object_info(hid_t fapl) "creation order index"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING("query object info by creation order index in native order w/creation " "order index"); @@ -21105,7 +21105,7 @@ object_info(hid_t fapl) "index"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING("query object info by name index in native order w/creation order index"); else @@ -21435,7 +21435,7 @@ object_info_old(hid_t fapl) TESTING("query object info by name index in decreasing order in old-style group"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); TESTING("query object info by name index in native order in old-style group"); } /* end else */ @@ -21629,7 +21629,7 @@ group_info(hid_t fapl) "creation order index"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING("query group info by creation order index in native order w/creation " "order index"); @@ -21656,7 +21656,7 @@ group_info(hid_t fapl) "index"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); if (use_index) TESTING("query group info by name index in native order w/creation order index"); else @@ -22149,7 +22149,7 @@ group_info_old(hid_t fapl) TESTING("query group info by name index in decreasing order in old-style group"); } /* end else */ else { - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); TESTING("query group info by name index in native order in old-style group"); } /* end else */ diff --git a/test/mf.c b/test/mf.c index 69caf25..d73b95c 100644 --- a/test/mf.c +++ b/test/mf.c @@ -159,8 +159,8 @@ check_stats(const H5F_t *f, const H5FS_t *frsp, H5FS_stat_t *state) { H5FS_stat_t frspace_stats; /* Statistics about the heap */ - HDassert(f); - HDassert(frsp); + assert(f); + assert(frsp); /* Get statistics for free-space and verify they are correct */ if (H5FS_stat_info(f, frsp, &frspace_stats) < 0) @@ -7756,7 +7756,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t is_multi_or_split) hbool_t relax; H5FD_mem_t mt; - HDassert(is_multi_or_split); + assert(is_multi_or_split); HDmemset(memb_name, 0, sizeof memb_name); diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index 8a1328f..bd38d8c 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -1359,9 +1359,9 @@ create_datasets(hid_t file_id, unsigned min_dset, unsigned max_dset) hsize_t chunk_dims[2] = {CHUNK_DIM, CHUNK_DIM}; hsize_t dset_dims[2] = {DSET_DIM, DSET_DIM}; - HDassert(file_id >= 0); - HDassert(min_dset <= max_dset); - HDassert(max_dset <= MAX_DSET_COUNT); + assert(file_id >= 0); + assert(min_dset <= max_dset); + assert(max_dset <= MAX_DSET_COUNT); LOGPRINT(2, "create_dataset()\n"); @@ -1678,9 +1678,9 @@ verify_datasets(hid_t file_id, unsigned min_dset, unsigned max_dset) hid_t memspace_id = H5I_INVALID_HID; hsize_t chunk_dims[2] = {CHUNK_DIM, CHUNK_DIM}; - HDassert(file_id >= 0); - HDassert(min_dset <= max_dset); - HDassert(max_dset <= MAX_DSET_COUNT); + assert(file_id >= 0); + assert(min_dset <= max_dset); + assert(max_dset <= MAX_DSET_COUNT); LOGPRINT(2, "verify_datasets()\n"); diff --git a/test/objcopy.c b/test/objcopy.c index 187b04a..f1c4636 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -1098,7 +1098,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, else { /* vlens cannot currently be nested below the top layer of a * compound */ - HDassert(H5Tdetect_class(memb_id, H5T_VLEN) == FALSE); + assert(H5Tdetect_class(memb_id, H5T_VLEN) == FALSE); /* Iterate over all elements, calling memcmp() for each */ for (elmt = 0; elmt < nelmts; elmt++) { @@ -1675,7 +1675,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) break; case H5O_TYPE_MAP: - HDassert(0 && "maps not supported in native VOL connector"); + assert(0 && "maps not supported in native VOL connector"); /* clang complains about implicit fallthrough here and * our usual attributes and fall-through comments don't @@ -1685,7 +1685,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: - HDassert(0 && "Unknown type of object"); + assert(0 && "Unknown type of object"); break; H5_CLANG_DIAG_ON("implicit-fallthrough") } /* end switch */ @@ -1708,7 +1708,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) char linkval2[NAME_BUF_SIZE]; /* Link value */ /* Get link values */ - HDassert(linfo.u.val_size <= NAME_BUF_SIZE); + assert(linfo.u.val_size <= NAME_BUF_SIZE); if (H5Lget_val(gid, objname, linkval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR; if (H5Lget_val(gid2, objname2, linkval2, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) @@ -1719,7 +1719,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) TEST_ERROR; } /* end else-if */ else { - HDassert(0 && "Unknown type of link"); + assert(0 && "Unknown type of link"); } /* end else */ } /* end else */ } /* end for */ diff --git a/test/objcopy_ref.c b/test/objcopy_ref.c index 73c611e..826ba9f 100644 --- a/test/objcopy_ref.c +++ b/test/objcopy_ref.c @@ -882,7 +882,7 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts, else { /* vlens cannot currently be nested below the top layer of a * compound */ - HDassert(H5Tdetect_class(memb_id, H5T_VLEN) == FALSE); + assert(H5Tdetect_class(memb_id, H5T_VLEN) == FALSE); /* Iterate over all elements, calling memcmp() for each */ for (elmt = 0; elmt < nelmts; elmt++) { @@ -1387,7 +1387,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) break; case H5O_TYPE_MAP: - HDassert(0 && "maps not supported in native VOL connector"); + assert(0 && "maps not supported in native VOL connector"); /* clang complains about implicit fallthrough here and * our usual attributes and fall-through comments don't @@ -1397,7 +1397,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: default: - HDassert(0 && "Unknown type of object"); + assert(0 && "Unknown type of object"); break; H5_CLANG_DIAG_ON("implicit-fallthrough") } /* end switch */ @@ -1420,7 +1420,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) char linkval2[NAME_BUF_SIZE]; /* Link value */ /* Get link values */ - HDassert(linfo.u.val_size <= NAME_BUF_SIZE); + assert(linfo.u.val_size <= NAME_BUF_SIZE); if (H5Lget_val(gid, objname, linkval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR; if (H5Lget_val(gid2, objname2, linkval2, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) @@ -1431,7 +1431,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags) TEST_ERROR; } /* end else-if */ else { - HDassert(0 && "Unknown type of link"); + assert(0 && "Unknown type of link"); } /* end else */ } /* end else */ } /* end for */ diff --git a/test/onion.c b/test/onion.c index da1eb12..20522bd 100644 --- a/test/onion.c +++ b/test/onion.c @@ -1680,7 +1680,7 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt TEST_ERROR; /* Re-use buffer space to sanity-check checksum for record pointer(s). */ - HDassert(readsize >= sizeof(H5FD_onion_record_loc_t)); + assert(readsize >= sizeof(H5FD_onion_record_loc_t)); for (size_t i = 0; i < history_out.n_revisions; i++) { uint64_t phys_addr; diff --git a/test/page_buffer.c b/test/page_buffer.c index 16fcfd5..2f4e607 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -1121,9 +1121,9 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* opening the file inserts one or more pages into the page buffer. * Get the raw and meta counts now, so we can adjust tests accordingly. */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->page_buf); + assert(f); + assert(f->shared); + assert(f->shared->page_buf); base_raw_cnt = f->shared->page_buf->raw_count; base_meta_cnt = f->shared->page_buf->meta_count; @@ -1255,9 +1255,9 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) /* opening the file inserts one or more pages into the page buffer. * Get the raw and meta counts now, so we can adjust tests accordingly. */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->page_buf); + assert(f); + assert(f->shared); + assert(f->shared->page_buf); base_raw_cnt = f->shared->page_buf->raw_count; base_meta_cnt = f->shared->page_buf->meta_count; @@ -1738,9 +1738,9 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) * Get the raw and meta counts now, so we can adjust the expected * statistics accordingly. */ - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->page_buf); + assert(f); + assert(f->shared); + assert(f->shared->page_buf); base_raw_cnt = f->shared->page_buf->raw_count; base_meta_cnt = f->shared->page_buf->meta_count; diff --git a/test/s3comms.c b/test/s3comms.c index 330360e..7cf3057 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -535,7 +535,7 @@ test_aws_canonical_request(void) /* create HTTP request object with given verb, resource/path */ hrb = H5FD_s3comms_hrb_init_request(C->verb, C->resource, "HTTP/1.1"); - HDassert(hrb->body == NULL); + assert(hrb->body == NULL); /* Create headers list from test case input */ @@ -557,9 +557,9 @@ test_aws_canonical_request(void) while (node != NULL) { FAIL_IF(FAIL == H5FD_s3comms_hrb_node_set(&node, node->name, NULL)); } - HDassert(NULL == node); + assert(NULL == node); FAIL_IF(FAIL == H5FD_s3comms_hrb_destroy(&hrb)); - HDassert(NULL == hrb); + assert(NULL == hrb); } /* for each test case */ @@ -580,7 +580,7 @@ test_aws_canonical_request(void) "signed headers destination cannot be null") FAIL_IF(FAIL == H5FD_s3comms_hrb_destroy(&hrb)) - HDassert(NULL == hrb); + assert(NULL == hrb); PASSED(); return 0; @@ -590,7 +590,7 @@ error: if (node != NULL) { while (node != NULL) (void)H5FD_s3comms_hrb_node_set(&node, node->name, NULL); - HDassert(node == NULL); + assert(node == NULL); } if (hrb != NULL) { (void)H5FD_s3comms_hrb_destroy(&hrb); @@ -1272,7 +1272,7 @@ test_HMAC_SHA256(void) } else { dest = (char *)HDmalloc(sizeof(char) * cases[i].dest_size); - HDassert(dest != NULL); + assert(dest != NULL); } JSVERIFY( @@ -1285,7 +1285,7 @@ test_HMAC_SHA256(void) /* print out how wrong things are, and then fail */ dest = (char *)HDrealloc(dest, cases[i].dest_size + 1); - HDassert(dest != NULL); + assert(dest != NULL); dest[cases[i].dest_size] = 0; HDfprintf(stdout, "ERROR:\n!!! \"%s\"\n != \"%s\"\n", cases[i].exp, dest); TEST_ERROR; @@ -1606,7 +1606,7 @@ test_parse_url(void) *********/ for (i = 0; i < ncases; i++) { - HDassert(purl == NULL); + assert(purl == NULL); JSVERIFY(cases[i].exp_ret, H5FD_s3comms_parse_url(cases[i].url, &purl), cases[i].msg) @@ -2217,7 +2217,7 @@ test_signing_key(void) for (i = 0; i < ncases; i++) { key = (unsigned char *)HDmalloc(sizeof(unsigned char) * SHA256_DIGEST_LENGTH); - HDassert(key != NULL); + assert(key != NULL); JSVERIFY(SUCCEED, H5FD_s3comms_signing_key(key, cases[i].secret_key, cases[i].region, cases[i].when), NULL) @@ -2234,7 +2234,7 @@ test_signing_key(void) ***************/ key = (unsigned char *)HDmalloc(sizeof(unsigned char) * SHA256_DIGEST_LENGTH); - HDassert(key != NULL); + assert(key != NULL); JSVERIFY(FAIL, H5FD_s3comms_signing_key(NULL, cases[0].secret_key, cases[0].region, cases[0].when), "destination cannot be NULL") @@ -2396,9 +2396,9 @@ test_trim(void) TESTING("s3comms trim"); for (i = 0; i < n_cases; i++) { - HDassert(str == NULL); + assert(str == NULL); str = (char *)HDmalloc(sizeof(char) * cases[i].in_len); - HDassert(str != NULL); + assert(str != NULL); HDstrncpy(str, cases[i].in, cases[i].in_len); JSVERIFY(SUCCEED, H5FD_s3comms_trim(dest, str, cases[i].in_len, &dest_len), NULL) @@ -2414,9 +2414,9 @@ test_trim(void) "should not fail when trimming a null string"); JSVERIFY(0, dest_len, "trimming NULL string writes 0 characters") - HDassert(str == NULL); + assert(str == NULL); str = (char *)HDmalloc(sizeof(char *) * 11); - HDassert(str != NULL); + assert(str != NULL); HDmemcpy(str, "some text ", 11); /* string with null terminator */ JSVERIFY(FAIL, H5FD_s3comms_trim(NULL, str, 10, &dest_len), "destination for trim cannot be NULL"); HDfree(str); @@ -2529,7 +2529,7 @@ test_uriencode(void) ***************/ dest = (char *)HDmalloc(sizeof(char) * 15); - HDassert(dest != NULL); + assert(dest != NULL); JSVERIFY(FAIL, H5FD_s3comms_uriencode(NULL, "word$", 5, FALSE, &dest_written), "destination cannot be NULL"); diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index 07f2cb1..4681d4f 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -75,7 +75,7 @@ open_skeleton(const char *filename, unsigned verbose) hsize_t dim[2]; /* Dataspace dimension */ unsigned u, v; /* Local index variable */ - HDassert(filename); + assert(filename); /* Create file access property list */ if ((fapl = h5_fileaccess()) < 0) @@ -148,7 +148,7 @@ addrem_records(hid_t fid, unsigned verbose, unsigned long nops, unsigned long fl unsigned long op_to_flush; /* # of operations before flush */ unsigned long u, v; /* Local index variables */ - HDassert(fid > 0); + assert(fid > 0); /* Reset the buffer */ HDmemset(&buf, 0, sizeof(buf)); diff --git a/test/swmr_common.c b/test/swmr_common.c index 0c869f1..0143cf8 100644 --- a/test/swmr_common.c +++ b/test/swmr_common.c @@ -179,7 +179,7 @@ create_symbol_datatype(void) int generate_name(char *name_buf, size_t name_buf_length, unsigned level, unsigned count) { - HDassert(name_buf); + assert(name_buf); HDsnprintf(name_buf, name_buf_length, "%u-%04u", level, count); diff --git a/test/swmr_generator.c b/test/swmr_generator.c index 53a619b..d8d4adc 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -97,8 +97,8 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t swmr_write, int comp #endif /* FILLVAL_WORKS */ unsigned u, v; /* Local index variable */ - HDassert(filename); - HDassert(index_type); + assert(filename); + assert(index_type); /* Create file access property list */ if ((fapl = h5_fileaccess()) < 0) diff --git a/test/swmr_reader.c b/test/swmr_reader.c index 4c3770b..47a1288 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -86,10 +86,10 @@ check_dataset(hid_t fid, hbool_t verbose, FILE *verbose_file, const char *sym_na hssize_t snpoints; /* Number of elements in dataset */ hsize_t start[2] = {0, 0}, count[2] = {1, 1}; /* Hyperslab selection values */ - HDassert(fid >= 0); - HDassert(sym_name); - HDassert(record); - HDassert(rec_sid >= 0); + assert(fid >= 0); + assert(sym_name); + assert(record); + assert(rec_sid >= 0); /* Open dataset for symbol */ if ((dsid = H5Dopen2(fid, sym_name, H5P_DEFAULT)) < 0) @@ -204,9 +204,9 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file, unsigned unsigned v; /* Local index variable */ hbool_t use_log_vfd = FALSE; /* Use the log VFD (set this manually) */ - HDassert(filename); - HDassert(nseconds != 0); - HDassert(poll_time != 0); + assert(filename); + assert(nseconds != 0); + assert(poll_time != 0); /* Reset the record */ /* (record's 'info' field might need to change for each record read, also) */ diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index 82c6af6..eca81ad 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -83,10 +83,10 @@ check_dataset(hid_t fid, unsigned verbose, const char *sym_name, symbol_t *recor hssize_t snpoints; /* Number of elements in dataset */ hsize_t start[2] = {0, 0}, count[2] = {1, 1}; /* Hyperslab selection values */ - HDassert(fid >= 0); - HDassert(sym_name); - HDassert(record); - HDassert(rec_sid >= 0); + assert(fid >= 0); + assert(sym_name); + assert(record); + assert(rec_sid >= 0); /* Open dataset for symbol */ if ((dsid = H5Dopen2(fid, sym_name, H5P_DEFAULT)) < 0) @@ -199,9 +199,9 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, uns symbol_t record; /* The record to add to the dataset */ unsigned v; /* Local index variable */ - HDassert(filename); - HDassert(nseconds != 0); - HDassert(poll_time != 0); + assert(filename); + assert(nseconds != 0); + assert(poll_time != 0); /* Reset the record */ /* (record's 'info' field might need to change for each record written, also) */ diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index da09b2b..d383e54 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -75,7 +75,7 @@ open_skeleton(const char *filename, unsigned verbose, unsigned old) hsize_t dim[2]; /* Dataspace dimensions */ unsigned u, v; /* Local index variable */ - HDassert(filename); + assert(filename); /* Create file access property list */ if ((fapl = h5_fileaccess()) < 0) @@ -146,7 +146,7 @@ remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned lon hsize_t dim[2] = {1, 0}; /* Dataspace dimensions */ unsigned long u, v; /* Local index variables */ - HDassert(fid >= 0); + assert(fid >= 0); /* Remove records from random datasets, according to frequency distribution */ shrink_to_flush = flush_count; diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index cc38fb8..ff55a5b 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -91,10 +91,10 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t hsize_t start[2] = {0, 0}; /* Hyperslab selection values */ hsize_t count[2] = {1, 1}; /* Hyperslab selection values */ - HDassert(fid >= 0); - HDassert(symbol); - HDassert(record); - HDassert(rec_sid >= 0); + assert(fid >= 0); + assert(symbol); + assert(record); + assert(rec_sid >= 0); /* Open dataset for symbol */ if ((dsid = H5Dopen2(fid, symbol->name, H5P_DEFAULT)) < 0) @@ -182,8 +182,8 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords, uns unsigned long u; /* Local index variable */ hid_t fapl; - HDassert(filename); - HDassert(poll_time != 0); + assert(filename); + assert(poll_time != 0); /* Create file access property list */ if ((fapl = h5_fileaccess()) < 0) diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index 3644d89..e8937e0 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -73,7 +73,7 @@ open_skeleton(const char *filename, unsigned verbose) unsigned seed; /* Seed for random number generator */ unsigned u, v; /* Local index variable */ - HDassert(filename); + assert(filename); /* Create file access property list */ if ((fapl = h5_fileaccess()) < 0) @@ -153,7 +153,7 @@ add_records(hid_t fid, unsigned verbose, unsigned long nrecords, unsigned long f hsize_t dim[2] = {1, 0}; /* Dataspace dimensions */ unsigned long u, v; /* Local index variables */ - HDassert(fid >= 0); + assert(fid >= 0); /* Reset the record */ /* (record's 'info' field might need to change for each record written, also) */ diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index cd02457..40014fb 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -71,7 +71,7 @@ create_file(const char *filename, hbool_t verbose, FILE *verbose_file, unsigned hid_t sid; /* Dataspace ID */ hid_t aid; /* Attribute ID */ - HDassert(filename); + assert(filename); /* Create file access property list */ if ((fapl = h5_fileaccess()) < 0) @@ -145,7 +145,7 @@ create_datasets(hid_t fid, int comp_level, hbool_t verbose, FILE *verbose_file, hsize_t chunk_dims[2] = {1, CHUNK_SIZE}; /* Chunk dimensions */ unsigned u, v; /* Local index variable */ - HDassert(index_type); + assert(index_type); /* Create datatype for creating datasets */ if ((tid = create_symbol_datatype()) < 0) @@ -219,7 +219,7 @@ add_records(hid_t fid, hbool_t verbose, FILE *verbose_file, unsigned long nrecor unsigned long rec_to_flush; /* # of records left to write before flush */ unsigned long u, v; /* Local index variables */ - HDassert(fid >= 0); + assert(fid >= 0); /* Reset the record */ /* (record's 'info' field might need to change for each record written, also) */ diff --git a/test/swmr_writer.c b/test/swmr_writer.c index 5f41215..3b86dea 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -75,7 +75,7 @@ open_skeleton(const char *filename, hbool_t verbose, FILE *verbose_file, unsigne unsigned u, v; /* Local index variable */ hbool_t use_log_vfd = FALSE; /* Use the log VFD (set this manually) */ - HDassert(filename); + assert(filename); /* Create file access property list */ if ((fapl = h5_fileaccess()) < 0) @@ -155,7 +155,7 @@ add_records(hid_t fid, hbool_t verbose, FILE *verbose_file, unsigned long nrecor unsigned long rec_to_flush; /* # of records left to write before flush */ unsigned long u, v; /* Local index variables */ - HDassert(fid >= 0); + assert(fid >= 0); /* Reset the record */ /* (record's 'info' field might need to change for each record written, also) */ diff --git a/test/tattr.c b/test/tattr.c index 9151b26..d38aaa7 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -4610,7 +4610,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -4693,7 +4693,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -4814,7 +4814,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -4924,7 +4924,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -5155,7 +5155,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -5209,7 +5209,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create several attributes, but keep storage in compact form */ @@ -5370,7 +5370,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -5564,7 +5564,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -5893,7 +5893,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -6415,7 +6415,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -6487,7 +6487,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Delete attributes from compact storage */ @@ -6546,7 +6546,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ @@ -6619,7 +6619,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Delete attributes from dense storage */ @@ -6689,7 +6689,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create attributes, to push into dense form */ @@ -6736,7 +6736,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Delete every other attribute from dense storage, in appropriate order */ @@ -6789,7 +6789,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Delete remaining attributes from dense storage, in appropriate order */ @@ -7078,7 +7078,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_attrs; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -7109,7 +7109,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_attrs; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -7140,7 +7140,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_attrs; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -7172,7 +7172,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, H5_index_t idx else { unsigned nvisit = 0; /* # of links visited */ - HDassert(order == H5_ITER_NATIVE); + assert(order == H5_ITER_NATIVE); for (v = 0; v < max_attrs; v++) if (iter_info->visited[v] == TRUE) nvisit++; @@ -7405,7 +7405,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -7507,7 +7507,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ @@ -7800,7 +7800,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -7878,7 +7878,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ @@ -8140,7 +8140,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -8246,7 +8246,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ @@ -8435,7 +8435,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Check on dataset's attribute storage status */ @@ -8498,7 +8498,7 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) break; default: - HDassert(0 && "Too many datasets!"); + assert(0 && "Too many datasets!"); } /* end switch */ /* Create more attributes, to push into dense form */ diff --git a/test/tfile.c b/test/tfile.c index 4bb2d82..fca33ab 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -4406,7 +4406,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t split) hbool_t relax; H5FD_mem_t mt; - HDassert(split); + assert(split); HDmemset(memb_name, 0, sizeof memb_name); diff --git a/test/th5s.c b/test/th5s.c index 7e9d216..8717e85 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1772,7 +1772,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) break; default: - HDassert(0); + assert(0); break; } /* end switch */ @@ -1797,7 +1797,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8); break; default: - HDassert(0); + assert(0); break; } /* end switch */ @@ -1822,7 +1822,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) expected_enc_size = 8; break; default: - HDassert(0); + assert(0); break; } @@ -1847,7 +1847,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) expected_enc_size = 8; break; default: - HDassert(0); + assert(0); break; } /* end switch */ @@ -1872,7 +1872,7 @@ test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high) expected_enc_size = 8; break; default: - HDassert(0); + assert(0); break; } @@ -1966,7 +1966,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) break; default: - HDassert(0); + assert(0); break; } @@ -1995,7 +1995,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) break; default: - HDassert(0); + assert(0); break; } @@ -2008,7 +2008,7 @@ test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high) VERIFY(is_regular, FALSE, "H5Sis_regular_hyperslab"); /* Verify the version and encoded size expected for the configuration */ - HDassert(expected_enc_size <= 255); + assert(expected_enc_size <= 255); ret = test_h5s_check_encoding(fapl, sid, expected_version, (uint8_t)expected_enc_size, expected_to_fail); CHECK(ret, FAIL, "test_h5s_check_encoding"); diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c index 0128874..fc3ddcf 100644 --- a/test/trefer_deprec.c +++ b/test/trefer_deprec.c @@ -1426,9 +1426,9 @@ test_reference_group(void) /* Create bottom dataset */ did = H5Dcreate2(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(did > 0); + assert(did > 0); ret = H5Dclose(did); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Gclose(gid); CHECK(ret, FAIL, "H5Gclose"); diff --git a/test/tselect.c b/test/tselect.c index 8079353..8fc6c65 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -1884,8 +1884,8 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, size_t H5_ATTR size_t s; /* Local index variable */ hbool_t mis_match; /* Flag to indicate mismatch in expected value */ - HDassert(cube_buf); - HDassert(cube_size > 0); + assert(cube_buf); + assert(cube_size > 0); expected_value = 0; mis_match = FALSE; @@ -1902,7 +1902,7 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, size_t H5_ATTR m = 0; do { /* Sanity check */ - HDassert(s < cube_size); + assert(s < cube_size); /* Check for correct value */ if (*cube_ptr != expected_value) @@ -1976,12 +1976,12 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co MESSAGE(7, ("\tranks = %u/%u, edge_size = %u, chunk_edge_size = %u.\n", small_rank, large_rank, edge_size, chunk_edge_size)); - HDassert(edge_size >= 6); - HDassert(edge_size >= chunk_edge_size); - HDassert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); - HDassert(small_rank > 0); - HDassert(small_rank < large_rank); - HDassert(large_rank <= SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(edge_size >= chunk_edge_size); + assert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); + assert(small_rank > 0); + assert(small_rank < large_rank); + assert(large_rank <= SS_DR_MAX_RANK); /* Compute cube sizes */ small_cube_size = large_cube_size = (size_t)1; @@ -1992,7 +1992,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co large_cube_size *= (size_t)edge_size; } /* end for */ - HDassert(large_cube_size < (size_t)UINT_MAX); + assert(large_cube_size < (size_t)UINT_MAX); /* set up the start, stride, count, and block pointers */ start_ptr = &(start[SS_DR_MAX_RANK - large_rank]); @@ -2238,8 +2238,8 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co (x * edge_size); stop_index = start_index + small_cube_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= large_cube_size); + assert(start_index < stop_index); + assert(stop_index <= large_cube_size); mis_match = FALSE; ptr_1 = large_cube_buf_1; @@ -2432,8 +2432,8 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co (x * edge_size); stop_index = start_index + small_cube_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= large_cube_size); + assert(start_index < stop_index); + assert(stop_index <= large_cube_size); mis_match = FALSE; ptr_1 = large_cube_buf_1; @@ -2597,16 +2597,16 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid, u unsigned u; /* Local index variables */ herr_t ret; /* Generic return value */ - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(0 < sel_rank); - HDassert(sel_rank <= tgt_n_cube_rank); - HDassert(tgt_n_cube_rank <= SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(0 < sel_rank); + assert(sel_rank <= tgt_n_cube_rank); + assert(tgt_n_cube_rank <= SS_DR_MAX_RANK); sel_offset = SS_DR_MAX_RANK - sel_rank; n_cube_offset = SS_DR_MAX_RANK - tgt_n_cube_rank; - HDassert(n_cube_offset <= sel_offset); + assert(n_cube_offset <= sel_offset); /* First, compute the base count (which assumes start == 0 * for the associated offset) and offset_count (which @@ -2819,13 +2819,13 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t *buf_ptr, unsigned rank unsigned v, w, x, y, z; /* to track position in checker */ const unsigned test_max_rank = 5; /* code changes needed if this is increased */ - HDassert(buf_ptr != NULL); - HDassert(0 < rank); - HDassert(rank <= test_max_rank); - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(test_max_rank <= SS_DR_MAX_RANK); + assert(buf_ptr != NULL); + assert(0 < rank); + assert(rank <= test_max_rank); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(test_max_rank <= SS_DR_MAX_RANK); val_ptr = buf_ptr; expected_value = first_expected_val; @@ -2956,15 +2956,15 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ MESSAGE(7, ("\tranks = %d/%d, edge_size = %d, checker_edge_size = %d, chunk_edge_size = %d.\n", small_rank, large_rank, edge_size, checker_edge_size, chunk_edge_size)); - HDassert(edge_size >= 6); - HDassert(checker_edge_size > 0); - HDassert(checker_edge_size <= edge_size); - HDassert(edge_size >= chunk_edge_size); - HDassert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); - HDassert(small_rank > 0); - HDassert(small_rank < large_rank); - HDassert(large_rank <= test_max_rank); - HDassert(test_max_rank <= SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(checker_edge_size > 0); + assert(checker_edge_size <= edge_size); + assert(edge_size >= chunk_edge_size); + assert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); + assert(small_rank > 0); + assert(small_rank < large_rank); + assert(large_rank <= test_max_rank); + assert(test_max_rank <= SS_DR_MAX_RANK); /* Compute cube sizes */ small_cube_size = large_cube_size = (size_t)1; @@ -2974,16 +2974,16 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ large_cube_size *= (size_t)edge_size; } /* end for */ - HDassert(large_cube_size < (size_t)(UINT_MAX)); + assert(large_cube_size < (size_t)(UINT_MAX)); small_rank_offset = test_max_rank - small_rank; - HDassert(small_rank_offset >= 1); + assert(small_rank_offset >= 1); /* also, at present, we use 16 bit values in this test -- * hence the following assertion. Delete it if we convert * to 32 bit values. */ - HDassert(large_cube_size < (size_t)(64 * 1024)); + assert(large_cube_size < (size_t)(64 * 1024)); /* Allocate & initialize buffers */ small_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), small_cube_size); @@ -3150,11 +3150,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * need for another inner loop. */ - HDassert((sel_start[0] == 0) || (0 < small_rank_offset)); - HDassert((sel_start[1] == 0) || (1 < small_rank_offset)); - HDassert((sel_start[2] == 0) || (2 < small_rank_offset)); - HDassert((sel_start[3] == 0) || (3 < small_rank_offset)); - HDassert((sel_start[4] == 0) || (4 < small_rank_offset)); + assert((sel_start[0] == 0) || (0 < small_rank_offset)); + assert((sel_start[1] == 0) || (1 < small_rank_offset)); + assert((sel_start[2] == 0) || (2 < small_rank_offset)); + assert((sel_start[3] == 0) || (3 < small_rank_offset)); + assert((sel_start[4] == 0) || (4 < small_rank_offset)); test_select_hyper_checker_board_dr__select_checker_board( file_large_cube_sid, large_rank, edge_size, checker_edge_size, small_rank, sel_start); @@ -3230,11 +3230,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * need for another inner loop. */ - HDassert((sel_start[0] == 0) || (0 < small_rank_offset)); - HDassert((sel_start[1] == 0) || (1 < small_rank_offset)); - HDassert((sel_start[2] == 0) || (2 < small_rank_offset)); - HDassert((sel_start[3] == 0) || (3 < small_rank_offset)); - HDassert((sel_start[4] == 0) || (4 < small_rank_offset)); + assert((sel_start[0] == 0) || (0 < small_rank_offset)); + assert((sel_start[1] == 0) || (1 < small_rank_offset)); + assert((sel_start[2] == 0) || (2 < small_rank_offset)); + assert((sel_start[3] == 0) || (3 < small_rank_offset)); + assert((sel_start[4] == 0) || (4 < small_rank_offset)); test_select_hyper_checker_board_dr__select_checker_board( mem_large_cube_sid, large_rank, edge_size, checker_edge_size, small_rank, sel_start); @@ -3264,8 +3264,8 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ (x * edge_size); stop_index = start_index + small_cube_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= large_cube_size); + assert(start_index < stop_index); + assert(stop_index <= large_cube_size); /* verify that the large cube contains only zeros before the slice */ for (s = 0; s < start_index; s++) { @@ -3273,7 +3273,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ data_ok = FALSE; ptr_1++; } /* end for */ - HDassert(s == start_index); + assert(s == start_index); data_ok &= test_select_hyper_checker_board_dr__verify_data( ptr_1, small_rank, edge_size, checker_edge_size, (uint16_t)0, (hbool_t)TRUE); @@ -3281,7 +3281,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ ptr_1 += small_cube_size; s += small_cube_size; - HDassert(s == stop_index + 1); + assert(s == stop_index + 1); /* verify that the large cube contains only zeros after the slice */ for (s = stop_index + 1; s < large_cube_size; s++) { @@ -3350,11 +3350,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * need for another inner loop. */ - HDassert((sel_start[0] == 0) || (0 < small_rank_offset)); - HDassert((sel_start[1] == 0) || (1 < small_rank_offset)); - HDassert((sel_start[2] == 0) || (2 < small_rank_offset)); - HDassert((sel_start[3] == 0) || (3 < small_rank_offset)); - HDassert((sel_start[4] == 0) || (4 < small_rank_offset)); + assert((sel_start[0] == 0) || (0 < small_rank_offset)); + assert((sel_start[1] == 0) || (1 < small_rank_offset)); + assert((sel_start[2] == 0) || (2 < small_rank_offset)); + assert((sel_start[3] == 0) || (3 < small_rank_offset)); + assert((sel_start[4] == 0) || (4 < small_rank_offset)); test_select_hyper_checker_board_dr__select_checker_board( mem_large_cube_sid, large_rank, edge_size, checker_edge_size, small_rank, sel_start); @@ -3445,11 +3445,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ * need for another inner loop. */ - HDassert((sel_start[0] == 0) || (0 < small_rank_offset)); - HDassert((sel_start[1] == 0) || (1 < small_rank_offset)); - HDassert((sel_start[2] == 0) || (2 < small_rank_offset)); - HDassert((sel_start[3] == 0) || (3 < small_rank_offset)); - HDassert((sel_start[4] == 0) || (4 < small_rank_offset)); + assert((sel_start[0] == 0) || (0 < small_rank_offset)); + assert((sel_start[1] == 0) || (1 < small_rank_offset)); + assert((sel_start[2] == 0) || (2 < small_rank_offset)); + assert((sel_start[3] == 0) || (3 < small_rank_offset)); + assert((sel_start[4] == 0) || (4 < small_rank_offset)); test_select_hyper_checker_board_dr__select_checker_board( file_large_cube_sid, large_rank, edge_size, checker_edge_size, small_rank, sel_start); @@ -3488,8 +3488,8 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ (x * edge_size); stop_index = start_index + small_cube_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= large_cube_size); + assert(start_index < stop_index); + assert(stop_index <= large_cube_size); /* verify that the large cube contains only zeros before the slice */ for (s = 0; s < start_index; s++) { @@ -3497,7 +3497,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ data_ok = FALSE; ptr_1++; } /* end for */ - HDassert(s == start_index); + assert(s == start_index); /* verify that the slice contains the expected data */ data_ok &= test_select_hyper_checker_board_dr__verify_data( @@ -3506,7 +3506,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ ptr_1 += small_cube_size; s += small_cube_size; - HDassert(s == stop_index + 1); + assert(s == stop_index + 1); /* verify that the large cube contains only zeros after the slice */ for (s = stop_index + 1; s < large_cube_size; s++) { @@ -5558,7 +5558,7 @@ test_select_hyper_valid_combination(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Selection Combination Validity\n")); - HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); + assert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for single point selection */ single_pt_sid = H5Screate_simple(SPACE9_RANK, dims2D, NULL); @@ -8448,7 +8448,7 @@ test_shape_same(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Same Shape Comparisons\n")); - HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); + assert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for "all" selection */ all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); @@ -10901,13 +10901,13 @@ test_shape_same_dr__full_space_vs_slice(int test_num, int small_rank, int large_ htri_t check; /* Shape comparison return value */ herr_t ret; /* Generic return value */ - HDassert(0 < small_rank); - HDassert(small_rank <= large_rank); - HDassert(large_rank <= SS_DR_MAX_RANK); - HDassert(0 <= offset); - HDassert(offset < large_rank); - HDassert(edge_size > 0); - HDassert(edge_size <= 1000); + assert(0 < small_rank); + assert(small_rank <= large_rank); + assert(large_rank <= SS_DR_MAX_RANK); + assert(0 <= offset); + assert(offset < large_rank); + assert(edge_size > 0); + assert(edge_size <= 1000); HDsnprintf(test_desc_0, sizeof(test_desc_0), "\tn-cube slice through m-cube (n <= m) test %d.\n", test_num); @@ -10959,7 +10959,7 @@ test_shape_same_dr__full_space_vs_slice(int test_num, int small_rank, int large_ */ i = SS_DR_MAX_RANK - large_rank; - HDassert(i >= 0); + assert(i >= 0); start_ptr = &(start[i]); stride_ptr = &(stride[i]); @@ -11153,21 +11153,21 @@ test_shape_same_dr__checkerboard(int test_num, int small_rank, int large_rank, i htri_t check; /* Shape comparison return value */ herr_t ret; /* Generic return value */ - HDassert(0 < small_rank); - HDassert(small_rank <= large_rank); - HDassert(large_rank <= SS_DR_MAX_RANK); - HDassert(0 < checker_size); - HDassert(checker_size <= edge_size); - HDassert(edge_size <= 1000); - HDassert(0 <= offset); - HDassert(offset < (int)edge_size); + assert(0 < small_rank); + assert(small_rank <= large_rank); + assert(large_rank <= SS_DR_MAX_RANK); + assert(0 < checker_size); + assert(checker_size <= edge_size); + assert(edge_size <= 1000); + assert(0 <= offset); + assert(offset < (int)edge_size); for (i = SS_DR_MAX_RANK - large_rank; i < SS_DR_MAX_RANK; i++) if (dim_selected[i] == TRUE) dims_selected++; - HDassert(dims_selected >= 0); - HDassert(dims_selected <= large_rank); + assert(dims_selected >= 0); + assert(dims_selected <= large_rank); HDsnprintf(test_desc_0, sizeof(test_desc_0), "\tcheckerboard n-cube slice through m-cube (n <= m) test %d.\n", test_num); @@ -11356,7 +11356,7 @@ test_shape_same_dr__checkerboard(int test_num, int small_rank, int large_rank, i */ i = SS_DR_MAX_RANK - large_rank; - HDassert(i >= 0); + assert(i >= 0); start_ptr = &(start[i]); stride_ptr = &(stride[i]); @@ -11697,22 +11697,22 @@ test_shape_same_dr__irregular(int test_num, int small_rank, int large_rank, int htri_t check; /* Shape comparison return value */ herr_t ret; /* Generic return value */ - HDassert(0 < small_rank); - HDassert(small_rank <= large_rank); - HDassert(large_rank <= SS_DR_MAX_RANK); - HDassert(9 <= edge_size); - HDassert(edge_size <= 1000); - HDassert(0 <= slice_offset); - HDassert(slice_offset < edge_size); - HDassert(-2 <= pattern_offset); - HDassert(pattern_offset <= 2); + assert(0 < small_rank); + assert(small_rank <= large_rank); + assert(large_rank <= SS_DR_MAX_RANK); + assert(9 <= edge_size); + assert(edge_size <= 1000); + assert(0 <= slice_offset); + assert(slice_offset < edge_size); + assert(-2 <= pattern_offset); + assert(pattern_offset <= 2); for (i = SS_DR_MAX_RANK - large_rank; i < SS_DR_MAX_RANK; i++) if (dim_selected[i] == TRUE) dims_selected++; - HDassert(dims_selected >= 0); - HDassert(dims_selected <= large_rank); + assert(dims_selected >= 0); + assert(dims_selected <= large_rank); HDsnprintf(test_desc_0, sizeof(test_desc_0), "\tirregular sub set of n-cube slice through m-cube (n <= m) test %d.\n", test_num); @@ -11810,7 +11810,7 @@ test_shape_same_dr__irregular(int test_num, int small_rank, int large_rank, int */ i = SS_DR_MAX_RANK - large_rank; - HDassert(i >= 0); + assert(i >= 0); start_ptr = &(start[i]); stride_ptr = &(stride[i]); @@ -14294,7 +14294,7 @@ test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t endpoints, hssize_t en hsize_t blocklist[12]; herr_t ret; - HDassert(enblocks <= 2); + assert(enblocks <= 2); /* Copy sid to lim_sid */ lim_sid = H5Scopy(sid); @@ -14332,7 +14332,7 @@ test_hyper_unlim_check(hid_t sid, hsize_t *dims, hssize_t endpoints, hssize_t en ERROR("H5Sget_select_hyper_blocklist"); } /* end if */ else { - HDassert(nblocks == (hssize_t)2); + assert(nblocks == (hssize_t)2); if (HDmemcmp(blocklist, eblock1, 6 * sizeof(eblock1[0])) != 0) { if (HDmemcmp(blocklist, eblock2, 6 * sizeof(eblock2[0])) != 0) ERROR("H5Sget_select_hyper_blocklist"); @@ -14760,7 +14760,7 @@ test_internal_consistency(void) /* Output message about test being performed */ MESSAGE(6, ("Testing Consistency of Internal States\n")); - HDassert(SPACE9_DIM2 >= POINT1_NPOINTS); + assert(SPACE9_DIM2 >= POINT1_NPOINTS); /* Create dataspace for "all" selection */ all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL); @@ -15326,7 +15326,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ @@ -15374,7 +15374,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ @@ -15445,7 +15445,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ @@ -15493,7 +15493,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ @@ -15531,7 +15531,7 @@ test_sel_iter(void) case H5S_SEL_ERROR: case H5S_SEL_N: default: - HDassert(0 && "Can't occur"); + assert(0 && "Can't occur"); break; } /* end switch */ diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 0323d5f..24747dc 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -64,46 +64,46 @@ tts_cancel(void) /* make thread scheduling global */ ret = pthread_attr_init(&attribute); - HDassert(ret == 0); + assert(ret == 0); #ifdef H5_HAVE_SYSTEM_SCOPE_THREADS ret = pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); - HDassert(ret == 0); + assert(ret == 0); #endif /* H5_HAVE_SYSTEM_SCOPE_THREADS */ /* Initialize mutex & condition variables */ ret = pthread_mutex_init(&mutex, NULL); - HDassert(ret == 0); + assert(ret == 0); ret = pthread_cond_init(&cond, NULL); - HDassert(ret == 0); + assert(ret == 0); /* * Create a hdf5 file using H5F_ACC_TRUNC access, default file * creation plist and default file access plist */ cancel_file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(cancel_file >= 0); + assert(cancel_file >= 0); ret = pthread_create(&childthread, &attribute, tts_cancel_thread, NULL); - HDassert(ret == 0); + assert(ret == 0); tts_cancel_barrier(); ret = pthread_cancel(childthread); - HDassert(ret == 0); + assert(ret == 0); dataset = H5Dopen2(cancel_file, DATASETNAME, H5P_DEFAULT); - HDassert(dataset >= 0); + assert(dataset >= 0); ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buffer); - HDassert(ret >= 0); + assert(ret >= 0); if (buffer != 11) TestErrPrintf("operation unsuccessful with value at %d instead of 11\n", buffer); ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(cancel_file); - HDassert(ret >= 0); + assert(ret >= 0); /* Destroy the thread attribute */ ret = pthread_attr_destroy(&attribute); - HDassert(ret == 0); + assert(ret == 0); } /* end tts_cancel() */ void * diff --git a/test/tunicode.c b/test/tunicode.c index 27df42d..7bc4c68 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -152,7 +152,7 @@ test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string) /* Create a src_type that holds the UTF-8 string and its final NULL */ big_len = length + 1; /* +1 byte for final NULL */ - HDassert((2 * big_len) <= sizeof(cmpbuf)); + assert((2 * big_len) <= sizeof(cmpbuf)); src_type = mkstr(big_len, H5T_STR_NULLTERM); CHECK(src_type, FAIL, "mkstr"); /* Create a dst_type that holds half of the UTF-8 string and a final @@ -215,7 +215,7 @@ test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string) /* Create a src_type that holds the UTF-8 string */ big_len = length; - HDassert((2 * big_len) <= sizeof(cmpbuf)); + assert((2 * big_len) <= sizeof(cmpbuf)); src_type = mkstr(big_len, H5T_STR_NULLPAD); CHECK(src_type, FAIL, "mkstr"); /* Create a dst_type that holds half of the UTF-8 string */ diff --git a/test/tvltypes.c b/test/tvltypes.c index f8b8056..688bb5d 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -2690,13 +2690,13 @@ test_vltypes_fill_value(void) } break; case H5D_VIRTUAL: - HDassert(0 && "Invalid layout type!"); + assert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert(0 && "Unknown layout type!"); + assert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -2798,13 +2798,13 @@ test_vltypes_fill_value(void) break; case H5D_VIRTUAL: - HDassert(0 && "Invalid layout type!"); + assert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert(0 && "Unknown layout type!"); + assert(0 && "Unknown layout type!"); break; } /* end switch */ @@ -2985,13 +2985,13 @@ test_vltypes_fill_value(void) break; case H5D_VIRTUAL: - HDassert(0 && "Invalid layout type!"); + assert(0 && "Invalid layout type!"); break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDassert(0 && "Unknown layout type!"); + assert(0 && "Unknown layout type!"); break; } /* end switch */ diff --git a/test/vds.c b/test/vds.c index 0f3e0b0..c006673 100644 --- a/test/vds.c +++ b/test/vds.c @@ -277,11 +277,11 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, const char htri_t tri_ret; ssize_t str_len; - HDassert(dcpl >= 0); - HDassert(vspace >= 0); - HDassert(srcspace >= 0); - HDassert(filename); - HDassert(dsetname); + assert(dcpl >= 0); + assert(vspace >= 0); + assert(srcspace >= 0); + assert(filename); + assert(dsetname); /* Check vspace */ if ((space_out = H5Pget_virtual_vspace(dcpl, i)) < 0) @@ -314,7 +314,7 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, const char TEST_ERROR; if ((size_t)str_len != HDstrlen(filename)) TEST_ERROR; - HDassert((size_t)str_len < sizeof(name_out)); + assert((size_t)str_len < sizeof(name_out)); if ((str_len = H5Pget_virtual_filename(dcpl, i, name_out, sizeof(name_out))) < 0) TEST_ERROR; if ((size_t)str_len != HDstrlen(filename)) @@ -327,7 +327,7 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace, const char TEST_ERROR; if ((size_t)str_len != HDstrlen(dsetname)) TEST_ERROR; - HDassert((size_t)str_len < sizeof(name_out)); + assert((size_t)str_len < sizeof(name_out)); if ((str_len = H5Pget_virtual_dsetname(dcpl, i, name_out, sizeof(name_out))) < 0) TEST_ERROR; if ((size_t)str_len != HDstrlen(dsetname)) @@ -368,13 +368,13 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, hid_t *ex H5O_native_info_t ninfo; /* Object info struct */ htri_t tri_ret; - HDassert((config >= TEST_API_BASIC) && (config < TEST_API_NTESTS)); - HDassert(fapl >= 0); - HDassert(dcpl >= 0); - HDassert(ex_dcpl); - HDassert(*ex_dcpl < 0); - HDassert(vspace >= 0); - HDassert(filename); + assert((config >= TEST_API_BASIC) && (config < TEST_API_NTESTS)); + assert(fapl >= 0); + assert(dcpl >= 0); + assert(ex_dcpl); + assert(*ex_dcpl < 0); + assert(vspace >= 0); + assert(filename); /* Take different action depending on test configuration */ if (config >= TEST_API_CREATE_DSET) { diff --git a/test/vfd.c b/test/vfd.c index a9cd241..adacd5e 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -104,7 +104,7 @@ static int __k; \ if ((sizes_array)[idx] == 0) { \ \ - HDassert((idx) > 0); \ + assert((idx) > 0); \ (bool_size_fixed) = TRUE; \ } \ else { \ @@ -131,7 +131,7 @@ static int __k; \ if ((types_array)[idx] == H5FD_MEM_NOLIST) { \ \ - HDassert((idx) > 0); \ + assert((idx) > 0); \ (bool_type_fixed) = TRUE; \ } \ else { \ @@ -4184,7 +4184,7 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a */ fix_point = ((uint32_t)rand() & (count - 1)) / 2; - HDassert(fix_point < count / 2); + assert(fix_point < count / 2); for (i = 0; i < count; i++) { @@ -4475,7 +4475,7 @@ test_vector_io__dump_test_vectors(uint32_t count, H5FD_mem_t types[], haddr_t ad SET_TYPE(type_fixed, types, type, i); - HDassert((H5FD_MEM_DEFAULT <= type) && (type <= H5FD_MEM_OHDR)); + assert((H5FD_MEM_DEFAULT <= type) && (type <= H5FD_MEM_OHDR)); w_buf = (const char *)(write_bufs[i]); @@ -5220,7 +5220,7 @@ test_selection_io(const char *vfd_name) * Test 3: Strided <> Contiguous 1D I/O */ /* SEL_IO_DIM1 must be even */ - HDassert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); + assert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); /* Strided selection in memory */ start[0] = 1; @@ -5269,7 +5269,7 @@ test_selection_io(const char *vfd_name) * Test 4: Contiguous <> Strided 1D I/O */ /* SEL_IO_DIM1 must be even */ - HDassert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); + assert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); /* Contiguous selection in memory */ start[0] = 1; @@ -5318,7 +5318,7 @@ test_selection_io(const char *vfd_name) * Test 5: Strided <> Strided 1D I/O */ /* SEL_IO_DIM1 must be even */ - HDassert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); + assert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); /* Strided selection in memory */ start[0] = 1; @@ -5474,8 +5474,8 @@ test_selection_io(const char *vfd_name) * Test 8: Strided <> Strided 2D I/O */ /* SEL_IO_DIM0 and SEL_IO_DIM1 must be even */ - HDassert(SEL_IO_DIM0 / 2 == (SEL_IO_DIM0 + 1) / 2); - HDassert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); + assert(SEL_IO_DIM0 / 2 == (SEL_IO_DIM0 + 1) / 2); + assert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); /* Strided selection (across dim 1) in memory */ start[0] = 0; @@ -5509,7 +5509,7 @@ test_selection_io(const char *vfd_name) /* Update file buf */ for (i = 0, i2 = 1, j2 = 0; i < SEL_IO_DIM0; i++) for (j = 1; j < SEL_IO_DIM1; j += 2) { - HDassert(i2 < SEL_IO_DIM0); + assert(i2 < SEL_IO_DIM0); fbuf2[i2][j2] = wbuf2[i][j]; if (++j2 == SEL_IO_DIM1) { i2 += 2; @@ -5571,7 +5571,7 @@ test_selection_io(const char *vfd_name) /* Update file buf */ for (i = 1, i2 = 0, j2 = 1; i < (SEL_IO_DIM0 * SEL_IO_DIM1); i += 2) { - HDassert(i2 < SEL_IO_DIM0); + assert(i2 < SEL_IO_DIM0); fbuf2[i2][j2] = wbuf1[i]; j2 += 2; if (j2 >= SEL_IO_DIM1) { @@ -5633,7 +5633,7 @@ test_selection_io(const char *vfd_name) /* Update file buf */ for (i = 0, i2 = 0; i < SEL_IO_DIM0; i += 2) for (j = 0; j < SEL_IO_DIM1; j++) { - HDassert(i2 < (SEL_IO_DIM0 * SEL_IO_DIM1)); + assert(i2 < (SEL_IO_DIM0 * SEL_IO_DIM1)); fbuf1[i2] = wbuf2[i][j]; i2 += 2; } @@ -5668,7 +5668,7 @@ test_selection_io(const char *vfd_name) * Test 11: Strided <> Strided 1D and 2D I/O */ /* SEL_IO_DIM1 must be even */ - HDassert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); + assert(SEL_IO_DIM1 / 2 == (SEL_IO_DIM1 + 1) / 2); /* Strided selection in memory (1D) */ start[0] = 0; @@ -5717,7 +5717,7 @@ test_selection_io(const char *vfd_name) fbuf1[(2 * i) + 1] = wbuf1[2 * i]; for (i = 1, i2 = 0, j2 = 1; i < SEL_IO_DIM0; i += 2) for (j = 0; j < SEL_IO_DIM1; j++) { - HDassert(i2 < SEL_IO_DIM0); + assert(i2 < SEL_IO_DIM0); fbuf2[i2][j2] = wbuf2[i][j]; j2 += 2; if (j2 >= SEL_IO_DIM1) { @@ -5826,7 +5826,7 @@ test_selection_io(const char *vfd_name) * find 1D index into 2D array */ for (i = 0, i2 = 0, j2 = 0; i < SEL_IO_DIM0; i += 2) for (j = 0; j < SEL_IO_DIM1; j++) { - HDassert(i2 < SEL_IO_DIM0); + assert(i2 < SEL_IO_DIM0); fbuf1[(i2 * SEL_IO_DIM1) + j2] = wbuf2[i][j]; j2 += 2; if (j2 >= SEL_IO_DIM1) { @@ -5836,7 +5836,7 @@ test_selection_io(const char *vfd_name) } for (i = 1, i2 = 0, j2 = 1; i < SEL_IO_DIM0; i += 2) for (j = 0; j < SEL_IO_DIM1; j++) { - HDassert(i2 < SEL_IO_DIM0); + assert(i2 < SEL_IO_DIM0); fbuf2[i2][j2] = wbuf2[i][j]; j2 += 2; if (j2 >= SEL_IO_DIM1) { diff --git a/testpar/API/t_chunk_alloc.c b/testpar/API/t_chunk_alloc.c index dd78225..b5c4468 100644 --- a/testpar/API/t_chunk_alloc.c +++ b/testpar/API/t_chunk_alloc.c @@ -275,7 +275,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti case open_only: break; default: - HDassert(0); + assert(0); } /* Close up */ @@ -401,7 +401,7 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in value = 0; break; default: - HDassert(0); + assert(0); } /* verify content of the chunk */ diff --git a/testpar/API/t_dset.c b/testpar/API/t_dset.c index dd8e58c..0bc88c1 100644 --- a/testpar/API/t_dset.c +++ b/testpar/API/t_dset.c @@ -3116,13 +3116,13 @@ test_actual_io_mode(int selection_mode) MPI_Barrier(MPI_COMM_WORLD); - HDassert(mpi_size >= 1); + assert(mpi_size >= 1); mpi_comm = MPI_COMM_WORLD; mpi_info = MPI_INFO_NULL; filename = (const char *)PARATESTFILE /* GetTestParameters() */; - HDassert(filename != NULL); + assert(filename != NULL); /* Setup the file access template */ fapl = create_faccess_plist(mpi_comm, mpi_info, facc_type); @@ -3638,7 +3638,7 @@ test_no_collective_cause_mode(int selection_mode) MPI_Barrier(MPI_COMM_WORLD); - HDassert(mpi_size >= 1); + assert(mpi_size >= 1); mpi_comm = MPI_COMM_WORLD; mpi_info = MPI_INFO_NULL; @@ -3680,7 +3680,7 @@ test_no_collective_cause_mode(int selection_mode) } filename = (const char *)PARATESTFILE /* GetTestParameters() */; - HDassert(filename != NULL); + assert(filename != NULL); /* Setup the file access template */ fapl = create_faccess_plist(mpi_comm, mpi_info, l_facc_type); @@ -4294,7 +4294,7 @@ test_dense_attr(void) /* get filename */ filename = (const char *)PARATESTFILE /* GetTestParameters() */; - HDassert(filename != NULL); + assert(filename != NULL); fpid = H5Pcreate(H5P_FILE_ACCESS); VRFY((fpid > 0), "H5Pcreate succeeded"); diff --git a/testpar/API/t_file.c b/testpar/API/t_file.c index a96f593..1a80dfe 100644 --- a/testpar/API/t_file.c +++ b/testpar/API/t_file.c @@ -727,8 +727,8 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, hsize_t entry_ptr = cache_ptr->index[i]; while (entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(entry_ptr->is_dirty == FALSE); + assert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + assert(entry_ptr->is_dirty == FALSE); if (!entry_ptr->is_pinned && !entry_ptr->is_protected) { ret = H5AC_expunge_entry(f, entry_ptr->type, entry_ptr->addr, 0); diff --git a/testpar/API/t_mdset.c b/testpar/API/t_mdset.c index c53ec2c..47e4b9c 100644 --- a/testpar/API/t_mdset.c +++ b/testpar/API/t_mdset.c @@ -1955,7 +1955,7 @@ rr_obj_hdr_flush_confusion(void) return; } - HDassert(mpi_size > 2); + assert(mpi_size > 2); is_reader = mpi_rank % 2; mrc = MPI_Comm_split(MPI_COMM_WORLD, is_reader, mpi_rank, &comm); @@ -2781,7 +2781,7 @@ chunk_align_bug_1(void) #endif /* Set aggregator size and alignment, disable metadata aggregator */ - HDassert(AGGR_SIZE > CHUNK_SIZE); + assert(AGGR_SIZE > CHUNK_SIZE); ret = H5Pset_small_data_block_size(fapl_id, AGGR_SIZE); VRFY((ret >= 0), "H5Pset_small_data_block_size succeeded"); ret = H5Pset_meta_block_size(fapl_id, 0); diff --git a/testpar/API/t_shapesame.c b/testpar/API/t_shapesame.c index 2a029ab..32980f4 100644 --- a/testpar/API/t_shapesame.c +++ b/testpar/API/t_shapesame.c @@ -151,12 +151,12 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker hid_t large_ds_dcpl_id = H5P_DEFAULT; herr_t ret; /* Generic return value */ - HDassert(edge_size >= 6); - HDassert(edge_size >= chunk_edge_size); - HDassert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); - HDassert(1 < small_rank); - HDassert(small_rank < large_rank); - HDassert(large_rank <= PAR_SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(edge_size >= chunk_edge_size); + assert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); + assert(1 < small_rank); + assert(small_rank < large_rank); + assert(large_rank <= PAR_SS_DR_MAX_RANK); tv_ptr->test_num = test_num; tv_ptr->edge_size = edge_size; @@ -171,7 +171,7 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker /* the VRFY() macro needs the local variable mpi_rank -- set it up now */ mpi_rank = tv_ptr->mpi_rank; - HDassert(tv_ptr->mpi_size >= 1); + assert(tv_ptr->mpi_size >= 1); tv_ptr->mpi_comm = MPI_COMM_WORLD; tv_ptr->mpi_info = MPI_INFO_NULL; @@ -185,8 +185,8 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker /* used by checker board tests only */ tv_ptr->small_ds_offset = PAR_SS_DR_MAX_RANK - tv_ptr->small_rank; - HDassert(0 < tv_ptr->small_ds_offset); - HDassert(tv_ptr->small_ds_offset < PAR_SS_DR_MAX_RANK); + assert(0 < tv_ptr->small_ds_offset); + assert(tv_ptr->small_ds_offset < PAR_SS_DR_MAX_RANK); for (i = 0; i < tv_ptr->large_rank - 1; i++) { @@ -198,8 +198,8 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker /* used by checker board tests only */ tv_ptr->large_ds_offset = PAR_SS_DR_MAX_RANK - tv_ptr->large_rank; - HDassert(0 <= tv_ptr->large_ds_offset); - HDassert(tv_ptr->large_ds_offset < PAR_SS_DR_MAX_RANK); + assert(0 <= tv_ptr->large_ds_offset); + assert(tv_ptr->large_ds_offset < PAR_SS_DR_MAX_RANK); /* set up the start, stride, count, and block pointers */ /* used by contiguous tests only */ @@ -252,7 +252,7 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker HDmemset(tv_ptr->large_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->large_ds_slice_size); filename = filenames[0]; /* (const char *)GetTestParameters(); */ - HDassert(filename != NULL); + assert(filename != NULL); #if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG if (MAINPROCESS) { @@ -1088,8 +1088,8 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= tv_ptr->large_ds_size); + assert(start_index < stop_index); + assert(stop_index <= tv_ptr->large_ds_size); for (n = 0; n < tv_ptr->large_ds_size; n++) { @@ -1364,8 +1364,8 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t *tv_ptr) start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size; stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= tv_ptr->small_ds_size); + assert(start_index < stop_index); + assert(stop_index <= tv_ptr->small_ds_size); for (n = 0; n < tv_ptr->small_ds_size; n++) { @@ -1653,8 +1653,8 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index < tv_ptr->large_ds_size); + assert(start_index < stop_index); + assert(stop_index < tv_ptr->large_ds_size); for (n = 0; n < tv_ptr->large_ds_size; n++) { @@ -2076,20 +2076,20 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, const hid_t tgt_sid, cons hsize_t block[PAR_SS_DR_MAX_RANK]; herr_t ret; /* Generic return value */ - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(0 < sel_rank); - HDassert(sel_rank <= tgt_rank); - HDassert(tgt_rank <= test_max_rank); - HDassert(test_max_rank <= PAR_SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(0 < sel_rank); + assert(sel_rank <= tgt_rank); + assert(tgt_rank <= test_max_rank); + assert(test_max_rank <= PAR_SS_DR_MAX_RANK); sel_offset = test_max_rank - sel_rank; - HDassert(sel_offset >= 0); + assert(sel_offset >= 0); n_cube_offset = test_max_rank - tgt_rank; - HDassert(n_cube_offset >= 0); - HDassert(n_cube_offset <= sel_offset); + assert(n_cube_offset >= 0); + assert(n_cube_offset <= sel_offset); #if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s:%d: edge_size/checker_edge_size = %d/%d\n", fcnName, mpi_rank, edge_size, @@ -2407,13 +2407,13 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t *buf_ptr, const int rank, const int int v, w, x, y, z; /* to track position in checker */ const int test_max_rank = 5; /* code changes needed if this is increased */ - HDassert(buf_ptr != NULL); - HDassert(0 < rank); - HDassert(rank <= test_max_rank); - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(test_max_rank <= PAR_SS_DR_MAX_RANK); + assert(buf_ptr != NULL); + assert(0 < rank); + assert(rank <= test_max_rank); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(test_max_rank <= PAR_SS_DR_MAX_RANK); #if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG @@ -2702,11 +2702,11 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t *tv_ptr) tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDassert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); ckrbrd_hs_dr_pio_test__slct_ckrbrd( tv_ptr->mpi_rank, tv_ptr->file_large_ds_sid_0, tv_ptr->large_rank, tv_ptr->edge_size, @@ -2926,11 +2926,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDassert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); ckrbrd_hs_dr_pio_test__slct_ckrbrd( tv_ptr->mpi_rank, tv_ptr->mem_large_ds_sid, tv_ptr->large_rank, tv_ptr->edge_size, @@ -2991,8 +2991,8 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) } #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ - HDassert(start_index < stop_index); - HDassert(stop_index <= tv_ptr->large_ds_size); + assert(start_index < stop_index); + assert(stop_index <= tv_ptr->large_ds_size); for (u = 0; u < start_index; u++) { @@ -3248,11 +3248,11 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t *tv_ptr) tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDassert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); ckrbrd_hs_dr_pio_test__slct_ckrbrd( tv_ptr->mpi_rank, tv_ptr->mem_large_ds_sid, tv_ptr->large_rank, tv_ptr->edge_size, @@ -3298,8 +3298,8 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t *tv_ptr) start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size; stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= tv_ptr->small_ds_size); + assert(start_index < stop_index); + assert(stop_index <= tv_ptr->small_ds_size); data_ok = TRUE; @@ -3541,11 +3541,11 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDassert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); ckrbrd_hs_dr_pio_test__slct_ckrbrd( tv_ptr->mpi_rank, tv_ptr->file_large_ds_sid_1, tv_ptr->large_rank, tv_ptr->edge_size, @@ -3594,8 +3594,8 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index < tv_ptr->large_ds_size); + assert(start_index < stop_index); + assert(stop_index < tv_ptr->large_ds_size); data_ok = TRUE; diff --git a/testpar/API/t_span_tree.c b/testpar/API/t_span_tree.c index 5aafb0b..e3148a6 100644 --- a/testpar/API/t_span_tree.c +++ b/testpar/API/t_span_tree.c @@ -1038,21 +1038,21 @@ lower_dim_size_comp_test__select_checker_board(const int mpi_rank, const hid_t t } #endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ - HDassert(0 < checker_edge_size); - HDassert(0 < sel_rank); - HDassert(sel_rank <= tgt_rank); - HDassert(tgt_rank <= test_max_rank); - HDassert(test_max_rank <= LDSCT_DS_RANK); + assert(0 < checker_edge_size); + assert(0 < sel_rank); + assert(sel_rank <= tgt_rank); + assert(tgt_rank <= test_max_rank); + assert(test_max_rank <= LDSCT_DS_RANK); sel_offset = test_max_rank - sel_rank; - HDassert(sel_offset >= 0); + assert(sel_offset >= 0); ds_offset = test_max_rank - tgt_rank; - HDassert(ds_offset >= 0); - HDassert(ds_offset <= sel_offset); + assert(ds_offset >= 0); + assert(ds_offset <= sel_offset); - HDassert((hsize_t)checker_edge_size <= dims[sel_offset]); - HDassert(dims[sel_offset] == 10); + assert((hsize_t)checker_edge_size <= dims[sel_offset]); + assert(dims[sel_offset] == 10); #if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if (mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK) { @@ -1389,13 +1389,13 @@ lower_dim_size_comp_test__verify_data(uint32_t *buf_ptr, int v, w, x, y, z; /* to track position in checker */ const int test_max_rank = 5; /* code changes needed if this is increased */ - HDassert(buf_ptr != NULL); - HDassert(0 < rank); - HDassert(rank <= test_max_rank); - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(test_max_rank <= LDSCT_DS_RANK); + assert(buf_ptr != NULL); + assert(0 < rank); + assert(rank <= test_max_rank); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(test_max_rank <= LDSCT_DS_RANK); #if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG if (mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK) { @@ -1598,7 +1598,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - HDassert(mpi_size >= 1); + assert(mpi_size >= 1); mpi_comm = MPI_COMM_WORLD; mpi_info = MPI_INFO_NULL; @@ -1667,7 +1667,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ /* get the file name */ filename = (const char *)PARATESTFILE /* GetTestParameters() */; - HDassert(filename != NULL); + assert(filename != NULL); /* ---------------------------------------- * CREATE AN HDF5 FILE WITH PARALLEL ACCESS @@ -2160,9 +2160,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ stop_index = start_index + (int)small_ds_slice_size; - HDassert(0 <= start_index); - HDassert(start_index < stop_index); - HDassert(stop_index <= (int)large_ds_size); + assert(0 <= start_index); + assert(start_index < stop_index); + assert(stop_index <= (int)large_ds_size); ptr_1 = large_ds_buf_1; @@ -2260,9 +2260,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ stop_index = start_index + (int)small_ds_slice_size; - HDassert(0 <= start_index); - HDassert(start_index < stop_index); - HDassert(stop_index <= (int)small_ds_size); + assert(0 <= start_index); + assert(start_index < stop_index); + assert(stop_index <= (int)small_ds_size); ptr_1 = small_ds_buf_1; @@ -2490,11 +2490,11 @@ link_chunk_collective_io_test(void) return; } - HDassert(mpi_size > 0); + assert(mpi_size > 0); /* get the file name */ filename = (const char *)PARATESTFILE /* GetTestParameters() */; - HDassert(filename != NULL); + assert(filename != NULL); /* setup file access template */ acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type); diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index 8b67dd9..74080c6 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -3408,13 +3408,13 @@ test_actual_io_mode(int selection_mode) MPI_Barrier(test_comm); - HDassert(mpi_size >= 1); + assert(mpi_size >= 1); mpi_comm = test_comm; mpi_info = MPI_INFO_NULL; filename = (const char *)GetTestParameters(); - HDassert(filename != NULL); + assert(filename != NULL); /* Setup the file access template */ fapl_id = create_faccess_plist(mpi_comm, mpi_info, facc_type); @@ -3906,7 +3906,7 @@ test_no_collective_cause_mode(int selection_mode) MPI_Barrier(test_comm); - HDassert(mpi_size >= 1); + assert(mpi_size >= 1); mpi_comm = test_comm; mpi_info = MPI_INFO_NULL; @@ -3948,7 +3948,7 @@ test_no_collective_cause_mode(int selection_mode) } filename = (const char *)GetTestParameters(); - HDassert(filename != NULL); + assert(filename != NULL); /* Setup the file access template */ fapl_id = create_faccess_plist(mpi_comm, mpi_info, l_facc_type); @@ -4577,7 +4577,7 @@ test_dense_attr(void) /* get filename */ filename = (const char *)GetTestParameters(); - HDassert(filename != NULL); + assert(filename != NULL); /* set up MPI parameters */ MPI_Comm_size(test_comm, &mpi_size); diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 2507c7e..a9486a4 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -747,8 +747,8 @@ init_data(void) haddr_t addr = BASE_ADDR; /* this must hold so moves don't change entry size. */ - HDassert((NUM_DATA_ENTRIES / 2) % 20 == 0); - HDassert((virt_num_data_entries / 2) % 20 == 0); + assert((NUM_DATA_ENTRIES / 2) % 20 == 0); + assert((virt_num_data_entries / 2) % 20 == 0); for (i = 0; i < NUM_DATA_ENTRIES; i++) { data[i].base_addr = addr; @@ -770,7 +770,7 @@ init_data(void) data_index[i] = i; addr += addr_offsets[j]; - HDassert(addr > data[i].base_addr); + assert(addr > data[i].base_addr); j = (j + 1) % num_addr_offsets; } @@ -2134,20 +2134,20 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr) int idx; struct datum *entry_ptr; - HDassert(udata_ptr); - HDassert(image_len_ptr); + assert(udata_ptr); + assert(image_len_ptr); idx = addr_to_datum_index(addr); - HDassert(idx >= 0); - HDassert(idx < NUM_DATA_ENTRIES); - HDassert(idx < virt_num_data_entries); + assert(idx >= 0); + assert(idx < NUM_DATA_ENTRIES); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(addr == entry_ptr->base_addr); - HDassert(!entry_ptr->global_pinned); - HDassert(!entry_ptr->local_pinned); + assert(addr == entry_ptr->base_addr); + assert(!entry_ptr->global_pinned); + assert(!entry_ptr->local_pinned); if (callbacks_verbose) { @@ -2183,21 +2183,21 @@ datum_deserialize(const void H5_ATTR_NDEBUG_UNUSED *image_ptr, H5_ATTR_UNUSED si int idx; struct datum *entry_ptr = NULL; - HDassert(image_ptr != NULL); + assert(image_ptr != NULL); idx = addr_to_datum_index(addr); - HDassert(idx >= 0); - HDassert(idx < NUM_DATA_ENTRIES); - HDassert(idx < virt_num_data_entries); + assert(idx >= 0); + assert(idx < NUM_DATA_ENTRIES); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(addr == entry_ptr->base_addr); - HDassert(!entry_ptr->global_pinned); - HDassert(!entry_ptr->local_pinned); + assert(addr == entry_ptr->base_addr); + assert(!entry_ptr->global_pinned); + assert(!entry_ptr->local_pinned); - HDassert(dirty_ptr); + assert(dirty_ptr); if (callbacks_verbose) { @@ -2238,19 +2238,19 @@ datum_image_len(const void *thing, size_t *image_len) int idx; const struct datum *entry_ptr; - HDassert(thing); - HDassert(image_len); + assert(thing); + assert(image_len); entry_ptr = (const struct datum *)thing; idx = addr_to_datum_index(entry_ptr->base_addr); - HDassert(idx >= 0); - HDassert(idx < NUM_DATA_ENTRIES); - HDassert(idx < virt_num_data_entries); - HDassert(&(data[idx]) == entry_ptr); - HDassert(entry_ptr->local_len > 0); - HDassert(entry_ptr->local_len <= entry_ptr->len); + assert(idx >= 0); + assert(idx < NUM_DATA_ENTRIES); + assert(idx < virt_num_data_entries); + assert(&(data[idx]) == entry_ptr); + assert(entry_ptr->local_len > 0); + assert(entry_ptr->local_len <= entry_ptr->len); if (callbacks_verbose) { HDfprintf(stdout, "%d: image_len() idx = %d, addr = %ld, len = %d.\n", world_mpi_rank, idx, @@ -2258,7 +2258,7 @@ datum_image_len(const void *thing, size_t *image_len) fflush(stdout); } - HDassert(entry_ptr->header.addr == entry_ptr->base_addr); + assert(entry_ptr->header.addr == entry_ptr->base_addr); *image_len = entry_ptr->local_len; @@ -2285,28 +2285,28 @@ datum_serialize(const H5F_t *f, void H5_ATTR_NDEBUG_UNUSED *image_ptr, size_t le struct datum *entry_ptr; struct H5AC_aux_t *aux_ptr; - HDassert(thing_ptr); - HDassert(image_ptr); + assert(thing_ptr); + assert(image_ptr); entry_ptr = (struct datum *)thing_ptr; - HDassert(f); - HDassert(f->shared); - HDassert(f->shared->cache); - HDassert(f->shared->cache->aux_ptr); + assert(f); + assert(f->shared); + assert(f->shared->cache); + assert(f->shared->cache->aux_ptr); aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr); - HDassert(aux_ptr); + assert(aux_ptr); entry_ptr->aux_ptr = aux_ptr; idx = addr_to_datum_index(entry_ptr->base_addr); - HDassert(idx >= 0); - HDassert(idx < NUM_DATA_ENTRIES); - HDassert(idx < virt_num_data_entries); - HDassert(&(data[idx]) == entry_ptr); + assert(idx >= 0); + assert(idx < NUM_DATA_ENTRIES); + assert(idx < virt_num_data_entries); + assert(&(data[idx]) == entry_ptr); if (callbacks_verbose) { @@ -2315,17 +2315,17 @@ datum_serialize(const H5F_t *f, void H5_ATTR_NDEBUG_UNUSED *image_ptr, size_t le fflush(stdout); } - HDassert(entry_ptr->header.addr == entry_ptr->base_addr); - HDassert((entry_ptr->header.size == entry_ptr->len) || (entry_ptr->header.size == entry_ptr->local_len)); + assert(entry_ptr->header.addr == entry_ptr->base_addr); + assert((entry_ptr->header.size == entry_ptr->len) || (entry_ptr->header.size == entry_ptr->local_len)); - HDassert(entry_ptr->header.is_dirty == entry_ptr->dirty); + assert(entry_ptr->header.is_dirty == entry_ptr->dirty); datum_flushes++; if (entry_ptr->header.is_pinned) { datum_pinned_flushes++; - HDassert(entry_ptr->global_pinned || entry_ptr->local_pinned); + assert(entry_ptr->global_pinned || entry_ptr->local_pinned); } return (ret_value); @@ -2355,16 +2355,16 @@ datum_notify(H5C_notify_action_t action, void *thing) struct mssg_t mssg; int idx; - HDassert(thing); + assert(thing); entry_ptr = (struct datum *)thing; idx = addr_to_datum_index(entry_ptr->base_addr); - HDassert(idx >= 0); - HDassert(idx < NUM_DATA_ENTRIES); - HDassert(idx < virt_num_data_entries); - HDassert(&(data[idx]) == entry_ptr); + assert(idx >= 0); + assert(idx < NUM_DATA_ENTRIES); + assert(idx < virt_num_data_entries); + assert(&(data[idx]) == entry_ptr); if (callbacks_verbose) { @@ -2373,14 +2373,14 @@ datum_notify(H5C_notify_action_t action, void *thing) fflush(stdout); } - HDassert(entry_ptr->header.addr == entry_ptr->base_addr); + assert(entry_ptr->header.addr == entry_ptr->base_addr); /* Skip this check when the entry is being dirtied, since the resize * operation sends the message before the len/local_len is updated * (after the resize operation completes successfully) (QAK - 2016/10/19) */ if (H5AC_NOTIFY_ACTION_ENTRY_DIRTIED != action) - HDassert((entry_ptr->header.size == entry_ptr->len) || - (entry_ptr->header.size == entry_ptr->local_len)); + assert((entry_ptr->header.size == entry_ptr->len) || + (entry_ptr->header.size == entry_ptr->local_len)); switch (action) { case H5AC_NOTIFY_ACTION_AFTER_INSERT: @@ -2523,11 +2523,11 @@ datum_notify(H5C_notify_action_t action, void *thing) fflush(stdout); } - HDassert(entry_ptr->aux_ptr); + assert(entry_ptr->aux_ptr); aux_ptr = entry_ptr->aux_ptr; entry_ptr->aux_ptr = NULL; - HDassert(entry_ptr->header.is_dirty); /* JRM */ + assert(entry_ptr->header.is_dirty); /* JRM */ if ((file_mpi_rank != 0) && (entry_ptr->dirty) && (aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY)) { @@ -2603,7 +2603,7 @@ datum_notify(H5C_notify_action_t action, void *thing) if (entry_ptr->header.is_pinned) { datum_pinned_flushes++; - HDassert(entry_ptr->global_pinned || entry_ptr->local_pinned); + assert(entry_ptr->global_pinned || entry_ptr->local_pinned); } break; @@ -2644,7 +2644,7 @@ datum_notify(H5C_notify_action_t action, void *thing) if (entry_ptr->header.is_pinned) { datum_pinned_clears++; - HDassert(entry_ptr->global_pinned || entry_ptr->local_pinned); + assert(entry_ptr->global_pinned || entry_ptr->local_pinned); } /* end if */ break; @@ -2728,16 +2728,16 @@ datum_free_icr(void *thing) int idx; struct datum *entry_ptr; - HDassert(thing); + assert(thing); entry_ptr = (struct datum *)thing; idx = addr_to_datum_index(entry_ptr->base_addr); - HDassert(idx >= 0); - HDassert(idx < NUM_DATA_ENTRIES); - HDassert(idx < virt_num_data_entries); - HDassert(&(data[idx]) == entry_ptr); + assert(idx >= 0); + assert(idx < NUM_DATA_ENTRIES); + assert(idx < virt_num_data_entries); + assert(&(data[idx]) == entry_ptr); if (callbacks_verbose) { @@ -2746,13 +2746,13 @@ datum_free_icr(void *thing) fflush(stdout); } - HDassert(entry_ptr->header.addr == entry_ptr->base_addr); - HDassert((entry_ptr->header.size == entry_ptr->len) || (entry_ptr->header.size == entry_ptr->local_len)); + assert(entry_ptr->header.addr == entry_ptr->base_addr); + assert((entry_ptr->header.size == entry_ptr->len) || (entry_ptr->header.size == entry_ptr->local_len)); - HDassert(!(entry_ptr->header.is_dirty)); - HDassert(!(entry_ptr->global_pinned)); - HDassert(!(entry_ptr->local_pinned)); - HDassert(!(entry_ptr->header.is_pinned)); + assert(!(entry_ptr->header.is_dirty)); + assert(!(entry_ptr->global_pinned)); + assert(!(entry_ptr->local_pinned)); + assert(!(entry_ptr->header.is_pinned)); datum_destroys++; @@ -2784,15 +2784,15 @@ expunge_entry(H5F_t *file_ptr, int32_t idx) herr_t result; struct datum *entry_ptr; - HDassert(file_ptr); - HDassert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); - HDassert(idx < virt_num_data_entries); + assert(file_ptr); + assert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(!(entry_ptr->locked)); - HDassert(!(entry_ptr->global_pinned)); - HDassert(!(entry_ptr->local_pinned)); + assert(!(entry_ptr->locked)); + assert(!(entry_ptr->global_pinned)); + assert(!(entry_ptr->local_pinned)); entry_ptr->dirty = FALSE; @@ -2808,8 +2808,8 @@ expunge_entry(H5F_t *file_ptr, int32_t idx) } } - HDassert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); - HDassert(!((entry_ptr->header).is_dirty)); + assert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); + assert(!((entry_ptr->header).is_dirty)); result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr, NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2855,14 +2855,14 @@ insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags) herr_t result; struct datum *entry_ptr; - HDassert(cache_ptr); - HDassert(file_ptr); - HDassert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); - HDassert(idx < virt_num_data_entries); + assert(cache_ptr); + assert(file_ptr); + assert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(!(entry_ptr->locked)); + assert(!(entry_ptr->locked)); insert_pinned = ((flags & H5C__PIN_ENTRY_FLAG) != 0); @@ -2907,18 +2907,18 @@ insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags) if (insert_pinned) { - HDassert(entry_ptr->header.is_pinned); + assert(entry_ptr->header.is_pinned); entry_ptr->global_pinned = TRUE; global_pins++; } else { - HDassert(!(entry_ptr->header.is_pinned)); + assert(!(entry_ptr->header.is_pinned)); entry_ptr->global_pinned = FALSE; } - /* HDassert( entry_ptr->header.is_dirty ); */ - HDassert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); + /* assert( entry_ptr->header.is_dirty ); */ + assert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); } return; @@ -2950,18 +2950,18 @@ local_pin_and_unpin_random_entries(H5F_t *file_ptr, int min_idx, int max_idx, in int i; int idx; - HDassert(file_ptr); - HDassert(0 <= min_idx); - HDassert(min_idx < max_idx); - HDassert(max_idx < NUM_DATA_ENTRIES); - HDassert(max_idx < virt_num_data_entries); - HDassert(0 <= min_count); - HDassert(min_count < max_count); + assert(file_ptr); + assert(0 <= min_idx); + assert(min_idx < max_idx); + assert(max_idx < NUM_DATA_ENTRIES); + assert(max_idx < virt_num_data_entries); + assert(0 <= min_count); + assert(min_count < max_count); count = (HDrand() % (max_count - min_count)) + min_count; - HDassert(min_count <= count); - HDassert(count <= max_count); + assert(min_count <= count); + assert(count <= max_count); for (i = 0; i < count; i++) { local_pin_random_entry(file_ptr, min_idx, max_idx); @@ -2969,8 +2969,8 @@ local_pin_and_unpin_random_entries(H5F_t *file_ptr, int min_idx, int max_idx, in count = (HDrand() % (max_count - min_count)) + min_count; - HDassert(min_count <= count); - HDassert(count <= max_count); + assert(min_count <= count); + assert(count <= max_count); i = 0; idx = 0; @@ -3009,16 +3009,16 @@ local_pin_random_entry(H5F_t *file_ptr, int min_idx, int max_idx) if (nerrors == 0) { - HDassert(file_ptr); - HDassert(0 <= min_idx); - HDassert(min_idx < max_idx); - HDassert(max_idx < NUM_DATA_ENTRIES); - HDassert(max_idx < virt_num_data_entries); + assert(file_ptr); + assert(0 <= min_idx); + assert(min_idx < max_idx); + assert(max_idx < NUM_DATA_ENTRIES); + assert(max_idx < virt_num_data_entries); do { idx = (HDrand() % (max_idx - min_idx)) + min_idx; - HDassert(min_idx <= idx); - HDassert(idx <= max_idx); + assert(min_idx <= idx); + assert(idx <= max_idx); } while (data[idx].global_pinned || data[idx].local_pinned); pin_entry(file_ptr, idx, FALSE, FALSE); @@ -3049,7 +3049,7 @@ local_unpin_all_entries(H5F_t *file_ptr, hbool_t via_unprotect) int idx; - HDassert(file_ptr); + assert(file_ptr); idx = 0; @@ -3086,10 +3086,10 @@ local_unpin_next_pinned_entry(H5F_t *file_ptr, int start_idx, hbool_t via_unprot if (nerrors == 0) { - HDassert(file_ptr); - HDassert(0 <= start_idx); - HDassert(start_idx < NUM_DATA_ENTRIES); - HDassert(start_idx < virt_num_data_entries); + assert(file_ptr); + assert(0 <= start_idx); + assert(start_idx < NUM_DATA_ENTRIES); + assert(start_idx < virt_num_data_entries); idx = start_idx; @@ -3138,14 +3138,14 @@ lock_and_unlock_random_entries(H5F_t *file_ptr, int min_idx, int max_idx, int mi if (nerrors == 0) { - HDassert(file_ptr); - HDassert(0 <= min_count); - HDassert(min_count < max_count); + assert(file_ptr); + assert(0 <= min_count); + assert(min_count < max_count); count = (HDrand() % (max_count - min_count)) + min_count; - HDassert(min_count <= count); - HDassert(count <= max_count); + assert(min_count <= count); + assert(count <= max_count); for (i = 0; i < count; i++) { lock_and_unlock_random_entry(file_ptr, min_idx, max_idx); @@ -3177,16 +3177,16 @@ lock_and_unlock_random_entry(H5F_t *file_ptr, int min_idx, int max_idx) if (nerrors == 0) { - HDassert(file_ptr); - HDassert(0 <= min_idx); - HDassert(min_idx < max_idx); - HDassert(max_idx < NUM_DATA_ENTRIES); - HDassert(max_idx < virt_num_data_entries); + assert(file_ptr); + assert(0 <= min_idx); + assert(min_idx < max_idx); + assert(max_idx < NUM_DATA_ENTRIES); + assert(max_idx < virt_num_data_entries); idx = (HDrand() % (max_idx - min_idx)) + min_idx; - HDassert(min_idx <= idx); - HDassert(idx <= max_idx); + assert(min_idx <= idx); + assert(idx <= max_idx); lock_entry(file_ptr, idx); unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET); @@ -3217,12 +3217,12 @@ lock_entry(H5F_t *file_ptr, int32_t idx) if (nerrors == 0) { - HDassert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); - HDassert(idx < virt_num_data_entries); + assert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(!(entry_ptr->locked)); + assert(!(entry_ptr->locked)); cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, &(types[0]), entry_ptr->base_addr, &entry_ptr->base_addr, H5AC__NO_FLAGS_SET); @@ -3242,7 +3242,7 @@ lock_entry(H5F_t *file_ptr, int32_t idx) entry_ptr->locked = TRUE; } - HDassert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); + assert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); } return; @@ -3270,13 +3270,13 @@ mark_entry_dirty(int32_t idx) if (nerrors == 0) { - HDassert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); - HDassert(idx < virt_num_data_entries); + assert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(entry_ptr->locked || entry_ptr->global_pinned); - HDassert(!(entry_ptr->local_pinned)); + assert(entry_ptr->locked || entry_ptr->global_pinned); + assert(!(entry_ptr->local_pinned)); (entry_ptr->ver)++; entry_ptr->dirty = TRUE; @@ -3320,15 +3320,15 @@ pin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty) if (nerrors == 0) { - HDassert(file_ptr); - HDassert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); - HDassert(idx < virt_num_data_entries); + assert(file_ptr); + assert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(!(entry_ptr->global_pinned)); - HDassert(!(entry_ptr->local_pinned)); - HDassert(!(dirty && (!global))); + assert(!(entry_ptr->global_pinned)); + assert(!(entry_ptr->local_pinned)); + assert(!(dirty && (!global))); lock_entry(file_ptr, idx); @@ -3339,8 +3339,8 @@ pin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty) unlock_entry(file_ptr, idx, flags); - HDassert((entry_ptr->header).is_pinned); - HDassert((!dirty) || ((entry_ptr->header).is_dirty)); + assert((entry_ptr->header).is_pinned); + assert((!dirty) || ((entry_ptr->header).is_dirty)); if (global) { @@ -3380,12 +3380,12 @@ pin_protected_entry(int32_t idx, hbool_t global) herr_t result; struct datum *entry_ptr; - HDassert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); - HDassert(idx < virt_num_data_entries); + assert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(entry_ptr->locked); + assert(entry_ptr->locked); if (nerrors == 0) { @@ -3415,7 +3415,7 @@ pin_protected_entry(int32_t idx, hbool_t global) local_pins++; } - HDassert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); + assert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); } return; @@ -3451,19 +3451,19 @@ move_entry(H5F_t *file_ptr, int32_t old_idx, int32_t new_idx) if ((nerrors == 0) && (old_idx != new_idx)) { - HDassert(file_ptr); - HDassert((0 <= old_idx) && (old_idx < NUM_DATA_ENTRIES)); - HDassert(old_idx < virt_num_data_entries); - HDassert((0 <= new_idx) && (new_idx < NUM_DATA_ENTRIES)); - HDassert(new_idx < virt_num_data_entries); + assert(file_ptr); + assert((0 <= old_idx) && (old_idx < NUM_DATA_ENTRIES)); + assert(old_idx < virt_num_data_entries); + assert((0 <= new_idx) && (new_idx < NUM_DATA_ENTRIES)); + assert(new_idx < virt_num_data_entries); old_entry_ptr = &(data[old_idx]); new_entry_ptr = &(data[new_idx]); - HDassert(((old_entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); - HDassert(!(old_entry_ptr->header.is_protected)); - HDassert(!(old_entry_ptr->locked)); - HDassert(old_entry_ptr->len == new_entry_ptr->len); + assert(((old_entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); + assert(!(old_entry_ptr->header.is_protected)); + assert(!(old_entry_ptr->locked)); + assert(old_entry_ptr->len == new_entry_ptr->len); old_addr = old_entry_ptr->base_addr; new_addr = new_entry_ptr->base_addr; @@ -3507,7 +3507,7 @@ move_entry(H5F_t *file_ptr, int32_t old_idx, int32_t new_idx) } else { - HDassert(((old_entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); + assert(((old_entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); if (!(old_entry_ptr->header.is_dirty)) { @@ -3532,7 +3532,7 @@ move_entry(H5F_t *file_ptr, int32_t old_idx, int32_t new_idx) } else { - HDassert(old_entry_ptr->header.is_dirty); + assert(old_entry_ptr->header.is_dirty); } } } @@ -3632,18 +3632,18 @@ resize_entry(int32_t idx, size_t new_size) if (nerrors == 0) { - HDassert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); - HDassert(idx < virt_num_data_entries); + assert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); - HDassert(!(entry_ptr->locked)); - HDassert((entry_ptr->global_pinned) && (!entry_ptr->local_pinned)); - HDassert((entry_ptr->header.size == entry_ptr->len) || - (entry_ptr->header.size == entry_ptr->local_len)); - HDassert(new_size > 0); - HDassert(new_size <= entry_ptr->len); + assert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); + assert(!(entry_ptr->locked)); + assert((entry_ptr->global_pinned) && (!entry_ptr->local_pinned)); + assert((entry_ptr->header.size == entry_ptr->len) || + (entry_ptr->header.size == entry_ptr->local_len)); + assert(new_size > 0); + assert(new_size <= entry_ptr->len); result = H5AC_resize_entry((void *)entry_ptr, new_size); @@ -3656,9 +3656,9 @@ resize_entry(int32_t idx, size_t new_size) } else { - HDassert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); - HDassert(entry_ptr->header.is_dirty); - HDassert(entry_ptr->header.size == new_size); + assert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); + assert(entry_ptr->header.is_dirty); + assert(entry_ptr->header.size == new_size); entry_ptr->dirty = TRUE; entry_ptr->local_len = new_size; @@ -3704,9 +3704,9 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr H5C_t *cache_ptr = NULL; haddr_t actual_base_addr; - HDassert(fid_ptr != NULL); - HDassert(file_ptr_ptr != NULL); - HDassert(cache_ptr_ptr != NULL); + assert(fid_ptr != NULL); + assert(file_ptr_ptr != NULL); + assert(cache_ptr_ptr != NULL); fid = H5Fcreate(filenames[0], H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -3937,8 +3937,8 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl) hbool_t proceed = TRUE; unsigned u = 0; - HDassert(world_mpi_rank != world_server_mpi_rank); - HDassert((num_writes == 0) || (written_entries_tbl != NULL)); + assert(world_mpi_rank != world_server_mpi_rank); + assert((num_writes == 0) || (written_entries_tbl != NULL)); /* barrier to ensure that all other processes are ready to leave * the sync point as well. @@ -4043,8 +4043,8 @@ setup_rand(void) if ((use_predefined_seeds) && (world_mpi_size == num_predefined_seeds)) { - HDassert(world_mpi_rank >= 0); - HDassert(world_mpi_rank < world_mpi_size); + assert(world_mpi_rank >= 0); + assert(world_mpi_rank < world_mpi_size); seed = predefined_seeds[world_mpi_rank]; HDfprintf(stdout, "%d:%s: predefined_seed = %d.\n", world_mpi_rank, __func__, seed); @@ -4564,13 +4564,13 @@ unlock_entry(H5F_t *file_ptr, int32_t idx, unsigned int flags) if (nerrors == 0) { - HDassert(file_ptr); - HDassert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); - HDassert(idx < virt_num_data_entries); + assert(file_ptr); + assert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert(entry_ptr->locked); + assert(entry_ptr->locked); dirtied = ((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG); @@ -4598,13 +4598,13 @@ unlock_entry(H5F_t *file_ptr, int32_t idx, unsigned int flags) entry_ptr->locked = FALSE; } - HDassert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); + assert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE); if (((flags & H5AC__DIRTIED_FLAG) != 0) && ((flags & H5C__DELETED_FLAG) == 0) && (!(((world_mpi_rank == 0) && (entry_ptr->flushed)) || ((world_mpi_rank != 0) && (entry_ptr->cleared))))) { - HDassert(entry_ptr->header.is_dirty); - HDassert(entry_ptr->dirty); + assert(entry_ptr->header.is_dirty); + assert(entry_ptr->dirty); } } @@ -4634,16 +4634,16 @@ unpin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t if (nerrors == 0) { - HDassert(file_ptr); - HDassert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); - HDassert(idx < virt_num_data_entries); + assert(file_ptr); + assert((0 <= idx) && (idx < NUM_DATA_ENTRIES)); + assert(idx < virt_num_data_entries); entry_ptr = &(data[idx]); - HDassert((entry_ptr->header).is_pinned); - HDassert(!(entry_ptr->global_pinned && entry_ptr->local_pinned)); - HDassert((global && entry_ptr->global_pinned) || (!global && entry_ptr->local_pinned)); - HDassert(!(dirty && (!global))); + assert((entry_ptr->header).is_pinned); + assert(!(entry_ptr->global_pinned && entry_ptr->local_pinned)); + assert((global && entry_ptr->global_pinned) || (!global && entry_ptr->local_pinned)); + assert(!(dirty && (!global))); if (via_unprotect) { @@ -4674,7 +4674,7 @@ unpin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t } } - HDassert(!((entry_ptr->header).is_pinned)); + assert(!((entry_ptr->header).is_pinned)); if (global) { @@ -5132,8 +5132,8 @@ smoke_check_1(int metadata_write_strategy) */ for (i = 0; i < NUM_DATA_ENTRIES; i++) { - HDassert(data_index[i] == i); - HDassert(!(data[i].dirty)); + assert(data_index[i] == i); + assert(!(data[i].dirty)); } /* compose the done message */ @@ -5330,8 +5330,8 @@ smoke_check_2(int metadata_write_strategy) */ for (i = 0; i < NUM_DATA_ENTRIES; i++) { - HDassert(data_index[i] == i); - HDassert(!(data[i].dirty)); + assert(data_index[i] == i); + assert(!(data[i].dirty)); } /* compose the done message */ @@ -5491,10 +5491,10 @@ smoke_check_3(int metadata_write_strategy) pin_entry(file_ptr, i, TRUE, dirty); - HDassert(!dirty || data[i].header.is_dirty); - HDassert(data[i].header.is_pinned); - HDassert(data[i].global_pinned); - HDassert(!data[i].local_pinned); + assert(!dirty || data[i].header.is_dirty); + assert(data[i].header.is_pinned); + assert(data[i].global_pinned); + assert(!data[i].local_pinned); } if (i > 100) { @@ -5529,8 +5529,8 @@ smoke_check_3(int metadata_write_strategy) hbool_t via_unprotect = ((((unsigned)i) & 0x02) == 0); hbool_t dirty = ((((unsigned)i) & 0x04) == 0); - HDassert(data[i].global_pinned); - HDassert(!data[i].local_pinned); + assert(data[i].global_pinned); + assert(!data[i].local_pinned); unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); } @@ -5615,8 +5615,8 @@ smoke_check_3(int metadata_write_strategy) */ for (i = 0; i < NUM_DATA_ENTRIES; i++) { - HDassert(data_index[i] == i); - HDassert(!(data[i].dirty)); + assert(data_index[i] == i); + assert(!(data[i].dirty)); } /* compose the done message */ @@ -5788,10 +5788,10 @@ smoke_check_4(int metadata_write_strategy) pin_entry(file_ptr, i, TRUE, dirty); - HDassert(!dirty || data[i].header.is_dirty); - HDassert(data[i].header.is_pinned); - HDassert(data[i].global_pinned); - HDassert(!data[i].local_pinned); + assert(!dirty || data[i].header.is_dirty); + assert(data[i].header.is_pinned); + assert(data[i].global_pinned); + assert(!data[i].local_pinned); } if (i > 100) { @@ -5822,8 +5822,8 @@ smoke_check_4(int metadata_write_strategy) hbool_t via_unprotect = ((((unsigned)i) & 0x02) == 0); hbool_t dirty = ((((unsigned)i) & 0x04) == 0); - HDassert(data[i].global_pinned); - HDassert(!data[i].local_pinned); + assert(data[i].global_pinned); + assert(!data[i].local_pinned); unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect); } @@ -5899,8 +5899,8 @@ smoke_check_4(int metadata_write_strategy) */ for (i = 0; i < NUM_DATA_ENTRIES; i++) { - HDassert(data_index[i] == i); - HDassert(!(data[i].dirty)); + assert(data_index[i] == i); + assert(!(data[i].dirty)); } /* compose the done message */ @@ -6091,8 +6091,8 @@ smoke_check_5(int metadata_write_strategy) */ for (i = 0; i < NUM_DATA_ENTRIES; i++) { - HDassert(data_index[i] == i); - HDassert(!(data[i].dirty)); + assert(data_index[i] == i); + assert(!(data[i].dirty)); } /* compose the done message */ @@ -6395,8 +6395,8 @@ trace_file_check(int metadata_write_strategy) */ for (i = 0; i < NUM_DATA_ENTRIES; i++) { - HDassert(data_index[i] == i); - HDassert(!(data[i].dirty)); + assert(data_index[i] == i); + assert(!(data[i].dirty)); } /* compose the done message */ @@ -6639,7 +6639,7 @@ smoke_check_6(int metadata_write_strategy) /* Make sure coll entries do not cross the 80% threshold */ H5_CHECK_OVERFLOW(cache_ptr->max_cache_size, size_t, double); - HDassert((double)cache_ptr->max_cache_size * 0.8 > cache_ptr->coll_list_size); + assert((double)cache_ptr->max_cache_size * 0.8 > cache_ptr->coll_list_size); } /* Restore collective metadata reads state */ H5F_set_coll_metadata_reads(file_ptr, &md_reads_file_flag, &md_reads_context_flag); @@ -6663,7 +6663,7 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert((double)cache_ptr->max_cache_size * 0.8 > cache_ptr->coll_list_size); + assert((double)cache_ptr->max_cache_size * 0.8 > cache_ptr->coll_list_size); } /* Restore collective metadata reads state */ H5F_set_coll_metadata_reads(file_ptr, &md_reads_file_flag, &md_reads_context_flag); @@ -6695,7 +6695,7 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert((double)cache_ptr->max_cache_size * 0.8 > cache_ptr->coll_list_size); + assert((double)cache_ptr->max_cache_size * 0.8 > cache_ptr->coll_list_size); } /* Restore collective metadata reads state */ H5F_set_coll_metadata_reads(file_ptr, &md_reads_file_flag, &md_reads_context_flag); @@ -6719,7 +6719,7 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert((double)cache_ptr->max_cache_size * 0.8 > cache_ptr->coll_list_size); + assert((double)cache_ptr->max_cache_size * 0.8 > cache_ptr->coll_list_size); } /* Restore collective metadata reads state */ H5F_set_coll_metadata_reads(file_ptr, &md_reads_file_flag, &md_reads_context_flag); @@ -6744,8 +6744,8 @@ smoke_check_6(int metadata_write_strategy) */ for (i = 0; i < NUM_DATA_ENTRIES; i++) { - HDassert(data_index[i] == i); - HDassert(!(data[i].dirty)); + assert(data_index[i] == i); + assert(!(data[i].dirty)); } /* compose the done message */ diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index 86f1696..fc1724f 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -151,7 +151,7 @@ construct_test_file(int test_file_index) /* setup the file name */ if (pass) { - HDassert(FILENAMES[test_file_index]); + assert(FILENAMES[test_file_index]); if (h5_fixname(FILENAMES[test_file_index], H5P_DEFAULT, filename, sizeof(filename)) == NULL) { @@ -414,9 +414,9 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) if (show_progress) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - HDassert(0 <= min_dset); - HDassert(min_dset <= max_dset); - HDassert(max_dset < MAX_NUM_DSETS); + assert(0 <= min_dset); + assert(min_dset <= max_dset); + assert(max_dset < MAX_NUM_DSETS); /* create the datasets */ @@ -731,9 +731,9 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - HDassert(0 <= min_dset); - HDassert(min_dset <= max_dset); - HDassert(max_dset < MAX_NUM_DSETS); + assert(0 <= min_dset); + assert(min_dset <= max_dset); + assert(max_dset < MAX_NUM_DSETS); if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); @@ -832,7 +832,7 @@ open_hdf5_file(const hbool_t create_file, const hbool_t mdci_sbem_expected, cons H5AC_cache_image_config_t cache_image_config = {H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION, TRUE, FALSE, H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE}; - HDassert(!create_file || config_fsm); + assert(!create_file || config_fsm); if (pass) { /* opening the file both read only and with a cache image @@ -2053,7 +2053,7 @@ serial_insert_cache_image(int file_name_idx, int mpi_size) /* 1) setup the file name */ if (pass) { - HDassert(FILENAMES[file_name_idx]); + assert(FILENAMES[file_name_idx]); if (h5_fixname(FILENAMES[file_name_idx], H5P_DEFAULT, filename, sizeof(filename)) == NULL) { @@ -2390,9 +2390,9 @@ verify_data_sets(hid_t file_id, int min_dset, int max_dset) if (show_progress) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); - HDassert(0 <= min_dset); - HDassert(min_dset <= max_dset); - HDassert(max_dset < MAX_NUM_DSETS); + assert(0 <= min_dset); + assert(min_dset <= max_dset); + assert(max_dset < MAX_NUM_DSETS); /* open the datasets */ @@ -3180,7 +3180,7 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) /* setup the file name */ if (pass) { - HDassert(FILENAMES[test_file_index]); + assert(FILENAMES[test_file_index]); if (h5_fixname(FILENAMES[test_file_index], H5P_DEFAULT, filename, sizeof(filename)) == NULL) { diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index ac5b90b..2e49a6d 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -263,7 +263,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti case open_only: break; default: - HDassert(0); + assert(0); } /* Close up */ @@ -387,7 +387,7 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in value = 0; break; default: - HDassert(0); + assert(0); } /* verify content of the chunk */ diff --git a/testpar/t_dset.c b/testpar/t_dset.c index d144235..acabbb0 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -2966,13 +2966,13 @@ test_actual_io_mode(int selection_mode) MPI_Barrier(MPI_COMM_WORLD); - HDassert(mpi_size >= 1); + assert(mpi_size >= 1); mpi_comm = MPI_COMM_WORLD; mpi_info = MPI_INFO_NULL; filename = (const char *)GetTestParameters(); - HDassert(filename != NULL); + assert(filename != NULL); /* Setup the file access template */ fapl = create_faccess_plist(mpi_comm, mpi_info, facc_type); @@ -3490,7 +3490,7 @@ test_no_collective_cause_mode(int selection_mode) MPI_Barrier(MPI_COMM_WORLD); - HDassert(mpi_size >= 1); + assert(mpi_size >= 1); mpi_comm = MPI_COMM_WORLD; mpi_info = MPI_INFO_NULL; @@ -3532,7 +3532,7 @@ test_no_collective_cause_mode(int selection_mode) } filename = (const char *)GetTestParameters(); - HDassert(filename != NULL); + assert(filename != NULL); /* Setup the file access template */ fapl = create_faccess_plist(mpi_comm, mpi_info, l_facc_type); @@ -4169,7 +4169,7 @@ test_dense_attr(void) /* get filename */ filename = (const char *)GetTestParameters(); - HDassert(filename != NULL); + assert(filename != NULL); /* set up MPI parameters */ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); diff --git a/testpar/t_file.c b/testpar/t_file.c index 9c98e5b..b2c2c7d 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -711,7 +711,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, hsize_t entry_ptr = cache_ptr->index[i]; while (entry_ptr != NULL) { - HDassert(entry_ptr->is_dirty == FALSE); + assert(entry_ptr->is_dirty == FALSE); if (!entry_ptr->is_pinned && !entry_ptr->is_protected) { ret = H5AC_expunge_entry(f, entry_ptr->type, entry_ptr->addr, 0); diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 7cdfecf..10fcd19 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -1775,7 +1775,7 @@ rr_obj_hdr_flush_confusion(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - HDassert(mpi_size > 2); + assert(mpi_size > 2); is_reader = mpi_rank % 2; mrc = MPI_Comm_split(MPI_COMM_WORLD, is_reader, mpi_rank, &comm); @@ -2579,7 +2579,7 @@ chunk_align_bug_1(void) align = (hsize_t)file_size + CHUNK_SIZE + EXTRA_ALIGN; /* Set aggregator size and alignment, disable metadata aggregator */ - HDassert(AGGR_SIZE > CHUNK_SIZE); + assert(AGGR_SIZE > CHUNK_SIZE); ret = H5Pset_small_data_block_size(fapl_id, AGGR_SIZE); VRFY((ret >= 0), "H5Pset_small_data_block_size succeeded"); ret = H5Pset_meta_block_size(fapl_id, 0); diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c index e346714..4f0ffe9 100644 --- a/testpar/t_pflush2.c +++ b/testpar/t_pflush2.c @@ -68,7 +68,7 @@ check_test_file(char *name, size_t name_length, hid_t fapl_id) goto error; if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) goto error; - HDassert(100 == dims[0] && 100 == dims[1]); + assert(100 == dims[0] && 100 == dims[1]); /* Read some data */ if (H5Dread(did, H5T_NATIVE_INT, sid, sid, dxpl_id, data_g) < 0) diff --git a/testpar/t_pread.c b/testpar/t_pread.c index d05ec46..f408b71 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -111,7 +111,7 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) pass = TRUE; - HDassert(comm != MPI_COMM_NULL); + assert(comm != MPI_COMM_NULL); if ((MPI_Comm_rank(comm, &group_rank)) != MPI_SUCCESS) { pass = FALSE; @@ -151,7 +151,7 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) * need to worry that we reassign it for each file! */ group_filename = FILENAMES[file_index]; - HDassert(group_filename); + assert(group_filename); /* Assign the 'data_filename' */ if (h5_fixname(group_filename, H5P_DEFAULT, data_filename, sizeof(data_filename)) == NULL) { @@ -513,7 +513,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) pass = TRUE; - HDassert(comm != MPI_COMM_NULL); + assert(comm != MPI_COMM_NULL); if ((MPI_Comm_rank(comm, &group_rank)) != MPI_SUCCESS) { pass = FALSE; @@ -555,7 +555,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) else /* test 2 group 1 */ group_filename = FILENAMES[2]; - HDassert(group_filename); + assert(group_filename); if (h5_fixname(group_filename, H5P_DEFAULT, reloc_data_filename, sizeof(reloc_data_filename)) == NULL) { diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index c11f95c..b702ffb 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -133,12 +133,12 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker hid_t large_ds_dcpl_id = H5P_DEFAULT; herr_t ret; /* Generic return value */ - HDassert(edge_size >= 6); - HDassert(edge_size >= chunk_edge_size); - HDassert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); - HDassert(1 < small_rank); - HDassert(small_rank < large_rank); - HDassert(large_rank <= PAR_SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(edge_size >= chunk_edge_size); + assert((chunk_edge_size == 0) || (chunk_edge_size >= 3)); + assert(1 < small_rank); + assert(small_rank < large_rank); + assert(large_rank <= PAR_SS_DR_MAX_RANK); tv_ptr->test_num = test_num; tv_ptr->edge_size = edge_size; @@ -153,7 +153,7 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker /* the VRFY() macro needs the local variable mpi_rank -- set it up now */ mpi_rank = tv_ptr->mpi_rank; - HDassert(tv_ptr->mpi_size >= 1); + assert(tv_ptr->mpi_size >= 1); tv_ptr->mpi_comm = MPI_COMM_WORLD; tv_ptr->mpi_info = MPI_INFO_NULL; @@ -167,8 +167,8 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker /* used by checker board tests only */ tv_ptr->small_ds_offset = PAR_SS_DR_MAX_RANK - tv_ptr->small_rank; - HDassert(0 < tv_ptr->small_ds_offset); - HDassert(tv_ptr->small_ds_offset < PAR_SS_DR_MAX_RANK); + assert(0 < tv_ptr->small_ds_offset); + assert(tv_ptr->small_ds_offset < PAR_SS_DR_MAX_RANK); for (i = 0; i < tv_ptr->large_rank - 1; i++) { @@ -180,8 +180,8 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker /* used by checker board tests only */ tv_ptr->large_ds_offset = PAR_SS_DR_MAX_RANK - tv_ptr->large_rank; - HDassert(0 <= tv_ptr->large_ds_offset); - HDassert(tv_ptr->large_ds_offset < PAR_SS_DR_MAX_RANK); + assert(0 <= tv_ptr->large_ds_offset); + assert(tv_ptr->large_ds_offset < PAR_SS_DR_MAX_RANK); /* set up the start, stride, count, and block pointers */ /* used by contiguous tests only */ @@ -234,7 +234,7 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker HDmemset(tv_ptr->large_ds_slice_buf, 0, sizeof(uint32_t) * tv_ptr->large_ds_slice_size); filename = (const char *)GetTestParameters(); - HDassert(filename != NULL); + assert(filename != NULL); #if CONTIG_HS_DR_PIO_TEST__SETUP__DEBUG if (MAINPROCESS) { @@ -1070,8 +1070,8 @@ contig_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= tv_ptr->large_ds_size); + assert(start_index < stop_index); + assert(stop_index <= tv_ptr->large_ds_size); for (n = 0; n < tv_ptr->large_ds_size; n++) { @@ -1346,8 +1346,8 @@ contig_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t *tv_ptr) start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size; stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= tv_ptr->small_ds_size); + assert(start_index < stop_index); + assert(stop_index <= tv_ptr->small_ds_size); for (n = 0; n < tv_ptr->small_ds_size; n++) { @@ -1635,8 +1635,8 @@ contig_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index < tv_ptr->large_ds_size); + assert(start_index < stop_index); + assert(stop_index < tv_ptr->large_ds_size); for (n = 0; n < tv_ptr->large_ds_size; n++) { @@ -2049,20 +2049,20 @@ ckrbrd_hs_dr_pio_test__slct_ckrbrd(const int mpi_rank, const hid_t tgt_sid, cons hsize_t block[PAR_SS_DR_MAX_RANK]; herr_t ret; /* Generic return value */ - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(0 < sel_rank); - HDassert(sel_rank <= tgt_rank); - HDassert(tgt_rank <= test_max_rank); - HDassert(test_max_rank <= PAR_SS_DR_MAX_RANK); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(0 < sel_rank); + assert(sel_rank <= tgt_rank); + assert(tgt_rank <= test_max_rank); + assert(test_max_rank <= PAR_SS_DR_MAX_RANK); sel_offset = test_max_rank - sel_rank; - HDassert(sel_offset >= 0); + assert(sel_offset >= 0); n_cube_offset = test_max_rank - tgt_rank; - HDassert(n_cube_offset >= 0); - HDassert(n_cube_offset <= sel_offset); + assert(n_cube_offset >= 0); + assert(n_cube_offset <= sel_offset); #if CKRBRD_HS_DR_PIO_TEST__SELECT_CHECKER_BOARD__DEBUG HDfprintf(stdout, "%s:%d: edge_size/checker_edge_size = %d/%d\n", fcnName, mpi_rank, edge_size, @@ -2380,13 +2380,13 @@ ckrbrd_hs_dr_pio_test__verify_data(uint32_t *buf_ptr, const int rank, const int int v, w, x, y, z; /* to track position in checker */ const int test_max_rank = 5; /* code changes needed if this is increased */ - HDassert(buf_ptr != NULL); - HDassert(0 < rank); - HDassert(rank <= test_max_rank); - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(test_max_rank <= PAR_SS_DR_MAX_RANK); + assert(buf_ptr != NULL); + assert(0 < rank); + assert(rank <= test_max_rank); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(test_max_rank <= PAR_SS_DR_MAX_RANK); #if CKRBRD_HS_DR_PIO_TEST__VERIFY_DATA__DEBUG @@ -2675,11 +2675,11 @@ ckrbrd_hs_dr_pio_test__d2m_l2s(struct hs_dr_pio_test_vars_t *tv_ptr) tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDassert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); ckrbrd_hs_dr_pio_test__slct_ckrbrd( tv_ptr->mpi_rank, tv_ptr->file_large_ds_sid_0, tv_ptr->large_rank, tv_ptr->edge_size, @@ -2899,11 +2899,11 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDassert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); ckrbrd_hs_dr_pio_test__slct_ckrbrd( tv_ptr->mpi_rank, tv_ptr->mem_large_ds_sid, tv_ptr->large_rank, tv_ptr->edge_size, @@ -2964,8 +2964,8 @@ ckrbrd_hs_dr_pio_test__d2m_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) } #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__D2M_S2L__DEBUG */ - HDassert(start_index < stop_index); - HDassert(stop_index <= tv_ptr->large_ds_size); + assert(start_index < stop_index); + assert(stop_index <= tv_ptr->large_ds_size); for (u = 0; u < start_index; u++) { @@ -3221,11 +3221,11 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t *tv_ptr) tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDassert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); ckrbrd_hs_dr_pio_test__slct_ckrbrd( tv_ptr->mpi_rank, tv_ptr->mem_large_ds_sid, tv_ptr->large_rank, tv_ptr->edge_size, @@ -3271,8 +3271,8 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t *tv_ptr) start_index = (size_t)(tv_ptr->mpi_rank) * tv_ptr->small_ds_slice_size; stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index <= tv_ptr->small_ds_size); + assert(start_index < stop_index); + assert(stop_index <= tv_ptr->small_ds_size); data_ok = TRUE; @@ -3514,11 +3514,11 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) tv_ptr->start[3] = (hsize_t)l; tv_ptr->start[4] = 0; - HDassert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); - HDassert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[0] == 0) || (0 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[1] == 0) || (1 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[2] == 0) || (2 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[3] == 0) || (3 < tv_ptr->small_ds_offset + 1)); + assert((tv_ptr->start[4] == 0) || (4 < tv_ptr->small_ds_offset + 1)); ckrbrd_hs_dr_pio_test__slct_ckrbrd( tv_ptr->mpi_rank, tv_ptr->file_large_ds_sid_1, tv_ptr->large_rank, tv_ptr->edge_size, @@ -3567,8 +3567,8 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t *tv_ptr) (k * tv_ptr->edge_size * tv_ptr->edge_size) + (l * tv_ptr->edge_size)); stop_index = start_index + tv_ptr->small_ds_slice_size - 1; - HDassert(start_index < stop_index); - HDassert(stop_index < tv_ptr->large_ds_size); + assert(start_index < stop_index); + assert(stop_index < tv_ptr->large_ds_size); data_ok = TRUE; diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index aab2b59..423b121 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -939,21 +939,21 @@ lower_dim_size_comp_test__select_checker_board(const int mpi_rank, const hid_t t } #endif /* LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG */ - HDassert(0 < checker_edge_size); - HDassert(0 < sel_rank); - HDassert(sel_rank <= tgt_rank); - HDassert(tgt_rank <= test_max_rank); - HDassert(test_max_rank <= LDSCT_DS_RANK); + assert(0 < checker_edge_size); + assert(0 < sel_rank); + assert(sel_rank <= tgt_rank); + assert(tgt_rank <= test_max_rank); + assert(test_max_rank <= LDSCT_DS_RANK); sel_offset = test_max_rank - sel_rank; - HDassert(sel_offset >= 0); + assert(sel_offset >= 0); ds_offset = test_max_rank - tgt_rank; - HDassert(ds_offset >= 0); - HDassert(ds_offset <= sel_offset); + assert(ds_offset >= 0); + assert(ds_offset <= sel_offset); - HDassert((hsize_t)checker_edge_size <= dims[sel_offset]); - HDassert(dims[sel_offset] == 10); + assert((hsize_t)checker_edge_size <= dims[sel_offset]); + assert(dims[sel_offset] == 10); #if LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG if (mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK) { @@ -1290,13 +1290,13 @@ lower_dim_size_comp_test__verify_data(uint32_t *buf_ptr, int v, w, x, y, z; /* to track position in checker */ const int test_max_rank = 5; /* code changes needed if this is increased */ - HDassert(buf_ptr != NULL); - HDassert(0 < rank); - HDassert(rank <= test_max_rank); - HDassert(edge_size >= 6); - HDassert(0 < checker_edge_size); - HDassert(checker_edge_size <= edge_size); - HDassert(test_max_rank <= LDSCT_DS_RANK); + assert(buf_ptr != NULL); + assert(0 < rank); + assert(rank <= test_max_rank); + assert(edge_size >= 6); + assert(0 < checker_edge_size); + assert(checker_edge_size <= edge_size); + assert(test_max_rank <= LDSCT_DS_RANK); #if LOWER_DIM_SIZE_COMP_TEST__VERIFY_DATA__DEBUG if (mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK) { @@ -1499,7 +1499,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - HDassert(mpi_size >= 1); + assert(mpi_size >= 1); mpi_comm = MPI_COMM_WORLD; mpi_info = MPI_INFO_NULL; @@ -1568,7 +1568,7 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ /* get the file name */ filename = (const char *)GetTestParameters(); - HDassert(filename != NULL); + assert(filename != NULL); /* ---------------------------------------- * CREATE AN HDF5 FILE WITH PARALLEL ACCESS @@ -2057,9 +2057,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ stop_index = start_index + (int)small_ds_slice_size; - HDassert(0 <= start_index); - HDassert(start_index < stop_index); - HDassert(stop_index <= (int)large_ds_size); + assert(0 <= start_index); + assert(start_index < stop_index); + assert(stop_index <= (int)large_ds_size); ptr_1 = large_ds_buf_1; @@ -2157,9 +2157,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ stop_index = start_index + (int)small_ds_slice_size; - HDassert(0 <= start_index); - HDassert(start_index < stop_index); - HDassert(stop_index <= (int)small_ds_size); + assert(0 <= start_index); + assert(start_index < stop_index); + assert(stop_index <= (int)small_ds_size); ptr_1 = small_ds_buf_1; @@ -2362,11 +2362,11 @@ link_chunk_collective_io_test(void) MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - HDassert(mpi_size > 0); + assert(mpi_size > 0); /* get the file name */ filename = (const char *)GetTestParameters(); - HDassert(filename != NULL); + assert(filename != NULL); /* setup file access template */ acc_tpl = create_faccess_plist(mpi_comm, mpi_info, facc_type); diff --git a/testpar/t_subfiling_vfd.c b/testpar/t_subfiling_vfd.c index 04d8762..ba22718 100644 --- a/testpar/t_subfiling_vfd.c +++ b/testpar/t_subfiling_vfd.c @@ -132,7 +132,7 @@ create_subfiling_ioc_fapl(MPI_Comm comm, MPI_Info info, hbool_t custom_config, H5FD_ioc_config_t ioc_conf; hid_t ret_value = H5I_INVALID_HID; - HDassert(!custom_config || custom_cfg); + assert(!custom_config || custom_cfg); if ((ret_value = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; @@ -955,7 +955,7 @@ test_selection_strategies(void) VRFY(HDsetenv(H5FD_SUBFILING_IOC_SELECTION_CRITERIA, criteria_buf, 1) >= 0, "HDsetenv succeeded"); - HDassert(num_active_ranks == mpi_size || num_active_ranks == 1); + assert(num_active_ranks == mpi_size || num_active_ranks == 1); if ((num_active_ranks == mpi_size) || (mpi_rank == 0)) { h5_stat_t file_info; @@ -2099,7 +2099,7 @@ parse_subfiling_env_vars(void) } if (NULL != (env_value = HDgetenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX))) { - HDassert(config_dir); + assert(config_dir); HDstrncpy(config_dir, env_value, PATH_MAX); diff --git a/testpar/t_vfd.c b/testpar/t_vfd.c index 86cfe2f..94dfb92 100644 --- a/testpar/t_vfd.c +++ b/testpar/t_vfd.c @@ -270,10 +270,10 @@ setup_vfd_test_file(int file_name_id, char *file_name, int mpi_size, H5FD_mpio_x unsigned flags = 0; /* file open flags */ H5FD_t *lf = NULL; /* VFD struct ptr */ - HDassert(vfd_name); - HDassert(lf_ptr); - HDassert(fapl_id_ptr); - HDassert(dxpl_id_ptr); + assert(vfd_name); + assert(lf_ptr); + assert(fapl_id_ptr); + assert(dxpl_id_ptr); if (show_progress) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -533,9 +533,9 @@ takedown_vfd_test_file(int mpi_rank, char *filename, H5FD_t **lf_ptr, hid_t *fap int cp = 0; hbool_t show_progress = FALSE; - HDassert(lf_ptr); - HDassert(fapl_id_ptr); - HDassert(dxpl_id_ptr); + assert(lf_ptr); + assert(fapl_id_ptr); + assert(dxpl_id_ptr); if (show_progress) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); @@ -681,7 +681,7 @@ vector_read_test_1(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector read test 1 -- %s / col op / col I/O", vfd_name); @@ -914,7 +914,7 @@ vector_read_test_2(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector read test 2 -- %s / col op / col I/O", vfd_name); @@ -1218,7 +1218,7 @@ vector_read_test_3(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector read test 3 -- %s / col op / col I/O", vfd_name); @@ -1574,7 +1574,7 @@ vector_read_test_4(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector read test 4 -- %s / col op / col I/O", vfd_name); @@ -1860,7 +1860,7 @@ vector_read_test_4(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ break; default: - HDassert(FALSE); /* should be un-reachable */ + assert(FALSE); /* should be un-reachable */ break; } } @@ -2004,7 +2004,7 @@ vector_read_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer_ } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector read test 5 -- %s / col op / col I/O", vfd_name); @@ -2243,7 +2243,7 @@ vector_write_test_1(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector write test 1 -- %s / col op / col I/O", vfd_name); @@ -2433,7 +2433,7 @@ vector_write_test_2(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector write test 2 -- %s / col op / col I/O", vfd_name); @@ -2689,7 +2689,7 @@ vector_write_test_3(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector write test 3 -- %s / col op / col I/O", vfd_name); @@ -2952,7 +2952,7 @@ vector_write_test_4(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector write test 4 -- %s / col op / col I/O", vfd_name); @@ -3252,7 +3252,7 @@ vector_write_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector write test 5 -- %s / col op / col I/O", vfd_name); @@ -3558,7 +3558,7 @@ vector_write_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer break; default: - HDassert(FALSE); /* should be un-reachable */ + assert(FALSE); /* should be un-reachable */ break; } } @@ -3689,7 +3689,7 @@ vector_write_test_6(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsnprintf(test_title, sizeof(test_title), "parallel vector write test 6 -- %s / col op / col I/O", vfd_name); @@ -3947,7 +3947,7 @@ vector_write_test_7(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer } else { - HDassert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); + assert(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO); HDsprintf(test_title, "parallel vector write test 7 -- %s / col op / col I/O", vfd_name); } 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]; } diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index f060e2c..5fc5dc1 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -532,8 +532,8 @@ test_parse_tuple(void) /* SETUP */ - HDassert(parsed == NULL); - HDassert(cpy == NULL); + assert(parsed == NULL); + assert(cpy == NULL); tc = cases[i]; if (show_progress == TRUE) { HDprintf("testing %d: %s...\n", i, tc.test_msg); @@ -551,8 +551,8 @@ test_parse_tuple(void) JSVERIFY_STR(tc.exp_elems[elem_i], parsed[elem_i], NULL) } /* TEARDOWN */ - HDassert(parsed != NULL); - HDassert(cpy != NULL); + assert(parsed != NULL); + assert(cpy != NULL); HDfree(parsed); parsed = NULL; HDfree(cpy); @@ -623,7 +623,7 @@ test_populate_ros3_fa(void) show_progress = TRUE; #endif /* H5TOOLS_UTILS_TEST_DEBUG */ - HDassert(bad_version != H5FD_CURR_ROS3_FAPL_T_VERSION); + assert(bad_version != H5FD_CURR_ROS3_FAPL_T_VERSION); /********* * TESTS * @@ -747,7 +747,7 @@ test_populate_ros3_fa(void) HDprintf("region overflow\n"); } - HDassert(HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN); + assert(HDstrlen(values[0]) > H5FD_ROS3_MAX_REGION_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) @@ -817,7 +817,7 @@ test_populate_ros3_fa(void) HDprintf("id overflow\n"); } - HDassert(HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN); + assert(HDstrlen(values[1]) > H5FD_ROS3_MAX_SECRET_ID_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) @@ -924,7 +924,7 @@ test_populate_ros3_fa(void) HDprintf("key overflow\n"); } - HDassert(HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN); + assert(HDstrlen(values[2]) > H5FD_ROS3_MAX_SECRET_KEY_LEN); JSVERIFY(0, h5tools_populate_ros3_fapl(&fa, values), "could not fill fapl") JSVERIFY(H5FD_CURR_ROS3_FAPL_T_VERSION, fa.version, NULL) diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index b80189b..ca7d4ae 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -263,7 +263,7 @@ done: break; default: /* unknown request */ - HDassert(0 && "Unknown IO type"); + assert(0 && "Unknown IO type"); break; } @@ -311,7 +311,7 @@ sio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); - HDassert(0 && "Unknown IO type"); + assert(0 && "Unknown IO type"); break; } @@ -660,7 +660,7 @@ dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer) for (k = 0; k < parms->rank; k++) { - HDassert(h5offset[k] >= 0); + assert(h5offset[k] >= 0); if (dims[k] <= (hsize_t)h5offset[k]) { dims[k] = dims[k] + h5count[k]; hrc = H5Sset_extent_simple(h5dset_space_id, parms->rank, dims, maxdims); @@ -684,7 +684,7 @@ dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer) default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); - HDassert(0 && "Unknown IO type"); + assert(0 && "Unknown IO type"); break; } /* switch (parms->io_type) */ } @@ -982,7 +982,7 @@ dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer, const default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); - HDassert(0 && "Unknown IO type"); + assert(0 && "Unknown IO type"); break; } /* switch (parms->io_type) */ } @@ -1167,7 +1167,7 @@ set_vfd(parameters *param) HDmemset(memb_name, 0, sizeof memb_name); HDmemset(memb_addr, 0, sizeof memb_addr); - HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); if (NULL == (sv = HDcalloc(1, sizeof(*sv)))) return -1; @@ -1310,7 +1310,7 @@ do_cleanupfile(iotype iot, char *filename) } else if (driver == H5FD_MULTI) { H5FD_mem_t mt; - HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { HDsnprintf(temp, temp_sz, "%s-%c.h5", filename, multi_letters[mt]); @@ -1326,7 +1326,7 @@ do_cleanupfile(iotype iot, char *filename) default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); - HDassert(0 && "Unknown IO type"); + assert(0 && "Unknown IO type"); break; } } diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index bf70fc3..870318e 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -328,7 +328,7 @@ run_test(iotype iot, parameters parms, struct options *opts) default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); - HDassert(0 && "Unknown IO tpe"); + assert(0 && "Unknown IO tpe"); break; } diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 5275481..59dc59e 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -1654,13 +1654,13 @@ copy_user_block(const char *infile, const char *outfile, hsize_t size) } while (-1 == nwritten && EINTR == errno); if (-1 == nwritten) /* error */ H5TOOLS_GOTO_ERROR((-1), "HDwrite failed"); - HDassert(nwritten > 0); - HDassert(nwritten <= nbytes); + assert(nwritten > 0); + assert(nwritten <= nbytes); /* Update # of bytes left & offset in buffer */ nbytes -= nwritten; wbuf += nwritten; - HDassert(nbytes == 0 || wbuf < (rbuf + USERBLOCK_XFER_SIZE)); + assert(nbytes == 0 || wbuf < (rbuf + USERBLOCK_XFER_SIZE)); } /* end while */ /* Update size of userblock left to transfer */ diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 495954e..021529e 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -308,7 +308,7 @@ attribute_stats(iter_t *iter, const H5O_info2_t *oi, const H5O_native_info_t *na bin = ceil_log10((unsigned long)oi->num_attrs); if ((bin + 1) > iter->attr_nbins) { iter->attr_bins = (unsigned long *)HDrealloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long)); - HDassert(iter->attr_bins); + assert(iter->attr_bins); /* Initialize counts for intermediate bins */ while (iter->attr_nbins < bin) @@ -742,7 +742,7 @@ freespace_stats(hid_t fid, iter_t *iter) if (NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)))) return (FAIL); nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); - HDassert(nsects); + assert(nsects); } /* end else-if */ for (u = 0; u < (size_t)nsects; u++) { @@ -756,7 +756,7 @@ freespace_stats(hid_t fid, iter_t *iter) if (bin >= iter->sect_nbins) { /* Allocate more storage for section info */ iter->sect_bins = (unsigned long *)HDrealloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long)); - HDassert(iter->sect_bins); + assert(iter->sect_bins); /* Initialize counts for intermediate bins */ while (iter->sect_nbins < bin) @@ -1720,7 +1720,7 @@ main(int argc, char *argv[]) if (H5Fget_filesize(fid, &iter.filesize) < 0) warn_msg("Unable to retrieve file size\n"); - HDassert(iter.filesize != 0); + assert(iter.filesize != 0); /* Get storage info for file-level structures */ if (H5Fget_info2(fid, &finfo) < 0) @@ -1754,7 +1754,7 @@ main(int argc, char *argv[]) if (H5Pget_file_space_strategy(fcpl, &iter.fs_strategy, &iter.fs_persist, &iter.fs_threshold) < 0) warn_msg("Unable to retrieve file space information\n"); - HDassert(iter.fs_strategy >= 0 && iter.fs_strategy < H5F_FSPACE_STRATEGY_NTYPES); + assert(iter.fs_strategy >= 0 && iter.fs_strategy < H5F_FSPACE_STRATEGY_NTYPES); if (H5Pget_file_space_page_size(fcpl, &iter.fsp_size) < 0) warn_msg("Unable to retrieve file space page size\n"); diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index b15ae09..0d268c6 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -468,7 +468,7 @@ main(int argc, char *argv[]) * Debug a v2 B-tree header. */ const H5B2_class_t *cls = get_H5B2_class(sig); - HDassert(cls); + assert(cls); if ((cls == H5D_BT2 || cls == H5D_BT2_FILT) && (extra_count == 0 || extra[0] == 0)) { HDfprintf(stderr, "ERROR: Need v2 B-tree header address and object header address containing the " @@ -486,7 +486,7 @@ main(int argc, char *argv[]) * Debug a v2 B-tree internal node. */ const H5B2_class_t *cls = get_H5B2_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if ((cls == H5D_BT2 || cls == H5D_BT2_FILT) && @@ -522,7 +522,7 @@ main(int argc, char *argv[]) * Debug a v2 B-tree leaf node. */ const H5B2_class_t *cls = get_H5B2_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if ((cls == H5D_BT2 || cls == H5D_BT2_FILT) && @@ -649,7 +649,7 @@ main(int argc, char *argv[]) * Debug an extensible array header. */ const H5EA_class_t *cls = get_H5EA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0) { @@ -670,7 +670,7 @@ main(int argc, char *argv[]) * Debug an extensible array index block. */ const H5EA_class_t *cls = get_H5EA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0) { @@ -691,7 +691,7 @@ main(int argc, char *argv[]) * Debug an extensible array super block. */ const H5EA_class_t *cls = get_H5EA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0) { @@ -711,7 +711,7 @@ main(int argc, char *argv[]) * Debug an extensible array data block. */ const H5EA_class_t *cls = get_H5EA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0 || extra[2] == 0) { @@ -732,7 +732,7 @@ main(int argc, char *argv[]) * Debug a fixed array header. */ const H5FA_class_t *cls = get_H5FA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0) { @@ -752,7 +752,7 @@ main(int argc, char *argv[]) * Debug a fixed array data block. */ const H5FA_class_t *cls = get_H5FA_class(sig); - HDassert(cls); + assert(cls); /* Check for enough valid parameters */ if (extra_count == 0 || extra[0] == 0 || extra[1] == 0) { diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index bd1a50f..58a8685 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -8058,9 +8058,9 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -8512,7 +8512,7 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) sid1 = H5Screate_simple(2, dims1, NULL); did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); - HDassert(status >= 0); + assert(status >= 0); /* create the reference dataset */ sid2 = H5Screate_simple(1, dims2, NULL); @@ -8533,12 +8533,12 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) } status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); - HDassert(status >= 0); + assert(status >= 0); H5Sget_select_npoints(sid1); /* store first dataset region */ status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1); - HDassert(status >= 0); + assert(status >= 0); /* select sequence of five points for second reference */ coord[0][0] = 6; @@ -8567,17 +8567,17 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) /* write */ status = H5Dwrite(did2, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf); - HDassert(status >= 0); + assert(status >= 0); /* close, free memory buffers */ status = H5Dclose(did1); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(sid1); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did2); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(sid2); - HDassert(status >= 0); + assert(status >= 0); HDfree(rbuf); HDfree(buf); diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index ba4f0a4..2341a04 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -1750,9 +1750,9 @@ gent_many(void) /* Create links to external and UD links */ ret = H5Lcreate_soft("/g8/elink", fid, "/g7/slink5", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Lcreate_soft("/g8/udlink", fid, "/g7/slink6", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); H5Fclose(fid); } @@ -2707,16 +2707,16 @@ gent_vldatatypes(void) type = H5Tvlen_create(H5T_NATIVE_INT); dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(type, space, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(space); - HDassert(ret >= 0); + assert(ret >= 0); /* Allocate and initialize VL dataset to write */ for (i = 0; i < SPACE1_DIM1; i++) { @@ -2734,16 +2734,16 @@ gent_vldatatypes(void) type = H5Tvlen_create(H5T_NATIVE_FLOAT); dset = H5Dcreate2(file, "Dataset2.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(type, space, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(space); - HDassert(ret >= 0); + assert(ret >= 0); /* Allocate and initialize a scalar VL dataset to write */ adata.p = HDmalloc(37 * sizeof(int)); @@ -2757,18 +2757,18 @@ gent_vldatatypes(void) type = H5Tvlen_create(H5T_NATIVE_INT); dset = H5Dcreate2(file, "Dataset3.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &adata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(type, space, H5P_DEFAULT, &adata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(space); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(file); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -2821,23 +2821,23 @@ gent_vldatatypes2(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -2881,34 +2881,34 @@ gent_vldatatypes3(void) /* Insert fields */ ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -2948,9 +2948,9 @@ gent_vldatatypes4(void) /* Insert fields */ ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a datatype to refer to */ tid1 = H5Tvlen_create(tid2); @@ -2960,23 +2960,23 @@ gent_vldatatypes4(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } /* Generate a variable-length dataset with NULL values in it */ @@ -3008,37 +3008,37 @@ gent_vldatatypes5(void) /* Create file */ fid1 = H5Fcreate(FILE43, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid1 > 0); + assert(fid1 > 0); /* Create dataspace for datasets */ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); - HDassert(sid1 > 0); + assert(sid1 > 0); /* Create a datatype to refer to */ tid1 = H5Tvlen_create(H5T_NATIVE_UINT); - HDassert(tid1 > 0); + assert(tid1 > 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, F43_DSETNAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(dataset > 0); + assert(dataset > 0); ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } /* This is big enough to make h5dump to use hyperslap to read @@ -3104,7 +3104,7 @@ gent_array1_big(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /*--------------------------- * Region Reference dataset @@ -3128,13 +3128,13 @@ gent_array1_big(void) /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); /* Release memory */ HDfree(wbuf); @@ -3173,17 +3173,17 @@ gent_array1(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3220,17 +3220,17 @@ gent_array2(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3272,19 +3272,19 @@ gent_array3(void) /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3323,35 +3323,35 @@ gent_array4(void) /* Insert integer field */ ret = H5Tinsert(tid2, "i", HOFFSET(s2_t, i), H5T_NATIVE_INT); - HDassert(ret >= 0); + assert(ret >= 0); /* Insert float field */ ret = H5Tinsert(tid2, "f", HOFFSET(s2_t, f), H5T_NATIVE_FLOAT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close compound datatype */ ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3392,42 +3392,42 @@ gent_array5(void) /* Insert integer field */ ret = H5Tinsert(tid2, "i", HOFFSET(s2_t, i), H5T_NATIVE_INT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create an array of floats datatype */ tid3 = H5Tarray_create2(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1); /* Insert float array field */ ret = H5Tinsert(tid2, "f", HOFFSET(s2_t, f), tid3); - HDassert(ret >= 0); + assert(ret >= 0); /* Close array of floats field datatype */ ret = H5Tclose(tid3); - HDassert(ret >= 0); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close compound datatype */ ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3467,28 +3467,28 @@ gent_array6(void) /* Close VL datatype */ ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3531,35 +3531,35 @@ gent_array7(void) /* Close nested array datatype */ ret = H5Tclose(tid3); - HDassert(ret >= 0); + assert(ret >= 0); /* Create an array datatype to refer to */ tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close VL datatype */ ret = H5Tclose(tid2); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write dataset to disk */ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Reclaim the write VL data */ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata); - HDassert(ret >= 0); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dataset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid1); - HDassert(ret >= 0); + assert(ret >= 0); } /* Test the boundary of the display output buffer at the reallocation event */ @@ -3578,7 +3578,7 @@ gent_array8(void) /* Allocate data buffer */ wdata = (int *)HDmalloc(F64_DIM1 * sizeof(int)); - HDassert(wdata); + assert(wdata); /* * Initialize data. i is the element in the dataspace, j and k the @@ -3610,20 +3610,20 @@ gent_array8(void) dset = H5Dcreate2(file, F64_DATASET, filetype, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (dset >= 0) status = H5Dwrite(dset, filetype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - HDassert(status >= 0); + assert(status >= 0); } /* * Close and release resources. */ status = H5Dclose(dset); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(filetype); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(file); - HDassert(status >= 0); + assert(status >= 0); HDfree(wdata); } @@ -3648,30 +3648,30 @@ gent_empty(void) dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); /* write out an empty native integer dataset dataset */ dset = H5Dcreate2(file, "Dataset2.0", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); /* write out an empty native floating-point dataset dataset */ dset = H5Dcreate2(file, "Dataset3.0", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); /* write out an empty array dataset */ type = H5Tarray_create2(H5T_NATIVE_INT, SPACE1_RANK, dims); dset = H5Dcreate2(file, "Dataset4.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); /* write out an empty compound dataset */ type = H5Tcreate(H5T_COMPOUND, sizeof(empty_struct)); @@ -3681,15 +3681,15 @@ gent_empty(void) dset = H5Dcreate2(file, "Dataset5.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(type); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(space); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(file); - HDassert(ret >= 0); + assert(ret >= 0); } static void @@ -3881,7 +3881,7 @@ gent_multi(void) HDmemset(memb_name, 0, sizeof memb_name); HDmemset(memb_addr, 0, sizeof memb_addr); - HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); + assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { memb_fapl[mt] = H5P_DEFAULT; @@ -4168,9 +4168,9 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4277,9 +4277,9 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf52); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52); - HDassert(status >= 0); + assert(status >= 0); status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4408,9 +4408,9 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT); status = H5Awrite(aid, tid, buf53); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53); - HDassert(status >= 0); + assert(status >= 0); status = H5Aclose(aid); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4597,9 +4597,9 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4705,9 +4705,9 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4842,9 +4842,9 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da tid = H5Tvlen_create(H5T_NATIVE_INT); did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53); - HDassert(status >= 0); + assert(status >= 0); status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(did); status = H5Tclose(tid); status = H5Sclose(sid); @@ -4915,7 +4915,7 @@ gent_attr_all(void) sid = H5Screate_simple(1, dims, NULL); did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Sclose(sid); - HDassert(status >= 0); + assert(status >= 0); /* Create groups */ group_id = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -4940,17 +4940,17 @@ gent_attr_all(void) /* Close */ status = H5Dclose(did); - HDassert(status >= 0); + assert(status >= 0); status = H5Gclose(group_id); - HDassert(status >= 0); + assert(status >= 0); status = H5Gclose(group2_id); - HDassert(status >= 0); + assert(status >= 0); status = H5Gclose(root_id); - HDassert(status >= 0); + assert(status >= 0); /* Close file */ status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); } /*------------------------------------------------------------------------- @@ -5091,65 +5091,65 @@ gent_compound_complex(void) /* Create the dataspace */ dataspace = H5Screate_simple(F41_RANK, dim, NULL); - HDassert(dataspace >= 0); + assert(dataspace >= 0); /* Create the file */ datafile = H5Fcreate(FILE41, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(datafile >= 0); + assert(datafile >= 0); /* Copy the array data type for the string array */ array_tid = H5Tcopy(H5T_C_S1); - HDassert(array_tid >= 0); + assert(array_tid >= 0); /* Set the string array size to Variable */ status = H5Tset_size(array_tid, H5T_VARIABLE); - HDassert(status >= 0); + assert(status >= 0); /* Create the array data type for the string array */ str_array_id = H5Tarray_create2(array_tid, F41_ARRAY_RANK, array_dimb); - HDassert(str_array_id >= 0); + assert(str_array_id >= 0); /* Copy the array data type for the character array */ array1_tid = H5Tcopy(H5T_C_S1); - HDassert(array1_tid >= 0); + assert(array1_tid >= 0); /* Set the character array size */ status = H5Tset_size(array1_tid, F41_ARRAY_DIMc); - HDassert(status >= 0); + assert(status >= 0); /* Create the array data type for the character array */ array2_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F41_ARRAY_RANKd, array_dimd); - HDassert(array2_tid >= 0); + assert(array2_tid >= 0); /* Create the array data type for the character array */ array4_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F41_ARRAY_RANK, array_dimf); - HDassert(array4_tid >= 0); + assert(array4_tid >= 0); /* Create the memory data type */ Array1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Array1Struct)); - HDassert(Array1Structid >= 0); + assert(Array1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, "a_name", HOFFSET(Array1Struct, a), H5T_NATIVE_INT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "b_name", HOFFSET(Array1Struct, b), str_array_id); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "c_name", HOFFSET(Array1Struct, c), array1_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "d_name", HOFFSET(Array1Struct, d), array2_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "e_name", HOFFSET(Array1Struct, e), H5T_NATIVE_FLOAT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "f_name", HOFFSET(Array1Struct, f), array4_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, "g_name", HOFFSET(Array1Struct, g), H5T_NATIVE_CHAR); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(datafile, F41_DATASETNAME, Array1Structid, dataspace, H5P_DEFAULT, H5P_DEFAULT, @@ -5157,35 +5157,35 @@ gent_compound_complex(void) /* Write data to the dataset */ status = H5Dwrite(dataset, Array1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Array1); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Array1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array1_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array2_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array4_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(str_array_id); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(dataspace); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(datafile); - HDassert(status >= 0); + assert(status >= 0); } static void @@ -5202,7 +5202,7 @@ gent_named_dtype_attr(void) /* Create a file */ fid = H5Fcreate(FILE42, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid > 0); + assert(fid > 0); /*------------------------------------------------------------------------- * datatype @@ -5211,27 +5211,27 @@ gent_named_dtype_attr(void) /* Create a datatype to commit and use */ tid = H5Tcopy(H5T_NATIVE_INT); - HDassert(tid > 0); + assert(tid > 0); /* Commit datatype to file */ ret = H5Tcommit2(fid, F42_TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a hard link to the datatype */ ret = H5Lcreate_hard(fid, F42_TYPENAME, fid, F42_LINKNAME, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* Create a scalar dataspace used for all objects */ sid = H5Screate(H5S_SCALAR); - HDassert(sid > 0); + assert(sid > 0); /* Create attribute on committed datatype */ aid = H5Acreate2(tid, F42_ATTRNAME, H5T_STD_I32LE, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(aid > 0); + assert(aid > 0); /* Write data into the attribute */ ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset @@ -5240,15 +5240,15 @@ gent_named_dtype_attr(void) /* Create dataset */ did = H5Dcreate2(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(did > 0); + assert(did > 0); /* Create attribute on dataset */ aid = H5Acreate2(did, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(aid > 0); + assert(aid > 0); /* Write data into the attribute */ ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * group @@ -5257,15 +5257,15 @@ gent_named_dtype_attr(void) /* Create a group */ gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(gid > 0); + assert(gid > 0); /* Create attribute on group */ aid = H5Acreate2(gid, F42_ATTRNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - HDassert(aid > 0); + assert(aid > 0); /* Write data into the attribute */ ret = H5Awrite(aid, H5T_NATIVE_INT, &data); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close @@ -5274,23 +5274,23 @@ gent_named_dtype_attr(void) /* Close attribute */ ret = H5Aclose(aid); - HDassert(ret >= 0); + assert(ret >= 0); /* Close dataset */ ret = H5Dclose(did); - HDassert(ret >= 0); + assert(ret >= 0); /* Close dataspace */ ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); /* Close datatype */ ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /* Close file */ ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5423,25 +5423,25 @@ make_external(hid_t fid) dcpl = H5Pcreate(H5P_DATASET_CREATE); ret = H5Pset_external(dcpl, "ext1.bin", (off_t)0, size); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_external(dcpl, "ext2.bin", (off_t)0, size); - HDassert(ret >= 0); + assert(ret >= 0); sid = H5Screate_simple(1, cur_size, max_size); - HDassert(ret >= 0); + assert(ret >= 0); dsid = H5Dcreate2(fid, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); H5Dclose(dsid); - HDassert(ret >= 0); + assert(ret >= 0); H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5477,7 +5477,7 @@ gent_filters(void) /* create a file */ fid = H5Fcreate(FILE44, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Check if we support comments in the current VOL connector */ H5VLquery_optional(fid, H5VL_SUBCLS_OBJECT, H5VL_NATIVE_OBJECT_SET_COMMENT, &supports_comments); @@ -5494,40 +5494,40 @@ gent_filters(void) *------------------------------------------------------------------------- */ ret = H5Pset_layout(dcpl, H5D_COMPACT); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "compact", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) { ret = H5Oset_comment_by_name(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); } ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "contiguous", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) { ret = H5Oset_comment_by_name(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); } ret = H5Pset_layout(dcpl, H5D_CHUNKED); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "chunked", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) { ret = H5Oset_comment_by_name(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5537,7 +5537,7 @@ gent_filters(void) /* set up chunk */ ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * SZIP @@ -5547,14 +5547,14 @@ gent_filters(void) if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set szip data */ ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "szip", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ @@ -5565,14 +5565,14 @@ gent_filters(void) #if defined(H5_HAVE_FILTER_DEFLATE) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set deflate data */ ret = H5Pset_deflate(dcpl, 9); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "deflate", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); #endif /*------------------------------------------------------------------------- @@ -5582,14 +5582,14 @@ gent_filters(void) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the shuffle filter */ ret = H5Pset_shuffle(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "shuffle", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * checksum @@ -5598,14 +5598,14 @@ gent_filters(void) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the checksum filter */ ret = H5Pset_fletcher32(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fletcher32", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * nbit @@ -5614,16 +5614,16 @@ gent_filters(void) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the checksum filter */ ret = H5Pset_nbit(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); tid = H5Tcopy(H5T_NATIVE_INT); H5Tset_precision(tid, H5Tget_size(tid) - 1); ret = make_dset(fid, "nbit", sid, tid, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * scaleoffset @@ -5632,14 +5632,14 @@ gent_filters(void) /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the scaleoffset filter */ ret = H5Pset_scaleoffset(dcpl, H5Z_SO_INT, (int)H5Tget_size(H5T_NATIVE_INT)); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "scaleoffset", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * all filters @@ -5647,37 +5647,37 @@ gent_filters(void) */ /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /* set the shuffle filter */ ret = H5Pset_shuffle(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); #ifdef H5_HAVE_FILTER_SZIP if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { szip_options_mask = H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK; /* set szip data */ ret = H5Pset_szip(dcpl, szip_options_mask, szip_pixels_per_block); - HDassert(ret >= 0); + assert(ret >= 0); } #endif /* H5_HAVE_FILTER_SZIP */ #if defined(H5_HAVE_FILTER_DEFLATE) /* set deflate data */ ret = H5Pset_deflate(dcpl, 5); - HDassert(ret >= 0); + assert(ret >= 0); #endif /* set the checksum filter */ ret = H5Pset_fletcher32(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); /* set the nbit filter */ ret = H5Pset_nbit(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "all", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * user defined filter @@ -5685,20 +5685,20 @@ gent_filters(void) */ /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Zregister(H5Z_MYFILTER); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_filter(dcpl, MYFILTER_ID, 0, 0, NULL); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "myfilter", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * make an external dataset @@ -5711,27 +5711,27 @@ gent_filters(void) *------------------------------------------------------------------------- */ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "alloc_time_early", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_INCR *------------------------------------------------------------------------- */ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "alloc_time_incr", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_ALLOC_TIME_LATE *------------------------------------------------------------------------- */ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "alloc_time_late", sid, H5T_NATIVE_INT, dcpl, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * commit a H5G_TYPE type with a comment @@ -5739,28 +5739,28 @@ gent_filters(void) */ tid = H5Tcopy(H5T_STD_B8LE); ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); if (supports_comments & H5VL_OPT_QUERY_SUPPORTED) { ret = H5Oset_comment_by_name(fid, "mytype", "This is a committed datatype", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); } ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5825,7 +5825,7 @@ gent_fcontents(void) /* create a file */ fid = H5Fcreate(FILE46, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); write_dset(fid, 1, dims, "dset", H5T_NATIVE_INT, buf); @@ -5851,27 +5851,27 @@ gent_fcontents(void) /* hard link to "dset" */ ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* hard link to "dset" */ ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* soft link to itself */ ret = H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* soft link to "dset" */ ret = H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* dangling external link */ ret = H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /* dangling udlink */ ret = H5Lcreate_ud(fid, "udlink", (H5L_type_t)MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * datatypes @@ -5879,19 +5879,19 @@ gent_fcontents(void) */ tid = H5Tcopy(H5T_NATIVE_INT); ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /* no name datatype */ tid = H5Tcopy(H5T_NATIVE_INT); ret = H5Tcommit2(fid, "mytype2", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); write_dset(fid, 1, dims, "dsetmytype2", tid, buf); ret = H5Ldelete(fid, "mytype2", H5P_DEFAULT); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close @@ -5899,14 +5899,14 @@ gent_fcontents(void) */ ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); /* create a file for the bootblock test */ fid = H5Fcreate(FILE47, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -5943,7 +5943,7 @@ gent_fvalues(void) /* create a file */ fid = H5Fcreate(FILE48, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* create a space */ sid = H5Screate_simple(1, dims, NULL); @@ -5957,42 +5957,42 @@ gent_fvalues(void) *------------------------------------------------------------------------- */ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fill_time_ifset", sid, H5T_NATIVE_INT, dcpl, buf); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_NEVER *------------------------------------------------------------------------- */ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fill_time_never", sid, H5T_NATIVE_INT, dcpl, buf); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * H5D_FILL_TIME_ALLOC *------------------------------------------------------------------------- */ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fill_time_alloc", sid, H5T_NATIVE_INT, dcpl, buf); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with no fill value @@ -6009,13 +6009,13 @@ gent_fvalues(void) H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_CHAR); H5Tinsert(tid, "b", HOFFSET(c_t, b), H5T_NATIVE_DOUBLE); ret = H5Pset_fill_value(dcpl, tid, &fillval2); - HDassert(ret >= 0); + assert(ret >= 0); ret = make_dset(fid, "fill_compound", sid, tid, dcpl, buf2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_VLEN fill value @@ -6035,17 +6035,17 @@ gent_fvalues(void) fillval3.p = NULL; fillval3.len = 0; ret = H5Pset_fill_value(dcpl, tid, &fillval3); - HDassert(ret >= 0); + assert(ret >= 0); did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Treclaim(tid, sid, H5P_DEFAULT, buf3); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(did); ret = H5Tclose(tid); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * dataset with a H5T_ARRAY fill value @@ -6060,9 +6060,9 @@ gent_fvalues(void) *------------------------------------------------------------------------- */ ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -6105,7 +6105,7 @@ gent_string(void) /* create a file */ fid = H5Fcreate(FILE49, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /*------------------------------------------------------------------------- * str1 @@ -6114,11 +6114,11 @@ gent_string(void) tid = H5Tcopy(H5T_C_S1); ret = H5Tset_size(tid, sizeof(buf1)); - HDassert(ret >= 0); + assert(ret >= 0); write_dset(fid, 1, dims1, "str1", tid, buf1); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * str2 @@ -6127,16 +6127,16 @@ gent_string(void) sid = H5Screate_simple(SPACE1_RANK, dims2, NULL); tid = H5Tcopy(H5T_C_S1); ret = H5Tset_size(tid, H5T_VARIABLE); - HDassert(ret >= 0); + assert(ret >= 0); did = H5Dcreate2(fid, "str2", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Dclose(did); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * str3 @@ -6149,13 +6149,13 @@ gent_string(void) H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_INT); H5Tinsert(tid, "str", HOFFSET(c_t, str), str_tid); ret = make_dset(fid, "str3", sid, tid, H5P_DEFAULT, &buf3); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Tclose(str_tid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * str4 @@ -6164,14 +6164,14 @@ gent_string(void) sid = H5Screate_simple(SPACE1_RANK, dims4, NULL); ret = make_dset(fid, "str4", sid, H5T_NATIVE_CHAR, H5P_DEFAULT, buf4); ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -6215,7 +6215,7 @@ gent_aindices(void) /* create a file */ fid = H5Fcreate(FILE50, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /*------------------------------------------------------------------------- * root datasets @@ -6248,7 +6248,7 @@ gent_aindices(void) *------------------------------------------------------------------------- */ ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- @@ -6269,34 +6269,34 @@ gent_longlinks(void) /* Create files */ fid = H5Fcreate(FILE51, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create group with short name in file (used as target for hard links) */ gid = H5Gcreate2(fid, "grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(gid >= 0); + assert(gid >= 0); /* Construct very long file name */ objname = (char *)HDmalloc((size_t)(F51_MAX_NAME_LEN + 1)); - HDassert(objname); + assert(objname); for (u = 0; u < F51_MAX_NAME_LEN; u++) objname[u] = 'a'; objname[F51_MAX_NAME_LEN] = '\0'; /* Create hard link to existing object */ - HDassert(H5Lcreate_hard(fid, "grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); + assert(H5Lcreate_hard(fid, "grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); /* Create soft link to existing object */ objname[0] = 'b'; - HDassert(H5Lcreate_soft("grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); + assert(H5Lcreate_soft("grp1", fid, objname, H5P_DEFAULT, H5P_DEFAULT) >= 0); /* Create group with long name in existing group */ gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(gid2 >= 0); + assert(gid2 >= 0); /* Close objects */ - HDassert(H5Gclose(gid2) >= 0); - HDassert(H5Gclose(gid) >= 0); - HDassert(H5Fclose(fid) >= 0); + assert(H5Gclose(gid2) >= 0); + assert(H5Gclose(gid) >= 0); + assert(H5Fclose(fid) >= 0); /* Release memory */ HDfree(objname); @@ -6494,7 +6494,7 @@ gent_bigdims(void) /* create a file */ fid = H5Fcreate(FILE56, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* create dataset */ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) @@ -6552,7 +6552,7 @@ gent_bigdims(void) did = H5I_INVALID_HID; ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); return; @@ -6592,12 +6592,12 @@ gent_hyperslab(void) /* create a file */ fid = H5Fcreate(FILE57, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); write_dset(fid, 2, dims, "stripmine", H5T_NATIVE_DOUBLE, buf); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); HDfree(buf); } @@ -7858,17 +7858,17 @@ gent_charsets(void) sid = H5Screate_simple(1, dim, NULL); fid = H5Fcreate(FILE68, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); status = H5Tset_cset(ascii_dtid, H5T_CSET_ASCII); - HDassert(status >= 0); + assert(status >= 0); H5Tinsert(charset_dtid, "ascii", HOFFSET(CharSetInfo, ascii_p_), ascii_dtid); status = H5Tset_cset(utf8_dtid, H5T_CSET_UTF8); - HDassert(status >= 0); + assert(status >= 0); H5Tinsert(charset_dtid, "utf8", HOFFSET(CharSetInfo, utf8_p_), utf8_dtid); did = H5Dcreate2(fid, "CharSets", charset_dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did, charset_dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, writeData); - HDassert(status >= 0); + assert(status >= 0); H5Tclose(charset_dtid); H5Tclose(ascii_dtid); @@ -7926,7 +7926,7 @@ gent_compound_intsizes(void) /* Allocate buffer */ Array1 = (Array1Struct *)HDmalloc(sizeof(Array1Struct) * F70_LENGTH); - HDassert(Array1); + assert(Array1); /* Initialize the data in the arrays/datastructure */ for (m = 0; m < F70_LENGTH; m++) { @@ -8038,126 +8038,126 @@ gent_compound_intsizes(void) /* Create the array data type for the 8 bits signed int array */ array8_tid = H5Tarray_create2(H5T_NATIVE_SCHAR, F70_ARRAY_RANK, array_dim8); - HDassert(array8_tid >= 0); + assert(array8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ array16_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F70_ARRAY_RANK, array_dim16); - HDassert(array16_tid >= 0); + assert(array16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ array32_tid = H5Tarray_create2(H5T_NATIVE_INT, F70_ARRAY_RANK, array_dim32); - HDassert(array32_tid >= 0); + assert(array32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ array64_tid = H5Tarray_create2(H5T_NATIVE_LONG, F70_ARRAY_RANK, array_dim64); - HDassert(array64_tid >= 0); + assert(array64_tid >= 0); /* Create the array data type for the 8 bits signed int array */ arrayu8_tid = H5Tarray_create2(H5T_NATIVE_UCHAR, F70_ARRAY_RANK, array_dim8); - HDassert(arrayu8_tid >= 0); + assert(arrayu8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ arrayu16_tid = H5Tarray_create2(H5T_NATIVE_USHORT, F70_ARRAY_RANK, array_dim16); - HDassert(arrayu16_tid >= 0); + assert(arrayu16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ arrayu32_tid = H5Tarray_create2(H5T_NATIVE_UINT, F70_ARRAY_RANK, array_dim32); - HDassert(arrayu32_tid >= 0); + assert(arrayu32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ arrayu64_tid = H5Tarray_create2(H5T_NATIVE_ULONG, F70_ARRAY_RANK, array_dim64); - HDassert(arrayu64_tid >= 0); + assert(arrayu64_tid >= 0); /* Create the array data type for the 32 bits double array */ arraydbl_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F70_ARRAY_RANK, array_dim8); - HDassert(arraydbl_tid >= 0); + assert(arraydbl_tid >= 0); /* Create the dataspace */ space = H5Screate_simple(F70_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the file */ fid = H5Fcreate(FILE70, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create the memory data type */ Array1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Array1Struct)); - HDassert(Array1Structid >= 0); + assert(Array1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, F70_DATASETU08, HOFFSET(Array1Struct, dsetu8), arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU16, HOFFSET(Array1Struct, dsetu16), arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU32, HOFFSET(Array1Struct, dsetu32), arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU64, HOFFSET(Array1Struct, dsetu64), arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS08, HOFFSET(Array1Struct, dset8), array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS16, HOFFSET(Array1Struct, dset16), array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS32, HOFFSET(Array1Struct, dset32), array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS64, HOFFSET(Array1Struct, dset64), array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DUMMYDBL, HOFFSET(Array1Struct, dsetdbl), arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(fid, F70_DATASETNAME, Array1Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Array1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Array1); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Array1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); HDfree(Array1); } @@ -8328,79 +8328,79 @@ gent_compound_attr_intsizes(void) /* Create the array data type for the 8 bits signed int array */ array8_tid = H5Tarray_create2(H5T_NATIVE_SCHAR, F70_ARRAY_RANK, array_dim8); - HDassert(array8_tid >= 0); + assert(array8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ array16_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F70_ARRAY_RANK, array_dim16); - HDassert(array16_tid >= 0); + assert(array16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ array32_tid = H5Tarray_create2(H5T_NATIVE_INT, F70_ARRAY_RANK, array_dim32); - HDassert(array32_tid >= 0); + assert(array32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ array64_tid = H5Tarray_create2(H5T_NATIVE_LONG, F70_ARRAY_RANK, array_dim64); - HDassert(array64_tid >= 0); + assert(array64_tid >= 0); /* Create the array data type for the 8 bits signed int array */ arrayu8_tid = H5Tarray_create2(H5T_NATIVE_UCHAR, F70_ARRAY_RANK, array_dim8); - HDassert(arrayu8_tid >= 0); + assert(arrayu8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ arrayu16_tid = H5Tarray_create2(H5T_NATIVE_USHORT, F70_ARRAY_RANK, array_dim16); - HDassert(arrayu16_tid >= 0); + assert(arrayu16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ arrayu32_tid = H5Tarray_create2(H5T_NATIVE_UINT, F70_ARRAY_RANK, array_dim32); - HDassert(arrayu32_tid >= 0); + assert(arrayu32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ arrayu64_tid = H5Tarray_create2(H5T_NATIVE_ULONG, F70_ARRAY_RANK, array_dim64); - HDassert(arrayu64_tid >= 0); + assert(arrayu64_tid >= 0); /* Create the array data type for the 32 bits double array */ arraydbl_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F70_ARRAY_RANK, array_dim8); - HDassert(arraydbl_tid >= 0); + assert(arraydbl_tid >= 0); /* Create the dataspace */ space = H5Screate_simple(F70_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the file */ fid = H5Fcreate(FILE71, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create the memory data type */ Array1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Array1Struct)); - HDassert(Array1Structid >= 0); + assert(Array1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Array1Structid, F70_DATASETU08, HOFFSET(Array1Struct, dsetu8), arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU16, HOFFSET(Array1Struct, dsetu16), arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU32, HOFFSET(Array1Struct, dsetu32), arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETU64, HOFFSET(Array1Struct, dsetu64), arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS08, HOFFSET(Array1Struct, dset8), array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS16, HOFFSET(Array1Struct, dset16), array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS32, HOFFSET(Array1Struct, dset32), array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DATASETS64, HOFFSET(Array1Struct, dset64), array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Array1Structid, F70_DUMMYDBL, HOFFSET(Array1Struct, dsetdbl), arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); root = H5Gopen2(fid, "/", H5P_DEFAULT); @@ -8409,47 +8409,47 @@ gent_compound_attr_intsizes(void) /* Write data to the attribute */ status = H5Awrite(attr, Array1Structid, Array1); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Array1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Aclose(attr); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); HDfree(Array1); } @@ -9230,7 +9230,7 @@ gent_compound_int_array(void) /* Allocate buffer */ Cmpd1 = (Cmpd1Struct *)HDmalloc(sizeof(Cmpd1Struct) * F76_LENGTH); - HDassert(Cmpd1); + assert(Cmpd1); /* Initialize the data in the arrays/datastructure */ for (m = 0; m < F76_LENGTH; m++) { @@ -9316,126 +9316,126 @@ gent_compound_int_array(void) /* Create the array data type for the 8 bits signed int array */ array8_tid = H5Tarray_create2(H5T_NATIVE_SCHAR, F76_ARRAY_RANK, array_dim8); - HDassert(array8_tid >= 0); + assert(array8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ array16_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F76_ARRAY_RANK, array_dim16); - HDassert(array16_tid >= 0); + assert(array16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ array32_tid = H5Tarray_create2(H5T_NATIVE_INT, F76_ARRAY_RANK, array_dim32); - HDassert(array32_tid >= 0); + assert(array32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ array64_tid = H5Tarray_create2(H5T_NATIVE_LONG, F76_ARRAY_RANK, array_dim64); - HDassert(array64_tid >= 0); + assert(array64_tid >= 0); /* Create the array data type for the 8 bits signed int array */ arrayu8_tid = H5Tarray_create2(H5T_NATIVE_UCHAR, F76_ARRAY_RANK, array_dim8); - HDassert(arrayu8_tid >= 0); + assert(arrayu8_tid >= 0); /* Create the array data type for the 16 bits signed int array */ arrayu16_tid = H5Tarray_create2(H5T_NATIVE_USHORT, F76_ARRAY_RANK, array_dim16); - HDassert(arrayu16_tid >= 0); + assert(arrayu16_tid >= 0); /* Create the array data type for the 32 bits signed int array */ arrayu32_tid = H5Tarray_create2(H5T_NATIVE_UINT, F76_ARRAY_RANK, array_dim32); - HDassert(arrayu32_tid >= 0); + assert(arrayu32_tid >= 0); /* Create the array data type for the 64 bits signed int array */ arrayu64_tid = H5Tarray_create2(H5T_NATIVE_ULONG, F76_ARRAY_RANK, array_dim64); - HDassert(arrayu64_tid >= 0); + assert(arrayu64_tid >= 0); /* Create the array data type for the 32 bits double array */ arraydbl_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F76_ARRAY_RANK, array_dim8); - HDassert(arraydbl_tid >= 0); + assert(arraydbl_tid >= 0); /* Create the dataspace */ space = H5Screate_simple(F76_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the file */ fid = H5Fcreate(FILE76, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create the memory data type */ Cmpd1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Cmpd1Struct)); - HDassert(Cmpd1Structid >= 0); + assert(Cmpd1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Cmpd1Structid, F76_DATASETU08, HOFFSET(Cmpd1Struct, dsetu8), arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU16, HOFFSET(Cmpd1Struct, dsetu16), arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU32, HOFFSET(Cmpd1Struct, dsetu32), arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU64, HOFFSET(Cmpd1Struct, dsetu64), arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS08, HOFFSET(Cmpd1Struct, dset8), array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS16, HOFFSET(Cmpd1Struct, dset16), array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS32, HOFFSET(Cmpd1Struct, dset32), array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS64, HOFFSET(Cmpd1Struct, dset64), array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DUMMYDBL, HOFFSET(Cmpd1Struct, dsetdbl), arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(fid, F76_DATASETNAME, Cmpd1Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Cmpd1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Cmpd1); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Cmpd1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arrayu64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array8_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array16_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array32_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(array64_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Tclose(arraydbl_tid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); HDfree(Cmpd1); } @@ -9488,9 +9488,9 @@ gent_compound_ints(void) /* Allocate buffers */ Cmpd1 = (Cmpd1Struct *)HDmalloc(sizeof(Cmpd1Struct) * F77_LENGTH); - HDassert(Cmpd1); + assert(Cmpd1); Cmpd2 = (Cmpd2Struct *)HDmalloc(sizeof(Cmpd2Struct) * F77_LENGTH); - HDassert(Cmpd2); + assert(Cmpd2); /* Initialize the data in the arrays/datastructure */ for (m = 0; m < F77_LENGTH; m++) { @@ -9558,116 +9558,116 @@ gent_compound_ints(void) /* Create the dataspace */ space = H5Screate_simple(F76_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the file */ fid = H5Fcreate(FILE77, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* Create the memory data type */ Cmpd1Structid = H5Tcreate(H5T_COMPOUND, sizeof(Cmpd1Struct)); - HDassert(Cmpd1Structid >= 0); + assert(Cmpd1Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Cmpd1Structid, F76_DATASETU08, HOFFSET(Cmpd1Struct, dsetu8), H5T_NATIVE_UCHAR); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU16, HOFFSET(Cmpd1Struct, dsetu16), H5T_NATIVE_USHORT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU32, HOFFSET(Cmpd1Struct, dsetu32), H5T_NATIVE_UINT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETU64, HOFFSET(Cmpd1Struct, dsetu64), H5T_NATIVE_ULONG); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS08, HOFFSET(Cmpd1Struct, dset8), H5T_NATIVE_SCHAR); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS16, HOFFSET(Cmpd1Struct, dset16), H5T_NATIVE_SHORT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS32, HOFFSET(Cmpd1Struct, dset32), H5T_NATIVE_INT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DATASETS64, HOFFSET(Cmpd1Struct, dset64), H5T_NATIVE_LONG); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd1Structid, F76_DUMMYDBL, HOFFSET(Cmpd1Struct, dsetdbl), H5T_NATIVE_DOUBLE); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(fid, F77_DATASETNAME1, Cmpd1Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Cmpd1Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Cmpd1); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Cmpd1Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataspace */ space = H5Screate_simple(F76_RANK, dim, NULL); - HDassert(space >= 0); + assert(space >= 0); /* Create the memory data type */ Cmpd2Structid = H5Tcreate(H5T_COMPOUND, sizeof(Cmpd2Struct)); - HDassert(Cmpd2Structid >= 0); + assert(Cmpd2Structid >= 0); /* Insert the arrays and variables into the structure */ status = H5Tinsert(Cmpd2Structid, F76_DATASETU64, HOFFSET(Cmpd2Struct, dsetu64), H5T_NATIVE_ULONG); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETU32, HOFFSET(Cmpd2Struct, dsetu32), H5T_NATIVE_UINT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETU16, HOFFSET(Cmpd2Struct, dsetu16), H5T_NATIVE_USHORT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETU08, HOFFSET(Cmpd2Struct, dsetu8), H5T_NATIVE_UCHAR); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETS64, HOFFSET(Cmpd2Struct, dset64), H5T_NATIVE_LONG); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETS32, HOFFSET(Cmpd2Struct, dset32), H5T_NATIVE_INT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETS16, HOFFSET(Cmpd2Struct, dset16), H5T_NATIVE_SHORT); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DATASETS08, HOFFSET(Cmpd2Struct, dset8), H5T_NATIVE_SCHAR); - HDassert(status >= 0); + assert(status >= 0); status = H5Tinsert(Cmpd2Structid, F76_DUMMYDBL, HOFFSET(Cmpd2Struct, dsetdbl), H5T_NATIVE_DOUBLE); - HDassert(status >= 0); + assert(status >= 0); /* Create the dataset */ dataset = H5Dcreate2(fid, F77_DATASETNAME2, Cmpd2Structid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Write data to the dataset */ status = H5Dwrite(dataset, Cmpd2Structid, H5S_ALL, H5S_ALL, H5P_DEFAULT, Cmpd2); - HDassert(status >= 0); + assert(status >= 0); /* Release resources */ status = H5Tclose(Cmpd2Structid); - HDassert(status >= 0); + assert(status >= 0); status = H5Sclose(space); - HDassert(status >= 0); + assert(status >= 0); status = H5Dclose(dataset); - HDassert(status >= 0); + assert(status >= 0); status = H5Fclose(fid); - HDassert(status >= 0); + assert(status >= 0); HDfree(Cmpd1); HDfree(Cmpd2); @@ -10755,7 +10755,7 @@ gent_compound_complex2(void) /* Allocate buffer */ buf = (compound *)HDmalloc(sizeof(compound) * F82_DIM32); - HDassert(buf); + assert(buf); file = H5Fcreate(FILE82, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -11124,54 +11124,54 @@ gent_udfilter(void) /* create a file */ fid = H5Fcreate(FILE84, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(fid >= 0); + assert(fid >= 0); /* create a space */ sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); dcpl = H5Pcreate(H5P_DATASET_CREATE); - HDassert(dcpl >= 0); + assert(dcpl >= 0); ret = H5Pset_layout(dcpl, H5D_CHUNKED); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Zregister(H5Z_DYNLIBUD); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pset_filter(dcpl, H5Z_FILTER_DYNLIBUD, H5Z_FLAG_MANDATORY, 0, NULL); - HDassert(ret >= 0); + assert(ret >= 0); /* create the dataset */ dsid = H5Dcreate2(fid, "dynlibud", H5T_STD_I32LE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); - HDassert(dsid >= 0); + assert(dsid >= 0); /* write */ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1); - HDassert(ret >= 0); + assert(ret >= 0); /* close */ ret = H5Dclose(dsid); - HDassert(ret >= 0); + assert(ret >= 0); /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl, H5Z_FILTER_ALL); - HDassert(ret >= 0); + assert(ret >= 0); /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ ret = H5Sclose(sid); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Pclose(dcpl); - HDassert(ret >= 0); + assert(ret >= 0); ret = H5Fclose(fid); - HDassert(ret >= 0); + assert(ret >= 0); } /*------------------------------------------------------------------------- diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index cbb5f8f..35b6b07 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -222,7 +222,7 @@ main(void) */ TESTING(" files with file space info setting--no options (-S, -P, -T, -G) are set"); j = 0; /* #0 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; @@ -239,7 +239,7 @@ main(void) TESTING(" files with file space info setting--all options -S, -P, -T, -G are set"); ++j; /* #1 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; @@ -259,7 +259,7 @@ main(void) TESTING(" files with file space info setting--options -S and -T are set"); ++j; /* #2 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; @@ -278,7 +278,7 @@ main(void) if (h5_using_default_driver(NULL)) { TESTING(" files with file space info setting-- options -S and -P are set & -L"); ++j; /* #3 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; @@ -296,7 +296,7 @@ main(void) TESTING(" files with file space info setting-- options -P and -T are set & -L"); ++j; /* #4 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; @@ -314,7 +314,7 @@ main(void) TESTING(" files with file space info setting-- options -S and -G are set & -L"); ++j; /* #5 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; @@ -332,7 +332,7 @@ main(void) TESTING(" files with file space info setting-- options -S, -P, -T, -G are set"); ++j; /* #6 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, FALSE) < 0) GOERROR; @@ -352,7 +352,7 @@ main(void) TESTING(" files with file space info setting-- options -S, -T, -G are set & -L"); ++j; /* #7 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); fname = H5REPACK_FSPACE_FNAMES[j]; if (h5repack_init(&pack_options, 0, TRUE) < 0) GOERROR; @@ -2040,7 +2040,7 @@ make_testfiles(void) * default: strategy=FSM_AGGR, persist=FALSE, threshold=1 * default: inpage=4096 */ - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2061,7 +2061,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2080,7 +2080,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2103,7 +2103,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_page_size(fcpl, (hsize_t)8192) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2125,7 +2125,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_page_size(fcpl, (hsize_t)FS_PAGESIZE_DEF) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2145,7 +2145,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_AGGR, FALSE, (hsize_t)1) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, fapl)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -2168,7 +2168,7 @@ make_testfiles(void) return -1; if (H5Pset_file_space_page_size(fcpl, (hsize_t)8192) < 0) return -1; - HDassert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); + assert(j < NELMTS(H5REPACK_FSPACE_FNAMES)); if ((fid = H5Fcreate(H5REPACK_FSPACE_FNAMES[++j], H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) return -1; if (H5Fclose(fid) < 0) @@ -3787,7 +3787,7 @@ make_userblock(void) /* Write userblock data */ nwritten = HDwrite(fd, ub, (size_t)USERBLOCK_SIZE); - HDassert(nwritten == USERBLOCK_SIZE); + assert(nwritten == USERBLOCK_SIZE); /* Close file */ HDclose(fd); @@ -3852,7 +3852,7 @@ verify_userblock(const char *filename) /* Read userblock data */ nread = HDread(fd, ub, (size_t)USERBLOCK_SIZE); - HDassert(nread == USERBLOCK_SIZE); + assert(nread == USERBLOCK_SIZE); /* Verify userblock data */ for (u = 0; u < USERBLOCK_SIZE; u++) @@ -3902,7 +3902,7 @@ make_userblock_file(void) /* write userblock data */ nwritten = HDwrite(fd, ub, (size_t)USERBLOCK_SIZE); - HDassert(nwritten == USERBLOCK_SIZE); + assert(nwritten == USERBLOCK_SIZE); /* close file */ HDclose(fd); diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index c61e6a9..b815939 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -100,10 +100,10 @@ synchronize(void) int H5_ATTR_NDEBUG_UNUSED status; status = HDsystem("sync"); - HDassert(status >= 0); + assert(status >= 0); status = HDsystem("df >/dev/null"); - HDassert(status >= 0); + assert(status >= 0); #endif } @@ -150,15 +150,15 @@ main(void) /* Open the files */ file = H5Fcreate(HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - HDassert(file >= 0); + assert(file >= 0); fd = HDopen(RAW_FILE_NAME, O_RDWR | O_CREAT | O_TRUNC, 0666); - HDassert(fd >= 0); + assert(fd >= 0); /* Create the dataset */ file_space = H5Screate_simple(2, size, size); - HDassert(file_space >= 0); + assert(file_space >= 0); dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - HDassert(dset >= 0); + assert(dset >= 0); the_data = (unsigned char *)HDmalloc((size_t)(size[0] * size[1])); /* initial fill for lazy malloc */ @@ -198,7 +198,7 @@ main(void) HDputc(PROGRESS, stderr); HDfflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); - HDassert(status >= 0); + assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -222,9 +222,9 @@ main(void) HDputc(PROGRESS, stderr); HDfflush(stderr); offset = HDlseek(fd, (off_t)0, SEEK_SET); - HDassert(0 == offset); + assert(0 == offset); n = HDwrite(fd, the_data, (size_t)(size[0] * size[1])); - HDassert(n >= 0 && (size_t)n == (size[0] * size[1])); + assert(n >= 0 && (size_t)n == (size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -248,7 +248,7 @@ main(void) HDputc(PROGRESS, stderr); HDfflush(stderr); status = H5Dwrite(dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, the_data); - HDassert(status >= 0); + assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -272,9 +272,9 @@ main(void) HDputc(PROGRESS, stderr); HDfflush(stderr); offset = HDlseek(fd, (off_t)0, SEEK_SET); - HDassert(0 == offset); + assert(0 == offset); n = HDread(fd, the_data, (size_t)(size[0] * size[1])); - HDassert(n >= 0 && (size_t)n == (size[0] * size[1])); + assert(n >= 0 && (size_t)n == (size[0] * size[1])); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -298,7 +298,7 @@ main(void) HDputc(PROGRESS, stderr); HDfflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); - HDassert(status >= 0); + assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -312,11 +312,11 @@ main(void) t_start, t_stop, (size_t)(nread * size[0] * size[1])); /* Read hyperslab */ - HDassert(size[0] > 20 && size[1] > 20); + assert(size[0] > 20 && size[1] > 20); start[0] = start[1] = 10; count[0] = count[1] = size[0] - 20; status = H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, NULL, count, NULL); - HDassert(status >= 0); + assert(status >= 0); synchronize(); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); @@ -327,7 +327,7 @@ main(void) HDputc(PROGRESS, stderr); HDfflush(stderr); status = H5Dread(dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); - HDassert(status >= 0); + assert(status >= 0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); diff --git a/utils/mirror_vfd/mirror_writer.c b/utils/mirror_vfd/mirror_writer.c index 5bf79f4..4dbda3b 100644 --- a/utils/mirror_vfd/mirror_writer.c +++ b/utils/mirror_vfd/mirror_writer.c @@ -223,7 +223,7 @@ session_stop(struct mirror_session *session) { int ret_value = 0; - HDassert(session && (session->magic == MW_SESSION_MAGIC)); + assert(session && (session->magic == MW_SESSION_MAGIC)); mirror_log(session->loginfo, V_INFO, "session_stop()"); @@ -317,7 +317,7 @@ _xmit_reply(struct mirror_session *session) unsigned char xmit_buf[H5FD_MIRROR_XMIT_REPLY_SIZE]; H5FD_mirror_xmit_reply_t *reply = &(session->reply); - HDassert(session && (session->magic == MW_SESSION_MAGIC)); + assert(session && (session->magic == MW_SESSION_MAGIC)); mirror_log(session->loginfo, V_ALL, "_xmit_reply()"); @@ -353,7 +353,7 @@ reply_ok(struct mirror_session *session) { H5FD_mirror_xmit_reply_t *reply = &(session->reply); - HDassert(session && (session->magic == MW_SESSION_MAGIC)); + assert(session && (session->magic == MW_SESSION_MAGIC)); mirror_log(session->loginfo, V_ALL, "reply_ok()"); @@ -377,7 +377,7 @@ reply_error(struct mirror_session *session, const char *msg) { H5FD_mirror_xmit_reply_t *reply = &(session->reply); - HDassert(session && (session->magic == MW_SESSION_MAGIC)); + assert(session && (session->magic == MW_SESSION_MAGIC)); mirror_log(session->loginfo, V_ALL, "reply_error(%s)", msg); @@ -398,7 +398,7 @@ static int do_close(struct mirror_session *session) { - HDassert(session && (session->magic == MW_SESSION_MAGIC)); + assert(session && (session->magic == MW_SESSION_MAGIC)); mirror_log(session->loginfo, V_INFO, "do_close()"); @@ -438,7 +438,7 @@ do_lock(struct mirror_session *session, const unsigned char *xmit_buf) size_t decode_ret = 0; H5FD_mirror_xmit_lock_t xmit_lock; - HDassert(session && (session->magic == MW_SESSION_MAGIC) && xmit_buf); + assert(session && (session->magic == MW_SESSION_MAGIC) && xmit_buf); mirror_log(session->loginfo, V_INFO, "do_lock()"); @@ -486,8 +486,8 @@ do_open(struct mirror_session *session, const H5FD_mirror_xmit_open_t *xmit_open unsigned _flags = 0; haddr_t _maxaddr = HADDR_UNDEF; - HDassert(session && (session->magic == MW_SESSION_MAGIC) && xmit_open && - true == H5FD_mirror_xmit_is_open(xmit_open)); + assert(session && (session->magic == MW_SESSION_MAGIC) && xmit_open && + true == H5FD_mirror_xmit_is_open(xmit_open)); mirror_log(session->loginfo, V_INFO, "do_open()"); @@ -581,7 +581,7 @@ do_set_eoa(struct mirror_session *session, const unsigned char *xmit_buf) size_t decode_ret = 0; H5FD_mirror_xmit_eoa_t xmit_seoa; - HDassert(session && (session->magic == MW_SESSION_MAGIC) && xmit_buf); + assert(session && (session->magic == MW_SESSION_MAGIC) && xmit_buf); mirror_log(session->loginfo, V_INFO, "do_set_eoa()"); @@ -627,7 +627,7 @@ static int do_truncate(struct mirror_session *session) { - HDassert(session && (session->magic == MW_SESSION_MAGIC)); + assert(session && (session->magic == MW_SESSION_MAGIC)); mirror_log(session->loginfo, V_INFO, "do_truncate()"); @@ -658,7 +658,7 @@ do_truncate(struct mirror_session *session) static int do_unlock(struct mirror_session *session) { - HDassert(session && (session->magic == MW_SESSION_MAGIC)); + assert(session && (session->magic == MW_SESSION_MAGIC)); mirror_log(session->loginfo, V_INFO, "do_unlock()"); @@ -702,7 +702,7 @@ do_write(struct mirror_session *session, const unsigned char *xmit_buf) ssize_t nbytes_in_packet = 0; H5FD_mirror_xmit_write_t xmit_write; - HDassert(session && (session->magic == MW_SESSION_MAGIC) && xmit_buf); + assert(session && (session->magic == MW_SESSION_MAGIC) && xmit_buf); mirror_log(session->loginfo, V_INFO, "do_write()"); @@ -814,9 +814,9 @@ receive_communique(struct mirror_session *session, struct sock_comm *comm) size_t decode_ret; H5FD_mirror_xmit_t *X = comm->xmit_recd; - HDassert((session != NULL) && (session->magic == MW_SESSION_MAGIC) && (comm != NULL) && - (comm->magic == MW_SOCK_COMM_MAGIC) && (comm->xmit_recd != NULL) && (comm->raw != NULL) && - (comm->raw_size >= H5FD_MIRROR_XMIT_BUFFER_MAX)); + assert((session != NULL) && (session->magic == MW_SESSION_MAGIC) && (comm != NULL) && + (comm->magic == MW_SOCK_COMM_MAGIC) && (comm->xmit_recd != NULL) && (comm->raw != NULL) && + (comm->raw_size >= H5FD_MIRROR_XMIT_BUFFER_MAX)); mirror_log(session->loginfo, V_INFO, "receive_communique()"); @@ -900,7 +900,7 @@ process_instructions(struct mirror_session *session) size_t buf_size; H5FD_mirror_xmit_t xmit_recd; /* for decoded xmit header */ - HDassert(session && (session->magic == MW_SESSION_MAGIC)); + assert(session && (session->magic == MW_SESSION_MAGIC)); mirror_log(session->loginfo, V_INFO, "process_instructions()"); -- cgit v0.12