From aebac33a1f290fa5065bce96bb0512317a34c283 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Wed, 28 Jun 2023 15:48:12 -0700 Subject: Remove HD from memory allocate/free calls (#3195) * HDcalloc * HDfree * HDmalloc * HDrealloc --- c++/test/tattr.cpp | 2 +- c++/test/tcompound.cpp | 56 +- c++/test/tdspl.cpp | 12 +- c++/test/titerate.cpp | 2 +- c++/test/trefer.cpp | 48 +- c++/test/tvlstr.cpp | 40 +- doxygen/examples/H5DO_examples.c | 2 +- src/H5CS.c | 14 +- src/H5CX.c | 10 +- src/H5E.c | 8 +- src/H5Eint.c | 4 +- src/H5FDdirect.c | 26 +- src/H5FDint.c | 20 +- src/H5FDmpio.c | 52 +- src/H5FDsubfiling/H5FDioc.c | 26 +- src/H5FDsubfiling/H5FDioc_int.c | 8 +- src/H5FDsubfiling/H5FDioc_threads.c | 16 +- src/H5FDsubfiling/H5FDsubfile_int.c | 20 +- src/H5FDsubfiling/H5FDsubfiling.c | 68 +- src/H5FDsubfiling/H5subfiling_common.c | 114 ++-- src/H5Gloc.c | 2 +- src/H5MM.c | 8 +- src/H5MMprivate.h | 2 +- src/H5Tdbg.c | 6 +- src/H5Tvlen.c | 8 +- src/H5Z.c | 6 +- src/H5private.h | 12 - src/H5system.c | 6 +- src/H5timer.c | 2 +- test/API/H5_api_attribute_test.c | 54 +- test/API/H5_api_dataset_test.c | 190 +++--- test/API/H5_api_file_test.c | 66 +- test/API/H5_api_link_test.c | 24 +- test/API/H5_api_test.c | 2 +- test/API/H5_api_test_util.c | 14 +- test/API/tarray.c | 18 +- test/API/tattr.c | 48 +- test/API/tchecksum.c | 6 +- test/API/tcoords.c | 36 +- test/API/testhdf5.c | 8 +- test/API/tfile.c | 26 +- test/API/tgenprop.c | 36 +- test/API/th5o.c | 12 +- test/API/th5s.c | 70 +- test/API/tid.c | 54 +- test/API/titerate.c | 14 +- test/API/tmisc.c | 90 +-- test/API/trefer.c | 162 ++--- test/API/tselect.c | 408 ++++++------ test/API/tvlstr.c | 14 +- test/API/tvltypes.c | 58 +- test/accum.c | 186 +++--- test/big.c | 12 +- test/btree2.c | 30 +- test/cache.c | 36 +- test/cache_api.c | 5 +- test/cache_common.c | 89 ++- test/cache_logging.c | 4 +- test/cache_tagging.c | 54 +- test/chunk_info.c | 6 +- test/cmpd_dset.c | 74 +-- test/cmpd_dtransform.c | 24 +- test/cork.c | 42 +- test/dangle.c | 6 +- test/direct_chunk.c | 22 +- test/dsets.c | 365 ++++++----- test/dt_arith.c | 104 +-- test/dtransform.c | 24 +- test/dtypes.c | 174 ++--- test/earray.c | 32 +- test/efc.c | 6 +- test/enc_dec_plist.c | 10 +- test/enc_dec_plist_cross_platform.c | 8 +- test/err_compat.c | 24 +- test/error_test.c | 48 +- test/evict_on_close.c | 10 +- test/extend.c | 24 +- test/external.c | 6 +- test/external_common.c | 6 +- test/farray.c | 16 +- test/fheap.c | 12 +- test/file_image.c | 54 +- test/fillval.c | 42 +- test/filter_plugin.c | 14 +- test/flush1.c | 6 +- test/flush2.c | 6 +- test/freespace.c | 84 +-- test/gen_bounds.c | 36 +- test/gen_deflate.c | 6 +- test/gen_file_image.c | 4 +- test/gen_plist.c | 4 +- test/genall5.c | 82 +-- test/getname.c | 4 +- test/gheap.c | 30 +- test/h5test.c | 32 +- test/h5test.h | 2 +- test/hyperslab.c | 90 +-- test/istore.c | 24 +- test/links.c | 144 ++--- test/mdset.c | 10 +- test/mf.c | 10 +- test/mirror_vfd.c | 96 +-- test/ntypes.c | 210 +++--- test/objcopy.c | 72 +-- test/objcopy_ref.c | 28 +- test/ohdr.c | 18 +- test/onion.c | 230 +++---- test/page_buffer.c | 38 +- test/s3comms.c | 44 +- test/select_io_dset.c | 282 ++++---- test/set_extent.c | 48 +- test/stab.c | 18 +- test/swmr_common.c | 6 +- test/swmr_reader.c | 8 +- test/swmr_remove_reader.c | 8 +- test/tarray.c | 18 +- test/tattr.c | 48 +- test/tchecksum.c | 6 +- test/tcoords.c | 36 +- test/testframe.c | 12 +- test/tfile.c | 26 +- test/tgenprop.c | 36 +- test/th5_system.c | 12 +- test/th5o.c | 12 +- test/th5s.c | 70 +- test/tid.c | 54 +- test/timer.c | 40 +- test/titerate.c | 14 +- test/tmisc.c | 90 +-- test/trefer.c | 162 ++--- test/trefer_deprec.c | 108 ++-- test/trefstr.c | 12 +- test/tselect.c | 408 ++++++------ test/tskiplist.c | 18 +- test/tsohm.c | 6 +- test/ttsafe.c | 2 +- test/ttsafe_acreate.c | 4 +- test/ttsafe_cancel.c | 2 +- test/tvlstr.c | 14 +- test/tvltypes.c | 58 +- test/unlink.c | 24 +- test/unregister.c | 12 +- test/use_append_chunk_mirror.c | 4 +- test/use_common.c | 52 +- test/use_disable_mdc_flushes.c | 6 +- test/vds.c | 140 ++-- test/vds_env.c | 36 +- test/vds_swmr_reader.c | 6 +- test/vds_swmr_writer.c | 6 +- test/vfd.c | 150 ++--- test/vol.c | 16 +- testpar/API/H5_api_async_test_parallel.c | 154 ++--- testpar/API/H5_api_dataset_test_parallel.c | 447 +++++++------ testpar/API/H5_api_test_parallel.c | 6 +- testpar/API/t_bigio.c | 38 +- testpar/API/t_coll_chunk.c | 16 +- testpar/API/t_coll_md_read.c | 28 +- testpar/API/t_dset.c | 162 ++--- testpar/API/t_file.c | 16 +- testpar/API/t_file_image.c | 26 +- testpar/API/t_filter_read.c | 12 +- testpar/API/t_mdset.c | 66 +- testpar/API/t_prop.c | 8 +- testpar/API/t_pshutdown.c | 6 +- testpar/API/t_shapesame.c | 36 +- testpar/API/t_span_tree.c | 36 +- testpar/API/testphdf5.c | 4 +- testpar/t_2Gio.c | 170 ++--- testpar/t_bigio.c | 38 +- testpar/t_cache.c | 10 +- testpar/t_coll_chunk.c | 16 +- testpar/t_coll_md.c | 28 +- testpar/t_dset.c | 162 ++--- testpar/t_file.c | 16 +- testpar/t_file_image.c | 26 +- testpar/t_filter_read.c | 12 +- testpar/t_filters_parallel.c | 900 +++++++++++++------------- testpar/t_mdset.c | 66 +- testpar/t_mpi.c | 8 +- testpar/t_pflush1.c | 6 +- testpar/t_pflush2.c | 6 +- testpar/t_pmulti_dset.c | 10 +- testpar/t_pread.c | 16 +- testpar/t_prestart.c | 6 +- testpar/t_prop.c | 8 +- testpar/t_pshutdown.c | 6 +- testpar/t_select_io_dset.c | 204 +++--- testpar/t_shapesame.c | 36 +- testpar/t_span_tree.c | 36 +- testpar/t_subfiling_vfd.c | 134 ++-- testpar/t_vfd.c | 20 +- testpar/testphdf5.c | 4 +- tools/lib/h5diff.c | 34 +- tools/lib/h5diff_array.c | 36 +- tools/lib/h5diff_attr.c | 38 +- tools/lib/h5diff_dset.c | 56 +- tools/lib/h5tools.c | 28 +- tools/lib/h5tools_dump.c | 70 +- tools/lib/h5tools_ref.c | 6 +- tools/lib/h5tools_str.c | 36 +- tools/lib/h5tools_utils.c | 34 +- tools/lib/h5trav.c | 64 +- tools/lib/io_timer.c | 4 +- tools/libtest/h5tools_test_utils.c | 8 +- tools/src/h5copy/h5copy.c | 20 +- tools/src/h5diff/h5diff_common.c | 4 +- tools/src/h5diff/h5diff_main.c | 10 +- tools/src/h5dump/h5dump.c | 44 +- tools/src/h5dump/h5dump_ddl.c | 48 +- tools/src/h5dump/h5dump_xml.c | 202 +++--- tools/src/h5format_convert/h5format_convert.c | 4 +- tools/src/h5import/h5import.c | 62 +- tools/src/h5jam/h5jam.c | 6 +- tools/src/h5jam/h5unjam.c | 12 +- tools/src/h5ls/h5ls.c | 46 +- tools/src/h5perf/pio_engine.c | 6 +- tools/src/h5perf/pio_perf.c | 8 +- tools/src/h5perf/sio_engine.c | 16 +- tools/src/h5perf/sio_perf.c | 22 +- tools/src/h5repack/h5repack.c | 20 +- tools/src/h5repack/h5repack_copy.c | 16 +- tools/src/h5repack/h5repack_opttable.c | 12 +- tools/src/h5repack/h5repack_parse.c | 50 +- tools/src/h5repack/h5repack_refs.c | 95 ++- tools/src/h5stat/h5stat.c | 49 +- tools/src/misc/h5clear.c | 4 +- tools/src/misc/h5mkgrp.c | 8 +- tools/src/misc/h5repart.c | 12 +- tools/test/h5copy/h5copygentest.c | 12 +- tools/test/h5diff/h5diffgentest.c | 68 +- tools/test/h5dump/h5dumpgentest.c | 350 +++++----- tools/test/h5format_convert/h5fc_gentest.c | 2 +- tools/test/h5jam/getub.c | 10 +- tools/test/h5jam/h5jamgentest.c | 6 +- tools/test/h5repack/h5repacktst.c | 88 +-- tools/test/misc/clear_open_chk.c | 4 +- tools/test/misc/h5clear_gentest.c | 4 +- tools/test/misc/h5repart_gentest.c | 12 +- tools/test/misc/talign.c | 4 +- tools/test/perform/chunk_cache.c | 8 +- tools/test/perform/iopipe.c | 4 +- tools/test/perform/zip_perf.c | 14 +- utils/mirror_vfd/mirror_remote.c | 6 +- utils/mirror_vfd/mirror_server.c | 18 +- utils/mirror_vfd/mirror_writer.c | 16 +- utils/tools/h5dwalk/h5dwalk.c | 4 +- 246 files changed, 5892 insertions(+), 5912 deletions(-) diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 4a35763..fe27cb5 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -1663,7 +1663,7 @@ test_string_attr(FileAccPropList &fapl) if (HDstrcmp(string_att_check, ATTRSTR_DATA.c_str()) != 0) TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,string_att_check=%s\n", __LINE__, ATTRSTR_DATA.c_str(), string_att_check); - HDfree(string_att_check); + free(string_att_check); /* Test Attribute::read(...,H5std_string& strg) with VL string */ // Read and verify the attribute string as an std::string. diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 96073d6..b59f59c 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -100,9 +100,9 @@ test_compound_2() SUBTEST("Compound Element Reordering"); try { // Sizes should be the same, but be careful just in case - buf = static_cast(HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)))); - bkg = static_cast(HDmalloc(nelmts * sizeof(dst_typ_t))); - orig = static_cast(HDmalloc(nelmts * sizeof(src_typ_t))); + buf = static_cast(malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)))); + bkg = static_cast(malloc(nelmts * sizeof(dst_typ_t))); + orig = static_cast(malloc(nelmts * sizeof(src_typ_t))); for (i = 0; i < nelmts; i++) { s_ptr = (reinterpret_cast(orig)) + i; s_ptr->a = i * 8 + 0; @@ -161,9 +161,9 @@ test_compound_2() } } // Release resources - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); s_ptr = NULL; d_ptr = NULL; st.close(); @@ -213,9 +213,9 @@ test_compound_3() SUBTEST("Compound Datatype Subset Conversions"); try { /* Initialize */ - buf = static_cast(HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)))); - bkg = static_cast(HDmalloc(nelmts * sizeof(dst_typ_t))); - orig = static_cast(HDmalloc(nelmts * sizeof(src_typ_t))); + buf = static_cast(malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)))); + bkg = static_cast(malloc(nelmts * sizeof(dst_typ_t))); + orig = static_cast(malloc(nelmts * sizeof(src_typ_t))); for (i = 0; i < nelmts; i++) { s_ptr = (reinterpret_cast(orig)) + i; s_ptr->a = i * 8 + 0; @@ -271,9 +271,9 @@ test_compound_3() } /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); s_ptr = NULL; d_ptr = NULL; st.close(); @@ -328,9 +328,9 @@ test_compound_4() SUBTEST("Compound Element Shrinking & Reordering"); try { /* Sizes should be the same, but be careful just in case */ - buf = static_cast(HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)))); - bkg = static_cast(HDmalloc(nelmts * sizeof(dst_typ_t))); - orig = static_cast(HDmalloc(nelmts * sizeof(src_typ_t))); + buf = static_cast(malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)))); + bkg = static_cast(malloc(nelmts * sizeof(dst_typ_t))); + orig = static_cast(malloc(nelmts * sizeof(src_typ_t))); for (i = 0; i < nelmts; i++) { s_ptr = (reinterpret_cast(orig)) + i; s_ptr->a = i * 8 + 0; @@ -390,9 +390,9 @@ test_compound_4() } // for /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); s_ptr = NULL; d_ptr = NULL; st.close(); @@ -439,8 +439,8 @@ test_compound_5() hsize_t dims[1] = {4}; src_typ_t src[2] = {{"one", 102, {104, 105, 106, 107}}, {"two", 202, {204, 205, 206, 207}}}; dst_typ_t *dst; - void *buf = HDcalloc(2, sizeof(dst_typ_t)); - void *bkg = HDcalloc(2, sizeof(dst_typ_t)); + void *buf = calloc(2, sizeof(dst_typ_t)); + void *bkg = calloc(2, sizeof(dst_typ_t)); ArrayType *array_dt = NULL; // Output message about test being performed @@ -490,8 +490,8 @@ test_compound_5() } /* Free memory buffers */ - HDfree(buf); - HDfree(bkg); + free(buf); + free(bkg); dst = NULL; PASSED(); } // end of try block @@ -539,9 +539,9 @@ test_compound_6() SUBTEST("Compound Element Growing"); try { /* Sizes should be the same, but be careful just in case */ - buf = static_cast(HDmalloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)))); - bkg = static_cast(HDmalloc(nelmts * sizeof(dst_typ_t))); - orig = static_cast(HDmalloc(nelmts * sizeof(src_typ_t))); + buf = static_cast(malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)))); + bkg = static_cast(malloc(nelmts * sizeof(dst_typ_t))); + orig = static_cast(malloc(nelmts * sizeof(src_typ_t))); for (i = 0; i < nelmts; i++) { s_ptr = (reinterpret_cast(orig)) + i; s_ptr->b = (i * 8 + 1) & 0x7fff; @@ -574,9 +574,9 @@ test_compound_6() } /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); s_ptr = NULL; d_ptr = NULL; st.close(); diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index 308285f..e076c5a 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -60,12 +60,12 @@ test_transfplist() // Find out the length of the transform expression, allocate the buffer // for it, then read and verify the expression from the copied plist size_t tran_len = static_cast(dxpl_c_to_f_copy.getDataTransform(NULL)); - char *c_to_f_read = static_cast(HDmalloc(tran_len + 1)); + char *c_to_f_read = static_cast(malloc(tran_len + 1)); HDmemset(c_to_f_read, 0, tran_len + 1); dxpl_c_to_f_copy.getDataTransform(c_to_f_read, tran_len + 1); verify_val(const_cast(c_to_f_read), const_cast(c_to_f), "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(c_to_f_read); + free(c_to_f_read); // // Read the expression of each of the prop lists and verify the read @@ -75,12 +75,12 @@ test_transfplist() // Get and verify the expression with: // ssize_t getDataTransform(char* exp, const size_t buf_size [default=0]) tran_len = static_cast(dxpl_c_to_f.getDataTransform(NULL)); - c_to_f_read = static_cast(HDmalloc(tran_len + 1)); + c_to_f_read = static_cast(malloc(tran_len + 1)); HDmemset(c_to_f_read, 0, tran_len + 1); dxpl_c_to_f.getDataTransform(c_to_f_read, tran_len + 1); verify_val(const_cast(c_to_f_read), const_cast(c_to_f), "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(c_to_f_read); + free(c_to_f_read); // Get and verify the expression with: // H5std_string DSetMemXferPropList::getDataTransform() @@ -91,12 +91,12 @@ test_transfplist() // Get and verify the expression with: // ssize_t getDataTransform(char* exp, const size_t buf_size) tran_len = static_cast(dxpl_utrans_inv.getDataTransform(NULL, 0)); - char *utrans_inv_read = static_cast(HDmalloc(tran_len + 1)); + char *utrans_inv_read = static_cast(malloc(tran_len + 1)); HDmemset(utrans_inv_read, 0, tran_len + 1); dxpl_utrans_inv.getDataTransform(utrans_inv_read, tran_len + 1); verify_val(const_cast(utrans_inv_read), const_cast(utrans_inv), "DSetMemXferPropList::getDataTransform", __LINE__, __FILE__); - HDfree(utrans_inv_read); + free(utrans_inv_read); PASSED(); } diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index 70eb25f..a360595 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -267,7 +267,7 @@ test_iter_group(FileAccPropList &fapl) /* Free the dataset names */ for (int i = 0; i < NDATASETS + 2; i++) - HDfree(lnames[i]); + free(lnames[i]); // Everything will be closed as they go out of scope diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index fc7931f..f207eb7 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -80,9 +80,9 @@ test_reference_params() // Allocate write & read buffers size_t temp_size = MAX(sizeof(unsigned), sizeof(hobj_ref_t)); - wbuf = static_cast(HDmalloc(temp_size * SPACE1_DIM1)); - rbuf = static_cast(HDmalloc(temp_size * SPACE1_DIM1)); - tbuf = static_cast(HDmalloc(temp_size * SPACE1_DIM1)); + wbuf = static_cast(malloc(temp_size * SPACE1_DIM1)); + rbuf = static_cast(malloc(temp_size * SPACE1_DIM1)); + tbuf = static_cast(malloc(temp_size * SPACE1_DIM1)); // Create file FILE1 file1 = new H5File(FILE1, H5F_ACC_TRUNC); @@ -168,9 +168,9 @@ test_reference_params() // Let sid1 go out of scope // Free memory buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + free(wbuf); + free(rbuf); + free(tbuf); PASSED(); } // end try @@ -206,9 +206,9 @@ test_reference_obj() // Allocate write & read buffers size_t temp_size = MAX(sizeof(unsigned), sizeof(hobj_ref_t)); - wbuf = static_cast(HDmalloc(temp_size * SPACE1_DIM1)); - rbuf = static_cast(HDmalloc(temp_size * SPACE1_DIM1)); - tbuf = static_cast(HDmalloc(temp_size * SPACE1_DIM1)); + wbuf = static_cast(malloc(temp_size * SPACE1_DIM1)); + rbuf = static_cast(malloc(temp_size * SPACE1_DIM1)); + tbuf = static_cast(malloc(temp_size * SPACE1_DIM1)); // Create file FILE1 file1 = new H5File(FILE1, H5F_ACC_TRUNC); @@ -368,9 +368,9 @@ test_reference_obj() file1->close(); // Free allocated buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + free(wbuf); + free(rbuf); + free(tbuf); PASSED(); } // end try @@ -555,10 +555,10 @@ test_reference_region_1D() *drbuf; // Buffer for reading numeric data from disk // Allocate write & read buffers - wbuf = static_cast(HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1)); - rbuf = static_cast(HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1)); - dwbuf = static_cast(HDmalloc(sizeof(uint8_t) * SPACE3_DIM1)); - drbuf = static_cast(HDcalloc(sizeof(uint8_t), SPACE3_DIM1)); + wbuf = static_cast(calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1)); + rbuf = static_cast(malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1)); + dwbuf = static_cast(malloc(sizeof(uint8_t) * SPACE3_DIM1)); + drbuf = static_cast(calloc(sizeof(uint8_t), SPACE3_DIM1)); // Create file FILE1 H5File file1(FILE2, H5F_ACC_TRUNC); @@ -714,7 +714,7 @@ test_reference_region_1D() /* Allocate space for the hyperslab blocks */ coords = - static_cast(HDmalloc(static_cast(nelms) * SPACE3_RANK * sizeof(hsize_t) * 2)); + static_cast(malloc(static_cast(nelms) * SPACE3_RANK * sizeof(hsize_t) * 2)); // Get the list of hyperslab blocks currently selected reg_sp.getSelectHyperBlocklist(0, static_cast(nelms), coords); @@ -751,7 +751,7 @@ test_reference_region_1D() verify_val(static_cast(coords[28]), 72, "Hyperslab Coordinates", __LINE__, __FILE__); verify_val(static_cast(coords[29]), 73, "Hyperslab Coordinates", __LINE__, __FILE__); - HDfree(coords); + free(coords); // Check boundaries reg_sp.getSelectBounds(low, high); @@ -774,7 +774,7 @@ test_reference_region_1D() /* Allocate space for the hyperslab blocks */ coords = - static_cast(HDmalloc(static_cast(nelmspts) * SPACE3_RANK * sizeof(hsize_t))); + static_cast(malloc(static_cast(nelmspts) * SPACE3_RANK * sizeof(hsize_t))); // Get the list of element points currently selected elm_sp.getSelectElemPointlist(0, static_cast(nelmspts), coords); @@ -791,7 +791,7 @@ test_reference_region_1D() verify_val(coords[8], coord1[8][0], "Element Coordinates", __LINE__, __FILE__); verify_val(coords[9], coord1[9][0], "Element Coordinates", __LINE__, __FILE__); - HDfree(coords); + free(coords); // Check boundaries elm_sp.getSelectBounds(low, high); @@ -808,10 +808,10 @@ test_reference_region_1D() file1.close(); // Free memory buffers - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); PASSED(); } // end try diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 1cde7f1..3f5848e 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -65,7 +65,7 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) extra=MAX(sizeof(void *),sizeof(size_t)); - if((ret_value=HDmalloc(extra+size))!=NULL) { + if((ret_value=malloc(extra+size))!=NULL) { *(size_t *)ret_value=size; *mem_used+=size; } // end if @@ -108,7 +108,7 @@ static void test_vlstr_free_custom(void *_mem, void *info) if(_mem!=NULL) { mem=((unsigned char *)_mem)-extra; *mem_used-=*(size_t *)mem; - HDfree(mem); + free(mem); } // end if } #endif @@ -166,7 +166,7 @@ test_vlstring_dataset() TestErrPrintf("Line %d: Attribute data different: DSET1_DATA=%s,string_ds_check=%s\n", __LINE__, DSET1_DATA.c_str(), string_ds_check); - HDfree(string_ds_check); // note: no need for std::string test + free(string_ds_check); // note: no need for std::string test string_ds_check = NULL; // Read and verify the dataset string as an std::string. @@ -182,7 +182,7 @@ test_vlstring_dataset() // Test scalar type dataset with 1 value. dset1 = root.createDataSet("test_scalar_small", vlst, ds_space); - dynstring_ds_write = static_cast(HDcalloc(2, sizeof(char))); + dynstring_ds_write = static_cast(calloc(2, sizeof(char))); HDmemset(dynstring_ds_write, 'A', 1); // Write data to the dataset, then read it back. @@ -193,7 +193,7 @@ test_vlstring_dataset() if (HDstrcmp(string_ds_check, dynstring_ds_write) != 0) TestErrPrintf("VL string datasets don't match!, dynstring_ds_write=%s, string_ds_check=%s\n", dynstring_ds_write, string_ds_check); - HDfree(string_ds_check); + free(string_ds_check); string_ds_check = NULL; dset1.close(); @@ -213,9 +213,9 @@ test_vlstring_dataset() } if (dynstring_ds_write) - HDfree(dynstring_ds_write); + free(dynstring_ds_write); if (string_ds_check) - HDfree(string_ds_check); + free(string_ds_check); } // test_vlstring_dataset() /*------------------------------------------------------------------------- @@ -268,7 +268,7 @@ test_vlstring_array_dataset() TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n", __LINE__, string_ds_array[ii], string_ds_check[ii]); - HDfree(string_ds_check[ii]); + free(string_ds_check[ii]); } // Close objects that are no longer needed. @@ -284,7 +284,7 @@ test_vlstring_array_dataset() // Create and write another dataset. DataSet dataset2(file1->createDataSet("Dataset2", vlst, scalar_space)); - char *wdata2 = static_cast(HDcalloc(65534, sizeof(char))); + char *wdata2 = static_cast(calloc(65534, sizeof(char))); HDmemset(wdata2, 'A', 65533); dataset2.write(&wdata2, vlst); @@ -296,8 +296,8 @@ test_vlstring_array_dataset() // Release resources from second dataset operation. scalar_space.close(); dataset2.close(); - HDfree(wdata2); - HDfree(rdata2); + free(wdata2); + free(rdata2); // Close objects and file. dataset2.close(); @@ -662,7 +662,7 @@ test_vlstring_attribute() TestErrPrintf("Line %d: Attribute data different: ATTRSTR_DATA=%s,string_att_check=%s\n", __LINE__, ATTRSTR_DATA.c_str(), string_att_check); - HDfree(string_att_check); // note: no need for std::string test + free(string_att_check); // note: no need for std::string test // Read and verify the attribute string as an std::string. H5std_string read_str; @@ -677,7 +677,7 @@ test_vlstring_attribute() // Test creating a "large" sized string attribute gr_attr = root.createAttribute("test_scalar_large", vlst, att_space); - string_att_write = static_cast(HDcalloc(8192, sizeof(char))); + string_att_write = static_cast(calloc(8192, sizeof(char))); HDmemset(string_att_write, 'A', 8191); // Write data to the attribute, then read it back. @@ -690,8 +690,8 @@ test_vlstring_attribute() string_att_write, string_att_check); // Release resources. - HDfree(string_att_check); - HDfree(string_att_write); + free(string_att_check); + free(string_att_write); gr_attr.close(); file1.close(); @@ -739,7 +739,7 @@ static void test_read_vl_string_attribute() att.read(vlst, &string_att_check); if(HDstrcmp(string_att_check,ATTRSTR_DATA.c_str())!=0) TestErrPrintf("VL string attributes don't match!, string_att=%s, string_att_check=%s\n",ATTRSTR_DATA.c_str(),string_att_check); - HDfree(string_att_check); + free(string_att_check); att.close(); // Test reading "large" sized string attribute @@ -747,8 +747,8 @@ static void test_read_vl_string_attribute() att.read(vlst, &string_att_check); if(HDstrcmp(string_att_check,string_att_write)!=0) TestErrPrintf("VL string attributes don't match!, string_att_write=%s, string_att_check=%s\n",string_att_write,string_att_check); - HDfree(string_att_check); - HDfree(string_att_write); // Free string allocated in test_write_vl_string_attribute + free(string_att_check); + free(string_att_write); // Free string allocated in test_write_vl_string_attribute // Close objects and file. att.close(); @@ -821,7 +821,7 @@ test_vlstring_array_attribute() TestErrPrintf("Line %d: Attribute data different: written=%s,read=%s\n", __LINE__, string_att_check[ii], string_att_check[ii]); - HDfree(string_att_check[ii]); // note: no need for std::string test + free(string_att_check[ii]); // note: no need for std::string test } // Close group's attribute. @@ -869,7 +869,7 @@ read_scalar_dset(H5File &file, DataType &type, DataSpace &space, char *name, cha if (HDstrcmp(data, data_read) != 0) TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read); - HDfree(data_read); + free(data_read); } // end try catch (FileIException &ferr) { throw; diff --git a/doxygen/examples/H5DO_examples.c b/doxygen/examples/H5DO_examples.c index 7f4096e..2a2d6dd 100644 --- a/doxygen/examples/H5DO_examples.c +++ b/doxygen/examples/H5DO_examples.c @@ -190,7 +190,7 @@ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int); /* Get the size of the compressed chunk */ ret = H5Dget_chunk_storage_size(dataset, offset, &read_chunk_nbytes); - readbuf = HDmalloc(read_chunk_nbytes); + readbuf = malloc(read_chunk_nbytes); pt_readbuf = (const Bytef *)readbuf; /* Use H5DOread_chunk() to read the chunk back */ diff --git a/src/H5CS.c b/src/H5CS.c index 43c5bc3..c65a015 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -90,8 +90,8 @@ H5CS__get_stack(void) fstack = (H5CS_t *)LocalAlloc( LPTR, sizeof(H5CS_t)); /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ #else - fstack = (H5CS_t *)HDmalloc( - sizeof(H5CS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */ + fstack = + (H5CS_t *)malloc(sizeof(H5CS_t)); /* Don't use H5MM_malloc() here, it causes infinite recursion */ #endif /* H5_HAVE_WIN_THREADS */ assert(fstack); @@ -183,7 +183,7 @@ H5CS_push(const char *func_name) size_t na = MAX((fstack->nalloc * 2), H5CS_MIN_NSLOTS); /* Don't use H5MM_realloc here */ - const char **x = (const char **)HDrealloc(fstack->rec, na * sizeof(const char *)); + const char **x = (const char **)realloc(fstack->rec, na * sizeof(const char *)); /* (Avoid returning an error from this routine, currently -QAK) */ assert(x); @@ -256,9 +256,9 @@ H5CS_copy_stack(void) /* Allocate a new stack */ /* (Don't use library allocate code, since this code stack supports it) */ - if (NULL == (new_stack = HDcalloc(1, sizeof(H5CS_t)))) + if (NULL == (new_stack = calloc(1, sizeof(H5CS_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't allocate function stack") - if (NULL == (new_stack->rec = HDcalloc(old_stack->nused, sizeof(const char *)))) + if (NULL == (new_stack->rec = calloc(old_stack->nused, sizeof(const char *)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't allocate function stack records") /* Copy pointers on old stack to new one */ @@ -301,11 +301,11 @@ H5CS_close_stack(H5CS_t *stack) * and are not allocated, so there's no need to free them. */ if (stack->rec) { - HDfree(stack->rec); + free(stack->rec); stack->rec = NULL; } /* end if */ if (stack) - HDfree(stack); + free(stack); FUNC_LEAVE_NOAPI_NOFS(SUCCEED) } /* end H5CS_close_stack() */ diff --git a/src/H5CX.c b/src/H5CX.c index c5bb520..51bbd2f 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -696,8 +696,8 @@ H5CX_term_package(void) cnode = H5CX__pop_common(FALSE); /* Free the context node */ - /* (Allocated with HDmalloc() in H5CX_push_special() ) */ - HDfree(cnode); + /* (Allocated with malloc() in H5CX_push_special() ) */ + free(cnode); #ifndef H5_HAVE_THREADSAFE H5CX_head_g = NULL; @@ -736,10 +736,10 @@ H5CX__get_context(void) /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ ctx = (H5CX_node_t **)LocalAlloc(LPTR, sizeof(H5CX_node_t *)); #else - /* Use HDmalloc here since this has to match the HDfree in the + /* Use malloc here since this has to match the free in the * destructor and we want to avoid the codestack there. */ - ctx = (H5CX_node_t **)HDmalloc(sizeof(H5CX_node_t *)); + ctx = (H5CX_node_t **)malloc(sizeof(H5CX_node_t *)); #endif /* H5_HAVE_WIN_THREADS */ assert(ctx); @@ -852,7 +852,7 @@ H5CX_push_special(void) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Allocate & clear API context node, without using library API routines */ - cnode = (H5CX_node_t *)HDcalloc(1, sizeof(H5CX_node_t)); + cnode = (H5CX_node_t *)calloc(1, sizeof(H5CX_node_t)); assert(cnode); /* Set context info */ diff --git a/src/H5E.c b/src/H5E.c index ca7da2c..1c82e5d 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -333,10 +333,10 @@ H5E__get_stack(void) /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */ estack = (H5E_t *)LocalAlloc(LPTR, sizeof(H5E_t)); #else - /* Use HDmalloc here since this has to match the HDfree in the + /* Use malloc here since this has to match the free in the * destructor and we want to avoid the codestack there. */ - estack = (H5E_t *)HDmalloc(sizeof(H5E_t)); + estack = (H5E_t *)malloc(sizeof(H5E_t)); #endif /* H5_HAVE_WIN_THREADS */ assert(estack); @@ -1347,10 +1347,10 @@ done: if (va_started) va_end(ap); /* Memory was allocated with HDvasprintf so it needs to be freed - * with HDfree + * with free */ if (tmp) - HDfree(tmp); + free(tmp); FUNC_LEAVE_API(ret_value) } /* end H5Epush2() */ diff --git a/src/H5Eint.c b/src/H5Eint.c index 2719a41..4b2f185 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -688,10 +688,10 @@ done: if (va_started) va_end(ap); /* Memory was allocated with HDvasprintf so it needs to be freed - * with HDfree + * with free */ if (tmp) - HDfree(tmp); + free(tmp); FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_printf_stack() */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 7275bb5..25006ac 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -549,10 +549,10 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad * is to handle correctly the case that the file is in a different file system * than the one where the program is running. */ - /* NOTE: Use HDmalloc and HDfree here to ensure compatibility with - * posix_memalign. + /* NOTE: Use malloc and free here to ensure compatibility with + * posix_memalign(). */ - buf1 = HDmalloc(sizeof(int)); + buf1 = malloc(sizeof(int)); if (posix_memalign(&buf2, file->fa.mboundary, file->fa.fbsize) != 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "posix_memalign failed") @@ -591,9 +591,9 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad } if (buf1) - HDfree(buf1); + free(buf1); if (buf2) - HDfree(buf2); + free(buf2); /* Set return value */ ret_value = (H5FD_t *)file; @@ -1003,8 +1003,8 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U addr = (haddr_t)(((addr + size - 1) / _fbsize + 1) * _fbsize); if (copy_buf) { - /* Free with HDfree since it came from posix_memalign */ - HDfree(copy_buf); + /* Free with free since it came from posix_memalign */ + free(copy_buf); copy_buf = NULL; } /* end if */ } @@ -1015,9 +1015,9 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U done: if (ret_value < 0) { - /* Free with HDfree since it came from posix_memalign */ + /* Free with free since it came from posix_memalign */ if (copy_buf) - HDfree(copy_buf); + free(copy_buf); /* Reset last file I/O information */ file->pos = HADDR_UNDEF; @@ -1230,8 +1230,8 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ buf = (const char *)buf + size; if (copy_buf) { - /* Free with HDfree since it came from posix_memalign */ - HDfree(copy_buf); + /* Free with free since it came from posix_memalign */ + free(copy_buf); copy_buf = NULL; } /* end if */ } @@ -1244,9 +1244,9 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ done: if (ret_value < 0) { - /* Free with HDfree since it came from posix_memalign */ + /* Free with free since it came from posix_memalign */ if (copy_buf) - HDfree(copy_buf); + free(copy_buf); /* Reset last file I/O information */ file->pos = HADDR_UNDEF; diff --git a/src/H5FDint.c b/src/H5FDint.c index b10c386..2bc50ad 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -2283,7 +2283,7 @@ H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t srt_tmp_size = (count * sizeof(struct H5FD_vsrt_tmp_t)); - if (NULL == (srt_tmp = (H5FD_vsrt_tmp_t *)HDmalloc(srt_tmp_size))) + if (NULL == (srt_tmp = (H5FD_vsrt_tmp_t *)malloc(srt_tmp_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc srt_tmp") @@ -2305,11 +2305,11 @@ H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "duplicate addr in vector") } - if ((NULL == (*s_types_ptr = (H5FD_mem_t *)HDmalloc(count * sizeof(H5FD_mem_t)))) || - (NULL == (*s_addrs_ptr = (haddr_t *)HDmalloc(count * sizeof(haddr_t)))) || - (NULL == (*s_sizes_ptr = (size_t *)HDmalloc(count * sizeof(size_t)))) || + if ((NULL == (*s_types_ptr = (H5FD_mem_t *)malloc(count * sizeof(H5FD_mem_t)))) || + (NULL == (*s_addrs_ptr = (haddr_t *)malloc(count * sizeof(haddr_t)))) || + (NULL == (*s_sizes_ptr = (size_t *)malloc(count * sizeof(size_t)))) || (NULL == - (*s_bufs_ptr = (H5_flexible_const_ptr_t *)HDmalloc(count * sizeof(H5_flexible_const_ptr_t))))) { + (*s_bufs_ptr = (H5_flexible_const_ptr_t *)malloc(count * sizeof(H5_flexible_const_ptr_t))))) { HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sorted vector(s)") } @@ -2350,7 +2350,7 @@ H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t done: if (srt_tmp) { - HDfree(srt_tmp); + free(srt_tmp); srt_tmp = NULL; } @@ -2365,25 +2365,25 @@ done: /* free space allocated for sorted vectors */ if (*s_types_ptr) { - HDfree(*s_types_ptr); + free(*s_types_ptr); *s_types_ptr = NULL; } if (*s_addrs_ptr) { - HDfree(*s_addrs_ptr); + free(*s_addrs_ptr); *s_addrs_ptr = NULL; } if (*s_sizes_ptr) { - HDfree(*s_sizes_ptr); + free(*s_sizes_ptr); *s_sizes_ptr = NULL; } if (*s_bufs_ptr) { - HDfree(*s_bufs_ptr); + free(*s_bufs_ptr); *s_bufs_ptr = NULL; } } diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 47375df..52370f1 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1848,9 +1848,9 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ s_sizes, s_bufs) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't sort vector I/O request") - if ((NULL == (mpi_block_lengths = (int *)HDmalloc((size_t)count * sizeof(int)))) || - (NULL == (mpi_displacements = (MPI_Aint *)HDmalloc((size_t)count * sizeof(MPI_Aint)))) || - (NULL == (mpi_bufs = (MPI_Aint *)HDmalloc((size_t)count * sizeof(MPI_Aint))))) { + if ((NULL == (mpi_block_lengths = (int *)malloc((size_t)count * sizeof(int)))) || + (NULL == (mpi_displacements = (MPI_Aint *)malloc((size_t)count * sizeof(MPI_Aint)))) || + (NULL == (mpi_bufs = (MPI_Aint *)malloc((size_t)count * sizeof(MPI_Aint))))) { HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc mpi block lengths / displacement") } @@ -1924,9 +1924,9 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ if (!sub_types) { assert(!sub_types_created); - if (NULL == (sub_types = HDmalloc((size_t)count * sizeof(MPI_Datatype)))) + if (NULL == (sub_types = malloc((size_t)count * sizeof(MPI_Datatype)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sub types array") - if (NULL == (sub_types_created = (uint8_t *)HDcalloc((size_t)count, 1))) { + if (NULL == (sub_types_created = (uint8_t *)calloc((size_t)count, 1))) { H5MM_free(sub_types); sub_types = NULL; HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sub types created array") @@ -1984,15 +1984,15 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ /* Free up memory used to build types */ assert(mpi_block_lengths); - HDfree(mpi_block_lengths); + free(mpi_block_lengths); mpi_block_lengths = NULL; assert(mpi_displacements); - HDfree(mpi_displacements); + free(mpi_displacements); mpi_displacements = NULL; assert(mpi_bufs); - HDfree(mpi_bufs); + free(mpi_bufs); mpi_bufs = NULL; if (sub_types) { @@ -2002,9 +2002,9 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ if (sub_types_created[i]) MPI_Type_free(&sub_types[i]); - HDfree(sub_types); + free(sub_types); sub_types = NULL; - HDfree(sub_types_created); + free(sub_types_created); sub_types_created = NULL; } @@ -2032,24 +2032,24 @@ done: /* free sorted vectors if they exist */ if (!vector_was_sorted) if (s_types) { - HDfree(s_types); + free(s_types); s_types = NULL; } /* Clean up on error */ if (ret_value < 0) { if (mpi_block_lengths) { - HDfree(mpi_block_lengths); + free(mpi_block_lengths); mpi_block_lengths = NULL; } if (mpi_displacements) { - HDfree(mpi_displacements); + free(mpi_displacements); mpi_displacements = NULL; } if (mpi_bufs) { - HDfree(mpi_bufs); + free(mpi_bufs); mpi_bufs = NULL; } @@ -2060,9 +2060,9 @@ done: if (sub_types_created[i]) MPI_Type_free(&sub_types[i]); - HDfree(sub_types); + free(sub_types); sub_types = NULL; - HDfree(sub_types_created); + free(sub_types_created); sub_types_created = NULL; } } @@ -2198,7 +2198,7 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou /* free sorted addrs vector if it exists */ if (!vector_was_sorted) if (s_addrs) { - HDfree(s_addrs); + free(s_addrs); s_addrs = NULL; } @@ -2458,15 +2458,15 @@ done: /* free sorted vectors if they exist */ if (!vector_was_sorted) { if (s_addrs) { - HDfree(s_addrs); + free(s_addrs); s_addrs = NULL; } if (s_sizes) { - HDfree(s_sizes); + free(s_sizes); s_sizes = NULL; } if (s_bufs) { - HDfree(s_bufs); + free(s_bufs); s_bufs = NULL; } } @@ -2598,15 +2598,15 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co /* free sorted vectors if they exist */ if (!vector_was_sorted) { if (s_addrs) { - HDfree(s_addrs); + free(s_addrs); s_addrs = NULL; } if (s_sizes) { - HDfree(s_sizes); + free(s_sizes); s_sizes = NULL; } if (s_bufs) { - HDfree(s_bufs); + free(s_bufs); s_bufs = NULL; } } @@ -2762,15 +2762,15 @@ done: /* Cleanup on error */ if (ret_value < 0 && !vector_was_sorted) { if (s_addrs) { - HDfree(s_addrs); + free(s_addrs); s_addrs = NULL; } if (s_sizes) { - HDfree(s_sizes); + free(s_sizes); s_sizes = NULL; } if (s_bufs) { - HDfree(s_bufs); + free(s_bufs); s_bufs = NULL; } } diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index 190c8c4..1cc4f87 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -936,7 +936,7 @@ H5FD__ioc_close_int(H5FD_ioc_t *file_ptr) } done: - HDfree(file_ptr->file_path); + free(file_ptr->file_path); file_ptr->file_path = NULL; H5MM_free(file_ptr->file_dir); @@ -1486,7 +1486,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't get file dirname"); /* Try to open the subfiling configuration file and get the number of IOCs */ - if (NULL == (tmp_filename = HDmalloc(PATH_MAX))) + if (NULL == (tmp_filename = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate config file name buffer"); @@ -1576,7 +1576,7 @@ done: if (H5_mpi_info_free(&info) < 0) H5_SUBFILING_DONE_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free MPI info object"); - HDfree(tmp_filename); + free(tmp_filename); H5MM_free(file_dirname); H5MM_free(base_filename); @@ -1633,9 +1633,9 @@ H5FD__ioc_write_vector_internal(H5FD_t *_file, uint32_t count, H5FD_mem_t H5_ATT * that blocking write calls do not return early before the data is * actually written. */ - if (NULL == (sf_io_reqs = HDcalloc((size_t)count, sizeof(*sf_io_reqs)))) + if (NULL == (sf_io_reqs = calloc((size_t)count, sizeof(*sf_io_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate I/O request array"); - if (NULL == (mpi_reqs = HDmalloc(2 * (size_t)count * sizeof(*mpi_reqs)))) + if (NULL == (mpi_reqs = malloc(2 * (size_t)count * sizeof(*mpi_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate MPI request array"); /* Each pass thru the following should queue an MPI write @@ -1669,12 +1669,12 @@ H5FD__ioc_write_vector_internal(H5FD_t *_file, uint32_t count, H5FD_mem_t H5_ATT H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't complete I/O requests"); done: - HDfree(mpi_reqs); + free(mpi_reqs); if (sf_io_reqs) { for (size_t i = 0; i < count; i++) - HDfree(sf_io_reqs[i]); - HDfree(sf_io_reqs); + free(sf_io_reqs[i]); + free(sf_io_reqs); } H5_SUBFILING_FUNC_LEAVE; @@ -1712,9 +1712,9 @@ H5FD__ioc_read_vector_internal(H5FD_t *_file, uint32_t count, haddr_t addrs[], s * that the actual I/O call (currently, HDpread) has completed and * the data read from the file has been transferred to the caller. */ - if (NULL == (sf_io_reqs = HDcalloc((size_t)count, sizeof(*sf_io_reqs)))) + if (NULL == (sf_io_reqs = calloc((size_t)count, sizeof(*sf_io_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate I/O request array"); - if (NULL == (mpi_reqs = HDmalloc((size_t)count * sizeof(*mpi_reqs)))) + if (NULL == (mpi_reqs = malloc((size_t)count * sizeof(*mpi_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate MPI request array"); for (size_t i = 0; i < (size_t)count; i++) { @@ -1741,12 +1741,12 @@ H5FD__ioc_read_vector_internal(H5FD_t *_file, uint32_t count, haddr_t addrs[], s H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't complete I/O requests"); done: - HDfree(mpi_reqs); + free(mpi_reqs); if (sf_io_reqs) { for (size_t i = 0; i < count; i++) - HDfree(sf_io_reqs[i]); - HDfree(sf_io_reqs); + free(sf_io_reqs[i]); + free(sf_io_reqs); } H5_SUBFILING_FUNC_LEAVE; diff --git a/src/H5FDsubfiling/H5FDioc_int.c b/src/H5FDsubfiling/H5FDioc_int.c index afe6b16..fdde752 100644 --- a/src/H5FDsubfiling/H5FDioc_int.c +++ b/src/H5FDsubfiling/H5FDioc_int.c @@ -167,7 +167,7 @@ ioc__write_independent_async(int64_t context_id, int64_t offset, int64_t element * Allocate the I/O request object that will * be returned to the caller */ - if (NULL == (sf_io_request = HDmalloc(sizeof(io_req_t)))) + if (NULL == (sf_io_request = malloc(sizeof(io_req_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "couldn't allocate I/O request"); H5_CHECK_OVERFLOW(ioc_start, int64_t, int); @@ -228,7 +228,7 @@ done: } } - HDfree(sf_io_request); + free(sf_io_request); *io_req = NULL; } @@ -320,7 +320,7 @@ ioc__read_independent_async(int64_t context_id, int64_t offset, int64_t elements * Allocate the I/O request object that will * be returned to the caller */ - if (NULL == (sf_io_request = HDmalloc(sizeof(io_req_t)))) + if (NULL == (sf_io_request = malloc(sizeof(io_req_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_READERROR, FAIL, "couldn't allocate I/O request"); H5_CHECK_OVERFLOW(ioc_start, int64_t, int); @@ -402,7 +402,7 @@ done: } } - HDfree(sf_io_request); + free(sf_io_request); *io_req = NULL; } diff --git a/src/H5FDsubfiling/H5FDioc_threads.c b/src/H5FDsubfiling/H5FDioc_threads.c index 64529b9..e0d351f 100644 --- a/src/H5FDsubfiling/H5FDioc_threads.c +++ b/src/H5FDsubfiling/H5FDioc_threads.c @@ -125,7 +125,7 @@ initialize_ioc_threads(void *_sf_context) * Allocate and initialize IOC data that will be passed * to the IOC main thread */ - if (NULL == (ioc_data = HDmalloc(sizeof(*ioc_data)))) + if (NULL == (ioc_data = malloc(sizeof(*ioc_data)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, (-1), "can't allocate IOC data for IOC main thread"); ioc_data->sf_context_id = sf_context->sf_context_id; @@ -242,7 +242,7 @@ finalize_ioc_threads(void *_sf_context) H5_SUBFILING_DONE_ERROR(H5E_IO, H5E_CLOSEERROR, -1, "%" PRId32 " I/O requests failed", ioc_data->io_queue.num_failed); - HDfree(ioc_data); + free(ioc_data); sf_context->ioc_data = NULL; H5_SUBFILING_FUNC_LEAVE; @@ -739,7 +739,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ #endif /* Allocate space to receive data sent from the client */ - if (NULL == (recv_buf = HDmalloc((size_t)data_size))) { + if (NULL == (recv_buf = malloc((size_t)data_size))) { send_nack = TRUE; H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, -1, "couldn't allocate receive buffer for data"); } @@ -836,7 +836,7 @@ done: H5_SUBFILING_DONE_ERROR(H5E_IO, H5E_WRITEERROR, -1, "couldn't send NACK to client"); } - HDfree(recv_buf); + free(recv_buf); H5_SUBFILING_FUNC_LEAVE; } /* ioc_file_queue_write_indep() */ @@ -935,7 +935,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C #endif /* Allocate space to send data read from file to client */ - if (NULL == (send_buf = HDmalloc((size_t)data_size))) { + if (NULL == (send_buf = malloc((size_t)data_size))) { if (need_data_tag) { send_nack = TRUE; send_empty_buf = FALSE; @@ -1010,7 +1010,7 @@ done: H5_SUBFILING_MPI_DONE_ERROR(-1, "MPI_Send failed", mpi_code); } - HDfree(send_buf); + free(send_buf); return ret_value; } /* end ioc_file_queue_read_indep() */ @@ -1273,7 +1273,7 @@ ioc_io_queue_alloc_entry(void) { ioc_io_queue_entry_t *q_entry_ptr = NULL; - q_entry_ptr = (ioc_io_queue_entry_t *)HDmalloc(sizeof(ioc_io_queue_entry_t)); + q_entry_ptr = (ioc_io_queue_entry_t *)malloc(sizeof(ioc_io_queue_entry_t)); if (q_entry_ptr) { @@ -1703,7 +1703,7 @@ ioc_io_queue_free_entry(ioc_io_queue_entry_t *q_entry_ptr) q_entry_ptr->magic = 0; - HDfree(q_entry_ptr); + free(q_entry_ptr); q_entry_ptr = NULL; diff --git a/src/H5FDsubfiling/H5FDsubfile_int.c b/src/H5FDsubfiling/H5FDsubfile_int.c index 3a60af1..b8b2725 100644 --- a/src/H5FDsubfiling/H5FDsubfile_int.c +++ b/src/H5FDsubfiling/H5FDsubfile_int.c @@ -101,10 +101,10 @@ H5FD__subfiling__truncate_sub_files(hid_t context_id, int64_t logical_file_eof, num_subfiles_owned = sf_context->sf_num_fids; - if (NULL == (recv_reqs = HDmalloc((size_t)num_subfiles_owned * sizeof(*recv_reqs)))) + if (NULL == (recv_reqs = malloc((size_t)num_subfiles_owned * sizeof(*recv_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate receive requests array"); - if (NULL == (recv_msgs = HDmalloc((size_t)num_subfiles_owned * 3 * sizeof(*recv_msgs)))) + if (NULL == (recv_msgs = malloc((size_t)num_subfiles_owned * 3 * sizeof(*recv_msgs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate message array"); /* @@ -186,8 +186,8 @@ H5FD__subfiling__truncate_sub_files(hid_t context_id, int64_t logical_file_eof, H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code); done: - HDfree(recv_msgs); - HDfree(recv_reqs); + free(recv_msgs); + free(recv_reqs); H5_SUBFILING_FUNC_LEAVE; } /* H5FD__subfiling__truncate_sub_files() */ @@ -308,11 +308,11 @@ H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_eof_ptr) assert(n_io_concentrators > 0); assert(num_subfiles >= n_io_concentrators); - if (NULL == (sf_eofs = HDmalloc((size_t)num_subfiles * sizeof(int64_t)))) + if (NULL == (sf_eofs = malloc((size_t)num_subfiles * sizeof(int64_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile EOFs array"); - if (NULL == (recv_reqs = HDmalloc((size_t)num_subfiles * sizeof(*recv_reqs)))) + if (NULL == (recv_reqs = malloc((size_t)num_subfiles * sizeof(*recv_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate receive requests array"); - if (NULL == (recv_msg = HDmalloc((size_t)num_subfiles * sizeof(msg)))) + if (NULL == (recv_msg = malloc((size_t)num_subfiles * sizeof(msg)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate message array"); for (int i = 0; i < num_subfiles; i++) { @@ -405,9 +405,9 @@ done: } } - HDfree(recv_msg); - HDfree(recv_reqs); - HDfree(sf_eofs); + free(recv_msg); + free(recv_reqs); + free(sf_eofs); H5_SUBFILING_FUNC_LEAVE; } /* H5FD__subfiling__get_real_eof() */ diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index 59a193e..20d617d 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -468,7 +468,7 @@ H5Pset_fapl_subfiling(hid_t fapl_id, const H5FD_subfiling_config_t *vfd_config) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (vfd_config == NULL) { - if (NULL == (subfiling_conf = HDcalloc(1, sizeof(*subfiling_conf)))) + if (NULL == (subfiling_conf = calloc(1, sizeof(*subfiling_conf)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfiling VFD configuration"); subfiling_conf->ioc_fapl_id = H5I_INVALID_HID; @@ -516,7 +516,7 @@ done: if (subfiling_conf) { if (subfiling_conf->ioc_fapl_id >= 0 && H5I_dec_ref(subfiling_conf->ioc_fapl_id) < 0) H5_SUBFILING_DONE_ERROR(H5E_PLIST, H5E_CANTDEC, FAIL, "can't close IOC FAPL"); - HDfree(subfiling_conf); + free(subfiling_conf); } H5_SUBFILING_FUNC_LEAVE_API; @@ -902,7 +902,7 @@ H5FD__subfiling_sb_decode(H5FD_t *_file, const char *name, const unsigned char * /* Decode config file prefix string */ if (tmpu64 > 0) { if (!sf_context->config_file_prefix) { - if (NULL == (sf_context->config_file_prefix = HDmalloc(tmpu64))) + if (NULL == (sf_context->config_file_prefix = malloc(tmpu64))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate space for config file prefix string"); @@ -1346,7 +1346,7 @@ H5FD__subfiling_close_int(H5FD_subfiling_t *file_ptr) file_ptr->fail_to_encode = FALSE; done: - HDfree(file_ptr->file_path); + free(file_ptr->file_path); file_ptr->file_path = NULL; H5MM_free(file_ptr->file_dir); @@ -1675,14 +1675,14 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i * to contain the translation of the I/O request into a collection of * I/O requests. */ - if (NULL == (source_data_offset = - HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*source_data_offset)))) + if (NULL == + (source_data_offset = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*source_data_offset)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate source data offset I/O vector"); - if (NULL == (sf_data_size = HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_data_size)))) + if (NULL == (sf_data_size = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_data_size)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile data size I/O vector"); - if (NULL == (sf_offset = HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_offset)))) + if (NULL == (sf_offset = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_offset)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile offset I/O vector"); @@ -1713,16 +1713,16 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i H5_CHECKED_ASSIGN(vector_len, uint32_t, num_subfiles_used, int); /* Allocate I/O vectors */ - if (NULL == (io_types = HDmalloc(vector_len * sizeof(*io_types)))) + if (NULL == (io_types = malloc(vector_len * sizeof(*io_types)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O types vector"); - if (NULL == (io_addrs = HDmalloc(vector_len * sizeof(*io_addrs)))) + if (NULL == (io_addrs = malloc(vector_len * sizeof(*io_addrs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O addresses vector"); - if (NULL == (io_sizes = HDmalloc(vector_len * sizeof(*io_sizes)))) + if (NULL == (io_sizes = malloc(vector_len * sizeof(*io_sizes)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O sizes vector"); - if (NULL == (io_bufs = HDmalloc(vector_len * sizeof(*io_bufs)))) + if (NULL == (io_bufs = malloc(vector_len * sizeof(*io_bufs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O buffers vector"); @@ -1774,13 +1774,13 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i file_ptr->op = OP_READ; done: - HDfree(io_bufs); - HDfree(io_sizes); - HDfree(io_addrs); - HDfree(io_types); - HDfree(sf_offset); - HDfree(sf_data_size); - HDfree(source_data_offset); + free(io_bufs); + free(io_sizes); + free(io_addrs); + free(io_types); + free(sf_offset); + free(sf_data_size); + free(source_data_offset); if (ret_value < 0) { /* Reset last file I/O information */ @@ -1918,14 +1918,14 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ * to contain the translation of the I/O request into a collection of * I/O requests. */ - if (NULL == (source_data_offset = - HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*source_data_offset)))) + if (NULL == + (source_data_offset = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*source_data_offset)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate source data offset I/O vector"); - if (NULL == (sf_data_size = HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_data_size)))) + if (NULL == (sf_data_size = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_data_size)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile data size I/O vector"); - if (NULL == (sf_offset = HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_offset)))) + if (NULL == (sf_offset = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_offset)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile offset I/O vector"); @@ -1956,16 +1956,16 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ H5_CHECKED_ASSIGN(vector_len, uint32_t, num_subfiles_used, int); /* Allocate I/O vectors */ - if (NULL == (io_types = HDmalloc(vector_len * sizeof(*io_types)))) + if (NULL == (io_types = malloc(vector_len * sizeof(*io_types)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O types vector"); - if (NULL == (io_addrs = HDmalloc(vector_len * sizeof(*io_addrs)))) + if (NULL == (io_addrs = malloc(vector_len * sizeof(*io_addrs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O addresses vector"); - if (NULL == (io_sizes = HDmalloc(vector_len * sizeof(*io_sizes)))) + if (NULL == (io_sizes = malloc(vector_len * sizeof(*io_sizes)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O sizes vector"); - if (NULL == (io_bufs = HDmalloc(vector_len * sizeof(*io_bufs)))) + if (NULL == (io_bufs = malloc(vector_len * sizeof(*io_bufs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O buffers vector"); @@ -2031,13 +2031,13 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ file_ptr->local_eof = file_ptr->pos; done: - HDfree(io_bufs); - HDfree(io_sizes); - HDfree(io_addrs); - HDfree(io_types); - HDfree(sf_offset); - HDfree(sf_data_size); - HDfree(source_data_offset); + free(io_bufs); + free(io_sizes); + free(io_addrs); + free(io_types); + free(sf_offset); + free(sf_data_size); + free(source_data_offset); if (ret_value < 0) { /* Reset last file I/O information */ diff --git a/src/H5FDsubfiling/H5subfiling_common.c b/src/H5FDsubfiling/H5subfiling_common.c index 6302b08..3ef9344 100644 --- a/src/H5FDsubfiling/H5subfiling_common.c +++ b/src/H5FDsubfiling/H5subfiling_common.c @@ -154,7 +154,7 @@ H5_get_subfiling_object(int64_t object_id) /* Create subfiling context cache if it doesn't exist */ if (!sf_context_cache) { - if (NULL == (sf_context_cache = HDcalloc(DEFAULT_CONTEXT_CACHE_SIZE, sizeof(*sf_context_cache)))) + if (NULL == (sf_context_cache = calloc(DEFAULT_CONTEXT_CACHE_SIZE, sizeof(*sf_context_cache)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate space for subfiling context cache"); sf_context_cache_size = DEFAULT_CONTEXT_CACHE_SIZE; @@ -171,7 +171,7 @@ H5_get_subfiling_object(int64_t object_id) new_size = (sf_context_cache_size * 3) / 2; - if (NULL == (tmp_realloc = HDrealloc(sf_context_cache, new_size * sizeof(*sf_context_cache)))) + if (NULL == (tmp_realloc = realloc(sf_context_cache, new_size * sizeof(*sf_context_cache)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate space for subfiling context cache"); @@ -201,7 +201,7 @@ H5_get_subfiling_object(int64_t object_id) 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)))) + if (NULL == (ret_value = calloc(1, sizeof(subfiling_context_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate subfiling context object"); @@ -211,8 +211,7 @@ H5_get_subfiling_object(int64_t object_id) else if (obj_type == SF_TOPOLOGY) { /* Create subfiling topology cache if it doesn't exist */ if (!sf_topology_cache) { - if (NULL == - (sf_topology_cache = HDcalloc(DEFAULT_TOPOLOGY_CACHE_SIZE, sizeof(*sf_topology_cache)))) + if (NULL == (sf_topology_cache = calloc(DEFAULT_TOPOLOGY_CACHE_SIZE, sizeof(*sf_topology_cache)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate space for subfiling topology cache"); sf_topology_cache_size = DEFAULT_TOPOLOGY_CACHE_SIZE; @@ -229,7 +228,7 @@ H5_get_subfiling_object(int64_t object_id) new_size = (sf_topology_cache_size * 3) / 2; - if (NULL == (tmp_realloc = HDrealloc(sf_topology_cache, new_size * sizeof(*sf_topology_cache)))) + if (NULL == (tmp_realloc = realloc(sf_topology_cache, new_size * sizeof(*sf_topology_cache)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate space for subfiling topology cache"); @@ -259,7 +258,7 @@ H5_get_subfiling_object(int64_t object_id) assert(!sf_topology_cache[sf_topology_cache_num_entries]); /* Allocate a new subfiling topology object */ - if (NULL == (ret_value = HDmalloc(sizeof(sf_topology_t)))) + if (NULL == (ret_value = malloc(sizeof(sf_topology_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate subfiling topology object"); @@ -400,16 +399,16 @@ H5_free_subfiling_object_int(subfiling_context_t *sf_context) sf_context->sf_group_size = -1; sf_context->sf_group_rank = -1; - HDfree(sf_context->subfile_prefix); + free(sf_context->subfile_prefix); sf_context->subfile_prefix = NULL; - HDfree(sf_context->config_file_prefix); + free(sf_context->config_file_prefix); sf_context->config_file_prefix = NULL; - HDfree(sf_context->h5_filename); + free(sf_context->h5_filename); sf_context->h5_filename = NULL; - HDfree(sf_context->sf_fids); + free(sf_context->sf_fids); sf_context->sf_fids = NULL; /* @@ -420,7 +419,7 @@ H5_free_subfiling_object_int(subfiling_context_t *sf_context) */ sf_context->topology = NULL; - HDfree(sf_context); + free(sf_context); H5_SUBFILING_FUNC_LEAVE; } @@ -456,25 +455,25 @@ H5_free_subfiling_topology(sf_topology_t *topology) topology->n_io_concentrators = 0; if (topology->app_layout) { - HDfree(topology->app_layout->layout); + free(topology->app_layout->layout); topology->app_layout->layout = NULL; - HDfree(topology->app_layout->node_ranks); + free(topology->app_layout->node_ranks); topology->app_layout->node_ranks = NULL; - HDfree(topology->app_layout); + free(topology->app_layout); } topology->app_layout = NULL; - HDfree(topology->io_concentrators); + free(topology->io_concentrators); topology->io_concentrators = NULL; if (!mpi_finalized) if (H5_mpi_comm_free(&topology->app_comm) < 0) H5_SUBFILING_DONE_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free MPI communicator"); - HDfree(topology); + free(topology); H5_SUBFILING_FUNC_LEAVE; } @@ -1337,7 +1336,7 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) assert(MPI_COMM_NULL != comm); assert(MPI_COMM_NULL != node_comm); - if (NULL == (app_layout = HDcalloc(1, sizeof(*app_layout)))) + if (NULL == (app_layout = calloc(1, sizeof(*app_layout)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate application layout structure"); @@ -1350,7 +1349,7 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) if (MPI_SUCCESS != (mpi_code = MPI_Comm_size(node_comm, &app_layout->node_local_size))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Comm_size failed", mpi_code); - if (NULL == (app_layout->layout = HDmalloc((size_t)app_layout->world_size * sizeof(*app_layout->layout)))) + if (NULL == (app_layout->layout = malloc((size_t)app_layout->world_size * sizeof(*app_layout->layout)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate application layout array"); @@ -1373,7 +1372,7 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) assert(app_layout->node_count > 0); if (NULL == - (app_layout->node_ranks = HDmalloc((size_t)app_layout->node_count * sizeof(*app_layout->node_ranks)))) + (app_layout->node_ranks = malloc((size_t)app_layout->node_count * sizeof(*app_layout->node_ranks)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate application layout node rank array"); @@ -1393,9 +1392,9 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) done: if (ret_value < 0) { if (app_layout) { - HDfree(app_layout->layout); - HDfree(app_layout->node_ranks); - HDfree(app_layout); + free(app_layout->layout); + free(app_layout->node_ranks); + free(app_layout); } } @@ -1493,7 +1492,7 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com /* Allocate a partial layout info array to aggregate into from node-local ranks */ if (node_local_rank == 0) { if (NULL == - (layout_info_partial = HDmalloc((size_t)node_local_size * sizeof(*layout_info_partial)))) + (layout_info_partial = malloc((size_t)node_local_size * sizeof(*layout_info_partial)))) /* Push error, but participate in gather operation */ H5_SUBFILING_DONE_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate layout info array"); @@ -1508,10 +1507,10 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com if (node_local_rank == 0) { int send_size = 4 * node_local_size; - if (NULL == (recv_counts = HDmalloc((size_t)aggr_comm_size * sizeof(*recv_counts)))) + if (NULL == (recv_counts = malloc((size_t)aggr_comm_size * sizeof(*recv_counts)))) H5_SUBFILING_DONE_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate receive counts array"); - if (NULL == (recv_displs = HDmalloc((size_t)aggr_comm_size * sizeof(*recv_displs)))) + if (NULL == (recv_displs = malloc((size_t)aggr_comm_size * sizeof(*recv_displs)))) H5_SUBFILING_DONE_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate receive displacements array"); @@ -1528,8 +1527,8 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com recv_counts, recv_displs, MPI_INT, aggr_comm))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code); - HDfree(recv_displs); - HDfree(recv_counts); + free(recv_displs); + free(recv_counts); recv_displs = NULL; recv_counts = NULL; } @@ -1545,9 +1544,9 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com } done: - HDfree(recv_displs); - HDfree(recv_counts); - HDfree(layout_info_partial); + free(recv_displs); + free(recv_counts); + free(layout_info_partial); if (H5_mpi_comm_free(&aggr_comm) < 0) H5_SUBFILING_DONE_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free MPI communicator"); @@ -1623,8 +1622,8 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) max_iocs = app_topology->n_io_concentrators; - if (NULL == (app_topology->io_concentrators = - HDmalloc((size_t)max_iocs * sizeof(*app_topology->io_concentrators)))) + if (NULL == + (app_topology->io_concentrators = malloc((size_t)max_iocs * sizeof(*app_topology->io_concentrators)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate array of I/O concentrator ranks"); @@ -1719,7 +1718,7 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) done: if (ret_value < 0) { if (app_topology) - HDfree(app_topology->io_concentrators); + free(app_topology->io_concentrators); } H5_SUBFILING_FUNC_LEAVE; @@ -1833,7 +1832,7 @@ init_subfiling_context(subfiling_context_t *sf_context, const char *base_filenam sf_context->sf_num_fids++; if (NULL == - (sf_context->sf_fids = HDmalloc((size_t)sf_context->sf_num_fids * sizeof(*sf_context->sf_fids)))) + (sf_context->sf_fids = malloc((size_t)sf_context->sf_num_fids * sizeof(*sf_context->sf_fids)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate subfile IDs array"); for (int i = 0; i < sf_context->sf_num_fids; i++) @@ -1996,8 +1995,7 @@ record_fid_to_subfile(uint64_t file_id, int64_t subfile_context_id, int *next_in herr_t ret_value = SUCCEED; if (!sf_open_file_map) { - if (NULL == - (sf_open_file_map = HDmalloc((size_t)DEFAULT_FILE_MAP_ENTRIES * sizeof(*sf_open_file_map)))) + if (NULL == (sf_open_file_map = malloc((size_t)DEFAULT_FILE_MAP_ENTRIES * sizeof(*sf_open_file_map)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate open file mapping"); sf_file_map_size = DEFAULT_FILE_MAP_ENTRIES; @@ -2026,8 +2024,8 @@ record_fid_to_subfile(uint64_t file_id, int64_t subfile_context_id, int *next_in if (index == sf_file_map_size) { void *tmp_realloc; - if (NULL == (tmp_realloc = HDrealloc(sf_open_file_map, - ((size_t)(sf_file_map_size * 2) * sizeof(*sf_open_file_map))))) + if (NULL == (tmp_realloc = realloc(sf_open_file_map, + ((size_t)(sf_file_map_size * 2) * sizeof(*sf_open_file_map))))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't reallocate open file mapping"); @@ -2158,7 +2156,7 @@ ioc_open_files(int64_t file_context_id, int file_acc_flags) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't get HDF5 file dirname"); } - if (NULL == (filepath = HDmalloc(PATH_MAX))) + if (NULL == (filepath = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate space for subfile filename"); @@ -2231,7 +2229,7 @@ done: H5MM_free(base); H5MM_free(subfile_dir); - HDfree(filepath); + free(filepath); H5_SUBFILING_FUNC_LEAVE; } @@ -2280,7 +2278,7 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c if (*subfile_dir == '\0') subfile_dir = "."; - if (NULL == (config_filename = HDmalloc(PATH_MAX))) + if (NULL == (config_filename = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate space for subfiling configuration filename"); @@ -2311,7 +2309,7 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "couldn't create/truncate subfiling configuration file"); - if (NULL == (line_buf = HDmalloc(PATH_MAX))) + if (NULL == (line_buf = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate buffer for writing to subfiling configuration file"); @@ -2364,8 +2362,8 @@ done: "couldn't close subfiling configuration file"); } - HDfree(line_buf); - HDfree(config_filename); + free(line_buf); + free(config_filename); H5_SUBFILING_FUNC_LEAVE; } @@ -2408,7 +2406,7 @@ open_config_file(const char *base_filename, const char *config_dir, uint64_t fil if (*config_dir == '\0') config_dir = "."; - if (NULL == (config_filename = HDmalloc(PATH_MAX))) + if (NULL == (config_filename = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate space for subfiling configuration filename"); @@ -2441,7 +2439,7 @@ done: "couldn't close subfiling configuration file"); } - HDfree(config_filename); + free(config_filename); H5_SUBFILING_FUNC_LEAVE; } @@ -2480,7 +2478,7 @@ H5_get_subfiling_config_from_file(FILE *config_file, int64_t *stripe_size, int64 H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_SEEKERROR, FAIL, "couldn't seek to beginning of subfiling configuration file"); - if (NULL == (config_buf = HDmalloc((size_t)config_file_len + 1))) + if (NULL == (config_buf = malloc((size_t)config_file_len + 1))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate space for reading from subfiling configuration file"); @@ -2526,7 +2524,7 @@ H5_get_subfiling_config_from_file(FILE *config_file, int64_t *stripe_size, int64 } done: - HDfree(config_buf); + free(config_buf); H5_SUBFILING_FUNC_LEAVE; } @@ -2540,7 +2538,7 @@ done: * between MPI ranks. * * The resolved filepath returned through `resolved_filepath` - * must be freed by the caller with HDfree. + * must be freed by the caller with free. * * Return Non-negative on success/Negative on failure * @@ -2577,12 +2575,12 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat /* If filepath is just the filename, set up path using CWD */ if (!HDstrcmp(file_dirname, ".")) { - if (NULL == (resolved_path = HDmalloc(PATH_MAX))) + if (NULL == (resolved_path = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate buffer for filepath"); if (H5_basename(filepath, &file_basename) < 0) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't get file basename"); - if (NULL == (cwd = HDmalloc(PATH_MAX))) + if (NULL == (cwd = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate buffer for CWD"); @@ -2624,7 +2622,7 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "couldn't resolve filepath"); if (mpi_rank != 0) { - if (NULL == (resolved_path = HDmalloc(path_len))) + if (NULL == (resolved_path = malloc(path_len))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate file name buffer"); } @@ -2639,7 +2637,7 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat *resolved_filepath = resolved_path; done: - HDfree(cwd); + free(cwd); H5MM_free(file_basename); H5MM_free(file_dirname); @@ -2654,7 +2652,7 @@ done: H5_SUBFILING_MPI_DONE_ERROR(FAIL, "MPI_Bcast failed", mpi_code); } - HDfree(resolved_path); + free(resolved_path); } H5_SUBFILING_FUNC_LEAVE; @@ -3084,7 +3082,7 @@ H5_subfiling_terminate(void) sf_context_cache_size = 0; sf_context_cache_num_entries = 0; - HDfree(sf_context_cache); + free(sf_context_cache); sf_context_cache = NULL; } if (sf_topology_cache) { @@ -3098,13 +3096,13 @@ H5_subfiling_terminate(void) sf_topology_cache_size = 0; sf_topology_cache_num_entries = 0; - HDfree(sf_topology_cache); + free(sf_topology_cache); sf_topology_cache = NULL; } /* Clean up the file ID to context object mapping */ sf_file_map_size = 0; - HDfree(sf_open_file_map); + free(sf_open_file_map); sf_open_file_map = NULL; done: diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 4edcb1c..3978771 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -931,7 +931,7 @@ H5G__loc_set_comment_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ } /* end if */ done: - HDfree(comment.s); + free(comment.s); /* Indicate that this callback didn't take ownership of the group * * location for the object */ diff --git a/src/H5MM.c b/src/H5MM.c index 28281f8..d65344b 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -77,7 +77,7 @@ H5MM_malloc(size_t size) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - ret_value = HDmalloc(size); + ret_value = malloc(size); FUNC_LEAVE_NOAPI(ret_value) } /* end H5MM_malloc() */ @@ -106,7 +106,7 @@ H5MM_calloc(size_t size) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - ret_value = HDcalloc(1, size); + ret_value = calloc(1, size); FUNC_LEAVE_NOAPI(ret_value) } /* end H5MM_calloc() */ @@ -141,7 +141,7 @@ H5MM_realloc(void *mem, size_t size) /* Not defined in the standard, return NULL */ ret_value = NULL; else { - ret_value = HDrealloc(mem, size); + ret_value = realloc(mem, size); /* Some platforms do not return NULL if size is zero. */ if (0 == size) @@ -255,7 +255,7 @@ H5MM_xfree(void *mem) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDfree(mem); + free(mem); FUNC_LEAVE_NOAPI(NULL) } /* end H5MM_xfree() */ diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index 130a83e..84656ad 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -26,7 +26,7 @@ /* Private headers needed by this file */ #include "H5private.h" -#define H5MM_free(Z) HDfree(Z) +#define H5MM_free(Z) free(Z) /* * Library prototypes... diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index 52c70b9..4f09192 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -119,9 +119,9 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED *path, int H5_ATTR_UNUSED *nprint /*i fprintf(H5DEBUG(T), " %-16s %10" PRIdHSIZE " %10u %8s %8s %8s %10s\n", path->name, path->stats.nelmts, path->stats.ncalls, timestrs.user, timestrs.system, timestrs.elapsed, bandwidth); - HDfree(timestrs.user); - HDfree(timestrs.system); - HDfree(timestrs.elapsed); + free(timestrs.user); + free(timestrs.system); + free(timestrs.elapsed); } #endif diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 450d61c..9218fdd 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -541,7 +541,7 @@ H5T__vlen_mem_seq_write(H5VL_object_t H5_ATTR_UNUSED *file, const H5T_vlen_alloc "application memory allocation routine failed for VL data") } /* end if */ else /* Default to system malloc */ - if (NULL == (vl.p = HDmalloc(len))) + if (NULL == (vl.p = malloc(len))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "memory allocation failed for VL data") /* Copy the data into the newly allocated buffer */ @@ -734,7 +734,7 @@ H5T__vlen_mem_str_write(H5VL_object_t H5_ATTR_UNUSED *file, const H5T_vlen_alloc "application memory allocation routine failed for VL data") } /* end if */ else /* Default to system malloc */ - if (NULL == (t = (char *)HDmalloc((seq_len + 1) * base_size))) + if (NULL == (t = (char *)malloc((seq_len + 1) * base_size))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "memory allocation failed for VL data") /* 'write' the string into the buffer, with memcpy() */ @@ -1074,7 +1074,7 @@ H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info if (free_func != NULL) (*free_func)(vl->p, free_info); else - HDfree(vl->p); + free(vl->p); } /* end if */ } else if (dt->shared->u.vlen.type == H5T_VLEN_STRING) { @@ -1082,7 +1082,7 @@ H5T__vlen_reclaim(void *elem, const H5T_t *dt, H5T_vlen_alloc_info_t *alloc_info if (free_func != NULL) (*free_func)(*(char **)elem, free_info); else - HDfree(*(char **)elem); + free(*(char **)elem); } else { assert(0 && "Invalid VL type"); diff --git a/src/H5Z.c b/src/H5Z.c index 36aa04d..0907e32 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -180,9 +180,9 @@ H5Z_term_package(void) H5Z_stat_table_g[i].stats[dir].errors, timestrs.user, timestrs.system, timestrs.elapsed, bandwidth); next: - HDfree(timestrs.user); - HDfree(timestrs.system); - HDfree(timestrs.elapsed); + free(timestrs.user); + free(timestrs.system); + free(timestrs.elapsed); } /* end for */ } /* end for */ } /* end if */ diff --git a/src/H5private.h b/src/H5private.h index ed9e270..676fb22 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -638,9 +638,6 @@ typedef off_t h5_stat_size_t; #ifndef HDatoll #define HDatoll(S) atoll(S) #endif -#ifndef HDcalloc -#define HDcalloc(N, Z) calloc(N, Z) -#endif #ifndef HDceil #define HDceil(X) ceil(X) #endif @@ -751,9 +748,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDfread #define HDfread(M, Z, N, F) fread(M, Z, N, F) #endif -#ifndef HDfree -#define HDfree(M) free(M) -#endif #ifndef HDfrexp #define HDfrexp(X, N) frexp(X, N) #endif @@ -901,9 +895,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDlstat #define HDlstat(S, B) lstat(S, B) #endif -#ifndef HDmalloc -#define HDmalloc(Z) malloc(Z) -#endif #ifndef HDmemcmp #define HDmemcmp(X, Y, Z) memcmp(X, Y, Z) #endif @@ -1001,9 +992,6 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDreaddir #define HDreaddir(D) readdir(D) #endif -#ifndef HDrealloc -#define HDrealloc(M, Z) realloc(M, Z) -#endif #ifndef HDrealpath #define HDrealpath(F1, F2) realpath(F1, F2) #endif diff --git a/src/H5system.c b/src/H5system.c index 7a76723..46fea7a 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -75,7 +75,7 @@ HDvasprintf(char **bufp, const char *fmt, va_list _ap) char *buf; /* buffer to receive formatted string */ size_t bufsz; /* size of buffer to allocate */ - for (bufsz = 32; (buf = HDmalloc(bufsz)) != NULL;) { + for (bufsz = 32; (buf = malloc(bufsz)) != NULL;) { int ret; va_list ap; @@ -86,7 +86,7 @@ HDvasprintf(char **bufp, const char *fmt, va_list _ap) *bufp = buf; return ret; } - HDfree(buf); + free(buf); if (ret < 0) return ret; bufsz = (size_t)ret + 1; @@ -1301,7 +1301,7 @@ H5_get_option(int argc, const char *const *argv, const char *opts, const struct H5_optind++; sp = 1; - HDfree(arg); + free(arg); } else { char *cp; /* pointer into current token */ diff --git a/src/H5timer.c b/src/H5timer.c index 7690c57..89e4fd2 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -617,7 +617,7 @@ H5_timer_get_time_string(double seconds) } /* end if */ /* Allocate */ - if (NULL == (s = (char *)HDcalloc(H5TIMER_TIME_STRING_LEN, sizeof(char)))) + if (NULL == (s = (char *)calloc(H5TIMER_TIME_STRING_LEN, sizeof(char)))) return NULL; /* Do we need a format string? Some people might like a certain diff --git a/test/API/H5_api_attribute_test.c b/test/API/H5_api_attribute_test.c index 84ddbb0..45f4704 100644 --- a/test/API/H5_api_attribute_test.c +++ b/test/API/H5_api_attribute_test.c @@ -2369,7 +2369,7 @@ test_write_attribute(void) data_size *= dims[i]; data_size *= ATTRIBUTE_WRITE_TEST_ATTR_DTYPE_SIZE; - if (NULL == (data = HDmalloc(data_size))) + if (NULL == (data = malloc(data_size))) TEST_ERROR; for (i = 0; i < data_size / ATTRIBUTE_WRITE_TEST_ATTR_DTYPE_SIZE; i++) @@ -2389,7 +2389,7 @@ test_write_attribute(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -2412,7 +2412,7 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); H5Sclose(space_id); H5Aclose(attr_id); H5Gclose(group_id); @@ -2503,7 +2503,7 @@ test_write_attribute_invalid_params(void) data_size *= dims[i]; data_size *= ATTRIBUTE_WRITE_INVALID_PARAMS_TEST_ATTR_DTYPE_SIZE; - if (NULL == (data = HDmalloc(data_size))) + if (NULL == (data = malloc(data_size))) TEST_ERROR; for (i = 0; i < data_size / ATTRIBUTE_WRITE_INVALID_PARAMS_TEST_ATTR_DTYPE_SIZE; i++) @@ -2578,7 +2578,7 @@ test_write_attribute_invalid_params(void) TESTING_2("test cleanup"); if (data) { - HDfree(data); + free(data); data = NULL; } @@ -2601,7 +2601,7 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); H5Sclose(space_id); H5Aclose(attr_id); H5Gclose(group_id); @@ -2689,9 +2689,9 @@ test_read_attribute(void) data_size *= dims[i]; data_size *= ATTRIBUTE_READ_TEST_ATTR_DTYPE_SIZE; - if (NULL == (data = HDmalloc(data_size))) + if (NULL == (data = malloc(data_size))) TEST_ERROR; - if (NULL == (read_buf = HDcalloc(1, data_size))) + if (NULL == (read_buf = calloc(1, data_size))) TEST_ERROR; for (i = 0; i < data_size / ATTRIBUTE_READ_TEST_ATTR_DTYPE_SIZE; i++) @@ -2704,7 +2704,7 @@ test_read_attribute(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -2732,7 +2732,7 @@ test_read_attribute(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -2755,9 +2755,9 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); H5Sclose(space_id); H5Aclose(attr_id); H5Gclose(group_id); @@ -2849,9 +2849,9 @@ test_read_attribute_invalid_params(void) data_size *= dims[i]; data_size *= ATTRIBUTE_READ_INVALID_PARAMS_TEST_ATTR_DTYPE_SIZE; - if (NULL == (data = HDmalloc(data_size))) + if (NULL == (data = malloc(data_size))) TEST_ERROR; - if (NULL == (read_buf = HDcalloc(1, data_size))) + if (NULL == (read_buf = calloc(1, data_size))) TEST_ERROR; for (i = 0; i < data_size / ATTRIBUTE_READ_INVALID_PARAMS_TEST_ATTR_DTYPE_SIZE; i++) @@ -2864,7 +2864,7 @@ test_read_attribute_invalid_params(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -2946,7 +2946,7 @@ test_read_attribute_invalid_params(void) TESTING_2("test cleanup"); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -2969,9 +2969,9 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); H5Sclose(space_id); H5Aclose(attr_id); H5Gclose(group_id); @@ -3065,7 +3065,7 @@ test_read_empty_attribute(void) data_size *= dims[i]; data_size *= ATTRIBUTE_READ_EMPTY_DTYPE_SIZE; - if (NULL == (read_buf = HDcalloc(1, data_size))) + if (NULL == (read_buf = calloc(1, data_size))) TEST_ERROR; if (H5Aread(attr_id, ATTRIBUTE_READ_EMPTY_DTYPE, read_buf) < 0) { @@ -3075,7 +3075,7 @@ test_read_empty_attribute(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -3098,7 +3098,7 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); H5Sclose(space_id); H5Aclose(attr_id); H5Gclose(group_id); @@ -4055,7 +4055,7 @@ test_get_attribute_name(void) /* Allocate the name buffer */ name_buf_size = strlen(ATTRIBUTE_GET_NAME_TEST_ATTRIBUTE_NAME) + 2; - if (NULL == (name_buf = (char *)HDmalloc((size_t)name_buf_size))) { + if (NULL == (name_buf = (char *)malloc((size_t)name_buf_size))) { H5_FAILED(); printf(" couldn't allocate buffer for storing attribute's name\n"); goto error; @@ -4372,7 +4372,7 @@ test_get_attribute_name(void) TESTING_2("test cleanup"); if (name_buf) { - HDfree(name_buf); + free(name_buf); name_buf = NULL; } @@ -4397,7 +4397,7 @@ error: H5E_BEGIN_TRY { if (name_buf) - HDfree(name_buf); + free(name_buf); H5Sclose(space_id); H5Tclose(attr_dtype); H5Aclose(attr_id); @@ -4499,7 +4499,7 @@ test_get_attribute_name_invalid_params(void) goto error; } - if (NULL == (name_buf = (char *)HDmalloc((size_t)name_buf_size + 1))) + if (NULL == (name_buf = (char *)malloc((size_t)name_buf_size + 1))) TEST_ERROR; PASSED(); @@ -4731,7 +4731,7 @@ test_get_attribute_name_invalid_params(void) TESTING_2("test cleanup"); if (name_buf) { - HDfree(name_buf); + free(name_buf); name_buf = NULL; } @@ -4756,7 +4756,7 @@ error: H5E_BEGIN_TRY { if (name_buf) - HDfree(name_buf); + free(name_buf); H5Sclose(space_id); H5Tclose(attr_dtype); H5Aclose(attr_id); diff --git a/test/API/H5_api_dataset_test.c b/test/API/H5_api_dataset_test.c index e3843a6..55c4497 100644 --- a/test/API/H5_api_dataset_test.c +++ b/test/API/H5_api_dataset_test.c @@ -3753,7 +3753,7 @@ test_dataset_property_lists(void) PART_ERROR(H5Dget_access_plist); } - if (NULL == (tmp_prefix = (char *)HDcalloc(1, (size_t)buf_size + 1))) { + if (NULL == (tmp_prefix = (char *)calloc(1, (size_t)buf_size + 1))) { H5_FAILED(); printf(" couldn't allocate buffer for property value\n"); PART_ERROR(H5Dget_access_plist); @@ -3897,7 +3897,7 @@ test_dataset_property_lists(void) TESTING_2("test cleanup"); if (tmp_prefix) { - HDfree(tmp_prefix); + free(tmp_prefix); tmp_prefix = NULL; } @@ -3942,7 +3942,7 @@ error: H5E_BEGIN_TRY { if (tmp_prefix) - HDfree(tmp_prefix); + free(tmp_prefix); H5Pclose(dcpl_id1); H5Pclose(dcpl_id2); H5Pclose(dapl_id1); @@ -4108,7 +4108,7 @@ test_read_dataset_small_all(void) data_size *= dims[i]; data_size *= DATASET_SMALL_READ_TEST_ALL_DSET_DTYPESIZE; - if (NULL == (read_buf = HDmalloc(data_size))) + if (NULL == (read_buf = malloc(data_size))) TEST_ERROR; if (H5Dread(dset_id, DATASET_SMALL_READ_TEST_ALL_DSET_DTYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < @@ -4119,7 +4119,7 @@ test_read_dataset_small_all(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -4142,7 +4142,7 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); H5Sclose(fspace_id); H5Dclose(dset_id); H5Gclose(group_id); @@ -4232,7 +4232,7 @@ test_read_dataset_small_hyperslab(void) data_size *= dims[i]; data_size *= DATASET_SMALL_READ_TEST_HYPERSLAB_DSET_DTYPESIZE; - if (NULL == (read_buf = HDmalloc(data_size))) + if (NULL == (read_buf = malloc(data_size))) TEST_ERROR; if (H5Dread(dset_id, DATASET_SMALL_READ_TEST_HYPERSLAB_DSET_DTYPE, mspace_id, fspace_id, H5P_DEFAULT, @@ -4243,7 +4243,7 @@ test_read_dataset_small_hyperslab(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -4268,7 +4268,7 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -4347,7 +4347,7 @@ test_read_dataset_small_point_selection(void) data_size = DATASET_SMALL_READ_TEST_POINT_SELECTION_NUM_POINTS * DATASET_SMALL_READ_TEST_POINT_SELECTION_DSET_DTYPESIZE; - if (NULL == (data = HDmalloc(data_size))) + if (NULL == (data = malloc(data_size))) TEST_ERROR; for (i = 0; i < DATASET_SMALL_READ_TEST_POINT_SELECTION_NUM_POINTS; i++) { @@ -4372,7 +4372,7 @@ test_read_dataset_small_point_selection(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -4397,7 +4397,7 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -4969,7 +4969,7 @@ test_read_dataset_invalid_params(void) data_size *= dims[i]; data_size *= DATASET_READ_INVALID_PARAMS_TEST_DSET_DTYPESIZE; - if (NULL == (read_buf = HDmalloc(data_size))) + if (NULL == (read_buf = malloc(data_size))) TEST_ERROR; PASSED(); @@ -5106,7 +5106,7 @@ test_read_dataset_invalid_params(void) TESTING_2("test cleanup"); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -5129,7 +5129,7 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); H5Sclose(fspace_id); H5Dclose(dset_id); H5Gclose(group_id); @@ -5221,7 +5221,7 @@ test_write_dataset_small_all(void) goto error; } - if (NULL == (data = HDmalloc((hsize_t)space_npoints * DATASET_SMALL_WRITE_TEST_ALL_DSET_DTYPESIZE))) + if (NULL == (data = malloc((hsize_t)space_npoints * DATASET_SMALL_WRITE_TEST_ALL_DSET_DTYPESIZE))) TEST_ERROR; for (i = 0; i < (hsize_t)space_npoints; i++) @@ -5234,7 +5234,7 @@ test_write_dataset_small_all(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -5257,7 +5257,7 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); H5Sclose(fspace_id); H5Dclose(dset_id); H5Gclose(group_id); @@ -5336,7 +5336,7 @@ test_write_dataset_small_hyperslab(void) data_size *= dims[i]; data_size *= DATASET_SMALL_WRITE_TEST_HYPERSLAB_DSET_DTYPESIZE; - if (NULL == (data = HDmalloc(data_size))) + if (NULL == (data = malloc(data_size))) TEST_ERROR; for (i = 0; i < data_size / DATASET_SMALL_WRITE_TEST_HYPERSLAB_DSET_DTYPESIZE; i++) @@ -5362,7 +5362,7 @@ test_write_dataset_small_hyperslab(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -5387,7 +5387,7 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -5466,7 +5466,7 @@ test_write_dataset_small_point_selection(void) data_size = DATASET_SMALL_WRITE_TEST_POINT_SELECTION_NUM_POINTS * DATASET_SMALL_WRITE_TEST_POINT_SELECTION_DSET_DTYPESIZE; - if (NULL == (data = HDmalloc(data_size))) + if (NULL == (data = malloc(data_size))) TEST_ERROR; for (i = 0; i < data_size / DATASET_SMALL_WRITE_TEST_POINT_SELECTION_DSET_DTYPESIZE; i++) @@ -5494,7 +5494,7 @@ test_write_dataset_small_point_selection(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -5519,7 +5519,7 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -5604,7 +5604,7 @@ test_write_dataset_data_verification(void) data_size *= dims[i]; data_size *= DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE; - if (NULL == (data = HDmalloc(data_size))) + if (NULL == (data = malloc(data_size))) TEST_ERROR; for (i = 0; i < data_size / DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE; i++) @@ -5626,7 +5626,7 @@ test_write_dataset_data_verification(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -5666,7 +5666,7 @@ test_write_dataset_data_verification(void) } if (NULL == - (data = HDmalloc((hsize_t)space_npoints * DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE))) { + (data = malloc((hsize_t)space_npoints * DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); PART_ERROR(H5Dwrite_all_read); @@ -5687,7 +5687,7 @@ test_write_dataset_data_verification(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -5701,7 +5701,7 @@ test_write_dataset_data_verification(void) data_size = dims[1] * 2 * DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); PART_ERROR(H5Dwrite_hyperslab_read); @@ -5714,7 +5714,7 @@ test_write_dataset_data_verification(void) data_size *= dims[i]; data_size *= DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE; - if (NULL == (data = HDmalloc(data_size))) { + if (NULL == (data = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset data verification\n"); PART_ERROR(H5Dwrite_hyperslab_read); @@ -5808,8 +5808,8 @@ test_write_dataset_data_verification(void) PART_ERROR(H5Dwrite_hyperslab_read); } - if (NULL == (read_buf = HDmalloc((hsize_t)space_npoints * - DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE))) { + if (NULL == + (read_buf = malloc((hsize_t)space_npoints * DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); PART_ERROR(H5Dwrite_hyperslab_read); @@ -5829,17 +5829,17 @@ test_write_dataset_data_verification(void) } if (data) { - HDfree(data); + free(data); data = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -5854,7 +5854,7 @@ test_write_dataset_data_verification(void) data_size = DATASET_DATA_VERIFY_WRITE_TEST_NUM_POINTS * DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); PART_ERROR(H5Dwrite_point_sel_read); @@ -5867,7 +5867,7 @@ test_write_dataset_data_verification(void) data_size *= dims[i]; data_size *= DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE; - if (NULL == (data = HDmalloc(data_size))) { + if (NULL == (data = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset data verification\n"); PART_ERROR(H5Dwrite_point_sel_read); @@ -5968,8 +5968,8 @@ test_write_dataset_data_verification(void) PART_ERROR(H5Dwrite_point_sel_read); } - if (NULL == (read_buf = HDmalloc((hsize_t)space_npoints * - DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE))) { + if (NULL == + (read_buf = malloc((hsize_t)space_npoints * DATASET_DATA_VERIFY_WRITE_TEST_DSET_DTYPESIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); PART_ERROR(H5Dwrite_point_sel_read); @@ -5997,17 +5997,17 @@ test_write_dataset_data_verification(void) TESTING_2("test cleanup"); if (data) { - HDfree(data); + free(data); data = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -6030,11 +6030,11 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -6113,7 +6113,7 @@ test_write_dataset_invalid_params(void) goto error; } - if (NULL == (data = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_INVALID_PARAMS_TEST_DSET_DTYPESIZE))) + if (NULL == (data = malloc((hsize_t)space_npoints * DATASET_WRITE_INVALID_PARAMS_TEST_DSET_DTYPESIZE))) TEST_ERROR; for (i = 0; i < (hsize_t)space_npoints; i++) @@ -6253,7 +6253,7 @@ test_write_dataset_invalid_params(void) TESTING_2("test cleanup"); if (data) { - HDfree(data); + free(data); data = NULL; } @@ -6276,7 +6276,7 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); H5Sclose(fspace_id); H5Dclose(dset_id); H5Gclose(group_id); @@ -6372,7 +6372,7 @@ test_dataset_builtin_type_conversion(void) data_size *= dims[i]; data_size *= DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE; - if (NULL == (data = HDmalloc(data_size))) + if (NULL == (data = malloc(data_size))) TEST_ERROR; for (i = 0; i < data_size / DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE; i++) @@ -6395,7 +6395,7 @@ test_dataset_builtin_type_conversion(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -6435,8 +6435,8 @@ test_dataset_builtin_type_conversion(void) PART_ERROR(H5Dwrite_all_read); } - if (NULL == (data = HDmalloc((hsize_t)space_npoints * - DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE))) { + if (NULL == (data = malloc((hsize_t)space_npoints * + DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); PART_ERROR(H5Dwrite_all_read); @@ -6458,7 +6458,7 @@ test_dataset_builtin_type_conversion(void) } if (data) { - HDfree(data); + free(data); data = NULL; } @@ -6472,7 +6472,7 @@ test_dataset_builtin_type_conversion(void) data_size = dims[1] * 2 * DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); PART_ERROR(H5Dwrite_hyperslab_read); @@ -6485,7 +6485,7 @@ test_dataset_builtin_type_conversion(void) data_size *= dims[i]; data_size *= DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE; - if (NULL == (data = HDmalloc(data_size))) { + if (NULL == (data = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset data verification\n"); PART_ERROR(H5Dwrite_hyperslab_read); @@ -6582,8 +6582,8 @@ test_dataset_builtin_type_conversion(void) PART_ERROR(H5Dwrite_hyperslab_read); } - if (NULL == (read_buf = HDmalloc((hsize_t)space_npoints * - DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE))) { + if (NULL == (read_buf = malloc((hsize_t)space_npoints * + DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); PART_ERROR(H5Dwrite_hyperslab_read); @@ -6604,17 +6604,17 @@ test_dataset_builtin_type_conversion(void) } if (data) { - HDfree(data); + free(data); data = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -6629,7 +6629,7 @@ test_dataset_builtin_type_conversion(void) data_size = DATASET_DATA_BUILTIN_CONVERSION_TEST_NUM_POINTS * DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); PART_ERROR(H5Dwrite_point_sel_read); @@ -6642,7 +6642,7 @@ test_dataset_builtin_type_conversion(void) data_size *= dims[i]; data_size *= DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE; - if (NULL == (data = HDmalloc(data_size))) { + if (NULL == (data = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset data verification\n"); PART_ERROR(H5Dwrite_point_sel_read); @@ -6746,8 +6746,8 @@ test_dataset_builtin_type_conversion(void) PART_ERROR(H5Dwrite_point_sel_read); } - if (NULL == (read_buf = HDmalloc((hsize_t)space_npoints * - DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE))) { + if (NULL == (read_buf = malloc((hsize_t)space_npoints * + DATASET_DATA_BUILTIN_CONVERSION_TEST_MEM_DTYPESIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); PART_ERROR(H5Dwrite_point_sel_read); @@ -6776,17 +6776,17 @@ test_dataset_builtin_type_conversion(void) TESTING_2("test cleanup"); if (data) { - HDfree(data); + free(data); data = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -6809,11 +6809,11 @@ error: H5E_BEGIN_TRY { if (data) - HDfree(data); + free(data); if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -8695,7 +8695,7 @@ test_write_single_chunk_dataset(void) data_size *= dims[i]; data_size *= DATASET_SINGLE_CHUNK_WRITE_TEST_DSET_DTYPESIZE; - if (NULL == (write_buf = HDmalloc(data_size))) + if (NULL == (write_buf = malloc(data_size))) TEST_ERROR; for (i = 0; i < data_size / DATASET_SINGLE_CHUNK_WRITE_TEST_DSET_DTYPESIZE; i++) @@ -8709,7 +8709,7 @@ test_write_single_chunk_dataset(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } @@ -8749,7 +8749,7 @@ test_write_single_chunk_dataset(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_SINGLE_CHUNK_WRITE_TEST_DSET_DTYPESIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_SINGLE_CHUNK_WRITE_TEST_DSET_DTYPESIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -8770,7 +8770,7 @@ test_write_single_chunk_dataset(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -8795,9 +8795,9 @@ error: H5E_BEGIN_TRY { if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); H5Pclose(dcpl_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -9107,7 +9107,7 @@ test_write_multi_chunk_dataset_same_shape_read(void) data_size *= dims[i]; data_size *= DATASET_MULTI_CHUNK_WRITE_SAME_SPACE_READ_TEST_DSET_DTYPESIZE; - if (NULL == (write_buf = HDmalloc(data_size))) + if (NULL == (write_buf = malloc(data_size))) TEST_ERROR; /* @@ -9176,7 +9176,7 @@ test_write_multi_chunk_dataset_same_shape_read(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } @@ -9301,7 +9301,7 @@ error: H5E_BEGIN_TRY { if (write_buf) - HDfree(write_buf); + free(write_buf); H5Pclose(dcpl_id); H5Sclose(mspace_id); H5Sclose(fspace_id); @@ -9433,7 +9433,7 @@ test_write_multi_chunk_dataset_diff_shape_read(void) data_size *= dims[i]; data_size *= DATASET_MULTI_CHUNK_WRITE_DIFF_SPACE_READ_TEST_DSET_DTYPESIZE; - if (NULL == (write_buf = HDmalloc(data_size))) + if (NULL == (write_buf = malloc(data_size))) TEST_ERROR; /* @@ -9502,7 +9502,7 @@ test_write_multi_chunk_dataset_diff_shape_read(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } @@ -9539,7 +9539,7 @@ test_write_multi_chunk_dataset_diff_shape_read(void) /* * Allocate single chunk-sized read buffer. */ - if (NULL == (read_buf = HDmalloc(chunk_size))) { + if (NULL == (read_buf = malloc(chunk_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -9609,7 +9609,7 @@ test_write_multi_chunk_dataset_diff_shape_read(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -9636,9 +9636,9 @@ error: H5E_BEGIN_TRY { if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); H5Pclose(dcpl_id); H5Sclose(mspace_id); H5Sclose(fspace_id); @@ -9771,7 +9771,7 @@ test_overwrite_multi_chunk_dataset_same_shape_read(void) data_size *= dims[i]; data_size *= DATASET_MULTI_CHUNK_OVERWRITE_SAME_SPACE_READ_TEST_DSET_DTYPESIZE; - if (NULL == (write_buf = HDmalloc(data_size))) + if (NULL == (write_buf = malloc(data_size))) TEST_ERROR; /* @@ -9946,7 +9946,7 @@ test_overwrite_multi_chunk_dataset_same_shape_read(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } @@ -9973,7 +9973,7 @@ error: H5E_BEGIN_TRY { if (write_buf) - HDfree(write_buf); + free(write_buf); H5Pclose(dcpl_id); H5Sclose(mspace_id); H5Sclose(fspace_id); @@ -10106,13 +10106,13 @@ test_overwrite_multi_chunk_dataset_diff_shape_read(void) data_size *= dims[i]; data_size *= DATASET_MULTI_CHUNK_OVERWRITE_DIFF_SPACE_READ_TEST_DSET_DTYPESIZE; - if (NULL == (write_buf = HDmalloc(data_size))) + if (NULL == (write_buf = malloc(data_size))) TEST_ERROR; /* * Allocate single chunk-sized read buffer. */ - if (NULL == (read_buf = HDmalloc(chunk_size))) { + if (NULL == (read_buf = malloc(chunk_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -10286,12 +10286,12 @@ test_overwrite_multi_chunk_dataset_diff_shape_read(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -10318,9 +10318,9 @@ error: H5E_BEGIN_TRY { if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); H5Pclose(dcpl_id); H5Sclose(mspace_id); H5Sclose(fspace_id); @@ -10862,7 +10862,7 @@ test_get_vlen_buf_size(void) /* Allocate and initialize VL data to write */ for (i = 0; i < DATASET_GET_VLEN_BUF_SIZE_DSET_SPACE_DIM; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(unsigned int)); + wdata[i].p = malloc((i + 1) * sizeof(unsigned int)); wdata[i].len = i + 1; for (j = 0; j < (i + 1); j++) ((unsigned int *)wdata[i].p)[j] = i * 10 + j; diff --git a/test/API/H5_api_file_test.c b/test/API/H5_api_file_test.c index a73e28f..d3d686c 100644 --- a/test/API/H5_api_file_test.c +++ b/test/API/H5_api_file_test.c @@ -86,7 +86,7 @@ test_create_file(void) if (H5Fclose(file_id) < 0) TEST_ERROR; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; PASSED(); @@ -100,7 +100,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -236,7 +236,7 @@ test_create_file_invalid_params(void) } END_MULTIPART; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; return 0; @@ -251,7 +251,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -317,7 +317,7 @@ test_create_file_excl(void) if (H5Fclose(file_id) < 0) TEST_ERROR; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; PASSED(); @@ -332,7 +332,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -560,7 +560,7 @@ test_open_nonexistent_file(void) goto error; } - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; PASSED(); @@ -574,7 +574,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -791,7 +791,7 @@ test_file_permission(void) if (H5Fclose(file_id) < 0) TEST_ERROR; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; PASSED(); @@ -810,7 +810,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -1002,7 +1002,7 @@ test_flush_file(void) if (H5Fclose(file_id) < 0) TEST_ERROR; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; PASSED(); @@ -1018,7 +1018,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -1096,13 +1096,13 @@ test_file_is_accessible(void) } END_MULTIPART; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; return 0; error: - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -1386,9 +1386,9 @@ test_file_property_lists(void) if (H5Fclose(file_id2) < 0) TEST_ERROR; - HDfree(prefixed_filename1); + free(prefixed_filename1); prefixed_filename1 = NULL; - HDfree(prefixed_filename2); + free(prefixed_filename2); prefixed_filename2 = NULL; PASSED(); @@ -1407,8 +1407,8 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename1); - HDfree(prefixed_filename2); + free(prefixed_filename1); + free(prefixed_filename2); return 1; } @@ -1553,7 +1553,7 @@ test_get_file_intent(void) } END_MULTIPART; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; return 0; @@ -1565,7 +1565,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -1887,9 +1887,9 @@ test_get_file_obj_count(void) if (H5Fclose(file_id2) < 0) TEST_ERROR; - HDfree(prefixed_filename1); + free(prefixed_filename1); prefixed_filename1 = NULL; - HDfree(prefixed_filename2); + free(prefixed_filename2); prefixed_filename2 = NULL; PASSED(); @@ -1909,8 +1909,8 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename1); - HDfree(prefixed_filename2); + free(prefixed_filename1); + free(prefixed_filename2); return 1; } @@ -2030,7 +2030,7 @@ test_file_open_overlap(void) if (H5Fclose(file_id2) < 0) TEST_ERROR; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; PASSED(); @@ -2048,7 +2048,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -2121,7 +2121,7 @@ test_file_mounts(void) if (H5Fclose(child_fid) < 0) TEST_ERROR; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; PASSED(); @@ -2137,7 +2137,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } @@ -2191,7 +2191,7 @@ test_get_file_name(void) TEST_ERROR; /* Allocate buffer for file name */ - if (NULL == (file_name_buf = (char *)HDmalloc((size_t)file_name_buf_len + 1))) + if (NULL == (file_name_buf = (char *)malloc((size_t)file_name_buf_len + 1))) TEST_ERROR; PASSED(); @@ -2457,14 +2457,14 @@ test_get_file_name(void) TESTING_2("test cleanup"); if (file_name_buf) { - HDfree(file_name_buf); + free(file_name_buf); file_name_buf = NULL; } if (H5Fclose(file_id) < 0) TEST_ERROR; - HDfree(prefixed_filename); + free(prefixed_filename); prefixed_filename = NULL; PASSED(); @@ -2475,7 +2475,7 @@ error: H5E_BEGIN_TRY { if (file_name_buf) - HDfree(file_name_buf); + free(file_name_buf); H5Tclose(named_dtype_id); H5Sclose(dspace_id); H5Dclose(dset_id); @@ -2485,7 +2485,7 @@ error: } H5E_END_TRY; - HDfree(prefixed_filename); + free(prefixed_filename); return 1; } diff --git a/test/API/H5_api_link_test.c b/test/API/H5_api_link_test.c index 3559254..ffc5de5 100644 --- a/test/API/H5_api_link_test.c +++ b/test/API/H5_api_link_test.c @@ -307,7 +307,7 @@ test_create_hard_link_long_name(void) name_len = 99; /* Construct very long file name */ - if ((objname = (char *)HDmalloc((size_t)(name_len + 1))) == NULL) + if ((objname = (char *)malloc((size_t)(name_len + 1))) == NULL) TEST_ERROR; for (u = 0; u < name_len; u++) @@ -342,7 +342,7 @@ test_create_hard_link_long_name(void) /* Release memory */ if (objname) - HDfree(objname); + free(objname); PASSED(); @@ -358,7 +358,7 @@ error: H5E_END_TRY; if (objname) - HDfree(objname); + free(objname); return 1; } @@ -1493,7 +1493,7 @@ test_create_soft_link_long_name(void) name_len = 99; /* Construct very long file name */ - if ((objname = (char *)HDmalloc((size_t)(name_len + 1))) == NULL) + if ((objname = (char *)malloc((size_t)(name_len + 1))) == NULL) TEST_ERROR; for (u = 0; u < name_len; u++) @@ -1528,7 +1528,7 @@ test_create_soft_link_long_name(void) /* Release memory */ if (objname) - HDfree(objname); + free(objname); PASSED(); @@ -1544,7 +1544,7 @@ error: H5E_END_TRY; if (objname) - HDfree(objname); + free(objname); return 1; } @@ -13691,7 +13691,7 @@ test_get_link_val_invalid_params(void) } link_val_buf_size = 100; - if (NULL == (link_val_buf = (char *)HDmalloc(link_val_buf_size))) { + if (NULL == (link_val_buf = (char *)malloc(link_val_buf_size))) { H5_FAILED(); printf(" couldn't allocate buffer for storing link value\n"); goto error; @@ -13928,7 +13928,7 @@ test_get_link_val_invalid_params(void) TESTING_2("test cleanup"); if (link_val_buf) { - HDfree(link_val_buf); + free(link_val_buf); link_val_buf = NULL; } @@ -13949,7 +13949,7 @@ error: H5E_BEGIN_TRY { if (link_val_buf) - HDfree(link_val_buf); + free(link_val_buf); H5Pclose(gcpl_id); H5Gclose(group_id); H5Gclose(container_group); @@ -19303,7 +19303,7 @@ test_get_link_name_invalid_params(void) } link_name_buf_size = (size_t)ret; - if (NULL == (link_name_buf = (char *)HDmalloc(link_name_buf_size + 1))) + if (NULL == (link_name_buf = (char *)malloc(link_name_buf_size + 1))) TEST_ERROR; PASSED(); @@ -19459,7 +19459,7 @@ test_get_link_name_invalid_params(void) TESTING_2("test cleanup"); if (link_name_buf) { - HDfree(link_name_buf); + free(link_name_buf); link_name_buf = NULL; } @@ -19478,7 +19478,7 @@ error: H5E_BEGIN_TRY { if (link_name_buf) - HDfree(link_name_buf); + free(link_name_buf); H5Gclose(group_id); H5Gclose(container_group); H5Fclose(file_id); diff --git a/test/API/H5_api_test.c b/test/API/H5_api_test.c index 411062e..92237f5 100644 --- a/test/API/H5_api_test.c +++ b/test/API/H5_api_test.c @@ -286,7 +286,7 @@ main(int argc, char **argv) } done: - HDfree(vol_connector_string_copy); + free(vol_connector_string_copy); if (default_con_id >= 0 && H5VLclose(default_con_id) < 0) { fprintf(stderr, "Unable to close VOL connector ID\n"); diff --git a/test/API/H5_api_test_util.c b/test/API/H5_api_test_util.c index cab1de3..d7d330f 100644 --- a/test/API/H5_api_test_util.c +++ b/test/API/H5_api_test_util.c @@ -504,7 +504,7 @@ generate_random_datatype_enum(H5T_class_t H5_ATTR_UNUSED parent_class, hbool_t H num_members = (size_t)(rand() % ENUM_TYPE_MAX_MEMBERS + 1); - if (NULL == (enum_member_vals = HDmalloc(num_members * sizeof(int)))) { + if (NULL == (enum_member_vals = malloc(num_members * sizeof(int)))) { printf(" couldn't allocate space for enum members\n"); goto done; } @@ -537,7 +537,7 @@ generate_random_datatype_enum(H5T_class_t H5_ATTR_UNUSED parent_class, hbool_t H ret_value = datatype; done: - HDfree(enum_member_vals); + free(enum_member_vals); if ((ret_value == H5I_INVALID_HID) && (datatype >= 0)) { if (H5Tclose(datatype) < 0) @@ -558,7 +558,7 @@ generate_random_datatype_array(H5T_class_t H5_ATTR_UNUSED parent_class, hbool_t ndims = (unsigned)(rand() % ARRAY_TYPE_MAX_DIMS + 1); - if (NULL == (array_dims = HDmalloc(ndims * sizeof(*array_dims)))) { + if (NULL == (array_dims = malloc(ndims * sizeof(*array_dims)))) { printf(" couldn't allocate space for array datatype dims\n"); goto done; } @@ -579,7 +579,7 @@ generate_random_datatype_array(H5T_class_t H5_ATTR_UNUSED parent_class, hbool_t ret_value = datatype; done: - HDfree(array_dims); + free(array_dims); if (base_datatype >= 0) { if (H5Tclose(base_datatype) < 0) @@ -720,7 +720,7 @@ error: /* * Add a prefix to the given filename. The caller * is responsible for freeing the returned filename - * pointer with HDfree(). + * pointer with free(). */ herr_t prefix_filename(const char *prefix, const char *filename, char **filename_out) @@ -744,7 +744,7 @@ prefix_filename(const char *prefix, const char *filename, char **filename_out) goto done; } - if (NULL == (out_buf = HDmalloc(H5_API_TEST_FILENAME_MAX_LENGTH))) { + if (NULL == (out_buf = malloc(H5_API_TEST_FILENAME_MAX_LENGTH))) { printf(" couldn't allocated filename buffer\n"); ret_value = FAIL; goto done; @@ -789,7 +789,7 @@ remove_test_file(const char *prefix, const char *filename) } done: - HDfree(prefixed_filename); + free(prefixed_filename); return ret_value; } diff --git a/test/API/tarray.c b/test/API/tarray.c index 5780c66..00f0cf1 100644 --- a/test/API/tarray.c +++ b/test/API/tarray.c @@ -1055,7 +1055,7 @@ test_array_alloc_custom(size_t size, void *info) */ extra = MAX(sizeof(void *), sizeof(size_t)); - if ((ret_value = HDmalloc(extra + size)) != NULL) { + if ((ret_value = malloc(extra + size)) != NULL) { *(size_t *)ret_value = size; *mem_used += size; } /* end if */ @@ -1093,7 +1093,7 @@ test_array_free_custom(void *_mem, void *info) if (_mem != NULL) { mem = ((unsigned char *)_mem) - extra; *mem_used -= *(size_t *)((void *)mem); - HDfree(mem); + free(mem); } /* end if */ } /* end test_array_free_custom() */ @@ -1136,7 +1136,7 @@ test_array_vlen_atomic(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * sizeof(unsigned int)); + wdata[i][j].p = malloc((size_t)(i + j + 1) * sizeof(unsigned int)); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) ((unsigned int *)wdata[i][j].p)[k] = (unsigned int)(i * 100 + j * 10 + k); @@ -1357,7 +1357,7 @@ test_array_vlen_array(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * sizeof(unsigned int) * (size_t)ARRAY1_DIM1); + wdata[i][j].p = malloc((size_t)(i + j + 1) * sizeof(unsigned int) * (size_t)ARRAY1_DIM1); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) for (l = 0; l < ARRAY1_DIM1; l++) @@ -1632,8 +1632,8 @@ test_array_bkg(void) /* Initialize the data */ /* ------------------- */ - dtsinfo = (CmpDTSinfo *)HDmalloc(sizeof(CmpDTSinfo)); - CHECK_PTR(dtsinfo, "HDmalloc"); + dtsinfo = (CmpDTSinfo *)malloc(sizeof(CmpDTSinfo)); + CHECK_PTR(dtsinfo, "malloc"); HDmemset(dtsinfo, 0, sizeof(CmpDTSinfo)); for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { @@ -1662,7 +1662,7 @@ test_array_bkg(void) /* Initialize the names of data members */ /* ------------------------------------ */ for (i = 0; i < dtsinfo->nsubfields; i++) - dtsinfo->name[i] = (char *)HDcalloc((size_t)20, sizeof(char)); + dtsinfo->name[i] = (char *)calloc((size_t)20, sizeof(char)); HDstrcpy(dtsinfo->name[0], "One"); HDstrcpy(dtsinfo->name[1], "Two"); @@ -1734,7 +1734,7 @@ test_array_bkg(void) /* Release memory resources */ /* ------------------------ */ for (i = 0; i < dtsinfo->nsubfields; i++) - HDfree(dtsinfo->name[i]); + free(dtsinfo->name[i]); /* Release IDs */ /* ----------- */ @@ -1885,7 +1885,7 @@ test_array_bkg(void) status = H5Fclose(fid); CHECK(status, FAIL, "H5Fclose"); - HDfree(dtsinfo); + free(dtsinfo); } /* end test_array_bkg() */ /*------------------------------------------------------------------------- diff --git a/test/API/tattr.c b/test/API/tattr.c index 43d76ab..af96601 100644 --- a/test/API/tattr.c +++ b/test/API/tattr.c @@ -308,8 +308,8 @@ test_attr_basic_write(hid_t fapl) CHECK(attr_name_size, FAIL, "H5Aget_name"); if (attr_name_size > 0) { - attr_name = (char *)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); - CHECK_PTR(attr_name, "HDcalloc"); + attr_name = (char *)calloc((size_t)(attr_name_size + 1), sizeof(char)); + CHECK_PTR(attr_name, "calloc"); if (attr_name) { ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name); @@ -317,7 +317,7 @@ test_attr_basic_write(hid_t fapl) ret = HDstrcmp(attr_name, ATTR_TMP_NAME); VERIFY(ret, 0, "HDstrcmp"); - HDfree(attr_name); + free(attr_name); attr_name = NULL; } /* end if */ } /* end if */ @@ -345,8 +345,8 @@ test_attr_basic_write(hid_t fapl) CHECK(attr_name_size, FAIL, "H5Aget_name"); if (attr_name_size > 0) { - attr_name = (char *)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); - CHECK_PTR(attr_name, "HDcalloc"); + attr_name = (char *)calloc((size_t)(attr_name_size + 1), sizeof(char)); + CHECK_PTR(attr_name, "calloc"); if (attr_name) { ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name); @@ -354,7 +354,7 @@ test_attr_basic_write(hid_t fapl) ret = HDstrcmp(attr_name, ATTR1A_NAME); VERIFY(ret, 0, "HDstrcmp"); - HDfree(attr_name); + free(attr_name); attr_name = NULL; } /* end if */ } /* end if */ @@ -7503,8 +7503,8 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; - visited = (hbool_t *)HDmalloc(sizeof(hbool_t) * iter_info.max_visit); - CHECK_PTR(visited, "HDmalloc"); + visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit); + CHECK_PTR(visited, "malloc"); iter_info.visited = visited; /* Loop over operating on different indices on link fields */ @@ -7801,7 +7801,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Free the "visited link" array */ - HDfree(visited); + free(visited); } /* test_attr_iterate2() */ /*------------------------------------------------------------------------- @@ -8815,8 +8815,8 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) MESSAGE(5, ("Testing Writing Shared & Unshared Attributes in Compact & Dense Storage\n")); /* Allocate & initialize "big" attribute data */ - big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK_PTR(big_value, "HDmalloc"); + big_value = (unsigned *)malloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); + CHECK_PTR(big_value, "malloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9120,7 +9120,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Release memory */ - HDfree(big_value); + free(big_value); } /* test_attr_shared_write() */ /**************************************************************** @@ -9166,8 +9166,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) MESSAGE(5, ("Testing Renaming Shared & Unshared Attributes in Compact & Dense Storage\n")); /* Allocate & initialize "big" attribute data */ - big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK_PTR(big_value, "HDmalloc"); + big_value = (unsigned *)malloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); + CHECK_PTR(big_value, "malloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9580,7 +9580,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Release memory */ - HDfree(big_value); + free(big_value); } /* test_attr_shared_rename() */ /**************************************************************** @@ -9625,8 +9625,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) MESSAGE(5, ("Testing Deleting Shared & Unshared Attributes in Compact & Dense Storage\n")); /* Allocate & initialize "big" attribute data */ - big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK_PTR(big_value, "HDmalloc"); + big_value = (unsigned *)malloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); + CHECK_PTR(big_value, "malloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9964,7 +9964,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Release memory */ - HDfree(big_value); + free(big_value); } /* test_attr_shared_delete() */ /**************************************************************** @@ -10009,8 +10009,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) MESSAGE(5, ("Testing Unlinking Object with Shared Attributes in Compact & Dense Storage\n")); /* Allocate & initialize "big" attribute data */ - big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK_PTR(big_value, "HDmalloc"); + big_value = (unsigned *)malloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); + CHECK_PTR(big_value, "malloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -10336,7 +10336,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Release memory */ - HDfree(big_value); + free(big_value); } /* test_attr_shared_unlink() */ /**************************************************************** @@ -11629,8 +11629,8 @@ test_attr_delete_last_dense(hid_t fcpl, hid_t fapl) CHECK(aid, FAIL, "H5Acreate2"); /* Allocate the data buffer */ - data = (double *)HDmalloc((size_t)(DIM0 * DIM1) * sizeof(double)); - CHECK_PTR(data, "HDmalloc"); + data = (double *)malloc((size_t)(DIM0 * DIM1) * sizeof(double)); + CHECK_PTR(data, "malloc"); /* Initialize the data */ for (i = 0; i < DIM0; i++) @@ -11671,7 +11671,7 @@ test_attr_delete_last_dense(hid_t fcpl, hid_t fapl) /* Free the data buffer */ if (data) - HDfree(data); + free(data); } /* test_attr_delete_last_dense() */ #endif diff --git a/test/API/tchecksum.c b/test/API/tchecksum.c index a77ffcd..4aa300e 100644 --- a/test/API/tchecksum.c +++ b/test/API/tchecksum.c @@ -180,8 +180,8 @@ test_chksum_large(void) size_t u; /* Local index variable */ /* Allocate the buffer */ - large_buf = (uint8_t *)HDmalloc((size_t)BUF_LEN); - CHECK_PTR(large_buf, "HDmalloc"); + large_buf = (uint8_t *)malloc((size_t)BUF_LEN); + CHECK_PTR(large_buf, "malloc"); /* Initialize buffer w/known data */ for (u = 0; u < BUF_LEN; u++) @@ -209,7 +209,7 @@ test_chksum_large(void) VERIFY(chksum, 0x930c7afc, "H5_checksum_lookup3"); /* Release memory for buffer */ - HDfree(large_buf); + free(large_buf); } /* test_chksum_large() */ /**************************************************************** diff --git a/test/API/tcoords.c b/test/API/tcoords.c index 9c66b40..5cd79c5 100644 --- a/test/API/tcoords.c +++ b/test/API/tcoords.c @@ -435,18 +435,18 @@ test_multiple_ends(hid_t file, hbool_t is_chunked) hsize_t mem5_block[8] = {4, 5, 1, 4, 2, 1, 6, 2}; /* Initialize dynamic arrays */ - data_buf = HDcalloc(1, sizeof(*data_buf)); - CHECK_PTR(data_buf, "HDcalloc"); - mem1_buffer = HDcalloc(1, sizeof(*mem1_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); - mem2_buffer = HDcalloc(1, sizeof(*mem2_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); - mem3_buffer = HDcalloc(1, sizeof(*mem3_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); - mem4_buffer = HDcalloc(1, sizeof(*mem4_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); - mem5_buffer = HDcalloc(1, sizeof(*mem5_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); + data_buf = calloc(1, sizeof(*data_buf)); + CHECK_PTR(data_buf, "calloc"); + mem1_buffer = calloc(1, sizeof(*mem1_buffer)); + CHECK_PTR(data_buf, "calloc"); + mem2_buffer = calloc(1, sizeof(*mem2_buffer)); + CHECK_PTR(data_buf, "calloc"); + mem3_buffer = calloc(1, sizeof(*mem3_buffer)); + CHECK_PTR(data_buf, "calloc"); + mem4_buffer = calloc(1, sizeof(*mem4_buffer)); + CHECK_PTR(data_buf, "calloc"); + mem5_buffer = calloc(1, sizeof(*mem5_buffer)); + CHECK_PTR(data_buf, "calloc"); /* Create and write the dataset */ sid = H5Screate_simple(8, da_dims, da_dims); @@ -664,12 +664,12 @@ test_multiple_ends(hid_t file, hbool_t is_chunked) ret = H5Pclose(plid); CHECK(ret, FAIL, "H5Pclose"); - HDfree(data_buf); - HDfree(mem1_buffer); - HDfree(mem2_buffer); - HDfree(mem3_buffer); - HDfree(mem4_buffer); - HDfree(mem5_buffer); + free(data_buf); + free(mem1_buffer); + free(mem2_buffer); + free(mem3_buffer); + free(mem4_buffer); + free(mem5_buffer); } /**************************************************************** diff --git a/test/API/testhdf5.c b/test/API/testhdf5.c index 5e0409c..e863e38 100644 --- a/test/API/testhdf5.c +++ b/test/API/testhdf5.c @@ -146,16 +146,16 @@ getenv_all(MPI_Comm comm, int root, const char *name) MPI_Bcast(&len, 1, MPI_INT, root, comm); if (len >= 0) { if (env == NULL) - env = (char *)HDmalloc((size_t)len + 1); + env = (char *)malloc((size_t)len + 1); else if (HDstrlen(env) < (size_t)len) - env = (char *)HDrealloc(env, (size_t)len + 1); + env = (char *)realloc(env, (size_t)len + 1); MPI_Bcast(env, len, MPI_CHAR, root, comm); env[len] = '\0'; } else { if (env) - HDfree(env); + free(env); env = NULL; } } @@ -166,7 +166,7 @@ getenv_all(MPI_Comm comm, int root, const char *name) else { /* use original getenv */ if (env) - HDfree(env); + free(env); env = HDgetenv(name); } /* end if */ diff --git a/test/API/tfile.c b/test/API/tfile.c index 5462467..bdbf8e6 100644 --- a/test/API/tfile.c +++ b/test/API/tfile.c @@ -1230,8 +1230,8 @@ test_get_obj_ids(void) CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, (NGROUPS + NDSETS + 1), "H5Fget_obj_count"); - oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); - CHECK_PTR(oid_list, "HDcalloc"); + oid_list = (hid_t *)calloc((size_t)oid_list_size, sizeof(hid_t)); + CHECK_PTR(oid_list, "calloc"); /* Call the public function H5F_get_obj_ids to use H5F__get_objects. User reported having problem here. * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in @@ -1271,7 +1271,7 @@ test_get_obj_ids(void) H5Sclose(filespace); H5Fclose(fid); - HDfree(oid_list); + free(oid_list); /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works * when the file is closed first */ @@ -1294,8 +1294,8 @@ test_get_obj_ids(void) CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); - oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); - CHECK_PTR(oid_list, "HDcalloc"); + oid_list = (hid_t *)calloc((size_t)oid_count, sizeof(hid_t)); + CHECK_PTR(oid_list, "calloc"); /* Get the list of all opened objects */ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); @@ -1310,7 +1310,7 @@ test_get_obj_ids(void) } H5E_END_TRY; - HDfree(oid_list); + free(oid_list); } } @@ -1536,7 +1536,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, hid_t gid2, if (oid_count > 0) { hid_t *oid_list; - oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); + oid_list = (hid_t *)calloc((size_t)oid_count, sizeof(hid_t)); if (oid_list != NULL) { int i; @@ -1586,7 +1586,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, hid_t gid2, } /* end switch */ } /* end for */ - HDfree(oid_list); + free(oid_list); } /* end if */ } /* end if */ @@ -3245,19 +3245,19 @@ cal_chksum(const char *file, uint32_t *chksum) CHECK(fdes, FAIL, "HDfstat"); /* Allocate space for the file data */ - file_data = HDmalloc((size_t)sb.st_size); - CHECK_PTR(file_data, "HDmalloc"); + file_data = malloc((size_t)sb.st_size); + CHECK_PTR(file_data, "malloc"); if (file_data) { /* Read file's data into memory */ bytes_read = HDread(fdes, file_data, (size_t)sb.st_size); - CHECK(bytes_read == sb.st_size, FALSE, "HDmalloc"); + CHECK(bytes_read == sb.st_size, FALSE, "malloc"); /* Calculate checksum */ *chksum = H5_checksum_lookup3(file_data, sizeof(file_data), 0); /* Free memory */ - HDfree(file_data); + free(file_data); } /* Close the file */ @@ -4512,7 +4512,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t split) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - HDfree(memb_name[mt]); + free(memb_name[mt]); return 0; diff --git a/test/API/tgenprop.c b/test/API/tgenprop.c index b22409a..7b25d86 100644 --- a/test/API/tgenprop.c +++ b/test/API/tgenprop.c @@ -1027,7 +1027,7 @@ test_genprop_prop_crt_cb1(const char *name, size_t size, void *def_value) /* Set the information from the creation call */ prop1_cb_info.crt_count++; prop1_cb_info.crt_name = HDstrdup(name); - prop1_cb_info.crt_value = HDmalloc(size); + prop1_cb_info.crt_value = malloc(size); HDmemcpy(prop1_cb_info.crt_value, def_value, size); return (SUCCEED); @@ -1047,7 +1047,7 @@ test_genprop_prop_set_cb1(hid_t plist_id, const char *name, size_t size, void *v if (prop1_cb_info.set_name == NULL) prop1_cb_info.set_name = HDstrdup(name); if (prop1_cb_info.set_value == NULL) - prop1_cb_info.set_value = HDmalloc(size); + prop1_cb_info.set_value = malloc(size); HDmemcpy(prop1_cb_info.set_value, value, size); return (SUCCEED); @@ -1067,7 +1067,7 @@ test_genprop_prop_get_cb1(hid_t plist_id, const char *name, size_t size, void *v if (prop1_cb_info.get_name == NULL) prop1_cb_info.get_name = HDstrdup(name); if (prop1_cb_info.get_value == NULL) - prop1_cb_info.get_value = HDmalloc(size); + prop1_cb_info.get_value = malloc(size); HDmemcpy(prop1_cb_info.get_value, value, size); return (SUCCEED); @@ -1086,7 +1086,7 @@ test_genprop_prop_cop_cb1(const char *name, size_t size, void *value) if (prop1_cb_info.cop_name == NULL) prop1_cb_info.cop_name = HDstrdup(name); if (prop1_cb_info.cop_value == NULL) - prop1_cb_info.cop_value = HDmalloc(size); + prop1_cb_info.cop_value = malloc(size); HDmemcpy(prop1_cb_info.cop_value, value, size); return (SUCCEED); @@ -1133,7 +1133,7 @@ test_genprop_prop_cls_cb1(const char *name, size_t size, void *value) if (prop1_cb_info.cls_name == NULL) prop1_cb_info.cls_name = HDstrdup(name); if (prop1_cb_info.cls_value == NULL) - prop1_cb_info.cls_value = HDmalloc(size); + prop1_cb_info.cls_value = malloc(size); HDmemcpy(prop1_cb_info.cls_value, value, size); return (SUCCEED); @@ -1151,7 +1151,7 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v prop2_cb_info.del_count++; prop2_cb_info.del_plist_id = plist_id; prop2_cb_info.del_name = HDstrdup(name); - prop2_cb_info.del_value = HDmalloc(size); + prop2_cb_info.del_value = malloc(size); HDmemcpy(prop2_cb_info.del_value, value, size); return (SUCCEED); @@ -1368,18 +1368,18 @@ test_genprop_list_callback(void) VERIFY(prop1_cb_info.cls_count, 2, "H5Pclose"); /* Free memory allocated for tracking properties */ - HDfree(prop1_cb_info.crt_name); - HDfree(prop1_cb_info.crt_value); - HDfree(prop1_cb_info.get_name); - HDfree(prop1_cb_info.get_value); - HDfree(prop1_cb_info.set_name); - HDfree(prop1_cb_info.set_value); - HDfree(prop1_cb_info.cop_name); - HDfree(prop1_cb_info.cop_value); - HDfree(prop1_cb_info.cls_name); - HDfree(prop1_cb_info.cls_value); - HDfree(prop2_cb_info.del_name); - HDfree(prop2_cb_info.del_value); + free(prop1_cb_info.crt_name); + free(prop1_cb_info.crt_value); + free(prop1_cb_info.get_name); + free(prop1_cb_info.get_value); + free(prop1_cb_info.set_name); + free(prop1_cb_info.set_value); + free(prop1_cb_info.cop_name); + free(prop1_cb_info.cop_value); + free(prop1_cb_info.cls_name); + free(prop1_cb_info.cls_value); + free(prop2_cb_info.del_name); + free(prop2_cb_info.del_value); /* Close class */ ret = H5Pclose_class(cid1); diff --git a/test/API/th5o.c b/test/API/th5o.c index 916f005..bda3c93 100644 --- a/test/API/th5o.c +++ b/test/API/th5o.c @@ -962,10 +962,10 @@ test_h5o_link(void) /* Allocate memory buffers */ /* (These are treated as 2-D buffers) */ - wdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK_PTR(wdata, "HDmalloc"); - rdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK_PTR(rdata, "HDmalloc"); + wdata = (int *)malloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); + CHECK_PTR(wdata, "malloc"); + rdata = (int *)malloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); + CHECK_PTR(rdata, "malloc"); /* Initialize the raw data */ for (i = n = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) @@ -1088,8 +1088,8 @@ test_h5o_link(void) CHECK(ret, FAIL, "H5Pclose"); /* Release buffers */ - HDfree(wdata); - HDfree(rdata); + free(wdata); + free(rdata); } /* end test_h5o_link() */ #if 0 diff --git a/test/API/th5s.c b/test/API/th5s.c index 3e403e7..e5c8031 100644 --- a/test/API/th5s.c +++ b/test/API/th5s.c @@ -1274,8 +1274,8 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) CHECK(ret, FAIL, "H5Sencode2"); if (sbuf_size > 0) { - sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size); - CHECK_PTR(sbuf, "HDcalloc"); + sbuf = (unsigned char *)calloc((size_t)1, sbuf_size); + CHECK_PTR(sbuf, "calloc"); } /* Try decoding bogus buffer */ @@ -1336,8 +1336,8 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) CHECK(ret, FAIL, "H5Sencode"); if (null_size > 0) { - null_sbuf = (unsigned char *)HDcalloc((size_t)1, null_size); - CHECK_PTR(null_sbuf, "HDcalloc"); + null_sbuf = (unsigned char *)calloc((size_t)1, null_size); + CHECK_PTR(null_sbuf, "calloc"); } /* Encode the null dataspace in the buffer */ @@ -1372,8 +1372,8 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) CHECK(ret, FAIL, "H5Sencode"); if (scalar_size > 0) { - scalar_buf = (unsigned char *)HDcalloc((size_t)1, scalar_size); - CHECK_PTR(scalar_buf, "HDcalloc"); + scalar_buf = (unsigned char *)calloc((size_t)1, scalar_size); + CHECK_PTR(scalar_buf, "calloc"); } /* Encode the scalar dataspace in the buffer */ @@ -1411,11 +1411,11 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) /* Release resources */ if (sbuf) - HDfree(sbuf); + free(sbuf); if (null_sbuf) - HDfree(null_sbuf); + free(null_sbuf); if (scalar_buf) - HDfree(scalar_buf); + free(scalar_buf); } /* test_h5s_encode() */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -1466,8 +1466,8 @@ test_h5s_encode1(void) CHECK(ret, FAIL, "H5Sencode2"); if (sbuf_size > 0) { - sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size); - CHECK_PTR(sbuf, "HDcalloc"); + sbuf = (unsigned char *)calloc((size_t)1, sbuf_size); + CHECK_PTR(sbuf, "calloc"); } /* Try decoding bogus buffer */ @@ -1528,8 +1528,8 @@ test_h5s_encode1(void) CHECK(ret, FAIL, "H5Sencode"); if (null_size > 0) { - null_sbuf = (unsigned char *)HDcalloc((size_t)1, null_size); - CHECK_PTR(null_sbuf, "HDcalloc"); + null_sbuf = (unsigned char *)calloc((size_t)1, null_size); + CHECK_PTR(null_sbuf, "calloc"); } /* Encode the null dataspace in the buffer */ @@ -1564,8 +1564,8 @@ test_h5s_encode1(void) CHECK(ret, FAIL, "H5Sencode"); if (scalar_size > 0) { - scalar_buf = (unsigned char *)HDcalloc((size_t)1, scalar_size); - CHECK_PTR(scalar_buf, "HDcalloc"); + scalar_buf = (unsigned char *)calloc((size_t)1, scalar_size); + CHECK_PTR(scalar_buf, "calloc"); } /* Encode the scalar dataspace in the buffer */ @@ -1599,11 +1599,11 @@ test_h5s_encode1(void) /* Release resources */ if (sbuf) - HDfree(sbuf); + free(sbuf); if (null_sbuf) - HDfree(null_sbuf); + free(null_sbuf); if (scalar_buf) - HDfree(scalar_buf); + free(scalar_buf); } /* test_h5s_encode1() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -1651,8 +1651,8 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, CHECK(ret, FAIL, "H5Sencode2"); /* Allocate the buffer for encoding */ - buf = (char *)HDmalloc(buf_size); - CHECK_PTR(buf, "HDmalloc"); + buf = (char *)malloc(buf_size); + CHECK_PTR(buf, "malloc"); /* Encode according to the setting in in_fapl */ ret = H5Sencode2(in_sid, buf, &buf_size, in_fapl); @@ -1711,7 +1711,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, ret = H5Sclose(d_sid); CHECK(ret, FAIL, "H5Sclose"); if (buf) - HDfree(buf); + free(buf); } return (0); @@ -2177,7 +2177,7 @@ test_h5s_encode_length(void) /* Allocate the buffer */ if (sbuf_size > 0) { - sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size); + sbuf = (unsigned char *)calloc((size_t)1, sbuf_size); CHECK_PTR(sbuf, "H5Sencode2"); } @@ -2202,7 +2202,7 @@ test_h5s_encode_length(void) /* Free the buffer */ if (sbuf) - HDfree(sbuf); + free(sbuf); /* Close the original dataspace */ ret = H5Sclose(sid); @@ -2531,17 +2531,17 @@ test_h5s_chunk(void) int i, j; /* Allocate memory */ - chunk_data_dbl_data = (double *)HDcalloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(double)); - CHECK_PTR(chunk_data_dbl_data, "HDcalloc"); - chunk_data_dbl = (double **)HDcalloc(CHUNK_DATA_NX, sizeof(chunk_data_dbl_data)); - CHECK_PTR(chunk_data_dbl, "HDcalloc"); + chunk_data_dbl_data = (double *)calloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(double)); + CHECK_PTR(chunk_data_dbl_data, "calloc"); + chunk_data_dbl = (double **)calloc(CHUNK_DATA_NX, sizeof(chunk_data_dbl_data)); + CHECK_PTR(chunk_data_dbl, "calloc"); for (i = 0; i < CHUNK_DATA_NX; i++) chunk_data_dbl[i] = chunk_data_dbl_data + (i * CHUNK_DATA_NY); - chunk_data_flt_data = (float *)HDcalloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(float)); - CHECK_PTR(chunk_data_flt_data, "HDcalloc"); - chunk_data_flt = (float **)HDcalloc(CHUNK_DATA_NX, sizeof(chunk_data_flt_data)); - CHECK_PTR(chunk_data_flt, "HDcalloc"); + chunk_data_flt_data = (float *)calloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(float)); + CHECK_PTR(chunk_data_flt_data, "calloc"); + chunk_data_flt = (float **)calloc(CHUNK_DATA_NX, sizeof(chunk_data_flt_data)); + CHECK_PTR(chunk_data_flt, "calloc"); for (i = 0; i < CHUNK_DATA_NX; i++) chunk_data_flt[i] = chunk_data_flt_data + (i * CHUNK_DATA_NY); @@ -2611,10 +2611,10 @@ test_h5s_chunk(void) } /* end for */ } /* end for */ - HDfree(chunk_data_dbl); - HDfree(chunk_data_dbl_data); - HDfree(chunk_data_flt); - HDfree(chunk_data_flt_data); + free(chunk_data_dbl); + free(chunk_data_dbl_data); + free(chunk_data_flt); + free(chunk_data_flt_data); } /* test_h5s_chunk() */ /**************************************************************** diff --git a/test/API/tid.c b/test/API/tid.c index 2dd8851..3433b20 100644 --- a/test/API/tid.c +++ b/test/API/tid.c @@ -34,7 +34,7 @@ static herr_t free_wrapper(void *p, void H5_ATTR_UNUSED **_ctx) { - HDfree(p); + free(p); return SUCCEED; } @@ -98,12 +98,12 @@ basic_id_test(void) * Once the ID has been registered, testObj will be freed when * its ID type is destroyed. */ - testObj = HDmalloc(7 * sizeof(int)); + testObj = malloc(7 * sizeof(int)); arrayID = H5Iregister(myType, testObj); CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); if (arrayID == H5I_INVALID_HID) { - HDfree(testObj); + free(testObj); goto out; } @@ -192,12 +192,12 @@ basic_id_test(void) * freed when the previous type was destroyed. Allocate new * memory for it. */ - testObj = HDmalloc(7 * sizeof(int)); + testObj = malloc(7 * sizeof(int)); arrayID = H5Iregister(myType, testObj); CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); if (arrayID == H5I_INVALID_HID) { - HDfree(testObj); + free(testObj); goto out; } @@ -272,7 +272,7 @@ id_predefined_test(void) void *testPtr; herr_t testErr; - testObj = HDmalloc(sizeof(int)); + testObj = malloc(sizeof(int)); /* * Attempt to perform public functions on various library types @@ -363,14 +363,14 @@ id_predefined_test(void) /* testObj was never registered as an atom, so it will not be * automatically freed. */ - HDfree(testObj); + free(testObj); return 0; out: if (typeID != H5I_INVALID_HID) H5Tclose(typeID); if (testObj != NULL) - HDfree(testObj); + free(testObj); return -1; } @@ -720,8 +720,8 @@ test_remove_clear_type(void) /* Create an array to hold the objects in the master list */ list_size = RCT_MAX_NOBJS * sizeof(rct_obj_t); - obj_list.objects = HDmalloc(list_size); - CHECK_PTR(obj_list.objects, "HDcalloc"); + obj_list.objects = malloc(list_size); + CHECK_PTR(obj_list.objects, "calloc"); if (NULL == obj_list.objects) goto error; @@ -866,7 +866,7 @@ test_remove_clear_type(void) goto error; /* Free the object array */ - HDfree(obj_list.objects); + free(obj_list.objects); return 0; @@ -878,7 +878,7 @@ error: } H5E_END_TRY - HDfree(obj_list.objects); + free(obj_list.objects); return -1; } /* end test_remove_clear_type() */ @@ -901,7 +901,7 @@ free_actual_object(void *_p, void H5_ATTR_UNUSED **_ctx) if (7 != *p) return FAIL; - HDfree(p); + free(p); return SUCCEED; } @@ -934,7 +934,7 @@ realize_future_cb(void *_future_obj, hid_t *actual_id) } else { /* Create a new object (the 'actual object') of the correct type */ - if (NULL == (actual_obj = HDmalloc(sizeof(int)))) + if (NULL == (actual_obj = malloc(sizeof(int)))) return FAIL; *actual_obj = 7; @@ -955,7 +955,7 @@ discard_future_cb(void *future_obj) if (NULL == future_obj) return FAIL; - HDfree(future_obj); + free(future_obj); return SUCCEED; } @@ -970,7 +970,7 @@ realize_future_generate_cb(void *_future_obj, hid_t *actual_id) if (NULL != future_obj) return FAIL; /* Create a new object (the 'actual object') of the correct type */ - if (NULL == (actual_obj = HDmalloc(sizeof(int)))) + if (NULL == (actual_obj = malloc(sizeof(int)))) return FAIL; *actual_obj = 7; @@ -1054,7 +1054,7 @@ test_future_ids(void) /* Test base use-case: create a future object and destroy type without * realizing the future object. */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = obj_type; future_id = H5Iregister_future(obj_type, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1074,7 +1074,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object and realize the actual object. */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = obj_type; future_id = H5Iregister_future(obj_type, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1160,7 +1160,7 @@ test_future_ids(void) /* Test base use-case: create a future object for a pre-defined type */ /* (DATASPACE) */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATASPACE; future_id = H5Iregister_future(H5I_DATASPACE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1178,7 +1178,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATASPACE; future_id = H5Iregister_future(H5I_DATASPACE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1201,7 +1201,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATASPACE; future_id = H5Iregister_future(H5I_DATASPACE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1232,7 +1232,7 @@ test_future_ids(void) /* Test base use-case: create a future object for a pre-defined type */ /* (DATATYPE) */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATATYPE; future_id = H5Iregister_future(H5I_DATATYPE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1250,7 +1250,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATATYPE; future_id = H5Iregister_future(H5I_DATATYPE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1273,7 +1273,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATATYPE; future_id = H5Iregister_future(H5I_DATATYPE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1304,7 +1304,7 @@ test_future_ids(void) /* Test base use-case: create a future object for a pre-defined type */ /* (PROPERTY LIST) */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_GENPROP_LST; future_id = H5Iregister_future(H5I_GENPROP_LST, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1322,7 +1322,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_GENPROP_LST; future_id = H5Iregister_future(H5I_GENPROP_LST, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1345,7 +1345,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_GENPROP_LST; future_id = H5Iregister_future(H5I_GENPROP_LST, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); diff --git a/test/API/titerate.c b/test/API/titerate.c index 343c601..b50542c 100644 --- a/test/API/titerate.c +++ b/test/API/titerate.c @@ -381,7 +381,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) /* Free the dataset names */ for (i = 0; i < (NDATASETS + 2); i++) - HDfree(lnames[i]); + free(lnames[i]); } } /* test_iter_group() */ @@ -590,7 +590,7 @@ test_iter_attr(hid_t fapl, hbool_t new_format) /* Free the attribute names */ for (i = 0; i < NATTR; i++) - HDfree(anames[i]); + free(anames[i]); } } /* test_iter_attr() */ @@ -672,8 +672,8 @@ test_iter_group_large(hid_t fapl) } s1_t; /* Allocate & initialize array */ - names = (iter_info *)HDcalloc(sizeof(iter_info), (ITER_NGROUPS + 2)); - CHECK_PTR(names, "HDcalloc"); + names = (iter_info *)calloc(sizeof(iter_info), (ITER_NGROUPS + 2)); + CHECK_PTR(names, "calloc"); /* Output message about test being performed */ MESSAGE(5, ("Testing Large Group Iteration Functionality\n")); @@ -768,7 +768,7 @@ test_iter_group_large(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Release memory */ - HDfree(names); + free(names); } } /* test_iterate_group_large() */ @@ -921,8 +921,8 @@ test_grp_memb_funcs(hid_t fapl) /* Free the dataset names */ for (i = 0; i < (NDATASETS + 2); i++) { - HDfree(dnames[i]); - HDfree(obj_names[i]); + free(dnames[i]); + free(obj_names[i]); } /* end for */ } /* test_grp_memb_funcs() */ diff --git a/test/API/tmisc.c b/test/API/tmisc.c index 4696bda..eb827a2 100644 --- a/test/API/tmisc.c +++ b/test/API/tmisc.c @@ -568,8 +568,8 @@ test_misc2_write_attribute(void) ret = H5Fclose(file2); CHECK(ret, FAIL, "H5Fclose"); - HDfree(string_att1); - HDfree(string_att2); + free(string_att1); + free(string_att2); } static void @@ -782,7 +782,7 @@ create_struct3(void) misc5_struct3_hndl *str3hndl; /* New 'struct3' created */ herr_t ret; /* For error checking */ - str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl)); + str3hndl = (misc5_struct3_hndl *)malloc(sizeof(misc5_struct3_hndl)); CHECK_PTR(str3hndl, "malloc"); str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); @@ -808,7 +808,7 @@ delete_struct3(misc5_struct3_hndl *str3hndl) ret = H5Tclose(str3hndl->st3h_base); CHECK(ret, FAIL, "H5Tclose"); - HDfree(str3hndl); + free(str3hndl); } static void @@ -825,8 +825,8 @@ create_struct2(void) misc5_struct2_hndl *str2hndl; /* New 'struct2' created */ herr_t ret; /* For error checking */ - str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl)); - CHECK_PTR(str2hndl, "HDmalloc"); + str2hndl = (misc5_struct2_hndl *)malloc(sizeof(misc5_struct2_hndl)); + CHECK_PTR(str2hndl, "malloc"); str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); CHECK(str2hndl->st2h_base, FAIL, "H5Tcreate"); @@ -860,7 +860,7 @@ delete_struct2(misc5_struct2_hndl *str2hndl) H5Tclose(str2hndl->st2h_base); CHECK(ret, FAIL, "H5Tclose"); - HDfree(str2hndl); + free(str2hndl); } static void @@ -871,8 +871,8 @@ set_struct2(misc5_struct2 *buf) buf->st2_el1 = MISC5_DBGELVAL2; buf->st2_el2.len = MISC5_DBGNELM3; - buf->st2_el2.p = HDmalloc((buf->st2_el2.len) * sizeof(misc5_struct3)); - CHECK_PTR(buf->st2_el2.p, "HDmalloc"); + buf->st2_el2.p = malloc((buf->st2_el2.len) * sizeof(misc5_struct3)); + CHECK_PTR(buf->st2_el2.p, "malloc"); for (i = 0; i < (buf->st2_el2.len); i++) set_struct3(&(((misc5_struct3 *)(buf->st2_el2.p))[i])); @@ -881,7 +881,7 @@ set_struct2(misc5_struct2 *buf) static void clear_struct2(misc5_struct2 *buf) { - HDfree(buf->st2_el2.p); + free(buf->st2_el2.p); } /*********************** struct1 ***********************/ @@ -892,8 +892,8 @@ create_struct1(void) misc5_struct1_hndl *str1hndl; /* New 'struct1' created */ herr_t ret; /* For error checking */ - str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl)); - CHECK_PTR(str1hndl, "HDmalloc"); + str1hndl = (misc5_struct1_hndl *)malloc(sizeof(misc5_struct1_hndl)); + CHECK_PTR(str1hndl, "malloc"); str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); CHECK(str1hndl->st1h_base, FAIL, "H5Tcreate"); @@ -927,7 +927,7 @@ delete_struct1(misc5_struct1_hndl *str1hndl) ret = H5Tclose(str1hndl->st1h_base); CHECK(ret, FAIL, "H5Tclose"); - HDfree(str1hndl); + free(str1hndl); } static void @@ -938,8 +938,8 @@ set_struct1(misc5_struct1 *buf) buf->st1_el1 = MISC5_DBGELVAL1; buf->st1_el2.len = MISC5_DBGNELM2; - buf->st1_el2.p = HDmalloc((buf->st1_el2.len) * sizeof(misc5_struct2)); - CHECK_PTR(buf->st1_el2.p, "HDmalloc"); + buf->st1_el2.p = malloc((buf->st1_el2.len) * sizeof(misc5_struct2)); + CHECK_PTR(buf->st1_el2.p, "malloc"); for (i = 0; i < (buf->st1_el2.len); i++) set_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i])); @@ -952,7 +952,7 @@ clear_struct1(misc5_struct1 *buf) for (i = 0; i < buf->st1_el2.len; i++) clear_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i])); - HDfree(buf->st1_el2.p); + free(buf->st1_el2.p); } static void @@ -989,8 +989,8 @@ test_misc5(void) /* Create the variable-length buffer */ buf.len = MISC5_DBGNELM1; - buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1)); - CHECK_PTR(buf.p, "HDmalloc"); + buf.p = malloc((buf.len) * sizeof(misc5_struct1)); + CHECK_PTR(buf.p, "malloc"); /* Create the top-level VL information */ for (i = 0; i < MISC5_DBGNELM1; i++) @@ -1005,7 +1005,7 @@ test_misc5(void) clear_struct1(&(((misc5_struct1 *)(buf.p))[j])); /* Free the variable-length buffer */ - HDfree(buf.p); + free(buf.p); /* Close dataset */ ret = H5Dclose(dataset_id); @@ -1323,11 +1323,11 @@ test_misc8(void) MESSAGE(5, ("Testing dataset storage sizes\n")); /* Allocate space for the data to write & read */ - wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK_PTR(wdata, "HDmalloc"); + wdata = (int *)malloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); + CHECK_PTR(wdata, "malloc"); #ifdef VERIFY_DATA - rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK_PTR(rdata, "HDmalloc"); + rdata = (int *)malloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); + CHECK_PTR(rdata, "malloc"); #endif /* VERIFY_DATA */ /* Initialize values */ @@ -1794,9 +1794,9 @@ test_misc8(void) CHECK(ret, FAIL, "H5Fclose"); /* Free the read & write buffers */ - HDfree(wdata); + free(wdata); #ifdef VERIFY_DATA - HDfree(rdata); + free(rdata); #endif /* VERIFY_DATA */ } /* end test_misc8() */ #endif @@ -2264,8 +2264,8 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) herr_t ret; /* Generic return value */ /* Create a data buffer for the dataset read */ - read_data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK_PTR(read_data, "HDcalloc"); + read_data = (unsigned *)calloc(MISC13_DIM1, sizeof(unsigned)); + CHECK_PTR(read_data, "calloc"); /* Open the contiguous dataset in the root group */ dsid = H5Dopen2(loc_id, name, H5P_DEFAULT); @@ -2284,7 +2284,7 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) CHECK(ret, FAIL, "H5Dclose"); /* Free the dataset read buffer */ - HDfree(read_data); + free(read_data); } /* end misc13_verify_dataset() */ @@ -2390,8 +2390,8 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char int ret; /* Generic status value */ /* Allocate space for the user block */ - user_block = HDcalloc(size, (size_t)1); - CHECK_PTR(user_block, "HDcalloc"); + user_block = calloc(size, (size_t)1); + CHECK_PTR(user_block, "calloc"); /* Copy in the user block data */ HDmemcpy(user_block, str, HDstrlen(str)); @@ -2409,8 +2409,8 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char CHECK_PTR(old_fp, "HDfopen"); /* Allocate space for the copy buffer */ - copy_buf = HDmalloc((size_t)MISC13_COPY_BUF_SIZE); - CHECK_PTR(copy_buf, "HDmalloc"); + copy_buf = malloc((size_t)MISC13_COPY_BUF_SIZE); + CHECK_PTR(copy_buf, "malloc"); /* Copy data from the old file to the new file */ while ((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { @@ -2428,10 +2428,10 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char VERIFY(ret, 0, "HDfclose"); /* Free the copy buffer */ - HDfree(copy_buf); + free(copy_buf); /* Free the user block */ - HDfree(user_block); + free(user_block); } /* end misc13_insert_user_block() */ @@ -2559,8 +2559,8 @@ test_misc13(void) hbool_t check_for_new_dataset; /* Whether to check for the post-userblock-creation dataset */ /* Create a data buffer for the datasets */ - data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK_PTR(data, "HDcalloc"); + data = (unsigned *)calloc(MISC13_DIM1, sizeof(unsigned)); + CHECK_PTR(data, "calloc"); /* Initialize data to write */ misc13_init_data(data); @@ -2590,7 +2590,7 @@ test_misc13(void) misc13_verify_file(MISC13_FILE_2, data, userblock_size, check_for_new_dataset); /* Free the dataset buffer */ - HDfree(data); + free(data); } /* end test_misc13() */ #endif @@ -3718,7 +3718,7 @@ test_misc19(void) H5E_END_TRY; VERIFY(ret, FAIL, "H5FDunregister"); - HDfree(vfd_cls); + free(vfd_cls); /* Check H5I operations on virtual object connectors */ @@ -3758,7 +3758,7 @@ test_misc19(void) H5E_END_TRY; VERIFY(ret, FAIL, "H5VLunregister_connector"); - HDfree(vol_cls); + free(vol_cls); #endif } /* end test_misc19() */ @@ -3968,8 +3968,8 @@ test_misc21(void) MESSAGE(5, ("Testing late allocation time w/chunks & filters\n")); /* Allocate space for the buffer */ - buf = (char *)HDcalloc(MISC21_SPACE_DIM0 * MISC21_SPACE_DIM1, 1); - CHECK(buf, NULL, "HDcalloc"); + buf = (char *)calloc(MISC21_SPACE_DIM0 * MISC21_SPACE_DIM1, 1); + CHECK(buf, NULL, "calloc"); /* Create the file */ fid = H5Fcreate(MISC21_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -4009,7 +4009,7 @@ test_misc21(void) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - HDfree(buf); + free(buf); } /* end test_misc21() */ /**************************************************************** @@ -4053,8 +4053,8 @@ test_misc22(void) MESSAGE(5, ("Testing datatypes with SZIP filter\n")); /* Allocate space for the buffer */ - buf = (char *)HDcalloc(MISC22_SPACE_DIM0 * MISC22_SPACE_DIM1, 8); - CHECK(buf, NULL, "HDcalloc"); + buf = (char *)calloc(MISC22_SPACE_DIM0 * MISC22_SPACE_DIM1, 8); + CHECK(buf, NULL, "calloc"); /* Create the file */ fid = H5Fcreate(MISC22_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -4160,7 +4160,7 @@ test_misc22(void) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - HDfree(buf); + free(buf); } /* end test_misc22() */ #endif /* H5_HAVE_FILTER_SZIP */ diff --git a/test/API/trefer.c b/test/API/trefer.c index ea8888c..d1a6550 100644 --- a/test/API/trefer.c +++ b/test/API/trefer.c @@ -112,10 +112,10 @@ test_reference_params(void) MESSAGE(5, ("Testing Reference Parameters\n")); /* Allocate write & read buffers */ - wbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + wbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + tbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -411,10 +411,10 @@ test_reference_params(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); - HDfree(obuf); + free(wbuf); + free(rbuf); + free(tbuf); + free(obuf); } /* test_reference_params() */ /**************************************************************** @@ -445,10 +445,10 @@ test_reference_obj(void) MESSAGE(5, ("Testing Object Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + ibuf = calloc(sizeof(unsigned), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -645,10 +645,10 @@ test_reference_obj(void) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(ibuf); - HDfree(obuf); + free(wbuf); + free(rbuf); + free(ibuf); + free(obuf); } /* test_reference_obj() */ /**************************************************************** @@ -682,9 +682,9 @@ test_reference_vlen_obj(void) MESSAGE(5, ("Testing Object Reference Functions within VLEN type\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + ibuf = calloc(sizeof(unsigned), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -911,10 +911,10 @@ test_reference_vlen_obj(void) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(ibuf); - HDfree(obuf); + free(wbuf); + free(rbuf); + free(ibuf); + free(obuf); } /* test_reference_vlen_obj() */ /**************************************************************** @@ -946,8 +946,8 @@ test_reference_cmpnd_obj(void) MESSAGE(5, ("Testing Object Reference Functions within compound type\n")); /* Allocate write & read buffers */ - ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + ibuf = calloc(sizeof(unsigned), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -1202,8 +1202,8 @@ test_reference_cmpnd_obj(void) CHECK(ret, FAIL, "H5Rdestroy"); /* Free memory buffers */ - HDfree(ibuf); - HDfree(obuf); + free(ibuf); + free(obuf); } /* test_reference_cmpnd_obj() */ /**************************************************************** @@ -1255,10 +1255,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) MESSAGE(5, ("Testing Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + dwbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); for (tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++) *tu8++ = (uint8_t)(i * 3); @@ -1529,7 +1529,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 1, "H5Sget_select_hyper_nblocks"); /* allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); + coords = (hsize_t *)malloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); @@ -1537,7 +1537,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[1], 2, "Hyperslab Coordinates"); VERIFY(coords[2], 7, "Hyperslab Coordinates"); VERIFY(coords[3], 7, "Hyperslab Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid2, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 2, "Selection Bounds"); @@ -1560,7 +1560,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, SPACE2_DIM2, "H5Sget_select_elem_npoints"); /* allocate space for the element points */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); @@ -1584,7 +1584,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[17], coord1[8][1], "Element Coordinates"); VERIFY(coords[18], coord1[9][0], "Element Coordinates"); VERIFY(coords[19], coord1[9][1], "Element Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid2, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 0, "Selection Bounds"); @@ -1661,10 +1661,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } /* test_reference_region() */ @@ -1711,10 +1711,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1); - rbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1); - dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); + wbuf = calloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1); + rbuf = calloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1); + dwbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) *tu8++ = (uint8_t)(i * 3); @@ -1889,7 +1889,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 15, "H5Sget_select_hyper_nblocks"); /* allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); + coords = (hsize_t *)malloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); @@ -1923,7 +1923,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[27], 68, "Hyperslab Coordinates"); VERIFY(coords[28], 72, "Hyperslab Coordinates"); VERIFY(coords[29], 73, "Hyperslab Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid3, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 2, "Selection Bounds"); @@ -1944,7 +1944,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 10, "H5Sget_select_elem_npoints"); /* allocate space for the element points */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); @@ -1958,7 +1958,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[7], coord1[7][0], "Element Coordinates"); VERIFY(coords[8], coord1[8][0], "Element Coordinates"); VERIFY(coords[9], coord1[9][0], "Element Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid3, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 3, "Selection Bounds"); @@ -2002,10 +2002,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } /* test_reference_region_1D() */ @@ -2861,10 +2861,10 @@ test_reference_compat_conv(void) MESSAGE(5, ("Testing Deprecated Object Reference Functions\n")); /* Allocate write & read buffers */ - wbuf_obj = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); - rbuf_obj = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - wbuf_reg = HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf_reg = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); + wbuf_obj = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1); + rbuf_obj = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + wbuf_reg = calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf_reg = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE_REF_COMPAT, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3131,10 +3131,10 @@ test_reference_compat_conv(void) } /* Free memory buffers */ - HDfree(wbuf_obj); - HDfree(rbuf_obj); - HDfree(wbuf_reg); - HDfree(rbuf_reg); + free(wbuf_obj); + free(rbuf_obj); + free(wbuf_reg); + free(rbuf_reg); } /* test_reference_compat() */ #endif @@ -3174,17 +3174,17 @@ test_reference_perf(void) MESSAGE(5, ("Testing Object Reference Performance\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - wbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); - rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); - tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - wbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - wbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); + ibuf = calloc(sizeof(unsigned), SPACE1_DIM1); + wbuf_deprec = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1); + rbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf_deprec = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1); + tbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + wbuf_reg = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf_reg = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + wbuf_reg_deprec = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf_reg_deprec = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -3543,17 +3543,17 @@ test_reference_perf(void) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(wbuf_reg); - HDfree(rbuf_reg); - HDfree(wbuf_deprec); - HDfree(rbuf_deprec); - HDfree(wbuf_reg_deprec); - HDfree(rbuf_reg_deprec); - HDfree(tbuf); - HDfree(ibuf); - HDfree(obuf); + free(wbuf); + free(rbuf); + free(wbuf_reg); + free(rbuf_reg); + free(wbuf_deprec); + free(rbuf_deprec); + free(wbuf_reg_deprec); + free(rbuf_reg_deprec); + free(tbuf); + free(ibuf); + free(obuf); } /* test_reference_perf() */ /**************************************************************** diff --git a/test/API/tselect.c b/test/API/tselect.c index 34c90c3..9547b74 100644 --- a/test/API/tselect.c +++ b/test/API/tselect.c @@ -248,10 +248,10 @@ test_select_hyper(hid_t xfer_plist) MESSAGE(5, ("Testing Hyperslab Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -435,8 +435,8 @@ test_select_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper() */ struct pnt_iter { @@ -502,10 +502,10 @@ test_select_point(hid_t xfer_plist) MESSAGE(5, ("Testing Element Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -802,8 +802,8 @@ test_select_point(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_point() */ /**************************************************************** @@ -864,10 +864,10 @@ test_select_all(hid_t xfer_plist) MESSAGE(5, ("Testing 'All' Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE4_DIM1; i++) @@ -917,8 +917,8 @@ test_select_all(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_all() */ /**************************************************************** @@ -951,10 +951,10 @@ test_select_all_hyper(hid_t xfer_plist) MESSAGE(5, ("Testing 'All' Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -1069,8 +1069,8 @@ test_select_all_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_all_hyper() */ /**************************************************************** @@ -1105,10 +1105,10 @@ test_select_combo(void) MESSAGE(5, ("Testing Combination of Hyperslab & Element Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -1230,8 +1230,8 @@ test_select_combo(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_combo() */ static int @@ -1300,10 +1300,10 @@ test_select_hyper_stride(hid_t xfer_plist) MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -1415,8 +1415,8 @@ test_select_hyper_stride(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_stride() */ /**************************************************************** @@ -1446,10 +1446,10 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) MESSAGE(5, ("Testing Contiguous Hyperslabs Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -1557,8 +1557,8 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_contig() */ /**************************************************************** @@ -1586,11 +1586,11 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) MESSAGE(5, ("Testing More Contiguous Hyperslabs Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), - (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4); + CHECK_PTR(wbuf, "malloc"); + rbuf = + (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE8_DIM1; i++) @@ -1700,8 +1700,8 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_contig2() */ /**************************************************************** @@ -1732,11 +1732,11 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) MESSAGE(5, ("Testing Yet More Contiguous Hyperslabs Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), - (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4); + CHECK_PTR(wbuf, "malloc"); + rbuf = + (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE8_DIM4; i++) @@ -1865,8 +1865,8 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_contig3() */ #if 0 @@ -2005,10 +2005,10 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co block_ptr = &(block[SS_DR_MAX_RANK - large_rank]); /* Allocate buffers */ - small_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), small_cube_size); - CHECK_PTR(small_cube_buf_1, "HDcalloc"); - large_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), large_cube_size); - CHECK_PTR(large_cube_buf_1, "HDcalloc"); + small_cube_buf_1 = (uint16_t *)calloc(sizeof(uint16_t), small_cube_size); + CHECK_PTR(small_cube_buf_1, "calloc"); + large_cube_buf_1 = (uint16_t *)calloc(sizeof(uint16_t), large_cube_size); + CHECK_PTR(large_cube_buf_1, "calloc"); /* Create a dataset transfer property list */ fapl = H5Pcreate(H5P_FILE_ACCESS); @@ -2493,8 +2493,8 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(small_cube_buf_1); - HDfree(large_cube_buf_1); + free(small_cube_buf_1); + free(large_cube_buf_1); } /* test_select_hyper_contig_dr__run_test() */ #endif @@ -2533,8 +2533,8 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) max_cube_size *= (size_t)edge_size; /* Allocate cube buffer for writing values */ - cube_buf = (uint16_t *)HDmalloc(sizeof(uint16_t) * max_cube_size); - CHECK_PTR(cube_buf, "HDmalloc"); + cube_buf = (uint16_t *)malloc(sizeof(uint16_t) * max_cube_size); + CHECK_PTR(cube_buf, "malloc"); /* Initialize the cube buffer */ cube_ptr = cube_buf; @@ -2542,8 +2542,8 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) *cube_ptr++ = (uint16_t)s; /* Allocate cube buffer for zeroing values on disk */ - zero_buf = (uint16_t *)HDcalloc(sizeof(uint16_t), max_cube_size); - CHECK_PTR(zero_buf, "HDcalloc"); + zero_buf = (uint16_t *)calloc(sizeof(uint16_t), max_cube_size); + CHECK_PTR(zero_buf, "calloc"); for (large_rank = 1; large_rank <= max_rank; large_rank++) { for (small_rank = 1; small_rank < large_rank; small_rank++) { @@ -2559,8 +2559,8 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) } /* for loop on small rank */ } /* for loop on large rank */ - HDfree(cube_buf); - HDfree(zero_buf); + free(cube_buf); + free(zero_buf); } /* test_select_hyper_contig_dr() */ #endif @@ -2996,10 +2996,10 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ assert(large_cube_size < (size_t)(64 * 1024)); /* Allocate & initialize buffers */ - small_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), small_cube_size); - CHECK_PTR(small_cube_buf_1, "HDcalloc"); - large_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), large_cube_size); - CHECK_PTR(large_cube_buf_1, "HDcalloc"); + small_cube_buf_1 = (uint16_t *)calloc(sizeof(uint16_t), small_cube_size); + CHECK_PTR(small_cube_buf_1, "calloc"); + large_cube_buf_1 = (uint16_t *)calloc(sizeof(uint16_t), large_cube_size); + CHECK_PTR(large_cube_buf_1, "calloc"); /* Create a dataset transfer property list */ fapl = H5Pcreate(H5P_FILE_ACCESS); @@ -3571,8 +3571,8 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(small_cube_buf_1); - HDfree(large_cube_buf_1); + free(small_cube_buf_1); + free(large_cube_buf_1); } /* test_select_hyper_checker_board_dr__run_test() */ #endif @@ -3615,8 +3615,8 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) max_cube_size *= (size_t)(edge_size + 1); /* Allocate cube buffer for writing values */ - cube_buf = (uint16_t *)HDmalloc(sizeof(uint16_t) * max_cube_size); - CHECK_PTR(cube_buf, "HDmalloc"); + cube_buf = (uint16_t *)malloc(sizeof(uint16_t) * max_cube_size); + CHECK_PTR(cube_buf, "malloc"); /* Initialize the cube buffer */ cube_ptr = cube_buf; @@ -3624,8 +3624,8 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) *cube_ptr++ = (uint16_t)s; /* Allocate cube buffer for zeroing values on disk */ - zero_buf = (uint16_t *)HDcalloc(sizeof(uint16_t), max_cube_size); - CHECK_PTR(zero_buf, "HDcalloc"); + zero_buf = (uint16_t *)calloc(sizeof(uint16_t), max_cube_size); + CHECK_PTR(zero_buf, "calloc"); for (large_rank = 1; large_rank <= max_rank; large_rank++) { for (small_rank = 1; small_rank < large_rank; small_rank++) { @@ -3653,8 +3653,8 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) } /* for loop on small rank */ } /* for loop on large rank */ - HDfree(cube_buf); - HDfree(zero_buf); + free(cube_buf); + free(zero_buf); } /* test_select_hyper_checker_board_dr() */ #endif @@ -3688,12 +3688,12 @@ test_select_hyper_copy(void) MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); - rbuf2 = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf2, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); + rbuf2 = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf2, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -3825,9 +3825,9 @@ test_select_hyper_copy(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(rbuf2); + free(wbuf); + free(rbuf); + free(rbuf2); } /* test_select_hyper_copy() */ /**************************************************************** @@ -3859,12 +3859,12 @@ test_select_point_copy(void) MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); - rbuf2 = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf2, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); + rbuf2 = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf2, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -4038,9 +4038,9 @@ test_select_point_copy(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(rbuf2); + free(wbuf); + free(rbuf); + free(rbuf2); } /* test_select_point_copy() */ /**************************************************************** @@ -4077,10 +4077,10 @@ test_select_hyper_offset(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with Offsets\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -4226,8 +4226,8 @@ test_select_hyper_offset(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_offset() */ /**************************************************************** @@ -4259,10 +4259,10 @@ test_select_hyper_offset2(void) MESSAGE(5, ("Testing More Hyperslab Selection Functions with Offsets\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE7_DIM1 * SPACE7_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE7_DIM1 * SPACE7_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE7_DIM1; i++) @@ -4353,8 +4353,8 @@ test_select_hyper_offset2(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_offset2() */ /**************************************************************** @@ -4389,10 +4389,10 @@ test_select_point_offset(void) MESSAGE(5, ("Testing Element Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -4573,8 +4573,8 @@ test_select_point_offset(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_point_offset() */ /**************************************************************** @@ -4616,10 +4616,10 @@ test_select_hyper_union(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with unions of hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -5199,8 +5199,8 @@ test_select_hyper_union(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_union() */ /**************************************************************** @@ -5394,10 +5394,10 @@ test_select_hyper_union_3d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with unions of 3-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE3_DIM1 * SPACE3_DIM2); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE3_DIM1 * SPACE3_DIM2); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE4_DIM1; i++) @@ -5538,8 +5538,8 @@ test_select_hyper_union_3d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_union_3d() */ /**************************************************************** @@ -5718,10 +5718,10 @@ test_select_hyper_and_2d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with intersection of 2-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -5823,8 +5823,8 @@ test_select_hyper_and_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_and_2d() */ /**************************************************************** @@ -5857,10 +5857,10 @@ test_select_hyper_xor_2d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with XOR of 2-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -5964,8 +5964,8 @@ test_select_hyper_xor_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_xor_2d() */ /**************************************************************** @@ -5998,10 +5998,10 @@ test_select_hyper_notb_2d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTB of 2-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -6103,8 +6103,8 @@ test_select_hyper_notb_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_notb_2d() */ /**************************************************************** @@ -6137,10 +6137,10 @@ test_select_hyper_nota_2d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTA of 2-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -6243,8 +6243,8 @@ test_select_hyper_nota_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_nota_2d() */ /**************************************************************** @@ -6308,11 +6308,11 @@ test_select_hyper_union_random_5d(hid_t read_plist) MESSAGE(5, ("Testing Hyperslab Selection Functions with random unions of 5-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (int *)HDmalloc(sizeof(int) * SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (int *)HDcalloc(sizeof(int), - (size_t)(SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (int *)malloc(sizeof(int) * SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5); + CHECK_PTR(wbuf, "malloc"); + rbuf = (int *)calloc(sizeof(int), + (size_t)(SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE5_DIM1; i++) @@ -6421,8 +6421,8 @@ test_select_hyper_union_random_5d(hid_t read_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_union_random_5d() */ /**************************************************************** @@ -6463,10 +6463,10 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) MESSAGE(5, ("Testing Hyperslab I/O on Large Chunks\n")); /* Allocate the transfer buffers */ - data = (short *)HDmalloc(sizeof(short) * X * Y * Z); - CHECK_PTR(data, "HDmalloc"); - data_out = (short *)HDcalloc((size_t)(NX * NY * NZ), sizeof(short)); - CHECK_PTR(data_out, "HDcalloc"); + data = (short *)malloc(sizeof(short) * X * Y * Z); + CHECK_PTR(data, "malloc"); + data_out = (short *)calloc((size_t)(NX * NY * NZ), sizeof(short)); + CHECK_PTR(data_out, "calloc"); /* * Data buffer initialization. @@ -6647,8 +6647,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) CHECK(status, FAIL, "H5Sclose"); status = H5Fclose(file); CHECK(status, FAIL, "H5Fclose"); - HDfree(data); - HDfree(data_out); + free(data); + free(data_out); } /* test_select_hyper_chunk() */ /**************************************************************** @@ -6689,10 +6689,10 @@ test_select_point_chunk(void) MESSAGE(5, ("Testing Point Selections on Chunked Datasets\n")); /* Allocate the transfer buffers */ - data = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(data, "HDmalloc"); - data_out = (unsigned *)HDcalloc((size_t)(SPACE7_DIM1 * SPACE7_DIM2), sizeof(unsigned)); - CHECK_PTR(data_out, "HDcalloc"); + data = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(data, "malloc"); + data_out = (unsigned *)calloc((size_t)(SPACE7_DIM1 * SPACE7_DIM2), sizeof(unsigned)); + CHECK_PTR(data_out, "calloc"); /* * Data buffer initialization. @@ -6845,8 +6845,8 @@ test_select_point_chunk(void) ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - HDfree(data); - HDfree(data_out); + free(data); + free(data_out); } /* test_select_point_chunk() */ /**************************************************************** @@ -7468,8 +7468,8 @@ test_select_fill_all(void) MESSAGE(5, ("Testing Filling 'all' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7516,7 +7516,7 @@ test_select_fill_all(void) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_all() */ /**************************************************************** @@ -7544,8 +7544,8 @@ test_select_fill_point(hssize_t *offset) MESSAGE(5, ("Testing Filling 'point' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7614,7 +7614,7 @@ test_select_fill_point(hssize_t *offset) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_point() */ /**************************************************************** @@ -7644,8 +7644,8 @@ test_select_fill_hyper_simple(hssize_t *offset) MESSAGE(5, ("Testing Filling Simple 'hyperslab' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7720,7 +7720,7 @@ test_select_fill_hyper_simple(hssize_t *offset) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_hyper_simple() */ /**************************************************************** @@ -7755,8 +7755,8 @@ test_select_fill_hyper_regular(hssize_t *offset) MESSAGE(5, ("Testing Filling Regular 'hyperslab' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7833,7 +7833,7 @@ test_select_fill_hyper_regular(hssize_t *offset) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_hyper_regular() */ /**************************************************************** @@ -7875,8 +7875,8 @@ test_select_fill_hyper_irregular(hssize_t *offset) MESSAGE(5, ("Testing Filling Irregular 'hyperslab' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7957,7 +7957,7 @@ test_select_fill_hyper_irregular(hssize_t *offset) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_hyper_irregular() */ /**************************************************************** @@ -7984,10 +7984,10 @@ test_select_none(void) MESSAGE(5, ("Testing I/O on 0-sized Selections\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE7_DIM1; i++) @@ -8054,8 +8054,8 @@ test_select_none(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_none() */ /**************************************************************** @@ -8087,10 +8087,10 @@ test_scalar_select(void) MESSAGE(5, ("Testing I/O on Selections in Scalar Dataspaces\n")); /* Allocate write & read buffers */ - wbuf_uint8 = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf_uint8, "HDmalloc"); - wbuf_ushort = (unsigned short *)HDmalloc(sizeof(unsigned short) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf_ushort, "HDmalloc"); + wbuf_uint8 = (uint8_t *)malloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf_uint8, "malloc"); + wbuf_ushort = (unsigned short *)malloc(sizeof(unsigned short) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf_ushort, "malloc"); /* Initialize write buffers */ for (i = 0, tbuf_uint8 = wbuf_uint8, tbuf_ushort = wbuf_ushort; i < SPACE7_DIM1; i++) @@ -8213,8 +8213,8 @@ test_scalar_select(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf_uint8); - HDfree(wbuf_ushort); + free(wbuf_uint8); + free(wbuf_ushort); } /* test_scalar_select() */ /**************************************************************** @@ -13592,10 +13592,10 @@ test_select_hyper_chunk_offset(void) MESSAGE(6, ("Testing hyperslab selections using offsets in chunked datasets\n")); /* Allocate buffers */ - wbuf = (int *)HDmalloc(sizeof(int) * SPACE10_DIM1); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (int *)HDcalloc(sizeof(int), SPACE10_DIM1); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (int *)malloc(sizeof(int) * SPACE10_DIM1); + CHECK_PTR(wbuf, "malloc"); + rbuf = (int *)calloc(sizeof(int), SPACE10_DIM1); + CHECK_PTR(rbuf, "calloc"); /* Initialize the write buffer */ for (i = 0; i < SPACE10_DIM1; i++) @@ -13775,8 +13775,8 @@ test_select_hyper_chunk_offset(void) CHECK(ret, FAIL, "H5Fclose"); /* Free the buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_chunk_offset() */ #endif /**************************************************************** diff --git a/test/API/tvlstr.c b/test/API/tvlstr.c index 35d5358..427ae7b 100644 --- a/test/API/tvlstr.c +++ b/test/API/tvlstr.c @@ -64,7 +64,7 @@ test_vlstr_alloc_custom(size_t size, void *info) */ extra = MAX(sizeof(void *), sizeof(size_t)); - if ((ret_value = HDmalloc(extra + size)) != NULL) { + if ((ret_value = malloc(extra + size)) != NULL) { *(size_t *)ret_value = size; *mem_used += size; } /* end if */ @@ -96,7 +96,7 @@ test_vlstr_free_custom(void *_mem, void *info) if (_mem != NULL) { mem = ((unsigned char *)_mem) - extra; *mem_used -= *(size_t *)((void *)mem); - HDfree(mem); + free(mem); } /* end if */ } @@ -162,7 +162,7 @@ test_vlstrings_basic(void) dataset2 = H5Dcreate2(fid1, "Dataset2", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate2"); - wdata2 = (char *)HDcalloc((size_t)65534, sizeof(char)); + wdata2 = (char *)calloc((size_t)65534, sizeof(char)); HDmemset(wdata2, 'A', (size_t)65533); ret = H5Dwrite(dataset2, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2); @@ -170,7 +170,7 @@ test_vlstrings_basic(void) H5Sclose(dataspace); H5Dclose(dataset2); - HDfree(wdata2); + free(wdata2); /* Change to the custom memory allocation routines for reading VL string */ xfer_pid = H5Pcreate(H5P_DATASET_XFER); @@ -625,7 +625,7 @@ test_write_vl_string_attribute(void) att = H5Acreate2(root, "test_scalar_large", type, dataspace, H5P_DEFAULT, H5P_DEFAULT); CHECK(att, FAIL, "H5Acreate2"); - string_att_write = (char *)HDcalloc((size_t)8192, sizeof(char)); + string_att_write = (char *)calloc((size_t)8192, sizeof(char)); HDmemset(string_att_write, 'A', (size_t)8191); ret = H5Awrite(att, type, &string_att_write); @@ -642,7 +642,7 @@ test_write_vl_string_attribute(void) string_att_check = NULL; /* The attribute string written is freed below, in the test_read_vl_string_attribute() test */ - /* HDfree(string_att_write); */ + /* free(string_att_write); */ ret = H5Aclose(att); CHECK(ret, FAIL, "HAclose"); @@ -723,7 +723,7 @@ test_read_vl_string_attribute(void) /* Free string allocated in test_write_vl_string_attribute */ if (string_att_write) - HDfree(string_att_write); + free(string_att_write); ret = H5Aclose(att); CHECK(ret, FAIL, "HAclose"); diff --git a/test/API/tvltypes.c b/test/API/tvltypes.c index a17589b..30063e0 100644 --- a/test/API/tvltypes.c +++ b/test/API/tvltypes.c @@ -63,7 +63,7 @@ test_vltypes_alloc_custom(size_t size, void *mem_used) * DEC Alpha to keep the alignment correct - QAK) */ - if ((ret_value = HDmalloc(extra + size)) != NULL) { + if ((ret_value = malloc(extra + size)) != NULL) { *(size_t *)ret_value = size; *(size_t *)mem_used += size; } /* end if */ @@ -93,7 +93,7 @@ test_vltypes_free_custom(void *_mem, void *mem_used) unsigned char *mem = ((unsigned char *)_mem) - extra; /* Pointer to actual block allocated */ *(size_t *)mem_used -= *(size_t *)((void *)mem); - HDfree(mem); + free(mem); } /* end if */ } @@ -257,7 +257,7 @@ test_vltypes_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(unsigned int)); + wdata[i].p = malloc((i + 1) * sizeof(unsigned int)); wdata[i].len = i + 1; for (j = 0; j < (i + 1); j++) ((unsigned int *)wdata[i].p)[j] = i * 10 + j; @@ -588,7 +588,7 @@ rewrite_vltypes_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + increment) * sizeof(unsigned int)); + wdata[i].p = malloc((i + increment) * sizeof(unsigned int)); wdata[i].len = i + increment; for (j = 0; j < (i + increment); j++) ((unsigned int *)wdata[i].p)[j] = i * 20 + j; @@ -750,7 +750,7 @@ test_vltypes_vlen_compound(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(s1)); + wdata[i].p = malloc((i + 1) * sizeof(s1)); wdata[i].len = i + 1; for (j = 0; j < (i + 1); j++) { ((s1 *)wdata[i].p)[j].i = (int)(i * 10 + j); @@ -902,7 +902,7 @@ rewrite_vltypes_vlen_compound(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + increment) * sizeof(s1)); + wdata[i].p = malloc((i + increment) * sizeof(s1)); wdata[i].len = i + increment; for (j = 0; j < (i + increment); j++) { ((s1 *)wdata[i].p)[j].i = (int)(i * 40 + j); @@ -1051,17 +1051,17 @@ test_vltypes_compound_vlen_vlen(void) MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n")); /* Allocate and initialize VL data to write */ - wdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK_PTR(wdata, "HDmalloc"); - rdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK_PTR(rdata, "HDmalloc"); + wdata = (s1 *)malloc(sizeof(s1) * SPACE3_DIM1); + CHECK_PTR(wdata, "malloc"); + rdata = (s1 *)malloc(sizeof(s1) * SPACE3_DIM1); + CHECK_PTR(rdata, "malloc"); for (i = 0; i < SPACE3_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)(i * 20) / 3.0F; - wdata[i].v.p = HDmalloc((i + L1_INCM) * sizeof(hvl_t)); + wdata[i].v.p = malloc((i + L1_INCM) * sizeof(hvl_t)); wdata[i].v.len = i + L1_INCM; for (t1 = (hvl_t *)((wdata[i].v).p), j = 0; j < (i + L1_INCM); j++, t1++) { - t1->p = HDmalloc((j + L2_INCM) * sizeof(unsigned int)); + t1->p = malloc((j + L2_INCM) * sizeof(unsigned int)); t1->len = j + L2_INCM; for (k = 0; k < j + L2_INCM; k++) ((unsigned int *)t1->p)[k] = i * 100 + j * 10 + k; @@ -1193,8 +1193,8 @@ test_vltypes_compound_vlen_vlen(void) CHECK(ret, FAIL, "H5Fclose"); /* Release buffers */ - HDfree(wdata); - HDfree(rdata); + free(wdata); + free(rdata); } /* end test_vltypes_compound_vlen_vlen() */ /**************************************************************** @@ -1241,11 +1241,11 @@ test_vltypes_compound_vlstr(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].v.p = (s2 *)HDmalloc((i + L3_INCM) * sizeof(s2)); + wdata[i].v.p = (s2 *)malloc((i + L3_INCM) * sizeof(s2)); wdata[i].v.len = i + L3_INCM; for (t1 = (s2 *)((wdata[i].v).p), j = 0; j < (i + L3_INCM); j++, t1++) { HDstrcat(str, "m"); - t1->string = (char *)HDmalloc(HDstrlen(str) * sizeof(char) + 1); + t1->string = (char *)malloc(HDstrlen(str) * sizeof(char) + 1); HDstrcpy(t1->string, str); /*t1->color = red;*/ t1->color = blue; @@ -1411,11 +1411,11 @@ test_vltypes_compound_vlstr(void) /* Use this part for new data */ HDstrcpy(str, "bbbbbbbb\0"); for (i = 0; i < SPACE1_DIM1; i++) { - wdata2[i].v.p = (s2 *)HDmalloc((i + 1) * sizeof(s2)); + wdata2[i].v.p = (s2 *)malloc((i + 1) * sizeof(s2)); wdata2[i].v.len = i + 1; for (t1 = (s2 *)(wdata2[i].v).p, j = 0; j < i + 1; j++, t1++) { HDstrcat(str, "pp"); - t1->string = (char *)HDmalloc(HDstrlen(str) * sizeof(char) + 1); + t1->string = (char *)malloc(HDstrlen(str) * sizeof(char) + 1); HDstrcpy(t1->string, str); t1->color = green; } @@ -1529,7 +1529,7 @@ test_vltypes_compound_vlen_atomic(void) for (i = 0; i < SPACE1_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)(i * 20) / 3.0F; - wdata[i].v.p = HDmalloc((i + 1) * sizeof(unsigned int)); + wdata[i].v.p = malloc((i + 1) * sizeof(unsigned int)); wdata[i].v.len = i + 1; for (j = 0; j < (i + 1); j++) ((unsigned int *)wdata[i].v.p)[j] = i * 10 + j; @@ -1763,7 +1763,7 @@ rewrite_vltypes_compound_vlen_atomic(void) for (i = 0; i < SPACE1_DIM1; i++) { wdata[i].i = (int)(i * 40); wdata[i].f = (float)(i * 50) / 3.0F; - wdata[i].v.p = HDmalloc((i + increment) * sizeof(unsigned int)); + wdata[i].v.p = malloc((i + increment) * sizeof(unsigned int)); wdata[i].v.len = i + increment; for (j = 0; j < (i + increment); j++) ((unsigned int *)wdata[i].v.p)[j] = i * 60 + j; @@ -1937,14 +1937,14 @@ test_vltypes_vlen_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(hvl_t)); + wdata[i].p = malloc((i + 1) * sizeof(hvl_t)); if (wdata[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + 1; for (t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + 1); j++, t1++) { - t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); + t1->p = malloc((j + 1) * sizeof(unsigned int)); if (t1->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return; @@ -2138,14 +2138,14 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + increment) * sizeof(hvl_t)); + wdata[i].p = malloc((i + increment) * sizeof(hvl_t)); if (wdata[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + increment; for (t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + increment); j++, t1++) { - t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); + t1->p = malloc((j + 1) * sizeof(unsigned int)); if (t1->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return; @@ -2318,14 +2318,14 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + increment) * sizeof(hvl_t)); + wdata[i].p = malloc((i + increment) * sizeof(hvl_t)); if (wdata[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + increment; for (t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + increment); j++, t1++) { - t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); + t1->p = malloc((j + 1) * sizeof(unsigned int)); if (t1->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return; @@ -2594,8 +2594,8 @@ test_vltypes_fill_value(void) CHECK(ret, FAIL, "H5Tclose"); /* Allocate space for the buffer to read data */ - rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); - CHECK_PTR(rbuf, "HDmalloc"); + rbuf = (dtype1_struct *)malloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); + CHECK_PTR(rbuf, "malloc"); /* Create the small & large dataspaces to use */ small_dspace_id = H5Screate_simple(SPACE4_RANK, small_dims, NULL); @@ -3215,7 +3215,7 @@ test_vltypes_fill_value(void) CHECK(ret, FAIL, "H5Tclose"); /* Release buffer */ - HDfree(rbuf); + free(rbuf); } /* end test_vltypes_fill_value() */ /**************************************************************** diff --git a/test/accum.c b/test/accum.c index 85e6179..9033380 100644 --- a/test/accum.c +++ b/test/accum.c @@ -192,9 +192,9 @@ test_write_read(H5F_t *f) TESTING("simple write/read to/from metadata accumulator"); /* Allocate buffers */ - write_buf = (int *)HDmalloc(1024 * sizeof(int)); + write_buf = (int *)malloc(1024 * sizeof(int)); assert(write_buf); - read_buf = (int *)HDcalloc((size_t)1024, sizeof(int)); + read_buf = (int *)calloc((size_t)1024, sizeof(int)); assert(read_buf); /* Fill buffer with data, zero out read buffer */ @@ -216,15 +216,15 @@ test_write_read(H5F_t *f) PASSED(); /* Release memory */ - HDfree(write_buf); - HDfree(read_buf); + free(write_buf); + free(read_buf); return 0; error: /* Release memory */ - HDfree(write_buf); - HDfree(read_buf); + free(write_buf); + free(read_buf); return 1; } /* test_write_read */ @@ -251,9 +251,9 @@ test_write_read_nonacc_front(H5F_t *f) TESTING("simple write/read to/from before metadata accumulator"); /* Allocate buffers */ - write_buf = (int *)HDmalloc(2048 * sizeof(int)); + write_buf = (int *)malloc(2048 * sizeof(int)); assert(write_buf); - read_buf = (int *)HDcalloc((size_t)2048, sizeof(int)); + read_buf = (int *)calloc((size_t)2048, sizeof(int)); assert(read_buf); /* Fill buffer with data, zero out read buffer */ @@ -281,15 +281,15 @@ test_write_read_nonacc_front(H5F_t *f) PASSED(); /* Release memory */ - HDfree(write_buf); - HDfree(read_buf); + free(write_buf); + free(read_buf); return 0; error: /* Release memory */ - HDfree(write_buf); - HDfree(read_buf); + free(write_buf); + free(read_buf); return 1; } /* test_write_read */ @@ -316,9 +316,9 @@ test_write_read_nonacc_end(H5F_t *f) TESTING("simple write/read to/from after metadata accumulator"); /* Allocate buffers */ - write_buf = (int *)HDmalloc(2048 * sizeof(int)); + write_buf = (int *)malloc(2048 * sizeof(int)); assert(write_buf); - read_buf = (int *)HDcalloc((size_t)2048, sizeof(int)); + read_buf = (int *)calloc((size_t)2048, sizeof(int)); assert(read_buf); /* Fill buffer with data, zero out read buffer */ @@ -346,15 +346,15 @@ test_write_read_nonacc_end(H5F_t *f) PASSED(); /* Release memory */ - HDfree(write_buf); - HDfree(read_buf); + free(write_buf); + free(read_buf); return 0; error: /* Release memory */ - HDfree(write_buf); - HDfree(read_buf); + free(write_buf); + free(read_buf); return 1; } /* test_write_read */ @@ -383,11 +383,11 @@ test_free(H5F_t *f) TESTING("simple freeing metadata accumulator"); /* Write and free the whole accumulator. */ - wbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t)); + wbuf = (int32_t *)malloc(256 * sizeof(int32_t)); assert(wbuf); - rbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t)); + rbuf = (int32_t *)malloc(256 * sizeof(int32_t)); assert(rbuf); - expect = (int32_t *)HDmalloc(256 * sizeof(int32_t)); + expect = (int32_t *)malloc(256 * sizeof(int32_t)); assert(expect); /* Fill buffer with data */ @@ -565,11 +565,11 @@ test_free(H5F_t *f) if (HDmemcmp(expect + 76, rbuf, 116 * sizeof(int32_t)) != 0) TEST_ERROR; - HDfree(wbuf); + free(wbuf); wbuf = NULL; - HDfree(rbuf); + free(rbuf); rbuf = NULL; - HDfree(expect); + free(expect); expect = NULL; if (accum_reset(f) < 0) @@ -581,11 +581,11 @@ test_free(H5F_t *f) error: if (wbuf) - HDfree(wbuf); + free(wbuf); if (rbuf) - HDfree(rbuf); + free(rbuf); if (expect) - HDfree(expect); + free(expect); return 1; } /* test_free */ @@ -614,9 +614,9 @@ test_accum_overlap(H5F_t *f) TESTING("overlapping write to metadata accumulator"); /* Allocate buffers */ - wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t)); + wbuf = (int32_t *)malloc(4096 * sizeof(int32_t)); assert(wbuf); - rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t)); + rbuf = (int32_t *)calloc((size_t)4096, sizeof(int32_t)); assert(rbuf); /* Case 1: No metadata in accumulator */ @@ -783,15 +783,15 @@ test_accum_overlap(H5F_t *f) PASSED(); /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 0; error: /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 1; } /* test_accum_overlap */ @@ -821,9 +821,9 @@ test_accum_overlap_clean(H5F_t *f) TESTING("overlapping write to partially clean metadata accumulator"); /* Allocate buffers */ - wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t)); + wbuf = (int32_t *)malloc(4096 * sizeof(int32_t)); assert(wbuf); - rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t)); + rbuf = (int32_t *)calloc((size_t)4096, sizeof(int32_t)); assert(rbuf); /* Case 1: No metadata in accumulator */ @@ -1003,15 +1003,15 @@ test_accum_overlap_clean(H5F_t *f) PASSED(); /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 0; error: /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 1; } /* test_accum_overlap_clean */ @@ -1040,9 +1040,9 @@ test_accum_non_overlap_size(H5F_t *f) TESTING("non-overlapping write to accumulator larger then accum_size"); /* Allocate buffers */ - wbuf = (int *)HDmalloc(4096 * sizeof(int32_t)); + wbuf = (int *)malloc(4096 * sizeof(int32_t)); assert(wbuf); - rbuf = (int *)HDcalloc((size_t)4096, sizeof(int32_t)); + rbuf = (int *)calloc((size_t)4096, sizeof(int32_t)); assert(rbuf); /* Case 1: No metadata in accumulator */ @@ -1076,15 +1076,15 @@ test_accum_non_overlap_size(H5F_t *f) PASSED(); /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 0; error: /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 1; } /* test_accum_non_overlap_size */ @@ -1114,9 +1114,9 @@ test_accum_overlap_size(H5F_t *f) TESTING("overlapping write to accumulator larger then accum_size"); /* Allocate buffers */ - wbuf = (int32_t *)HDmalloc(4096 * sizeof(int32_t)); + wbuf = (int32_t *)malloc(4096 * sizeof(int32_t)); assert(wbuf); - rbuf = (int32_t *)HDcalloc((size_t)4096, sizeof(int32_t)); + rbuf = (int32_t *)calloc((size_t)4096, sizeof(int32_t)); assert(rbuf); /* Case 1: No metadata in accumulator */ @@ -1150,15 +1150,15 @@ test_accum_overlap_size(H5F_t *f) PASSED(); /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 0; error: /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 1; } /* test_accum_overlap_size */ @@ -1199,9 +1199,9 @@ test_accum_adjust(H5F_t *f) TESTING("accumulator adjustments after append/prepend of data"); /* Allocate buffers */ - wbuf = (int32_t *)HDmalloc((size_t)s * sizeof(int32_t)); + wbuf = (int32_t *)malloc((size_t)s * sizeof(int32_t)); assert(wbuf); - rbuf = (int32_t *)HDcalloc((size_t)s, sizeof(int32_t)); + rbuf = (int32_t *)calloc((size_t)s, sizeof(int32_t)); assert(rbuf); /* Fill up write buffer */ @@ -1456,15 +1456,15 @@ test_accum_adjust(H5F_t *f) PASSED(); /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 0; error: /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 1; } /* test_accum_adjust */ @@ -1497,9 +1497,9 @@ test_read_after(H5F_t *f) TESTING("reading data from both accumulator and disk"); /* Allocate buffers */ - wbuf = (int32_t *)HDmalloc((size_t)s * sizeof(int32_t)); + wbuf = (int32_t *)malloc((size_t)s * sizeof(int32_t)); assert(wbuf); - rbuf = (int32_t *)HDcalloc((size_t)s, sizeof(int32_t)); + rbuf = (int32_t *)calloc((size_t)s, sizeof(int32_t)); assert(rbuf); /* Fill up write buffer with 1s */ @@ -1545,15 +1545,15 @@ test_read_after(H5F_t *f) PASSED(); /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 0; error: /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); return 1; } /* end test_read_after */ @@ -1579,13 +1579,13 @@ test_big(H5F_t *f) unsigned u; /* Local index variable */ /* Allocate space for the write & read buffers */ - wbuf = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE); + wbuf = (uint8_t *)malloc((size_t)BIG_BUF_SIZE); assert(wbuf); - wbuf2 = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE); + wbuf2 = (uint8_t *)malloc((size_t)BIG_BUF_SIZE); assert(wbuf2); - rbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1); + rbuf = (uint8_t *)calloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1); assert(rbuf); - zbuf = (uint8_t *)HDcalloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1); + zbuf = (uint8_t *)calloc((size_t)(BIG_BUF_SIZE + 1536), (size_t)1); assert(zbuf); /* Initialize write buffers */ @@ -1907,18 +1907,18 @@ test_big(H5F_t *f) PASSED(); /* Release memory */ - HDfree(wbuf); - HDfree(wbuf2); - HDfree(rbuf); - HDfree(zbuf); + free(wbuf); + free(wbuf2); + free(rbuf); + free(zbuf); return 0; error: - HDfree(wbuf); - HDfree(wbuf2); - HDfree(rbuf); - HDfree(zbuf); + free(wbuf); + free(wbuf2); + free(rbuf); + free(zbuf); return 1; } /* end test_big() */ @@ -1950,9 +1950,9 @@ test_random_write(H5F_t *f) unsigned u; /* Local index variable */ /* Allocate space for the write & read buffers */ - wbuf = (uint8_t *)HDmalloc((size_t)RANDOM_BUF_SIZE); + wbuf = (uint8_t *)malloc((size_t)RANDOM_BUF_SIZE); assert(wbuf); - rbuf = (uint8_t *)HDcalloc((size_t)RANDOM_BUF_SIZE, (size_t)1); + rbuf = (uint8_t *)calloc((size_t)RANDOM_BUF_SIZE, (size_t)1); assert(rbuf); /* Initialize write buffer */ @@ -1970,9 +1970,9 @@ fprintf(stderr, "Random # seed was: %u\n", seed); HDsrandom(seed); /* Allocate space for the segment length buffer */ - off = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); + off = (size_t *)malloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); assert(off); - len = (size_t *)HDmalloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); + len = (size_t *)malloc(MAX_RANDOM_SEGMENTS * sizeof(size_t)); assert(len); /* Randomly choose lengths of segments */ @@ -2053,19 +2053,19 @@ fprintf(stderr, "Random # seed was: %u\n", seed); PASSED(); /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(off); - HDfree(len); + free(wbuf); + free(rbuf); + free(off); + free(len); return 0; error: /* Release memory */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(off); - HDfree(len); + free(wbuf); + free(rbuf); + free(off); + free(len); fprintf(stderr, "Random # seed was: %u\n", seed); return 1; @@ -2176,9 +2176,9 @@ test_swmr_write_big(hbool_t newest_format) FAIL_STACK_ERROR; /* Allocate space for the write & read buffers */ - if ((wbuf2 = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE)) == NULL) + if ((wbuf2 = (uint8_t *)malloc((size_t)BIG_BUF_SIZE)) == NULL) FAIL_STACK_ERROR; - if ((rbuf = (uint8_t *)HDmalloc((size_t)BIG_BUF_SIZE)) == NULL) + if ((rbuf = (uint8_t *)malloc((size_t)BIG_BUF_SIZE)) == NULL) FAIL_STACK_ERROR; /* Initialize wbuf with "0, 1, 2...1024"*/ @@ -2309,9 +2309,9 @@ test_swmr_write_big(hbool_t newest_format) /* Release memory */ if (wbuf2) - HDfree(wbuf2); + free(wbuf2); if (rbuf) - HDfree(rbuf); + free(rbuf); PASSED(); return 0; @@ -2327,9 +2327,9 @@ error: /* Release memory */ if (wbuf2) - HDfree(wbuf2); + free(wbuf2); if (rbuf) - HDfree(rbuf); + free(rbuf); return 1; diff --git a/test/big.c b/test/big.c index 07f16fa..c582094 100644 --- a/test/big.c +++ b/test/big.c @@ -322,7 +322,7 @@ writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n) hsize_t hs_start[1]; hsize_t hs_size[1]; hid_t file = -1, space1 = -1, space2 = -1, mem_space = -1, d1 = -1, d2 = -1; - int *buf = (int *)HDmalloc(sizeof(int) * WRT_SIZE); + int *buf = (int *)malloc(sizeof(int) * WRT_SIZE); int i, j; FILE *out = HDfopen(DNAME, "w"); hid_t dcpl; @@ -426,7 +426,7 @@ writer(char *filename, hid_t fapl, fsizes_t testsize, int wrt_n) goto error; if (H5Fclose(file) < 0) goto error; - HDfree(buf); + free(buf); HDfclose(out); PASSED(); return 0; @@ -443,7 +443,7 @@ error: } H5E_END_TRY if (buf) - HDfree(buf); + free(buf); if (out) HDfclose(out); return 1; @@ -471,7 +471,7 @@ reader(char *filename, hid_t fapl) char ln[128], *s; hsize_t hs_offset[1]; hsize_t hs_size[1] = {WRT_SIZE}; - int *buf = (int *)HDmalloc(sizeof(int) * WRT_SIZE); + int *buf = (int *)malloc(sizeof(int) * WRT_SIZE); int i, j, zero, wrong, nerrors = 0; /* Open script file */ @@ -534,7 +534,7 @@ reader(char *filename, hid_t fapl) FAIL_STACK_ERROR; if (H5Fclose(file) < 0) FAIL_STACK_ERROR; - HDfree(buf); + free(buf); HDfclose(script); return nerrors; @@ -549,7 +549,7 @@ error: } H5E_END_TRY if (buf) - HDfree(buf); + free(buf); if (script) HDfclose(script); return 1; diff --git a/test/btree2.c b/test/btree2.c index 7169f3e..500d523 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -3018,7 +3018,7 @@ fprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TESTING("B-tree insert: create random level 4 B-tree"); /* Allocate space for the records */ - if (NULL == (records = (hsize_t *)HDmalloc(sizeof(hsize_t) * INSERT_MANY))) + if (NULL == (records = (hsize_t *)malloc(sizeof(hsize_t) * INSERT_MANY))) TEST_ERROR; /* Initialize record #'s */ @@ -3198,7 +3198,7 @@ fprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); PASSED(); - HDfree(records); + free(records); return 0; @@ -3210,7 +3210,7 @@ error: H5Fclose(file); } H5E_END_TRY - HDfree(records); + free(records); return 1; } /* test_insert_lots() */ @@ -5112,7 +5112,7 @@ fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TESTING("B-tree update: create random level 4 B-tree"); /* Allocate space for the records */ - if (NULL == (records = (H5B2_test_rec_t *)HDmalloc(sizeof(H5B2_test_rec_t) * INSERT_MANY_REC))) + if (NULL == (records = (H5B2_test_rec_t *)malloc(sizeof(H5B2_test_rec_t) * INSERT_MANY_REC))) TEST_ERROR; /* Initialize record #'s */ @@ -5300,7 +5300,7 @@ fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); PASSED(); - HDfree(records); + free(records); return 0; @@ -5313,7 +5313,7 @@ error: H5Fclose(file); } H5E_END_TRY - HDfree(records); + free(records); return 1; } /* test_update_lots() */ @@ -8823,7 +8823,7 @@ fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); */ /* Allocate space for the records */ - if (NULL == (records = (hsize_t *)HDmalloc(sizeof(hsize_t) * INSERT_MANY))) + if (NULL == (records = (hsize_t *)malloc(sizeof(hsize_t) * INSERT_MANY))) TEST_ERROR; /* Initialize record #'s */ @@ -8861,7 +8861,7 @@ fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); TEST_ERROR; /* Allocate space for the file data */ - if (NULL == (file_data = HDmalloc((size_t)sb.st_size))) + if (NULL == (file_data = malloc((size_t)sb.st_size))) TEST_ERROR; /* Read file's data into memory */ @@ -9192,9 +9192,9 @@ fprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time); PASSED(); if (records) - HDfree(records); + free(records); if (file_data) - HDfree(file_data); + free(file_data); return 0; @@ -9210,9 +9210,9 @@ error: if (fd > 0) HDclose(fd); if (records) - HDfree(records); + free(records); if (file_data) - HDfree(file_data); + free(file_data); return 1; } /* test_remove_lots() */ @@ -9246,7 +9246,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param herr_t ret; /* Generic error return value */ /* Allocate space for the records */ - if (NULL == (records = (hsize_t *)HDmalloc(sizeof(hsize_t) * FIND_NEIGHBOR))) + if (NULL == (records = (hsize_t *)malloc(sizeof(hsize_t) * FIND_NEIGHBOR))) TEST_ERROR; /* Initialize record #'s */ @@ -9426,7 +9426,7 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam, const bt2_test_param PASSED(); - HDfree(records); + free(records); return 0; @@ -9438,7 +9438,7 @@ error: H5Fclose(file); } H5E_END_TRY - HDfree(records); + free(records); return 1; } /* test_find_neighbor() */ diff --git a/test/cache.c b/test/cache.c index ecd6578..418c8d5 100644 --- a/test/cache.c +++ b/test/cache.c @@ -4737,14 +4737,14 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) failure_mssg = "cache not empty at beginning of flush ops test."; } - spec = HDmalloc((size_t)max_num_spec * sizeof(struct fo_flush_cache_test_spec)); + spec = malloc((size_t)max_num_spec * sizeof(struct fo_flush_cache_test_spec)); if (spec == NULL) { pass = FALSE; failure_mssg = "couldn't allocate flush ops test spec array"; } - checks = HDmalloc((size_t)max_num_check * sizeof(struct fo_flush_entry_check)); + checks = malloc((size_t)max_num_check * sizeof(struct fo_flush_entry_check)); if (checks == NULL) { pass = FALSE; @@ -8060,8 +8060,8 @@ check_flush_cache__flush_ops(H5F_t *file_ptr) reset_entries(); } - HDfree(checks); - HDfree(spec); + free(checks); + free(spec); /* finally finish up with the flush ops eviction test */ check_flush_cache__flush_op_eviction_test(file_ptr); @@ -8356,7 +8356,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t *file_ptr) test_entry_t *entry_ptr; test_entry_t *base_addr; - expected = HDmalloc((size_t)num_total_entries * sizeof(struct expected_entry_status)); + expected = malloc((size_t)num_total_entries * sizeof(struct expected_entry_status)); if (expected == NULL) { pass = FALSE; @@ -9574,7 +9574,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t *file_ptr) reset_entries(); } - HDfree(expected); + free(expected); } /* check_flush_cache__flush_op_eviction_test() */ @@ -10640,7 +10640,7 @@ check_flush_cache__single_entry(H5F_t *file_ptr) struct pinned_single_entry_test_spec *spec = NULL; size_t i; - spec = HDmalloc(256 * sizeof(struct pinned_single_entry_test_spec)); + spec = malloc(256 * sizeof(struct pinned_single_entry_test_spec)); if (spec == NULL) { pass = FALSE; @@ -10758,7 +10758,7 @@ check_flush_cache__single_entry(H5F_t *file_ptr) i++; } - HDfree(spec); + free(spec); } } /* check_flush_cache__single_entry() */ @@ -25343,7 +25343,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) */ hbool_t deserialized = (hbool_t) !(fill_via_insertion); - expected = HDmalloc(150 * sizeof(struct expected_entry_status)); + expected = malloc(150 * sizeof(struct expected_entry_status)); if (expected == NULL) { pass = FALSE; @@ -26019,7 +26019,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) if (show_progress) /* 12 */ fprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); - HDfree(expected); + free(expected); if (pass) { PASSED(); @@ -31200,7 +31200,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) */ hbool_t deserialized = (hbool_t) !(fill_via_insertion); - expected = HDmalloc(150 * sizeof(struct expected_entry_status)); + expected = malloc(150 * sizeof(struct expected_entry_status)); if (expected == NULL) { pass = FALSE; @@ -31744,7 +31744,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) if (show_progress) /* 13 */ fprintf(stdout, "%s: check point %d -- pass %d\n", fcn_name, checkpoint++, pass); - HDfree(expected); + free(expected); if (pass) { PASSED(); @@ -31884,7 +31884,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t *file_ptr) H5C_t *cache_ptr = file_ptr->shared->cache; int i; - expected = HDmalloc(36 * sizeof(struct expected_entry_status)); + expected = malloc(36 * sizeof(struct expected_entry_status)); if (expected == NULL) { pass = FALSE; @@ -32078,7 +32078,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t *file_ptr) /* reset cache min clean size to its expected value */ cache_ptr->min_clean_size = (1 * 1024 * 1024); - HDfree(expected); + free(expected); } /* cedds__expunge_dirty_entry_in_flush_test() */ @@ -32118,7 +32118,7 @@ cedds__H5C_make_space_in_cache(H5F_t *file_ptr) const int num_huge_entries = 4; const int num_monster_entries = 32; - expected = HDmalloc(36 * sizeof(struct expected_entry_status)); + expected = malloc(36 * sizeof(struct expected_entry_status)); if (expected == NULL) { pass = FALSE; @@ -32432,7 +32432,7 @@ cedds__H5C_make_space_in_cache(H5F_t *file_ptr) /* reset cache min clean size to its expected value */ cache_ptr->min_clean_size = (1 * 1024 * 1024); - HDfree(expected); + free(expected); } /* cedds__H5C_make_space_in_cache() */ @@ -32513,7 +32513,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr) /* hbool_t apply_empty_reserve = */ TRUE, /* double empty_reserve = */ 0.05}; - expected = HDmalloc(36 * sizeof(struct expected_entry_status)); + expected = malloc(36 * sizeof(struct expected_entry_status)); if (expected == NULL) { pass = FALSE; @@ -32823,7 +32823,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *file_ptr) /* reset cache min clean size to its expected value */ cache_ptr->min_clean_size = (1 * 1024 * 1024); - HDfree(expected); + free(expected); } /* cedds__H5C__autoadjust__ageout__evict_aged_out_entries() */ diff --git a/test/cache_api.c b/test/cache_api.c index 413232e..d01f135 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1455,8 +1455,7 @@ init_invalid_configs(void) H5AC_cache_config_t *configs = NULL; /* Allocate memory */ - if (NULL == - (configs = (H5AC_cache_config_t *)HDcalloc(NUM_INVALID_CONFIGS, sizeof(H5AC_cache_config_t)))) { + if (NULL == (configs = (H5AC_cache_config_t *)calloc(NUM_INVALID_CONFIGS, sizeof(H5AC_cache_config_t)))) { return NULL; } @@ -2238,7 +2237,7 @@ main(void) nerrs += 1; if (invalid_configs) - HDfree(invalid_configs); + free(invalid_configs); if (H5Pclose(fcpl_id) < 0) { failure_mssg = "H5Pclose() failed.\n"; diff --git a/test/cache_common.c b/test/cache_common.c index 454d194..1d664ff 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1848,70 +1848,69 @@ create_entry_arrays(void) { /* pico entries */ - if (NULL == (pico_entries = (test_entry_t *)HDcalloc(NUM_PICO_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (pico_entries = (test_entry_t *)calloc(NUM_PICO_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_pico_entries = (test_entry_t *)HDcalloc(NUM_PICO_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_pico_entries = (test_entry_t *)calloc(NUM_PICO_ENTRIES, sizeof(test_entry_t)))) goto error; /* nano entries */ - if (NULL == (nano_entries = (test_entry_t *)HDcalloc(NUM_NANO_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (nano_entries = (test_entry_t *)calloc(NUM_NANO_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_nano_entries = (test_entry_t *)HDcalloc(NUM_NANO_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_nano_entries = (test_entry_t *)calloc(NUM_NANO_ENTRIES, sizeof(test_entry_t)))) goto error; /* micro entries */ - if (NULL == (micro_entries = (test_entry_t *)HDcalloc(NUM_MICRO_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (micro_entries = (test_entry_t *)calloc(NUM_MICRO_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_micro_entries = (test_entry_t *)HDcalloc(NUM_MICRO_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_micro_entries = (test_entry_t *)calloc(NUM_MICRO_ENTRIES, sizeof(test_entry_t)))) goto error; /* tiny entries */ - if (NULL == (tiny_entries = (test_entry_t *)HDcalloc(NUM_TINY_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (tiny_entries = (test_entry_t *)calloc(NUM_TINY_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_tiny_entries = (test_entry_t *)HDcalloc(NUM_TINY_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_tiny_entries = (test_entry_t *)calloc(NUM_TINY_ENTRIES, sizeof(test_entry_t)))) goto error; /* small entries */ - if (NULL == (small_entries = (test_entry_t *)HDcalloc(NUM_SMALL_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (small_entries = (test_entry_t *)calloc(NUM_SMALL_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_small_entries = (test_entry_t *)HDcalloc(NUM_SMALL_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_small_entries = (test_entry_t *)calloc(NUM_SMALL_ENTRIES, sizeof(test_entry_t)))) goto error; /* medium entries */ - if (NULL == (medium_entries = (test_entry_t *)HDcalloc(NUM_MEDIUM_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (medium_entries = (test_entry_t *)calloc(NUM_MEDIUM_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_medium_entries = (test_entry_t *)HDcalloc(NUM_MEDIUM_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_medium_entries = (test_entry_t *)calloc(NUM_MEDIUM_ENTRIES, sizeof(test_entry_t)))) goto error; /* large entries */ - if (NULL == (large_entries = (test_entry_t *)HDcalloc(NUM_LARGE_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (large_entries = (test_entry_t *)calloc(NUM_LARGE_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_large_entries = (test_entry_t *)HDcalloc(NUM_LARGE_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_large_entries = (test_entry_t *)calloc(NUM_LARGE_ENTRIES, sizeof(test_entry_t)))) goto error; /* huge entries */ - if (NULL == (huge_entries = (test_entry_t *)HDcalloc(NUM_HUGE_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (huge_entries = (test_entry_t *)calloc(NUM_HUGE_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_huge_entries = (test_entry_t *)HDcalloc(NUM_HUGE_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_huge_entries = (test_entry_t *)calloc(NUM_HUGE_ENTRIES, sizeof(test_entry_t)))) goto error; /* monster entries */ - if (NULL == (monster_entries = (test_entry_t *)HDcalloc(NUM_MONSTER_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (monster_entries = (test_entry_t *)calloc(NUM_MONSTER_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_monster_entries = (test_entry_t *)HDcalloc(NUM_MONSTER_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_monster_entries = (test_entry_t *)calloc(NUM_MONSTER_ENTRIES, sizeof(test_entry_t)))) goto error; /* variable entries */ - if (NULL == (variable_entries = (test_entry_t *)HDcalloc(NUM_VARIABLE_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (variable_entries = (test_entry_t *)calloc(NUM_VARIABLE_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == - (orig_variable_entries = (test_entry_t *)HDcalloc(NUM_VARIABLE_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_variable_entries = (test_entry_t *)calloc(NUM_VARIABLE_ENTRIES, sizeof(test_entry_t)))) goto error; /* notify entries */ - if (NULL == (notify_entries = (test_entry_t *)HDcalloc(NUM_NOTIFY_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (notify_entries = (test_entry_t *)calloc(NUM_NOTIFY_ENTRIES, sizeof(test_entry_t)))) goto error; - if (NULL == (orig_notify_entries = (test_entry_t *)HDcalloc(NUM_NOTIFY_ENTRIES, sizeof(test_entry_t)))) + if (NULL == (orig_notify_entries = (test_entry_t *)calloc(NUM_NOTIFY_ENTRIES, sizeof(test_entry_t)))) goto error; entries[0] = pico_entries; @@ -1964,48 +1963,48 @@ free_entry_arrays(void) { /* pico entries */ - HDfree(pico_entries); - HDfree(orig_pico_entries); + free(pico_entries); + free(orig_pico_entries); /* nano entries */ - HDfree(nano_entries); - HDfree(orig_nano_entries); + free(nano_entries); + free(orig_nano_entries); /* micro entries */ - HDfree(micro_entries); - HDfree(orig_micro_entries); + free(micro_entries); + free(orig_micro_entries); /* tiny entries */ - HDfree(tiny_entries); - HDfree(orig_tiny_entries); + free(tiny_entries); + free(orig_tiny_entries); /* small entries */ - HDfree(small_entries); - HDfree(orig_small_entries); + free(small_entries); + free(orig_small_entries); /* medium entries */ - HDfree(medium_entries); - HDfree(orig_medium_entries); + free(medium_entries); + free(orig_medium_entries); /* large entries */ - HDfree(large_entries); - HDfree(orig_large_entries); + free(large_entries); + free(orig_large_entries); /* huge entries */ - HDfree(huge_entries); - HDfree(orig_huge_entries); + free(huge_entries); + free(orig_huge_entries); /* monster entries */ - HDfree(monster_entries); - HDfree(orig_monster_entries); + free(monster_entries); + free(orig_monster_entries); /* variable entries */ - HDfree(variable_entries); - HDfree(orig_variable_entries); + free(variable_entries); + free(orig_variable_entries); /* notify entries */ - HDfree(notify_entries); - HDfree(orig_notify_entries); + free(notify_entries); + free(orig_notify_entries); } /* free_entry_arrays() */ diff --git a/test/cache_logging.c b/test/cache_logging.c index 67cf13d..fbdf552 100644 --- a/test/cache_logging.c +++ b/test/cache_logging.c @@ -77,7 +77,7 @@ test_logging_api(void) TEST_ERROR; /* Check to make sure that the property list getter works */ - if (NULL == (location = (char *)HDcalloc(size, sizeof(char)))) + if (NULL == (location = (char *)calloc(size, sizeof(char)))) TEST_ERROR; if (H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size, &start_on_access_out) < 0) TEST_ERROR; @@ -127,7 +127,7 @@ test_logging_api(void) TEST_ERROR; /* Clean up */ - HDfree(location); + free(location); if (H5Fclose(fid) < 0) TEST_ERROR; diff --git a/test/cache_tagging.c b/test/cache_tagging.c index b1110bc..c11ef6f 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -1810,7 +1810,7 @@ check_attribute_rename_tags(hid_t fcpl, int type) TEST_ERROR; /* Allocate array */ - if ((NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int))))) + if ((NULL == (data = (int *)calloc(DIMS * DIMS, sizeof(int))))) TEST_ERROR; /* Create Fapl */ @@ -1967,14 +1967,14 @@ check_attribute_rename_tags(hid_t fcpl, int type) /* Finished Test. Print status and return. */ /* ========================================== */ - HDfree(data); + free(data); PASSED(); return 0; error: if (data) - HDfree(data); + free(data); return 1; } /* check_attribute_rename_tags */ @@ -2023,7 +2023,7 @@ check_attribute_delete_tags(hid_t fcpl, int type) TEST_ERROR; /* Allocate array */ - if ((NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int))))) + if ((NULL == (data = (int *)calloc(DIMS * DIMS, sizeof(int))))) TEST_ERROR; /* Create Fapl */ @@ -2159,14 +2159,14 @@ check_attribute_delete_tags(hid_t fcpl, int type) /* Finished Test. Print status and return. */ /* ========================================== */ - HDfree(data); + free(data); PASSED(); return 0; error: if (data) - HDfree(data); + free(data); return 1; } /* check_attribute_delete_tags */ @@ -2690,7 +2690,7 @@ check_dataset_write_tags(void) /* ===== */ /* Allocate array */ - if ((NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int))))) + if ((NULL == (data = (int *)calloc(DIMS * DIMS, sizeof(int))))) TEST_ERROR; /* Create Fapl */ @@ -2803,14 +2803,14 @@ check_dataset_write_tags(void) /* Finished Test. Print status and return. */ /* ========================================== */ - HDfree(data); + free(data); PASSED(); return 0; error: if (data) - HDfree(data); + free(data); return 1; } /* check_dataset_write_tags */ @@ -2854,7 +2854,7 @@ check_attribute_write_tags(hid_t fcpl, int type) /* ===== */ /* Allocate array */ - if ((NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int))))) + if ((NULL == (data = (int *)calloc(DIMS * DIMS, sizeof(int))))) TEST_ERROR; /* Create Fapl */ @@ -2990,14 +2990,14 @@ check_attribute_write_tags(hid_t fcpl, int type) /* Finished Test. Print status and return. */ /* ========================================== */ - HDfree(data); + free(data); PASSED(); return 0; error: if (data) - HDfree(data); + free(data); return 1; } /* check_attribute_write_tags */ @@ -3043,7 +3043,7 @@ check_dataset_read_tags(void) /* ===== */ /* Allocate array */ - if ((NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int))))) + if ((NULL == (data = (int *)calloc(DIMS * DIMS, sizeof(int))))) TEST_ERROR; /* Create Fapl */ @@ -3152,14 +3152,14 @@ check_dataset_read_tags(void) /* Finished Test. Print status and return. */ /* ========================================== */ - HDfree(data); + free(data); PASSED(); return 0; error: if (data) - HDfree(data); + free(data); return 1; } /* check_dataset_read_tags */ @@ -3206,7 +3206,7 @@ check_dataset_size_retrieval(void) /* ===== */ /* Allocate array */ - if ((NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int))))) + if ((NULL == (data = (int *)calloc(DIMS * DIMS, sizeof(int))))) TEST_ERROR; /* Create Fapl */ @@ -3315,14 +3315,14 @@ check_dataset_size_retrieval(void) /* Finished Test. Print status and return. */ /* ========================================== */ - HDfree(data); + free(data); PASSED(); return 0; error: if (data) - HDfree(data); + free(data); return 1; } /* check_dataset_size_retrieval */ @@ -3370,7 +3370,7 @@ check_dataset_extend_tags(void) /* ===== */ /* Allocate array */ - if ((NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int))))) + if ((NULL == (data = (int *)calloc(DIMS * DIMS, sizeof(int))))) TEST_ERROR; /* Create Fapl */ @@ -3479,14 +3479,14 @@ check_dataset_extend_tags(void) /* Finished Test. Print status and return. */ /* ========================================== */ - HDfree(data); + free(data); PASSED(); return 0; error: if (data) - HDfree(data); + free(data); return 1; } /* check_dataset_extend_tags */ @@ -3817,7 +3817,7 @@ check_link_removal_tags(hid_t fcpl, int type) /* ===== */ /* Allocate array */ - if ((NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int))))) + if ((NULL == (data = (int *)calloc(DIMS * DIMS, sizeof(int))))) TEST_ERROR; /* Create Fapl */ @@ -3950,14 +3950,14 @@ check_link_removal_tags(hid_t fcpl, int type) /* Finished Test. Print status and return. */ /* ========================================== */ - HDfree(data); + free(data); PASSED(); return 0; error: if (data) - HDfree(data); + free(data); return 1; } /* check_link_removal_tags */ @@ -4006,7 +4006,7 @@ check_link_getname_tags(void) /* ===== */ /* Allocate array */ - if ((NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int))))) + if ((NULL == (data = (int *)calloc(DIMS * DIMS, sizeof(int))))) TEST_ERROR; /* Create Fapl */ @@ -4129,14 +4129,14 @@ check_link_getname_tags(void) /* Finished Test. Print status and return. */ /* ========================================== */ - HDfree(data); + free(data); PASSED(); return 0; error: if (data) - HDfree(data); + free(data); return 1; } /* check_link_getname_tags */ diff --git a/test/chunk_info.c b/test/chunk_info.c index def35e9..30459ed 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -564,7 +564,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) #ifdef H5_HAVE_FILTER_DEFLATE /* Allocate input (compressed) buffer */ - inbuf = HDcalloc(1, z_dst_nbytes); + inbuf = calloc(1, z_dst_nbytes); /* zlib-friendly alias for the input buffer */ z_dst = (Bytef *)inbuf; @@ -590,7 +590,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) } #else /* Allocate input (non-compressed) buffer */ - if (NULL == (inbuf = HDcalloc(1, CHK_SIZE))) + if (NULL == (inbuf = calloc(1, CHK_SIZE))) TEST_ERROR; HDmemcpy(inbuf, direct_buf, CHK_SIZE); #endif /* end H5_HAVE_FILTER_DEFLATE */ @@ -609,7 +609,7 @@ test_get_chunk_info_highest_v18(hid_t fapl) /* Free the input buffer */ if (inbuf) - HDfree(inbuf); + free(inbuf); if (H5Fflush(dset, H5F_SCOPE_LOCAL) < 0) TEST_ERROR; diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index 8d1f877..62b409d 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -182,17 +182,17 @@ test_compound(char *filename, hid_t fapl) int ret_code; /* Allocate buffers for datasets */ - if (NULL == (s1 = (s1_t *)HDmalloc(sizeof(s1_t) * NX * NY))) + if (NULL == (s1 = (s1_t *)malloc(sizeof(s1_t) * NX * NY))) goto error; - if (NULL == (s2 = (s2_t *)HDmalloc(sizeof(s2_t) * NX * NY))) + if (NULL == (s2 = (s2_t *)malloc(sizeof(s2_t) * NX * NY))) goto error; - if (NULL == (s3 = (s3_t *)HDmalloc(sizeof(s3_t) * NX * NY))) + if (NULL == (s3 = (s3_t *)malloc(sizeof(s3_t) * NX * NY))) goto error; - if (NULL == (s4 = (s4_t *)HDmalloc(sizeof(s4_t) * NX * NY))) + if (NULL == (s4 = (s4_t *)malloc(sizeof(s4_t) * NX * NY))) goto error; - if (NULL == (s5 = (s5_t *)HDmalloc(sizeof(s5_t) * NX * NY))) + if (NULL == (s5 = (s5_t *)malloc(sizeof(s5_t) * NX * NY))) goto error; - if (NULL == (s6 = (s6_t *)HDmalloc(sizeof(s6_t) * NX * NY))) + if (NULL == (s6 = (s6_t *)malloc(sizeof(s6_t) * NX * NY))) goto error; /* Create the file */ @@ -581,7 +581,7 @@ test_compound(char *filename, hid_t fapl) goto error; /* Read the dataset */ - s8 = (s1_t *)HDcalloc((size_t)(h_size[0] * h_size[1]), sizeof(s1_t)); + s8 = (s1_t *)calloc((size_t)(h_size[0] * h_size[1]), sizeof(s1_t)); assert(s8); if (H5Dread(dataset, s1_tid, s8_m_sid, s8_f_sid, H5P_DEFAULT, s8) < 0) { goto error; @@ -602,7 +602,7 @@ test_compound(char *filename, hid_t fapl) } } - HDfree(s8); + free(s8); s8 = NULL; PASSED(); @@ -714,7 +714,7 @@ test_compound(char *filename, hid_t fapl) f_offset[1] = NY / 3; 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)); + s11 = (s4_t *)malloc((size_t)h_size[0] * (size_t)h_size[1] * sizeof(s4_t)); assert(s11); /* Initialize */ @@ -726,7 +726,7 @@ test_compound(char *filename, hid_t fapl) if (H5Dwrite(dataset, s4_tid, s8_m_sid, s8_f_sid, PRESERVE, s11) < 0) { goto error; } - HDfree(s11); + free(s11); s11 = NULL; /* Read the whole thing */ @@ -773,12 +773,12 @@ test_compound(char *filename, hid_t fapl) H5Fclose(file); /* Release buffers */ - HDfree(s1); - HDfree(s2); - HDfree(s3); - HDfree(s4); - HDfree(s5); - HDfree(s6); + free(s1); + free(s2); + free(s3); + free(s4); + free(s5); + free(s6); PASSED(); return 0; @@ -788,17 +788,17 @@ error: /* Release resources */ if (s1) - HDfree(s1); + free(s1); if (s2) - HDfree(s2); + free(s2); if (s3) - HDfree(s3); + free(s3); if (s4) - HDfree(s4); + free(s4); if (s5) - HDfree(s5); + free(s5); if (s6) - HDfree(s6); + free(s6); return 1; } @@ -1306,12 +1306,12 @@ test_hdf5_src_subset(char *filename, hid_t fapl) goto error; /* Allocate space and initialize data */ - orig = (unsigned char *)HDmalloc(NX * NY * sizeof(stype1)); + orig = (unsigned char *)malloc(NX * NY * sizeof(stype1)); initialize_stype1(orig, (size_t)NX * NY); - rbuf = (unsigned char *)HDmalloc(NX * NY * sizeof(stype2)); + rbuf = (unsigned char *)malloc(NX * NY * sizeof(stype2)); - rew_buf = (unsigned char *)HDmalloc(NX * NY * sizeof(stype3)); + rew_buf = (unsigned char *)malloc(NX * NY * sizeof(stype3)); initialize_stype3(rew_buf, (size_t)NX * NY); /* Create dataset creation property list */ @@ -1440,17 +1440,17 @@ test_hdf5_src_subset(char *filename, hid_t fapl) if (H5Fclose(file) < 0) FAIL_STACK_ERROR; - HDfree(orig); - HDfree(rbuf); - HDfree(rew_buf); + free(orig); + free(rbuf); + free(rew_buf); PASSED(); return 0; error: - HDfree(orig); - HDfree(rbuf); - HDfree(rew_buf); + free(orig); + free(rbuf); + free(rew_buf); HDputs("*** DATASET TESTS FAILED ***"); return 1; @@ -1512,12 +1512,12 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) goto error; /* Allocate space and initialize data */ - orig = (unsigned char *)HDmalloc(NX * NY * sizeof(stype2)); + orig = (unsigned char *)malloc(NX * NY * sizeof(stype2)); initialize_stype2(orig, (size_t)NX * NY); - rbuf = (unsigned char *)HDmalloc(NX * NY * sizeof(stype1)); + rbuf = (unsigned char *)malloc(NX * NY * sizeof(stype1)); - rew_buf = (unsigned char *)HDmalloc(NX * NY * sizeof(stype4)); + rew_buf = (unsigned char *)malloc(NX * NY * sizeof(stype4)); initialize_stype4(rew_buf, (size_t)NX * NY); /* Create dataset creation property list */ @@ -1646,9 +1646,9 @@ test_hdf5_dst_subset(char *filename, hid_t fapl) if (H5Fclose(file) < 0) goto error; - HDfree(orig); - HDfree(rbuf); - HDfree(rew_buf); + free(orig); + free(rbuf); + free(rew_buf); PASSED(); return 0; diff --git a/test/cmpd_dtransform.c b/test/cmpd_dtransform.c index c62eea6..9487531 100644 --- a/test/cmpd_dtransform.c +++ b/test/cmpd_dtransform.c @@ -47,7 +47,7 @@ main(void) att_t *atts_res = NULL; /* Compound datatype */ - if (NULL == (atts = HDmalloc(sizeof(att_t)))) + if (NULL == (atts = malloc(sizeof(att_t)))) TEST_ERROR; HDstrcpy(atts[0].name, "Name"); HDstrcpy(atts[0].unit, "Unit"); @@ -96,9 +96,9 @@ main(void) FAIL_STACK_ERROR; } - if (NULL == (data = HDmalloc(LENGTH * sizeof(int)))) + if (NULL == (data = malloc(LENGTH * sizeof(int)))) TEST_ERROR; - if (NULL == (data_res = HDmalloc(LENGTH * sizeof(int)))) + if (NULL == (data_res = malloc(LENGTH * sizeof(int)))) TEST_ERROR; for (unsigned i = 0; i < LENGTH; i++) { data[i] = 10; @@ -110,7 +110,7 @@ main(void) FAIL_STACK_ERROR; /* Read attribute */ - if (NULL == (atts_res = HDmalloc(sizeof(att_t)))) + if (NULL == (atts_res = malloc(sizeof(att_t)))) TEST_ERROR; if (H5Aread(att_attr_id, att_dtyp_id, atts_res) < 0) FAIL_STACK_ERROR; @@ -130,10 +130,10 @@ main(void) if (data[idx] != data_res[idx]) TEST_ERROR; - HDfree(atts); - HDfree(atts_res); - HDfree(data); - HDfree(data_res); + free(atts); + free(atts_res); + free(data); + free(data_res); /* Close all identifiers. */ if (H5Pclose(dxpl_id) < 0) @@ -170,13 +170,13 @@ error: H5E_END_TRY if (atts) - HDfree(atts); + free(atts); if (atts_res) - HDfree(atts_res); + free(atts_res); if (data) - HDfree(data); + free(data); if (data_res) - HDfree(data_res); + free(data_res); return 1; } diff --git a/test/cork.c b/test/cork.c index 5a81b25..3187ee3 100644 --- a/test/cork.c +++ b/test/cork.c @@ -141,9 +141,9 @@ verify_old_dset_cork(void) TEST_ERROR; /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(100 * 20, sizeof(int)))) + if (NULL == (buf_data = (int *)calloc(100 * 20, sizeof(int)))) TEST_ERROR; - if (NULL == (buf = (int **)HDcalloc(100, sizeof(buf_data)))) + if (NULL == (buf = (int **)calloc(100, sizeof(buf_data)))) TEST_ERROR; for (i = 0; i < 100; i++) buf[i] = buf_data + (i * 20); @@ -255,8 +255,8 @@ verify_old_dset_cork(void) if (H5Fclose(fid) < 0) TEST_ERROR; - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); PASSED(); return 0; @@ -277,8 +277,8 @@ error: } H5E_END_TRY - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); return 1; } /* verify_old_dset_cork */ @@ -653,9 +653,9 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(100 * 20, sizeof(int)))) + if (NULL == (buf_data = (int *)calloc(100 * 20, sizeof(int)))) TEST_ERROR; - if (NULL == (buf = (int **)HDcalloc(100, sizeof(buf_data)))) + if (NULL == (buf = (int **)calloc(100, sizeof(buf_data)))) TEST_ERROR; for (i = 0; i < 100; i++) buf[i] = buf_data + (i * 20); @@ -719,8 +719,8 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format) if (H5Fclose(fid) < 0) TEST_ERROR; - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); PASSED(); return 0; @@ -740,8 +740,8 @@ error: } H5E_END_TRY - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); return 1; } /* verify_dset_cork */ @@ -2001,9 +2001,9 @@ test_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Set up data array */ - if (NULL == (wbuf_data = (int *)HDcalloc(DIMS0 * DIMS1, sizeof(int)))) + if (NULL == (wbuf_data = (int *)calloc(DIMS0 * DIMS1, sizeof(int)))) TEST_ERROR; - if (NULL == (wbuf = (int **)HDcalloc(DIMS0, sizeof(wbuf_data)))) + if (NULL == (wbuf = (int **)calloc(DIMS0, sizeof(wbuf_data)))) TEST_ERROR; for (i = 0; i < DIMS0; i++) wbuf[i] = wbuf_data + (i * DIMS1); @@ -2048,7 +2048,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format) TEST_ERROR; /* Set up data array */ - if (NULL == (rbuf_data = (int *)HDcalloc(DIMS0 * DIMS1, sizeof(int)))) + if (NULL == (rbuf_data = (int *)calloc(DIMS0 * DIMS1, sizeof(int)))) TEST_ERROR; /* Read from the dataset */ @@ -2195,9 +2195,9 @@ test_dset_cork(hbool_t swmr, hbool_t new_format) if (H5Pclose(dcpl) < 0) TEST_ERROR; - HDfree(wbuf); - HDfree(wbuf_data); - HDfree(rbuf_data); + free(wbuf); + free(wbuf_data); + free(rbuf_data); PASSED(); return 0; @@ -2217,9 +2217,9 @@ error: } H5E_END_TRY - HDfree(wbuf); - HDfree(wbuf_data); - HDfree(rbuf_data); + free(wbuf); + free(wbuf_data); + free(rbuf_data); return 1; diff --git a/test/dangle.c b/test/dangle.c index a51e347..c1cd1f5 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -598,7 +598,7 @@ test_dangle_force(void) TEST_ERROR; /* Allocate the array of object IDs */ - if (NULL == (objs = (hid_t *)HDcalloc((size_t)count, sizeof(hid_t)))) + if (NULL == (objs = (hid_t *)calloc((size_t)count, sizeof(hid_t)))) TEST_ERROR; /* Get the list of open IDs */ @@ -620,14 +620,14 @@ test_dangle_force(void) HDremove(filename); /* Release object ID array */ - HDfree(objs); + free(objs); PASSED(); return 0; error: if (objs) - HDfree(objs); + free(objs); return 1; } diff --git a/test/direct_chunk.c b/test/direct_chunk.c index 84ba71e..6bf1202 100644 --- a/test/direct_chunk.c +++ b/test/direct_chunk.c @@ -204,7 +204,7 @@ test_direct_chunk_write(hid_t file) direct_buf[i][j] = n++; /* Allocate output (compressed) buffer */ - outbuf = HDmalloc(z_dst_nbytes); + outbuf = malloc(z_dst_nbytes); z_dst = (Bytef *)outbuf; /* Perform compression from the source to the destination buffer */ @@ -236,7 +236,7 @@ test_direct_chunk_write(hid_t file) } if (outbuf) - HDfree(outbuf); + free(outbuf); if (H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) goto error; @@ -283,7 +283,7 @@ test_direct_chunk_write(hid_t file) direct_buf[i][j] = i + j; /* Allocate output (compressed) buffer */ - outbuf = HDmalloc(z_dst_nbytes); + outbuf = malloc(z_dst_nbytes); z_dst = (Bytef *)outbuf; /* Perform compression from the source to the destination buffer */ @@ -316,7 +316,7 @@ test_direct_chunk_write(hid_t file) } if (outbuf) - HDfree(outbuf); + free(outbuf); if (H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0) goto error; @@ -367,7 +367,7 @@ error: H5E_END_TRY if (outbuf) - HDfree(outbuf); + free(outbuf); H5_FAILED(); return 1; @@ -1510,7 +1510,7 @@ test_direct_chunk_read_no_cache(hid_t file) goto error; /* Allocate output (compressed) buffer */ - outbuf = HDmalloc(z_src_nbytes); + outbuf = malloc(z_src_nbytes); z_src = (Bytef *)outbuf; /* For each chunk in the dataset, compare the result of H5Dread and H5Dread_chunk. */ @@ -1589,7 +1589,7 @@ test_direct_chunk_read_no_cache(hid_t file) H5Pclose(dapl); if (outbuf) - HDfree(outbuf); + free(outbuf); PASSED(); return 0; @@ -1607,7 +1607,7 @@ error: H5E_END_TRY if (outbuf) - HDfree(outbuf); + free(outbuf); H5_FAILED(); return 1; @@ -1694,7 +1694,7 @@ test_direct_chunk_read_cache(hid_t file, hbool_t flush) } /* Allocate output (compressed) buffer */ - outbuf = HDmalloc(z_src_nbytes); + outbuf = malloc(z_src_nbytes); z_src = (Bytef *)outbuf; /* For each chunk in the dataset, compare the result of H5Dread and H5Dread_chunk. */ @@ -1779,7 +1779,7 @@ test_direct_chunk_read_cache(hid_t file, hbool_t flush) H5Pclose(dxpl); if (outbuf) - HDfree(outbuf); + free(outbuf); PASSED(); return 0; @@ -1796,7 +1796,7 @@ error: H5E_END_TRY if (outbuf) - HDfree(outbuf); + free(outbuf); H5_FAILED(); return 1; diff --git a/test/dsets.c b/test/dsets.c index d0dfdf6..727ffa7 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -552,9 +552,9 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) h5_fixname(FILENAME[4], fapl, filename, sizeof filename); /* Set up data array */ - if (NULL == (rdata_bytes = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) + if (NULL == (rdata_bytes = (int *)calloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) TEST_ERROR; - if (NULL == (rdata = (int **)HDcalloc(DSET_DIM1, sizeof(rdata_bytes)))) + if (NULL == (rdata = (int **)calloc(DSET_DIM1, sizeof(rdata_bytes)))) TEST_ERROR; for (i = 0; i < DSET_DIM1; i++) rdata[i] = rdata_bytes + (i * DSET_DIM2); @@ -574,7 +574,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) goto error; /* Create a small conversion buffer to test strip mining */ - tconv_buf = HDmalloc((size_t)1000); + tconv_buf = malloc((size_t)1000); xfer = H5Pcreate(H5P_DATASET_XFER); assert(xfer >= 0); if (H5Pset_buffer(xfer, (size_t)1000, tconv_buf, NULL) < 0) @@ -648,9 +648,9 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl) HDclose(f); f = -1; - HDfree(tconv_buf); - HDfree(rdata_bytes); - HDfree(rdata); + free(tconv_buf); + free(rdata_bytes); + free(rdata); PASSED(); } /* end if */ @@ -677,9 +677,9 @@ error: if (f > 0) HDclose(f); - HDfree(tconv_buf); - HDfree(rdata_bytes); - HDfree(rdata); + free(tconv_buf); + free(rdata_bytes); + free(rdata); return FAIL; } /* end test_simple_io() */ @@ -713,9 +713,9 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) h5_fixname(FILENAME[2], fapl, filename, sizeof filename); /* Set up data array */ - if (NULL == (rdata_bytes = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) + if (NULL == (rdata_bytes = (int *)calloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) TEST_ERROR; - if (NULL == (rdata = (int **)HDcalloc(DSET_DIM1, sizeof(rdata_bytes)))) + if (NULL == (rdata = (int **)calloc(DSET_DIM1, sizeof(rdata_bytes)))) TEST_ERROR; for (i = 0; i < DSET_DIM1; i++) rdata[i] = rdata_bytes + (i * DSET_DIM2); @@ -785,8 +785,8 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) HDclose(f); f = -1; - HDfree(rdata_bytes); - HDfree(rdata); + free(rdata_bytes); + free(rdata); PASSED(); } /* end if */ @@ -813,8 +813,8 @@ error: if (f > 0) HDclose(f); - HDfree(rdata_bytes); - HDfree(rdata); + free(rdata_bytes); + free(rdata); return FAIL; } /* end test_userblock_offset() */ @@ -1075,9 +1075,9 @@ test_max_compact(hid_t fapl) /* Initialize data */ compact_size = (SIXTY_FOUR_KB - 64) / sizeof(int); - if (NULL == (wbuf = (int *)HDmalloc(sizeof(int) * compact_size))) + if (NULL == (wbuf = (int *)malloc(sizeof(int) * compact_size))) TEST_ERROR; - if (NULL == (rbuf = (int *)HDmalloc(sizeof(int) * compact_size))) + if (NULL == (rbuf = (int *)malloc(sizeof(int) * compact_size))) TEST_ERROR; n = 0; @@ -1141,9 +1141,9 @@ test_max_compact(hid_t fapl) FAIL_STACK_ERROR; if (H5Fclose(file) < 0) FAIL_STACK_ERROR; - HDfree(wbuf); + free(wbuf); wbuf = NULL; - HDfree(rbuf); + free(rbuf); rbuf = NULL; /* Test compact dataset of size 64KB */ @@ -1184,9 +1184,9 @@ test_max_compact(hid_t fapl) error: if (wbuf) - HDfree(wbuf); + free(wbuf); if (rbuf) - HDfree(rbuf); + free(rbuf); H5E_BEGIN_TRY { @@ -1389,7 +1389,7 @@ test_conv_buffer(hid_t fid) TESTING("data type conversion buffer size"); - if ((cf = (CmpField *)HDcalloc((size_t)1, sizeof(CmpField))) == 0) + if ((cf = (CmpField *)calloc((size_t)1, sizeof(CmpField))) == 0) goto error; /* Populate the data members */ @@ -1454,7 +1454,7 @@ test_conv_buffer(hid_t fid) goto error; /* Read should succeed since library will set conversion buffer big enough */ - if ((cfrR = (CmpFieldR *)HDcalloc((size_t)1, sizeof(CmpFieldR))) == 0) + if ((cfrR = (CmpFieldR *)calloc((size_t)1, sizeof(CmpFieldR))) == 0) goto error; if (H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfrR) < 0) goto error; @@ -1505,14 +1505,14 @@ test_conv_buffer(hid_t fid) if (H5Dclose(dataset) < 0) goto error; - HDfree(cf); - HDfree(cfrR); + free(cf); + free(cfrR); HDputs(" PASSED"); return SUCCEED; error: - HDfree(cfrR); - HDfree(cf); + free(cfrR); + free(cf); H5E_BEGIN_TRY { @@ -1549,9 +1549,9 @@ test_tconv(hid_t file) hid_t space = -1, dataset = -1; int i; - if ((out = (char *)HDmalloc((size_t)(4 * 1000 * 1000))) == NULL) + if ((out = (char *)malloc((size_t)(4 * 1000 * 1000))) == NULL) goto error; - if ((in = (char *)HDmalloc((size_t)(4 * 1000 * 1000))) == NULL) + if ((in = (char *)malloc((size_t)(4 * 1000 * 1000))) == NULL) goto error; TESTING("data type conversion"); @@ -1596,17 +1596,17 @@ test_tconv(hid_t file) goto error; if (H5Sclose(space) < 0) goto error; - HDfree(out); - HDfree(in); + free(out); + free(in); HDputs(" PASSED"); return SUCCEED; error: if (out) - HDfree(out); + free(out); if (in) - HDfree(in); + free(in); H5E_BEGIN_TRY { @@ -1822,7 +1822,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_valu if (offset > nbytes || (offset + length) > nbytes || length < sizeof(unsigned int)) TEST_ERROR; - if (NULL == (data = HDmalloc((size_t)length))) + if (NULL == (data = malloc((size_t)length))) TEST_ERROR; HDmemset(data, (int)value, (size_t)length); @@ -1844,7 +1844,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_valu error: if (data) - HDfree(data); + free(data); return ret_value; } /* end filter_corrupt() */ @@ -1922,7 +1922,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, */ if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error; - tconv_buf = HDmalloc((size_t)1000); + tconv_buf = malloc((size_t)1000); if (H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error; if ((write_dxpl = H5Pcopy(dxpl)) < 0) @@ -2264,13 +2264,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, goto error; if (H5Pclose(write_dxpl) < 0) goto error; - HDfree(tconv_buf); + free(tconv_buf); return SUCCEED; error: if (tconv_buf) - HDfree(tconv_buf); + free(tconv_buf); return FAIL; } /* end test_filter_internal() */ @@ -4353,7 +4353,7 @@ test_nbit_compound_3(hid_t file) HDstrcpy(orig_data[i].str, "fixed-length C string"); orig_data[i].vl_str = HDstrdup("variable-length C string"); - orig_data[i].v.p = HDmalloc((size_t)(i + 1) * sizeof(unsigned int)); + orig_data[i].v.p = malloc((size_t)(i + 1) * sizeof(unsigned int)); orig_data[i].v.len = (size_t)i + 1; for (k = 0; k < (i + 1); k++) ((unsigned int *)orig_data[i].v.p)[k] = (unsigned int)(i * 100 + k); @@ -4483,9 +4483,9 @@ test_nbit_int_size(hid_t file) TESTING(" nbit integer dataset size"); /* Set up data array */ - if (NULL == (orig_data = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) + if (NULL == (orig_data = (int *)calloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) TEST_ERROR; - if (NULL == (orig = (int **)HDcalloc(DSET_DIM1, sizeof(orig_data)))) + if (NULL == (orig = (int **)calloc(DSET_DIM1, sizeof(orig_data)))) TEST_ERROR; for (i = 0; i < DSET_DIM1; i++) orig[i] = orig_data + (i * DSET_DIM2); @@ -4619,16 +4619,16 @@ test_nbit_int_size(hid_t file) H5Sclose(dataspace); H5Pclose(dset_create_props); - HDfree(orig); - HDfree(orig_data); + free(orig); + free(orig_data); PASSED(); return SUCCEED; error: - HDfree(orig); - HDfree(orig_data); + free(orig); + free(orig_data); return FAIL; } /* end test_nbit_int_size() */ @@ -4663,9 +4663,9 @@ test_nbit_flt_size(hid_t file) TESTING(" nbit floating-number dataset size"); /* Set up data array */ - if (NULL == (orig_data = (float *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(float)))) + if (NULL == (orig_data = (float *)calloc(DSET_DIM1 * DSET_DIM2, sizeof(float)))) TEST_ERROR; - if (NULL == (orig = (float **)HDcalloc(DSET_DIM1, sizeof(orig_data)))) + if (NULL == (orig = (float **)calloc(DSET_DIM1, sizeof(orig_data)))) TEST_ERROR; for (i = 0; i < DSET_DIM1; i++) orig[i] = orig_data + (i * DSET_DIM2); @@ -4830,13 +4830,13 @@ test_nbit_flt_size(hid_t file) PASSED(); - HDfree(orig); - HDfree(orig_data); + free(orig); + free(orig_data); return SUCCEED; error: - HDfree(orig); - HDfree(orig_data); + free(orig); + free(orig_data); return FAIL; } /* end test_nbit_flt_size() */ @@ -7224,7 +7224,7 @@ auxread_fdata(hid_t fid, const char *name) goto error; if (nelmts) { - buf = (void *)HDmalloc((size_t)(nelmts * msize)); + buf = (void *)malloc((size_t)(nelmts * msize)); if (buf == NULL) { printf("cannot read into memory\n"); goto error; @@ -7240,7 +7240,7 @@ auxread_fdata(hid_t fid, const char *name) if (H5Dclose(dset_id) < 0) goto error; if (buf) - HDfree(buf); + free(buf); return SUCCEED; @@ -7253,7 +7253,7 @@ error: H5Tclose(ftype_id); H5Tclose(mtype_id); if (buf) - HDfree(buf); + free(buf); } H5E_END_TRY return FAIL; @@ -7593,21 +7593,21 @@ test_missing_chunk(hid_t file) TESTING("Read dataset with unwritten chunk & undefined fill value"); /* Set up data arrays */ - if (NULL == (wdata = (int *)HDcalloc(MISSING_CHUNK_DIM, sizeof(int)))) + if (NULL == (wdata = (int *)calloc(MISSING_CHUNK_DIM, sizeof(int)))) TEST_ERROR; - if (NULL == (rdata = (int *)HDcalloc(MISSING_CHUNK_DIM, sizeof(int)))) + if (NULL == (rdata = (int *)calloc(MISSING_CHUNK_DIM, sizeof(int)))) TEST_ERROR; - if (NULL == (wdata2_bytes = (int *)HDcalloc(MISSING_CHUNK_DIM * MISSING_CHUNK_DIM, sizeof(int)))) + if (NULL == (wdata2_bytes = (int *)calloc(MISSING_CHUNK_DIM * MISSING_CHUNK_DIM, sizeof(int)))) TEST_ERROR; - if (NULL == (wdata2 = (int **)HDcalloc(MISSING_CHUNK_DIM, sizeof(wdata2_bytes)))) + if (NULL == (wdata2 = (int **)calloc(MISSING_CHUNK_DIM, sizeof(wdata2_bytes)))) TEST_ERROR; for (i = 0; i < MISSING_CHUNK_DIM; i++) wdata2[i] = wdata2_bytes + (i * MISSING_CHUNK_DIM); - if (NULL == (rdata2_bytes = (int *)HDcalloc(MISSING_CHUNK_DIM * MISSING_CHUNK_DIM, sizeof(int)))) + if (NULL == (rdata2_bytes = (int *)calloc(MISSING_CHUNK_DIM * MISSING_CHUNK_DIM, sizeof(int)))) TEST_ERROR; - if (NULL == (rdata2 = (int **)HDcalloc(MISSING_CHUNK_DIM, sizeof(rdata2_bytes)))) + if (NULL == (rdata2 = (int **)calloc(MISSING_CHUNK_DIM, sizeof(rdata2_bytes)))) TEST_ERROR; for (i = 0; i < MISSING_CHUNK_DIM; i++) rdata2[i] = rdata2_bytes + (i * MISSING_CHUNK_DIM); @@ -7770,12 +7770,12 @@ test_missing_chunk(hid_t file) if (H5Dclose(did2) < 0) TEST_ERROR; - HDfree(rdata); - HDfree(wdata); - HDfree(rdata2); - HDfree(wdata2); - HDfree(rdata2_bytes); - HDfree(wdata2_bytes); + free(rdata); + free(wdata); + free(rdata2); + free(wdata2); + free(rdata2_bytes); + free(wdata2_bytes); PASSED(); return SUCCEED; @@ -7794,12 +7794,12 @@ error: } H5E_END_TRY - HDfree(rdata); - HDfree(wdata); - HDfree(rdata2); - HDfree(wdata2); - HDfree(rdata2_bytes); - HDfree(wdata2_bytes); + free(rdata); + free(wdata); + free(rdata2); + free(wdata2); + free(rdata2_bytes); + free(wdata2_bytes); return FAIL; } /* end test_missing_chunk() */ @@ -9066,25 +9066,24 @@ test_big_chunks_bypass_cache(hid_t fapl) h5_fixname(FILENAME[9], fapl, filename, sizeof filename); /* Set up data arrays */ - if (NULL == - (t_wdata_bytes = (int *)HDcalloc((BYPASS_CHUNK_DIM / 2) * (BYPASS_CHUNK_DIM / 2), sizeof(int)))) + if (NULL == (t_wdata_bytes = (int *)calloc((BYPASS_CHUNK_DIM / 2) * (BYPASS_CHUNK_DIM / 2), sizeof(int)))) TEST_ERROR; - if (NULL == (t_wdata = (int **)HDcalloc((BYPASS_CHUNK_DIM / 2), sizeof(t_wdata_bytes)))) + if (NULL == (t_wdata = (int **)calloc((BYPASS_CHUNK_DIM / 2), sizeof(t_wdata_bytes)))) TEST_ERROR; for (i = 0; i < (BYPASS_CHUNK_DIM / 2); i++) t_wdata[i] = t_wdata_bytes + (i * (BYPASS_CHUNK_DIM / 2)); - if (NULL == (t_rdata1_bytes = (int *)HDcalloc(BYPASS_DIM * BYPASS_DIM, sizeof(int)))) + if (NULL == (t_rdata1_bytes = (int *)calloc(BYPASS_DIM * BYPASS_DIM, sizeof(int)))) TEST_ERROR; - if (NULL == (t_rdata1 = (int **)HDcalloc(BYPASS_DIM, sizeof(t_rdata1_bytes)))) + if (NULL == (t_rdata1 = (int **)calloc(BYPASS_DIM, sizeof(t_rdata1_bytes)))) TEST_ERROR; for (i = 0; i < BYPASS_DIM; i++) t_rdata1[i] = t_rdata1_bytes + (i * BYPASS_DIM); if (NULL == - (t_rdata2_bytes = (int *)HDcalloc((BYPASS_CHUNK_DIM / 2) * (BYPASS_CHUNK_DIM / 2), sizeof(int)))) + (t_rdata2_bytes = (int *)calloc((BYPASS_CHUNK_DIM / 2) * (BYPASS_CHUNK_DIM / 2), sizeof(int)))) TEST_ERROR; - if (NULL == (t_rdata2 = (int **)HDcalloc((BYPASS_CHUNK_DIM / 2), sizeof(t_rdata2_bytes)))) + if (NULL == (t_rdata2 = (int **)calloc((BYPASS_CHUNK_DIM / 2), sizeof(t_rdata2_bytes)))) TEST_ERROR; for (i = 0; i < (BYPASS_CHUNK_DIM / 2); i++) t_rdata2[i] = t_rdata2_bytes + (i * (BYPASS_CHUNK_DIM / 2)); @@ -9188,11 +9187,11 @@ test_big_chunks_bypass_cache(hid_t fapl) FAIL_STACK_ERROR; /* Allocate buffers */ - if (NULL == (wdata = (int *)HDmalloc(sizeof(int) * (BYPASS_CHUNK_DIM / 2)))) + if (NULL == (wdata = (int *)malloc(sizeof(int) * (BYPASS_CHUNK_DIM / 2)))) TEST_ERROR; - if (NULL == (rdata1 = (int *)HDmalloc(sizeof(int) * BYPASS_DIM))) + if (NULL == (rdata1 = (int *)malloc(sizeof(int) * BYPASS_DIM))) TEST_ERROR; - if (NULL == (rdata2 = (int *)HDmalloc(sizeof(int) * (BYPASS_CHUNK_DIM / 2)))) + if (NULL == (rdata2 = (int *)malloc(sizeof(int) * (BYPASS_CHUNK_DIM / 2)))) TEST_ERROR; /* Initialize data to write for 1-D dataset */ @@ -9352,15 +9351,15 @@ test_big_chunks_bypass_cache(hid_t fapl) FAIL_STACK_ERROR; /* Release buffers */ - HDfree(wdata); - HDfree(rdata1); - HDfree(rdata2); - HDfree(t_wdata); - HDfree(t_rdata1); - HDfree(t_rdata2); - HDfree(t_wdata_bytes); - HDfree(t_rdata1_bytes); - HDfree(t_rdata2_bytes); + free(wdata); + free(rdata1); + free(rdata2); + free(t_wdata); + free(t_rdata1); + free(t_rdata2); + free(t_wdata_bytes); + free(t_rdata1_bytes); + free(t_rdata2_bytes); PASSED(); return SUCCEED; @@ -9379,15 +9378,15 @@ error: } H5E_END_TRY - HDfree(wdata); - HDfree(rdata1); - HDfree(rdata2); - HDfree(t_wdata); - HDfree(t_rdata1); - HDfree(t_rdata2); - HDfree(t_wdata_bytes); - HDfree(t_rdata1_bytes); - HDfree(t_rdata2_bytes); + free(wdata); + free(rdata1); + free(rdata2); + free(t_wdata); + free(t_rdata1); + free(t_rdata2); + free(t_wdata_bytes); + free(t_rdata1_bytes); + free(t_rdata2_bytes); return FAIL; } /* end test_big_chunks_bypass_cache() */ @@ -9985,16 +9984,16 @@ test_chunk_fast_bug1(hid_t fapl) h5_fixname(FILENAME[10], fapl, filename, sizeof filename); /* Set up data array */ - if (NULL == (wbuf_bytes = (unsigned *)HDcalloc(40 * 20, sizeof(unsigned)))) + if (NULL == (wbuf_bytes = (unsigned *)calloc(40 * 20, sizeof(unsigned)))) TEST_ERROR; - if (NULL == (wbuf = (unsigned **)HDcalloc(40, sizeof(wbuf_bytes)))) + if (NULL == (wbuf = (unsigned **)calloc(40, sizeof(wbuf_bytes)))) TEST_ERROR; for (i = 0; i < 40; i++) wbuf[i] = wbuf_bytes + (i * 20); - if (NULL == (rbuf_bytes = (unsigned *)HDcalloc(40 * 20, sizeof(unsigned)))) + if (NULL == (rbuf_bytes = (unsigned *)calloc(40 * 20, sizeof(unsigned)))) TEST_ERROR; - if (NULL == (rbuf = (unsigned **)HDcalloc(40, sizeof(rbuf_bytes)))) + if (NULL == (rbuf = (unsigned **)calloc(40, sizeof(rbuf_bytes)))) TEST_ERROR; for (i = 0; i < 40; i++) rbuf[i] = rbuf_bytes + (i * 20); @@ -10070,10 +10069,10 @@ test_chunk_fast_bug1(hid_t fapl) if (H5Sclose(sid) < 0) FAIL_STACK_ERROR; - HDfree(wbuf); - HDfree(rbuf); - HDfree(wbuf_bytes); - HDfree(rbuf_bytes); + free(wbuf); + free(rbuf); + free(wbuf_bytes); + free(rbuf_bytes); PASSED(); return SUCCEED; @@ -10088,10 +10087,10 @@ error: } H5E_END_TRY - HDfree(wbuf); - HDfree(rbuf); - HDfree(wbuf_bytes); - HDfree(rbuf_bytes); + free(wbuf); + free(rbuf); + free(wbuf_bytes); + free(rbuf_bytes); return FAIL; } /* end test_chunk_fast_bug1() */ @@ -10783,30 +10782,30 @@ test_fixed_array(hid_t fapl) h5_fixname(FILENAME[12], fapl, filename, sizeof filename); /* Set up 2D data arrays */ - if (NULL == (chunks_bytes = (int *)HDcalloc(12 * 6, sizeof(int)))) + if (NULL == (chunks_bytes = (int *)calloc(12 * 6, sizeof(int)))) TEST_ERROR; - if (NULL == (chunks = (int **)HDcalloc(12, sizeof(chunks_bytes)))) + if (NULL == (chunks = (int **)calloc(12, sizeof(chunks_bytes)))) TEST_ERROR; for (i = 0; i < 12; i++) chunks[i] = chunks_bytes + (i * 6); - if (NULL == (chunks_big_bytes = (int *)HDcalloc(125 * 20, sizeof(int)))) + if (NULL == (chunks_big_bytes = (int *)calloc(125 * 20, sizeof(int)))) TEST_ERROR; - if (NULL == (chunks_big = (int **)HDcalloc(125, sizeof(chunks_big_bytes)))) + if (NULL == (chunks_big = (int **)calloc(125, sizeof(chunks_big_bytes)))) TEST_ERROR; for (i = 0; i < 125; i++) chunks_big[i] = chunks_big_bytes + (i * 20); - if (NULL == (coord_bytes = (hsize_t *)HDcalloc(POINTS * 2, sizeof(hsize_t)))) + if (NULL == (coord_bytes = (hsize_t *)calloc(POINTS * 2, sizeof(hsize_t)))) TEST_ERROR; - if (NULL == (coord = (hsize_t **)HDcalloc(POINTS, sizeof(coord_bytes)))) + if (NULL == (coord = (hsize_t **)calloc(POINTS, sizeof(coord_bytes)))) TEST_ERROR; for (i = 0; i < POINTS; i++) coord[i] = coord_bytes + (i * 2); - if (NULL == (coord_big_bytes = (hsize_t *)HDcalloc(POINTS_BIG * 2, sizeof(hsize_t)))) + if (NULL == (coord_big_bytes = (hsize_t *)calloc(POINTS_BIG * 2, sizeof(hsize_t)))) TEST_ERROR; - if (NULL == (coord_big = (hsize_t **)HDcalloc(POINTS_BIG, sizeof(coord_big_bytes)))) + if (NULL == (coord_big = (hsize_t **)calloc(POINTS_BIG, sizeof(coord_big_bytes)))) TEST_ERROR; for (i = 0; i < POINTS_BIG; i++) coord_big[i] = coord_big_bytes + (i * 2); @@ -10826,9 +10825,9 @@ test_fixed_array(hid_t fapl) TEST_ERROR; /* Allocate the "big" buffers */ - if (NULL == (wbuf_big = (int *)HDmalloc(sizeof(int) * POINTS_BIG))) + if (NULL == (wbuf_big = (int *)malloc(sizeof(int) * POINTS_BIG))) TEST_ERROR; - if (NULL == (rbuf_big = (int *)HDmalloc(sizeof(int) * POINTS_BIG))) + if (NULL == (rbuf_big = (int *)malloc(sizeof(int) * POINTS_BIG))) TEST_ERROR; #ifdef H5_HAVE_FILTER_DEFLATE @@ -11190,17 +11189,17 @@ test_fixed_array(hid_t fapl) #endif /* H5_HAVE_FILTER_DEFLATE */ /* Release buffers */ - HDfree(wbuf_big); - HDfree(rbuf_big); - - HDfree(chunks); - HDfree(chunks_big); - HDfree(coord); - HDfree(coord_big); - HDfree(chunks_bytes); - HDfree(chunks_big_bytes); - HDfree(coord_bytes); - HDfree(coord_big_bytes); + free(wbuf_big); + free(rbuf_big); + + free(chunks); + free(chunks_big); + free(coord); + free(coord_big); + free(chunks_bytes); + free(chunks_big_bytes); + free(coord_bytes); + free(coord_big_bytes); PASSED(); return SUCCEED; @@ -11216,16 +11215,16 @@ error: } H5E_END_TRY - HDfree(wbuf_big); - HDfree(rbuf_big); - HDfree(chunks); - HDfree(chunks_big); - HDfree(coord); - HDfree(coord_big); - HDfree(chunks_bytes); - HDfree(chunks_big_bytes); - HDfree(coord_bytes); - HDfree(coord_big_bytes); + free(wbuf_big); + free(rbuf_big); + free(chunks); + free(chunks_big); + free(coord); + free(coord_big); + free(chunks_bytes); + free(chunks_big_bytes); + free(coord_bytes); + free(coord_big_bytes); return FAIL; } /* end test_fixed_array() */ @@ -11304,13 +11303,13 @@ test_single_chunk(hid_t fapl) TEST_ERROR; /* Allocate the buffers */ - if (NULL == (wbuf = (int *)HDmalloc(sizeof(int) * (DSET_DIM1 * DSET_DIM2)))) + if (NULL == (wbuf = (int *)malloc(sizeof(int) * (DSET_DIM1 * DSET_DIM2)))) TEST_ERROR; - if (NULL == (rbuf = (int *)HDmalloc(sizeof(int) * (DSET_DIM1 * DSET_DIM2)))) + if (NULL == (rbuf = (int *)malloc(sizeof(int) * (DSET_DIM1 * DSET_DIM2)))) TEST_ERROR; - if (NULL == (t_wbuf = (int *)HDmalloc(sizeof(int) * (DSET_TMP_DIM1 * DSET_TMP_DIM2)))) + if (NULL == (t_wbuf = (int *)malloc(sizeof(int) * (DSET_TMP_DIM1 * DSET_TMP_DIM2)))) TEST_ERROR; - if (NULL == (t_rbuf = (int *)HDmalloc(sizeof(int) * (DSET_TMP_DIM1 * DSET_TMP_DIM2)))) + if (NULL == (t_rbuf = (int *)malloc(sizeof(int) * (DSET_TMP_DIM1 * DSET_TMP_DIM2)))) TEST_ERROR; for (i = n = 0; i < (DSET_DIM1 * DSET_DIM2); i++) @@ -11494,10 +11493,10 @@ test_single_chunk(hid_t fapl) #endif /* H5_HAVE_FILTER_DEFLATE */ /* Release buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(t_wbuf); - HDfree(t_rbuf); + free(wbuf); + free(rbuf); + free(t_wbuf); + free(t_rbuf); PASSED(); return SUCCEED; @@ -11515,13 +11514,13 @@ error: } H5E_END_TRY if (wbuf) - HDfree(wbuf); + free(wbuf); if (rbuf) - HDfree(rbuf); + free(rbuf); if (t_wbuf) - HDfree(t_wbuf); + free(t_wbuf); if (t_rbuf) - HDfree(t_rbuf); + free(t_rbuf); return FAIL; } /* end test_single_chunk() */ @@ -14519,7 +14518,7 @@ dls_01_main(void) if (NULL == h5_fixname(FILENAME[23], H5P_DEFAULT, filename, sizeof(filename))) TEST_ERROR; - buffer = (char *)HDcalloc(DLS_01_DIMS, DLS_01_STR_SIZE); + buffer = (char *)calloc(DLS_01_DIMS, DLS_01_STR_SIZE); if (NULL == buffer) TEST_ERROR; @@ -14565,7 +14564,7 @@ dls_01_main(void) if (status != 0) TEST_ERROR; - HDfree(buffer); + free(buffer); PASSED(); @@ -14573,7 +14572,7 @@ dls_01_main(void) error: if (buffer) - HDfree(buffer); + free(buffer); return FAIL; } /* end dls_01_main() */ @@ -15593,33 +15592,33 @@ main(void) /* Initialize global arrays */ /* points */ - if (NULL == (points_data = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) + if (NULL == (points_data = (int *)calloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) TEST_ERROR; - if (NULL == (points = (int **)HDcalloc(DSET_DIM1, sizeof(points_data)))) + if (NULL == (points = (int **)calloc(DSET_DIM1, sizeof(points_data)))) TEST_ERROR; for (i = 0; i < DSET_DIM1; i++) points[i] = points_data + (i * DSET_DIM2); /* check */ - if (NULL == (check_data = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) + if (NULL == (check_data = (int *)calloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) TEST_ERROR; - if (NULL == (check = (int **)HDcalloc(DSET_DIM1, sizeof(check_data)))) + if (NULL == (check = (int **)calloc(DSET_DIM1, sizeof(check_data)))) TEST_ERROR; for (i = 0; i < DSET_DIM1; i++) check[i] = check_data + (i * DSET_DIM2); /* points_dbl */ - if (NULL == (points_dbl_data = (double *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(double)))) + if (NULL == (points_dbl_data = (double *)calloc(DSET_DIM1 * DSET_DIM2, sizeof(double)))) TEST_ERROR; - if (NULL == (points_dbl = (double **)HDcalloc(DSET_DIM1, sizeof(points_dbl_data)))) + if (NULL == (points_dbl = (double **)calloc(DSET_DIM1, sizeof(points_dbl_data)))) TEST_ERROR; for (i = 0; i < DSET_DIM1; i++) points_dbl[i] = points_dbl_data + (i * DSET_DIM2); /* check_dbl */ - if (NULL == (check_dbl_data = (double *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(double)))) + if (NULL == (check_dbl_data = (double *)calloc(DSET_DIM1 * DSET_DIM2, sizeof(double)))) TEST_ERROR; - if (NULL == (check_dbl = (double **)HDcalloc(DSET_DIM1, sizeof(check_dbl_data)))) + if (NULL == (check_dbl = (double **)calloc(DSET_DIM1, sizeof(check_dbl_data)))) TEST_ERROR; for (i = 0; i < DSET_DIM1; i++) check_dbl[i] = check_dbl_data + (i * DSET_DIM2); @@ -15839,28 +15838,28 @@ main(void) #endif /* H5_HAVE_FILTER_SZIP */ h5_cleanup(FILENAME, fapl); - HDfree(points); - HDfree(check); - HDfree(points_dbl); - HDfree(check_dbl); + free(points); + free(check); + free(points_dbl); + free(check_dbl); - HDfree(points_data); - HDfree(check_data); - HDfree(points_dbl_data); - HDfree(check_dbl_data); + free(points_data); + free(check_data); + free(points_dbl_data); + free(check_dbl_data); HDexit(EXIT_SUCCESS); error: - HDfree(points); - HDfree(check); - HDfree(points_dbl); - HDfree(check_dbl); - - HDfree(points_data); - HDfree(check_data); - HDfree(points_dbl_data); - HDfree(check_dbl_data); + free(points); + free(check); + free(points_dbl); + free(check_dbl); + + free(points_data); + free(check_data); + free(points_dbl_data); + free(check_dbl_data); nerrors = MAX(1, nerrors); printf("***** %d DATASET TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); diff --git a/test/dt_arith.c b/test/dt_arith.c index 9f83fe8..4061fee 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -99,8 +99,8 @@ typedef enum dtype_t { static int without_hardware_g = 0; /* Allocates memory aligned on a certain boundary. */ -#define aligned_malloc(Z) ((void *)((char *)HDmalloc(ALIGNMENT + Z) + ALIGNMENT)) -#define aligned_free(M) HDfree((char *)(M)-ALIGNMENT) +#define aligned_malloc(Z) ((void *)((char *)malloc(ALIGNMENT + Z) + ALIGNMENT)) +#define aligned_free(M) free((char *)(M)-ALIGNMENT) /* Initialize source buffer of integer for integer->integer and integer->floating-point conversion test. * This algorithm is mainly to avoid any casting and comparison between source and destination types @@ -291,8 +291,8 @@ static int without_hardware_g = 0; HDmemset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ HDmemset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ \ - tmp1 = (unsigned char *)HDcalloc((size_t)1, (size_t)SRC_SIZE); \ - tmp2 = (unsigned char *)HDcalloc((size_t)1, (size_t)SRC_SIZE); \ + tmp1 = (unsigned char *)calloc((size_t)1, (size_t)SRC_SIZE); \ + tmp2 = (unsigned char *)calloc((size_t)1, (size_t)SRC_SIZE); \ \ buf_p = BUF; \ saved_p = SAVED; \ @@ -320,8 +320,8 @@ static int without_hardware_g = 0; buf_p += SRC_SIZE; \ saved_p += SRC_SIZE; \ } \ - HDfree(tmp1); \ - HDfree(tmp2); \ + free(tmp1); \ + free(tmp2); \ } while (0) /* Allocate buffer and initialize it with floating-point special values, +/-0, +/-infinity, @@ -342,7 +342,7 @@ static int without_hardware_g = 0; SAVED = (unsigned char *)aligned_malloc(NELMTS * MAX(SRC_SIZE, DST_SIZE)); \ HDmemset(BUF, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ HDmemset(SAVED, 0, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ - value = (unsigned char *)HDcalloc(SRC_SIZE, sizeof(unsigned char)); \ + value = (unsigned char *)calloc(SRC_SIZE, sizeof(unsigned char)); \ \ buf_p = BUF; \ \ @@ -385,7 +385,7 @@ static int without_hardware_g = 0; } \ \ HDmemcpy(SAVED, BUF, NELMTS *MAX(SRC_SIZE, DST_SIZE)); \ - HDfree(value); \ + free(value); \ } while (0) static hbool_t overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits); @@ -645,8 +645,8 @@ test_particular_fp_integer(void) endian = H5Tget_order(H5T_NATIVE_DOUBLE); src_size1 = H5Tget_size(H5T_NATIVE_DOUBLE); dst_size1 = H5Tget_size(H5T_NATIVE_SCHAR); - buf1 = (unsigned char *)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); - saved_buf1 = (unsigned char *)HDcalloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); + buf1 = (unsigned char *)calloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); + saved_buf1 = (unsigned char *)calloc((size_t)1, (size_t)MAX(src_size1, dst_size1)); HDmemcpy(buf1, &src_d, src_size1); HDmemcpy(saved_buf1, &src_d, src_size1); @@ -695,8 +695,8 @@ test_particular_fp_integer(void) /* Test conversion from float (the value is INT_MAX) to int. */ src_size2 = H5Tget_size(H5T_NATIVE_FLOAT); dst_size2 = H5Tget_size(H5T_NATIVE_INT); - buf2 = (unsigned char *)HDcalloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); - saved_buf2 = (unsigned char *)HDcalloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); + buf2 = (unsigned char *)calloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); + saved_buf2 = (unsigned char *)calloc((size_t)1, (size_t)MAX(src_size2, dst_size2)); HDmemcpy(buf2, &src_f, src_size2); HDmemcpy(saved_buf2, &src_f, src_size2); @@ -746,13 +746,13 @@ test_particular_fp_integer(void) } if (buf1) - HDfree(buf1); + free(buf1); if (buf2) - HDfree(buf2); + free(buf2); if (saved_buf1) - HDfree(saved_buf1); + free(saved_buf1); if (saved_buf2) - HDfree(saved_buf2); + free(saved_buf2); PASSED(); return 0; @@ -765,13 +765,13 @@ error: } H5E_END_TRY if (buf1) - HDfree(buf1); + free(buf1); if (buf2) - HDfree(buf2); + free(buf2); if (saved_buf1) - HDfree(saved_buf1); + free(saved_buf1); if (saved_buf2) - HDfree(saved_buf2); + free(saved_buf2); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -941,11 +941,11 @@ test_derived_flt(void) */ src_size = H5Tget_size(H5T_NATIVE_INT); endian = H5Tget_order(H5T_NATIVE_INT); - buf = (unsigned char *)HDmalloc(nelmts * (MAX(src_size, size))); - saved_buf = (unsigned char *)HDmalloc(nelmts * src_size); + buf = (unsigned char *)malloc(nelmts * (MAX(src_size, size))); + saved_buf = (unsigned char *)malloc(nelmts * src_size); HDmemset(buf, 0, nelmts * MAX(src_size, size)); HDmemset(saved_buf, 0, nelmts * src_size); - aligned = (int *)HDcalloc((size_t)1, src_size); + aligned = (int *)calloc((size_t)1, src_size); for (i = 0; i < nelmts * src_size; i++) buf[i] = saved_buf[i] = (unsigned char)HDrand(); @@ -1003,9 +1003,9 @@ test_derived_flt(void) } fails_this_test = 0; - HDfree(buf); - HDfree(saved_buf); - HDfree(aligned); + free(buf); + free(saved_buf); + free(aligned); buf = NULL; saved_buf = NULL; aligned = NULL; @@ -1102,8 +1102,8 @@ test_derived_flt(void) src_size = H5Tget_size(tid2); dst_size = H5Tget_size(tid1); endian = H5Tget_order(tid2); - buf = (unsigned char *)HDmalloc(nelmts * (MAX(src_size, dst_size))); - saved_buf = (unsigned char *)HDmalloc(nelmts * src_size); + buf = (unsigned char *)malloc(nelmts * (MAX(src_size, dst_size))); + saved_buf = (unsigned char *)malloc(nelmts * src_size); HDmemset(buf, 0, nelmts * MAX(src_size, dst_size)); HDmemset(saved_buf, 0, nelmts * src_size); @@ -1168,9 +1168,9 @@ test_derived_flt(void) } if (buf) - HDfree(buf); + free(buf); if (saved_buf) - HDfree(saved_buf); + free(saved_buf); if (H5Tclose(tid1) < 0) { H5_FAILED(); @@ -1207,11 +1207,11 @@ test_derived_flt(void) error: if (buf) - HDfree(buf); + free(buf); if (saved_buf) - HDfree(saved_buf); + free(saved_buf); if (aligned) - HDfree(aligned); + free(aligned); HDfflush(stdout); H5E_BEGIN_TRY { @@ -1426,8 +1426,8 @@ test_derived_integer(void) src_size = H5Tget_size(tid1); dst_size = H5Tget_size(tid2); endian = H5Tget_order(tid1); - buf = (unsigned char *)HDmalloc(nelmts * (MAX(src_size, dst_size))); - saved_buf = (unsigned char *)HDmalloc(nelmts * src_size); + buf = (unsigned char *)malloc(nelmts * (MAX(src_size, dst_size))); + saved_buf = (unsigned char *)malloc(nelmts * src_size); HDmemset(buf, 0, nelmts * MAX(src_size, dst_size)); HDmemset(saved_buf, 0, nelmts * src_size); @@ -1507,8 +1507,8 @@ test_derived_integer(void) goto error; } /* end if */ - HDfree(buf); - HDfree(saved_buf); + free(buf); + free(saved_buf); PASSED(); @@ -1521,9 +1521,9 @@ test_derived_integer(void) error: if (buf) - HDfree(buf); + free(buf); if (saved_buf) - HDfree(saved_buf); + free(saved_buf); HDfflush(stdout); H5E_BEGIN_TRY { @@ -1712,7 +1712,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) dst_nbits = H5Tget_precision(dst); /* not 8*dst_size, esp on J90 - QAK */ src_sign = H5Tget_sign(src); dst_sign = H5Tget_sign(dst); - aligned = HDcalloc((size_t)1, sizeof(long long)); + aligned = calloc((size_t)1, sizeof(long long)); /* Allocate and initialize the source buffer through macro INIT_INTEGER. The BUF * will be used for the conversion while the SAVED buffer will be @@ -2572,7 +2572,7 @@ done: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); + free(aligned); HDfflush(stdout); /* Restore the default error handler (set in h5_reset()) */ @@ -2588,7 +2588,7 @@ error: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); + free(aligned); HDfflush(stdout); /* Restore the default error handler (set in h5_reset()) */ @@ -2624,7 +2624,7 @@ test_conv_int_2(void) printf("%-70s", "Testing overlap calculations"); HDfflush(stdout); - buf = (char *)HDcalloc(TMP_BUF_DIM1, TMP_BUF_DIM2); + buf = (char *)calloc(TMP_BUF_DIM1, TMP_BUF_DIM2); assert(buf); for (i = 1; i <= TMP_BUF_DIM1; i++) { @@ -2648,7 +2648,7 @@ test_conv_int_2(void) } } PASSED(); - HDfree(buf); + free(buf); return 0; } @@ -2746,7 +2746,7 @@ my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t int retval = 0; size_t i; - bits = (unsigned char *)HDcalloc((size_t)1, size); + bits = (unsigned char *)calloc((size_t)1, size); for (i = 0; i < size; i++) bits[size - (i + 1)] = *(val + ENDIAN(size, i, endian)); @@ -2755,7 +2755,7 @@ my_isinf(int endian, const unsigned char *val, size_t size, size_t mpos, size_t H5T__bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0) retval = 1; - HDfree(bits); + free(bits); return retval; } @@ -2947,7 +2947,7 @@ test_conv_flt_1(const char *name, int run_test, hid_t src, hid_t dst) dendian = H5Tget_order(dst); /* Allocate buffers */ - aligned = HDcalloc((size_t)1, MAX(sizeof(long double), sizeof(double))); + aligned = calloc((size_t)1, MAX(sizeof(long double), sizeof(double))); /* Allocate and initialize the source buffer through macro INIT_FP_NORM or INIT_FP_SPECIAL. * The BUF will be used for the conversion while the SAVED buffer will be used for @@ -3301,7 +3301,7 @@ done: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); + free(aligned); HDfflush(stdout); #ifdef HANDLE_SIGFPE if (run_test == TEST_NOOP || run_test == TEST_NORMAL) @@ -3330,7 +3330,7 @@ error: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); + free(aligned); HDfflush(stdout); #ifdef HANDLE_SIGFPE if (run_test == TEST_NOOP || run_test == TEST_NORMAL) @@ -3597,7 +3597,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) dst_size = H5Tget_size(dst); src_nbits = H5Tget_precision(src); /* not 8*src_size, esp on J90 - QAK */ dst_nbits = H5Tget_precision(dst); /* not 8*dst_size, esp on J90 - QAK */ - aligned = HDcalloc((size_t)1, MAX(sizeof(long double), sizeof(long long))); + aligned = calloc((size_t)1, MAX(sizeof(long double), sizeof(long long))); #ifdef SHOW_OVERFLOWS noverflows_g = 0; #endif @@ -4521,7 +4521,7 @@ done: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); + free(aligned); HDfflush(stdout); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -4541,7 +4541,7 @@ error: if (saved) aligned_free(saved); if (aligned) - HDfree(aligned); + free(aligned); HDfflush(stdout); /* Restore the default error handler (set in h5_reset()) */ diff --git a/test/dtransform.c b/test/dtransform.c index d435b1f..3768320 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -131,7 +131,7 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, hsize_t dim[2] = {ROWS, COLS}; \ \ /* NOTE: If this macro encounters errors, this memory will leak */ \ - if (NULL == (array = HDcalloc(1, sizeof(*array)))) \ + if (NULL == (array = calloc(1, sizeof(*array)))) \ TEST_ERROR; \ \ if ((dataspace = H5Screate_simple(2, dim, NULL)) < 0) \ @@ -210,7 +210,7 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, if (H5Sclose(dataspace) < 0) \ TEST_ERROR; \ \ - HDfree(array); \ + free(array); \ } #define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ @@ -227,7 +227,7 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, hsize_t offset[2] = {0, 0}; \ \ /* NOTE: If this macro encounters errors, this memory will leak */ \ - if (NULL == (array = HDcalloc(1, sizeof(*array)))) \ + if (NULL == (array = calloc(1, sizeof(*array)))) \ TEST_ERROR; \ \ if ((dataspace = H5Screate_simple(2, dim, NULL)) < 0) \ @@ -297,7 +297,7 @@ const int transformData[ROWS][COLS] = {{36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, if (H5Sclose(memspace) < 0) \ TEST_ERROR; \ \ - HDfree(array); \ + free(array); \ } while (0) #define INVALID_SET_TEST(TRANSFORM) \ @@ -857,7 +857,7 @@ test_getset(const hid_t dxpl_id_c_to_f) TESTING("H5Pget_data_transform"); - if (NULL == (ptrgetTest = (char *)HDmalloc(HDstrlen(simple) + 1))) + if (NULL == (ptrgetTest = (char *)malloc(HDstrlen(simple) + 1))) TEST_ERROR; if (H5Pget_data_transform(dxpl_id_c_to_f, ptrgetTest, HDstrlen(c_to_f) + 1) < 0) @@ -867,7 +867,7 @@ test_getset(const hid_t dxpl_id_c_to_f) PASSED(); - HDfree(ptrgetTest); + free(ptrgetTest); ptrgetTest = NULL; TESTING("data transform, read after resetting of transform property"); @@ -888,7 +888,7 @@ test_getset(const hid_t dxpl_id_c_to_f) TESTING("H5Pget_data_transform, after resetting transform property"); - if (NULL == (ptrgetTest = (char *)HDcalloc((size_t)1, HDstrlen(simple) + 1))) + if (NULL == (ptrgetTest = (char *)calloc((size_t)1, HDstrlen(simple) + 1))) TEST_ERROR; if (H5Pget_data_transform(dxpl_id_c_to_f, ptrgetTest, HDstrlen(simple) + 1) < 0) TEST_ERROR; @@ -897,14 +897,14 @@ test_getset(const hid_t dxpl_id_c_to_f) PASSED(); - HDfree(ptrgetTest); + free(ptrgetTest); ptrgetTest = NULL; return 0; error: if (ptrgetTest) - HDfree(ptrgetTest); + free(ptrgetTest); return -1; } @@ -919,7 +919,7 @@ test_set(void) TESTING("H5Pget_data_transform (get before set)"); - if (NULL == (ptrgetTest = (char *)HDmalloc(HDstrlen(str) + 1))) + if (NULL == (ptrgetTest = (char *)malloc(HDstrlen(str) + 1))) TEST_ERROR; if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) @@ -935,7 +935,7 @@ test_set(void) else FAIL_PUTS_ERROR(" ERROR: Data transform get before set succeeded (it shouldn't have)\n"); - HDfree(ptrgetTest); + free(ptrgetTest); ptrgetTest = NULL; TESTING("H5Pset_data_transform (set with NULL transform)"); @@ -974,7 +974,7 @@ test_set(void) error: if (ptrgetTest) - HDfree(ptrgetTest); + free(ptrgetTest); H5E_BEGIN_TRY { H5Pclose(dxpl_id); diff --git a/test/dtypes.c b/test/dtypes.c index 4de3117..bbb91c9 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -777,11 +777,11 @@ test_compound_2(void) FAIL_STACK_ERROR; /* Sizes should be the same, but be careful just in case */ - if (NULL == (buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))))) + if (NULL == (buf = (unsigned char *)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))))) goto error; - if (NULL == (bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt)))) + if (NULL == (bkg = (unsigned char *)malloc(nelmts * sizeof(struct dt)))) goto error; - if (NULL == (orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st)))) + if (NULL == (orig = (unsigned char *)malloc(nelmts * sizeof(struct st)))) goto error; for (i = 0; i < (int)nelmts; i++) { s_ptr = ((struct st *)((void *)orig)) + i; @@ -839,9 +839,9 @@ test_compound_2(void) } /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); CHECK_NMEMBS(nmembs, st, dt); PASSED(); @@ -854,9 +854,9 @@ test_compound_2(void) return 0; error: - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -904,11 +904,11 @@ test_compound_3(void) FAIL_STACK_ERROR; /* Initialize */ - if (NULL == (buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))))) + if (NULL == (buf = (unsigned char *)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))))) goto error; - if (NULL == (bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt)))) + if (NULL == (bkg = (unsigned char *)malloc(nelmts * sizeof(struct dt)))) goto error; - if (NULL == (orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st)))) + if (NULL == (orig = (unsigned char *)malloc(nelmts * sizeof(struct st)))) goto error; for (i = 0; i < (int)nelmts; i++) { s_ptr = ((struct st *)((void *)orig)) + i; @@ -963,9 +963,9 @@ test_compound_3(void) } /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); CHECK_NMEMBS(nmembs, st, dt); PASSED(); @@ -977,9 +977,9 @@ test_compound_3(void) return 0; error: - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -1031,11 +1031,11 @@ test_compound_4(void) FAIL_STACK_ERROR; /* Sizes should be the same, but be careful just in case */ - if (NULL == (buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))))) + if (NULL == (buf = (unsigned char *)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))))) goto error; - if (NULL == (bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt)))) + if (NULL == (bkg = (unsigned char *)malloc(nelmts * sizeof(struct dt)))) goto error; - if (NULL == (orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st)))) + if (NULL == (orig = (unsigned char *)malloc(nelmts * sizeof(struct st)))) goto error; for (i = 0; i < (int)nelmts; i++) { s_ptr = ((struct st *)((void *)orig)) + i; @@ -1093,9 +1093,9 @@ test_compound_4(void) } /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); CHECK_NMEMBS(nmembs, st, dt); PASSED(); @@ -1107,9 +1107,9 @@ test_compound_4(void) return 0; error: - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -1155,15 +1155,15 @@ test_compound_5(void) src_type_t src[2] = {{"one", 102, {104, 105, 106, 107}}, {"two", 202, {204, 205, 206, 207}}}; dst_type_t *dst; - void *buf = HDcalloc((size_t)2, sizeof(dst_type_t)); - void *bkg = HDcalloc((size_t)2, sizeof(dst_type_t)); + void *buf = calloc((size_t)2, sizeof(dst_type_t)); + void *bkg = calloc((size_t)2, sizeof(dst_type_t)); int retval = 1; TESTING("optimized struct converter"); if (!buf || !bkg) { - HDfree(buf); - HDfree(bkg); + free(buf); + free(bkg); return 1; } @@ -1215,8 +1215,8 @@ test_compound_5(void) } /* Free memory buffers */ - HDfree(buf); - HDfree(bkg); + free(buf); + free(bkg); return retval; } @@ -1259,11 +1259,11 @@ test_compound_6(void) FAIL_STACK_ERROR; /* Sizes should be the same, but be careful just in case */ - if (NULL == (buf = (unsigned char *)HDmalloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))))) + if (NULL == (buf = (unsigned char *)malloc(nelmts * MAX(sizeof(struct st), sizeof(struct dt))))) goto error; - if (NULL == (bkg = (unsigned char *)HDmalloc(nelmts * sizeof(struct dt)))) + if (NULL == (bkg = (unsigned char *)malloc(nelmts * sizeof(struct dt)))) goto error; - if (NULL == (orig = (unsigned char *)HDmalloc(nelmts * sizeof(struct st)))) + if (NULL == (orig = (unsigned char *)malloc(nelmts * sizeof(struct st)))) goto error; for (i = 0; i < (int)nelmts; i++) { s_ptr = ((struct st *)((void *)orig)) + i; @@ -1307,9 +1307,9 @@ test_compound_6(void) } /* Release resources */ - HDfree(buf); - HDfree(bkg); - HDfree(orig); + free(buf); + free(bkg); + free(orig); CHECK_NMEMBS(nmembs, st, dt); PASSED(); @@ -1947,7 +1947,7 @@ test_compound_9(void) rdata.i1 = rdata.i2 = 0; if (rdata.str) - HDfree(rdata.str); + free(rdata.str); if (H5Dread(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) { H5_FAILED(); @@ -1972,7 +1972,7 @@ test_compound_9(void) rdata.str = NULL; if (rdata.str) - HDfree(rdata.str); + free(rdata.str); if (H5Dclose(dset_id) < 0) goto error; @@ -2285,11 +2285,11 @@ test_compound_11(void) TEST_ERROR; /* Allocate buffers */ - if ((buf = HDmalloc(sizeof(big_t) * NTESTELEM)) == NULL) + if ((buf = malloc(sizeof(big_t) * NTESTELEM)) == NULL) TEST_ERROR; - if ((buf_orig = HDmalloc(sizeof(big_t) * NTESTELEM)) == NULL) + if ((buf_orig = malloc(sizeof(big_t) * NTESTELEM)) == NULL) TEST_ERROR; - if ((bkg = HDmalloc(sizeof(big_t) * NTESTELEM)) == NULL) + if ((bkg = malloc(sizeof(big_t) * NTESTELEM)) == NULL) TEST_ERROR; /* Initialize buffer */ @@ -2299,7 +2299,7 @@ test_compound_11(void) ((big_t *)buf)[u].d3 = (double)u * 3.5; ((big_t *)buf)[u].i1 = (int)(u * 3); ((big_t *)buf)[u].i2 = (int)(u * 5); - ((big_t *)buf)[u].s1 = (char *)HDmalloc((size_t)32); + ((big_t *)buf)[u].s1 = (char *)malloc((size_t)32); if (!((big_t *)buf)[u].s1) TEST_ERROR; HDsnprintf(((big_t *)buf)[u].s1, 32, "%u", (unsigned)u); @@ -2452,7 +2452,7 @@ test_compound_11(void) /* Free everything */ for (u = 0; u < NTESTELEM; u++) - HDfree(((big_t *)buf_orig)[u].s1); + free(((big_t *)buf_orig)[u].s1); if (H5Sclose(space_id) < 0) TEST_ERROR; if (H5Tclose(opaq_dst_tid) < 0) @@ -2475,11 +2475,11 @@ test_compound_11(void) error: if (buf) - HDfree(buf); + free(buf); if (buf_orig) - HDfree(buf_orig); + free(buf_orig); if (bkg) - HDfree(bkg); + free(bkg); return retval; } @@ -3093,12 +3093,12 @@ test_compound_14(void) rdata1.c1 = rdata1.c2 = 0; if (rdata1.str) - HDfree(rdata1.str); + free(rdata1.str); rdata2.c1 = rdata2.c2 = 0; rdata2.l1 = rdata2.l2 = rdata2.l3 = rdata2.l4 = 0; if (rdata2.str) { - HDfree(rdata2.str); + free(rdata2.str); rdata2.str = NULL; } /* end if */ @@ -4724,7 +4724,7 @@ test_conv_str_1(void) goto error; if ((dst_type = mkstr((size_t)5, H5T_STR_NULLTERM)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc((size_t)2, (size_t)10))) + if (NULL == (buf = (char *)calloc((size_t)2, (size_t)10))) goto error; HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) @@ -4741,7 +4741,7 @@ test_conv_str_1(void) HDputs(" Extended C-string test failed"); goto error; } - HDfree(buf); + free(buf); buf = NULL; if (H5Tclose(src_type) < 0) goto error; @@ -4755,7 +4755,7 @@ test_conv_str_1(void) goto error; if ((dst_type = mkstr((size_t)5, H5T_STR_NULLPAD)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc((size_t)2, (size_t)10))) + if (NULL == (buf = (char *)calloc((size_t)2, (size_t)10))) goto error; HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) @@ -4772,7 +4772,7 @@ test_conv_str_1(void) HDputs(" Extended C buffer test failed"); goto error; } - HDfree(buf); + free(buf); buf = NULL; if (H5Tclose(src_type) < 0) goto error; @@ -4786,7 +4786,7 @@ test_conv_str_1(void) goto error; if ((dst_type = mkstr((size_t)5, H5T_STR_SPACEPAD)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc((size_t)2, (size_t)10))) + if (NULL == (buf = (char *)calloc((size_t)2, (size_t)10))) goto error; HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) @@ -4803,7 +4803,7 @@ test_conv_str_1(void) HDputs(" Extended Fortran-string test failed"); goto error; } - HDfree(buf); + free(buf); buf = NULL; if (H5Tclose(src_type) < 0) goto error; @@ -4820,7 +4820,7 @@ test_conv_str_1(void) goto error; if ((dst_type = mkstr((size_t)10, H5T_STR_NULLTERM)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc((size_t)2, (size_t)10))) + if (NULL == (buf = (char *)calloc((size_t)2, (size_t)10))) goto error; HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) @@ -4849,7 +4849,7 @@ test_conv_str_1(void) HDputs(" Non-terminated string test 2"); goto error; } - HDfree(buf); + free(buf); buf = NULL; if (H5Tclose(src_type) < 0) goto error; @@ -4863,7 +4863,7 @@ test_conv_str_1(void) goto error; if ((dst_type = mkstr((size_t)10, H5T_STR_SPACEPAD)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc((size_t)2, (size_t)10))) + if (NULL == (buf = (char *)calloc((size_t)2, (size_t)10))) goto error; HDmemcpy(buf, "abcdefghi\0abcdefghi\0", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) @@ -4922,7 +4922,7 @@ test_conv_str_1(void) HDputs(" Fortran to C string test 3"); goto error; } - HDfree(buf); + free(buf); buf = NULL; if (H5Tclose(src_type) < 0) goto error; @@ -4936,7 +4936,7 @@ test_conv_str_1(void) goto error; if ((dst_type = mkstr((size_t)10, H5T_STR_SPACEPAD)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc((size_t)2, (size_t)10))) + if (NULL == (buf = (char *)calloc((size_t)2, (size_t)10))) goto error; HDmemcpy(buf, "abcdefghijabcdefghij", (size_t)20); if (H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT) < 0) @@ -4999,7 +4999,7 @@ test_conv_str_1(void) goto error; if (H5Tclose(dst_type) < 0) goto error; - HDfree(buf); + free(buf); PASSED(); @@ -5018,7 +5018,7 @@ error: H5E_END_TRY if (buf) - HDfree(buf); + free(buf); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -5058,7 +5058,7 @@ test_conv_str_2(void) goto error; if ((f_type = mkstr((size_t)8, H5T_STR_SPACEPAD)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc(nelmts, (size_t)8))) + if (NULL == (buf = (char *)calloc(nelmts, (size_t)8))) goto error; for (i = 0; i < nelmts; i++) { nchars = (size_t)(HDrand() % 8); @@ -5089,7 +5089,7 @@ error: H5E_END_TRY if (buf) - HDfree(buf); + free(buf); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -5135,7 +5135,7 @@ test_conv_str_3(void) */ if ((type = mkstr((size_t)8, H5T_STR_NULLPAD)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc(nelmts, (size_t)8))) + if (NULL == (buf = (char *)calloc(nelmts, (size_t)8))) FAIL_PUTS_ERROR("Allocation failed."); for (i = 0; i < nelmts; i++) { nchars = (size_t)(HDrand() % 8); @@ -5226,7 +5226,7 @@ error: H5E_END_TRY if (buf) - HDfree(buf); + free(buf); if (tag) H5free_memory(tag); /* Technically allocated by API call */ @@ -5277,7 +5277,7 @@ test_conv_enum_1(void) } /* end for */ /* Initialize the buffer */ - if (NULL == (buf = (int *)HDmalloc(nelmts * MAX(H5Tget_size(t1), H5Tget_size(t2))))) + if (NULL == (buf = (int *)malloc(nelmts * MAX(H5Tget_size(t1), H5Tget_size(t2))))) goto error; for (u = 0; u < nelmts; u++) buf[u] = HDrand() % 26; @@ -5308,7 +5308,7 @@ error: H5E_END_TRY if (buf) - HDfree(buf); + free(buf); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -5357,7 +5357,7 @@ test_conv_enum_2(void) H5Tenum_insert(dsttype, mname[i], &i); /* Source data */ - data = (int *)HDmalloc(NTESTELEM * sizeof(int)); + data = (int *)malloc(NTESTELEM * sizeof(int)); for (i = 0; i < NTESTELEM; i++) { ((char *)data)[i * 3 + 2] = (char)(i % 8); ((char *)data)[i * 3 + 0] = 0; @@ -5378,7 +5378,7 @@ test_conv_enum_2(void) } /* Cleanup */ - HDfree(data); + free(data); H5Tclose(srctype); H5Tclose(dsttype); H5Tclose(oddsize); @@ -5800,7 +5800,7 @@ opaque_long(void) TEST_ERROR; /* Create long tag */ - if (NULL == (long_tag = (char *)HDmalloc((size_t)(16384 + 1)))) + if (NULL == (long_tag = (char *)malloc((size_t)(16384 + 1)))) TEST_ERROR; HDmemset(long_tag, 'a', (size_t)16384); long_tag[16384] = '\0'; @@ -5819,7 +5819,7 @@ opaque_long(void) TEST_ERROR; /* Release memory for tag */ - HDfree(long_tag); + free(long_tag); return 0; @@ -5827,7 +5827,7 @@ error: if (dt > 0) H5Tclose(dt); if (long_tag) - HDfree(long_tag); + free(long_tag); H5_FAILED(); return 1; } @@ -6104,7 +6104,7 @@ test_encode(void) } if (cmpd_buf_size > 0) - cmpd_buf = (unsigned char *)HDcalloc((size_t)1, cmpd_buf_size); + cmpd_buf = (unsigned char *)calloc((size_t)1, cmpd_buf_size); /* Try decoding an incorrect (empty) buffer (should fail) */ H5E_BEGIN_TRY @@ -6155,7 +6155,7 @@ test_encode(void) } if (enum_buf_size > 0) - enum_buf = (unsigned char *)HDcalloc((size_t)1, enum_buf_size); + enum_buf = (unsigned char *)calloc((size_t)1, enum_buf_size); if (H5Tencode(tid2, enum_buf, &enum_buf_size) < 0) { H5_FAILED(); @@ -6197,7 +6197,7 @@ test_encode(void) } if (vlstr_buf_size > 0) - vlstr_buf = (unsigned char *)HDcalloc((size_t)1, vlstr_buf_size); + vlstr_buf = (unsigned char *)calloc((size_t)1, vlstr_buf_size); if (H5Tencode(tid3, vlstr_buf, &vlstr_buf_size) < 0) { H5_FAILED(); @@ -6244,7 +6244,7 @@ test_encode(void) printf("Can't close datatype\n"); goto error; } - HDfree(cmpd_buf); + free(cmpd_buf); cmpd_buf_size = 0; /* Commit enumeration datatype and close it */ @@ -6263,7 +6263,7 @@ test_encode(void) printf("Can't close datatype\n"); goto error; } - HDfree(enum_buf); + free(enum_buf); enum_buf_size = 0; /* Commit enumeration datatype and close it */ @@ -6282,7 +6282,7 @@ test_encode(void) printf("Can't close datatype\n"); goto error; } - HDfree(vlstr_buf); + free(vlstr_buf); vlstr_buf_size = 0; /* Open the dataytpe for query */ @@ -6305,7 +6305,7 @@ test_encode(void) } if (cmpd_buf_size > 0) - cmpd_buf = (unsigned char *)HDcalloc((size_t)1, cmpd_buf_size); + cmpd_buf = (unsigned char *)calloc((size_t)1, cmpd_buf_size); if (H5Tencode(tid1, cmpd_buf, &cmpd_buf_size) < 0) { H5_FAILED(); @@ -6344,7 +6344,7 @@ test_encode(void) } if (enum_buf_size > 0) - enum_buf = (unsigned char *)HDcalloc((size_t)1, enum_buf_size); + enum_buf = (unsigned char *)calloc((size_t)1, enum_buf_size); if (H5Tencode(tid2, enum_buf, &enum_buf_size) < 0) { H5_FAILED(); @@ -6386,7 +6386,7 @@ test_encode(void) } if (vlstr_buf_size > 0) - vlstr_buf = (unsigned char *)HDcalloc((size_t)1, vlstr_buf_size); + vlstr_buf = (unsigned char *)calloc((size_t)1, vlstr_buf_size); if (H5Tencode(tid3, vlstr_buf, &vlstr_buf_size) < 0) { H5_FAILED(); @@ -6400,7 +6400,7 @@ test_encode(void) printf("Can't decode VL string type\n"); goto error; } - HDfree(vlstr_buf); + free(vlstr_buf); /* Verify that the datatype was copied exactly */ if (H5Tequal(decoded_tid3, tid3) <= 0) { @@ -6519,8 +6519,8 @@ test_encode(void) goto error; } - HDfree(cmpd_buf); - HDfree(enum_buf); + free(cmpd_buf); + free(enum_buf); PASSED(); return 0; diff --git a/test/earray.c b/test/earray.c index c3c86da..0a9de79 100644 --- a/test/earray.c +++ b/test/earray.c @@ -229,7 +229,7 @@ init_tparam(earray_test_param_t *tparam, const H5EA_create_t *cparam) tparam->nsblks = 1 + (cparam->max_nelmts_bits - H5VM_log2_of2(cparam->data_blk_min_elmts)); /* Allocate information for each super block */ - tparam->sblk_info = (H5EA_sblk_info_t *)HDmalloc(sizeof(H5EA_sblk_info_t) * tparam->nsblks); + tparam->sblk_info = (H5EA_sblk_info_t *)malloc(sizeof(H5EA_sblk_info_t) * tparam->nsblks); assert(tparam->sblk_info); /* Compute information about each super block */ @@ -266,7 +266,7 @@ static int finish_tparam(earray_test_param_t *tparam) { /* Release super block information */ - HDfree(tparam->sblk_info); + free(tparam->sblk_info); tparam->sblk_info = NULL; return (0); @@ -1298,7 +1298,7 @@ eiter_fw_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_para eiter_fw_t *eiter; /* Forward element iteration object */ /* Allocate space for the element iteration object */ - eiter = (eiter_fw_t *)HDmalloc(sizeof(eiter_fw_t)); + eiter = (eiter_fw_t *)malloc(sizeof(eiter_fw_t)); assert(eiter); /* Initialize the element iteration object */ @@ -1442,7 +1442,7 @@ eiter_fw_term(void *eiter) assert(eiter); /* Free iteration object */ - HDfree(eiter); + free(eiter); return (0); } /* end eiter_fw_term() */ @@ -1485,7 +1485,7 @@ eiter_rv_init(const H5EA_create_t *cparam, const earray_test_param_t *tparam, hs eiter_rv_t *eiter; /* Reverse element iteration object */ /* Allocate space for the element iteration object */ - eiter = (eiter_rv_t *)HDmalloc(sizeof(eiter_rv_t)); + eiter = (eiter_rv_t *)malloc(sizeof(eiter_rv_t)); assert(eiter); /* Initialize reverse iteration info */ @@ -1667,7 +1667,7 @@ eiter_rv_term(void *eiter) assert(eiter); /* Free iteration object */ - HDfree(eiter); + free(eiter); return (0); } /* end eiter_rv_term() */ @@ -1709,11 +1709,11 @@ eiter_rnd_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par size_t u; /* Local index variable */ /* Allocate space for the element iteration object */ - eiter = (eiter_rnd_t *)HDmalloc(sizeof(eiter_rnd_t)); + eiter = (eiter_rnd_t *)malloc(sizeof(eiter_rnd_t)); assert(eiter); /* Allocate space for the array of shuffled indices */ - eiter->idx = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)cnt); + eiter->idx = (hsize_t *)malloc(sizeof(hsize_t) * (size_t)cnt); assert(eiter->idx); /* Initialize reverse iteration info */ @@ -1820,10 +1820,10 @@ eiter_rnd_term(void *in_eiter) assert(eiter->idx); /* Free shuffled index array */ - HDfree(eiter->idx); + free(eiter->idx); /* Free iteration object */ - HDfree(eiter); + free(eiter); return (0); } /* end eiter_rnd_term() */ @@ -1858,11 +1858,11 @@ eiter_rnd2_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_pa size_t u; /* Local index variable */ /* Allocate space for the element iteration object */ - eiter = (eiter_rnd_t *)HDmalloc(sizeof(eiter_rnd_t)); + eiter = (eiter_rnd_t *)malloc(sizeof(eiter_rnd_t)); assert(eiter); /* Allocate space for the array of shuffled indices */ - eiter->idx = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)cnt); + eiter->idx = (hsize_t *)malloc(sizeof(hsize_t) * (size_t)cnt); assert(eiter->idx); /* Initialize reverse iteration info */ @@ -1875,7 +1875,7 @@ eiter_rnd2_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_pa hsize_t sparse_cnt = (hsize_t)(cnt * EA_RND2_SCALE); /* Sparse range to choose from */ /* Allocate temporary index array */ - tmp_idx = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)sparse_cnt); + tmp_idx = (hsize_t *)malloc(sizeof(hsize_t) * (size_t)sparse_cnt); assert(tmp_idx); /* Initialize temporary index array, for shuffling */ @@ -1892,7 +1892,7 @@ eiter_rnd2_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_pa } /* end for */ /* Release temporary array */ - HDfree(tmp_idx); + free(tmp_idx); } /* end if */ else { for (u = 0; u < (size_t)cnt; u++) @@ -1940,7 +1940,7 @@ eiter_cyc_init(const H5EA_create_t H5_ATTR_UNUSED *cparam, const earray_test_par eiter_cyc_t *eiter; /* Cyclic element iteration object */ /* Allocate space for the element iteration object */ - eiter = (eiter_cyc_t *)HDmalloc(sizeof(eiter_cyc_t)); + eiter = (eiter_cyc_t *)malloc(sizeof(eiter_cyc_t)); assert(eiter); /* Initialize reverse iteration info */ @@ -2035,7 +2035,7 @@ eiter_cyc_term(void *in_eiter) assert(eiter); /* Free iteration object */ - HDfree(eiter); + free(eiter); return (0); } /* end eiter_cyc_term() */ diff --git a/test/efc.c b/test/efc.c index 1033469..229359e 100644 --- a/test/efc.c +++ b/test/efc.c @@ -2666,7 +2666,7 @@ main(void) /* Allocate memory for filenames */ for (i = 0; i < N_FILENAMES; i++) { - filename[i] = (char *)HDcalloc(PATH_MAX, sizeof(char)); + filename[i] = (char *)calloc(PATH_MAX, sizeof(char)); } /* Patch filenames */ @@ -2716,7 +2716,7 @@ main(void) h5_clean_files(FILENAME, fapl_id); for (i = 0; i < N_FILENAMES; i++) { - HDfree(filename[i]); + free(filename[i]); } return EXIT_SUCCESS; @@ -2734,7 +2734,7 @@ error: H5CX_pop(FALSE); for (i = 0; i < N_FILENAMES; i++) { - HDfree(filename[i]); + free(filename[i]); } return EXIT_FAILURE; diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 6ace51c..cd97cb9 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -41,7 +41,7 @@ test_encode_decode(hid_t orig_pl, H5F_libver_t low, H5F_libver_t high) TEST_ERROR; /* Allocate the buffer for encoding */ - if (NULL == (temp_buf = (void *)HDmalloc(temp_size))) + if (NULL == (temp_buf = (void *)malloc(temp_size))) TEST_ERROR; /* Encode the property list to the buffer */ @@ -62,7 +62,7 @@ test_encode_decode(hid_t orig_pl, H5F_libver_t low, H5F_libver_t high) /* Free the buffer */ if (temp_buf) - HDfree(temp_buf); + free(temp_buf); #ifndef H5_NO_DEPRECATED_SYMBOLS /* Test H5Pencode1() */ @@ -71,7 +71,7 @@ test_encode_decode(hid_t orig_pl, H5F_libver_t low, H5F_libver_t high) if (H5Pencode1(orig_pl, NULL, &temp_size) < 0) STACK_ERROR; - if (NULL == (temp_buf = (void *)HDmalloc(temp_size))) + if (NULL == (temp_buf = (void *)malloc(temp_size))) TEST_ERROR; if (H5Pencode1(orig_pl, temp_buf, &temp_size) < 0) @@ -87,7 +87,7 @@ test_encode_decode(hid_t orig_pl, H5F_libver_t low, H5F_libver_t high) STACK_ERROR; if (temp_buf) - HDfree(temp_buf); + free(temp_buf); #endif /* H5_NO_DEPRECATED_SYMBOLS */ if ((H5Pclose(fapl)) < 0) @@ -98,7 +98,7 @@ test_encode_decode(hid_t orig_pl, H5F_libver_t low, H5F_libver_t high) error: if (temp_buf) - HDfree(temp_buf); + free(temp_buf); H5E_BEGIN_TRY { diff --git a/test/enc_dec_plist_cross_platform.c b/test/enc_dec_plist_cross_platform.c index 7092dc4..81464cb 100644 --- a/test/enc_dec_plist_cross_platform.c +++ b/test/enc_dec_plist_cross_platform.c @@ -180,7 +180,7 @@ test_plists(const char *filename_prefix) TEST_ERROR; size_1 = (size_t)HDlseek(fd_1, (HDoff_t)0, SEEK_END); HDlseek(fd_1, (HDoff_t)0, SEEK_SET); - buf_1 = (void *)HDmalloc(size_1); + buf_1 = (void *)malloc(size_1); if (HDread(fd_1, buf_1, size_1) < 0) TEST_ERROR; HDclose(fd_1); @@ -196,7 +196,7 @@ test_plists(const char *filename_prefix) TEST_ERROR; size_2 = (size_t)HDlseek(fd_2, (HDoff_t)0, SEEK_END); HDlseek(fd_2, (HDoff_t)0, SEEK_SET); - buf_2 = (void *)HDmalloc(size_2); + buf_2 = (void *)malloc(size_2); if (HDread(fd_2, buf_2, size_2) < 0) TEST_ERROR; HDclose(fd_2); @@ -217,8 +217,8 @@ test_plists(const char *filename_prefix) if ((H5Pclose(plist_2)) < 0) FAIL_STACK_ERROR; - HDfree(buf_1); - HDfree(buf_2); + free(buf_1); + free(buf_2); } /* end for */ return 1; diff --git a/test/err_compat.c b/test/err_compat.c index 4285b05..5f6378f 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -469,16 +469,16 @@ main(void) fapl_id = h5_fileaccess(); /* Set up data arrays */ - if (NULL == (ipoints2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int)))) + if (NULL == (ipoints2_data = (int *)calloc(DIM0 * DIM1, sizeof(int)))) TEST_ERROR; - if (NULL == (ipoints2 = (int **)HDcalloc(DIM0, sizeof(ipoints2_data)))) + if (NULL == (ipoints2 = (int **)calloc(DIM0, sizeof(ipoints2_data)))) TEST_ERROR; for (i = 0; i < DIM0; i++) ipoints2[i] = ipoints2_data + (i * DIM1); - if (NULL == (icheck2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int)))) + if (NULL == (icheck2_data = (int *)calloc(DIM0 * DIM1, sizeof(int)))) TEST_ERROR; - if (NULL == (icheck2 = (int **)HDcalloc(DIM0, sizeof(icheck2_data)))) + if (NULL == (icheck2 = (int **)calloc(DIM0, sizeof(icheck2_data)))) TEST_ERROR; for (i = 0; i < DIM0; i++) icheck2[i] = icheck2_data + (i * DIM1); @@ -518,19 +518,19 @@ main(void) TEST_ERROR; h5_clean_files(FILENAME, fapl_id); - HDfree(ipoints2); - HDfree(ipoints2_data); - HDfree(icheck2); - HDfree(icheck2_data); + free(ipoints2); + free(ipoints2_data); + free(icheck2); + free(icheck2_data); printf("All error API tests passed.\n"); return EXIT_SUCCESS; error: - HDfree(ipoints2); - HDfree(ipoints2_data); - HDfree(icheck2); - HDfree(icheck2_data); + free(ipoints2); + free(ipoints2_data); + free(icheck2); + free(icheck2_data); H5E_BEGIN_TRY { diff --git a/test/error_test.c b/test/error_test.c index 5578af4..ae46c62 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -184,9 +184,9 @@ init_error(void) char *msg = NULL; H5E_type_t msg_type; - if (NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1))) + if (NULL == (cls_name = (char *)malloc(HDstrlen(ERR_CLS_NAME) + 1))) TEST_ERROR; - if (NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) + if (NULL == (msg = (char *)malloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) TEST_ERROR; if ((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) @@ -226,16 +226,16 @@ init_error(void) if ((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) TEST_ERROR; - HDfree(cls_name); - HDfree(msg); + free(cls_name); + free(msg); return 0; error: if (cls_name) - HDfree(cls_name); + free(cls_name); if (msg) - HDfree(msg); + free(msg); return -1; } /* end init_error() */ @@ -329,9 +329,9 @@ test_long_desc(void) const char *test_FUNC = "test_long_desc"; /* Allocate space for the error description info */ - if (NULL == (long_desc = (char *)HDmalloc(LONG_DESC_SIZE))) + if (NULL == (long_desc = (char *)malloc(LONG_DESC_SIZE))) TEST_ERROR; - if (NULL == (full_desc = (char *)HDmalloc(LONG_DESC_SIZE + 128))) + if (NULL == (full_desc = (char *)malloc(LONG_DESC_SIZE + 128))) TEST_ERROR; /* Create the long part of the error description */ @@ -361,16 +361,16 @@ test_long_desc(void) if (H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR; - HDfree(long_desc); - HDfree(full_desc); + free(long_desc); + free(full_desc); return 0; error: if (long_desc) - HDfree(long_desc); + free(long_desc); if (full_desc) - HDfree(full_desc); + free(full_desc); return -1; } /* end test_long_desc() */ @@ -803,16 +803,16 @@ main(void) TEST_ERROR; /* Set up data arrays */ - if (NULL == (ipoints2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int)))) + if (NULL == (ipoints2_data = (int *)calloc(DIM0 * DIM1, sizeof(int)))) TEST_ERROR; - if (NULL == (ipoints2 = (int **)HDcalloc(DIM0, sizeof(ipoints2_data)))) + if (NULL == (ipoints2 = (int **)calloc(DIM0, sizeof(ipoints2_data)))) TEST_ERROR; for (i = 0; i < DIM0; i++) ipoints2[i] = ipoints2_data + (i * DIM1); - if (NULL == (icheck2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int)))) + if (NULL == (icheck2_data = (int *)calloc(DIM0 * DIM1, sizeof(int)))) TEST_ERROR; - if (NULL == (icheck2 = (int **)HDcalloc(DIM0, sizeof(icheck2_data)))) + if (NULL == (icheck2 = (int **)calloc(DIM0, sizeof(icheck2_data)))) TEST_ERROR; for (i = 0; i < DIM0; i++) icheck2[i] = icheck2_data + (i * DIM1); @@ -895,19 +895,19 @@ main(void) h5_clean_files(FILENAME, fapl); - HDfree(ipoints2); - HDfree(ipoints2_data); - HDfree(icheck2); - HDfree(icheck2_data); + free(ipoints2); + free(ipoints2_data); + free(icheck2); + free(icheck2_data); fprintf(stderr, "\nAll error API tests passed.\n"); return 0; error: - HDfree(ipoints2); - HDfree(ipoints2_data); - HDfree(icheck2); - HDfree(icheck2_data); + free(ipoints2); + free(ipoints2_data); + free(icheck2); + free(icheck2_data); fprintf(stderr, "\n***** ERROR TEST FAILED (real problem)! *****\n"); return 1; diff --git a/test/evict_on_close.c b/test/evict_on_close.c index af87c37..7d3442f 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -151,7 +151,7 @@ generate_eoc_test_file(hid_t fapl_id) TEST_ERROR; /* Create a data buffer for dataset writes */ - if (NULL == (data = (int *)HDcalloc(NELEMENTS, sizeof(int)))) + if (NULL == (data = (int *)calloc(NELEMENTS, sizeof(int)))) TEST_ERROR; /* Create file */ @@ -546,7 +546,7 @@ generate_eoc_test_file(hid_t fapl_id) if (H5Pclose(fapl_copy_id) < 0) TEST_ERROR; - HDfree(data); + free(data); PASSED(); return fid; @@ -564,7 +564,7 @@ error: } H5E_END_TRY - HDfree(data); + free(data); H5_FAILED(); return -1; @@ -712,7 +712,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) TEST_ERROR; /* Create the data buffer */ - if (NULL == (data = (int *)HDcalloc(NELEMENTS, sizeof(int)))) + if (NULL == (data = (int *)calloc(NELEMENTS, sizeof(int)))) TEST_ERROR; /* Record the number of cache entries */ @@ -771,7 +771,7 @@ check_dset_scheme(hid_t fid, const char *dset_name) if (before != after || before == during) TEST_ERROR; - HDfree(data); + free(data); PASSED(); return SUCCEED; diff --git a/test/extend.c b/test/extend.c index 5735266..f544342 100644 --- a/test/extend.c +++ b/test/extend.c @@ -271,16 +271,16 @@ main(void) fapl = h5_fileaccess(); /* Initialize buffer and space */ - if (NULL == (buf1_data = (int *)HDcalloc(N1X * N1Y, sizeof(int)))) + if (NULL == (buf1_data = (int *)calloc(N1X * N1Y, sizeof(int)))) TEST_ERROR; - if (NULL == (buf1 = (int **)HDcalloc(N1X, sizeof(buf1_data)))) + if (NULL == (buf1 = (int **)calloc(N1X, sizeof(buf1_data)))) TEST_ERROR; for (i = 0; i < N1X; i++) buf1[i] = buf1_data + (i * N1Y); - if (NULL == (buf2_data = (int *)HDcalloc(N2X * N2Y, sizeof(int)))) + if (NULL == (buf2_data = (int *)calloc(N2X * N2Y, sizeof(int)))) TEST_ERROR; - if (NULL == (buf2 = (int **)HDcalloc(N2X, sizeof(buf2_data)))) + if (NULL == (buf2 = (int **)calloc(N2X, sizeof(buf2_data)))) TEST_ERROR; for (i = 0; i < N2X; i++) buf2[i] = buf2_data + (i * N2Y); @@ -345,19 +345,19 @@ main(void) printf("All extend tests passed.\n"); h5_cleanup(FILENAME, fapl); - HDfree(buf1); - HDfree(buf1_data); - HDfree(buf2); - HDfree(buf2_data); + free(buf1); + free(buf1_data); + free(buf2); + free(buf2_data); HDexit(EXIT_SUCCESS); error: - HDfree(buf1); - HDfree(buf1_data); - HDfree(buf2); - HDfree(buf2_data); + free(buf1); + free(buf1_data); + free(buf2); + free(buf2_data); printf("*** One or more extend tests failed ***\n"); HDexit(EXIT_FAILURE); diff --git a/test/external.c b/test/external.c index 04686fe..5412469 100644 --- a/test/external.c +++ b/test/external.c @@ -1362,7 +1362,7 @@ test_h5d_get_access_plist(hid_t fapl_id) FAIL_STACK_ERROR; /* Check the value for the external prefix */ - if ((buffer = (char *)HDcalloc((size_t)64, sizeof(char))) == NULL) + if ((buffer = (char *)calloc((size_t)64, sizeof(char))) == NULL) TEST_ERROR; if (H5Pget_efile_prefix(dapl_id, buffer, (size_t)64) < 0) FAIL_STACK_ERROR; @@ -1370,7 +1370,7 @@ test_h5d_get_access_plist(hid_t fapl_id) FAIL_PUTS_ERROR("external file prefix from dapl incorrect"); /* Close everything */ - HDfree(buffer); + free(buffer); if (H5Sclose(sid) < 0) FAIL_STACK_ERROR; if (H5Dclose(did) < 0) @@ -1387,7 +1387,7 @@ test_h5d_get_access_plist(hid_t fapl_id) error: if (buffer) - HDfree(buffer); + free(buffer); H5E_BEGIN_TRY { H5Dclose(did); diff --git a/test/external_common.c b/test/external_common.c index 7d72605..25bf43e 100644 --- a/test/external_common.c +++ b/test/external_common.c @@ -46,7 +46,7 @@ reset_raw_data_files(hbool_t is_env) /* Set up garbage buffer */ garbage_count = N_EXT_FILES * GARBAGE_PER_FILE; - if (NULL == (garbage = (uint8_t *)HDcalloc(garbage_count, sizeof(uint8_t)))) + if (NULL == (garbage = (uint8_t *)calloc(garbage_count, sizeof(uint8_t)))) goto error; for (i = 0; i < garbage_count; i++) garbage[i] = 0xFF; @@ -113,13 +113,13 @@ reset_raw_data_files(hbool_t is_env) HDclose(fd); } /* end for */ - HDfree(garbage); + free(garbage); return SUCCEED; error: if (fd) HDclose(fd); if (garbage) - HDfree(garbage); + free(garbage); return FAIL; } diff --git a/test/farray.c b/test/farray.c index 39cd014..e37e00e 100644 --- a/test/farray.c +++ b/test/farray.c @@ -982,7 +982,7 @@ fiter_fw_init(const H5FA_create_t H5_ATTR_UNUSED *cparam, const farray_test_para fiter_fw_t *fiter; /* Forward element iteration object */ /* Allocate space for the element iteration object */ - fiter = (fiter_fw_t *)HDmalloc(sizeof(fiter_fw_t)); + fiter = (fiter_fw_t *)malloc(sizeof(fiter_fw_t)); assert(fiter); /* Initialize the element iteration object */ @@ -1034,7 +1034,7 @@ fiter_term(void *fiter) assert(fiter); /* Free iteration object */ - HDfree(fiter); + free(fiter); return (0); } /* end fiter_term() */ @@ -1068,7 +1068,7 @@ fiter_rv_init(const H5FA_create_t *cparam, const farray_test_param_t H5_ATTR_UNU fiter_rv_t *fiter; /* Reverse element iteration object */ /* Allocate space for the element iteration object */ - fiter = (fiter_rv_t *)HDmalloc(sizeof(fiter_rv_t)); + fiter = (fiter_rv_t *)malloc(sizeof(fiter_rv_t)); assert(fiter); /* Initialize reverse iteration info */ @@ -1134,11 +1134,11 @@ fiter_rnd_init(const H5FA_create_t H5_ATTR_UNUSED *cparam, const farray_test_par size_t u; /* Local index variable */ /* Allocate space for the element iteration object */ - fiter = (fiter_rnd_t *)HDmalloc(sizeof(fiter_rnd_t)); + fiter = (fiter_rnd_t *)malloc(sizeof(fiter_rnd_t)); assert(fiter); /* Allocate space for the array of shuffled indices */ - fiter->idx = (hsize_t *)HDmalloc(sizeof(hsize_t) * (size_t)cnt); + fiter->idx = (hsize_t *)malloc(sizeof(hsize_t) * (size_t)cnt); assert(fiter->idx); /* Initialize reverse iteration info */ @@ -1209,10 +1209,10 @@ fiter_rnd_term(void *_fiter) assert(fiter->idx); /* Free shuffled index array */ - HDfree(fiter->idx); + free(fiter->idx); /* Free iteration object */ - HDfree(fiter); + free(fiter); return (0); } /* end fiter_rnd_term() */ @@ -1248,7 +1248,7 @@ fiter_cyc_init(const H5FA_create_t H5_ATTR_UNUSED *cparam, const farray_test_par fiter_cyc_t *fiter; /* Cyclic element iteration object */ /* Allocate space for the element iteration object */ - fiter = (fiter_cyc_t *)HDmalloc(sizeof(fiter_cyc_t)); + fiter = (fiter_cyc_t *)malloc(sizeof(fiter_cyc_t)); assert(fiter); /* Initialize reverse iteration info */ diff --git a/test/fheap.c b/test/fheap.c index 6aa3919..3ce2209 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -7622,9 +7622,9 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); /* Set up data array */ - if (NULL == (heap_id_data = (unsigned char *)HDcalloc(100 * MAX_HEAP_ID_LEN, sizeof(unsigned char)))) + if (NULL == (heap_id_data = (unsigned char *)calloc(100 * MAX_HEAP_ID_LEN, sizeof(unsigned char)))) TEST_ERROR; - if (NULL == (heap_id = (unsigned char **)HDcalloc(100, sizeof(heap_id_data)))) + if (NULL == (heap_id = (unsigned char **)calloc(100, sizeof(heap_id_data)))) TEST_ERROR; for (i = 0; i < 100; i++) heap_id[i] = heap_id_data + (i * MAX_HEAP_ID_LEN); @@ -7695,8 +7695,8 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ /* All tests passed */ PASSED(); - HDfree(heap_id); - HDfree(heap_id_data); + free(heap_id); + free(heap_id_data); return 0; @@ -7709,8 +7709,8 @@ error: } H5E_END_TRY - HDfree(heap_id); - HDfree(heap_id_data); + free(heap_id); + free(heap_id_data); return 1; } /* test_man_incr_insert_remove() */ diff --git a/test/file_image.c b/test/file_image.c index a43f176..28f56d4 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -102,7 +102,7 @@ test_properties(void) * not be the case. */ size = (size_t)count * sizeof(char); - if (NULL == (buffer = (char *)HDmalloc(size))) + if (NULL == (buffer = (char *)malloc(size))) TEST_ERROR; for (i = 0; i < count - 1; i++) buffer[i] = (char)(65 + i); @@ -158,7 +158,7 @@ error: retval = 1; if (H5Pclose(fapl_2) < 0) retval = 1; - HDfree(buffer); + free(buffer); H5free_memory(temp); H5free_memory(temp2); @@ -187,7 +187,7 @@ malloc_cb(size_t size, H5FD_file_image_op_t op, void *udata) u->used_callbacks |= MALLOC; u->malloc_src = op; - return HDmalloc(size); + return malloc(size); } /****************************************************************************** @@ -231,7 +231,7 @@ realloc_cb(void *ptr, size_t size, H5FD_file_image_op_t op, void *udata) u->used_callbacks |= REALLOC; u->realloc_src = op; - return HDrealloc(ptr, size); + return realloc(ptr, size); } /****************************************************************************** @@ -251,7 +251,7 @@ free_cb(void *ptr, H5FD_file_image_op_t op, void *udata) u->used_callbacks |= FREE; u->free_src = op; - HDfree(ptr); + free(ptr); return (SUCCEED); } @@ -349,7 +349,7 @@ test_callbacks(void) TESTING("Callback use in property list operations"); /* Allocate and initialize udata */ - udata = (udata_t *)HDmalloc(sizeof(udata_t)); + udata = (udata_t *)malloc(sizeof(udata_t)); VERIFY(udata != NULL, "udata malloc failed"); reset_udata(udata); @@ -358,7 +358,7 @@ test_callbacks(void) /* Allocate and initialize file image buffer */ size = (size_t)count * sizeof(char); - file_image = (char *)HDmalloc(size); + file_image = (char *)malloc(size); VERIFY(file_image != NULL, "file_image malloc failed"); for (i = 0; i < count - 1; i++) file_image[i] = (char)(65 + i); @@ -523,16 +523,16 @@ test_callbacks(void) /* Close stuff */ if (H5Pclose(fapl_1) < 0) FAIL_STACK_ERROR; - HDfree(file_image); - HDfree(temp_file_image); - HDfree(udata); + free(file_image); + free(temp_file_image); + free(udata); PASSED(); return 0; error: - HDfree(file_image); - HDfree(udata); + free(file_image); + free(udata); return 1; } /* test_callbacks() */ @@ -592,7 +592,7 @@ test_core(void) VERIFY(ret >= 0, "h5_make_local_copy"); /* Allocate and initialize udata */ - udata = (udata_t *)HDmalloc(sizeof(udata_t)); + udata = (udata_t *)malloc(sizeof(udata_t)); VERIFY(udata != NULL, "udata malloc failed"); /* copy the address of the udata into the callbacks structure */ @@ -661,7 +661,7 @@ test_core(void) ret = HDfstat(fd, &sb); VERIFY(ret == 0, "fstat failed"); size = (size_t)sb.st_size; - file_image = (unsigned char *)HDmalloc(size); + file_image = (unsigned char *)malloc(size); if (HDread(fd, file_image, size) < 0) FAIL_PUTS_ERROR("unable to read from file descriptor"); ret = HDclose(fd); @@ -679,8 +679,8 @@ test_core(void) /* Release resources */ h5_clean_files(FILENAME, fapl); - HDfree(udata); - HDfree(file_image); + free(udata); + free(file_image); HDremove(copied_filename); PASSED(); @@ -785,8 +785,8 @@ test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl VERIFY(image_size > 0, "H5Fget_file_image(1) failed."); /* allocate a buffer of the appropriate size */ - image_ptr = HDmalloc((size_t)image_size); - VERIFY(image_ptr != NULL, "HDmalloc(1) failed."); + image_ptr = malloc((size_t)image_size); + VERIFY(image_ptr != NULL, "malloc(1) failed."); /* load the image of the file into the buffer */ bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_size); @@ -835,8 +835,8 @@ test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl VERIFY(file_size >= image_size, "file size != image size."); /* allocate a buffer for the test file image */ - file_image_ptr = HDmalloc((size_t)file_size); - VERIFY(file_image_ptr != NULL, "HDmalloc(2f) failed."); + file_image_ptr = malloc((size_t)file_size); + VERIFY(file_image_ptr != NULL, "malloc(2f) failed."); size_remaining = image_size; insertion_ptr = file_image_ptr; @@ -893,8 +893,8 @@ test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl VERIFY(file_size == image_size, "file size != image size."); /* allocate a buffer for the test file image */ - file_image_ptr = HDmalloc((size_t)file_size); - VERIFY(file_image_ptr != NULL, "HDmalloc(2) failed."); + file_image_ptr = malloc((size_t)file_size); + VERIFY(file_image_ptr != NULL, "malloc(2) failed."); /* open the test file using standard I/O calls */ fd = HDopen(file_name, O_RDONLY); @@ -958,11 +958,11 @@ test_get_file_image(const char *test_banner, const int file_name_num, hid_t fapl /* discard the image buffer if it exists */ if (image_ptr != NULL) - HDfree(image_ptr); + free(image_ptr); /* discard the image buffer if it exists */ if (file_image_ptr != NULL) - HDfree(file_image_ptr); + free(file_image_ptr); PASSED(); @@ -1061,8 +1061,8 @@ test_get_file_image_error_rejection(void) VERIFY(image_size > 0, "H5Fget_file_image(1 -- test 1) failed."); /* allocate a buffer of the appropriate size */ - image_ptr = HDmalloc((size_t)image_size); - VERIFY(image_ptr != NULL, "HDmalloc(1) failed."); + image_ptr = malloc((size_t)image_size); + VERIFY(image_ptr != NULL, "malloc(1) failed."); /* load the image of the file into the buffer */ H5E_BEGIN_TRY @@ -1107,7 +1107,7 @@ test_get_file_image_error_rejection(void) /* discard the image buffer if it exists */ if (image_ptr != NULL) - HDfree(image_ptr); + free(image_ptr); /************************** Test #2 **********************************/ /* set up a multi file driver test file, and try to get its image diff --git a/test/fillval.c b/test/fillval.c index 03815e4..661b2b6 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -323,7 +323,7 @@ test_getset_vl(hid_t fapl) TEST_ERROR; /* Release the fill value retrieved */ - HDfree(f2); + free(f2); /* Open file. */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -365,7 +365,7 @@ test_getset_vl(hid_t fapl) TEST_ERROR; /* Release the fill value retrieved */ - HDfree(f2); + free(f2); /* Close IDs */ if (H5Dclose(datasetid) < 0) @@ -970,7 +970,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f if (datatype == H5T_INTEGER) { /*check for overflow*/ assert((nelmts * sizeof(int)) == (hsize_t)((size_t)(nelmts * sizeof(int)))); - buf = (int *)HDmalloc((size_t)(nelmts * sizeof(int))); + buf = (int *)malloc((size_t)(nelmts * sizeof(int))); if (H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0) goto error; @@ -996,7 +996,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f else if (datatype == H5T_COMPOUND) { /*check for overflow*/ assert((nelmts * sizeof(comp_datatype)) == (hsize_t)((size_t)(nelmts * sizeof(comp_datatype)))); - buf_c = (comp_datatype *)HDmalloc((size_t)nelmts * sizeof(comp_datatype)); + buf_c = (comp_datatype *)malloc((size_t)nelmts * sizeof(comp_datatype)); if (H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, buf_c) < 0) goto error; @@ -1054,7 +1054,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f printf(" Got %d\n", allocation); goto error; } - HDfree(buf); + free(buf); buf = NULL; H5Sclose(mspace); @@ -1153,7 +1153,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, H5D_f } /* end for datatype==H5T_COMPOUND */ } if (datatype == H5T_COMPOUND) { - HDfree(buf_c); + free(buf_c); buf_c = NULL; } /* end if */ @@ -1556,8 +1556,8 @@ test_extend_release_cmpd_vl(void *_elmt) comp_vl_datatype *elmt = (comp_vl_datatype *)_elmt; /* Element to free */ /* Free memory for string fields */ - HDfree(elmt->a); - HDfree(elmt->b); + free(elmt->a); + free(elmt->b); return 0; } /* end test_extend_release_integer() */ @@ -1694,7 +1694,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t assert((nelmts * val_size) == (hsize_t)((size_t)(nelmts * val_size))); /* Allocate & initialize buffer */ - buf = HDmalloc((size_t)(nelmts * val_size)); + buf = malloc((size_t)(nelmts * val_size)); init_rtn(buf, nelmts, init_val); /* Create dataspace describing memory buffer */ @@ -2000,9 +2000,9 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t for (i = 0; i < nelmts; i++) release_rtn((void *)((char *)buf + (val_size * i))); - HDfree(init_val_c.a); - HDfree(init_val_c.b); - HDfree(buf); + free(init_val_c.a); + free(init_val_c.b); + free(buf); /* Cleanup IDs */ if (H5Pclose(dcpl) < 0) @@ -2015,9 +2015,9 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name, const hsize_t return 0; error: - HDfree(init_val_c.a); - HDfree(init_val_c.b); - HDfree(buf); + free(init_val_c.a); + free(init_val_c.b); + free(buf); H5E_BEGIN_TRY { @@ -2159,16 +2159,16 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout) if (H5Fclose(file) < 0) TEST_ERROR; - HDfree(fillval_c.a); - HDfree(fillval_c.b); + free(fillval_c.a); + free(fillval_c.b); PASSED(); return 0; error: - HDfree(fillval_c.a); - HDfree(fillval_c.b); + free(fillval_c.a); + free(fillval_c.b); H5E_BEGIN_TRY { @@ -2180,8 +2180,8 @@ error: return 1; skip: - HDfree(fillval_c.a); - HDfree(fillval_c.b); + free(fillval_c.a); + free(fillval_c.b); H5E_BEGIN_TRY { diff --git a/test/filter_plugin.c b/test/filter_plugin.c index f1ef4f3..a467a1e 100644 --- a/test/filter_plugin.c +++ b/test/filter_plugin.c @@ -84,9 +84,9 @@ free_2D_array(int ***arr) { if (arr && *arr && (*arr)[0]) - HDfree((*arr)[0]); + free((*arr)[0]); if (arr && *arr) - HDfree(*arr); + free(*arr); *arr = NULL; return SUCCEED; @@ -114,9 +114,9 @@ allocate_and_init_2D_array(int ***arr, const hsize_t *sizes, int **initial_value c = (size_t)sizes[1]; /* Allocate and set up pseudo-2D array */ - if (NULL == (*arr = (int **)HDcalloc(r, sizeof(int *)))) + if (NULL == (*arr = (int **)calloc(r, sizeof(int *)))) TEST_ERROR; - if (NULL == ((*arr)[0] = (int *)HDcalloc(r * c, sizeof(int)))) + if (NULL == ((*arr)[0] = (int *)calloc(r * c, sizeof(int)))) TEST_ERROR; for (i = 0; i < r; i++) (*arr)[i] = (**arr + c * i); @@ -212,7 +212,7 @@ ensure_filter_works(hid_t fid, const char *name, hid_t dcpl_id) */ if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; - if (NULL == (tconv_buf = HDcalloc((size_t)1000, sizeof(char)))) + if (NULL == (tconv_buf = calloc((size_t)1000, sizeof(char)))) TEST_ERROR; if (H5Pset_buffer(dxpl_id, (size_t)1000, tconv_buf, NULL) < 0) TEST_ERROR; @@ -400,7 +400,7 @@ ensure_filter_works(hid_t fid, const char *name, hid_t dcpl_id) free_2D_array(&orig); free_2D_array(&read); - HDfree(tconv_buf); + free(tconv_buf); return SUCCEED; @@ -420,7 +420,7 @@ error: free_2D_array(&read); if (tconv_buf) - HDfree(tconv_buf); + free(tconv_buf); return FAIL; } /* end ensure_filter_works() */ diff --git a/test/flush1.c b/test/flush1.c index ea8cbb9..54fa738 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -138,7 +138,7 @@ add_dset_to_file(hid_t fid, const char *dset_name) STACK_ERROR; /* Write some data */ - if (NULL == (data = (int *)HDcalloc((size_t)NELEMENTS, sizeof(int)))) + if (NULL == (data = (int *)calloc((size_t)NELEMENTS, sizeof(int)))) STACK_ERROR; for (i = 0; i < NELEMENTS; i++) data[i] = i; @@ -152,7 +152,7 @@ add_dset_to_file(hid_t fid, const char *dset_name) if (H5Dclose(did) < 0) STACK_ERROR; - HDfree(data); + free(data); return SUCCEED; @@ -165,7 +165,7 @@ error: } H5E_END_TRY - HDfree(data); + free(data); return FAIL; } /* end add_dset_to_file() */ diff --git a/test/flush2.c b/test/flush2.c index 8c3358e..7d28bdb 100644 --- a/test/flush2.c +++ b/test/flush2.c @@ -77,7 +77,7 @@ dset_ok(hid_t fid, const char *dset_name) goto error; /* Read the data */ - if (NULL == (data = (int *)HDcalloc((size_t)NELEMENTS, sizeof(int)))) + if (NULL == (data = (int *)calloc((size_t)NELEMENTS, sizeof(int)))) goto error; if (H5Dread(did, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) goto error; @@ -90,7 +90,7 @@ dset_ok(hid_t fid, const char *dset_name) if (H5Dclose(did) < 0) goto error; - HDfree(data); + free(data); return TRUE; @@ -102,7 +102,7 @@ error: } H5E_END_TRY - HDfree(data); + free(data); return FALSE; } /* end dset_ok() */ diff --git a/test/freespace.c b/test/freespace.c index 4a0856d..9245e10 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -269,7 +269,7 @@ static herr_t TEST_sect_free(H5FS_section_info_t *sect) { /* Release the section */ - HDfree(sect); + free(sect); return 0; } /* TEST_sect_free() */ @@ -632,7 +632,7 @@ test_fs_sect_add(hid_t fapl) if (!H5_addr_defined(fs_addr)) TEST_ERROR; - if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, @@ -698,7 +698,7 @@ test_fs_sect_add(hid_t fapl) TEST_ERROR; /* Create free list section node */ - if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, @@ -772,7 +772,7 @@ test_fs_sect_add(hid_t fapl) if (!H5_addr_defined(fs_addr)) TEST_ERROR; - if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; /* @@ -842,7 +842,7 @@ test_fs_sect_add(hid_t fapl) if (!H5_addr_defined(fs_addr)) TEST_ERROR; - if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; /* @@ -1001,7 +1001,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, @@ -1021,7 +1021,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section C */ - if (NULL == (sect_node3 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node3 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, @@ -1040,7 +1040,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, @@ -1059,7 +1059,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section D */ - if (NULL == (sect_node4 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node4 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, @@ -1128,7 +1128,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, @@ -1148,7 +1148,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, @@ -1207,7 +1207,7 @@ test_fs_sect_find(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, @@ -1355,7 +1355,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section C */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, @@ -1375,7 +1375,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, @@ -1393,7 +1393,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node3 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node3 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, @@ -1411,7 +1411,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section D */ - if (NULL == (sect_node4 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node4 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, @@ -1484,7 +1484,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, @@ -1504,7 +1504,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, @@ -1587,7 +1587,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, @@ -1607,7 +1607,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, @@ -1627,7 +1627,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section C */ - if (NULL == (sect_node3 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node3 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, @@ -1645,7 +1645,7 @@ test_fs_sect_merge(hid_t fapl) /* * Add section D */ - if (NULL == (sect_node4 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node4 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, @@ -1833,7 +1833,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section A that allow shrinking but its section class type does not define "can_shrink" */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, @@ -1868,7 +1868,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Re-add section A that allow shrinking and its section class type defines "can_shrink" */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, @@ -1935,7 +1935,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, @@ -1955,7 +1955,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, @@ -2035,7 +2035,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, @@ -2055,7 +2055,7 @@ test_fs_sect_shrink(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, @@ -2177,7 +2177,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, @@ -2197,7 +2197,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, @@ -2281,7 +2281,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, @@ -2293,7 +2293,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, @@ -2305,7 +2305,7 @@ test_fs_sect_change_class(hid_t fapl) /* * Add section C */ - if (NULL == (sect_node3 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node3 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, @@ -2465,7 +2465,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, @@ -2485,7 +2485,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, @@ -2542,7 +2542,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, @@ -2562,7 +2562,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, @@ -2616,7 +2616,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, @@ -2636,7 +2636,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, @@ -2691,7 +2691,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section A */ - if (NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node1 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, @@ -2711,7 +2711,7 @@ test_fs_sect_extend(hid_t fapl) /* * Add section B */ - if (NULL == (sect_node2 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node2 = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, @@ -2822,7 +2822,7 @@ test_fs_sect_iterate(hid_t fapl) TEST_ERROR; for (i = 1; i <= NUM_SECTIONS; i++) { - if (NULL == (sect_node = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t)))) + if (NULL == (sect_node = (TEST_free_section_t *)malloc(sizeof(TEST_free_section_t)))) FAIL_STACK_ERROR; sect_size = (unsigned)((i - 1) % 9) + 1; diff --git a/test/gen_bounds.c b/test/gen_bounds.c index 4ff9799..1198694 100644 --- a/test/gen_bounds.c +++ b/test/gen_bounds.c @@ -148,7 +148,7 @@ gen_earliest_latest(void) /* * Add a chunked dataset with layout version 3 (default) */ - buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + buf = (float *)malloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); if (buf == NULL) TEST_ERROR; @@ -210,7 +210,7 @@ gen_earliest_latest(void) TEST_ERROR; /* Release allocated buffer */ - HDfree(buf); + free(buf); bufp = buf = NULL; /* Close everything */ @@ -234,7 +234,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); - HDfree(buf); + free(buf); } H5E_END_TRY return FAIL; @@ -293,7 +293,7 @@ gen_earliest_v18(void) * Add a chunked dataset with layout version 3 (default) */ - buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + buf = (float *)malloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); if (buf == NULL) TEST_ERROR; @@ -325,7 +325,7 @@ gen_earliest_v18(void) TEST_ERROR; /* Release allocated buffer */ - HDfree(buf); + free(buf); bufp = buf = NULL; /* Close everything */ @@ -349,7 +349,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); - HDfree(buf); + free(buf); } H5E_END_TRY return FAIL; @@ -402,7 +402,7 @@ gen_latest_latest(void) * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts) */ - buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + buf = (float *)malloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); if (buf == NULL) TEST_ERROR; @@ -437,7 +437,7 @@ gen_latest_latest(void) TEST_ERROR; /* Release allocated buffer */ - HDfree(buf); + free(buf); bufp = buf = NULL; /* Close everything */ @@ -459,7 +459,7 @@ error: H5Sclose(space); H5Pclose(dcpl); H5Fclose(fid); - HDfree(buf); + free(buf); } H5E_END_TRY return FAIL; @@ -520,7 +520,7 @@ gen_v18_latest(void) * Add a chunked dataset with layout version 3 (default) */ - buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + buf = (float *)malloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); if (buf == NULL) TEST_ERROR; @@ -551,7 +551,7 @@ gen_v18_latest(void) TEST_ERROR; /* Release allocated buffer */ - HDfree(buf); + free(buf); bufp = buf = NULL; /* Close property list and dataset, will reuse dataspace */ @@ -575,7 +575,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); - HDfree(buf); + free(buf); } H5E_END_TRY return FAIL; @@ -635,7 +635,7 @@ gen_v18_v18(void) * Add a chunked dataset with layout version 3 (default) */ - buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); + buf = (float *)malloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float)); if (buf == NULL) TEST_ERROR; @@ -712,7 +712,7 @@ gen_v18_v18(void) TEST_ERROR; /* Release allocated buffer */ - HDfree(buf); + free(buf); bufp = buf = NULL; /* Close everything */ @@ -737,7 +737,7 @@ error: H5Pclose(fcpl); H5Pclose(fapl); H5Fclose(fid); - HDfree(buf); + free(buf); } H5E_END_TRY return FAIL; @@ -1018,7 +1018,7 @@ gen_ref_files(const char *filename, H5F_libver_t low_bound, H5F_libver_t high_bo * Create test file, attribute, group and dataset */ - if ((dwbuf = HDcalloc(sizeof(unsigned), 100)) == NULL) + if ((dwbuf = calloc(sizeof(unsigned), 100)) == NULL) TEST_ERROR; /* Create the test file */ @@ -1068,7 +1068,7 @@ gen_ref_files(const char *filename, H5F_libver_t low_bound, H5F_libver_t high_bo TEST_ERROR; if (dwbuf) { - HDfree(dwbuf); + free(dwbuf); dwbuf = NULL; } @@ -1201,7 +1201,7 @@ error: H5Sclose(sid); H5Pclose(fapl); H5Fclose(fid); - HDfree(dwbuf); + free(dwbuf); } H5E_END_TRY diff --git a/test/gen_deflate.c b/test/gen_deflate.c index a3ba2c6..05742e5 100644 --- a/test/gen_deflate.c +++ b/test/gen_deflate.c @@ -54,7 +54,7 @@ main(void) /* Initialize the data */ /* (Try for something easily compressible) */ - if (NULL == (data = (int *)HDmalloc(SPACE_DIM1 * SPACE_DIM2 * sizeof(int)))) + if (NULL == (data = (int *)malloc(SPACE_DIM1 * SPACE_DIM2 * sizeof(int)))) TEST_ERROR; for (i = 0; i < SPACE_DIM1; i++) @@ -97,13 +97,13 @@ main(void) if (H5Fclose(fid) < 0) FAIL_STACK_ERROR; - HDfree(data); + free(data); return EXIT_SUCCESS; error: if (data) - HDfree(data); + free(data); H5E_BEGIN_TRY { H5Pclose(dcpl_id); diff --git a/test/gen_file_image.c b/test/gen_file_image.c index b2faefd..8b0e00f 100644 --- a/test/gen_file_image.c +++ b/test/gen_file_image.c @@ -45,7 +45,7 @@ main(void) int *data = NULL; /* Dataset data */ /* Initialize the data */ - if (NULL == (data = (int *)HDmalloc(SPACE_DIM1 * SPACE_DIM2 * sizeof(int)))) + if (NULL == (data = (int *)malloc(SPACE_DIM1 * SPACE_DIM2 * sizeof(int)))) TEST_ERROR; for (i = 0; i < SPACE_DIM1; i++) @@ -80,7 +80,7 @@ main(void) error: if (data) - HDfree(data); + free(data); H5E_BEGIN_TRY { H5Dclose(did); diff --git a/test/gen_plist.c b/test/gen_plist.c index 0892755..bd94e9c 100644 --- a/test/gen_plist.c +++ b/test/gen_plist.c @@ -463,7 +463,7 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil if ((ret = H5Pencode2(plist_id, NULL, &temp_size, H5P_DEFAULT)) < 0) assert(ret > 0); - temp_buf = (void *)HDmalloc(temp_size); + temp_buf = (void *)malloc(temp_size); assert(temp_buf); if ((ret = H5Pencode2(plist_id, temp_buf, &temp_size, H5P_DEFAULT)) < 0) @@ -477,7 +477,7 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil HDclose(fd); - HDfree(temp_buf); + free(temp_buf); return 1; } diff --git a/test/genall5.c b/test/genall5.c index 64764c0..81069f4 100644 --- a/test/genall5.c +++ b/test/genall5.c @@ -520,11 +520,11 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) 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); + slinkval = (char *)malloc(lnk_info.u.val_size); if (!slinkval) { pass = FALSE; - failure_mssg = "vrfy_ns_grp_c: HDmalloc of slinkval failed"; + failure_mssg = "vrfy_ns_grp_c: malloc of slinkval failed"; } assert(slinkval); @@ -540,7 +540,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) assert(ret >= 0); assert(0 == HDstrcmp(slinkval, group_name)); - HDfree(slinkval); + free(slinkval); } /* end if */ else if (1 == (u % 3)) { H5O_info2_t root_oinfo; @@ -586,11 +586,11 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) } assert(H5L_TYPE_EXTERNAL == lnk_info.type); - elinkval = HDmalloc(lnk_info.u.val_size); + elinkval = malloc(lnk_info.u.val_size); if (!elinkval) { pass = FALSE; - failure_mssg = "vrfy_ns_grp_c: HDmalloc of elinkval failed."; + failure_mssg = "vrfy_ns_grp_c: malloc of elinkval failed."; } assert(elinkval); @@ -618,7 +618,7 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) assert(0 == HDstrcmp(file, "external.h5")); assert(0 == HDstrcmp(path, "/ext")); - HDfree(elinkval); + free(elinkval); } /* end else */ u++; @@ -929,11 +929,11 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) 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); + slinkval = (char *)malloc(lnk_info.u.val_size); if (!slinkval) { pass = FALSE; - failure_mssg = "vrfy_ns_grp_d: HDmalloc of slinkval failed"; + failure_mssg = "vrfy_ns_grp_d: malloc of slinkval failed"; } assert(slinkval); @@ -949,7 +949,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) assert(ret >= 0); assert(0 == HDstrcmp(slinkval, group_name)); - HDfree(slinkval); + free(slinkval); } /* end if */ else if (1 == (u % 3)) { H5O_info2_t root_oinfo; @@ -994,11 +994,11 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) } assert(H5L_TYPE_EXTERNAL == lnk_info.type); - elinkval = HDmalloc(lnk_info.u.val_size); + elinkval = malloc(lnk_info.u.val_size); if (!elinkval) { pass = FALSE; - failure_mssg = "vrfy_ns_grp_d: HDmalloc of elinkval failed."; + failure_mssg = "vrfy_ns_grp_d: malloc of elinkval failed."; } assert(elinkval); @@ -1026,7 +1026,7 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) assert(0 == HDstrcmp(file, "external.h5")); assert(0 == HDstrcmp(path, "/ext")); - HDfree(elinkval); + free(elinkval); } /* end else */ u++; @@ -1520,11 +1520,11 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) 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); + slinkval = (char *)malloc(lnk_info.u.val_size); if (!slinkval) { pass = FALSE; - failure_mssg = "vrfy_os_grp_n: HDmalloc of slinkval failed"; + failure_mssg = "vrfy_os_grp_n: malloc of slinkval failed"; } assert(slinkval); @@ -1541,7 +1541,7 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks) assert(ret >= 0); assert(0 == HDstrcmp(slinkval, group_name)); - HDfree(slinkval); + free(slinkval); } /* end if */ else { H5O_info2_t root_oinfo; @@ -1652,11 +1652,11 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) } if ((pass) && (write_data)) { - wdata = (int *)HDmalloc(sizeof(int) * DSET_DIMS); + wdata = (int *)malloc(sizeof(int) * DSET_DIMS); if (!wdata) { pass = FALSE; - failure_mssg = "ds_ctg_i: HDmalloc of wdata failed."; + failure_mssg = "ds_ctg_i: malloc of wdata failed."; } assert(wdata); } @@ -1674,7 +1674,7 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) assert(ret >= 0); } - HDfree(wdata); + free(wdata); if (pass) { ret = H5Dclose(dsid); @@ -1863,11 +1863,11 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) } if ((pass) && (write_data)) { - rdata = (int *)HDmalloc(sizeof(int) * DSET_DIMS); + rdata = (int *)malloc(sizeof(int) * DSET_DIMS); if (!rdata) { pass = FALSE; - failure_mssg = "vrfy_ds_ctg_i: HDmalloc of rdata failed."; + failure_mssg = "vrfy_ds_ctg_i: malloc of rdata failed."; } assert(rdata); } @@ -1892,7 +1892,7 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) } } /* end if */ - HDfree(rdata); + free(rdata); if (pass) { ret = H5Dclose(dsid); @@ -1998,11 +1998,11 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) } if ((pass) && (write_data)) { - wdata = (int *)HDmalloc(sizeof(int) * DSET_DIMS); + wdata = (int *)malloc(sizeof(int) * DSET_DIMS); if (!wdata) { pass = FALSE; - failure_mssg = "ds_chk_i: HDmalloc of wdata failed."; + failure_mssg = "ds_chk_i: malloc of wdata failed."; } assert(wdata); } @@ -2017,7 +2017,7 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) failure_mssg = "ds_chk_i: H5Dwrite() failed."; } assert(ret >= 0); - HDfree(wdata); + free(wdata); } /* end if */ if (pass) { @@ -2222,11 +2222,11 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) } if ((pass) && (write_data)) { - rdata = (int *)HDmalloc(sizeof(int) * DSET_DIMS); + rdata = (int *)malloc(sizeof(int) * DSET_DIMS); if (!rdata) { pass = FALSE; - failure_mssg = "vrfy_ds_chk_i: HDmalloc of rdata failed."; + failure_mssg = "vrfy_ds_chk_i: malloc of rdata failed."; } assert(rdata); } @@ -2251,7 +2251,7 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) } } /* end if */ - HDfree(rdata); + free(rdata); if (pass) { ret = H5Dclose(dsid); @@ -2356,11 +2356,11 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) } if ((pass) && (write_data)) { - wdata = (int *)HDmalloc(sizeof(int) * DSET_COMPACT_DIMS); + wdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS); if (!wdata) { pass = FALSE; - failure_mssg = "ds_cpt_i: HDmalloc of wdata failed."; + failure_mssg = "ds_cpt_i: malloc of wdata failed."; } assert(wdata); } @@ -2377,7 +2377,7 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) } assert(ret >= 0); - HDfree(wdata); + free(wdata); } /* end if */ if (pass) { @@ -2562,11 +2562,11 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) } if ((pass) && (write_data)) { - rdata = (int *)HDmalloc(sizeof(int) * DSET_COMPACT_DIMS); + rdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS); if (!rdata) { pass = FALSE; - failure_mssg = "vrfy_ds_cpt_i: HDmalloc of rdata failed."; + failure_mssg = "vrfy_ds_cpt_i: malloc of rdata failed."; } assert(rdata); } @@ -2591,7 +2591,7 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) } } /* end if */ - HDfree(rdata); + free(rdata); if (pass) { ret = H5Dclose(dsid); @@ -2666,11 +2666,11 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) } if ((pass) && (write_data)) { - wdata = (hvl_t *)HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS); + wdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS); if (!wdata) { pass = FALSE; - failure_mssg = "ds_ctg_v: HDmalloc of wdata failed."; + failure_mssg = "ds_ctg_v: malloc of wdata failed."; } assert(wdata); } @@ -2682,11 +2682,11 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) unsigned v; len = (u % 10) + 1; - tdata = (int *)HDmalloc(sizeof(int) * len); + tdata = (int *)malloc(sizeof(int) * len); if (!tdata) { pass = FALSE; - failure_mssg = "ds_ctg_v: HDmalloc of tdata failed."; + failure_mssg = "ds_ctg_v: malloc of tdata failed."; break; } assert(tdata); @@ -2718,7 +2718,7 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) } assert(ret >= 0); - HDfree(wdata); + free(wdata); } /* end if */ if (pass) { @@ -2929,11 +2929,11 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) } if ((pass) && (write_data)) { - rdata = (hvl_t *)HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS); + rdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS); if (!rdata) { pass = FALSE; - failure_mssg = "vrfy_ds_ctg_v: HDmalloc of rdata failed."; + failure_mssg = "vrfy_ds_ctg_v: malloc of rdata failed."; } assert(rdata); } @@ -2983,7 +2983,7 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) assert(ret >= 0); } /* end if */ - HDfree(rdata); + free(rdata); if (pass) { ret = H5Sclose(sid); diff --git a/test/getname.c b/test/getname.c index 5960e5c..9633a96 100644 --- a/test/getname.c +++ b/test/getname.c @@ -1470,7 +1470,7 @@ test_main(hid_t file_id, hid_t fapl) char *name3; /* Include the extra null character */ - name3 = (char *)HDmalloc(name_len + 1); + name3 = (char *)malloc(name_len + 1); if (!name3) TEST_ERROR; @@ -1493,7 +1493,7 @@ test_main(hid_t file_id, hid_t fapl) if (HDstrcmp(name3, "/g") != 0) TEST_ERROR; - HDfree(name3); + free(name3); } /* Close */ diff --git a/test/gheap.c b/test/gheap.c index cca5289..79e5f02 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -81,7 +81,7 @@ test_1(hid_t fapl) TESTING("monotonically increasing lengths"); /* Allocate buffer for H5HG_t */ - if (NULL == (obj = (H5HG_t *)HDmalloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) + if (NULL == (obj = (H5HG_t *)malloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) goto error; /* Open a clean file */ @@ -136,7 +136,7 @@ test_1(hid_t fapl) } /* Release buffer */ - HDfree(obj); + free(obj); obj = NULL; if (H5Fclose(file) < 0) @@ -154,7 +154,7 @@ error: } H5E_END_TRY if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } @@ -189,7 +189,7 @@ test_2(hid_t fapl) TESTING("monotonically decreasing lengths"); /* Allocate buffer for H5HG_t */ - if (NULL == (obj = (H5HG_t *)HDmalloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) + if (NULL == (obj = (H5HG_t *)malloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) goto error; /* Open a clean file */ @@ -236,7 +236,7 @@ test_2(hid_t fapl) } /* Release buffer */ - HDfree(obj); + free(obj); obj = NULL; if (H5Fclose(file) < 0) @@ -254,7 +254,7 @@ error: } H5E_END_TRY if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } @@ -289,7 +289,7 @@ test_3(hid_t fapl) TESTING("complete object removal"); /* Allocate buffer for H5HG_t */ - if (NULL == (obj = (H5HG_t *)HDmalloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) + if (NULL == (obj = (H5HG_t *)malloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) goto error; /* Open a clean file */ @@ -326,7 +326,7 @@ test_3(hid_t fapl) } /* Release buffer */ - HDfree(obj); + free(obj); obj = NULL; if (H5Fclose(file) < 0) @@ -344,7 +344,7 @@ error: } H5E_END_TRY if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } @@ -380,7 +380,7 @@ test_4(hid_t fapl) TESTING("partial object removal"); /* Allocate buffer for H5HG_t */ - if (NULL == (obj = (H5HG_t *)HDmalloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) + if (NULL == (obj = (H5HG_t *)malloc(sizeof(H5HG_t) * GHEAP_TEST_NOBJS))) goto error; /* Open a clean file */ @@ -422,7 +422,7 @@ test_4(hid_t fapl) } /* Release buffer */ - HDfree(obj); + free(obj); obj = NULL; if (H5Fclose(file) < 0) @@ -440,7 +440,7 @@ error: } H5E_END_TRY if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } @@ -474,7 +474,7 @@ test_ooo_indices(hid_t fapl) TESTING("out of order indices"); - if (NULL == (obj = (H5HG_t *)HDmalloc(2000 * sizeof(*obj)))) + if (NULL == (obj = (H5HG_t *)malloc(2000 * sizeof(*obj)))) goto error; /* Open a clean file */ @@ -546,7 +546,7 @@ test_ooo_indices(hid_t fapl) goto error; if (nerrors) goto error; - HDfree(obj); + free(obj); obj = NULL; PASSED(); @@ -559,7 +559,7 @@ error: } H5E_END_TRY if (obj) - HDfree(obj); + free(obj); return MAX(1, nerrors); } /* end test_ooo_indices */ diff --git a/test/h5test.c b/test/h5test.c index 7c16950..a35d8bf 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1007,7 +1007,7 @@ h5_set_info_object(void) /* copy key/value pair into temporary buffer */ len = HDstrcspn(valp, ";"); next = &valp[len]; - if (NULL == (key_val = (char *)HDcalloc(1, len + 1))) + if (NULL == (key_val = (char *)calloc(1, len + 1))) return -1; /* increment the next pointer past the terminating semicolon */ @@ -1056,10 +1056,10 @@ h5_set_info_object(void) } valp = next; - HDfree(key_val); + free(key_val); } while (next && *next); - HDfree(envp); + free(envp); } return ret_value; @@ -1387,16 +1387,16 @@ getenv_all(MPI_Comm comm, int root, const char *name) MPI_Bcast(&len, 1, MPI_INT, root, comm); if (len >= 0) { if (env == NULL) - env = (char *)HDmalloc((size_t)len + 1); + env = (char *)malloc((size_t)len + 1); else if (HDstrlen(env) < (size_t)len) - env = (char *)HDrealloc(env, (size_t)len + 1); + env = (char *)realloc(env, (size_t)len + 1); MPI_Bcast(env, len, MPI_CHAR, root, comm); env[len] = '\0'; } else { if (env) - HDfree(env); + free(env); env = NULL; } } @@ -1407,7 +1407,7 @@ getenv_all(MPI_Comm comm, int root, const char *name) else { /* use original getenv */ if (env) - HDfree(env); + free(env); env = HDgetenv(name); } /* end if */ @@ -1446,7 +1446,7 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) goto error; /* Allocate copy buffer */ - if (NULL == (buf = HDcalloc((size_t)1, (size_t)READ_BUF_SIZE))) + if (NULL == (buf = calloc((size_t)1, (size_t)READ_BUF_SIZE))) goto error; /* Copy old file into temporary file */ @@ -1467,7 +1467,7 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) goto error; /* Release memory */ - HDfree(buf); + free(buf); return 0; @@ -1477,7 +1477,7 @@ error: HDclose(fd_old); if (fd_new > 0) HDclose(fd_new); - HDfree(buf); + free(buf); return -1; } /* end h5_make_local_copy() */ @@ -1808,7 +1808,7 @@ h5_get_dummy_vfd_class(void) H5FD_class_t *vfd_class = NULL; /* Dummy VFD that will be returned */ /* Create the class and initialize everything to zero/NULL */ - if (NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t)))) + if (NULL == (vfd_class = (H5FD_class_t *)malloc(sizeof(H5FD_class_t)))) TEST_ERROR; /* Copy the dummy VFD */ @@ -1818,7 +1818,7 @@ h5_get_dummy_vfd_class(void) error: if (vfd_class) - HDfree(vfd_class); + free(vfd_class); return NULL; } /* h5_get_dummy_vfd_class */ @@ -1848,7 +1848,7 @@ h5_get_dummy_vol_class(void) H5VL_class_t *vol_class = NULL; /* Dummy VOL class that will be returned */ /* Create the class and initialize everything to zero/NULL */ - if (NULL == (vol_class = (H5VL_class_t *)HDcalloc((size_t)1, sizeof(H5VL_class_t)))) + if (NULL == (vol_class = (H5VL_class_t *)calloc((size_t)1, sizeof(H5VL_class_t)))) TEST_ERROR; /* Fill in the minimum parameters to make a VOL connector class that @@ -1861,7 +1861,7 @@ h5_get_dummy_vol_class(void) error: if (vol_class) - HDfree(vol_class); + free(vol_class); return NULL; } /* h5_get_dummy_vol_class */ @@ -2062,7 +2062,7 @@ h5_duplicate_file_by_bytes(const char *orig, const char *dest) } read_size = MIN(fsize, max_buf); - dup_buf = HDmalloc(read_size); + dup_buf = malloc(read_size); if (NULL == dup_buf) { ret_value = -1; goto done; @@ -2084,7 +2084,7 @@ done: if (dest_ptr != NULL) HDfclose(dest_ptr); if (dup_buf != NULL) - HDfree(dup_buf); + free(dup_buf); return ret_value; } /* end h5_duplicate_file_by_bytes() */ diff --git a/test/h5test.h b/test/h5test.h index 0b4b36a..3382eb4 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -266,7 +266,7 @@ extern "C" { * an equivalent non-const pointer around) is far messier. */ #ifndef h5_free_const -#define h5_free_const(mem) HDfree((void *)(uintptr_t)mem) +#define h5_free_const(mem) free((void *)(uintptr_t)mem) #endif /* Generally useful testing routines */ diff --git a/test/hyperslab.c b/test/hyperslab.c index 79f37f9..55735d4 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -117,12 +117,12 @@ print_ref(size_t nx, size_t ny, size_t nz) { uint8_t *array; - if (NULL != (array = (uint8_t *)HDmalloc(nx * ny * nz))) { + if (NULL != (array = (uint8_t *)malloc(nx * ny * nz))) { printf("Reference array:\n"); init_full(array, nx, ny, nz); print_array(array, nx, ny, nz); - HDfree(array); - } /* end if */ + free(array); + } } /* end print_ref() */ /*------------------------------------------------------------------------- @@ -179,7 +179,7 @@ test_fill(size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_t dk, size HDfflush(stdout); /* Allocate array */ - if (NULL == (dst = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz))) + if (NULL == (dst = (uint8_t *)calloc((size_t)1, nx * ny * nz))) TEST_ERROR; init_full(dst, nx, ny, nz); @@ -258,13 +258,13 @@ test_fill(size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_t dk, size PASSED(); - HDfree(dst); + free(dst); return SUCCEED; error: if (dst) - HDfree(dst); + free(dst); return FAIL; } /* end test_fill() */ @@ -370,9 +370,9 @@ test_copy(int mode, size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_ /* * Allocate arrays */ - if (NULL == (src = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz))) + if (NULL == (src = (uint8_t *)calloc((size_t)1, nx * ny * nz))) TEST_ERROR; - if (NULL == (dst = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz))) + if (NULL == (dst = (uint8_t *)calloc((size_t)1, nx * ny * nz))) TEST_ERROR; init_full(src, nx, ny, nz); @@ -527,16 +527,16 @@ test_copy(int mode, size_t nx, size_t ny, size_t nz, size_t di, size_t dj, size_ PASSED(); - HDfree(src); - HDfree(dst); + free(src); + free(dst); return SUCCEED; error: if (src) - HDfree(src); + free(src); if (dst) - HDfree(dst); + free(dst); return FAIL; } /* end test_copy() */ @@ -577,9 +577,9 @@ test_multifill(size_t nx) HDfflush(stdout); /* Initialize the source and destination */ - if (NULL == (src = (struct a_struct *)HDmalloc(nx * sizeof(*src)))) + if (NULL == (src = (struct a_struct *)malloc(nx * sizeof(*src)))) TEST_ERROR; - if (NULL == (dst = (struct a_struct *)HDmalloc(nx * sizeof(*dst)))) + if (NULL == (dst = (struct a_struct *)malloc(nx * sizeof(*dst)))) TEST_ERROR; for (i = 0; i < nx; i++) { @@ -645,16 +645,16 @@ test_multifill(size_t nx) PASSED(); - HDfree(src); - HDfree(dst); + free(src); + free(dst); return SUCCEED; error: if (src) - HDfree(src); + free(src); if (dst) - HDfree(dst); + free(dst); return FAIL; } /* end test_multifill() */ @@ -689,9 +689,9 @@ test_endian(size_t nx) HDfflush(stdout); /* Initialize arrays */ - if (NULL == (src = (uint8_t *)HDmalloc(nx * 4))) + if (NULL == (src = (uint8_t *)malloc(nx * 4))) TEST_ERROR; - if (NULL == (dst = (uint8_t *)HDcalloc(nx, (size_t)4))) + if (NULL == (dst = (uint8_t *)calloc(nx, (size_t)4))) TEST_ERROR; init_full(src, nx, (size_t)4, (size_t)1); @@ -731,16 +731,16 @@ test_endian(size_t nx) PASSED(); - HDfree(src); - HDfree(dst); + free(src); + free(dst); return SUCCEED; error: if (src) - HDfree(src); + free(src); if (dst) - HDfree(dst); + free(dst); return FAIL; } /* end test_endian() */ @@ -776,9 +776,9 @@ test_transpose(size_t nx, size_t ny) HDfflush(stdout); /* Initialize */ - if (NULL == (src = (int *)HDmalloc(nx * ny * sizeof(*src)))) + if (NULL == (src = (int *)malloc(nx * ny * sizeof(*src)))) TEST_ERROR; - if (NULL == (dst = (int *)HDcalloc(nx * ny, sizeof(*dst)))) + if (NULL == (dst = (int *)calloc(nx * ny, sizeof(*dst)))) TEST_ERROR; for (i = 0; i < nx; i++) @@ -826,16 +826,16 @@ test_transpose(size_t nx, size_t ny) PASSED(); - HDfree(src); - HDfree(dst); + free(src); + free(dst); return SUCCEED; error: if (src) - HDfree(src); + free(src); if (dst) - HDfree(dst); + free(dst); return FAIL; } /* end test_transpose() */ @@ -875,11 +875,11 @@ test_sub_super(size_t nx, size_t ny) HDfflush(stdout); /* Initialize */ - if (NULL == (full = (uint8_t *)HDmalloc(4 * nx * ny))) + if (NULL == (full = (uint8_t *)malloc(4 * nx * ny))) TEST_ERROR; - if (NULL == (half = (uint8_t *)HDcalloc((size_t)1, nx * ny))) + if (NULL == (half = (uint8_t *)calloc((size_t)1, nx * ny))) TEST_ERROR; - if (NULL == (twice = (uint8_t *)HDcalloc((size_t)4, nx * ny))) + if (NULL == (twice = (uint8_t *)calloc((size_t)4, nx * ny))) TEST_ERROR; init_full(full, 2 * nx, 2 * ny, (size_t)1); @@ -973,19 +973,19 @@ test_sub_super(size_t nx, size_t ny) PASSED(); - HDfree(full); - HDfree(half); - HDfree(twice); + free(full); + free(half); + free(twice); return SUCCEED; error: if (full) - HDfree(full); + free(full); if (half) - HDfree(half); + free(half); if (twice) - HDfree(twice); + free(twice); return FAIL; } /* test_sub_super() */ @@ -1018,7 +1018,7 @@ test_array_fill(size_t lo, size_t hi) TESTING(s); /* Initialize */ - if (NULL == (dst = (int *)HDcalloc(sizeof(int), ARRAY_FILL_SIZE * hi))) + if (NULL == (dst = (int *)calloc(sizeof(int), ARRAY_FILL_SIZE * hi))) TEST_ERROR; /* Setup */ @@ -1040,13 +1040,13 @@ test_array_fill(size_t lo, size_t hi) PASSED(); - HDfree(dst); + free(dst); return SUCCEED; error: if (dst) - HDfree(dst); + free(dst); return FAIL; } /* end test_array_fill() */ @@ -1083,7 +1083,7 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z) TESTING(s); /* Initialize */ - if (NULL == (a = (hsize_t *)HDmalloc(sizeof(hsize_t) * x * y * z))) + if (NULL == (a = (hsize_t *)malloc(sizeof(hsize_t) * x * y * z))) TEST_ERROR; dims[0] = z; @@ -1125,13 +1125,13 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z) PASSED(); - HDfree(a); + free(a); return SUCCEED; error: if (a) - HDfree(a); + free(a); return FAIL; } /* end test_array_offset_n_calc() */ diff --git a/test/istore.c b/test/istore.c index 0b651fa..37e603b 100644 --- a/test/istore.c +++ b/test/istore.c @@ -273,9 +273,9 @@ test_extend(hid_t f, const char *prefix, size_t nx, size_t ny, size_t nz) HDsnprintf(s, sizeof(s), "istore extend: %s", dims); TESTING(s); - buf = (uint8_t *)HDmalloc(nx * ny * nz); - check = (uint8_t *)HDmalloc(nx * ny * nz); - whole = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz); + buf = (uint8_t *)malloc(nx * ny * nz); + check = (uint8_t *)malloc(nx * ny * nz); + whole = (uint8_t *)calloc((size_t)1, nx * ny * nz); whole_size[0] = nx; whole_size[1] = ny; @@ -405,17 +405,17 @@ test_extend(hid_t f, const char *prefix, size_t nx, size_t ny, size_t nz) TEST_ERROR; /* Free memory used */ - HDfree(buf); - HDfree(check); - HDfree(whole); + free(buf); + free(check); + free(whole); PASSED(); return SUCCEED; error: - HDfree(buf); - HDfree(check); - HDfree(whole); + free(buf); + free(check); + free(whole); return FAIL; } @@ -473,7 +473,7 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, size_t nx, size_t ny, s SKIPPED(); return SUCCEED; } - buf = (uint8_t *)HDmalloc(nx * ny * nz); + buf = (uint8_t *)malloc(nx * ny * nz); HDmemset(buf, 128, nx * ny * nz); /* Set dimensions of dataset */ @@ -542,12 +542,12 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, size_t nx, size_t ny, s if (H5Dclose(dataset) < 0) TEST_ERROR; - HDfree(buf); + free(buf); PASSED(); return SUCCEED; error: - HDfree(buf); + free(buf); return FAIL; } diff --git a/test/links.c b/test/links.c index 59e2c42..eda699e 100644 --- a/test/links.c +++ b/test/links.c @@ -884,7 +884,7 @@ long_links(hid_t fapl, hbool_t new_format) TEST_ERROR; /* Construct very long file name */ - if ((objname = (char *)HDmalloc((size_t)(MAX_NAME_LEN + 1))) == NULL) + if ((objname = (char *)malloc((size_t)(MAX_NAME_LEN + 1))) == NULL) TEST_ERROR; for (u = 0; u < MAX_NAME_LEN; u++) objname[u] = 'a'; @@ -912,7 +912,7 @@ long_links(hid_t fapl, hbool_t new_format) TEST_ERROR; /* Release memory */ - HDfree(objname); + free(objname); PASSED(); return SUCCEED; @@ -925,7 +925,7 @@ error: H5Fclose(fid); } H5E_END_TRY - HDfree(objname); + free(objname); return FAIL; } @@ -6481,7 +6481,7 @@ link_iterate_deprec(hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; - if (NULL == (visited = (hbool_t *)HDmalloc(sizeof(hbool_t) * iter_info.max_visit))) + if (NULL == (visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit))) TEST_ERROR; iter_info.visited = visited; @@ -6653,7 +6653,7 @@ link_iterate_deprec(hid_t fapl) /* Free resources */ if (visited) - HDfree(visited); + free(visited); return SUCCEED; @@ -6668,7 +6668,7 @@ error: H5E_END_TRY if (visited) - HDfree(visited); + free(visited); return FAIL; } /* end link_iterate_deprec() */ @@ -6964,7 +6964,7 @@ link_iterate_old_deprec(hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = CORDER_NLINKS; - if (NULL == (visited = (hbool_t *)HDmalloc(sizeof(hbool_t) * iter_info.max_visit))) + if (NULL == (visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit))) TEST_ERROR; iter_info.visited = visited; @@ -7055,7 +7055,7 @@ link_iterate_old_deprec(hid_t fapl) /* Free resources */ if (visited) - HDfree(visited); + free(visited); return SUCCEED; @@ -7069,7 +7069,7 @@ error: H5E_END_TRY if (visited) - HDfree(visited); + free(visited); return FAIL; } /* end link_iterate_old_deprec() */ @@ -9242,13 +9242,13 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) TESTING("H5Pset/get_elink_fapl() with same physical layout"); /* Set up file names and paths */ - if (NULL == (filename1 = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename1 = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (filename2 = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename2 = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (tmpname = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (tmpname = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (cwdpath = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (cwdpath = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; if ((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || @@ -9256,9 +9256,9 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) TEST_ERROR; /* Set up data array */ - if (NULL == (points_data = (int *)HDcalloc(NUM40 * NUM40, sizeof(int)))) + if (NULL == (points_data = (int *)calloc(NUM40 * NUM40, sizeof(int)))) TEST_ERROR; - if (NULL == (points = (int **)HDcalloc(NUM40, sizeof(points_data)))) + if (NULL == (points = (int **)calloc(NUM40, sizeof(points_data)))) TEST_ERROR; for (i = 0; i < NUM40; i++) points[i] = points_data + (i * NUM40); @@ -9371,13 +9371,13 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format) if (H5Pclose(core_fapl) < 0) TEST_ERROR; - HDfree(points); - HDfree(points_data); + free(points); + free(points_data); - HDfree(filename1); - HDfree(filename2); - HDfree(tmpname); - HDfree(cwdpath); + free(filename1); + free(filename2); + free(tmpname); + free(cwdpath); PASSED(); return SUCCEED; @@ -9396,13 +9396,13 @@ error: } H5E_END_TRY - HDfree(points); - HDfree(points_data); + free(points); + free(points_data); - HDfree(filename1); - HDfree(filename2); - HDfree(tmpname); - HDfree(cwdpath); + free(filename1); + free(filename2); + free(tmpname); + free(cwdpath); return FAIL; } /* end external_set_elink_fapl2() */ @@ -12476,27 +12476,27 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) return SUCCEED; } - if (NULL == (filename1 = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename1 = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (filename2a = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename2a = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (filename2b = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename2b = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (filename3a = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename3a = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (filename3b = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename3b = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (filename4a = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename4a = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (filename4b = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename4b = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (filename5a = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename5a = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (filename5b = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (filename5b = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (tmpname = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (tmpname = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; - if (NULL == (cwdpath = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char)))) + if (NULL == (cwdpath = (char *)calloc(NAME_BUF_SIZE, sizeof(char)))) TEST_ERROR; /* set up name for main file: "extlinks21A" */ @@ -12666,17 +12666,17 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if (H5Fclose(file1) < 0) TEST_ERROR; - HDfree(filename1); - HDfree(filename2a); - HDfree(filename2b); - HDfree(filename3a); - HDfree(filename3b); - HDfree(filename4a); - HDfree(filename4b); - HDfree(filename5a); - HDfree(filename5b); - HDfree(tmpname); - HDfree(cwdpath); + free(filename1); + free(filename2a); + free(filename2b); + free(filename3a); + free(filename3b); + free(filename4a); + free(filename4b); + free(filename5a); + free(filename5b); + free(tmpname); + free(cwdpath); PASSED(); @@ -12697,17 +12697,17 @@ error: } H5E_END_TRY - HDfree(filename1); - HDfree(filename2a); - HDfree(filename2b); - HDfree(filename3a); - HDfree(filename3b); - HDfree(filename4a); - HDfree(filename4b); - HDfree(filename5a); - HDfree(filename5b); - HDfree(tmpname); - HDfree(cwdpath); + free(filename1); + free(filename2a); + free(filename2b); + free(filename3a); + free(filename3b); + free(filename4a); + free(filename4b); + free(filename5a); + free(filename5b); + free(tmpname); + free(cwdpath); return FAIL; @@ -19670,7 +19670,7 @@ link_iterate(hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; - if (NULL == (visited = (hbool_t *)HDmalloc(sizeof(hbool_t) * iter_info.max_visit))) + if (NULL == (visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit))) TEST_ERROR; iter_info.visited = visited; @@ -19842,7 +19842,7 @@ link_iterate(hid_t fapl) /* Free resources */ if (visited) - HDfree(visited); + free(visited); return SUCCEED; @@ -19857,7 +19857,7 @@ error: H5E_END_TRY if (visited) - HDfree(visited); + free(visited); return FAIL; } /* end link_iterate() */ @@ -20169,7 +20169,7 @@ link_iterate_old(hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = CORDER_NLINKS; - if (NULL == (visited = (hbool_t *)HDmalloc(sizeof(hbool_t) * iter_info.max_visit))) + if (NULL == (visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit))) TEST_ERROR; iter_info.visited = visited; @@ -20257,7 +20257,7 @@ link_iterate_old(hid_t fapl) /* Free resources */ if (visited) - HDfree(visited); + free(visited); return SUCCEED; @@ -20271,7 +20271,7 @@ error: H5E_END_TRY if (visited) - HDfree(visited); + free(visited); return FAIL; } /* end link_iterate_old() */ @@ -20428,7 +20428,7 @@ open_by_idx(hid_t fapl) TEST_ERROR; /* Allocate object token array */ - if (NULL == (objno = (H5O_token_t *)HDmalloc(sizeof(H5O_token_t) * (max_compact * 2)))) + if (NULL == (objno = (H5O_token_t *)malloc(sizeof(H5O_token_t) * (max_compact * 2)))) TEST_ERROR; /* Create file to mount */ @@ -20635,7 +20635,7 @@ open_by_idx(hid_t fapl) /* Free resources */ if (objno) - HDfree(objno); + free(objno); return SUCCEED; @@ -20652,7 +20652,7 @@ error: H5E_END_TRY if (objno) - HDfree(objno); + free(objno); return FAIL; } /* end open_by_idx() */ @@ -21046,7 +21046,7 @@ object_info(hid_t fapl) TEST_ERROR; /* Allocate object token array */ - if (NULL == (objno = (H5O_token_t *)HDmalloc(sizeof(H5O_token_t) * (max_compact * 2)))) + if (NULL == (objno = (H5O_token_t *)malloc(sizeof(H5O_token_t) * (max_compact * 2)))) TEST_ERROR; /* Create dataspace for attributes */ @@ -21288,7 +21288,7 @@ object_info(hid_t fapl) if (H5Sclose(space_id) < 0) TEST_ERROR; if (objno) - HDfree(objno); + free(objno); return SUCCEED; @@ -21305,7 +21305,7 @@ error: H5E_END_TRY if (objno) - HDfree(objno); + free(objno); return FAIL; } /* end object_info() */ diff --git a/test/mdset.c b/test/mdset.c index ceeea1a..762e502 100644 --- a/test/mdset.c +++ b/test/mdset.c @@ -83,7 +83,7 @@ test_mdset_location(hid_t fapl_id) if ((file_id2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; - if (NULL == (buf = (int *)HDcalloc(2 * MAX_DSET_X * MAX_DSET_Y, sizeof(int)))) + if (NULL == (buf = (int *)calloc(2 * MAX_DSET_X * MAX_DSET_Y, sizeof(int)))) TEST_ERROR; /* Generate memory dataspace */ @@ -224,13 +224,13 @@ test_mdset(size_t niter, unsigned flags, hid_t fapl_id) dcpl_id[i] = -1; /* Allocate buffers */ - if (NULL == (rbuf = (unsigned *)HDmalloc(buf_size))) + if (NULL == (rbuf = (unsigned *)malloc(buf_size))) TEST_ERROR; - if (NULL == (erbuf = (unsigned *)HDmalloc(buf_size))) + if (NULL == (erbuf = (unsigned *)malloc(buf_size))) TEST_ERROR; - if (NULL == (wbuf = (unsigned *)HDmalloc(buf_size))) + if (NULL == (wbuf = (unsigned *)malloc(buf_size))) TEST_ERROR; - if (NULL == (efbuf = (unsigned *)HDmalloc(buf_size))) + if (NULL == (efbuf = (unsigned *)malloc(buf_size))) TEST_ERROR; /* Initialize buffer indices */ diff --git a/test/mf.c b/test/mf.c index 641e638..3cf7927 100644 --- a/test/mf.c +++ b/test/mf.c @@ -6203,7 +6203,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - HDfree(memb_name[mt]); + free(memb_name[mt]); } /* end else */ } /* end if */ @@ -7414,7 +7414,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for if (nsects) { /* Allocate storage for the free space section information */ - sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)); + sect_info = (H5F_sect_info_t *)calloc((size_t)nsects, sizeof(H5F_sect_info_t)); H5Fget_free_sections(file, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); @@ -7423,7 +7423,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for if (sect_info[i].size < fs_threshold) TEST_ERROR; if (sect_info) - HDfree(sect_info); + free(sect_info); } } else { @@ -7781,7 +7781,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t is_multi_or_split) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - HDfree(memb_name[mt]); + free(memb_name[mt]); return 0; @@ -8940,7 +8940,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - HDfree(memb_name[mt]); + free(memb_name[mt]); /* Close memb_fapl */ if (H5Pclose(memb_fapl) < 0) diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index 92bdaed..46b6de6 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -140,7 +140,7 @@ populate_filepath(const char *dirname, const char *basename, hid_t fapl_id, char if ((basename == NULL) || (*basename == 0) || (dirname == NULL) || (*dirname == 0) || (path_out == NULL)) TEST_ERROR; - if (NULL == (path = HDcalloc(H5FD_SPLITTER_PATH_MAX, sizeof(char)))) + if (NULL == (path = calloc(H5FD_SPLITTER_PATH_MAX, sizeof(char)))) TEST_ERROR; if (HDsnprintf(path, H5FD_SPLITTER_PATH_MAX, "%s%s%s", dirname, @@ -157,12 +157,12 @@ populate_filepath(const char *dirname, const char *basename, hid_t fapl_id, char TEST_ERROR; } - HDfree(path); + free(path); return SUCCEED; error: - HDfree(path); + free(path); return FAIL; } /* end populate_filepath() */ @@ -181,7 +181,7 @@ build_paths(const char *basename, H5FD_splitter_vfd_config_t *splitter_config, { char *baselogname = NULL; - if (NULL == (baselogname = HDcalloc(H5FD_SPLITTER_PATH_MAX, sizeof(char)))) + if (NULL == (baselogname = calloc(H5FD_SPLITTER_PATH_MAX, sizeof(char)))) TEST_ERROR; if (populate_filepath(MIRROR_RW_DIR, basename, splitter_config->rw_fapl_id, names->rw, TRUE) < 0) @@ -198,12 +198,12 @@ build_paths(const char *basename, H5FD_splitter_vfd_config_t *splitter_config, if (populate_filepath(MIRROR_WO_DIR, baselogname, splitter_config->wo_fapl_id, names->log, FALSE) < 0) TEST_ERROR; - HDfree(baselogname); + free(baselogname); return SUCCEED; error: - HDfree(baselogname); + free(baselogname); return FAIL; } /* end build_paths() */ @@ -877,13 +877,13 @@ test_encdec_open(H5FD_mirror_xmit_t xmit_mock) FAIL_PUTS_ERROR("shared header structure is not in expected state"); /* Allocate memory */ - if (NULL == (buf = HDmalloc((H5FD_MIRROR_XMIT_OPEN_SIZE + 8) * sizeof(unsigned char)))) + if (NULL == (buf = malloc((H5FD_MIRROR_XMIT_OPEN_SIZE + 8) * sizeof(unsigned char)))) FAIL_PUTS_ERROR("Unable to allocate memory for buf"); - if (NULL == (expected = HDmalloc((H5FD_MIRROR_XMIT_OPEN_SIZE + 8) * sizeof(unsigned char)))) + if (NULL == (expected = malloc((H5FD_MIRROR_XMIT_OPEN_SIZE + 8) * sizeof(unsigned char)))) FAIL_PUTS_ERROR("Unable to allocate memory for expected"); - if (NULL == (xmit_in = HDmalloc(sizeof(H5FD_mirror_xmit_open_t)))) + if (NULL == (xmit_in = malloc(sizeof(H5FD_mirror_xmit_open_t)))) FAIL_PUTS_ERROR("Unable to allocate memory for xmit_in"); - if (NULL == (xmit_out = HDmalloc(sizeof(H5FD_mirror_xmit_open_t)))) + if (NULL == (xmit_out = malloc(sizeof(H5FD_mirror_xmit_open_t)))) FAIL_PUTS_ERROR("Unable to allocate memory for xmit_out"); /* Populate the expected buffer; expect end padding of 0xFF */ @@ -970,19 +970,19 @@ test_encdec_open(H5FD_mirror_xmit_t xmit_mock) TEST_ERROR; } - HDfree(buf); - HDfree(expected); - HDfree(xmit_in); - HDfree(xmit_out); + free(buf); + free(expected); + free(xmit_in); + free(xmit_out); PASSED(); return 0; error: - HDfree(buf); - HDfree(expected); - HDfree(xmit_in); - HDfree(xmit_out); + free(buf); + free(expected); + free(xmit_in); + free(xmit_out); return -1; } @@ -1209,7 +1209,7 @@ create_mirroring_split_fapl(const char *basename, struct mirrortest_filenames *n H5FD_mirror_fapl_t mirror_conf; hid_t ret_value = H5I_INVALID_HID; - if (NULL == (splitter_config = HDmalloc(sizeof(H5FD_splitter_vfd_config_t)))) + if (NULL == (splitter_config = malloc(sizeof(H5FD_splitter_vfd_config_t)))) TEST_ERROR; /* Initialize the fapls, too, so the library doesn't try to @@ -1263,7 +1263,7 @@ create_mirroring_split_fapl(const char *basename, struct mirrortest_filenames *n if (H5Pclose(splitter_config->wo_fapl_id) < 0) TEST_ERROR; - HDfree(splitter_config); + free(splitter_config); return ret_value; @@ -1275,7 +1275,7 @@ error: H5Pclose(ret_value); } H5E_END_TRY - HDfree(splitter_config); + free(splitter_config); return H5I_INVALID_HID; } /* end create_mirroring_split_fapl() */ @@ -1302,7 +1302,7 @@ test_create_and_close(const struct mt_opts *opts) TESTING("File creation and immediate close"); - if (NULL == (names = HDmalloc(sizeof(struct mirrortest_filenames)))) + if (NULL == (names = malloc(sizeof(struct mirrortest_filenames)))) TEST_ERROR; /* Create FAPL for splitter[sec2|mirror] */ @@ -1317,13 +1317,13 @@ test_create_and_close(const struct mt_opts *opts) if (H5Pclose(fapl_id) < 0) TEST_ERROR; - HDfree(names); + free(names); PASSED(); return 0; error: - HDfree(names); + free(names); H5E_BEGIN_TRY { H5Fclose(file_id); @@ -1741,7 +1741,7 @@ test_basic_dataset_write(const struct mt_opts *opts) TESTING("Mirror open and dataset writing"); - if (NULL == (names = HDmalloc(sizeof(struct mirrortest_filenames)))) + if (NULL == (names = malloc(sizeof(struct mirrortest_filenames)))) TEST_ERROR; /* Create FAPL for Splitter[sec2|mirror] */ @@ -1749,7 +1749,7 @@ test_basic_dataset_write(const struct mt_opts *opts) TEST_ERROR; /* Prepare data to be written */ - if (NULL == (buf = HDmalloc(DATABUFFER_SIZE * DATABUFFER_SIZE * sizeof(int)))) + if (NULL == (buf = malloc(DATABUFFER_SIZE * DATABUFFER_SIZE * sizeof(int)))) TEST_ERROR; for (i = 0; i < DATABUFFER_SIZE; i++) { for (j = 0; j < DATABUFFER_SIZE; j++) { @@ -1798,15 +1798,15 @@ test_basic_dataset_write(const struct mt_opts *opts) if (h5_compare_file_bytes(names->rw, names->wo) < 0) TEST_ERROR; - HDfree(buf); - HDfree(names); + free(buf); + free(names); PASSED(); return 0; error: - HDfree(buf); - HDfree(names); + free(buf); + free(names); H5E_BEGIN_TRY { @@ -1841,7 +1841,7 @@ test_chunked_dataset_write(const struct mt_opts *opts) TESTING("Mirror open and dataset writing (chunked)"); - if (NULL == (names = HDmalloc(sizeof(struct mirrortest_filenames)))) + if (NULL == (names = malloc(sizeof(struct mirrortest_filenames)))) TEST_ERROR; /* Create FAPL for Splitter[sec2|mirror] */ @@ -1891,13 +1891,13 @@ test_chunked_dataset_write(const struct mt_opts *opts) TEST_ERROR; } - HDfree(names); + free(names); PASSED(); return 0; error: - HDfree(names); + free(names); H5E_BEGIN_TRY { H5Fclose(file_id); @@ -1931,7 +1931,7 @@ test_on_disk_zoo(const struct mt_opts *opts) TESTING("'Zoo' of on-disk structures"); - if (NULL == (names = HDmalloc(sizeof(struct mirrortest_filenames)))) + if (NULL == (names = malloc(sizeof(struct mirrortest_filenames)))) TEST_ERROR; /* Create FAPL for Splitter[sec2|mirror] */ @@ -1982,13 +1982,13 @@ test_on_disk_zoo(const struct mt_opts *opts) if (h5_compare_file_bytes(names->rw, names->wo) < 0) TEST_ERROR; - HDfree(names); + free(names); PASSED(); return 0; error: - HDfree(names); + free(names); H5E_BEGIN_TRY { H5Fclose(file_id); @@ -2035,9 +2035,9 @@ test_vanishing_datasets(const struct mt_opts *opts) TESTING("Vanishing Datasets"); - if (NULL == (names = HDmalloc(sizeof(struct mirrortest_filenames)))) + if (NULL == (names = malloc(sizeof(struct mirrortest_filenames)))) TEST_ERROR; - if (NULL == (buf = HDcalloc(1, sizeof(*buf)))) + if (NULL == (buf = calloc(1, sizeof(*buf)))) TEST_ERROR; /* -------------------- */ @@ -2121,15 +2121,15 @@ test_vanishing_datasets(const struct mt_opts *opts) if (H5Pclose(fapl_id) < 0) TEST_ERROR; - HDfree(names); - HDfree(buf); + free(names); + free(buf); PASSED(); return 0; error: - HDfree(names); - HDfree(buf); + free(names); + free(buf); H5E_BEGIN_TRY { H5Pclose(fapl_id); @@ -2173,7 +2173,7 @@ test_concurrent_access(const struct mt_opts *opts) TESTING("Concurrent opened mirrored files"); - if (NULL == (bundle = HDmalloc(sizeof(struct file_bundle) * CONCURRENT_COUNT))) + if (NULL == (bundle = malloc(sizeof(struct file_bundle) * CONCURRENT_COUNT))) TEST_ERROR; /* Initialize bundle */ @@ -2198,7 +2198,7 @@ test_concurrent_access(const struct mt_opts *opts) } /* Prepare data to be written */ - if (NULL == (buf = HDmalloc(DATABUFFER_SIZE * DATABUFFER_SIZE * sizeof(int)))) + if (NULL == (buf = malloc(DATABUFFER_SIZE * DATABUFFER_SIZE * sizeof(int)))) TEST_ERROR; for (i = 0; i < DATABUFFER_SIZE; i++) { for (j = 0; j < DATABUFFER_SIZE; j++) { @@ -2258,8 +2258,8 @@ test_concurrent_access(const struct mt_opts *opts) if (h5_compare_file_bytes(bundle[i].names.rw, bundle[i].names.wo) < 0) TEST_ERROR; - HDfree(bundle); - HDfree(buf); + free(bundle); + free(buf); PASSED(); return 0; @@ -2275,8 +2275,8 @@ error: } } H5E_END_TRY - HDfree(bundle); - HDfree(buf); + free(bundle); + free(buf); return -1; } /* end test_concurrent_access() */ diff --git a/test/ntypes.c b/test/ntypes.c index 210dc9c..25f6b49 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -82,9 +82,9 @@ test_atomic_dtype(hid_t file) TESTING("atomic datatype"); - if (NULL == (ipoints2 = HDcalloc(1, sizeof(*ipoints2)))) + if (NULL == (ipoints2 = calloc(1, sizeof(*ipoints2)))) TEST_ERROR; - if (NULL == (icheck2 = HDcalloc(1, sizeof(*icheck2)))) + if (NULL == (icheck2 = calloc(1, sizeof(*icheck2)))) TEST_ERROR; /* Initialize the dataset */ @@ -132,7 +132,7 @@ test_atomic_dtype(hid_t file) /* Read the dataset back. The temporary buffer is for special platforms * like Cray. */ - if (NULL == (tmp = HDmalloc((size_t)(DIM0 * DIM1 * H5Tget_size(native_type))))) + if (NULL == (tmp = malloc((size_t)(DIM0 * DIM1 * H5Tget_size(native_type))))) TEST_ERROR; if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0) @@ -140,7 +140,7 @@ test_atomic_dtype(hid_t file) /* Copy data from temporary buffer to destination buffer */ HDmemcpy(icheck2, tmp, (size_t)(DIM0 * DIM1 * H5Tget_size(native_type))); - HDfree(tmp); + free(tmp); tmp = NULL; /* Convert to the integer type */ @@ -274,8 +274,8 @@ test_atomic_dtype(hid_t file) if (H5Sclose(space) < 0) TEST_ERROR; - HDfree(ipoints2); - HDfree(icheck2); + free(ipoints2); + free(icheck2); PASSED(); @@ -283,7 +283,7 @@ test_atomic_dtype(hid_t file) error: if (tmp) - HDfree(tmp); + free(tmp); H5E_BEGIN_TRY { @@ -294,8 +294,8 @@ error: } H5E_END_TRY - HDfree(ipoints2); - HDfree(icheck2); + free(ipoints2); + free(icheck2); return -1; } @@ -340,9 +340,9 @@ test_compound_dtype2(hid_t file) TESTING("nested compound datatype"); /* Allocate space for the points & check arrays */ - if (NULL == (points = (s1 *)HDmalloc(sizeof(s1) * DIM0 * DIM1))) + if (NULL == (points = (s1 *)malloc(sizeof(s1) * DIM0 * DIM1))) TEST_ERROR; - if (NULL == (check = (s1 *)HDcalloc(sizeof(s1), DIM0 * DIM1))) + if (NULL == (check = (s1 *)calloc(sizeof(s1), DIM0 * DIM1))) TEST_ERROR; /* Initialize the dataset */ @@ -538,22 +538,22 @@ test_compound_dtype2(hid_t file) /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ - if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type)))) + if (NULL == (tmp = malloc(DIM0 * DIM1 * H5Tget_size(native_type)))) TEST_ERROR; - if (NULL == (bkg = HDcalloc(sizeof(s1), DIM0 * DIM1))) + if (NULL == (bkg = calloc(sizeof(s1), DIM0 * DIM1))) TEST_ERROR; if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0) TEST_ERROR; HDmemcpy(check, tmp, DIM0 * DIM1 * H5Tget_size(native_type)); - HDfree(tmp); + free(tmp); tmp = NULL; if (H5Tconvert(native_type, tid_m, (DIM0 * DIM1), check, bkg, H5P_DEFAULT) < 0) TEST_ERROR; - HDfree(bkg); + free(bkg); bkg = NULL; /* Check that the values read are the same as the values written */ @@ -585,21 +585,21 @@ test_compound_dtype2(hid_t file) H5Tclose(tid_m); /* Free memory for test data */ - HDfree(points); - HDfree(check); + free(points); + free(check); PASSED(); return 0; error: if (tmp) - HDfree(tmp); + free(tmp); if (bkg) - HDfree(bkg); + free(bkg); if (points) - HDfree(points); + free(points); if (check) - HDfree(check); + free(check); H5E_BEGIN_TRY { @@ -655,9 +655,9 @@ test_compound_dtype(hid_t file) TESTING("compound datatype"); /* Allocate space for the points & check arrays */ - if (NULL == (points = (s1 *)HDmalloc(sizeof(s1) * DIM0 * DIM1))) + if (NULL == (points = (s1 *)malloc(sizeof(s1) * DIM0 * DIM1))) TEST_ERROR; - if (NULL == (check = (s1 *)HDcalloc(sizeof(s1), DIM0 * DIM1))) + if (NULL == (check = (s1 *)calloc(sizeof(s1), DIM0 * DIM1))) TEST_ERROR; /* Initialize the dataset */ @@ -759,22 +759,22 @@ test_compound_dtype(hid_t file) /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ - if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type)))) + if (NULL == (tmp = malloc(DIM0 * DIM1 * H5Tget_size(native_type)))) TEST_ERROR; - if (NULL == (bkg = HDcalloc(sizeof(s1), DIM0 * DIM1))) + if (NULL == (bkg = calloc(sizeof(s1), DIM0 * DIM1))) TEST_ERROR; if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0) TEST_ERROR; HDmemcpy(check, tmp, DIM0 * DIM1 * H5Tget_size(native_type)); - HDfree(tmp); + free(tmp); tmp = NULL; if (H5Tconvert(native_type, tid2, (DIM0 * DIM1), check, bkg, H5P_DEFAULT) < 0) TEST_ERROR; - HDfree(bkg); + free(bkg); bkg = NULL; /* Check that the values read are the same as the values written */ @@ -798,8 +798,8 @@ test_compound_dtype(hid_t file) H5Tclose(tid2); /* Free memory for test data */ - HDfree(points); - HDfree(check); + free(points); + free(check); PASSED(); return 0; @@ -807,13 +807,13 @@ test_compound_dtype(hid_t file) error: /* Free memory for test data */ if (tmp) - HDfree(tmp); + free(tmp); if (bkg) - HDfree(bkg); + free(bkg); if (points) - HDfree(points); + free(points); if (check) - HDfree(check); + free(check); H5E_BEGIN_TRY { @@ -865,9 +865,9 @@ test_compound_dtype3(hid_t file) TESTING("compound datatype with array as field"); /* Allocate space for the points & check arrays */ - if (NULL == (points = (s1 *)HDmalloc(sizeof(s1) * DIM0 * DIM1))) + if (NULL == (points = (s1 *)malloc(sizeof(s1) * DIM0 * DIM1))) TEST_ERROR; - if (NULL == (check = (s1 *)HDcalloc(sizeof(s1), DIM0 * DIM1))) + if (NULL == (check = (s1 *)calloc(sizeof(s1), DIM0 * DIM1))) TEST_ERROR; /* Initialize the dataset */ @@ -989,22 +989,22 @@ test_compound_dtype3(hid_t file) /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ - if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type)))) + if (NULL == (tmp = malloc(DIM0 * DIM1 * H5Tget_size(native_type)))) TEST_ERROR; - if (NULL == (bkg = HDcalloc(sizeof(s1), DIM0 * DIM1))) + if (NULL == (bkg = calloc(sizeof(s1), DIM0 * DIM1))) TEST_ERROR; if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0) TEST_ERROR; HDmemcpy(check, tmp, DIM0 * DIM1 * H5Tget_size(native_type)); - HDfree(tmp); + free(tmp); tmp = NULL; if (H5Tconvert(native_type, tid_m, (DIM0 * DIM1), check, bkg, H5P_DEFAULT) < 0) TEST_ERROR; - HDfree(bkg); + free(bkg); bkg = NULL; /* Check that the values read are the same as the values written */ @@ -1034,8 +1034,8 @@ test_compound_dtype3(hid_t file) H5Tclose(tid_m2); /* Free memory for test data */ - HDfree(points); - HDfree(check); + free(points); + free(check); PASSED(); return 0; @@ -1043,13 +1043,13 @@ test_compound_dtype3(hid_t file) error: /* Free memory for test data */ if (tmp) - HDfree(tmp); + free(tmp); if (bkg) - HDfree(bkg); + free(bkg); if (points) - HDfree(points); + free(points); if (check) - HDfree(check); + free(check); H5E_BEGIN_TRY { @@ -1102,9 +1102,9 @@ test_compound_opaque(hid_t file) TESTING("compound datatype with opaque field"); /* Allocate space for the points & check arrays */ - if (NULL == (points = (s1 *)HDmalloc(sizeof(s1) * DIM0 * DIM1))) + if (NULL == (points = (s1 *)malloc(sizeof(s1) * DIM0 * DIM1))) TEST_ERROR; - if (NULL == (check = (s1 *)HDcalloc(sizeof(s1), DIM0 * DIM1))) + if (NULL == (check = (s1 *)calloc(sizeof(s1), DIM0 * DIM1))) TEST_ERROR; /* Initialize the dataset */ @@ -1217,22 +1217,22 @@ test_compound_opaque(hid_t file) /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ - if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type)))) + if (NULL == (tmp = malloc(DIM0 * DIM1 * H5Tget_size(native_type)))) TEST_ERROR; - if (NULL == (bkg = HDcalloc(sizeof(s1), DIM0 * DIM1))) + if (NULL == (bkg = calloc(sizeof(s1), DIM0 * DIM1))) TEST_ERROR; if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0) TEST_ERROR; HDmemcpy(check, tmp, DIM0 * DIM1 * H5Tget_size(native_type)); - HDfree(tmp); + free(tmp); tmp = NULL; if (H5Tconvert(native_type, tid_m, (DIM0 * DIM1), check, bkg, H5P_DEFAULT) < 0) TEST_ERROR; - HDfree(bkg); + free(bkg); bkg = NULL; /* Check that the values read are the same as the values written */ @@ -1261,8 +1261,8 @@ test_compound_opaque(hid_t file) H5Tclose(tid_m); /* Free memory for test data */ - HDfree(points); - HDfree(check); + free(points); + free(check); PASSED(); return 0; @@ -1270,13 +1270,13 @@ test_compound_opaque(hid_t file) error: /* Free memory for test data */ if (tmp) - HDfree(tmp); + free(tmp); if (bkg) - HDfree(bkg); + free(bkg); if (points) - HDfree(points); + free(points); if (check) - HDfree(check); + free(check); H5E_BEGIN_TRY { @@ -1328,9 +1328,9 @@ test_enum_dtype(hid_t file) TESTING("enum datatype"); - if (NULL == (spoints2 = HDcalloc(1, sizeof(*spoints2)))) + if (NULL == (spoints2 = calloc(1, sizeof(*spoints2)))) TEST_ERROR; - if (NULL == (scheck2 = HDcalloc(1, sizeof(*scheck2)))) + if (NULL == (scheck2 = calloc(1, sizeof(*scheck2)))) TEST_ERROR; /* Initialize the dataset */ @@ -1397,7 +1397,7 @@ test_enum_dtype(hid_t file) /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ - if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type)))) + if (NULL == (tmp = malloc(DIM0 * DIM1 * H5Tget_size(native_type)))) TEST_ERROR; if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0) @@ -1424,18 +1424,18 @@ test_enum_dtype(hid_t file) H5Tclose(native_type); H5Tclose(tid_m); - HDfree(tmp); - HDfree(spoints2); - HDfree(scheck2); + free(tmp); + free(spoints2); + free(scheck2); PASSED(); return 0; error: /* Free memory for test data */ - HDfree(tmp); - HDfree(spoints2); - HDfree(scheck2); + free(tmp); + free(spoints2); + free(scheck2); H5E_BEGIN_TRY { @@ -1484,9 +1484,9 @@ test_array_dtype(hid_t file) TESTING("array of compound datatype"); /* Allocate space for the points & check arrays */ - if (NULL == (points = (s1 *)HDmalloc(sizeof(s1) * DIM0 * DIM1 * 5))) + if (NULL == (points = (s1 *)malloc(sizeof(s1) * DIM0 * DIM1 * 5))) TEST_ERROR; - if (NULL == (check = (s1 *)HDcalloc(sizeof(s1), DIM0 * DIM1 * 5))) + if (NULL == (check = (s1 *)calloc(sizeof(s1), DIM0 * DIM1 * 5))) TEST_ERROR; /* Initialize the dataset */ @@ -1568,14 +1568,14 @@ test_array_dtype(hid_t file) /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ - if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type)))) + if (NULL == (tmp = malloc(DIM0 * DIM1 * H5Tget_size(native_type)))) TEST_ERROR; if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0) TEST_ERROR; HDmemcpy(check, tmp, DIM0 * DIM1 * H5Tget_size(native_type)); - HDfree(tmp); + free(tmp); tmp = NULL; if (H5Tconvert(native_type, tid_m, (DIM0 * DIM1), check, NULL, H5P_DEFAULT) < 0) @@ -1606,8 +1606,8 @@ test_array_dtype(hid_t file) TEST_ERROR; /* Free memory for test data */ - HDfree(points); - HDfree(check); + free(points); + free(check); PASSED(); return 0; @@ -1615,11 +1615,11 @@ test_array_dtype(hid_t file) error: /* Free memory for test data */ if (tmp) - HDfree(tmp); + free(tmp); if (points) - HDfree(points); + free(points); if (check) - HDfree(check); + free(check); H5E_BEGIN_TRY { @@ -1668,9 +1668,9 @@ test_array_dtype2(hid_t file) TESTING("array of atomic datatype"); - if (NULL == (ipoints3 = HDcalloc(1, sizeof(*ipoints3)))) + if (NULL == (ipoints3 = calloc(1, sizeof(*ipoints3)))) goto error; - if (NULL == (icheck3 = HDcalloc(1, sizeof(*icheck3)))) + if (NULL == (icheck3 = calloc(1, sizeof(*icheck3)))) goto error; /* Initialize the dataset */ @@ -1725,14 +1725,14 @@ test_array_dtype2(hid_t file) /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ - if (NULL == (tmp = HDmalloc(DIM0 * DIM1 * H5Tget_size(native_type)))) + if (NULL == (tmp = malloc(DIM0 * DIM1 * H5Tget_size(native_type)))) TEST_ERROR; if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp) < 0) TEST_ERROR; HDmemcpy(icheck3, tmp, DIM0 * DIM1 * H5Tget_size(native_type)); - HDfree(tmp); + free(tmp); tmp = NULL; if (H5Tconvert(native_type, tid_m, (DIM0 * DIM1), icheck3, NULL, H5P_DEFAULT) < 0) @@ -1759,8 +1759,8 @@ test_array_dtype2(hid_t file) if (H5Tclose(tid_m) < 0) TEST_ERROR; - HDfree(ipoints3); - HDfree(icheck3); + free(ipoints3); + free(icheck3); PASSED(); return 0; @@ -1768,7 +1768,7 @@ test_array_dtype2(hid_t file) error: /* Free memory for test data */ if (tmp) - HDfree(tmp); + free(tmp); H5E_BEGIN_TRY { @@ -1781,8 +1781,8 @@ error: } H5E_END_TRY - HDfree(ipoints3); - HDfree(icheck3); + free(ipoints3); + free(icheck3); return -1; } @@ -1817,7 +1817,7 @@ test_vl_dtype(hid_t file) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(hvl_t)); + wdata[i].p = malloc((i + 1) * sizeof(hvl_t)); if (NULL == wdata[i].p) { H5_FAILED(); printf(" Cannot allocate memory for VL data! i=%u\n", (unsigned)i); @@ -1825,7 +1825,7 @@ test_vl_dtype(hid_t file) } /* end if */ wdata[i].len = i + 1; for (t1 = (hvl_t *)wdata[i].p, j = 0; j < (i + 1); j++, t1++) { - t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); + t1->p = malloc((j + 1) * sizeof(unsigned int)); if (NULL == t1->p) { H5_FAILED(); printf(" Cannot allocate memory for VL data! i=%u, j=%u\n", (unsigned)i, (unsigned)j); @@ -1914,7 +1914,7 @@ test_vl_dtype(hid_t file) /* use temporary buffer to convert datatype. This is for special * platforms like Cray */ - if (NULL == (tmp = (void **)HDmalloc(t2->len * sizeof(unsigned int)))) + if (NULL == (tmp = (void **)malloc(t2->len * sizeof(unsigned int)))) TEST_ERROR; HDmemcpy(tmp, t2->p, t2->len * H5Tget_size(nat_super_type)); @@ -1930,7 +1930,7 @@ test_vl_dtype(hid_t file) } /* end if */ } /* end for */ - HDfree(tmp); + free(tmp); tmp = NULL; } /* end for */ } /* end for */ @@ -1968,7 +1968,7 @@ test_vl_dtype(hid_t file) error: /* Free memory for test data */ if (tmp) - HDfree(tmp); + free(tmp); H5E_BEGIN_TRY { @@ -2103,7 +2103,7 @@ test_vlstr_dtype(hid_t file) /* Free memory for rdata */ for (i = 0; i < SPACE1_DIM1; i++) - HDfree(rdata[i]); + free(rdata[i]); rdata_alloc = FALSE; PASSED(); @@ -2113,7 +2113,7 @@ error: if (rdata_alloc) { /* Free memory for rdata */ for (i = 0; i < SPACE1_DIM1; i++) - HDfree(rdata[i]); + free(rdata[i]); } /* end if */ H5E_BEGIN_TRY @@ -2286,9 +2286,9 @@ test_refer_dtype(hid_t file) TESTING("reference datatype"); /* Allocate write & read buffers */ - if (NULL == (wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t))))) + if (NULL == (wbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t))))) TEST_ERROR; - if (NULL == (rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t))))) + if (NULL == (rbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t))))) TEST_ERROR; /* Create dataspace for datasets */ @@ -2393,8 +2393,8 @@ test_refer_dtype(hid_t file) TEST_ERROR; /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); PASSED(); @@ -2402,9 +2402,9 @@ test_refer_dtype(hid_t file) error: if (wbuf) - HDfree(wbuf); + free(wbuf); if (rbuf) - HDfree(rbuf); + free(rbuf); H5E_BEGIN_TRY { @@ -2459,9 +2459,9 @@ test_refer_dtype2(hid_t file) TESTING("dataset region reference"); /* Allocate write & read buffers */ - if (NULL == (dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2))) + if (NULL == (dwbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2))) TEST_ERROR; - if (NULL == (drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2))) + if (NULL == (drbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2))) TEST_ERROR; /* Create dataspace for datasets */ @@ -2605,8 +2605,8 @@ test_refer_dtype2(hid_t file) TEST_ERROR; /* Free memory buffers */ - HDfree(dwbuf); - HDfree(drbuf); + free(dwbuf); + free(drbuf); PASSED(); return 0; @@ -2614,9 +2614,9 @@ test_refer_dtype2(hid_t file) error: /* Free memory buffers */ if (dwbuf) - HDfree(dwbuf); + free(dwbuf); if (drbuf) - HDfree(drbuf); + free(drbuf); H5E_BEGIN_TRY { @@ -2807,7 +2807,7 @@ test_bitfield_dtype(hid_t file) if ((ntype_size = H5Tget_size(native_type)) == 0) TEST_ERROR; - rbuf = HDmalloc((size_t)nelmts * ntype_size); + rbuf = malloc((size_t)nelmts * ntype_size); /* Read the data and compare them */ if (H5Dread(dataset1, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) @@ -2831,7 +2831,7 @@ test_bitfield_dtype(hid_t file) if (H5Dclose(dataset1) < 0) TEST_ERROR; if (rbuf) - HDfree(rbuf); + free(rbuf); /* Open dataset2 again to check H5Tget_native_type */ if ((dataset2 = H5Dopen2(file, DSET2_BITFIELD_NAME, H5P_DEFAULT)) < 0) diff --git a/test/objcopy.c b/test/objcopy.c index a14421b..f13b64b 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -197,7 +197,7 @@ token_insert(H5O_info2_t *oi) /* Extend the table */ if (idtab_g.nobjs >= idtab_g.nalloc) { idtab_g.nalloc = MAX(256, 2 * idtab_g.nalloc); - idtab_g.obj = (H5O_token_t *)HDrealloc(idtab_g.obj, idtab_g.nalloc * sizeof(idtab_g.obj[0])); + idtab_g.obj = (H5O_token_t *)realloc(idtab_g.obj, idtab_g.nalloc * sizeof(idtab_g.obj[0])); } /* end if */ /* Insert the entry */ @@ -253,7 +253,7 @@ static void token_reset(void) { if (idtab_g.obj) - HDfree(idtab_g.obj); + free(idtab_g.obj); idtab_g.obj = NULL; idtab_g.nalloc = idtab_g.nobjs = 0; } /* end token_reset() */ @@ -585,7 +585,7 @@ test_copy_attach_attribute_vl(hid_t loc_id) for (i = 0; i < 4; i++) { buf[i].len = i * 3 + 1; - buf[i].p = (int *)HDmalloc(buf[i].len * sizeof(int)); + buf[i].p = (int *)malloc(buf[i].len * sizeof(int)); for (j = 0; j < buf[i].len; j++) ((int *)buf[i].p)[j] = (int)(j + 1); } /* end for */ @@ -851,9 +851,9 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ /* Check the raw data is equal */ /* Allocate & initialize space for the raw data buffers */ - if ((rbuf = HDcalloc(elmt_size, (size_t)nelmts)) == NULL) + if ((rbuf = calloc(elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR; - if ((rbuf2 = HDcalloc(elmt_size, (size_t)nelmts)) == NULL) + if ((rbuf2 = calloc(elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR; /* Read data from the source attribute */ @@ -884,9 +884,9 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ TEST_ERROR; /* Release raw data buffers */ - HDfree(rbuf); + free(rbuf); rbuf = NULL; - HDfree(rbuf2); + free(rbuf2); rbuf2 = NULL; /* close the source dataspace */ @@ -909,9 +909,9 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ error: if (rbuf) - HDfree(rbuf); + free(rbuf); if (rbuf2) - HDfree(rbuf2); + free(rbuf2); H5E_BEGIN_TRY { H5Sclose(sid2); @@ -1460,9 +1460,9 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) /* Check the raw data is equal */ /* Allocate & initialize space for the raw data buffers */ - if ((rbuf = HDcalloc(elmt_size, (size_t)nelmts)) == NULL) + if ((rbuf = calloc(elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR; - if ((rbuf2 = HDcalloc(elmt_size, (size_t)nelmts)) == NULL) + if ((rbuf2 = calloc(elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR; /* Read data from datasets */ @@ -1491,9 +1491,9 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) TEST_ERROR; /* Release raw data buffers */ - HDfree(rbuf); + free(rbuf); rbuf = NULL; - HDfree(rbuf2); + free(rbuf2); rbuf2 = NULL; /* close the source dataspace */ @@ -1523,9 +1523,9 @@ error: H5E_BEGIN_TRY { if (rbuf) - HDfree(rbuf); + free(rbuf); if (rbuf2) - HDfree(rbuf2); + free(rbuf2); H5Pclose(dcpl2); H5Pclose(dcpl); H5Sclose(sid2); @@ -6248,7 +6248,7 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { buf[i].len = i + 1; - buf[i].p = (int *)HDmalloc(buf[i].len * sizeof(int)); + buf[i].p = (int *)malloc(buf[i].len * sizeof(int)); for (j = 0; j < buf[i].len; j++) ((int *)buf[i].p)[j] = (int)(i * 10 + j); } /* end for */ @@ -6410,7 +6410,7 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { buf[i].len = i + 1; - buf[i].p = (int *)HDmalloc(buf[i].len * sizeof(int)); + buf[i].p = (int *)malloc(buf[i].len * sizeof(int)); for (j = 0; j < buf[i].len; j++) ((int *)buf[i].p)[j] = (int)(i * 10 + j); } /* end for */ @@ -6626,7 +6626,7 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { buf[i].len = i + 1; - buf[i].p = (int *)HDmalloc(buf[i].len * sizeof(int)); + buf[i].p = (int *)malloc(buf[i].len * sizeof(int)); for (j = 0; j < buf[i].len; j++) ((int *)buf[i].p)[j] = (int)(i * 10 + j); } /* end for */ @@ -6961,7 +6961,7 @@ attach_attribute_compound_vlstr(hid_t loc_id) /* Write to the attribute */ len = HDstrlen(ATTR_CMPD_STRING) + 1; buf.i = 9; - if (NULL == (buf.v = (char *)HDcalloc(len, sizeof(char)))) + if (NULL == (buf.v = (char *)calloc(len, sizeof(char)))) goto done; HDstrncpy(buf.v, ATTR_CMPD_STRING, len); if (H5Awrite(aid, cmpd_tid, &buf) < 0) @@ -6981,7 +6981,7 @@ done: if (aid > 0) H5Aclose(aid); - HDfree(buf.v); + free(buf.v); return ret_value; } /* attach_attribute_compound_vlstr */ @@ -7301,7 +7301,7 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, for (i = 0; i < DIM_SIZE_1; i++) { for (j = 0; j < DIM_SIZE_2; j++) { buf[i][j].len = (size_t)(j + 1); - buf[i][j].p = (int *)HDmalloc(buf[i][j].len * sizeof(int)); + buf[i][j].p = (int *)malloc(buf[i][j].len * sizeof(int)); for (k = 0; k < (int)buf[i][j].len; k++) ((int *)buf[i][j].p)[k] = i * 10000 + j * 100 + k; } @@ -9500,7 +9500,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { buf[i].len = i + 1; - buf[i].p = (int *)HDmalloc(buf[i].len * sizeof(int)); + buf[i].p = (int *)malloc(buf[i].len * sizeof(int)); for (j = 0; j < buf[i].len; j++) ((int *)buf[i].p)[j] = (int)(i * 10 + j); } /* end for */ @@ -9684,7 +9684,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { buf[i].len = i + 1; - buf[i].p = (int *)HDmalloc(buf[i].len * sizeof(int)); + buf[i].p = (int *)malloc(buf[i].len * sizeof(int)); for (j = 0; j < buf[i].len; j++) ((int *)buf[i].p)[j] = (int)(i * 10 + j); } /* end for */ @@ -9868,7 +9868,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { buf[i].len = i + 1; - buf[i].p = (int *)HDmalloc(buf[i].len * sizeof(int)); + buf[i].p = (int *)malloc(buf[i].len * sizeof(int)); for (j = 0; j < buf[i].len; j++) ((int *)buf[i].p)[j] = (int)(i * 10 + j); } /* end for */ @@ -10059,7 +10059,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_ /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { buf[i].len = i + 1; - buf[i].p = (int *)HDmalloc(buf[i].len * sizeof(int)); + buf[i].p = (int *)malloc(buf[i].len * sizeof(int)); for (j = 0; j < buf[i].len; j++) ((int *)buf[i].p)[j] = (int)(i * 10 + j); } /* end for */ @@ -10246,14 +10246,14 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { - buf[i].p = HDmalloc((i + 1) * sizeof(hvl_t)); + buf[i].p = malloc((i + 1) * sizeof(hvl_t)); if (buf[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); return 1; } /* end if */ buf[i].len = i + 1; for (tvl = (hvl_t *)buf[i].p, j = 0; j < (i + 1); j++, tvl++) { - tvl->p = HDmalloc((j + 1) * sizeof(unsigned int)); + tvl->p = malloc((j + 1) * sizeof(unsigned int)); if (tvl->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return 1; @@ -10447,14 +10447,14 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { - buf[i].p = HDmalloc((i + 1) * sizeof(hvl_t)); + buf[i].p = malloc((i + 1) * sizeof(hvl_t)); if (buf[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); TEST_ERROR; } /* end if */ buf[i].len = i + 1; for (tvl = (hvl_t *)buf[i].p, j = 0; j < (i + 1); j++, tvl++) { - tvl->p = HDmalloc((j + 1) * sizeof(unsigned int)); + tvl->p = malloc((j + 1) * sizeof(unsigned int)); if (tvl->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); TEST_ERROR; @@ -10642,14 +10642,14 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { - buf[i].p = HDmalloc((i + 1) * sizeof(hvl_t)); + buf[i].p = malloc((i + 1) * sizeof(hvl_t)); if (buf[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); TEST_ERROR; } /* end if */ buf[i].len = i + 1; for (tvl = (hvl_t *)buf[i].p, j = 0; j < (i + 1); j++, tvl++) { - tvl->p = HDmalloc((j + 1) * sizeof(unsigned int)); + tvl->p = malloc((j + 1) * sizeof(unsigned int)); if (tvl->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); TEST_ERROR; @@ -10886,14 +10886,14 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* set initial data values */ for (i = 0; i < DIM_SIZE_1; i++) { - buf[i].p = HDmalloc((i + 1) * sizeof(hvl_t)); + buf[i].p = malloc((i + 1) * sizeof(hvl_t)); if (buf[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); TEST_ERROR; } /* end if */ buf[i].len = i + 1; for (tvl = (hvl_t *)buf[i].p, j = 0; j < (i + 1); j++, tvl++) { - tvl->p = HDmalloc((j + 1) * sizeof(unsigned int)); + tvl->p = malloc((j + 1) * sizeof(unsigned int)); if (tvl->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); TEST_ERROR; @@ -11094,7 +11094,7 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, for (i = 0; i < DIM_SIZE_1; i++) { buf[i].a = (int)(i * (i - 1)); buf[i].b.len = i + 1; - buf[i].b.p = (int *)HDmalloc(buf[i].b.len * sizeof(int)); + buf[i].b.p = (int *)malloc(buf[i].b.len * sizeof(int)); for (j = 0; j < buf[i].b.len; j++) ((int *)buf[i].b.p)[j] = (int)(i * 10 + j); buf[i].c = 1.0 / ((double)i + 1.0); @@ -11270,7 +11270,7 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl for (i = 0; i < DIM_SIZE_1; i++) { buf[i].a = (int)(i * (i - 1)); buf[i].b.len = i + 1; - buf[i].b.p = (int *)HDmalloc(buf[i].b.len * sizeof(int)); + buf[i].b.p = (int *)malloc(buf[i].b.len * sizeof(int)); for (j = 0; j < buf[i].b.len; j++) ((int *)buf[i].b.p)[j] = (int)(i * 10 + j); buf[i].c = 1.0 / ((double)i + 1.0); @@ -11455,7 +11455,7 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl for (i = 0; i < DIM_SIZE_1; i++) { buf[i].a = (int)(i * (i - 1)); buf[i].b.len = i + 1; - buf[i].b.p = (int *)HDmalloc(buf[i].b.len * sizeof(int)); + buf[i].b.p = (int *)malloc(buf[i].b.len * sizeof(int)); for (j = 0; j < buf[i].b.len; j++) ((int *)buf[i].b.p)[j] = (int)(i * 10 + j); buf[i].c = 1.0 / ((double)i + 1.0); diff --git a/test/objcopy_ref.c b/test/objcopy_ref.c index 23deb2c..eac44bb 100644 --- a/test/objcopy_ref.c +++ b/test/objcopy_ref.c @@ -105,7 +105,7 @@ token_insert(H5O_info2_t *oinfo) /* Extend the table */ if (idtab_g.nobjs >= idtab_g.nalloc) { idtab_g.nalloc = MAX(256, 2 * idtab_g.nalloc); - idtab_g.obj = (H5O_token_t *)HDrealloc(idtab_g.obj, idtab_g.nalloc * sizeof(idtab_g.obj[0])); + idtab_g.obj = (H5O_token_t *)realloc(idtab_g.obj, idtab_g.nalloc * sizeof(idtab_g.obj[0])); } /* Insert the entry */ @@ -161,7 +161,7 @@ static void token_reset(void) { if (idtab_g.obj) - HDfree(idtab_g.obj); + free(idtab_g.obj); idtab_g.obj = NULL; idtab_g.nalloc = idtab_g.nobjs = 0; } /* end token_reset() */ @@ -635,9 +635,9 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ /* Check the raw data is equal */ /* Allocate & initialize space for the raw data buffers */ - if ((rbuf = HDcalloc(elmt_size, (size_t)nelmts)) == NULL) + if ((rbuf = calloc(elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR; - if ((rbuf2 = HDcalloc(elmt_size, (size_t)nelmts)) == NULL) + if ((rbuf2 = calloc(elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR; /* Read data from the source attribute */ @@ -668,9 +668,9 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ TEST_ERROR; /* Release raw data buffers */ - HDfree(rbuf); + free(rbuf); rbuf = NULL; - HDfree(rbuf2); + free(rbuf2); rbuf2 = NULL; /* close the source dataspace */ @@ -693,9 +693,9 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ error: if (rbuf) - HDfree(rbuf); + free(rbuf); if (rbuf2) - HDfree(rbuf2); + free(rbuf2); H5E_BEGIN_TRY { H5Sclose(sid2); @@ -1172,9 +1172,9 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) /* Check the raw data is equal */ /* Allocate & initialize space for the raw data buffers */ - if ((rbuf = HDcalloc(elmt_size, (size_t)nelmts)) == NULL) + if ((rbuf = calloc(elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR; - if ((rbuf2 = HDcalloc(elmt_size, (size_t)nelmts)) == NULL) + if ((rbuf2 = calloc(elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR; /* Read data from datasets */ @@ -1203,9 +1203,9 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) TEST_ERROR; /* Release raw data buffers */ - HDfree(rbuf); + free(rbuf); rbuf = NULL; - HDfree(rbuf2); + free(rbuf2); rbuf2 = NULL; /* close the source dataspace */ @@ -1235,9 +1235,9 @@ error: H5E_BEGIN_TRY { if (rbuf) - HDfree(rbuf); + free(rbuf); if (rbuf2) - HDfree(rbuf2); + free(rbuf2); H5Pclose(dcpl2); H5Pclose(dcpl); H5Sclose(sid2); diff --git a/test/ohdr.c b/test/ohdr.c index a15b8a0..d48189d 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -360,7 +360,7 @@ test_ohdr_swmr(hbool_t new_format) } /* end else */ /* Initialize data */ - wbuf = (int *)HDcalloc(compact_size, sizeof(int)); + wbuf = (int *)calloc(compact_size, sizeof(int)); n = 0; for (u = 0; u < compact_size; u++) wbuf[u] = n++; @@ -440,7 +440,7 @@ test_ohdr_swmr(hbool_t new_format) FAIL_STACK_ERROR; /* Free the buffer */ - HDfree(wbuf); + free(wbuf); PASSED(); @@ -455,7 +455,7 @@ error: H5Pclose(plist); H5Pclose(fapl); HDremove(FILE_OHDR_SWMR); - HDfree(wbuf); + free(wbuf); } H5E_END_TRY @@ -949,9 +949,9 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id) **********************************************/ buf_size = HDstrlen(ATTR_LONG) + 1; - if (NULL == (in_buf = (char *)HDcalloc(buf_size, sizeof(char)))) + if (NULL == (in_buf = (char *)calloc(buf_size, sizeof(char)))) TEST_ERROR; - if (NULL == (out_buf = (char *)HDcalloc(buf_size, sizeof(char)))) + if (NULL == (out_buf = (char *)calloc(buf_size, sizeof(char)))) TEST_ERROR; /* Create a string attribute on the dataset @@ -1052,8 +1052,8 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id) TEST_ERROR; /* Free memory */ - HDfree(in_buf); - HDfree(out_buf); + free(in_buf); + free(out_buf); PASSED(); return SUCCEED; @@ -1069,8 +1069,8 @@ error: } H5E_END_TRY - HDfree(in_buf); - HDfree(out_buf); + free(in_buf); + free(out_buf); return FAIL; } /* test_minimized_dset_ohdr_attribute_addition */ diff --git a/test/onion.c b/test/onion.c index d87958e..d54b539 100644 --- a/test/onion.c +++ b/test/onion.c @@ -112,21 +112,21 @@ onion_filepaths_init(const char *basename) { struct onion_filepaths *paths = NULL; - if (NULL == (paths = HDmalloc(sizeof(struct onion_filepaths)))) + if (NULL == (paths = malloc(sizeof(struct onion_filepaths)))) TEST_ERROR; paths->canon = NULL; paths->onion = NULL; paths->recovery = NULL; - if (NULL == (paths->canon = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->canon = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) TEST_ERROR; HDsnprintf(paths->canon, ONION_TEST_FIXNAME_SIZE, "%s", basename); - if (NULL == (paths->onion = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->onion = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) TEST_ERROR; HDsnprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); - if (NULL == (paths->recovery = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->recovery = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) TEST_ERROR; HDsnprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); @@ -134,11 +134,11 @@ onion_filepaths_init(const char *basename) error: if (paths != NULL) { - HDfree(paths->canon); - HDfree(paths->onion); - HDfree(paths->recovery); + free(paths->canon); + free(paths->onion); + free(paths->recovery); } - HDfree(paths); + free(paths); return NULL; } @@ -147,10 +147,10 @@ error: static void onion_filepaths_destroy(struct onion_filepaths *paths) { - HDfree(paths->canon); - HDfree(paths->onion); - HDfree(paths->recovery); - HDfree(paths); + free(paths->canon); + free(paths->onion); + free(paths->recovery); + free(paths); } /*----------------------------------------------------------------------------- @@ -1156,7 +1156,7 @@ test_history_encode_decode(void) if (80 != exp_size) TEST_ERROR; - history.record_locs = HDcalloc(history.n_revisions, sizeof(H5FD_onion_record_loc_t)); + history.record_locs = calloc(history.n_revisions, sizeof(H5FD_onion_record_loc_t)); if (NULL == history.record_locs) TEST_ERROR; @@ -1185,7 +1185,7 @@ test_history_encode_decode(void) buf_p = exp + exp_size - 4; UINT32ENCODE(buf_p, history.checksum); - if (NULL == (buf = HDmalloc(exp_size))) + if (NULL == (buf = malloc(exp_size))) TEST_ERROR; if (H5FD__onion_history_encode(&history, buf, &checksum_out) != exp_size) @@ -1212,7 +1212,7 @@ test_history_encode_decode(void) /* True decode requires allocating space for record pointers */ - history_out.record_locs = HDcalloc(history_out.n_revisions, sizeof(H5FD_onion_record_loc_t)); + history_out.record_locs = calloc(history_out.n_revisions, sizeof(H5FD_onion_record_loc_t)); if (NULL == history_out.record_locs) TEST_ERROR; @@ -1238,17 +1238,17 @@ test_history_encode_decode(void) TEST_ERROR; } - HDfree(history_out.record_locs); - HDfree(buf); - HDfree(history.record_locs); + free(history_out.record_locs); + free(buf); + free(history.record_locs); PASSED(); return 0; error: - HDfree(history_out.record_locs); - HDfree(buf); - HDfree(history.record_locs); + free(history_out.record_locs); + free(buf); + free(history.record_locs); return -1; } /* end test_history_encode_decode() */ @@ -1336,7 +1336,7 @@ test_revision_record_encode_decode(void) TESTING("encode/decode revision record"); HDmemcpy(record.time_of_creation, "19411207T190643Z", 16); - record.archival_index.list = HDcalloc(record.archival_index.n_entries, sizeof(H5FD_onion_index_entry_t)); + record.archival_index.list = calloc(record.archival_index.n_entries, sizeof(H5FD_onion_index_entry_t)); if (NULL == record.archival_index.list) TEST_ERROR; @@ -1376,7 +1376,7 @@ test_revision_record_encode_decode(void) r_out.archival_index.n_entries = 0; r_out.archival_index.list = NULL; - if (NULL == (buf = HDmalloc(sizeof(unsigned char) * exp_size))) + if (NULL == (buf = malloc(sizeof(unsigned char) * exp_size))) TEST_ERROR; /* Test encode */ @@ -1459,10 +1459,10 @@ test_revision_record_encode_decode(void) TEST_ERROR; /* Allocate variable-length components */ - r_out.comment = HDcalloc(r_out.comment_size, sizeof(char)); + r_out.comment = calloc(r_out.comment_size, sizeof(char)); if (NULL == r_out.comment) TEST_ERROR; - r_out.archival_index.list = HDcalloc(r_out.archival_index.n_entries, sizeof(H5FD_onion_index_entry_t)); + r_out.archival_index.list = calloc(r_out.archival_index.n_entries, sizeof(H5FD_onion_index_entry_t)); if (NULL == r_out.archival_index.list) TEST_ERROR; @@ -1508,19 +1508,19 @@ test_revision_record_encode_decode(void) /* Cleanup */ - HDfree(r_out.archival_index.list); - HDfree(r_out.comment); - HDfree(buf); - HDfree(record.archival_index.list); + free(r_out.archival_index.list); + free(r_out.comment); + free(buf); + free(record.archival_index.list); PASSED(); return 0; error: - HDfree(r_out.archival_index.list); - HDfree(r_out.comment); - HDfree(buf); - HDfree(record.archival_index.list); + free(r_out.archival_index.list); + free(r_out.comment); + free(buf); + free(record.archival_index.list); return -1; } /* end test_revision_record_encode_decode() */ @@ -1549,7 +1549,7 @@ compare_file_bytes_exactly(const char *filepath, hid_t fapl_id, size_t nbytes, c TEST_ERROR; } - if (NULL == (act_buf = HDmalloc(nbytes))) + if (NULL == (act_buf = malloc(nbytes))) TEST_ERROR; /* Fill buffer with bogus UCHAR_MAX values */ for (size_t i = 0; i < nbytes; i++) @@ -1569,14 +1569,14 @@ compare_file_bytes_exactly(const char *filepath, hid_t fapl_id, size_t nbytes, c if (H5FDclose(raw_vfile) < 0) TEST_ERROR; - HDfree(act_buf); + free(act_buf); return 0; error: if (raw_vfile != NULL) H5FDclose(raw_vfile); - HDfree(act_buf); + free(act_buf); return -1; } /* end compare_file_bytes_exactly() */ @@ -1621,7 +1621,7 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt /* Ingest onion header */ readsize = MIN(filesize, H5FD_ONION_ENCODED_SIZE_HEADER); - if (NULL == (buf = HDmalloc(readsize * sizeof(unsigned char)))) + if (NULL == (buf = malloc(readsize * sizeof(unsigned char)))) TEST_ERROR; if (H5FDread(raw_file, H5FD_MEM_DRAW, H5P_DEFAULT, 0, readsize, buf) < 0) TEST_ERROR; @@ -1645,13 +1645,13 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt if (filter->origin_eof != hdr_out.origin_eof) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; /* Ingest history */ readsize = hdr_out.history_size; - if (NULL == (buf = HDmalloc(readsize * sizeof(unsigned char)))) + if (NULL == (buf = malloc(readsize * sizeof(unsigned char)))) TEST_ERROR; if (H5FDread(raw_file, H5FD_MEM_DRAW, H5P_DEFAULT, hdr_out.history_addr, readsize, buf) < 0) TEST_ERROR; @@ -1673,7 +1673,7 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt TEST_ERROR; /* Final read, populate pointers to revision records */ - history_out.record_locs = HDcalloc(history_out.n_revisions, sizeof(H5FD_onion_record_loc_t)); + history_out.record_locs = calloc(history_out.n_revisions, sizeof(H5FD_onion_record_loc_t)); if (NULL == history_out.record_locs) TEST_ERROR; if (H5FD__onion_history_decode(buf, &history_out) != readsize) @@ -1706,7 +1706,7 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt TEST_ERROR; } - HDfree(buf); + free(buf); buf = NULL; /* Ingest revision(s) */ @@ -1722,7 +1722,7 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt rev_out.comment = NULL; readsize = rpp->record_size; - if (NULL == (buf = HDmalloc((size_t)rpp->record_size))) + if (NULL == (buf = malloc((size_t)rpp->record_size))) TEST_ERROR; if (H5FDread(raw_file, H5FD_MEM_DRAW, H5P_DEFAULT, rpp->phys_addr, rpp->record_size, buf) < 0) TEST_ERROR; @@ -1750,10 +1750,10 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt TEST_ERROR; /* Final read, get variable-length data */ - if (NULL == (rev_out.comment = HDmalloc((size_t)rev_out.comment_size))) + if (NULL == (rev_out.comment = malloc((size_t)rev_out.comment_size))) TEST_ERROR; rev_out.archival_index.list = - HDcalloc(rev_out.archival_index.n_entries, sizeof(H5FD_onion_index_entry_t)); + calloc(rev_out.archival_index.n_entries, sizeof(H5FD_onion_index_entry_t)); if (NULL == rev_out.archival_index.list) TEST_ERROR; @@ -1776,21 +1776,21 @@ verify_history_as_expected_onion(H5FD_t *raw_file, struct expected_history *filt erp->n_index_entries != rev_out.archival_index.n_entries) TEST_ERROR; - HDfree(buf); - HDfree(rev_out.comment); - HDfree(rev_out.archival_index.list); + free(buf); + free(rev_out.comment); + free(rev_out.archival_index.list); } - HDfree(history_out.record_locs); + free(history_out.record_locs); history_out.record_locs = NULL; return 0; error: - HDfree(buf); - HDfree(rev_out.comment); - HDfree(rev_out.archival_index.list); - HDfree(history_out.record_locs); + free(buf); + free(rev_out.comment); + free(rev_out.archival_index.list); + free(history_out.record_locs); return -1; @@ -1851,7 +1851,7 @@ verify_stored_onion_create_0_open(struct onion_filepaths *paths, H5FD_onion_fapl TEST_ERROR; /* Size here is arbitrary */ - if (NULL == (act_buf = HDcalloc(1, 8))) + if (NULL == (act_buf = calloc(1, 8))) TEST_ERROR; /* Should fail when reading from an empty file */ @@ -1863,7 +1863,7 @@ verify_stored_onion_create_0_open(struct onion_filepaths *paths, H5FD_onion_fapl if (err_ret != FAIL) TEST_ERROR; - HDfree(act_buf); + free(act_buf); act_buf = NULL; if (H5FDclose(file) < 0) @@ -1887,7 +1887,7 @@ verify_stored_onion_create_0_open(struct onion_filepaths *paths, H5FD_onion_fapl error: if (file != NULL) (void)H5FDclose(file); - HDfree(act_buf); + free(act_buf); return -1; } /* end verify_stored_onion_create_0_open() */ @@ -2032,13 +2032,13 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) } /* Verify logical file contents. */ - if (NULL == (buf = HDmalloc(4 * sizeof(char)))) + if (NULL == (buf = malloc(4 * sizeof(char)))) TEST_ERROR; if (H5FDread(vfile_rw, H5FD_MEM_DRAW, H5P_DEFAULT, 0, 4, buf) < 0) TEST_ERROR; if (HDmemcmp(a_list_s, buf, 4) != 0) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; /* Write the latter half of buffer at addr 0 (more than one page) */ @@ -2052,13 +2052,13 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) TEST_ERROR; /* Verify logical file contents. */ - if (NULL == (buf = HDmalloc(buf_size * sizeof(char)))) + if (NULL == (buf = malloc(buf_size * sizeof(char)))) TEST_ERROR; if (H5FDread(vfile_rw, H5FD_MEM_DRAW, H5P_DEFAULT, 0, buf_size, buf) < 0) TEST_ERROR; if (HDmemcmp(a_list_s + half_size, buf, buf_size) != 0) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; /* Overwrite existing data with entire buffer at addr 0 */ @@ -2068,13 +2068,13 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) TEST_ERROR; /* Verify logical file contents. */ - if (NULL == (buf = HDmalloc(a_list_size_s * sizeof(char)))) + if (NULL == (buf = malloc(a_list_size_s * sizeof(char)))) TEST_ERROR; if (H5FDread(vfile_rw, H5FD_MEM_DRAW, H5P_DEFAULT, 0, a_list_size_s, buf) < 0) TEST_ERROR; if (HDmemcmp(a_list_s, buf, a_list_size_s) != 0) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; } /* end if writing data to logical file */ @@ -2135,13 +2135,13 @@ test_create_oniontarget(hbool_t truncate_canonical, hbool_t with_initial_data) TEST_ERROR; if (H5FDset_eoa(vfile_ro, H5FD_MEM_DRAW, a_list_size_s) < 0) TEST_ERROR; - if (NULL == (buf = HDmalloc(a_list_size_s * 64 * sizeof(char)))) + if (NULL == (buf = malloc(a_list_size_s * 64 * sizeof(char)))) TEST_ERROR; if (H5FDread(vfile_ro, H5FD_MEM_DRAW, H5P_DEFAULT, 0, a_list_size_s, buf) < 0) TEST_ERROR; if (HDmemcmp(a_list_s, buf, a_list_size_s) != 0) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; } else { @@ -2180,7 +2180,7 @@ error: onion_filepaths_destroy(paths); } - HDfree(buf); + free(buf); if (vfile_raw != NULL) (void)H5FDclose(vfile_raw); @@ -2356,7 +2356,7 @@ test_several_revisions_with_logical_gaps(void) H5FDget_eof(file, H5FD_MEM_DRAW)); TEST_ERROR; } - if (NULL == (buf = HDmalloc(size * sizeof(unsigned char)))) + if (NULL == (buf = malloc(size * sizeof(unsigned char)))) TEST_ERROR; if (H5FDset_eoa(file, H5FD_MEM_DRAW, size) < 0) TEST_ERROR; @@ -2368,10 +2368,10 @@ test_several_revisions_with_logical_gaps(void) } if (HDmemcmp(buf + a_off, a_list_s, a_list_size_s) != 0) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; /* Repeat read at page offset; test possible read offset error */ - if (NULL == (buf = HDmalloc(ONION_TEST_PAGE_SIZE_5 * sizeof(unsigned char)))) + if (NULL == (buf = malloc(ONION_TEST_PAGE_SIZE_5 * sizeof(unsigned char)))) TEST_ERROR; if (H5FDread(file, H5FD_MEM_DRAW, H5P_DEFAULT, ONION_TEST_PAGE_SIZE_5, ONION_TEST_PAGE_SIZE_5, buf) < 0) TEST_ERROR; @@ -2382,7 +2382,7 @@ test_several_revisions_with_logical_gaps(void) } if (HDmemcmp(buf + size, a_list_s, ONION_TEST_PAGE_SIZE_5 - size) != 0) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; if (H5FDclose(file) < 0) TEST_ERROR; @@ -2404,7 +2404,7 @@ test_several_revisions_with_logical_gaps(void) size = b_off + b_list_size_s; if (size != H5FDget_eof(file, H5FD_MEM_DRAW)) TEST_ERROR; - if (NULL == (buf = HDmalloc(size * sizeof(unsigned char)))) + if (NULL == (buf = malloc(size * sizeof(unsigned char)))) TEST_ERROR; if (H5FDset_eoa(file, H5FD_MEM_DRAW, size) < 0) TEST_ERROR; @@ -2422,7 +2422,7 @@ test_several_revisions_with_logical_gaps(void) } if (HDmemcmp(buf + b_off, b_list_s, b_list_size_s) != 0) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; if (H5FDclose(file) < 0) TEST_ERROR; @@ -2444,7 +2444,7 @@ test_several_revisions_with_logical_gaps(void) size = b_off + b_list_size_s; if (size != H5FDget_eof(file, H5FD_MEM_DRAW)) TEST_ERROR; - buf = (unsigned char *)HDmalloc(sizeof(unsigned char) * size); + buf = (unsigned char *)malloc(sizeof(unsigned char) * size); if (NULL == buf) TEST_ERROR; if (H5FDset_eoa(file, H5FD_MEM_DRAW, size) < 0) @@ -2461,7 +2461,7 @@ test_several_revisions_with_logical_gaps(void) } if (HDmemcmp(buf + b_off, b_list_s, b_list_size_s) != 0) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; if (H5FDclose(file) < 0) TEST_ERROR; @@ -2536,8 +2536,8 @@ error: onion_filepaths_destroy(paths); } - HDfree(history_out.record_locs); - HDfree(buf); + free(history_out.record_locs); + free(buf); if (file != NULL) (void)H5FDclose(file); @@ -2609,7 +2609,7 @@ do_onion_open_and_writes(const char *filename, H5FD_onion_fapl_info_t *onion_inf if (H5FDwrite(file, H5FD_MEM_DRAW, H5P_DEFAULT, wi->offset, wi->size, wi->buf) < 0) TEST_ERROR; /* Verify write as expected */ - if (NULL == (buf_vfy = HDmalloc(wi->size * sizeof(unsigned char)))) + if (NULL == (buf_vfy = malloc(wi->size * sizeof(unsigned char)))) TEST_ERROR; if (H5FDread(file, H5FD_MEM_DRAW, H5P_DEFAULT, wi->offset, wi->size, buf_vfy) < 0) TEST_ERROR; @@ -2622,7 +2622,7 @@ do_onion_open_and_writes(const char *filename, H5FD_onion_fapl_info_t *onion_inf HDfflush(stdout); TEST_ERROR; } - HDfree(buf_vfy); + free(buf_vfy); buf_vfy = NULL; } /* end for each write */ @@ -2646,7 +2646,7 @@ error: } H5E_END_TRY - HDfree(buf_vfy); + free(buf_vfy); return -1; } /* end do_onion_open_and_writes() */ @@ -2733,7 +2733,7 @@ test_page_aligned_history_create(void) TEST_ERROR; /* Inspect logical file */ - if (NULL == (buf = HDmalloc(b_list_size_s * sizeof(unsigned char)))) + if (NULL == (buf = malloc(b_list_size_s * sizeof(unsigned char)))) TEST_ERROR; file = H5FDopen(paths->canon, H5F_ACC_RDONLY, fapl_id, HADDR_UNDEF); if (NULL == file) @@ -2767,7 +2767,7 @@ test_page_aligned_history_create(void) if (H5FDclose(file) < 0) TEST_ERROR; file = NULL; - HDfree(buf); + free(buf); buf = NULL; /* Inspect history construction */ @@ -2777,7 +2777,7 @@ test_page_aligned_history_create(void) if (H5FDset_eoa(file, H5FD_MEM_DRAW, H5FDget_eof(file, H5FD_MEM_DRAW)) < 0) TEST_ERROR; - if (NULL == (buf = HDmalloc(H5FD_ONION_ENCODED_SIZE_HEADER))) + if (NULL == (buf = malloc(H5FD_ONION_ENCODED_SIZE_HEADER))) TEST_ERROR; if (H5FDread(file, H5FD_MEM_DRAW, H5P_DEFAULT, 0, H5FD_ONION_ENCODED_SIZE_HEADER, buf) < 0) TEST_ERROR; @@ -2785,10 +2785,10 @@ test_page_aligned_history_create(void) TEST_ERROR; if (hdr_out.history_addr & ((1 << 5) - 1)) /* 5::PAGE_SIZE_5 */ TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; - if (NULL == (buf = HDmalloc(hdr_out.history_size))) + if (NULL == (buf = malloc(hdr_out.history_size))) TEST_ERROR; if (H5FDread(file, H5FD_MEM_DRAW, H5P_DEFAULT, hdr_out.history_addr, hdr_out.history_size, buf) < 0) TEST_ERROR; @@ -2796,12 +2796,12 @@ test_page_aligned_history_create(void) TEST_ERROR; if (history_out.n_revisions != 2) TEST_ERROR; - history_out.record_locs = HDcalloc(history_out.n_revisions, sizeof(H5FD_onion_record_loc_t)); + history_out.record_locs = calloc(history_out.n_revisions, sizeof(H5FD_onion_record_loc_t)); if (NULL == history_out.record_locs) TEST_ERROR; if (H5FD__onion_history_decode(buf, &history_out) != hdr_out.history_size) TEST_ERROR; - HDfree(buf); + free(buf); buf = NULL; for (i = 0; i < history_out.n_revisions; i++) { @@ -2811,7 +2811,7 @@ test_page_aligned_history_create(void) /* TODO: check phys_addr of each page entry? */ } - HDfree(history_out.record_locs); + free(history_out.record_locs); history_out.record_locs = NULL; if (H5FDclose(file) < 0) @@ -2830,7 +2830,7 @@ test_page_aligned_history_create(void) HDremove(paths->recovery); onion_filepaths_destroy(paths); - HDfree(buf); + free(buf); PASSED(); return 0; @@ -2844,8 +2844,8 @@ error: onion_filepaths_destroy(paths); } - HDfree(history_out.record_locs); - HDfree(buf); + free(history_out.record_locs); + free(buf); if (file != NULL) (void)H5FDclose(file); @@ -2908,11 +2908,11 @@ test_integration_create(void) /* SETUP */ - if (NULL == (wdata = HDcalloc(1, sizeof(*wdata)))) + if (NULL == (wdata = calloc(1, sizeof(*wdata)))) TEST_ERROR; - if (NULL == (rdata = HDcalloc(1, sizeof(*rdata)))) + if (NULL == (rdata = calloc(1, sizeof(*rdata)))) TEST_ERROR; - if (NULL == (dset_data = HDcalloc(1, sizeof(*dset_data)))) + if (NULL == (dset_data = calloc(1, sizeof(*dset_data)))) TEST_ERROR; if ((onion_info.backing_fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) @@ -3168,9 +3168,9 @@ test_integration_create(void) HDremove(paths->recovery); onion_filepaths_destroy(paths); - HDfree(wdata); - HDfree(rdata); - HDfree(dset_data); + free(wdata); + free(rdata); + free(dset_data); PASSED(); return 0; @@ -3193,9 +3193,9 @@ error: } H5E_END_TRY - HDfree(wdata); - HDfree(rdata); - HDfree(dset_data); + free(wdata); + free(rdata); + free(dset_data); return -1; } /* end test_integration_create() */ @@ -3237,11 +3237,11 @@ test_integration_create_simple(void) TESTING("onion-created one-dimensional HDF5 file with revisions"); /* Setup */ - if (NULL == (wdata = HDcalloc(1, sizeof(*wdata)))) + if (NULL == (wdata = calloc(1, sizeof(*wdata)))) TEST_ERROR; - if (NULL == (rdata = HDcalloc(1, sizeof(*rdata)))) + if (NULL == (rdata = calloc(1, sizeof(*rdata)))) TEST_ERROR; - if (NULL == (dset_data = HDcalloc(1, sizeof(*dset_data)))) + if (NULL == (dset_data = calloc(1, sizeof(*dset_data)))) TEST_ERROR; if ((onion_info.backing_fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) @@ -3427,9 +3427,9 @@ test_integration_create_simple(void) HDremove(paths->recovery); onion_filepaths_destroy(paths); - HDfree(wdata); - HDfree(rdata); - HDfree(dset_data); + free(wdata); + free(rdata); + free(dset_data); PASSED(); return 0; @@ -3452,9 +3452,9 @@ error: } H5E_END_TRY - HDfree(wdata); - HDfree(rdata); - HDfree(dset_data); + free(wdata); + free(rdata); + free(dset_data); return -1; } /* end test_integration_create_simple() */ @@ -4681,11 +4681,11 @@ test_integration_create_by_name(void) TESTING("H5Pset_driver_by_name"); /* Setup */ - if (NULL == (wdata = HDcalloc(1, sizeof(*wdata)))) + if (NULL == (wdata = calloc(1, sizeof(*wdata)))) TEST_ERROR; - if (NULL == (rdata = HDcalloc(1, sizeof(*rdata)))) + if (NULL == (rdata = calloc(1, sizeof(*rdata)))) TEST_ERROR; - if (NULL == (dset_data = HDcalloc(1, sizeof(*dset_data)))) + if (NULL == (dset_data = calloc(1, sizeof(*dset_data)))) TEST_ERROR; if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) @@ -4867,9 +4867,9 @@ test_integration_create_by_name(void) HDremove(paths->recovery); onion_filepaths_destroy(paths); - HDfree(wdata); - HDfree(rdata); - HDfree(dset_data); + free(wdata); + free(rdata); + free(dset_data); PASSED(); return 0; @@ -4891,9 +4891,9 @@ error: } H5E_END_TRY - HDfree(wdata); - HDfree(rdata); - HDfree(dset_data); + free(wdata); + free(rdata); + free(dset_data); return -1; } /* end test_integration_create_simple() */ diff --git a/test/page_buffer.c b/test/page_buffer.c index 55a079d..18e0ce4 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -104,7 +104,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl) FAIL_STACK_ERROR; num_elements = NX * NY; - if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL) + if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL) TEST_ERROR; for (i = 0; i < (int)num_elements; i++) data[i] = i; @@ -185,7 +185,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl) if (H5Sclose(filespace) < 0) FAIL_STACK_ERROR; - HDfree(data); + free(data); return 0; error: @@ -196,7 +196,7 @@ error: H5Gclose(grp_id); H5Fclose(file_id); if (data) - HDfree(data); + free(data); } H5E_END_TRY return (1); @@ -253,7 +253,7 @@ open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size FAIL_STACK_ERROR; num_elements = NX * NY; - if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL) + if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL) TEST_ERROR; for (i = 0; i < NUM_DSETS; i++) { @@ -280,7 +280,7 @@ open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size FAIL_STACK_ERROR; if (H5Fclose(file_id) < 0) FAIL_STACK_ERROR; - HDfree(data); + free(data); return 0; @@ -290,7 +290,7 @@ error: H5Gclose(grp_id); H5Fclose(file_id); if (data) - HDfree(data); + free(data); } H5E_END_TRY return 1; @@ -348,7 +348,7 @@ set_multi_split(const char *env_h5_drvr, hid_t fapl, hsize_t pagesize) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - HDfree(memb_name[mt]); + free(memb_name[mt]); } /* end if */ @@ -580,7 +580,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) if (set_multi_split(env_h5_drvr, fapl, sizeof(int) * 200) != 0) TEST_ERROR; - if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL) + if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL) TEST_ERROR; if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) @@ -786,7 +786,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; if (H5Pclose(fapl) < 0) FAIL_STACK_ERROR; - HDfree(data); + free(data); PASSED(); return 0; @@ -798,7 +798,7 @@ error: H5Pclose(fcpl); H5Fclose(file_id); if (data) - HDfree(data); + free(data); } H5E_END_TRY return 1; @@ -848,7 +848,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) if (set_multi_split(env_h5_drvr, fapl, sizeof(int) * 200) != 0) TEST_ERROR; - if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL) + if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL) TEST_ERROR; if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) @@ -1028,7 +1028,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; if (H5Pclose(fapl) < 0) FAIL_STACK_ERROR; - HDfree(data); + free(data); PASSED(); return 0; @@ -1040,7 +1040,7 @@ error: H5Pclose(fcpl); H5Fclose(file_id); if (data) - HDfree(data); + free(data); } H5E_END_TRY return 1; @@ -1092,7 +1092,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if (set_multi_split(env_h5_drvr, fapl, sizeof(int) * 200) != 0) TEST_ERROR; - if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL) + if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL) TEST_ERROR; if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) @@ -1646,7 +1646,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr) if (H5Pclose(fapl) < 0) FAIL_STACK_ERROR; - HDfree(data); + free(data); PASSED(); @@ -1660,7 +1660,7 @@ error: H5Pclose(fcpl); H5Fclose(file_id); if (data) - HDfree(data); + free(data); } H5E_END_TRY @@ -1711,7 +1711,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) if (set_multi_split(env_h5_drvr, fapl, sizeof(int) * 200) != 0) TEST_ERROR; - if ((data = (int *)HDcalloc((size_t)num_elements, sizeof(int))) == NULL) + if ((data = (int *)calloc((size_t)num_elements, sizeof(int))) == NULL) TEST_ERROR; if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) @@ -1938,7 +1938,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr) FAIL_STACK_ERROR; if (H5Pclose(fapl) < 0) FAIL_STACK_ERROR; - HDfree(data); + free(data); PASSED(); return 0; @@ -1950,7 +1950,7 @@ error: H5Pclose(fcpl); H5Fclose(file_id); if (data) - HDfree(data); + free(data); } H5E_END_TRY diff --git a/test/s3comms.c b/test/s3comms.c index 7a6b09c..dd7682c 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -1271,7 +1271,7 @@ test_HMAC_SHA256(void) dest = NULL; } else { - dest = (char *)HDmalloc(sizeof(char) * cases[i].dest_size); + dest = (char *)malloc(sizeof(char) * cases[i].dest_size); assert(dest != NULL); } @@ -1284,7 +1284,7 @@ test_HMAC_SHA256(void) if (0 != HDstrncmp(cases[i].exp, dest, HDstrlen(cases[i].exp))) { /* print out how wrong things are, and then fail */ - dest = (char *)HDrealloc(dest, cases[i].dest_size + 1); + dest = (char *)realloc(dest, cases[i].dest_size + 1); assert(dest != NULL); dest[cases[i].dest_size] = 0; fprintf(stdout, "ERROR:\n!!! \"%s\"\n != \"%s\"\n", cases[i].exp, dest); @@ -1296,14 +1296,14 @@ test_HMAC_SHA256(void) JSVERIFY(0, HDstrncmp(cases[i].exp, dest, HDstrlen(cases[i].exp)), NULL); #endif /* VERBOSE */ } - HDfree(dest); + free(dest); } PASSED(); return 0; error: - HDfree(dest); + free(dest); return -1; } /* end test_HMAC_SHA256() */ @@ -1365,13 +1365,13 @@ test_nlowercase(void) TESTING("nlowercase"); for (i = 0; i < n_cases; i++) { - dest = (char *)HDmalloc(sizeof(char) * 16); + dest = (char *)malloc(sizeof(char) * 16); JSVERIFY(SUCCEED, H5FD_s3comms_nlowercase(dest, cases[i].in, cases[i].len), cases[i].in) if (cases[i].len > 0) { JSVERIFY(0, HDstrncmp(dest, cases[i].exp, cases[i].len), NULL) } - HDfree(dest); + free(dest); } /* end for each testcase */ JSVERIFY(FAIL, H5FD_s3comms_nlowercase(NULL, cases[0].in, cases[0].len), "null destination should fail") @@ -1380,7 +1380,7 @@ test_nlowercase(void) return 0; error: - HDfree(dest); + free(dest); return -1; } /* end test_nlowercase() */ @@ -2216,7 +2216,7 @@ test_signing_key(void) TESTING("signing_key"); for (i = 0; i < ncases; i++) { - key = (unsigned char *)HDmalloc(sizeof(unsigned char) * SHA256_DIGEST_LENGTH); + key = (unsigned char *)malloc(sizeof(unsigned char) * SHA256_DIGEST_LENGTH); assert(key != NULL); JSVERIFY(SUCCEED, H5FD_s3comms_signing_key(key, cases[i].secret_key, cases[i].region, cases[i].when), @@ -2225,7 +2225,7 @@ test_signing_key(void) JSVERIFY(0, HDstrncmp((const char *)cases[i].exp, (const char *)key, SHA256_DIGEST_LENGTH), (const char *)cases[i].exp) - HDfree(key); + free(key); key = NULL; } @@ -2233,7 +2233,7 @@ test_signing_key(void) * ERROR CASES * ***************/ - key = (unsigned char *)HDmalloc(sizeof(unsigned char) * SHA256_DIGEST_LENGTH); + key = (unsigned char *)malloc(sizeof(unsigned char) * SHA256_DIGEST_LENGTH); assert(key != NULL); JSVERIFY(FAIL, H5FD_s3comms_signing_key(NULL, cases[0].secret_key, cases[0].region, cases[0].when), @@ -2248,7 +2248,7 @@ test_signing_key(void) JSVERIFY(FAIL, H5FD_s3comms_signing_key(key, cases[0].secret_key, cases[0].region, NULL), "time string cannot be NULL") - HDfree(key); + free(key); key = NULL; PASSED(); @@ -2256,7 +2256,7 @@ test_signing_key(void) error: if (key != NULL) { - HDfree(key); + free(key); } return -1; @@ -2397,7 +2397,7 @@ test_trim(void) for (i = 0; i < n_cases; i++) { assert(str == NULL); - str = (char *)HDmalloc(sizeof(char) * cases[i].in_len); + str = (char *)malloc(sizeof(char) * cases[i].in_len); assert(str != NULL); HDstrncpy(str, cases[i].in, cases[i].in_len); @@ -2406,7 +2406,7 @@ test_trim(void) if (dest_len > 0) { JSVERIFY(0, HDstrncmp(cases[i].exp, dest, dest_len), cases[i].exp) } - HDfree(str); + free(str); str = NULL; } /* end for each testcase */ @@ -2415,11 +2415,11 @@ test_trim(void) JSVERIFY(0, dest_len, "trimming NULL string writes 0 characters") assert(str == NULL); - str = (char *)HDmalloc(sizeof(char *) * 11); + str = (char *)malloc(sizeof(char *) * 11); 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); + free(str); str = NULL; PASSED(); @@ -2427,7 +2427,7 @@ test_trim(void) error: if (str != NULL) { - HDfree(str); + free(str); } return -1; @@ -2511,7 +2511,7 @@ test_uriencode(void) for (i = 0; i < ncases; i++) { str_len = cases[i].s_len; - dest = (char *)HDmalloc(sizeof(char) * str_len * 3 + 1); + dest = (char *)malloc(sizeof(char) * str_len * 3 + 1); FAIL_IF(dest == NULL) JSVERIFY(SUCCEED, @@ -2520,7 +2520,7 @@ test_uriencode(void) JSVERIFY(HDstrlen(cases[i].expected), dest_written, NULL) JSVERIFY(0, HDstrncmp(dest, cases[i].expected, dest_written), cases[i].expected); - HDfree(dest); + free(dest); dest = NULL; } /* end for each testcase */ @@ -2528,7 +2528,7 @@ test_uriencode(void) * ERROR CASES * ***************/ - dest = (char *)HDmalloc(sizeof(char) * 15); + dest = (char *)malloc(sizeof(char) * 15); assert(dest != NULL); JSVERIFY(FAIL, H5FD_s3comms_uriencode(NULL, "word$", 5, FALSE, &dest_written), @@ -2536,7 +2536,7 @@ test_uriencode(void) JSVERIFY(FAIL, H5FD_s3comms_uriencode(dest, NULL, 5, FALSE, &dest_written), "source string cannot be NULL"); - HDfree(dest); + free(dest); dest = NULL; PASSED(); @@ -2544,7 +2544,7 @@ test_uriencode(void) error: if (dest != NULL) { - HDfree(dest); + free(dest); } return -1; diff --git a/test/select_io_dset.c b/test/select_io_dset.c index 7a766b4..8700283 100644 --- a/test/select_io_dset.c +++ b/test/select_io_dset.c @@ -268,11 +268,11 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) char *rbuf = NULL; char dset_name[DSET_NAME_LEN]; - if ((wbuf = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) + if ((wbuf = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) FAIL_STACK_ERROR; - if (mwbuf && (wbuf_bak = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) + if (mwbuf && (wbuf_bak = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) FAIL_STACK_ERROR; - if ((rbuf = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) + if ((rbuf = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) FAIL_STACK_ERROR; /* Create dataset transfer property list */ @@ -365,9 +365,9 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) if (H5Pclose(dxpl) < 0) FAIL_STACK_ERROR; - HDfree(wbuf); - HDfree(wbuf_bak); - HDfree(rbuf); + free(wbuf); + free(wbuf_bak); + free(rbuf); PASSED(); @@ -384,11 +384,11 @@ error: H5E_END_TRY; if (wbuf) - HDfree(wbuf); + free(wbuf); if (wbuf_bak) - HDfree(wbuf_bak); + free(wbuf_bak); if (wbuf) - HDfree(rbuf); + free(rbuf); return FAIL; @@ -737,17 +737,17 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) FAIL_STACK_ERROR; /* Allocate buffers for datasets */ - if (NULL == (s1_wbuf = (s1_t *)HDmalloc(sizeof(s1_t) * DSET_SELECT_DIM))) + if (NULL == (s1_wbuf = (s1_t *)malloc(sizeof(s1_t) * DSET_SELECT_DIM))) FAIL_STACK_ERROR; - if (mwbuf && NULL == (s1_wbuf_bak = (s1_t *)HDmalloc(sizeof(s1_t) * DSET_SELECT_DIM))) + if (mwbuf && NULL == (s1_wbuf_bak = (s1_t *)malloc(sizeof(s1_t) * DSET_SELECT_DIM))) FAIL_STACK_ERROR; - if (NULL == (s1_rbuf = (s1_t *)HDmalloc(sizeof(s1_t) * DSET_SELECT_DIM))) + if (NULL == (s1_rbuf = (s1_t *)malloc(sizeof(s1_t) * DSET_SELECT_DIM))) FAIL_STACK_ERROR; - if (NULL == (s2_wbuf = (s2_t *)HDmalloc(sizeof(s2_t) * DSET_SELECT_DIM))) + if (NULL == (s2_wbuf = (s2_t *)malloc(sizeof(s2_t) * DSET_SELECT_DIM))) FAIL_STACK_ERROR; - if (mwbuf && NULL == (s2_wbuf_bak = (s2_t *)HDmalloc(sizeof(s2_t) * DSET_SELECT_DIM))) + if (mwbuf && NULL == (s2_wbuf_bak = (s2_t *)malloc(sizeof(s2_t) * DSET_SELECT_DIM))) FAIL_STACK_ERROR; - if (NULL == (s2_rbuf = (s2_t *)HDmalloc(sizeof(s2_t) * DSET_SELECT_DIM))) + if (NULL == (s2_rbuf = (s2_t *)malloc(sizeof(s2_t) * DSET_SELECT_DIM))) FAIL_STACK_ERROR; /* Create the memory data type */ @@ -968,12 +968,12 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) FAIL_STACK_ERROR; /* Release buffers */ - HDfree(s1_wbuf); - HDfree(s1_wbuf_bak); - HDfree(s1_rbuf); - HDfree(s2_wbuf); - HDfree(s2_wbuf_bak); - HDfree(s2_rbuf); + free(s1_wbuf); + free(s1_wbuf_bak); + free(s1_rbuf); + free(s2_wbuf); + free(s2_wbuf_bak); + free(s2_rbuf); PASSED(); @@ -994,17 +994,17 @@ error: H5E_END_TRY; if (s1_wbuf) - HDfree(s1_wbuf); + free(s1_wbuf); if (s1_wbuf_bak) - HDfree(s1_wbuf_bak); + free(s1_wbuf_bak); if (s1_rbuf) - HDfree(s1_rbuf); + free(s1_rbuf); if (s2_wbuf) - HDfree(s2_wbuf); + free(s2_wbuf); if (s2_wbuf_bak) - HDfree(s2_wbuf_bak); + free(s2_wbuf_bak); if (s2_rbuf) - HDfree(s2_rbuf); + free(s2_rbuf); return FAIL; } /* test_cmpd_with_bkg() */ @@ -1116,24 +1116,24 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m buf_size = ndsets * DSET_SELECT_DIM * sizeof(int); /* Allocate buffers for all datasets */ - if (NULL == (total_wbuf = (int *)HDmalloc(buf_size))) + if (NULL == (total_wbuf = (int *)malloc(buf_size))) FAIL_STACK_ERROR; - if (mwbuf && NULL == (total_wbuf_bak = (int *)HDmalloc(buf_size))) + if (mwbuf && NULL == (total_wbuf_bak = (int *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_trans_wbuf = (int *)HDmalloc(buf_size))) + if (NULL == (total_trans_wbuf = (int *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_rbuf = (int *)HDmalloc(buf_size))) + if (NULL == (total_rbuf = (int *)malloc(buf_size))) FAIL_STACK_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(long); - if (NULL == (total_lwbuf = (long *)HDmalloc(buf_size))) + if (NULL == (total_lwbuf = (long *)malloc(buf_size))) FAIL_STACK_ERROR; - if (mwbuf && NULL == (total_lwbuf_bak = (long *)HDmalloc(buf_size))) + if (mwbuf && NULL == (total_lwbuf_bak = (long *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_trans_lwbuf = (long *)HDmalloc(buf_size))) + if (NULL == (total_trans_lwbuf = (long *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_lrbuf = (long *)HDmalloc(buf_size))) + if (NULL == (total_lrbuf = (long *)malloc(buf_size))) FAIL_STACK_ERROR; /* Initialize buffer indices */ @@ -1267,14 +1267,14 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m FAIL_STACK_ERROR; } - HDfree(total_wbuf); - HDfree(total_wbuf_bak); - HDfree(total_rbuf); - HDfree(total_trans_wbuf); - HDfree(total_lwbuf); - HDfree(total_lwbuf_bak); - HDfree(total_lrbuf); - HDfree(total_trans_lwbuf); + free(total_wbuf); + free(total_wbuf_bak); + free(total_rbuf); + free(total_trans_wbuf); + free(total_lwbuf); + free(total_lwbuf_bak); + free(total_lrbuf); + free(total_trans_lwbuf); PASSED(); @@ -1293,21 +1293,21 @@ error: H5E_END_TRY; if (total_wbuf) - HDfree(total_wbuf); + free(total_wbuf); if (total_wbuf_bak) - HDfree(total_wbuf_bak); + free(total_wbuf_bak); if (total_trans_wbuf) - HDfree(total_trans_wbuf); + free(total_trans_wbuf); if (total_rbuf) - HDfree(total_rbuf); + free(total_rbuf); if (total_lwbuf) - HDfree(total_lwbuf); + free(total_lwbuf); if (total_lwbuf_bak) - HDfree(total_lwbuf_bak); + free(total_lwbuf_bak); if (total_lrbuf) - HDfree(total_lrbuf); + free(total_lrbuf); if (total_trans_lwbuf) - HDfree(total_lrbuf); + free(total_lrbuf); return FAIL; @@ -1446,18 +1446,18 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) s2_buf_size = ndsets * DSET_SELECT_DIM * sizeof(s2_t); /* Allocate buffers */ - if (NULL == (total_wbuf = (s1_t *)HDmalloc(buf_size))) + if (NULL == (total_wbuf = (s1_t *)malloc(buf_size))) TEST_ERROR; - if (mwbuf && NULL == (total_wbuf_bak = (s1_t *)HDmalloc(buf_size))) + if (mwbuf && NULL == (total_wbuf_bak = (s1_t *)malloc(buf_size))) TEST_ERROR; - if (NULL == (total_rbuf = (s1_t *)HDmalloc(buf_size))) + if (NULL == (total_rbuf = (s1_t *)malloc(buf_size))) TEST_ERROR; - if (NULL == (s2_total_wbuf = (s2_t *)HDmalloc(s2_buf_size))) + if (NULL == (s2_total_wbuf = (s2_t *)malloc(s2_buf_size))) TEST_ERROR; - if (mwbuf && NULL == (s2_total_wbuf_bak = (s2_t *)HDmalloc(s2_buf_size))) + if (mwbuf && NULL == (s2_total_wbuf_bak = (s2_t *)malloc(s2_buf_size))) TEST_ERROR; - if (NULL == (s2_total_rbuf = (s2_t *)HDmalloc(s2_buf_size))) + if (NULL == (s2_total_rbuf = (s2_t *)malloc(s2_buf_size))) TEST_ERROR; /* Initialize buffer indices */ @@ -1740,12 +1740,12 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) FAIL_STACK_ERROR; } - HDfree(total_wbuf); - HDfree(total_wbuf_bak); - HDfree(total_rbuf); - HDfree(s2_total_wbuf); - HDfree(s2_total_wbuf_bak); - HDfree(s2_total_rbuf); + free(total_wbuf); + free(total_wbuf_bak); + free(total_rbuf); + free(s2_total_wbuf); + free(s2_total_wbuf_bak); + free(s2_total_rbuf); PASSED(); @@ -1763,17 +1763,17 @@ error: H5E_END_TRY; if (total_wbuf) - HDfree(total_wbuf); + free(total_wbuf); if (total_wbuf_bak) - HDfree(total_wbuf_bak); + free(total_wbuf_bak); if (total_rbuf) - HDfree(total_rbuf); + free(total_rbuf); if (s2_total_wbuf) - HDfree(s2_total_wbuf); + free(s2_total_wbuf); if (s2_total_wbuf_bak) - HDfree(s2_total_wbuf_bak); + free(s2_total_wbuf_bak); if (s2_total_rbuf) - HDfree(s2_total_rbuf); + free(s2_total_rbuf); return FAIL; @@ -1882,11 +1882,11 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) buf_size = ndsets * ss * DSET_SELECT_DIM; /* Allocate buffers for all datasets */ - if (NULL == (total_wbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_wbuf = (uint8_t *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_wbuf_bak = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_wbuf_bak = (uint8_t *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_rbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_rbuf = (uint8_t *)malloc(buf_size))) FAIL_STACK_ERROR; /* Initialize buffer indices */ @@ -1949,11 +1949,11 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) buf_size = ndsets * (ss * DSET_SELECT_DIM); /* Allocate buffers for all datasets */ - if (NULL == (total_lwbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_lwbuf = (uint8_t *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_lwbuf_bak = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_lwbuf_bak = (uint8_t *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_lrbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_lrbuf = (uint8_t *)malloc(buf_size))) FAIL_STACK_ERROR; /* Initialize buffer indices */ @@ -2024,11 +2024,11 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) buf_size = ndsets * (ss * DSET_SELECT_DIM); /* Allocate buffers for all datasets */ - if (NULL == (total_swbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_swbuf = (uint8_t *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_swbuf_bak = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_swbuf_bak = (uint8_t *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_srbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_srbuf = (uint8_t *)malloc(buf_size))) FAIL_STACK_ERROR; /* Initialize buffer indices */ @@ -2093,15 +2093,15 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) FAIL_STACK_ERROR; } - HDfree(total_wbuf); - HDfree(total_wbuf_bak); - HDfree(total_rbuf); - HDfree(total_lwbuf); - HDfree(total_lwbuf_bak); - HDfree(total_lrbuf); - HDfree(total_swbuf); - HDfree(total_swbuf_bak); - HDfree(total_srbuf); + free(total_wbuf); + free(total_wbuf_bak); + free(total_rbuf); + free(total_lwbuf); + free(total_lwbuf_bak); + free(total_lrbuf); + free(total_swbuf); + free(total_swbuf_bak); + free(total_srbuf); PASSED(); @@ -2119,23 +2119,23 @@ error: H5E_END_TRY; if (total_wbuf) - HDfree(total_wbuf); + free(total_wbuf); if (total_wbuf_bak) - HDfree(total_wbuf_bak); + free(total_wbuf_bak); if (total_rbuf) - HDfree(total_rbuf); + free(total_rbuf); if (total_lwbuf) - HDfree(total_lwbuf); + free(total_lwbuf); if (total_lwbuf_bak) - HDfree(total_lwbuf_bak); + free(total_lwbuf_bak); if (total_lrbuf) - HDfree(total_lrbuf); + free(total_lrbuf); if (total_swbuf) - HDfree(total_swbuf); + free(total_swbuf); if (total_swbuf_bak) - HDfree(total_swbuf_bak); + free(total_swbuf_bak); if (total_srbuf) - HDfree(total_srbuf); + free(total_srbuf); return FAIL; @@ -2363,49 +2363,49 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) /* DSET_WITH_NO_CONV */ buf_size = ndsets * DSET_SELECT_DIM * sizeof(int); - if (NULL == (total_wbuf1 = (int *)HDmalloc(buf_size))) + if (NULL == (total_wbuf1 = (int *)malloc(buf_size))) FAIL_STACK_ERROR; - if (mwbuf && NULL == (total_wbuf1_bak = (int *)HDmalloc(buf_size))) + if (mwbuf && NULL == (total_wbuf1_bak = (int *)malloc(buf_size))) FAIL_STACK_ERROR; - if (NULL == (total_rbuf1 = (int *)HDmalloc(buf_size))) + if (NULL == (total_rbuf1 = (int *)malloc(buf_size))) FAIL_STACK_ERROR; /* DSET_WITH_CONV_AND_NO_BKG */ buf_size = ndsets * DSET_SELECT_DIM * sizeof(unsigned long); - if (NULL == (ul_total_wbuf2 = (unsigned long *)HDmalloc(buf_size))) + if (NULL == (ul_total_wbuf2 = (unsigned long *)malloc(buf_size))) FAIL_STACK_ERROR; - if (mwbuf && NULL == (ul_total_wbuf2_bak = (unsigned long *)HDmalloc(buf_size))) + if (mwbuf && NULL == (ul_total_wbuf2_bak = (unsigned long *)malloc(buf_size))) FAIL_STACK_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(long); - if (NULL == (l_total_rbuf2 = (long *)HDmalloc(buf_size))) + if (NULL == (l_total_rbuf2 = (long *)malloc(buf_size))) FAIL_STACK_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(long); - if (NULL == (l_total_wbuf2 = (long *)HDmalloc(buf_size))) + if (NULL == (l_total_wbuf2 = (long *)malloc(buf_size))) FAIL_STACK_ERROR; - if (mwbuf && NULL == (l_total_wbuf2_bak = (long *)HDmalloc(buf_size))) + if (mwbuf && NULL == (l_total_wbuf2_bak = (long *)malloc(buf_size))) FAIL_STACK_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(short); - if (NULL == (s_total_rbuf2 = (short *)HDmalloc(buf_size))) + if (NULL == (s_total_rbuf2 = (short *)malloc(buf_size))) FAIL_STACK_ERROR; /* DSET_WITH_CONV_AND_BKG */ buf_size = ndsets * DSET_SELECT_DIM * sizeof(s1_t); - if (NULL == (s1_total_wbuf3 = (s1_t *)HDmalloc(buf_size))) + if (NULL == (s1_total_wbuf3 = (s1_t *)malloc(buf_size))) FAIL_STACK_ERROR; - if (mwbuf && NULL == (s1_total_wbuf3_bak = (s1_t *)HDmalloc(buf_size))) + if (mwbuf && NULL == (s1_total_wbuf3_bak = (s1_t *)malloc(buf_size))) FAIL_STACK_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(s3_t); - if (NULL == (s3_total_rbuf3 = (s3_t *)HDmalloc(buf_size))) + if (NULL == (s3_total_rbuf3 = (s3_t *)malloc(buf_size))) FAIL_STACK_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(s4_t); - if (NULL == (s4_total_wbuf3 = (s4_t *)HDmalloc(buf_size))) + if (NULL == (s4_total_wbuf3 = (s4_t *)malloc(buf_size))) FAIL_STACK_ERROR; - if (mwbuf && NULL == (s4_total_wbuf3_bak = (s4_t *)HDmalloc(buf_size))) + if (mwbuf && NULL == (s4_total_wbuf3_bak = (s4_t *)malloc(buf_size))) FAIL_STACK_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(s1_t); - if (NULL == (s1_total_rbuf3 = (s1_t *)HDmalloc(buf_size))) + if (NULL == (s1_total_rbuf3 = (s1_t *)malloc(buf_size))) FAIL_STACK_ERROR; /* Test with s settings for ndsets */ @@ -2639,37 +2639,37 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) } /* Freeing */ - HDfree(total_wbuf1); + free(total_wbuf1); total_wbuf1 = NULL; - HDfree(total_wbuf1_bak); + free(total_wbuf1_bak); total_wbuf1_bak = NULL; - HDfree(total_rbuf1); + free(total_rbuf1); total_rbuf1 = NULL; - HDfree(ul_total_wbuf2); + free(ul_total_wbuf2); ul_total_wbuf2 = NULL; - HDfree(ul_total_wbuf2_bak); + free(ul_total_wbuf2_bak); ul_total_wbuf2_bak = NULL; - HDfree(l_total_rbuf2); + free(l_total_rbuf2); l_total_rbuf2 = NULL; - HDfree(l_total_wbuf2); + free(l_total_wbuf2); l_total_wbuf2 = NULL; - HDfree(l_total_wbuf2_bak); + free(l_total_wbuf2_bak); l_total_wbuf2_bak = NULL; - HDfree(s_total_rbuf2); + free(s_total_rbuf2); s_total_rbuf2 = NULL; - HDfree(s1_total_wbuf3); + free(s1_total_wbuf3); s1_total_wbuf3 = NULL; - HDfree(s1_total_wbuf3_bak); + free(s1_total_wbuf3_bak); s1_total_wbuf3_bak = NULL; - HDfree(s3_total_rbuf3); + free(s3_total_rbuf3); s3_total_rbuf3 = NULL; - HDfree(s4_total_wbuf3); + free(s4_total_wbuf3); s4_total_wbuf3 = NULL; - HDfree(s4_total_wbuf3_bak); + free(s4_total_wbuf3_bak); s4_total_wbuf3_bak = NULL; - HDfree(s1_total_rbuf3); + free(s1_total_rbuf3); s1_total_rbuf3 = NULL; } /* end for n niter */ @@ -2693,37 +2693,37 @@ error: H5E_END_TRY; if (total_wbuf1) - HDfree(total_wbuf1); + free(total_wbuf1); if (total_wbuf1_bak) - HDfree(total_wbuf1_bak); + free(total_wbuf1_bak); if (total_rbuf1) - HDfree(total_rbuf1); + free(total_rbuf1); if (ul_total_wbuf2) - HDfree(ul_total_wbuf2); + free(ul_total_wbuf2); if (ul_total_wbuf2_bak) - HDfree(ul_total_wbuf2_bak); + free(ul_total_wbuf2_bak); if (l_total_rbuf2) - HDfree(l_total_rbuf2); + free(l_total_rbuf2); if (l_total_wbuf2) - HDfree(l_total_wbuf2); + free(l_total_wbuf2); if (l_total_wbuf2_bak) - HDfree(l_total_wbuf2_bak); + free(l_total_wbuf2_bak); if (s_total_rbuf2) - HDfree(s_total_rbuf2); + free(s_total_rbuf2); if (s1_total_wbuf3) - HDfree(s1_total_wbuf3); + free(s1_total_wbuf3); if (s1_total_wbuf3_bak) - HDfree(s1_total_wbuf3_bak); + free(s1_total_wbuf3_bak); if (s3_total_rbuf3) - HDfree(s3_total_rbuf3); + free(s3_total_rbuf3); if (s4_total_wbuf3) - HDfree(s4_total_wbuf3); + free(s4_total_wbuf3); if (s4_total_wbuf3_bak) - HDfree(s4_total_wbuf3_bak); + free(s4_total_wbuf3_bak); if (s1_total_rbuf3) - HDfree(s1_total_rbuf3); + free(s1_total_rbuf3); return FAIL; diff --git a/test/set_extent.c b/test/set_extent.c index 462c5d2..815442f 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -2270,11 +2270,11 @@ test_random_rank4(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disable_ char filename[NAME_BUF_SIZE]; /* Initialize large arrays */ - if (NULL == (rbuf = HDcalloc(1, sizeof(*rbuf)))) + if (NULL == (rbuf = calloc(1, sizeof(*rbuf)))) TEST_ERROR; - if (NULL == (wbuf = HDcalloc(1, sizeof(*wbuf)))) + if (NULL == (wbuf = calloc(1, sizeof(*wbuf)))) TEST_ERROR; - if (NULL == (dim_log = HDcalloc(1, sizeof(*dim_log)))) + if (NULL == (dim_log = calloc(1, sizeof(*dim_log)))) TEST_ERROR; /* Create a new file */ @@ -2417,9 +2417,9 @@ test_random_rank4(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disable_ if (H5Fclose(file) < 0) TEST_ERROR; - HDfree(rbuf); - HDfree(wbuf); - HDfree(dim_log); + free(rbuf); + free(wbuf); + free(dim_log); return 0; @@ -2434,9 +2434,9 @@ error: } H5E_END_TRY - HDfree(rbuf); - HDfree(wbuf); - HDfree(dim_log); + free(rbuf); + free(wbuf); + free(dim_log); return -1; } /* end test_random_rank4 */ @@ -2492,11 +2492,11 @@ test_random_rank4_vl(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disab char filename[NAME_BUF_SIZE]; /* Initialize large arrays */ - if (NULL == (rbuf = HDcalloc(1, sizeof(*rbuf)))) + if (NULL == (rbuf = calloc(1, sizeof(*rbuf)))) TEST_ERROR; - if (NULL == (wbuf = HDcalloc(1, sizeof(*wbuf)))) + if (NULL == (wbuf = calloc(1, sizeof(*wbuf)))) TEST_ERROR; - if (NULL == (dim_log = HDcalloc(1, sizeof(*dim_log)))) + if (NULL == (dim_log = calloc(1, sizeof(*dim_log)))) TEST_ERROR; /* Initialize fill value buffers so they aren't freed in case of an error */ @@ -2519,7 +2519,7 @@ test_random_rank4_vl(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disab for (k = 0; k < dims[2]; k++) for (l = 0; l < dims[3]; l++) { wbuf->arr[i][j][k][l].len = 2; - if (NULL == (wbuf->arr[i][j][k][l].p = HDmalloc(2 * sizeof(int)))) + if (NULL == (wbuf->arr[i][j][k][l].p = malloc(2 * sizeof(int)))) TEST_ERROR; } /* end for */ @@ -2562,7 +2562,7 @@ test_random_rank4_vl(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disab /* Create VL fill value, if requested */ if (do_fillvalue) { fill_value.len = 2; - if (NULL == (fill_value.p = HDmalloc(2 * sizeof(int)))) + if (NULL == (fill_value.p = malloc(2 * sizeof(int)))) TEST_ERROR; ((int *)fill_value.p)[0] = 1; ((int *)fill_value.p)[1] = 2; @@ -2688,7 +2688,7 @@ test_random_rank4_vl(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disab TEST_ERROR; if (H5Treclaim(type, mspace, H5P_DEFAULT, wbuf) < 0) TEST_ERROR; - HDfree(fill_value.p); + free(fill_value.p); if (H5Sclose(mspace) < 0) TEST_ERROR; if (H5Pclose(my_dcpl) < 0) @@ -2700,9 +2700,9 @@ test_random_rank4_vl(hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, hbool_t disab if (H5Fclose(file) < 0) TEST_ERROR; - HDfree(rbuf); - HDfree(wbuf); - HDfree(dim_log); + free(rbuf); + free(wbuf); + free(dim_log); return 0; @@ -2714,12 +2714,12 @@ error: for (k = 0; k < dims[2]; k++) for (l = 0; l < dims[3]; l++) { if (rbuf->arr[i][j][k][l].p) - HDfree(rbuf->arr[i][j][k][l].p); + free(rbuf->arr[i][j][k][l].p); if (wbuf->arr[i][j][k][l].p) - HDfree(wbuf->arr[i][j][k][l].p); + free(wbuf->arr[i][j][k][l].p); } /* end for */ if (fill_value.p) - HDfree(fill_value.p); + free(fill_value.p); H5Sclose(fspace); H5Sclose(mspace); H5Pclose(dcpl); @@ -2729,9 +2729,9 @@ error: } H5E_END_TRY - HDfree(rbuf); - HDfree(wbuf); - HDfree(dim_log); + free(rbuf); + free(wbuf); + free(dim_log); return -1; } /* end test_random_rank4_vl */ diff --git a/test/stab.c b/test/stab.c index 779d4bb..41c494f 100644 --- a/test/stab.c +++ b/test/stab.c @@ -213,12 +213,12 @@ test_long(hid_t fcpl, hid_t fapl, hbool_t new_format) TEST_ERROR; /* Group names */ - name1 = (char *)HDmalloc((size_t)LONG_NAME_LEN); + name1 = (char *)malloc((size_t)LONG_NAME_LEN); for (i = 0; i < LONG_NAME_LEN; i++) name1[i] = (char)('A' + i % 26); name1[LONG_NAME_LEN - 1] = '\0'; size_t name2Len = (2 * LONG_NAME_LEN) + 2; - name2 = (char *)HDmalloc(name2Len); + name2 = (char *)malloc(name2Len); HDsnprintf(name2, name2Len, "%s/%s", name1, name1); /* Create groups */ @@ -246,8 +246,8 @@ test_long(hid_t fcpl, hid_t fapl, hbool_t new_format) TEST_ERROR; /* Release name buffers */ - HDfree(name2); - HDfree(name1); + free(name2); + free(name1); PASSED(); return 0; @@ -258,8 +258,8 @@ error: H5Gclose(g1); H5Gclose(g2); H5Fclose(fid); - HDfree(name2); - HDfree(name1); + free(name2); + free(name1); } H5E_END_TRY return 1; @@ -668,7 +668,7 @@ long_compact(hid_t fcpl, hid_t fapl2) TEST_ERROR; /* Construct very long object name template */ - if (NULL == (objname = (char *)HDmalloc((size_t)(LONG_COMPACT_LENGTH + 1)))) + if (NULL == (objname = (char *)malloc((size_t)(LONG_COMPACT_LENGTH + 1)))) TEST_ERROR; HDmemset(objname, 'a', (size_t)LONG_COMPACT_LENGTH); objname[LONG_COMPACT_LENGTH] = '\0'; @@ -752,7 +752,7 @@ long_compact(hid_t fcpl, hid_t fapl2) TEST_ERROR; /* Free object name */ - HDfree(objname); + free(objname); objname = NULL; /* Close top group */ @@ -788,7 +788,7 @@ error: H5E_END_TRY if (objname) - HDfree(objname); + free(objname); return 1; } /* end long_compact() */ diff --git a/test/swmr_common.c b/test/swmr_common.c index 173dea8..ef4c550 100644 --- a/test/swmr_common.c +++ b/test/swmr_common.c @@ -204,7 +204,7 @@ generate_symbols(void) unsigned u, v; /* Local index variables */ for (u = 0; u < NLEVELS; u++) { - symbol_info[u] = HDmalloc(symbol_count[u] * sizeof(symbol_info_t)); + symbol_info[u] = malloc(symbol_count[u] * sizeof(symbol_info_t)); for (v = 0; v < symbol_count[u]; v++) { char name_buf[64]; @@ -238,8 +238,8 @@ shutdown_symbols(void) /* Clean up the symbols */ for (u = 0; u < NLEVELS; u++) { for (v = 0; v < symbol_count[u]; v++) - HDfree(symbol_info[u][v].name); - HDfree(symbol_info[u]); + free(symbol_info[u][v].name); + free(symbol_info[u]); } /* end for */ return 0; diff --git a/test/swmr_reader.c b/test/swmr_reader.c index c293b49..af4a6ae 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -219,7 +219,7 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file, unsigned /* Allocate space for 'common' datasets, if any */ if (ncommon > 0) { /* Allocate array to hold pointers to symbols for common datasets */ - if (NULL == (sym_com = (symbol_info_t **)HDmalloc(sizeof(symbol_info_t *) * ncommon))) + if (NULL == (sym_com = (symbol_info_t **)malloc(sizeof(symbol_info_t *) * ncommon))) return -1; /* Open the common datasets */ @@ -240,7 +240,7 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file, unsigned /* Allocate space for 'random' datasets, if any */ if (nrandom > 0) { /* Allocate array to hold pointers to symbols for random datasets */ - if (NULL == (sym_rand = (symbol_info_t **)HDmalloc(sizeof(symbol_info_t *) * nrandom))) + if (NULL == (sym_rand = (symbol_info_t **)malloc(sizeof(symbol_info_t *) * nrandom))) return -1; /* Determine the random datasets */ @@ -354,13 +354,13 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file, unsigned /* Close 'random' datasets, if any */ if (nrandom > 0) { /* Release array holding dataset ID's for random datasets */ - HDfree(sym_rand); + free(sym_rand); } /* end if */ /* Close 'common' datasets, if any */ if (ncommon > 0) { /* Release array holding dataset ID's for common datasets */ - HDfree(sym_com); + free(sym_com); } /* end if */ return 0; diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index cc525c8..4418d0a 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -214,7 +214,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, uns /* Allocate space for 'common' datasets, if any */ if (ncommon > 0) { /* Allocate array to hold pointers to symbols for common datasets */ - if (NULL == (sym_com = (symbol_info_t **)HDmalloc(sizeof(symbol_info_t *) * ncommon))) + if (NULL == (sym_com = (symbol_info_t **)malloc(sizeof(symbol_info_t *) * ncommon))) return -1; /* Open the common datasets */ @@ -235,7 +235,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, uns /* Allocate space for 'random' datasets, if any */ if (nrandom > 0) { /* Allocate array to hold pointers to symbols for random datasets */ - if (NULL == (sym_rand = (symbol_info_t **)HDmalloc(sizeof(symbol_info_t *) * nrandom))) + if (NULL == (sym_rand = (symbol_info_t **)malloc(sizeof(symbol_info_t *) * nrandom))) return -1; /* Determine the random datasets */ @@ -340,13 +340,13 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds, uns /* Close 'random' datasets, if any */ if (nrandom > 0) { /* Release array holding dataset ID's for random datasets */ - HDfree(sym_rand); + free(sym_rand); } /* end if */ /* Close 'common' datasets, if any */ if (ncommon > 0) { /* Release array holding dataset ID's for common datasets */ - HDfree(sym_com); + free(sym_com); } /* end if */ return 0; diff --git a/test/tarray.c b/test/tarray.c index 9602b41..10c225c 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -1055,7 +1055,7 @@ test_array_alloc_custom(size_t size, void *info) */ extra = MAX(sizeof(void *), sizeof(size_t)); - if ((ret_value = HDmalloc(extra + size)) != NULL) { + if ((ret_value = malloc(extra + size)) != NULL) { *(size_t *)ret_value = size; *mem_used += size; } /* end if */ @@ -1093,7 +1093,7 @@ test_array_free_custom(void *_mem, void *info) if (_mem != NULL) { mem = ((unsigned char *)_mem) - extra; *mem_used -= *(size_t *)((void *)mem); - HDfree(mem); + free(mem); } /* end if */ } /* end test_array_free_custom() */ @@ -1136,7 +1136,7 @@ test_array_vlen_atomic(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * sizeof(unsigned int)); + wdata[i][j].p = malloc((size_t)(i + j + 1) * sizeof(unsigned int)); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) ((unsigned int *)wdata[i][j].p)[k] = (unsigned int)(i * 100 + j * 10 + k); @@ -1357,7 +1357,7 @@ test_array_vlen_array(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * sizeof(unsigned int) * (size_t)ARRAY1_DIM1); + wdata[i][j].p = malloc((size_t)(i + j + 1) * sizeof(unsigned int) * (size_t)ARRAY1_DIM1); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) for (l = 0; l < ARRAY1_DIM1; l++) @@ -1632,8 +1632,8 @@ test_array_bkg(void) /* Initialize the data */ /* ------------------- */ - dtsinfo = (CmpDTSinfo *)HDmalloc(sizeof(CmpDTSinfo)); - CHECK_PTR(dtsinfo, "HDmalloc"); + dtsinfo = (CmpDTSinfo *)malloc(sizeof(CmpDTSinfo)); + CHECK_PTR(dtsinfo, "malloc"); HDmemset(dtsinfo, 0, sizeof(CmpDTSinfo)); for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { @@ -1662,7 +1662,7 @@ test_array_bkg(void) /* Initialize the names of data members */ /* ------------------------------------ */ for (i = 0; i < dtsinfo->nsubfields; i++) - dtsinfo->name[i] = (char *)HDcalloc((size_t)20, sizeof(char)); + dtsinfo->name[i] = (char *)calloc((size_t)20, sizeof(char)); HDstrcpy(dtsinfo->name[0], "One"); HDstrcpy(dtsinfo->name[1], "Two"); @@ -1734,7 +1734,7 @@ test_array_bkg(void) /* Release memory resources */ /* ------------------------ */ for (i = 0; i < dtsinfo->nsubfields; i++) - HDfree(dtsinfo->name[i]); + free(dtsinfo->name[i]); /* Release IDs */ /* ----------- */ @@ -1885,7 +1885,7 @@ test_array_bkg(void) status = H5Fclose(fid); CHECK(status, FAIL, "H5Fclose"); - HDfree(dtsinfo); + free(dtsinfo); } /* end test_array_bkg() */ /*------------------------------------------------------------------------- diff --git a/test/tattr.c b/test/tattr.c index b0442f6..834271e 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -302,8 +302,8 @@ test_attr_basic_write(hid_t fapl) CHECK(attr_name_size, FAIL, "H5Aget_name"); if (attr_name_size > 0) { - attr_name = (char *)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); - CHECK_PTR(attr_name, "HDcalloc"); + attr_name = (char *)calloc((size_t)(attr_name_size + 1), sizeof(char)); + CHECK_PTR(attr_name, "calloc"); if (attr_name) { ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name); @@ -311,7 +311,7 @@ test_attr_basic_write(hid_t fapl) ret = HDstrcmp(attr_name, ATTR_TMP_NAME); VERIFY(ret, 0, "HDstrcmp"); - HDfree(attr_name); + free(attr_name); attr_name = NULL; } /* end if */ } /* end if */ @@ -339,8 +339,8 @@ test_attr_basic_write(hid_t fapl) CHECK(attr_name_size, FAIL, "H5Aget_name"); if (attr_name_size > 0) { - attr_name = (char *)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); - CHECK_PTR(attr_name, "HDcalloc"); + attr_name = (char *)calloc((size_t)(attr_name_size + 1), sizeof(char)); + CHECK_PTR(attr_name, "calloc"); if (attr_name) { ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name); @@ -348,7 +348,7 @@ test_attr_basic_write(hid_t fapl) ret = HDstrcmp(attr_name, ATTR1A_NAME); VERIFY(ret, 0, "HDstrcmp"); - HDfree(attr_name); + free(attr_name); attr_name = NULL; } /* end if */ } /* end if */ @@ -7319,8 +7319,8 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; - visited = (hbool_t *)HDmalloc(sizeof(hbool_t) * iter_info.max_visit); - CHECK_PTR(visited, "HDmalloc"); + visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit); + CHECK_PTR(visited, "malloc"); iter_info.visited = visited; /* Loop over operating on different indices on link fields */ @@ -7611,7 +7611,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Free the "visited link" array */ - HDfree(visited); + free(visited); } /* test_attr_iterate2() */ /*------------------------------------------------------------------------- @@ -8609,8 +8609,8 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) MESSAGE(5, ("Testing Writing Shared & Unshared Attributes in Compact & Dense Storage\n")); /* Allocate & initialize "big" attribute data */ - big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK_PTR(big_value, "HDmalloc"); + big_value = (unsigned *)malloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); + CHECK_PTR(big_value, "malloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8906,7 +8906,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Release memory */ - HDfree(big_value); + free(big_value); } /* test_attr_shared_write() */ /**************************************************************** @@ -8946,8 +8946,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) MESSAGE(5, ("Testing Renaming Shared & Unshared Attributes in Compact & Dense Storage\n")); /* Allocate & initialize "big" attribute data */ - big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK_PTR(big_value, "HDmalloc"); + big_value = (unsigned *)malloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); + CHECK_PTR(big_value, "malloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9354,7 +9354,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Release memory */ - HDfree(big_value); + free(big_value); } /* test_attr_shared_rename() */ /**************************************************************** @@ -9393,8 +9393,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) MESSAGE(5, ("Testing Deleting Shared & Unshared Attributes in Compact & Dense Storage\n")); /* Allocate & initialize "big" attribute data */ - big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK_PTR(big_value, "HDmalloc"); + big_value = (unsigned *)malloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); + CHECK_PTR(big_value, "malloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9726,7 +9726,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Release memory */ - HDfree(big_value); + free(big_value); } /* test_attr_shared_delete() */ /**************************************************************** @@ -9765,8 +9765,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) MESSAGE(5, ("Testing Unlinking Object with Shared Attributes in Compact & Dense Storage\n")); /* Allocate & initialize "big" attribute data */ - big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK_PTR(big_value, "HDmalloc"); + big_value = (unsigned *)malloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); + CHECK_PTR(big_value, "malloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -10085,7 +10085,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Release memory */ - HDfree(big_value); + free(big_value); } /* test_attr_shared_unlink() */ /**************************************************************** @@ -11375,8 +11375,8 @@ test_attr_delete_last_dense(hid_t fcpl, hid_t fapl) CHECK(aid, FAIL, "H5Acreate2"); /* Allocate the data buffer */ - data = (double *)HDmalloc((size_t)(DIM0 * DIM1) * sizeof(double)); - CHECK_PTR(data, "HDmalloc"); + data = (double *)malloc((size_t)(DIM0 * DIM1) * sizeof(double)); + CHECK_PTR(data, "malloc"); /* Initialize the data */ for (i = 0; i < DIM0; i++) @@ -11417,7 +11417,7 @@ test_attr_delete_last_dense(hid_t fcpl, hid_t fapl) /* Free the data buffer */ if (data) - HDfree(data); + free(data); } /* test_attr_delete_last_dense() */ diff --git a/test/tchecksum.c b/test/tchecksum.c index a77ffcd..4aa300e 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -180,8 +180,8 @@ test_chksum_large(void) size_t u; /* Local index variable */ /* Allocate the buffer */ - large_buf = (uint8_t *)HDmalloc((size_t)BUF_LEN); - CHECK_PTR(large_buf, "HDmalloc"); + large_buf = (uint8_t *)malloc((size_t)BUF_LEN); + CHECK_PTR(large_buf, "malloc"); /* Initialize buffer w/known data */ for (u = 0; u < BUF_LEN; u++) @@ -209,7 +209,7 @@ test_chksum_large(void) VERIFY(chksum, 0x930c7afc, "H5_checksum_lookup3"); /* Release memory for buffer */ - HDfree(large_buf); + free(large_buf); } /* test_chksum_large() */ /**************************************************************** diff --git a/test/tcoords.c b/test/tcoords.c index 0be11e4..6545a64 100644 --- a/test/tcoords.c +++ b/test/tcoords.c @@ -435,18 +435,18 @@ test_multiple_ends(hid_t file, hbool_t is_chunked) hsize_t mem5_block[8] = {4, 5, 1, 4, 2, 1, 6, 2}; /* Initialize dynamic arrays */ - data_buf = HDcalloc(1, sizeof(*data_buf)); - CHECK_PTR(data_buf, "HDcalloc"); - mem1_buffer = HDcalloc(1, sizeof(*mem1_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); - mem2_buffer = HDcalloc(1, sizeof(*mem2_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); - mem3_buffer = HDcalloc(1, sizeof(*mem3_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); - mem4_buffer = HDcalloc(1, sizeof(*mem4_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); - mem5_buffer = HDcalloc(1, sizeof(*mem5_buffer)); - CHECK_PTR(data_buf, "HDcalloc"); + data_buf = calloc(1, sizeof(*data_buf)); + CHECK_PTR(data_buf, "calloc"); + mem1_buffer = calloc(1, sizeof(*mem1_buffer)); + CHECK_PTR(data_buf, "calloc"); + mem2_buffer = calloc(1, sizeof(*mem2_buffer)); + CHECK_PTR(data_buf, "calloc"); + mem3_buffer = calloc(1, sizeof(*mem3_buffer)); + CHECK_PTR(data_buf, "calloc"); + mem4_buffer = calloc(1, sizeof(*mem4_buffer)); + CHECK_PTR(data_buf, "calloc"); + mem5_buffer = calloc(1, sizeof(*mem5_buffer)); + CHECK_PTR(data_buf, "calloc"); /* Create and write the dataset */ sid = H5Screate_simple(8, da_dims, da_dims); @@ -664,12 +664,12 @@ test_multiple_ends(hid_t file, hbool_t is_chunked) ret = H5Pclose(plid); CHECK(ret, FAIL, "H5Pclose"); - HDfree(data_buf); - HDfree(mem1_buffer); - HDfree(mem2_buffer); - HDfree(mem3_buffer); - HDfree(mem4_buffer); - HDfree(mem5_buffer); + free(data_buf); + free(mem1_buffer); + free(mem2_buffer); + free(mem3_buffer); + free(mem4_buffer); + free(mem5_buffer); } /**************************************************************** diff --git a/test/testframe.c b/test/testframe.c index ea5cc18..cd2947b 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -74,11 +74,11 @@ AddTest(const char *TheName, void (*TheCall)(void), void (*Cleanup)(void), const if (HDstrlen(TheDescr) >= MAXTESTDESC) { printf("Test description ('%s') too long, increase MAXTESTDESC(%d).\n", TheDescr, MAXTESTDESC); HDexit(EXIT_FAILURE); - } /* end if */ + } if (HDstrlen(TheName) >= MAXTESTNAME) { printf("Test name too long, increase MAXTESTNAME(%d).\n", MAXTESTNAME); HDexit(EXIT_FAILURE); - } /* end if */ + } /* Check for increasing the Test array size */ if (Index >= TestAlloc) { @@ -86,16 +86,16 @@ AddTest(const char *TheName, void (*TheCall)(void), void (*Cleanup)(void), const unsigned newAlloc = MAX(1, TestAlloc * 2); /* New array size */ /* Reallocate array */ - if (NULL == (newTest = (TestStruct *)HDrealloc(Test, newAlloc * sizeof(TestStruct)))) { + if (NULL == (newTest = (TestStruct *)realloc(Test, newAlloc * sizeof(TestStruct)))) { printf("Out of memory for tests, Index = %u, TestAlloc = %u, newAlloc = %u\n", Index, TestAlloc, newAlloc); HDexit(EXIT_FAILURE); - } /* end if */ + } /* Update info */ Test = newTest; TestAlloc = newAlloc; - } /* end if */ + } /* Set up test function */ HDstrcpy(Test[Index].Description, TheDescr); @@ -378,7 +378,7 @@ void TestShutdown(void) { if (Test) - HDfree(Test); + free(Test); } /* diff --git a/test/tfile.c b/test/tfile.c index 9da1c9b..8482e1f 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1205,8 +1205,8 @@ test_get_obj_ids(void) CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, (NGROUPS + NDSETS + 1), "H5Fget_obj_count"); - oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); - CHECK_PTR(oid_list, "HDcalloc"); + oid_list = (hid_t *)calloc((size_t)oid_list_size, sizeof(hid_t)); + CHECK_PTR(oid_list, "calloc"); /* Call the public function H5F_get_obj_ids to use H5F__get_objects. User reported having problem here. * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in @@ -1246,7 +1246,7 @@ test_get_obj_ids(void) H5Sclose(filespace); H5Fclose(fid); - HDfree(oid_list); + free(oid_list); /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works * when the file is closed first */ @@ -1268,8 +1268,8 @@ test_get_obj_ids(void) CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); - oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); - CHECK_PTR(oid_list, "HDcalloc"); + oid_list = (hid_t *)calloc((size_t)oid_count, sizeof(hid_t)); + CHECK_PTR(oid_list, "calloc"); /* Get the list of all opened objects */ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); @@ -1284,7 +1284,7 @@ test_get_obj_ids(void) } H5E_END_TRY; - HDfree(oid_list); + free(oid_list); } /**************************************************************** @@ -1503,7 +1503,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, hid_t gid2, if (oid_count > 0) { hid_t *oid_list; - oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); + oid_list = (hid_t *)calloc((size_t)oid_count, sizeof(hid_t)); if (oid_list != NULL) { int i; @@ -1553,7 +1553,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, hid_t gid2, } /* end switch */ } /* end for */ - HDfree(oid_list); + free(oid_list); } /* end if */ } /* end if */ @@ -3181,19 +3181,19 @@ cal_chksum(const char *file, uint32_t *chksum) CHECK(fdes, FAIL, "HDfstat"); /* Allocate space for the file data */ - file_data = HDmalloc((size_t)sb.st_size); - CHECK_PTR(file_data, "HDmalloc"); + file_data = malloc((size_t)sb.st_size); + CHECK_PTR(file_data, "malloc"); if (file_data) { /* Read file's data into memory */ bytes_read = HDread(fdes, file_data, (size_t)sb.st_size); - CHECK(bytes_read == sb.st_size, FALSE, "HDmalloc"); + CHECK(bytes_read == sb.st_size, FALSE, "malloc"); /* Calculate checksum */ *chksum = H5_checksum_lookup3(file_data, sizeof(file_data), 0); /* Free memory */ - HDfree(file_data); + free(file_data); } /* Close the file */ @@ -4432,7 +4432,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t split) /* Free memb_name */ for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) - HDfree(memb_name[mt]); + free(memb_name[mt]); return 0; diff --git a/test/tgenprop.c b/test/tgenprop.c index 3955bb9..3f61e46 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -1027,7 +1027,7 @@ test_genprop_prop_crt_cb1(const char *name, size_t size, void *def_value) /* Set the information from the creation call */ prop1_cb_info.crt_count++; prop1_cb_info.crt_name = HDstrdup(name); - prop1_cb_info.crt_value = HDmalloc(size); + prop1_cb_info.crt_value = malloc(size); HDmemcpy(prop1_cb_info.crt_value, def_value, size); return (SUCCEED); @@ -1047,7 +1047,7 @@ test_genprop_prop_set_cb1(hid_t plist_id, const char *name, size_t size, void *v if (prop1_cb_info.set_name == NULL) prop1_cb_info.set_name = HDstrdup(name); if (prop1_cb_info.set_value == NULL) - prop1_cb_info.set_value = HDmalloc(size); + prop1_cb_info.set_value = malloc(size); HDmemcpy(prop1_cb_info.set_value, value, size); return (SUCCEED); @@ -1067,7 +1067,7 @@ test_genprop_prop_get_cb1(hid_t plist_id, const char *name, size_t size, void *v if (prop1_cb_info.get_name == NULL) prop1_cb_info.get_name = HDstrdup(name); if (prop1_cb_info.get_value == NULL) - prop1_cb_info.get_value = HDmalloc(size); + prop1_cb_info.get_value = malloc(size); HDmemcpy(prop1_cb_info.get_value, value, size); return (SUCCEED); @@ -1086,7 +1086,7 @@ test_genprop_prop_cop_cb1(const char *name, size_t size, void *value) if (prop1_cb_info.cop_name == NULL) prop1_cb_info.cop_name = HDstrdup(name); if (prop1_cb_info.cop_value == NULL) - prop1_cb_info.cop_value = HDmalloc(size); + prop1_cb_info.cop_value = malloc(size); HDmemcpy(prop1_cb_info.cop_value, value, size); return (SUCCEED); @@ -1133,7 +1133,7 @@ test_genprop_prop_cls_cb1(const char *name, size_t size, void *value) if (prop1_cb_info.cls_name == NULL) prop1_cb_info.cls_name = HDstrdup(name); if (prop1_cb_info.cls_value == NULL) - prop1_cb_info.cls_value = HDmalloc(size); + prop1_cb_info.cls_value = malloc(size); HDmemcpy(prop1_cb_info.cls_value, value, size); return (SUCCEED); @@ -1151,7 +1151,7 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v prop2_cb_info.del_count++; prop2_cb_info.del_plist_id = plist_id; prop2_cb_info.del_name = HDstrdup(name); - prop2_cb_info.del_value = HDmalloc(size); + prop2_cb_info.del_value = malloc(size); HDmemcpy(prop2_cb_info.del_value, value, size); return (SUCCEED); @@ -1368,18 +1368,18 @@ test_genprop_list_callback(void) VERIFY(prop1_cb_info.cls_count, 2, "H5Pclose"); /* Free memory allocated for tracking properties */ - HDfree(prop1_cb_info.crt_name); - HDfree(prop1_cb_info.crt_value); - HDfree(prop1_cb_info.get_name); - HDfree(prop1_cb_info.get_value); - HDfree(prop1_cb_info.set_name); - HDfree(prop1_cb_info.set_value); - HDfree(prop1_cb_info.cop_name); - HDfree(prop1_cb_info.cop_value); - HDfree(prop1_cb_info.cls_name); - HDfree(prop1_cb_info.cls_value); - HDfree(prop2_cb_info.del_name); - HDfree(prop2_cb_info.del_value); + free(prop1_cb_info.crt_name); + free(prop1_cb_info.crt_value); + free(prop1_cb_info.get_name); + free(prop1_cb_info.get_value); + free(prop1_cb_info.set_name); + free(prop1_cb_info.set_value); + free(prop1_cb_info.cop_name); + free(prop1_cb_info.cop_value); + free(prop1_cb_info.cls_name); + free(prop1_cb_info.cls_value); + free(prop2_cb_info.del_name); + free(prop2_cb_info.del_value); /* Close class */ ret = H5Pclose_class(cid1); diff --git a/test/th5_system.c b/test/th5_system.c index 0e22b8a..33728ca 100644 --- a/test/th5_system.c +++ b/test/th5_system.c @@ -33,8 +33,8 @@ test_h5_dirname(void) MESSAGE(5, ("Testing H5_dirname\n")); - path = HDmalloc(H5_SYSTEM_TEST_PATH_MAX); - CHECK_PTR(path, "HDmalloc"); + path = malloc(H5_SYSTEM_TEST_PATH_MAX); + CHECK_PTR(path, "malloc"); if (!path) return; @@ -225,7 +225,7 @@ test_h5_dirname(void) "comparing H5_dirname with contrived path to proper dirname"); H5MM_free(dirname); - HDfree(path); + free(path); } static void @@ -237,8 +237,8 @@ test_h5_basename(void) MESSAGE(5, ("Testing H5_basename\n")); - path = HDmalloc(H5_SYSTEM_TEST_PATH_MAX); - CHECK_PTR(path, "HDmalloc"); + path = malloc(H5_SYSTEM_TEST_PATH_MAX); + CHECK_PTR(path, "malloc"); if (!path) return; @@ -434,7 +434,7 @@ test_h5_basename(void) VERIFY_STR(basename, "finaldir", "comparing H5_basename with contrived path to proper basename"); H5MM_free(basename); - HDfree(path); + free(path); } static void diff --git a/test/th5o.c b/test/th5o.c index 4468bab..70f1416 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -957,10 +957,10 @@ test_h5o_link(void) /* Allocate memory buffers */ /* (These are treated as 2-D buffers) */ - wdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK_PTR(wdata, "HDmalloc"); - rdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK_PTR(rdata, "HDmalloc"); + wdata = (int *)malloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); + CHECK_PTR(wdata, "malloc"); + rdata = (int *)malloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); + CHECK_PTR(rdata, "malloc"); /* Initialize the raw data */ for (i = n = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) @@ -1083,8 +1083,8 @@ test_h5o_link(void) CHECK(ret, FAIL, "H5Pclose"); /* Release buffers */ - HDfree(wdata); - HDfree(rdata); + free(wdata); + free(rdata); } /* end test_h5o_link() */ /**************************************************************** diff --git a/test/th5s.c b/test/th5s.c index 5a43e60..d944279 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1256,8 +1256,8 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) CHECK(ret, FAIL, "H5Sencode2"); if (sbuf_size > 0) { - sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size); - CHECK_PTR(sbuf, "HDcalloc"); + sbuf = (unsigned char *)calloc((size_t)1, sbuf_size); + CHECK_PTR(sbuf, "calloc"); } /* Try decoding bogus buffer */ @@ -1318,8 +1318,8 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) CHECK(ret, FAIL, "H5Sencode"); if (null_size > 0) { - null_sbuf = (unsigned char *)HDcalloc((size_t)1, null_size); - CHECK_PTR(null_sbuf, "HDcalloc"); + null_sbuf = (unsigned char *)calloc((size_t)1, null_size); + CHECK_PTR(null_sbuf, "calloc"); } /* Encode the null dataspace in the buffer */ @@ -1354,8 +1354,8 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) CHECK(ret, FAIL, "H5Sencode"); if (scalar_size > 0) { - scalar_buf = (unsigned char *)HDcalloc((size_t)1, scalar_size); - CHECK_PTR(scalar_buf, "HDcalloc"); + scalar_buf = (unsigned char *)calloc((size_t)1, scalar_size); + CHECK_PTR(scalar_buf, "calloc"); } /* Encode the scalar dataspace in the buffer */ @@ -1393,11 +1393,11 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) /* Release resources */ if (sbuf) - HDfree(sbuf); + free(sbuf); if (null_sbuf) - HDfree(null_sbuf); + free(null_sbuf); if (scalar_buf) - HDfree(scalar_buf); + free(scalar_buf); } /* test_h5s_encode() */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -1448,8 +1448,8 @@ test_h5s_encode1(void) CHECK(ret, FAIL, "H5Sencode2"); if (sbuf_size > 0) { - sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size); - CHECK_PTR(sbuf, "HDcalloc"); + sbuf = (unsigned char *)calloc((size_t)1, sbuf_size); + CHECK_PTR(sbuf, "calloc"); } /* Try decoding bogus buffer */ @@ -1510,8 +1510,8 @@ test_h5s_encode1(void) CHECK(ret, FAIL, "H5Sencode"); if (null_size > 0) { - null_sbuf = (unsigned char *)HDcalloc((size_t)1, null_size); - CHECK_PTR(null_sbuf, "HDcalloc"); + null_sbuf = (unsigned char *)calloc((size_t)1, null_size); + CHECK_PTR(null_sbuf, "calloc"); } /* Encode the null dataspace in the buffer */ @@ -1546,8 +1546,8 @@ test_h5s_encode1(void) CHECK(ret, FAIL, "H5Sencode"); if (scalar_size > 0) { - scalar_buf = (unsigned char *)HDcalloc((size_t)1, scalar_size); - CHECK_PTR(scalar_buf, "HDcalloc"); + scalar_buf = (unsigned char *)calloc((size_t)1, scalar_size); + CHECK_PTR(scalar_buf, "calloc"); } /* Encode the scalar dataspace in the buffer */ @@ -1581,11 +1581,11 @@ test_h5s_encode1(void) /* Release resources */ if (sbuf) - HDfree(sbuf); + free(sbuf); if (null_sbuf) - HDfree(null_sbuf); + free(null_sbuf); if (scalar_buf) - HDfree(scalar_buf); + free(scalar_buf); } /* test_h5s_encode1() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -1633,8 +1633,8 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, CHECK(ret, FAIL, "H5Sencode2"); /* Allocate the buffer for encoding */ - buf = (char *)HDmalloc(buf_size); - CHECK_PTR(buf, "HDmalloc"); + buf = (char *)malloc(buf_size); + CHECK_PTR(buf, "malloc"); /* Encode according to the setting in in_fapl */ ret = H5Sencode2(in_sid, buf, &buf_size, in_fapl); @@ -1693,7 +1693,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, ret = H5Sclose(d_sid); CHECK(ret, FAIL, "H5Sclose"); if (buf) - HDfree(buf); + free(buf); } return (0); @@ -2159,7 +2159,7 @@ test_h5s_encode_length(void) /* Allocate the buffer */ if (sbuf_size > 0) { - sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size); + sbuf = (unsigned char *)calloc((size_t)1, sbuf_size); CHECK_PTR(sbuf, "H5Sencode2"); } @@ -2184,7 +2184,7 @@ test_h5s_encode_length(void) /* Free the buffer */ if (sbuf) - HDfree(sbuf); + free(sbuf); /* Close the original dataspace */ ret = H5Sclose(sid); @@ -2513,17 +2513,17 @@ test_h5s_chunk(void) int i, j; /* Allocate memory */ - chunk_data_dbl_data = (double *)HDcalloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(double)); - CHECK_PTR(chunk_data_dbl_data, "HDcalloc"); - chunk_data_dbl = (double **)HDcalloc(CHUNK_DATA_NX, sizeof(chunk_data_dbl_data)); - CHECK_PTR(chunk_data_dbl, "HDcalloc"); + chunk_data_dbl_data = (double *)calloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(double)); + CHECK_PTR(chunk_data_dbl_data, "calloc"); + chunk_data_dbl = (double **)calloc(CHUNK_DATA_NX, sizeof(chunk_data_dbl_data)); + CHECK_PTR(chunk_data_dbl, "calloc"); for (i = 0; i < CHUNK_DATA_NX; i++) chunk_data_dbl[i] = chunk_data_dbl_data + (i * CHUNK_DATA_NY); - chunk_data_flt_data = (float *)HDcalloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(float)); - CHECK_PTR(chunk_data_flt_data, "HDcalloc"); - chunk_data_flt = (float **)HDcalloc(CHUNK_DATA_NX, sizeof(chunk_data_flt_data)); - CHECK_PTR(chunk_data_flt, "HDcalloc"); + chunk_data_flt_data = (float *)calloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(float)); + CHECK_PTR(chunk_data_flt_data, "calloc"); + chunk_data_flt = (float **)calloc(CHUNK_DATA_NX, sizeof(chunk_data_flt_data)); + CHECK_PTR(chunk_data_flt, "calloc"); for (i = 0; i < CHUNK_DATA_NX; i++) chunk_data_flt[i] = chunk_data_flt_data + (i * CHUNK_DATA_NY); @@ -2593,10 +2593,10 @@ test_h5s_chunk(void) } /* end for */ } /* end for */ - HDfree(chunk_data_dbl); - HDfree(chunk_data_dbl_data); - HDfree(chunk_data_flt); - HDfree(chunk_data_flt_data); + free(chunk_data_dbl); + free(chunk_data_dbl_data); + free(chunk_data_flt); + free(chunk_data_flt_data); } /* test_h5s_chunk() */ /**************************************************************** diff --git a/test/tid.c b/test/tid.c index 6b7bb0b..dd6d051 100644 --- a/test/tid.c +++ b/test/tid.c @@ -21,7 +21,7 @@ static herr_t free_wrapper(void *p, void H5_ATTR_UNUSED **_ctx) { - HDfree(p); + free(p); return SUCCEED; } @@ -85,12 +85,12 @@ basic_id_test(void) * Once the ID has been registered, testObj will be freed when * its ID type is destroyed. */ - testObj = HDmalloc(7 * sizeof(int)); + testObj = malloc(7 * sizeof(int)); arrayID = H5Iregister(myType, testObj); CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); if (arrayID == H5I_INVALID_HID) { - HDfree(testObj); + free(testObj); goto out; } @@ -179,12 +179,12 @@ basic_id_test(void) * freed when the previous type was destroyed. Allocate new * memory for it. */ - testObj = HDmalloc(7 * sizeof(int)); + testObj = malloc(7 * sizeof(int)); arrayID = H5Iregister(myType, testObj); CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); if (arrayID == H5I_INVALID_HID) { - HDfree(testObj); + free(testObj); goto out; } @@ -259,7 +259,7 @@ id_predefined_test(void) void *testPtr; herr_t testErr; - testObj = HDmalloc(sizeof(int)); + testObj = malloc(sizeof(int)); /* * Attempt to perform public functions on various library types @@ -350,14 +350,14 @@ id_predefined_test(void) /* testObj was never registered as an atom, so it will not be * automatically freed. */ - HDfree(testObj); + free(testObj); return 0; out: if (typeID != H5I_INVALID_HID) H5Tclose(typeID); if (testObj != NULL) - HDfree(testObj); + free(testObj); return -1; } @@ -703,8 +703,8 @@ test_remove_clear_type(void) /* Create an array to hold the objects in the master list */ list_size = RCT_MAX_NOBJS * sizeof(rct_obj_t); - obj_list.objects = HDmalloc(list_size); - CHECK_PTR(obj_list.objects, "HDcalloc"); + obj_list.objects = malloc(list_size); + CHECK_PTR(obj_list.objects, "calloc"); if (NULL == obj_list.objects) goto error; @@ -849,7 +849,7 @@ test_remove_clear_type(void) goto error; /* Free the object array */ - HDfree(obj_list.objects); + free(obj_list.objects); return 0; @@ -861,7 +861,7 @@ error: } H5E_END_TRY - HDfree(obj_list.objects); + free(obj_list.objects); return -1; } /* end test_remove_clear_type() */ @@ -883,7 +883,7 @@ free_actual_object(void *_p, void H5_ATTR_UNUSED **_ctx) if (7 != *p) return FAIL; - HDfree(p); + free(p); return SUCCEED; } @@ -916,7 +916,7 @@ realize_future_cb(void *_future_obj, hid_t *actual_id) } else { /* Create a new object (the 'actual object') of the correct type */ - if (NULL == (actual_obj = HDmalloc(sizeof(int)))) + if (NULL == (actual_obj = malloc(sizeof(int)))) return FAIL; *actual_obj = 7; @@ -937,7 +937,7 @@ discard_future_cb(void *future_obj) if (NULL == future_obj) return FAIL; - HDfree(future_obj); + free(future_obj); return SUCCEED; } @@ -952,7 +952,7 @@ realize_future_generate_cb(void *_future_obj, hid_t *actual_id) if (NULL != future_obj) return FAIL; /* Create a new object (the 'actual object') of the correct type */ - if (NULL == (actual_obj = HDmalloc(sizeof(int)))) + if (NULL == (actual_obj = malloc(sizeof(int)))) return FAIL; *actual_obj = 7; @@ -1036,7 +1036,7 @@ test_future_ids(void) /* Test base use-case: create a future object and destroy type without * realizing the future object. */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = obj_type; future_id = H5Iregister_future(obj_type, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1056,7 +1056,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object and realize the actual object. */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = obj_type; future_id = H5Iregister_future(obj_type, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1142,7 +1142,7 @@ test_future_ids(void) /* Test base use-case: create a future object for a pre-defined type */ /* (DATASPACE) */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATASPACE; future_id = H5Iregister_future(H5I_DATASPACE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1160,7 +1160,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATASPACE; future_id = H5Iregister_future(H5I_DATASPACE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1183,7 +1183,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATASPACE; future_id = H5Iregister_future(H5I_DATASPACE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1214,7 +1214,7 @@ test_future_ids(void) /* Test base use-case: create a future object for a pre-defined type */ /* (DATATYPE) */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATATYPE; future_id = H5Iregister_future(H5I_DATATYPE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1232,7 +1232,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATATYPE; future_id = H5Iregister_future(H5I_DATATYPE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1255,7 +1255,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_DATATYPE; future_id = H5Iregister_future(H5I_DATATYPE, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1286,7 +1286,7 @@ test_future_ids(void) /* Test base use-case: create a future object for a pre-defined type */ /* (PROPERTY LIST) */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_GENPROP_LST; future_id = H5Iregister_future(H5I_GENPROP_LST, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1304,7 +1304,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_GENPROP_LST; future_id = H5Iregister_future(H5I_GENPROP_LST, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); @@ -1327,7 +1327,7 @@ test_future_ids(void) goto error; /* Test base use-case: create a future object for a pre-defined type */ - future_obj = HDmalloc(sizeof(future_obj_t)); + future_obj = malloc(sizeof(future_obj_t)); future_obj->obj_type = H5I_GENPROP_LST; future_id = H5Iregister_future(H5I_GENPROP_LST, future_obj, realize_future_cb, discard_future_cb); CHECK(future_id, H5I_INVALID_HID, "H5Iregister_future"); diff --git a/test/timer.c b/test/timer.c index d271f41..7231534 100644 --- a/test/timer.c +++ b/test/timer.c @@ -43,62 +43,62 @@ test_time_formatting(void) s = H5_timer_get_time_string(-1.0); if (NULL == s || HDstrcmp(s, "N/A") != 0) TEST_ERROR; - HDfree(s); + free(s); /* 0 0 */ s = H5_timer_get_time_string(0.0); if (NULL == s || HDstrcmp(s, "0.0 s") != 0) TEST_ERROR; - HDfree(s); + free(s); /* < 1 us nanoseconds */ s = H5_timer_get_time_string(123.0E-9); if (NULL == s || HDstrcmp(s, "123 ns") != 0) TEST_ERROR; - HDfree(s); + free(s); /* < 1 ms microseconds */ s = H5_timer_get_time_string(23.456E-6); if (NULL == s || HDstrcmp(s, "23.5 us") != 0) TEST_ERROR; - HDfree(s); + free(s); /* < 1 s milliseconds */ s = H5_timer_get_time_string(4.56789E-3); if (NULL == s || HDstrcmp(s, "4.6 ms") != 0) TEST_ERROR; - HDfree(s); + free(s); /* < 1 min seconds */ s = H5_timer_get_time_string(3.14); if (NULL == s || HDstrcmp(s, "3.14 s") != 0) TEST_ERROR; - HDfree(s); + free(s); /* < 1 hr mins, secs */ s = H5_timer_get_time_string(2521.0); if (NULL == s || HDstrcmp(s, "42 m 1 s") != 0) TEST_ERROR; - HDfree(s); + free(s); /* < 1 d hrs, mins, secs */ s = H5_timer_get_time_string(9756.0); if (NULL == s || HDstrcmp(s, "2 h 42 m 36 s") != 0) TEST_ERROR; - HDfree(s); + free(s); /* > 1 d days, hrs, mins, secs */ s = H5_timer_get_time_string(280802.0); if (NULL == s || HDstrcmp(s, "3 d 6 h 0 m 2 s") != 0) TEST_ERROR; - HDfree(s); + free(s); PASSED(); return 0; error: if (s) - HDfree(s); + free(s); return -1; } @@ -149,8 +149,8 @@ test_timer_system_user(void) /* Do some fake work */ for (i = 0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * (size_t)i); - HDfree(buf); + buf = (char *)malloc(1024 * (size_t)i); + free(buf); } err = H5_timer_stop(&timer); @@ -208,8 +208,8 @@ test_timer_elapsed(void) /* Do some fake work */ for (i = 0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * (size_t)i); - HDfree(buf); + buf = (char *)malloc(1024 * (size_t)i); + free(buf); } err = H5_timer_stop(&timer); @@ -275,8 +275,8 @@ test_timer_functionality(void) /* Do some fake work */ for (i = 0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * (size_t)i); - HDfree(buf); + buf = (char *)malloc(1024 * (size_t)i); + free(buf); } /* Running state should change after stop */ @@ -317,8 +317,8 @@ test_timer_functionality(void) /* Do some fake work */ for (i = 0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * (size_t)i); - HDfree(buf); + buf = (char *)malloc(1024 * (size_t)i); + free(buf); } /* Times should be non-negative */ @@ -334,8 +334,8 @@ test_timer_functionality(void) /* Do some fake work */ for (i = 0; i < 1024; i++) { - buf = (char *)HDmalloc(1024 * (size_t)i); - HDfree(buf); + buf = (char *)malloc(1024 * (size_t)i); + free(buf); } /* State should flip on stop */ diff --git a/test/titerate.c b/test/titerate.c index 3b6ecc7..2e9856b 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -364,7 +364,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) /* Free the dataset names */ for (i = 0; i < (NDATASETS + 2); i++) - HDfree(lnames[i]); + free(lnames[i]); } /* test_iter_group() */ /**************************************************************** @@ -557,7 +557,7 @@ test_iter_attr(hid_t fapl, hbool_t new_format) /* Free the attribute names */ for (i = 0; i < NATTR; i++) - HDfree(anames[i]); + free(anames[i]); } /* test_iter_attr() */ @@ -632,8 +632,8 @@ test_iter_group_large(hid_t fapl) } s1_t; /* Allocate & initialize array */ - names = (iter_info *)HDcalloc(sizeof(iter_info), (ITER_NGROUPS + 2)); - CHECK_PTR(names, "HDcalloc"); + names = (iter_info *)calloc(sizeof(iter_info), (ITER_NGROUPS + 2)); + CHECK_PTR(names, "calloc"); /* Output message about test being performed */ MESSAGE(5, ("Testing Large Group Iteration Functionality\n")); @@ -725,7 +725,7 @@ test_iter_group_large(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Release memory */ - HDfree(names); + free(names); } /* test_iterate_group_large() */ /**************************************************************** @@ -877,8 +877,8 @@ test_grp_memb_funcs(hid_t fapl) /* Free the dataset names */ for (i = 0; i < (NDATASETS + 2); i++) { - HDfree(dnames[i]); - HDfree(obj_names[i]); + free(dnames[i]); + free(obj_names[i]); } /* end for */ } /* test_grp_memb_funcs() */ diff --git a/test/tmisc.c b/test/tmisc.c index 8d4e417..a2e8343 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -520,8 +520,8 @@ test_misc2_write_attribute(void) ret = H5Fclose(file2); CHECK(ret, FAIL, "H5Fclose"); - HDfree(string_att1); - HDfree(string_att2); + free(string_att1); + free(string_att2); } static void @@ -734,7 +734,7 @@ create_struct3(void) misc5_struct3_hndl *str3hndl; /* New 'struct3' created */ herr_t ret; /* For error checking */ - str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl)); + str3hndl = (misc5_struct3_hndl *)malloc(sizeof(misc5_struct3_hndl)); CHECK_PTR(str3hndl, "malloc"); str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); @@ -760,7 +760,7 @@ delete_struct3(misc5_struct3_hndl *str3hndl) ret = H5Tclose(str3hndl->st3h_base); CHECK(ret, FAIL, "H5Tclose"); - HDfree(str3hndl); + free(str3hndl); } static void @@ -777,8 +777,8 @@ create_struct2(void) misc5_struct2_hndl *str2hndl; /* New 'struct2' created */ herr_t ret; /* For error checking */ - str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl)); - CHECK_PTR(str2hndl, "HDmalloc"); + str2hndl = (misc5_struct2_hndl *)malloc(sizeof(misc5_struct2_hndl)); + CHECK_PTR(str2hndl, "malloc"); str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); CHECK(str2hndl->st2h_base, FAIL, "H5Tcreate"); @@ -812,7 +812,7 @@ delete_struct2(misc5_struct2_hndl *str2hndl) H5Tclose(str2hndl->st2h_base); CHECK(ret, FAIL, "H5Tclose"); - HDfree(str2hndl); + free(str2hndl); } static void @@ -823,8 +823,8 @@ set_struct2(misc5_struct2 *buf) buf->st2_el1 = MISC5_DBGELVAL2; buf->st2_el2.len = MISC5_DBGNELM3; - buf->st2_el2.p = HDmalloc((buf->st2_el2.len) * sizeof(misc5_struct3)); - CHECK_PTR(buf->st2_el2.p, "HDmalloc"); + buf->st2_el2.p = malloc((buf->st2_el2.len) * sizeof(misc5_struct3)); + CHECK_PTR(buf->st2_el2.p, "malloc"); for (i = 0; i < (buf->st2_el2.len); i++) set_struct3(&(((misc5_struct3 *)(buf->st2_el2.p))[i])); @@ -833,7 +833,7 @@ set_struct2(misc5_struct2 *buf) static void clear_struct2(misc5_struct2 *buf) { - HDfree(buf->st2_el2.p); + free(buf->st2_el2.p); } /*********************** struct1 ***********************/ @@ -844,8 +844,8 @@ create_struct1(void) misc5_struct1_hndl *str1hndl; /* New 'struct1' created */ herr_t ret; /* For error checking */ - str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl)); - CHECK_PTR(str1hndl, "HDmalloc"); + str1hndl = (misc5_struct1_hndl *)malloc(sizeof(misc5_struct1_hndl)); + CHECK_PTR(str1hndl, "malloc"); str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); CHECK(str1hndl->st1h_base, FAIL, "H5Tcreate"); @@ -879,7 +879,7 @@ delete_struct1(misc5_struct1_hndl *str1hndl) ret = H5Tclose(str1hndl->st1h_base); CHECK(ret, FAIL, "H5Tclose"); - HDfree(str1hndl); + free(str1hndl); } static void @@ -890,8 +890,8 @@ set_struct1(misc5_struct1 *buf) buf->st1_el1 = MISC5_DBGELVAL1; buf->st1_el2.len = MISC5_DBGNELM2; - buf->st1_el2.p = HDmalloc((buf->st1_el2.len) * sizeof(misc5_struct2)); - CHECK_PTR(buf->st1_el2.p, "HDmalloc"); + buf->st1_el2.p = malloc((buf->st1_el2.len) * sizeof(misc5_struct2)); + CHECK_PTR(buf->st1_el2.p, "malloc"); for (i = 0; i < (buf->st1_el2.len); i++) set_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i])); @@ -904,7 +904,7 @@ clear_struct1(misc5_struct1 *buf) for (i = 0; i < buf->st1_el2.len; i++) clear_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i])); - HDfree(buf->st1_el2.p); + free(buf->st1_el2.p); } static void @@ -941,8 +941,8 @@ test_misc5(void) /* Create the variable-length buffer */ buf.len = MISC5_DBGNELM1; - buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1)); - CHECK_PTR(buf.p, "HDmalloc"); + buf.p = malloc((buf.len) * sizeof(misc5_struct1)); + CHECK_PTR(buf.p, "malloc"); /* Create the top-level VL information */ for (i = 0; i < MISC5_DBGNELM1; i++) @@ -957,7 +957,7 @@ test_misc5(void) clear_struct1(&(((misc5_struct1 *)(buf.p))[j])); /* Free the variable-length buffer */ - HDfree(buf.p); + free(buf.p); /* Close dataset */ ret = H5Dclose(dataset_id); @@ -1272,11 +1272,11 @@ test_misc8(void) MESSAGE(5, ("Testing dataset storage sizes\n")); /* Allocate space for the data to write & read */ - wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK_PTR(wdata, "HDmalloc"); + wdata = (int *)malloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); + CHECK_PTR(wdata, "malloc"); #ifdef VERIFY_DATA - rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK_PTR(rdata, "HDmalloc"); + rdata = (int *)malloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); + CHECK_PTR(rdata, "malloc"); #endif /* VERIFY_DATA */ /* Initialize values */ @@ -1743,9 +1743,9 @@ test_misc8(void) CHECK(ret, FAIL, "H5Fclose"); /* Free the read & write buffers */ - HDfree(wdata); + free(wdata); #ifdef VERIFY_DATA - HDfree(rdata); + free(rdata); #endif /* VERIFY_DATA */ } /* end test_misc8() */ @@ -2208,8 +2208,8 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) herr_t ret; /* Generic return value */ /* Create a data buffer for the dataset read */ - read_data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK_PTR(read_data, "HDcalloc"); + read_data = (unsigned *)calloc(MISC13_DIM1, sizeof(unsigned)); + CHECK_PTR(read_data, "calloc"); /* Open the contiguous dataset in the root group */ dsid = H5Dopen2(loc_id, name, H5P_DEFAULT); @@ -2228,7 +2228,7 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) CHECK(ret, FAIL, "H5Dclose"); /* Free the dataset read buffer */ - HDfree(read_data); + free(read_data); } /* end misc13_verify_dataset() */ @@ -2334,8 +2334,8 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char int ret; /* Generic status value */ /* Allocate space for the user block */ - user_block = HDcalloc(size, (size_t)1); - CHECK_PTR(user_block, "HDcalloc"); + user_block = calloc(size, (size_t)1); + CHECK_PTR(user_block, "calloc"); /* Copy in the user block data */ HDmemcpy(user_block, str, HDstrlen(str)); @@ -2353,8 +2353,8 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char CHECK_PTR(old_fp, "HDfopen"); /* Allocate space for the copy buffer */ - copy_buf = HDmalloc((size_t)MISC13_COPY_BUF_SIZE); - CHECK_PTR(copy_buf, "HDmalloc"); + copy_buf = malloc((size_t)MISC13_COPY_BUF_SIZE); + CHECK_PTR(copy_buf, "malloc"); /* Copy data from the old file to the new file */ while ((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { @@ -2372,10 +2372,10 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char VERIFY(ret, 0, "HDfclose"); /* Free the copy buffer */ - HDfree(copy_buf); + free(copy_buf); /* Free the user block */ - HDfree(user_block); + free(user_block); } /* end misc13_insert_user_block() */ @@ -2503,8 +2503,8 @@ test_misc13(void) hbool_t check_for_new_dataset; /* Whether to check for the post-userblock-creation dataset */ /* Create a data buffer for the datasets */ - data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK_PTR(data, "HDcalloc"); + data = (unsigned *)calloc(MISC13_DIM1, sizeof(unsigned)); + CHECK_PTR(data, "calloc"); /* Initialize data to write */ misc13_init_data(data); @@ -2534,7 +2534,7 @@ test_misc13(void) misc13_verify_file(MISC13_FILE_2, data, userblock_size, check_for_new_dataset); /* Free the dataset buffer */ - HDfree(data); + free(data); } /* end test_misc13() */ @@ -3640,7 +3640,7 @@ test_misc19(void) H5E_END_TRY VERIFY(ret, FAIL, "H5FDunregister"); - HDfree(vfd_cls); + free(vfd_cls); /* Check H5I operations on virtual object connectors */ @@ -3680,7 +3680,7 @@ test_misc19(void) H5E_END_TRY VERIFY(ret, FAIL, "H5VLunregister_connector"); - HDfree(vol_cls); + free(vol_cls); } /* end test_misc19() */ @@ -3888,8 +3888,8 @@ test_misc21(void) MESSAGE(5, ("Testing late allocation time w/chunks & filters\n")); /* Allocate space for the buffer */ - buf = (char *)HDcalloc(MISC21_SPACE_DIM0 * MISC21_SPACE_DIM1, 1); - CHECK(buf, NULL, "HDcalloc"); + buf = (char *)calloc(MISC21_SPACE_DIM0 * MISC21_SPACE_DIM1, 1); + CHECK(buf, NULL, "calloc"); /* Create the file */ fid = H5Fcreate(MISC21_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3929,7 +3929,7 @@ test_misc21(void) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - HDfree(buf); + free(buf); } /* end test_misc21() */ /**************************************************************** @@ -3973,8 +3973,8 @@ test_misc22(void) MESSAGE(5, ("Testing datatypes with SZIP filter\n")); /* Allocate space for the buffer */ - buf = (char *)HDcalloc(MISC22_SPACE_DIM0 * MISC22_SPACE_DIM1, 8); - CHECK(buf, NULL, "HDcalloc"); + buf = (char *)calloc(MISC22_SPACE_DIM0 * MISC22_SPACE_DIM1, 8); + CHECK(buf, NULL, "calloc"); /* Create the file */ fid = H5Fcreate(MISC22_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -4080,7 +4080,7 @@ test_misc22(void) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - HDfree(buf); + free(buf); } /* end test_misc22() */ #endif /* H5_HAVE_FILTER_SZIP */ diff --git a/test/trefer.c b/test/trefer.c index b725b90..aa90051 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -110,10 +110,10 @@ test_reference_params(void) MESSAGE(5, ("Testing Reference Parameters\n")); /* Allocate write & read buffers */ - wbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + wbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + tbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -409,10 +409,10 @@ test_reference_params(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); - HDfree(obuf); + free(wbuf); + free(rbuf); + free(tbuf); + free(obuf); } /* test_reference_params() */ /**************************************************************** @@ -443,10 +443,10 @@ test_reference_obj(void) MESSAGE(5, ("Testing Object Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + ibuf = calloc(sizeof(unsigned), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -643,10 +643,10 @@ test_reference_obj(void) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(ibuf); - HDfree(obuf); + free(wbuf); + free(rbuf); + free(ibuf); + free(obuf); } /* test_reference_obj() */ /**************************************************************** @@ -680,9 +680,9 @@ test_reference_vlen_obj(void) MESSAGE(5, ("Testing Object Reference Functions within VLEN type\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + ibuf = calloc(sizeof(unsigned), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -909,10 +909,10 @@ test_reference_vlen_obj(void) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(ibuf); - HDfree(obuf); + free(wbuf); + free(rbuf); + free(ibuf); + free(obuf); } /* test_reference_vlen_obj() */ /**************************************************************** @@ -944,8 +944,8 @@ test_reference_cmpnd_obj(void) MESSAGE(5, ("Testing Object Reference Functions within compound type\n")); /* Allocate write & read buffers */ - ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); + ibuf = calloc(sizeof(unsigned), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -1200,8 +1200,8 @@ test_reference_cmpnd_obj(void) CHECK(ret, FAIL, "H5Rdestroy"); /* Free memory buffers */ - HDfree(ibuf); - HDfree(obuf); + free(ibuf); + free(obuf); } /* test_reference_cmpnd_obj() */ /**************************************************************** @@ -1253,10 +1253,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) MESSAGE(5, ("Testing Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + dwbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); for (tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++) *tu8++ = (uint8_t)(i * 3); @@ -1527,7 +1527,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 1, "H5Sget_select_hyper_nblocks"); /* allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); + coords = (hsize_t *)malloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); @@ -1535,7 +1535,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[1], 2, "Hyperslab Coordinates"); VERIFY(coords[2], 7, "Hyperslab Coordinates"); VERIFY(coords[3], 7, "Hyperslab Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid2, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 2, "Selection Bounds"); @@ -1558,7 +1558,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, SPACE2_DIM2, "H5Sget_select_elem_npoints"); /* allocate space for the element points */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); @@ -1582,7 +1582,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[17], coord1[8][1], "Element Coordinates"); VERIFY(coords[18], coord1[9][0], "Element Coordinates"); VERIFY(coords[19], coord1[9][1], "Element Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid2, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 0, "Selection Bounds"); @@ -1659,10 +1659,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } /* test_reference_region() */ @@ -1709,10 +1709,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1); - rbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1); - dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); + wbuf = calloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1); + rbuf = calloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1); + dwbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) *tu8++ = (uint8_t)(i * 3); @@ -1887,7 +1887,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 15, "H5Sget_select_hyper_nblocks"); /* allocate space for the hyperslab blocks */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); + coords = (hsize_t *)malloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); @@ -1921,7 +1921,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[27], 68, "Hyperslab Coordinates"); VERIFY(coords[28], 72, "Hyperslab Coordinates"); VERIFY(coords[29], 73, "Hyperslab Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid3, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 2, "Selection Bounds"); @@ -1942,7 +1942,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 10, "H5Sget_select_elem_npoints"); /* allocate space for the element points */ - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); @@ -1956,7 +1956,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[7], coord1[7][0], "Element Coordinates"); VERIFY(coords[8], coord1[8][0], "Element Coordinates"); VERIFY(coords[9], coord1[9][0], "Element Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid3, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 3, "Selection Bounds"); @@ -2000,10 +2000,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } /* test_reference_region_1D() */ @@ -2855,10 +2855,10 @@ test_reference_compat_conv(void) MESSAGE(5, ("Testing Deprecated Object Reference Functions\n")); /* Allocate write & read buffers */ - wbuf_obj = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); - rbuf_obj = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - wbuf_reg = HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf_reg = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); + wbuf_obj = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1); + rbuf_obj = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + wbuf_reg = calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf_reg = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE_REF_COMPAT, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3125,10 +3125,10 @@ test_reference_compat_conv(void) } /* Free memory buffers */ - HDfree(wbuf_obj); - HDfree(rbuf_obj); - HDfree(wbuf_reg); - HDfree(rbuf_reg); + free(wbuf_obj); + free(rbuf_obj); + free(wbuf_reg); + free(rbuf_reg); } /* test_reference_compat() */ /**************************************************************** @@ -3167,17 +3167,17 @@ test_reference_perf(void) MESSAGE(5, ("Testing Object Reference Performance\n")); /* Allocate write & read buffers */ - wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1); - wbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); - rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); - tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - wbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - rbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1); - wbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + wbuf = calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + obuf = calloc(sizeof(unsigned), SPACE1_DIM1); + ibuf = calloc(sizeof(unsigned), SPACE1_DIM1); + wbuf_deprec = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1); + rbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf_deprec = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1); + tbuf = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + wbuf_reg = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + rbuf_reg = (H5R_ref_t *)calloc(sizeof(H5R_ref_t), SPACE1_DIM1); + wbuf_reg_deprec = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf_reg_deprec = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); for (i = 0; i < SPACE1_DIM1; i++) obuf[i] = i * 3; @@ -3536,17 +3536,17 @@ test_reference_perf(void) } /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(wbuf_reg); - HDfree(rbuf_reg); - HDfree(wbuf_deprec); - HDfree(rbuf_deprec); - HDfree(wbuf_reg_deprec); - HDfree(rbuf_reg_deprec); - HDfree(tbuf); - HDfree(ibuf); - HDfree(obuf); + free(wbuf); + free(rbuf); + free(wbuf_reg); + free(rbuf_reg); + free(wbuf_deprec); + free(rbuf_deprec); + free(wbuf_reg_deprec); + free(rbuf_reg_deprec); + free(tbuf); + free(ibuf); + free(obuf); } /* test_reference_perf() */ /**************************************************************** diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c index fc3ddcf..e59bb9b 100644 --- a/test/trefer_deprec.c +++ b/test/trefer_deprec.c @@ -85,12 +85,12 @@ test_reference_params(void) MESSAGE(5, ("Testing Reference Parameters\n")); /* Allocate write & read buffers */ - wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - CHECK_PTR(rbuf, "HDmalloc"); - tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - CHECK_PTR(tbuf, "HDmalloc"); + wbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + CHECK_PTR(wbuf, "malloc"); + rbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + CHECK_PTR(rbuf, "malloc"); + tbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + CHECK_PTR(tbuf, "malloc"); /* Create file */ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -232,9 +232,9 @@ test_reference_params(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + free(wbuf); + free(rbuf); + free(tbuf); } /* test_reference_obj() */ /**************************************************************** @@ -270,12 +270,12 @@ test_reference_obj(void) MESSAGE(5, ("Testing Object Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - CHECK_PTR(rbuf, "HDmalloc"); - tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); - CHECK_PTR(tbuf, "HDmalloc"); + wbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + CHECK_PTR(wbuf, "malloc"); + rbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + CHECK_PTR(rbuf, "malloc"); + tbuf = (hobj_ref_t *)malloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1); + CHECK_PTR(tbuf, "malloc"); /* Create file */ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -486,9 +486,9 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + free(wbuf); + free(rbuf); + free(tbuf); } /* test_reference_obj() */ /**************************************************************** @@ -542,10 +542,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) MESSAGE(5, ("Testing Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); /* Create file access property list */ fapl = H5Pcreate(H5P_FILE_ACCESS); @@ -807,15 +807,15 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 36, "H5Sget_select_npoints"); ret = (int)H5Sget_select_hyper_nblocks(sid2); VERIFY(ret, 1, "H5Sget_select_hyper_nblocks"); - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * - 2); /* allocate space for the hyperslab blocks */ + coords = (hsize_t *)malloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * + 2); /* allocate space for the hyperslab blocks */ ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); VERIFY(coords[0], 2, "Hyperslab Coordinates"); VERIFY(coords[1], 2, "Hyperslab Coordinates"); VERIFY(coords[2], 7, "Hyperslab Coordinates"); VERIFY(coords[3], 7, "Hyperslab Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid2, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 2, "Selection Bounds"); @@ -836,8 +836,8 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 10, "H5Sget_select_npoints"); ret = (int)H5Sget_select_elem_npoints(sid2); VERIFY(ret, 10, "H5Sget_select_elem_npoints"); - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * - sizeof(hsize_t)); /* allocate space for the element points */ + coords = (hsize_t *)malloc((size_t)ret * SPACE2_RANK * + sizeof(hsize_t)); /* allocate space for the element points */ ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); VERIFY(coords[0], coord1[0][0], "Element Coordinates"); @@ -860,7 +860,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[17], coord1[8][1], "Element Coordinates"); VERIFY(coords[18], coord1[9][0], "Element Coordinates"); VERIFY(coords[19], coord1[9][1], "Element Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid2, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 0, "Selection Bounds"); @@ -930,10 +930,10 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } /* test_reference_region() */ /**************************************************************** @@ -978,10 +978,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE3_DIM1); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); /* Create the file access property list */ fapl = H5Pcreate(H5P_FILE_ACCESS); @@ -1131,8 +1131,8 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 30, "H5Sget_select_npoints"); ret = (int)H5Sget_select_hyper_nblocks(sid3); VERIFY(ret, 15, "H5Sget_select_hyper_nblocks"); - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * - 2); /* allocate space for the hyperslab blocks */ + coords = (hsize_t *)malloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * + 2); /* allocate space for the hyperslab blocks */ ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); VERIFY(coords[0], 2, "Hyperslab Coordinates"); @@ -1165,7 +1165,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[27], 68, "Hyperslab Coordinates"); VERIFY(coords[28], 72, "Hyperslab Coordinates"); VERIFY(coords[29], 73, "Hyperslab Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid3, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 2, "Selection Bounds"); @@ -1184,8 +1184,8 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(ret, 10, "H5Sget_select_npoints"); ret = (int)H5Sget_select_elem_npoints(sid3); VERIFY(ret, 10, "H5Sget_select_elem_npoints"); - coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * - sizeof(hsize_t)); /* allocate space for the element points */ + coords = (hsize_t *)malloc((size_t)ret * SPACE3_RANK * + sizeof(hsize_t)); /* allocate space for the element points */ ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); VERIFY(coords[0], coord1[0][0], "Element Coordinates"); @@ -1198,7 +1198,7 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) VERIFY(coords[7], coord1[7][0], "Element Coordinates"); VERIFY(coords[8], coord1[8][0], "Element Coordinates"); VERIFY(coords[9], coord1[9][0], "Element Coordinates"); - HDfree(coords); + free(coords); ret = H5Sget_select_bounds(sid3, low, high); CHECK(ret, FAIL, "H5Sget_select_bounds"); VERIFY(low[0], 3, "Selection Bounds"); @@ -1233,10 +1233,10 @@ test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } /* test_reference_region_1D() */ /**************************************************************** @@ -1538,10 +1538,10 @@ test_reference_compat(void) MESSAGE(5, ("Testing Deprecated Object Reference Functions\n")); /* Allocate write & read buffers */ - wbuf_obj = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1); - rbuf_obj = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - wbuf_reg = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf_reg = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + wbuf_obj = (hobj_ref_t *)calloc(sizeof(hobj_ref_t), SPACE1_DIM1); + rbuf_obj = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + wbuf_reg = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf_reg = (hdset_reg_ref_t *)malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1798,10 +1798,10 @@ test_reference_compat(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf_obj); - HDfree(rbuf_obj); - HDfree(wbuf_reg); - HDfree(rbuf_reg); + free(wbuf_obj); + free(rbuf_obj); + free(wbuf_reg); + free(rbuf_reg); } /* test_reference_compat() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/test/trefstr.c b/test/trefstr.c index 9019ce6..3fe8e99 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -375,8 +375,8 @@ test_refstr_acat(void) VERIFY(cmp, 0, "HDstrcmp"); /* Append a large string to ref-counted string */ - large_str = HDmalloc(1024); - CHECK_PTR(large_str, "HDmalloc"); + large_str = malloc(1024); + CHECK_PTR(large_str, "malloc"); HDmemset(large_str, 'a', 1024); large_str[1023] = '\0'; ret = H5RS_acat(rs, large_str); @@ -386,8 +386,8 @@ test_refstr_acat(void) s = H5RS_get_str(rs); CHECK_PTR(s, "H5RS_get_str"); HDsnprintf(buf, sizeof(buf), "%s", "foobar"); - large_str2 = HDmalloc(1024 + 6); - CHECK_PTR(large_str2, "HDmalloc"); + large_str2 = malloc(1024 + 6); + CHECK_PTR(large_str2, "malloc"); HDstrcpy(large_str2, "foobar"); HDmemset(&large_str2[6], 'a', 1024); large_str2[1029] = '\0'; @@ -399,8 +399,8 @@ test_refstr_acat(void) CHECK(ret, FAIL, "H5RS_decr"); /* Free large strings */ - HDfree(large_str); - HDfree(large_str2); + free(large_str); + free(large_str2); } /* end test_refstr_acat() */ /**************************************************************** diff --git a/test/tselect.c b/test/tselect.c index f55f5c3..5b79b3b 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -247,10 +247,10 @@ test_select_hyper(hid_t xfer_plist) MESSAGE(5, ("Testing Hyperslab Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -434,8 +434,8 @@ test_select_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper() */ struct pnt_iter { @@ -501,10 +501,10 @@ test_select_point(hid_t xfer_plist) MESSAGE(5, ("Testing Element Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -801,8 +801,8 @@ test_select_point(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_point() */ /**************************************************************** @@ -863,10 +863,10 @@ test_select_all(hid_t xfer_plist) MESSAGE(5, ("Testing 'All' Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE4_DIM1; i++) @@ -916,8 +916,8 @@ test_select_all(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_all() */ /**************************************************************** @@ -950,10 +950,10 @@ test_select_all_hyper(hid_t xfer_plist) MESSAGE(5, ("Testing 'All' Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -1068,8 +1068,8 @@ test_select_all_hyper(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_all_hyper() */ /**************************************************************** @@ -1104,10 +1104,10 @@ test_select_combo(void) MESSAGE(5, ("Testing Combination of Hyperslab & Element Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -1229,8 +1229,8 @@ test_select_combo(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_combo() */ static int @@ -1299,10 +1299,10 @@ test_select_hyper_stride(hid_t xfer_plist) MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -1414,8 +1414,8 @@ test_select_hyper_stride(hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_stride() */ /**************************************************************** @@ -1445,10 +1445,10 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) MESSAGE(5, ("Testing Contiguous Hyperslabs Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -1556,8 +1556,8 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_contig() */ /**************************************************************** @@ -1585,11 +1585,11 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) MESSAGE(5, ("Testing More Contiguous Hyperslabs Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), - (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4); + CHECK_PTR(wbuf, "malloc"); + rbuf = + (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE8_DIM1; i++) @@ -1699,8 +1699,8 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_contig2() */ /**************************************************************** @@ -1731,11 +1731,11 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) MESSAGE(5, ("Testing Yet More Contiguous Hyperslabs Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), - (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4); + CHECK_PTR(wbuf, "malloc"); + rbuf = + (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE8_DIM4; i++) @@ -1864,8 +1864,8 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_contig3() */ /**************************************************************** @@ -2001,10 +2001,10 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co block_ptr = &(block[SS_DR_MAX_RANK - large_rank]); /* Allocate buffers */ - small_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), small_cube_size); - CHECK_PTR(small_cube_buf_1, "HDcalloc"); - large_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), large_cube_size); - CHECK_PTR(large_cube_buf_1, "HDcalloc"); + small_cube_buf_1 = (uint16_t *)calloc(sizeof(uint16_t), small_cube_size); + CHECK_PTR(small_cube_buf_1, "calloc"); + large_cube_buf_1 = (uint16_t *)calloc(sizeof(uint16_t), large_cube_size); + CHECK_PTR(large_cube_buf_1, "calloc"); /* Create a dataset transfer property list */ fapl = H5Pcreate(H5P_FILE_ACCESS); @@ -2489,8 +2489,8 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf, co CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(small_cube_buf_1); - HDfree(large_cube_buf_1); + free(small_cube_buf_1); + free(large_cube_buf_1); } /* test_select_hyper_contig_dr__run_test() */ @@ -2528,8 +2528,8 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) max_cube_size *= (size_t)edge_size; /* Allocate cube buffer for writing values */ - cube_buf = (uint16_t *)HDmalloc(sizeof(uint16_t) * max_cube_size); - CHECK_PTR(cube_buf, "HDmalloc"); + cube_buf = (uint16_t *)malloc(sizeof(uint16_t) * max_cube_size); + CHECK_PTR(cube_buf, "malloc"); /* Initialize the cube buffer */ cube_ptr = cube_buf; @@ -2537,8 +2537,8 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) *cube_ptr++ = (uint16_t)s; /* Allocate cube buffer for zeroing values on disk */ - zero_buf = (uint16_t *)HDcalloc(sizeof(uint16_t), max_cube_size); - CHECK_PTR(zero_buf, "HDcalloc"); + zero_buf = (uint16_t *)calloc(sizeof(uint16_t), max_cube_size); + CHECK_PTR(zero_buf, "calloc"); for (large_rank = 1; large_rank <= max_rank; large_rank++) { for (small_rank = 1; small_rank < large_rank; small_rank++) { @@ -2554,8 +2554,8 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist) } /* for loop on small rank */ } /* for loop on large rank */ - HDfree(cube_buf); - HDfree(zero_buf); + free(cube_buf); + free(zero_buf); } /* test_select_hyper_contig_dr() */ @@ -2986,10 +2986,10 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ assert(large_cube_size < (size_t)(64 * 1024)); /* Allocate & initialize buffers */ - small_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), small_cube_size); - CHECK_PTR(small_cube_buf_1, "HDcalloc"); - large_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), large_cube_size); - CHECK_PTR(large_cube_buf_1, "HDcalloc"); + small_cube_buf_1 = (uint16_t *)calloc(sizeof(uint16_t), small_cube_size); + CHECK_PTR(small_cube_buf_1, "calloc"); + large_cube_buf_1 = (uint16_t *)calloc(sizeof(uint16_t), large_cube_size); + CHECK_PTR(large_cube_buf_1, "calloc"); /* Create a dataset transfer property list */ fapl = H5Pcreate(H5P_FILE_ACCESS); @@ -3561,8 +3561,8 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_ CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(small_cube_buf_1); - HDfree(large_cube_buf_1); + free(small_cube_buf_1); + free(large_cube_buf_1); } /* test_select_hyper_checker_board_dr__run_test() */ @@ -3604,8 +3604,8 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) max_cube_size *= (size_t)(edge_size + 1); /* Allocate cube buffer for writing values */ - cube_buf = (uint16_t *)HDmalloc(sizeof(uint16_t) * max_cube_size); - CHECK_PTR(cube_buf, "HDmalloc"); + cube_buf = (uint16_t *)malloc(sizeof(uint16_t) * max_cube_size); + CHECK_PTR(cube_buf, "malloc"); /* Initialize the cube buffer */ cube_ptr = cube_buf; @@ -3613,8 +3613,8 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) *cube_ptr++ = (uint16_t)s; /* Allocate cube buffer for zeroing values on disk */ - zero_buf = (uint16_t *)HDcalloc(sizeof(uint16_t), max_cube_size); - CHECK_PTR(zero_buf, "HDcalloc"); + zero_buf = (uint16_t *)calloc(sizeof(uint16_t), max_cube_size); + CHECK_PTR(zero_buf, "calloc"); for (large_rank = 1; large_rank <= max_rank; large_rank++) { for (small_rank = 1; small_rank < large_rank; small_rank++) { @@ -3642,8 +3642,8 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist) } /* for loop on small rank */ } /* for loop on large rank */ - HDfree(cube_buf); - HDfree(zero_buf); + free(cube_buf); + free(zero_buf); } /* test_select_hyper_checker_board_dr() */ @@ -3677,12 +3677,12 @@ test_select_hyper_copy(void) MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); - rbuf2 = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf2, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); + rbuf2 = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf2, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -3814,9 +3814,9 @@ test_select_hyper_copy(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(rbuf2); + free(wbuf); + free(rbuf); + free(rbuf2); } /* test_select_hyper_copy() */ /**************************************************************** @@ -3848,12 +3848,12 @@ test_select_point_copy(void) MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); /* Allocate write & read buffers */ - wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); - rbuf2 = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf2, "HDcalloc"); + wbuf = (uint16_t *)malloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); + rbuf2 = (uint16_t *)calloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf2, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -4027,9 +4027,9 @@ test_select_point_copy(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(rbuf2); + free(wbuf); + free(rbuf); + free(rbuf2); } /* test_select_point_copy() */ /**************************************************************** @@ -4066,10 +4066,10 @@ test_select_hyper_offset(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with Offsets\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -4215,8 +4215,8 @@ test_select_hyper_offset(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_offset() */ /**************************************************************** @@ -4248,10 +4248,10 @@ test_select_hyper_offset2(void) MESSAGE(5, ("Testing More Hyperslab Selection Functions with Offsets\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE7_DIM1 * SPACE7_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE7_DIM1 * SPACE7_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE7_DIM1; i++) @@ -4342,8 +4342,8 @@ test_select_hyper_offset2(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_offset2() */ /**************************************************************** @@ -4378,10 +4378,10 @@ test_select_point_offset(void) MESSAGE(5, ("Testing Element Selection Functions\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -4562,8 +4562,8 @@ test_select_point_offset(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_point_offset() */ /**************************************************************** @@ -4605,10 +4605,10 @@ test_select_hyper_union(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with unions of hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -5188,8 +5188,8 @@ test_select_hyper_union(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_union() */ /**************************************************************** @@ -5383,10 +5383,10 @@ test_select_hyper_union_3d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with unions of 3-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE3_DIM1 * SPACE3_DIM2); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE3_DIM1 * SPACE3_DIM2); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE4_DIM1; i++) @@ -5527,8 +5527,8 @@ test_select_hyper_union_3d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_union_3d() */ /**************************************************************** @@ -5707,10 +5707,10 @@ test_select_hyper_and_2d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with intersection of 2-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -5812,8 +5812,8 @@ test_select_hyper_and_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_and_2d() */ /**************************************************************** @@ -5846,10 +5846,10 @@ test_select_hyper_xor_2d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with XOR of 2-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -5953,8 +5953,8 @@ test_select_hyper_xor_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_xor_2d() */ /**************************************************************** @@ -5987,10 +5987,10 @@ test_select_hyper_notb_2d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTB of 2-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -6092,8 +6092,8 @@ test_select_hyper_notb_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_notb_2d() */ /**************************************************************** @@ -6126,10 +6126,10 @@ test_select_hyper_nota_2d(void) MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTA of 2-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE2_DIM1; i++) @@ -6232,8 +6232,8 @@ test_select_hyper_nota_2d(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_nota_2d() */ /**************************************************************** @@ -6297,11 +6297,11 @@ test_select_hyper_union_random_5d(hid_t read_plist) MESSAGE(5, ("Testing Hyperslab Selection Functions with random unions of 5-D hyperslabs\n")); /* Allocate write & read buffers */ - wbuf = (int *)HDmalloc(sizeof(int) * SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (int *)HDcalloc(sizeof(int), - (size_t)(SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5)); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (int *)malloc(sizeof(int) * SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5); + CHECK_PTR(wbuf, "malloc"); + rbuf = (int *)calloc(sizeof(int), + (size_t)(SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5)); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE5_DIM1; i++) @@ -6410,8 +6410,8 @@ test_select_hyper_union_random_5d(hid_t read_plist) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_union_random_5d() */ /**************************************************************** @@ -6452,10 +6452,10 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) MESSAGE(5, ("Testing Hyperslab I/O on Large Chunks\n")); /* Allocate the transfer buffers */ - data = (short *)HDmalloc(sizeof(short) * X * Y * Z); - CHECK_PTR(data, "HDmalloc"); - data_out = (short *)HDcalloc((size_t)(NX * NY * NZ), sizeof(short)); - CHECK_PTR(data_out, "HDcalloc"); + data = (short *)malloc(sizeof(short) * X * Y * Z); + CHECK_PTR(data, "malloc"); + data_out = (short *)calloc((size_t)(NX * NY * NZ), sizeof(short)); + CHECK_PTR(data_out, "calloc"); /* * Data buffer initialization. @@ -6636,8 +6636,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) CHECK(status, FAIL, "H5Sclose"); status = H5Fclose(file); CHECK(status, FAIL, "H5Fclose"); - HDfree(data); - HDfree(data_out); + free(data); + free(data_out); } /* test_select_hyper_chunk() */ /**************************************************************** @@ -6678,10 +6678,10 @@ test_select_point_chunk(void) MESSAGE(5, ("Testing Point Selections on Chunked Datasets\n")); /* Allocate the transfer buffers */ - data = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(data, "HDmalloc"); - data_out = (unsigned *)HDcalloc((size_t)(SPACE7_DIM1 * SPACE7_DIM2), sizeof(unsigned)); - CHECK_PTR(data_out, "HDcalloc"); + data = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(data, "malloc"); + data_out = (unsigned *)calloc((size_t)(SPACE7_DIM1 * SPACE7_DIM2), sizeof(unsigned)); + CHECK_PTR(data_out, "calloc"); /* * Data buffer initialization. @@ -6834,8 +6834,8 @@ test_select_point_chunk(void) ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); - HDfree(data); - HDfree(data_out); + free(data); + free(data_out); } /* test_select_point_chunk() */ /**************************************************************** @@ -7457,8 +7457,8 @@ test_select_fill_all(void) MESSAGE(5, ("Testing Filling 'all' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7505,7 +7505,7 @@ test_select_fill_all(void) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_all() */ /**************************************************************** @@ -7533,8 +7533,8 @@ test_select_fill_point(hssize_t *offset) MESSAGE(5, ("Testing Filling 'point' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7603,7 +7603,7 @@ test_select_fill_point(hssize_t *offset) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_point() */ /**************************************************************** @@ -7633,8 +7633,8 @@ test_select_fill_hyper_simple(hssize_t *offset) MESSAGE(5, ("Testing Filling Simple 'hyperslab' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7709,7 +7709,7 @@ test_select_fill_hyper_simple(hssize_t *offset) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_hyper_simple() */ /**************************************************************** @@ -7744,8 +7744,8 @@ test_select_fill_hyper_regular(hssize_t *offset) MESSAGE(5, ("Testing Filling Regular 'hyperslab' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7822,7 +7822,7 @@ test_select_fill_hyper_regular(hssize_t *offset) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_hyper_regular() */ /**************************************************************** @@ -7864,8 +7864,8 @@ test_select_fill_hyper_irregular(hssize_t *offset) MESSAGE(5, ("Testing Filling Irregular 'hyperslab' Selections\n")); /* Allocate memory buffer */ - wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); + wbuf = (unsigned *)malloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); /* Initialize memory buffer */ for (u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++) @@ -7946,7 +7946,7 @@ test_select_fill_hyper_irregular(hssize_t *offset) CHECK(ret, FAIL, "H5Sclose"); /* Free memory buffers */ - HDfree(wbuf); + free(wbuf); } /* test_select_fill_hyper_irregular() */ /**************************************************************** @@ -7973,10 +7973,10 @@ test_select_none(void) MESSAGE(5, ("Testing I/O on 0-sized Selections\n")); /* Allocate write & read buffers */ - wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf, "malloc"); + rbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(rbuf, "calloc"); /* Initialize write buffer */ for (i = 0, tbuf = wbuf; i < SPACE7_DIM1; i++) @@ -8043,8 +8043,8 @@ test_select_none(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_none() */ /**************************************************************** @@ -8076,10 +8076,10 @@ test_scalar_select(void) MESSAGE(5, ("Testing I/O on Selections in Scalar Dataspaces\n")); /* Allocate write & read buffers */ - wbuf_uint8 = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf_uint8, "HDmalloc"); - wbuf_ushort = (unsigned short *)HDmalloc(sizeof(unsigned short) * SPACE7_DIM1 * SPACE7_DIM2); - CHECK_PTR(wbuf_ushort, "HDmalloc"); + wbuf_uint8 = (uint8_t *)malloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf_uint8, "malloc"); + wbuf_ushort = (unsigned short *)malloc(sizeof(unsigned short) * SPACE7_DIM1 * SPACE7_DIM2); + CHECK_PTR(wbuf_ushort, "malloc"); /* Initialize write buffers */ for (i = 0, tbuf_uint8 = wbuf_uint8, tbuf_ushort = wbuf_ushort; i < SPACE7_DIM1; i++) @@ -8202,8 +8202,8 @@ test_scalar_select(void) CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ - HDfree(wbuf_uint8); - HDfree(wbuf_ushort); + free(wbuf_uint8); + free(wbuf_ushort); } /* test_scalar_select() */ /**************************************************************** @@ -13560,10 +13560,10 @@ test_select_hyper_chunk_offset(void) MESSAGE(6, ("Testing hyperslab selections using offsets in chunked datasets\n")); /* Allocate buffers */ - wbuf = (int *)HDmalloc(sizeof(int) * SPACE10_DIM1); - CHECK_PTR(wbuf, "HDmalloc"); - rbuf = (int *)HDcalloc(sizeof(int), SPACE10_DIM1); - CHECK_PTR(rbuf, "HDcalloc"); + wbuf = (int *)malloc(sizeof(int) * SPACE10_DIM1); + CHECK_PTR(wbuf, "malloc"); + rbuf = (int *)calloc(sizeof(int), SPACE10_DIM1); + CHECK_PTR(rbuf, "calloc"); /* Initialize the write buffer */ for (i = 0; i < SPACE10_DIM1; i++) @@ -13743,8 +13743,8 @@ test_select_hyper_chunk_offset(void) CHECK(ret, FAIL, "H5Fclose"); /* Free the buffers */ - HDfree(wbuf); - HDfree(rbuf); + free(wbuf); + free(rbuf); } /* test_select_hyper_chunk_offset() */ /**************************************************************** diff --git a/test/tskiplist.c b/test/tskiplist.c index 07fe5dc..2fc6c39 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -66,12 +66,12 @@ test_skiplist_init(void) size_t u, v; /* Local index variables */ /* Allocate arrays */ - rand_num = (int *)HDmalloc(sizeof(int) * NUM_ELEMS); - CHECK_PTR(rand_num, "HDmalloc"); - sort_rand_num = (int *)HDmalloc(sizeof(int) * NUM_ELEMS); - CHECK_PTR(sort_rand_num, "HDmalloc"); - rev_sort_rand_num = (int *)HDmalloc(sizeof(int) * NUM_ELEMS); - CHECK_PTR(rev_sort_rand_num, "HDmalloc"); + rand_num = (int *)malloc(sizeof(int) * NUM_ELEMS); + CHECK_PTR(rand_num, "malloc"); + sort_rand_num = (int *)malloc(sizeof(int) * NUM_ELEMS); + CHECK_PTR(sort_rand_num, "malloc"); + rev_sort_rand_num = (int *)malloc(sizeof(int) * NUM_ELEMS); + CHECK_PTR(rev_sort_rand_num, "malloc"); /* Initialize random number seed */ curr_time = HDtime(NULL); @@ -1549,11 +1549,11 @@ test_skiplist_term(void) { /* Release arrays */ if (rand_num) - HDfree(rand_num); + free(rand_num); if (sort_rand_num) - HDfree(sort_rand_num); + free(sort_rand_num); if (rev_sort_rand_num) - HDfree(rev_sort_rand_num); + free(rev_sort_rand_num); } /* end test_skiplist_term() */ /**************************************************************** diff --git a/test/tsohm.c b/test/tsohm.c index 27dafce..ecda449 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -3718,9 +3718,9 @@ test_sohm_external_dtype(void) CHECK_I(dset1_tid, "H5Dget_type"); /* Allocate space and initialize data */ - orig = (s1_t *)HDmalloc(NX * NY * sizeof(s1_t)); + orig = (s1_t *)malloc(NX * NY * sizeof(s1_t)); if (orig == NULL) - CHECK_I(-1, "HDmalloc"); + CHECK_I(-1, "malloc"); for (i = 0; i < NX * NY; i++) { s_ptr = (s1_t *)orig + i; s_ptr->a = (int)(i * 3 + 1); @@ -3783,7 +3783,7 @@ test_sohm_external_dtype(void) CHECK_I(ret, "H5Pclose"); ret = H5Fclose(file2); CHECK_I(ret, "H5Fclose"); - HDfree(orig); + free(orig); } /* test_sohm_external_dtype */ /**************************************************************** diff --git a/test/ttsafe.c b/test/ttsafe.c index cea1e84..2f792f5 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -80,7 +80,7 @@ gen_name(int value) int i; length = num_digits(MAX_NUM_NAME - 1); - temp = (char *)HDmalloc(NAME_OFFSET + length + 1); + temp = (char *)malloc(NAME_OFFSET + length + 1); temp = HDstrcpy(temp, "attrib"); temp[NAME_OFFSET + length] = '\0'; diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c index fb84c6e..84105e8 100644 --- a/test/ttsafe_acreate.c +++ b/test/ttsafe_acreate.c @@ -100,7 +100,7 @@ tts_acreate(void) * with the dataset */ for (i = 0; i < NUM_THREADS; i++) { - attrib_data = (ttsafe_name_data_t *)HDmalloc(sizeof(ttsafe_name_data_t)); + attrib_data = (ttsafe_name_data_t *)malloc(sizeof(ttsafe_name_data_t)); attrib_data->dataset = dataset; attrib_data->datatype = datatype; attrib_data->dataspace = dataspace; @@ -158,7 +158,7 @@ tts_acreate_thread(void *client_data) CHECK(attribute, H5I_INVALID_HID, "H5Acreate2"); /* Write data to the attribute */ - attribute_data = (int *)HDmalloc(sizeof(int)); + attribute_data = (int *)malloc(sizeof(int)); *attribute_data = attrib_data->current_index; status = H5Awrite(attribute, H5T_NATIVE_INT, attribute_data); CHECK(status, FAIL, "H5Awrite"); diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 24747dc..22e2cb3 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -135,7 +135,7 @@ tts_cancel_thread(void H5_ATTR_UNUSED *arg) CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2"); /* If thread is cancelled, make cleanup call */ - cleanup_structure = (cancel_cleanup_t *)HDmalloc(sizeof(cancel_cleanup_t)); + cleanup_structure = (cancel_cleanup_t *)malloc(sizeof(cancel_cleanup_t)); cleanup_structure->dataset = dataset; cleanup_structure->datatype = datatype; cleanup_structure->dataspace = dataspace; diff --git a/test/tvlstr.c b/test/tvlstr.c index 3fcc57d..ce0c622 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -64,7 +64,7 @@ test_vlstr_alloc_custom(size_t size, void *info) */ extra = MAX(sizeof(void *), sizeof(size_t)); - if ((ret_value = HDmalloc(extra + size)) != NULL) { + if ((ret_value = malloc(extra + size)) != NULL) { *(size_t *)ret_value = size; *mem_used += size; } /* end if */ @@ -96,7 +96,7 @@ test_vlstr_free_custom(void *_mem, void *info) if (_mem != NULL) { mem = ((unsigned char *)_mem) - extra; *mem_used -= *(size_t *)((void *)mem); - HDfree(mem); + free(mem); } /* end if */ } @@ -162,7 +162,7 @@ test_vlstrings_basic(void) dataset2 = H5Dcreate2(fid1, "Dataset2", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate2"); - wdata2 = (char *)HDcalloc((size_t)65534, sizeof(char)); + wdata2 = (char *)calloc((size_t)65534, sizeof(char)); HDmemset(wdata2, 'A', (size_t)65533); ret = H5Dwrite(dataset2, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2); @@ -170,7 +170,7 @@ test_vlstrings_basic(void) H5Sclose(dataspace); H5Dclose(dataset2); - HDfree(wdata2); + free(wdata2); /* Change to the custom memory allocation routines for reading VL string */ xfer_pid = H5Pcreate(H5P_DATASET_XFER); @@ -625,7 +625,7 @@ test_write_vl_string_attribute(void) att = H5Acreate2(root, "test_scalar_large", type, dataspace, H5P_DEFAULT, H5P_DEFAULT); CHECK(att, FAIL, "H5Acreate2"); - string_att_write = (char *)HDcalloc((size_t)8192, sizeof(char)); + string_att_write = (char *)calloc((size_t)8192, sizeof(char)); HDmemset(string_att_write, 'A', (size_t)8191); ret = H5Awrite(att, type, &string_att_write); @@ -642,7 +642,7 @@ test_write_vl_string_attribute(void) string_att_check = NULL; /* The attribute string written is freed below, in the test_read_vl_string_attribute() test */ - /* HDfree(string_att_write); */ + /* free(string_att_write); */ ret = H5Aclose(att); CHECK(ret, FAIL, "HAclose"); @@ -723,7 +723,7 @@ test_read_vl_string_attribute(void) /* Free string allocated in test_write_vl_string_attribute */ if (string_att_write) - HDfree(string_att_write); + free(string_att_write); ret = H5Aclose(att); CHECK(ret, FAIL, "HAclose"); diff --git a/test/tvltypes.c b/test/tvltypes.c index 688bb5d..69af737 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -60,7 +60,7 @@ test_vltypes_alloc_custom(size_t size, void *mem_used) * DEC Alpha to keep the alignment correct - QAK) */ - if ((ret_value = HDmalloc(extra + size)) != NULL) { + if ((ret_value = malloc(extra + size)) != NULL) { *(size_t *)ret_value = size; *(size_t *)mem_used += size; } /* end if */ @@ -90,7 +90,7 @@ test_vltypes_free_custom(void *_mem, void *mem_used) unsigned char *mem = ((unsigned char *)_mem) - extra; /* Pointer to actual block allocated */ *(size_t *)mem_used -= *(size_t *)((void *)mem); - HDfree(mem); + free(mem); } /* end if */ } @@ -254,7 +254,7 @@ test_vltypes_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(unsigned int)); + wdata[i].p = malloc((i + 1) * sizeof(unsigned int)); wdata[i].len = i + 1; for (j = 0; j < (i + 1); j++) ((unsigned int *)wdata[i].p)[j] = i * 10 + j; @@ -585,7 +585,7 @@ rewrite_vltypes_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + increment) * sizeof(unsigned int)); + wdata[i].p = malloc((i + increment) * sizeof(unsigned int)); wdata[i].len = i + increment; for (j = 0; j < (i + increment); j++) ((unsigned int *)wdata[i].p)[j] = i * 20 + j; @@ -747,7 +747,7 @@ test_vltypes_vlen_compound(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(s1)); + wdata[i].p = malloc((i + 1) * sizeof(s1)); wdata[i].len = i + 1; for (j = 0; j < (i + 1); j++) { ((s1 *)wdata[i].p)[j].i = (int)(i * 10 + j); @@ -899,7 +899,7 @@ rewrite_vltypes_vlen_compound(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + increment) * sizeof(s1)); + wdata[i].p = malloc((i + increment) * sizeof(s1)); wdata[i].len = i + increment; for (j = 0; j < (i + increment); j++) { ((s1 *)wdata[i].p)[j].i = (int)(i * 40 + j); @@ -1048,17 +1048,17 @@ test_vltypes_compound_vlen_vlen(void) MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n")); /* Allocate and initialize VL data to write */ - wdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK_PTR(wdata, "HDmalloc"); - rdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK_PTR(rdata, "HDmalloc"); + wdata = (s1 *)malloc(sizeof(s1) * SPACE3_DIM1); + CHECK_PTR(wdata, "malloc"); + rdata = (s1 *)malloc(sizeof(s1) * SPACE3_DIM1); + CHECK_PTR(rdata, "malloc"); for (i = 0; i < SPACE3_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)(i * 20) / 3.0F; - wdata[i].v.p = HDmalloc((i + L1_INCM) * sizeof(hvl_t)); + wdata[i].v.p = malloc((i + L1_INCM) * sizeof(hvl_t)); wdata[i].v.len = i + L1_INCM; for (t1 = (hvl_t *)((wdata[i].v).p), j = 0; j < (i + L1_INCM); j++, t1++) { - t1->p = HDmalloc((j + L2_INCM) * sizeof(unsigned int)); + t1->p = malloc((j + L2_INCM) * sizeof(unsigned int)); t1->len = j + L2_INCM; for (k = 0; k < j + L2_INCM; k++) ((unsigned int *)t1->p)[k] = i * 100 + j * 10 + k; @@ -1190,8 +1190,8 @@ test_vltypes_compound_vlen_vlen(void) CHECK(ret, FAIL, "H5Fclose"); /* Release buffers */ - HDfree(wdata); - HDfree(rdata); + free(wdata); + free(rdata); } /* end test_vltypes_compound_vlen_vlen() */ /**************************************************************** @@ -1238,11 +1238,11 @@ test_vltypes_compound_vlstr(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].v.p = (s2 *)HDmalloc((i + L3_INCM) * sizeof(s2)); + wdata[i].v.p = (s2 *)malloc((i + L3_INCM) * sizeof(s2)); wdata[i].v.len = i + L3_INCM; for (t1 = (s2 *)((wdata[i].v).p), j = 0; j < (i + L3_INCM); j++, t1++) { HDstrcat(str, "m"); - t1->string = (char *)HDmalloc(HDstrlen(str) * sizeof(char) + 1); + t1->string = (char *)malloc(HDstrlen(str) * sizeof(char) + 1); HDstrcpy(t1->string, str); /*t1->color = red;*/ t1->color = blue; @@ -1408,11 +1408,11 @@ test_vltypes_compound_vlstr(void) /* Use this part for new data */ HDstrcpy(str, "bbbbbbbb\0"); for (i = 0; i < SPACE1_DIM1; i++) { - wdata2[i].v.p = (s2 *)HDmalloc((i + 1) * sizeof(s2)); + wdata2[i].v.p = (s2 *)malloc((i + 1) * sizeof(s2)); wdata2[i].v.len = i + 1; for (t1 = (s2 *)(wdata2[i].v).p, j = 0; j < i + 1; j++, t1++) { HDstrcat(str, "pp"); - t1->string = (char *)HDmalloc(HDstrlen(str) * sizeof(char) + 1); + t1->string = (char *)malloc(HDstrlen(str) * sizeof(char) + 1); HDstrcpy(t1->string, str); t1->color = green; } @@ -1526,7 +1526,7 @@ test_vltypes_compound_vlen_atomic(void) for (i = 0; i < SPACE1_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)(i * 20) / 3.0F; - wdata[i].v.p = HDmalloc((i + 1) * sizeof(unsigned int)); + wdata[i].v.p = malloc((i + 1) * sizeof(unsigned int)); wdata[i].v.len = i + 1; for (j = 0; j < (i + 1); j++) ((unsigned int *)wdata[i].v.p)[j] = i * 10 + j; @@ -1760,7 +1760,7 @@ rewrite_vltypes_compound_vlen_atomic(void) for (i = 0; i < SPACE1_DIM1; i++) { wdata[i].i = (int)(i * 40); wdata[i].f = (float)(i * 50) / 3.0F; - wdata[i].v.p = HDmalloc((i + increment) * sizeof(unsigned int)); + wdata[i].v.p = malloc((i + increment) * sizeof(unsigned int)); wdata[i].v.len = i + increment; for (j = 0; j < (i + increment); j++) ((unsigned int *)wdata[i].v.p)[j] = i * 60 + j; @@ -1934,14 +1934,14 @@ test_vltypes_vlen_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(hvl_t)); + wdata[i].p = malloc((i + 1) * sizeof(hvl_t)); if (wdata[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + 1; for (t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + 1); j++, t1++) { - t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); + t1->p = malloc((j + 1) * sizeof(unsigned int)); if (t1->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return; @@ -2135,14 +2135,14 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + increment) * sizeof(hvl_t)); + wdata[i].p = malloc((i + increment) * sizeof(hvl_t)); if (wdata[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + increment; for (t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + increment); j++, t1++) { - t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); + t1->p = malloc((j + 1) * sizeof(unsigned int)); if (t1->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return; @@ -2315,14 +2315,14 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + increment) * sizeof(hvl_t)); + wdata[i].p = malloc((i + increment) * sizeof(hvl_t)); if (wdata[i].p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + increment; for (t1 = (hvl_t *)(wdata[i].p), j = 0; j < (i + increment); j++, t1++) { - t1->p = HDmalloc((j + 1) * sizeof(unsigned int)); + t1->p = malloc((j + 1) * sizeof(unsigned int)); if (t1->p == NULL) { TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return; @@ -2591,8 +2591,8 @@ test_vltypes_fill_value(void) CHECK(ret, FAIL, "H5Tclose"); /* Allocate space for the buffer to read data */ - rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); - CHECK_PTR(rbuf, "HDmalloc"); + rbuf = (dtype1_struct *)malloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); + CHECK_PTR(rbuf, "malloc"); /* Create the small & large dataspaces to use */ small_dspace_id = H5Screate_simple(SPACE4_RANK, small_dims, NULL); @@ -3212,7 +3212,7 @@ test_vltypes_fill_value(void) CHECK(ret, FAIL, "H5Tclose"); /* Release buffer */ - HDfree(rbuf); + free(rbuf); } /* end test_vltypes_fill_value() */ /**************************************************************** diff --git a/test/unlink.c b/test/unlink.c index 68cc0ec..a455139 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -649,7 +649,7 @@ test_filespace(hid_t fapl) TEST_ERROR; /* Create buffer for writing dataset */ - if (NULL == (data = (int *)HDmalloc(sizeof(int) * FILESPACE_DIM0 * FILESPACE_DIM1 * FILESPACE_DIM2))) + if (NULL == (data = (int *)malloc(sizeof(int) * FILESPACE_DIM0 * FILESPACE_DIM1 * FILESPACE_DIM2))) TEST_ERROR; /* Create single dataset (with contiguous storage & late allocation), remove it & verify file size */ @@ -1425,7 +1425,7 @@ test_filespace(hid_t fapl) /* Cleanup common objects */ /* Release dataset buffer */ - HDfree(data); + free(data); /* Close property lists */ if (H5Pclose(fapl_nocache) < 0) @@ -1452,7 +1452,7 @@ test_filespace(hid_t fapl) error: /* Release dataset buffer */ if (data) - HDfree(data); + free(data); return 1; } /* end test_filespace() */ @@ -1736,7 +1736,7 @@ test_unlink_rightleaf(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - if (NULL == (gids = (hid_t *)HDcalloc((size_t)ngroups, sizeof(hid_t)))) + if (NULL == (gids = (hid_t *)calloc((size_t)ngroups, sizeof(hid_t)))) TEST_ERROR; if ((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) @@ -1770,7 +1770,7 @@ test_unlink_rightleaf(hid_t fid) TEST_ERROR; /* Free memory */ - HDfree(gids); + free(gids); PASSED(); return 0; @@ -1786,7 +1786,7 @@ error: } H5E_END_TRY } /* end if */ - HDfree(gids); + free(gids); } /* end if */ H5E_BEGIN_TRY { @@ -1823,7 +1823,7 @@ test_unlink_rightnode(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - if (NULL == (gids = (hid_t *)HDcalloc((size_t)ngroups, sizeof(hid_t)))) + if (NULL == (gids = (hid_t *)calloc((size_t)ngroups, sizeof(hid_t)))) TEST_ERROR; if ((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) @@ -1860,7 +1860,7 @@ test_unlink_rightnode(hid_t fid) FAIL_STACK_ERROR; /* Free memory */ - HDfree(gids); + free(gids); PASSED(); return 0; @@ -1876,7 +1876,7 @@ error: } H5E_END_TRY } /* end if */ - HDfree(gids); + free(gids); } /* end if */ H5E_BEGIN_TRY { @@ -1913,7 +1913,7 @@ test_unlink_middlenode(hid_t fid) TESTING("deleting right-most child in non-leaf B-tree node"); /* Allocate space for the group IDs */ - if (NULL == (gids = (hid_t *)HDcalloc((size_t)ngroups, sizeof(hid_t)))) + if (NULL == (gids = (hid_t *)calloc((size_t)ngroups, sizeof(hid_t)))) TEST_ERROR; if ((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) @@ -2236,7 +2236,7 @@ test_unlink_middlenode(hid_t fid) FAIL_STACK_ERROR; /* Free memory */ - HDfree(gids); + free(gids); PASSED(); return 0; @@ -2252,7 +2252,7 @@ error: } H5E_END_TRY } /* end if */ - HDfree(gids); + free(gids); } /* end if */ H5E_BEGIN_TRY { diff --git a/test/unregister.c b/test/unregister.c index 3e7b3b7..4d73783 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -97,9 +97,9 @@ test_unregister_filters(hid_t fapl_id) TESTING("Unregistering filter"); /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) + if (NULL == (buf_data = (int *)calloc(DSET_DIM1 * DSET_DIM2, sizeof(int)))) TEST_ERROR; - if (NULL == (buf = (int **)HDcalloc(DSET_DIM1, sizeof(buf_data)))) + if (NULL == (buf = (int **)calloc(DSET_DIM1, sizeof(buf_data)))) TEST_ERROR; for (i = 0; i < DSET_DIM1; i++) buf[i] = buf_data + (i * DSET_DIM2); @@ -240,8 +240,8 @@ test_unregister_filters(hid_t fapl_id) if (H5Fclose(fid2) < 0) goto error; - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); PASSED(); return SUCCEED; @@ -260,8 +260,8 @@ error: } H5E_END_TRY - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); return FAIL; } diff --git a/test/use_append_chunk_mirror.c b/test/use_append_chunk_mirror.c index f9019a5..eecc2c2 100644 --- a/test/use_append_chunk_mirror.c +++ b/test/use_append_chunk_mirror.c @@ -173,7 +173,7 @@ main(int argc, char *argv[]) mirr_fa.handshake_port = SERVER_PORT; HDstrncpy(mirr_fa.remote_ip, SERVER_IP, H5FD_MIRROR_MAX_IP_LEN); - if (NULL == (split_fa = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) { + if (NULL == (split_fa = calloc(1, sizeof(H5FD_splitter_vfd_config_t)))) { fprintf(stderr, "can't allocate memory for splitter config\n"); Hgoto_error(1); } @@ -373,7 +373,7 @@ main(int argc, char *argv[]) } done: - HDfree(split_fa); + free(split_fa); if (ret_value != 0) { printf("Error(s) encountered\n"); diff --git a/test/use_common.c b/test/use_common.c index f97c875..fde73e8 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -137,7 +137,7 @@ parse_option(int argc, char *const argv[], options_t *opts) /* set test file name if not given */ if (!opts->filename) { /* default data file name is .h5 */ - if ((opts->filename = (char *)HDmalloc(HDstrlen(opts->progname) + 4)) == NULL) { + if ((opts->filename = (char *)malloc(HDstrlen(opts->progname) + 4)) == NULL) { fprintf(stderr, "malloc: failed\n"); Hgoto_error(-1); } @@ -310,7 +310,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts) memdims[0] = 1; memdims[1] = opts->dims[1]; memdims[2] = opts->dims[2]; - if ((buffer = (UC_CTYPE *)HDmalloc((size_t)memdims[1] * (size_t)memdims[2] * sizeof(UC_CTYPE))) == NULL) { + if ((buffer = (UC_CTYPE *)malloc((size_t)memdims[1] * (size_t)memdims[2] * sizeof(UC_CTYPE))) == NULL) { fprintf(stderr, "malloc: failed\n"); return -1; } @@ -322,12 +322,12 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts) rank = H5Sget_simple_extent_ndims(f_sid); if (rank != UC_RANK) { fprintf(stderr, "rank(%d) of dataset does not match\n", rank); - HDfree(buffer); + free(buffer); return -1; } if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0) { fprintf(stderr, "H5Sget_simple_extent_dims got error\n"); - HDfree(buffer); + free(buffer); return -1; } printf("dataset rank %d, dimensions %llu x %llu x %llu\n", rank, (unsigned long long)(dims[0]), @@ -336,14 +336,14 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts) if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]) { fprintf(stderr, "dataset is not empty. Got dims=(%llu,%llu,%llu)\n", (unsigned long long)dims[0], (unsigned long long)dims[1], (unsigned long long)dims[2]); - HDfree(buffer); + free(buffer); return -1; } /* setup mem-space for buffer */ if ((m_sid = H5Screate_simple(rank, memdims, NULL)) < 0) { fprintf(stderr, "H5Screate_simple for memory failed\n"); - HDfree(buffer); + free(buffer); return -1; } @@ -364,7 +364,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts) if (opts->use_swmr) { if (H5Odisable_mdc_flushes(dsid) < 0) { fprintf(stderr, "H5Odisable_mdc_flushes failed\n"); - HDfree(buffer); + free(buffer); return -1; } } @@ -373,14 +373,14 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts) dims[0] = i + 1; if (H5Dset_extent(dsid, dims) < 0) { fprintf(stderr, "H5Dset_extent failed\n"); - HDfree(buffer); + free(buffer); return -1; } /* Get the dataset's dataspace */ if ((f_sid = H5Dget_space(dsid)) < 0) { fprintf(stderr, "H5Dset_extent failed\n"); - HDfree(buffer); + free(buffer); return -1; } @@ -388,14 +388,14 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts) /* Choose the next plane to write */ if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) { fprintf(stderr, "Failed H5Sselect_hyperslab\n"); - HDfree(buffer); + free(buffer); return -1; } /* Write plane to the dataset */ if (H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0) { fprintf(stderr, "Failed H5Dwrite\n"); - HDfree(buffer); + free(buffer); return -1; } @@ -403,7 +403,7 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts) if (opts->use_swmr) { if (H5Oenable_mdc_flushes(dsid) < 0) { fprintf(stderr, "H5Oenable_mdc_flushes failed\n"); - HDfree(buffer); + free(buffer); return -1; } } @@ -411,13 +411,13 @@ write_uc_file(hbool_t tosend, hid_t file_id, options_t *opts) /* flush file to make the just written plane available. */ if (H5Dflush(dsid) < 0) { fprintf(stderr, "Failed to H5Fflush file\n"); - HDfree(buffer); + free(buffer); return -1; } } /* end for each plane to write */ /* Done writing. Free/Close all resources including data file */ - HDfree(buffer); + free(buffer); if (H5Dclose(dsid) < 0) { fprintf(stderr, "Failed to close datasete\n"); return -1; @@ -486,7 +486,7 @@ read_uc_file(hbool_t towait, options_t *opts) memdims[0] = 1; memdims[1] = opts->dims[1]; memdims[2] = opts->dims[2]; - if ((buffer = (UC_CTYPE *)HDmalloc((size_t)memdims[1] * (size_t)memdims[2] * sizeof(UC_CTYPE))) == NULL) { + if ((buffer = (UC_CTYPE *)malloc((size_t)memdims[1] * (size_t)memdims[2] * sizeof(UC_CTYPE))) == NULL) { fprintf(stderr, "malloc: failed\n"); return -1; } @@ -499,12 +499,12 @@ read_uc_file(hbool_t towait, options_t *opts) rank = H5Sget_simple_extent_ndims(f_sid); if (rank != UC_RANK) { fprintf(stderr, "rank(%d) of dataset does not match\n", rank); - HDfree(buffer); + free(buffer); return -1; } if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0) { fprintf(stderr, "H5Sget_simple_extent_dims got error\n"); - HDfree(buffer); + free(buffer); return -1; } printf("dataset rank %d, dimensions %llu x %llu x %llu\n", rank, (unsigned long long)(dims[0]), @@ -515,14 +515,14 @@ read_uc_file(hbool_t towait, options_t *opts) (unsigned long long)dims[0], (unsigned long long)dims[1], (unsigned long long)dims[2]); fprintf(stderr, "But memdims=(%llu,%llu,%llu)\n", (unsigned long long)memdims[0], (unsigned long long)memdims[1], (unsigned long long)memdims[2]); - HDfree(buffer); + free(buffer); return -1; } /* Setup mem-space for buffer */ if ((m_sid = H5Screate_simple(rank, memdims, NULL)) < 0) { fprintf(stderr, "H5Screate_simple for memory failed\n"); - HDfree(buffer); + free(buffer); return -1; } @@ -548,7 +548,7 @@ read_uc_file(hbool_t towait, options_t *opts) printf("."); if (loops_waiting_for_plane >= 30) { fprintf(stderr, "waited too long for new plane, quit.\n"); - HDfree(buffer); + free(buffer); return -1; } } @@ -566,7 +566,7 @@ read_uc_file(hbool_t towait, options_t *opts) /* Get the dataset's dataspace */ if ((f_sid = H5Dget_space(dsid)) < 0) { fprintf(stderr, "H5Dget_space failed\n"); - HDfree(buffer); + free(buffer); return -1; } @@ -574,14 +574,14 @@ read_uc_file(hbool_t towait, options_t *opts) /* Choose the next plane to read */ if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) { fprintf(stderr, "H5Sselect_hyperslab failed\n"); - HDfree(buffer); + free(buffer); return -1; } /* Read the plane from the dataset */ if (H5Dread(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0) { fprintf(stderr, "H5Dread failed\n"); - HDfree(buffer); + free(buffer); return -1; } @@ -613,18 +613,18 @@ read_uc_file(hbool_t towait, options_t *opts) f_sid = H5Dget_space(dsid); /* Get filespace handle first. */ if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0) { fprintf(stderr, "H5Sget_simple_extent_dims got error\n"); - HDfree(buffer); + free(buffer); return -1; } } /* end while (expecting more planes to read) */ if (H5Fclose(fid) < 0) { fprintf(stderr, "H5Fclose failed\n"); - HDfree(buffer); + free(buffer); return -1; } - HDfree(buffer); + free(buffer); if (nreadererr) return -1; diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c index 6d4a051..f2a4e0f 100644 --- a/test/use_disable_mdc_flushes.c +++ b/test/use_disable_mdc_flushes.c @@ -149,7 +149,7 @@ parse_option(int argc, char *const argv[]) /* set test file name if not given */ if (!filename_g) { /* default data file name is .h5 */ - if ((filename_g = (char *)HDmalloc(HDstrlen(progname_g) + 4)) == NULL) { + if ((filename_g = (char *)malloc(HDstrlen(progname_g) + 4)) == NULL) { fprintf(stderr, "malloc: failed\n"); Hgoto_error(-1); }; @@ -372,7 +372,7 @@ write_file(void) memdims[0] = 1; memdims[1] = dims_g[1]; memdims[2] = dims_g[2]; - if ((buffer = (UC_CTYPE *)HDmalloc((size_t)memdims[1] * (size_t)memdims[2] * sizeof(UC_CTYPE))) == NULL) { + if ((buffer = (UC_CTYPE *)malloc((size_t)memdims[1] * (size_t)memdims[2] * sizeof(UC_CTYPE))) == NULL) { fprintf(stderr, "malloc: failed\n"); return -1; }; @@ -470,7 +470,7 @@ write_file(void) } /* Done writing. Free/Close all resources including data file */ - HDfree(buffer); + free(buffer); if (H5Dclose(dsid) < 0) { fprintf(stderr, "Failed to close datasete\n"); diff --git a/test/vds.c b/test/vds.c index e678e88..d65f788 100644 --- a/test/vds.c +++ b/test/vds.c @@ -164,9 +164,9 @@ vds_select_equal(hid_t space1, hid_t space2) /* Allocate point lists. Do not return directly after * allocating, to make sure buffers are freed. */ - if (NULL == (buf1 = (hsize_t *)HDmalloc((size_t)rank1 * (size_t)npoints1 * sizeof(hsize_t)))) + if (NULL == (buf1 = (hsize_t *)malloc((size_t)rank1 * (size_t)npoints1 * sizeof(hsize_t)))) TEST_ERROR; - if (NULL == (buf2 = (hsize_t *)HDmalloc((size_t)rank1 * (size_t)npoints1 * sizeof(hsize_t)))) + if (NULL == (buf2 = (hsize_t *)malloc((size_t)rank1 * (size_t)npoints1 * sizeof(hsize_t)))) TEST_ERROR; /* Get and compare point lists */ @@ -181,9 +181,9 @@ vds_select_equal(hid_t space1, hid_t space2) } /* Free buffers */ - HDfree(buf1); + free(buf1); buf1 = NULL; - HDfree(buf2); + free(buf2); buf2 = NULL; } /* end block */ @@ -214,10 +214,10 @@ vds_select_equal(hid_t space1, hid_t space2) /* Allocate block lists. Do not return directly after * allocating, to make sure buffers are freed. */ if (NULL == - (buf1 = (hsize_t *)HDmalloc((size_t)2 * (size_t)rank1 * (size_t)nblocks1 * sizeof(*buf1)))) + (buf1 = (hsize_t *)malloc((size_t)2 * (size_t)rank1 * (size_t)nblocks1 * sizeof(*buf1)))) TEST_ERROR; if (NULL == - (buf2 = (hsize_t *)HDmalloc((size_t)2 * (size_t)rank1 * (size_t)nblocks1 * sizeof(*buf2)))) + (buf2 = (hsize_t *)malloc((size_t)2 * (size_t)rank1 * (size_t)nblocks1 * sizeof(*buf2)))) TEST_ERROR; /* Get and compare block lists */ @@ -232,9 +232,9 @@ vds_select_equal(hid_t space1, hid_t space2) } /* Free buffers */ - HDfree(buf1); + free(buf1); buf1 = NULL; - HDfree(buf2); + free(buf2); buf2 = NULL; } /* end block */ @@ -250,9 +250,9 @@ vds_select_equal(hid_t space1, hid_t space2) error: if (buf1) - HDfree(buf1); + free(buf1); if (buf2) - HDfree(buf2); + free(buf2); return -1; } /* end vds_select_equal() */ @@ -470,7 +470,7 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, hid_t *ex /* Encode property list to plist_buf */ if (H5Pencode2(dcpl, NULL, &plist_buf_size, fapl) < 0) TEST_ERROR; - if (NULL == (plist_buf = HDmalloc(plist_buf_size))) + if (NULL == (plist_buf = malloc(plist_buf_size))) TEST_ERROR; if (H5Pencode2(dcpl, plist_buf, &plist_buf_size, fapl) < 0) TEST_ERROR; @@ -480,7 +480,7 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl, hid_t *ex TEST_ERROR; /* Free plist_buf */ - HDfree(plist_buf); + free(plist_buf); plist_buf = NULL; } else { @@ -512,7 +512,7 @@ error: } H5E_END_TRY if (plist_buf) - HDfree(plist_buf); + free(plist_buf); return -1; } /* end test_api_get_ex_dcpl() */ @@ -1207,15 +1207,15 @@ test_vds_prefix_first(unsigned config, hid_t vds_fapl, hid_t src_fapl) TESTING_2_SUPPRESSED("basic virtual dataset I/O via H5Pset_vds_prefix(): all selection"); - if ((srcfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilename = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilename_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilename_map = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((vfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((vfilename = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilenamepct = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilenamepct = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilenamepct_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilenamepct_map = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; h5_fixname(FILENAME[0], vds_fapl, vfilename, FILENAME_BUF_SIZE); @@ -1408,11 +1408,11 @@ test_vds_prefix_first(unsigned config, hid_t vds_fapl, hid_t src_fapl) TEST_ERROR_SUPPRESSED; dcpl = -1; - HDfree(srcfilename); - HDfree(srcfilename_map); - HDfree(vfilename); - HDfree(srcfilenamepct); - HDfree(srcfilenamepct_map); + free(srcfilename); + free(srcfilename_map); + free(vfilename); + free(srcfilenamepct); + free(srcfilenamepct_map); PASSED_SUPPRESSED(); return 0; @@ -1439,11 +1439,11 @@ error: if (HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0) TEST_ERROR_SUPPRESSED; - HDfree(srcfilename); - HDfree(srcfilename_map); - HDfree(vfilename); - HDfree(srcfilenamepct); - HDfree(srcfilenamepct_map); + free(srcfilename); + free(srcfilename_map); + free(vfilename); + free(srcfilenamepct); + free(srcfilenamepct_map); return 1; } /* end test_vds_prefix */ @@ -1494,17 +1494,17 @@ test_basic_io(unsigned config, hid_t vds_fapl, hid_t src_fapl) TESTING_2_SUPPRESSED("basic virtual dataset I/O"); - if ((srcfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilename = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilename_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilename_map = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((vfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((vfilename = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((vfilename2 = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((vfilename2 = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilenamepct = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilenamepct = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilenamepct_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilenamepct_map = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; h5_fixname(FILENAME[0], vds_fapl, vfilename, FILENAME_BUF_SIZE); @@ -4340,12 +4340,12 @@ test_basic_io(unsigned config, hid_t vds_fapl, hid_t src_fapl) TEST_ERROR_SUPPRESSED; dcpl = -1; - HDfree(srcfilename); - HDfree(srcfilename_map); - HDfree(vfilename); - HDfree(vfilename2); - HDfree(srcfilenamepct); - HDfree(srcfilenamepct_map); + free(srcfilename); + free(srcfilename_map); + free(vfilename); + free(vfilename2); + free(srcfilenamepct); + free(srcfilenamepct_map); PASSED_SUPPRESSED(); return 0; @@ -4369,12 +4369,12 @@ error: } H5E_END_TRY - HDfree(srcfilename); - HDfree(srcfilename_map); - HDfree(vfilename); - HDfree(vfilename2); - HDfree(srcfilenamepct); - HDfree(srcfilenamepct_map); + free(srcfilename); + free(srcfilename_map); + free(vfilename); + free(vfilename2); + free(srcfilenamepct); + free(srcfilenamepct_map); return 1; } /* end test_basic_io() */ @@ -7435,21 +7435,21 @@ test_printf(unsigned config, hid_t vds_fapl, hid_t src_fapl) TESTING_2_SUPPRESSED("virtual dataset I/O with printf source"); - if ((srcfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilename = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilename_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilename_map = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilename2 = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilename2 = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilename2_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilename2_map = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((vfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((vfilename = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((printf_srcfilename_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((printf_srcfilename_map = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilenamepct = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilenamepct = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; - if ((srcfilenamepct_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) + if ((srcfilenamepct_map = (char *)calloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL) TEST_ERROR_SUPPRESSED; h5_fixname(FILENAME[0], vds_fapl, vfilename, FILENAME_BUF_SIZE); @@ -11058,14 +11058,14 @@ test_printf(unsigned config, hid_t vds_fapl, hid_t src_fapl) TEST_ERROR_SUPPRESSED; memspace = -1; - HDfree(srcfilename); - HDfree(srcfilename_map); - HDfree(srcfilename2); - HDfree(srcfilename2_map); - HDfree(vfilename); - HDfree(printf_srcfilename_map); - HDfree(srcfilenamepct); - HDfree(srcfilenamepct_map); + free(srcfilename); + free(srcfilename_map); + free(srcfilename2); + free(srcfilename2_map); + free(vfilename); + free(printf_srcfilename_map); + free(srcfilenamepct); + free(srcfilenamepct_map); PASSED_SUPPRESSED(); return 0; @@ -11089,14 +11089,14 @@ error: } H5E_END_TRY - HDfree(srcfilename); - HDfree(srcfilename_map); - HDfree(srcfilename2); - HDfree(srcfilename2_map); - HDfree(vfilename); - HDfree(printf_srcfilename_map); - HDfree(srcfilenamepct); - HDfree(srcfilenamepct_map); + free(srcfilename); + free(srcfilename_map); + free(srcfilename2); + free(srcfilename2_map); + free(vfilename); + free(printf_srcfilename_map); + free(srcfilenamepct); + free(srcfilenamepct_map); return 1; } /* end test_printf() */ diff --git a/test/vds_env.c b/test/vds_env.c index ff3cea6..5301dee 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -69,17 +69,17 @@ test_vds_prefix_second(unsigned config, hid_t fapl) TESTING("basic virtual dataset I/O via H5Pset_vds_prefix(): all selection with ENV prefix"); - if (NULL == (srcfilename = HDmalloc(FILENAME_BUF_SIZE))) + if (NULL == (srcfilename = malloc(FILENAME_BUF_SIZE))) TEST_ERROR; - if (NULL == (srcfilename_map = HDmalloc(FILENAME_BUF_SIZE))) + if (NULL == (srcfilename_map = malloc(FILENAME_BUF_SIZE))) TEST_ERROR; - if (NULL == (vfilename = HDmalloc(FILENAME_BUF_SIZE))) + if (NULL == (vfilename = malloc(FILENAME_BUF_SIZE))) TEST_ERROR; - if (NULL == (vfilename2 = HDmalloc(FILENAME_BUF_SIZE))) + if (NULL == (vfilename2 = malloc(FILENAME_BUF_SIZE))) TEST_ERROR; - if (NULL == (srcfilenamepct = HDmalloc(FILENAME_BUF_SIZE))) + if (NULL == (srcfilenamepct = malloc(FILENAME_BUF_SIZE))) TEST_ERROR; - if (NULL == (srcfilenamepct_map = HDmalloc(FILENAME_BUF_SIZE))) + if (NULL == (srcfilenamepct_map = malloc(FILENAME_BUF_SIZE))) TEST_ERROR; h5_fixname(FILENAME[0], fapl, vfilename, FILENAME_BUF_SIZE); @@ -273,23 +273,23 @@ test_vds_prefix_second(unsigned config, hid_t fapl) TEST_ERROR; dcpl = -1; - HDfree(srcfilenamepct_map); - HDfree(srcfilenamepct); - HDfree(vfilename2); - HDfree(vfilename); - HDfree(srcfilename_map); - HDfree(srcfilename); + free(srcfilenamepct_map); + free(srcfilenamepct); + free(vfilename2); + free(vfilename); + free(srcfilename_map); + free(srcfilename); PASSED(); return 0; error: - HDfree(srcfilenamepct_map); - HDfree(srcfilenamepct); - HDfree(vfilename2); - HDfree(vfilename); - HDfree(srcfilename_map); - HDfree(srcfilename); + free(srcfilenamepct_map); + free(srcfilenamepct); + free(vfilename2); + free(vfilename); + free(srcfilename_map); + free(srcfilename); H5E_BEGIN_TRY { diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c index 109af6d..f6e9ddd 100644 --- a/test/vds_swmr_reader.c +++ b/test/vds_swmr_reader.c @@ -47,7 +47,7 @@ main(void) TEST_ERROR; n_elements = (int)(VDS_PLANE[1] * VDS_PLANE[2]); size = (size_t)n_elements * sizeof(int); - if (NULL == (buffer = (int *)HDmalloc(size))) + if (NULL == (buffer = (int *)malloc(size))) TEST_ERROR; /* Create memory dataspace */ @@ -117,7 +117,7 @@ main(void) if (H5Fclose(fid) < 0) TEST_ERROR; - HDfree(buffer); + free(buffer); fprintf(stderr, "SWMR reader exited successfully\n"); return EXIT_SUCCESS; @@ -139,7 +139,7 @@ error: } H5E_END_TRY - HDfree(buffer); + free(buffer); fprintf(stderr, "ERROR: SWMR reader exited with errors\n"); return EXIT_FAILURE; diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c index 2617497..46cd668 100644 --- a/test/vds_swmr_writer.c +++ b/test/vds_swmr_writer.c @@ -64,7 +64,7 @@ main(int argc, char *argv[]) /* Create a data buffer that represents a plane */ n_elements = PLANES[file_number][1] * PLANES[file_number][2]; - if (NULL == (buffer = (int *)HDmalloc(n_elements * sizeof(int)))) + if (NULL == (buffer = (int *)malloc(n_elements * sizeof(int)))) TEST_ERROR; /* Create the memory dataspace */ @@ -132,7 +132,7 @@ main(int argc, char *argv[]) TEST_ERROR; if (H5Fclose(fid) < 0) TEST_ERROR; - HDfree(buffer); + free(buffer); fprintf(stderr, "SWMR writer exited successfully\n"); return EXIT_SUCCESS; @@ -152,7 +152,7 @@ error: if (fsid >= 0) (void)H5Sclose(fsid); if (buffer != NULL) - HDfree(buffer); + free(buffer); } H5E_END_TRY diff --git a/test/vfd.c b/test/vfd.c index 2b11db6..3e87980 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -487,9 +487,9 @@ test_core(void) TEST_ERROR; /* Allocate memory for data set. */ - if (NULL == (data_w = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + if (NULL == (data_w = (int *)malloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) FAIL_PUTS_ERROR("unable to allocate memory for input array"); - if (NULL == (data_r = (int *)HDmalloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) + if (NULL == (data_r = (int *)malloc(DSET1_DIM1 * DSET1_DIM2 * sizeof(int)))) FAIL_PUTS_ERROR("unable to allocate memory for output array"); /* Initialize the buffers */ @@ -622,8 +622,8 @@ test_core(void) if (H5Dclose(did) < 0) TEST_ERROR; - HDfree(data_w); - HDfree(data_r); + free(data_w); + free(data_r); /* Close and delete the file */ if (H5Fclose(fid) < 0) @@ -681,9 +681,9 @@ error: H5E_END_TRY if (data_w) - HDfree(data_w); + free(data_w); if (data_r) - HDfree(data_r); + free(data_r); return -1; } /* end test_core() */ @@ -880,8 +880,8 @@ test_direct(void) if (H5Dclose(dset2) < 0) TEST_ERROR; - HDfree(points); - HDfree(check); + free(points); + free(check); /* Close and delete the file */ if (H5Fclose(file) < 0) @@ -908,9 +908,9 @@ error: H5E_END_TRY if (proto_points) - HDfree(proto_points); + free(proto_points); if (proto_check) - HDfree(proto_check); + free(proto_check); return -1; #endif /*H5_HAVE_DIRECT*/ @@ -1034,9 +1034,9 @@ test_family(void) TESTING("FAMILY file driver"); /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) + if (NULL == (buf_data = (int *)calloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) TEST_ERROR; - if (NULL == (buf = (int **)HDcalloc(FAMILY_NUMBER, sizeof(buf_data)))) + if (NULL == (buf = (int **)calloc(FAMILY_NUMBER, sizeof(buf_data)))) TEST_ERROR; for (i = 0; i < FAMILY_NUMBER; i++) buf[i] = buf_data + (i * FAMILY_SIZE); @@ -1180,8 +1180,8 @@ test_family(void) if (H5Pclose(fapl) < 0) TEST_ERROR; - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); PASSED(); return SUCCEED; @@ -1197,8 +1197,8 @@ error: } H5E_END_TRY - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); return FAIL; } /* end test_family() */ @@ -1346,9 +1346,9 @@ test_family_member_fapl(void) TESTING("Family member FAPL"); /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) + if (NULL == (buf_data = (int *)calloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) TEST_ERROR; - if (NULL == (buf = (int **)HDcalloc(FAMILY_NUMBER, sizeof(buf_data)))) + if (NULL == (buf = (int **)calloc(FAMILY_NUMBER, sizeof(buf_data)))) TEST_ERROR; for (i = 0; i < FAMILY_NUMBER; i++) buf[i] = buf_data + (i * FAMILY_SIZE); @@ -1411,8 +1411,8 @@ test_family_member_fapl(void) if (H5Pclose(fapl_id) == FAIL) TEST_ERROR; - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); PASSED(); return SUCCEED; @@ -1428,8 +1428,8 @@ error: } H5E_END_TRY - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); return FAIL; } /* end test_family_member_fapl() */ @@ -1514,9 +1514,9 @@ test_multi(void) TESTING("MULTI file driver"); /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(MULTI_SIZE * MULTI_SIZE, sizeof(int)))) + if (NULL == (buf_data = (int *)calloc(MULTI_SIZE * MULTI_SIZE, sizeof(int)))) TEST_ERROR; - if (NULL == (buf = (int **)HDcalloc(MULTI_SIZE, sizeof(buf_data)))) + if (NULL == (buf = (int **)calloc(MULTI_SIZE, sizeof(buf_data)))) TEST_ERROR; for (i = 0; i < MULTI_SIZE; i++) buf[i] = buf_data + (i * MULTI_SIZE); @@ -1701,8 +1701,8 @@ test_multi(void) if (H5Pclose(fapl) < 0) TEST_ERROR; - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); PASSED(); @@ -1720,8 +1720,8 @@ error: } H5E_END_TRY - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); return FAIL; } /* end test_multi() */ @@ -1766,9 +1766,9 @@ test_multi_compat(void) TESTING("MULTI file driver backward compatibility"); /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(MULTI_SIZE * MULTI_SIZE, sizeof(int)))) + if (NULL == (buf_data = (int *)calloc(MULTI_SIZE * MULTI_SIZE, sizeof(int)))) TEST_ERROR; - if (NULL == (buf = (int **)HDcalloc(MULTI_SIZE, sizeof(buf_data)))) + if (NULL == (buf = (int **)calloc(MULTI_SIZE, sizeof(buf_data)))) TEST_ERROR; for (i = 0; i < MULTI_SIZE; i++) buf[i] = buf_data + (i * MULTI_SIZE); @@ -1895,8 +1895,8 @@ test_multi_compat(void) if (H5Pclose(fapl) < 0) TEST_ERROR; - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); PASSED(); @@ -1912,8 +1912,8 @@ error: } H5E_END_TRY - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); return FAIL; } /* end test_multi_compat() */ @@ -2410,7 +2410,7 @@ compare_splitter_config_info(hid_t fapl_id, H5FD_splitter_vfd_config_t *info) int ret_value = 0; H5FD_splitter_vfd_config_t *fetched_info = NULL; - if (NULL == (fetched_info = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + if (NULL == (fetched_info = calloc(1, sizeof(H5FD_splitter_vfd_config_t)))) SPLITTER_TEST_FAULT("memory allocation for fetched_info struct failed"); fetched_info->magic = H5FD_SPLITTER_MAGIC; @@ -2450,7 +2450,7 @@ compare_splitter_config_info(hid_t fapl_id, H5FD_splitter_vfd_config_t *info) } done: - HDfree(fetched_info); + free(fetched_info); return ret_value; } /* end compare_splitter_config_info() */ @@ -2487,9 +2487,9 @@ run_splitter_test(const struct splitter_dataset_def *data, hbool_t ignore_wo_err FILE *logfile = NULL; int ret_value = 0; - if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + if (NULL == (vfd_config = calloc(1, sizeof(H5FD_splitter_vfd_config_t)))) SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed"); - if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) + if (NULL == (filename_rw = calloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed"); vfd_config->magic = H5FD_SPLITTER_MAGIC; @@ -2623,8 +2623,8 @@ done: if (logfile != NULL) HDfclose(logfile); - HDfree(vfd_config); - HDfree(filename_rw); + free(vfd_config); + free(filename_rw); return ret_value; } /* end run_splitter_test() */ @@ -2652,7 +2652,7 @@ driver_is_splitter_compatible(hid_t fapl_id) herr_t ret = SUCCEED; int ret_value = 0; - if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) { + if (NULL == (vfd_config = calloc(1, sizeof(H5FD_splitter_vfd_config_t)))) { FAIL_PUTS_ERROR("memory allocation for vfd_config struct failed"); } @@ -2681,7 +2681,7 @@ driver_is_splitter_compatible(hid_t fapl_id) } split_fapl_id = H5I_INVALID_HID; - HDfree(vfd_config); + free(vfd_config); return ret_value; @@ -2692,7 +2692,7 @@ error: } H5E_END_TRY - HDfree(vfd_config); + free(vfd_config); return -1; } /* end driver_is_splitter_compatible() */ @@ -2719,9 +2719,9 @@ splitter_RO_test(const struct splitter_dataset_def *data, hid_t child_fapl_id) hid_t file_id = H5I_INVALID_HID; int ret_value = 0; - if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + if (NULL == (vfd_config = calloc(1, sizeof(H5FD_splitter_vfd_config_t)))) SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed"); - if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) + if (NULL == (filename_rw = calloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed"); vfd_config->magic = H5FD_SPLITTER_MAGIC; @@ -2828,8 +2828,8 @@ done: H5E_END_TRY } - HDfree(vfd_config); - HDfree(filename_rw); + free(vfd_config); + free(filename_rw); return ret_value; } /* end splitter_RO_test() */ @@ -3068,9 +3068,9 @@ splitter_tentative_open_test(hid_t child_fapl_id) struct splitter_dataset_def data; /* for comparison */ int ret_value = 0; - if (NULL == (vfd_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + if (NULL == (vfd_config = calloc(1, sizeof(H5FD_splitter_vfd_config_t)))) SPLITTER_TEST_FAULT("memory allocation for vfd_config struct failed"); - if (NULL == (filename_rw = HDcalloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) + if (NULL == (filename_rw = calloc(H5FD_SPLITTER_PATH_MAX + 1, sizeof(char)))) SPLITTER_TEST_FAULT("memory allocation for filename_rw string failed"); /* pre-fill data buffer to write */ @@ -3319,8 +3319,8 @@ done: H5E_END_TRY } - HDfree(vfd_config); - HDfree(filename_rw); + free(vfd_config); + free(filename_rw); return ret_value; } /* end splitter_tentative_open_test() */ @@ -3536,12 +3536,12 @@ static H5FD_t * H5FD__ctl_test_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { - return HDcalloc(1, sizeof(H5FD_t)); + return calloc(1, sizeof(H5FD_t)); } static herr_t H5FD__ctl_test_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { - HDfree(_file); + free(_file); return SUCCEED; } static haddr_t @@ -3849,7 +3849,7 @@ test_ctl(void) PASSED(); /* Set up splitter VFD config */ - if (NULL == (splitter_config = HDcalloc(1, sizeof(H5FD_splitter_vfd_config_t)))) + if (NULL == (splitter_config = calloc(1, sizeof(H5FD_splitter_vfd_config_t)))) TEST_ERROR; splitter_config->magic = H5FD_SPLITTER_MAGIC; @@ -4001,7 +4001,7 @@ test_ctl(void) TESTING_2("test cleanup"); - HDfree(splitter_config); + free(splitter_config); if (H5FDunregister(driver_id) < 0) TEST_ERROR; @@ -4018,7 +4018,7 @@ error: H5E_BEGIN_TRY { if (splitter_config) - HDfree(splitter_config); + free(splitter_config); H5FDunregister(driver_id); H5Pclose(sub_fapl_id); H5Pclose(fapl_id); @@ -4076,8 +4076,8 @@ test_vector_io__setup_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], siz sizes[i] = (size_t)((rand() & 1023) + 1); - temp_buf = HDmalloc(sizes[i] + 1); - read_bufs[i] = HDmalloc(sizes[i] + 1); + temp_buf = malloc(sizes[i] + 1); + read_bufs[i] = malloc(sizes[i] + 1); if ((NULL == temp_buf) || (NULL == read_bufs[i])) { @@ -4103,7 +4103,7 @@ test_vector_io__setup_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], siz if (!result) { /* free buffers */ - HDfree(temp_buf); + free(temp_buf); for (i = 0; i < count; i++) { @@ -4115,7 +4115,7 @@ test_vector_io__setup_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], siz if (read_bufs[i]) { - HDfree(read_bufs[i]); + free(read_bufs[i]); read_bufs[i] = NULL; } } @@ -4196,8 +4196,8 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a sizes[i] = (size_t)((rand() & 1023) + 1); - temp_buf = HDmalloc(sizes[i] + 1); - read_bufs[i] = HDmalloc(sizes[i] + 1); + temp_buf = malloc(sizes[i] + 1); + read_bufs[i] = malloc(sizes[i] + 1); } else { @@ -4212,8 +4212,8 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a addrs[i] = HADDR_UNDEF; - temp_buf = HDmalloc(sizes[fix_point] + 1); - read_bufs[i] = HDmalloc(sizes[fix_point] + 1); + temp_buf = malloc(sizes[fix_point] + 1); + read_bufs[i] = malloc(sizes[fix_point] + 1); } if ((NULL == temp_buf) || (NULL == read_bufs[i])) { @@ -4243,7 +4243,7 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a if (!result) { /* free buffers */ - HDfree(temp_buf); + free(temp_buf); for (i = 0; i < count; i++) { @@ -4255,7 +4255,7 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a if (read_bufs[i]) { - HDfree(read_bufs[i]); + free(read_bufs[i]); read_bufs[i] = NULL; } } @@ -4910,13 +4910,13 @@ test_vector_io(const char *vfd_name) h5_free_const(write_bufs_2[i]); write_bufs_2[i] = NULL; - HDfree(read_bufs_0[i]); + free(read_bufs_0[i]); read_bufs_0[i] = NULL; - HDfree(read_bufs_1[i]); + free(read_bufs_1[i]); read_bufs_1[i] = NULL; - HDfree(read_bufs_2[i]); + free(read_bufs_2[i]); read_bufs_2[i] = NULL; h5_free_const(f_write_bufs_0[i]); @@ -4928,13 +4928,13 @@ test_vector_io(const char *vfd_name) h5_free_const(f_write_bufs_2[i]); f_write_bufs_2[i] = NULL; - HDfree(f_read_bufs_0[i]); + free(f_read_bufs_0[i]); f_read_bufs_0[i] = NULL; - HDfree(f_read_bufs_1[i]); + free(f_read_bufs_1[i]); f_read_bufs_1[i] = NULL; - HDfree(f_read_bufs_2[i]); + free(f_read_bufs_2[i]); f_read_bufs_2[i] = NULL; } @@ -4974,7 +4974,7 @@ test_selection_io_write(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t mem_s int i; int j; - if (NULL == (bufs = HDcalloc(count, sizeof(void *)))) + if (NULL == (bufs = calloc(count, sizeof(void *)))) TEST_ERROR; /* Update write buffer */ @@ -4990,12 +4990,12 @@ test_selection_io_write(H5FD_t *lf, H5FD_mem_t type, uint32_t count, hid_t mem_s bufs) < 0) TEST_ERROR; - HDfree(bufs); + free(bufs); return 0; error: - HDfree(bufs); + free(bufs); return -1; } /* end test_selection_io_write() */ diff --git a/test/vol.c b/test/vol.c index 551abd1..c9a9aa1 100644 --- a/test/vol.c +++ b/test/vol.c @@ -584,7 +584,7 @@ fake_vol_info_to_str(const void *info, char **str) } /* Allocate the string long enough for the info */ - if (NULL == (*str = (char *)HDcalloc(1, str_size))) + if (NULL == (*str = (char *)calloc(1, str_size))) return FAIL; HDsnprintf(*str, str_size, "%d", val); @@ -628,7 +628,7 @@ fake_vol_free_info(void *info) herr_t ret_value = SUCCEED; /* Return value */ if (info) - HDfree(info); + free(info); return ret_value; } /* end fake_vol_free_info() */ @@ -715,7 +715,7 @@ test_vol_registration(void) TEST_ERROR; /* Test registering a VOL connector with an incompatible version # */ - if (NULL == (bad_fake_vol_class = HDmalloc(sizeof(H5VL_class_t)))) + if (NULL == (bad_fake_vol_class = malloc(sizeof(H5VL_class_t)))) TEST_ERROR; HDmemcpy(bad_fake_vol_class, &fake_vol_g, sizeof(H5VL_class_t)); bad_fake_vol_class->version = H5VL_VERSION + 1; @@ -726,7 +726,7 @@ test_vol_registration(void) H5E_END_TRY if (H5I_INVALID_HID != vol_id) FAIL_PUTS_ERROR("should not be able to register a connector with an incompatible version #"); - HDfree(bad_fake_vol_class); + free(bad_fake_vol_class); bad_fake_vol_class = NULL; /* Load a VOL interface @@ -807,7 +807,7 @@ error: H5E_END_TRY if (bad_fake_vol_class) - HDfree(bad_fake_vol_class); + free(bad_fake_vol_class); return FAIL; } /* end test_vol_registration() */ @@ -2192,7 +2192,7 @@ test_async_vol_props(void) if (conn_env_str) { if (HDsetenv(HDF5_VOL_CONNECTOR, conn_env_str, TRUE) < 0) TEST_ERROR; - HDfree(conn_env_str); + free(conn_env_str); if (H5VL__reparse_def_vol_conn_variable_test() < 0) TEST_ERROR; @@ -2209,7 +2209,7 @@ error: H5VLunregister_connector(vol_id); } H5E_END_TRY - HDfree(conn_env_str); + free(conn_env_str); return FAIL; } /* end test_async_vol_props() */ @@ -2510,7 +2510,7 @@ test_info_to_str(void) /* Free the string being returned */ if (ret_str) - HDfree(ret_str); + free(ret_str); if (H5Pclose(fapl_id) < 0) TEST_ERROR; diff --git a/testpar/API/H5_api_async_test_parallel.c b/testpar/API/H5_api_async_test_parallel.c index 97944df..d6f55b1 100644 --- a/testpar/API/H5_api_async_test_parallel.c +++ b/testpar/API/H5_api_async_test_parallel.c @@ -125,13 +125,13 @@ test_one_dataset_io(void) data_size *= dims[i]; data_size *= sizeof(int); - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); TEST_ERROR; } - if (NULL == (read_buf = HDmalloc(data_size))) { + if (NULL == (read_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); TEST_ERROR; @@ -364,17 +364,17 @@ test_one_dataset_io(void) TEST_ERROR; if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -395,11 +395,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Sclose(mspace_id); H5Dclose(dset_id); @@ -483,13 +483,13 @@ test_multi_dataset_io(void) data_size *= sizeof(int); data_size *= MULTI_DATASET_IO_TEST_NDSETS; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); TEST_ERROR; } - if (NULL == (read_buf = HDmalloc(data_size))) { + if (NULL == (read_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); TEST_ERROR; @@ -687,17 +687,17 @@ test_multi_dataset_io(void) TEST_ERROR; if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -718,11 +718,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Sclose(mspace_id); for (i = 0; i < MULTI_DATASET_IO_TEST_NDSETS; i++) @@ -805,13 +805,13 @@ test_multi_file_dataset_io(void) data_size *= sizeof(int); data_size *= MULTI_FILE_DATASET_IO_TEST_NFILES; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); TEST_ERROR; } - if (NULL == (read_buf = HDmalloc(data_size))) { + if (NULL == (read_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); TEST_ERROR; @@ -1111,17 +1111,17 @@ test_multi_file_dataset_io(void) TEST_ERROR; if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -1142,11 +1142,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Sclose(mspace_id); for (i = 0; i < MULTI_FILE_DATASET_IO_TEST_NFILES; i++) { @@ -1228,13 +1228,13 @@ test_multi_file_grp_dset_io(void) data_size *= sizeof(int); data_size *= MULTI_FILE_GRP_DSET_IO_TEST_NFILES; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); TEST_ERROR; } - if (NULL == (read_buf = HDmalloc(data_size))) { + if (NULL == (read_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); TEST_ERROR; @@ -1527,17 +1527,17 @@ test_multi_file_grp_dset_io(void) TEST_ERROR; if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -1558,11 +1558,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Sclose(mspace_id); H5Dclose(dset_id); @@ -1633,13 +1633,13 @@ test_set_extent(void) if (generate_random_parallel_dimensions(SET_EXTENT_TEST_SPACE_RANK, &dims) < 0) TEST_ERROR; - if (NULL == (maxdims = HDmalloc(SET_EXTENT_TEST_SPACE_RANK * sizeof(hsize_t)))) { + if (NULL == (maxdims = malloc(SET_EXTENT_TEST_SPACE_RANK * sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate max dataspace dimension buffer\n"); TEST_ERROR; } - if (NULL == (cdims = HDmalloc(SET_EXTENT_TEST_SPACE_RANK * sizeof(hsize_t)))) { + if (NULL == (cdims = malloc(SET_EXTENT_TEST_SPACE_RANK * sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate chunk dimension buffer\n"); TEST_ERROR; @@ -1685,13 +1685,13 @@ test_set_extent(void) data_size *= sizeof(int); data_size *= SET_EXTENT_TEST_NUM_EXTENDS; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); TEST_ERROR; } - if (NULL == (read_buf = HDmalloc(data_size))) { + if (NULL == (read_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); TEST_ERROR; @@ -1844,27 +1844,27 @@ test_set_extent(void) FAIL_PUTS_ERROR(" dataspaces are not equal\n"); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (cdims) { - HDfree(cdims); + free(cdims); cdims = NULL; } if (maxdims) { - HDfree(maxdims); + free(maxdims); maxdims = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -1897,15 +1897,15 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (cdims) - HDfree(cdims); + free(cdims); if (maxdims) - HDfree(maxdims); + free(maxdims); if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Sclose(mspace_id); H5Sclose(space_id_out); @@ -2045,7 +2045,7 @@ test_attribute_exists(void) TEST_ERROR; if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -2060,7 +2060,7 @@ error: H5E_BEGIN_TRY { if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Aclose(attr_id); H5Dclose(dset_id); @@ -2150,13 +2150,13 @@ test_attribute_io(void) data_size *= dims[i]; data_size *= sizeof(int); - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for attribute write\n"); TEST_ERROR; } - if (NULL == (read_buf = HDmalloc(data_size))) { + if (NULL == (read_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for attribute read\n"); TEST_ERROR; @@ -2240,17 +2240,17 @@ test_attribute_io(void) TEST_ERROR; if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -2265,11 +2265,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Aclose(attr_id); H5Dclose(dset_id); @@ -2348,13 +2348,13 @@ test_attribute_io_tconv(void) data_size *= dims[i]; data_size *= sizeof(int); - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for attribute write\n"); TEST_ERROR; } - if (NULL == (read_buf = HDmalloc(data_size))) { + if (NULL == (read_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for attribute read\n"); TEST_ERROR; @@ -2433,17 +2433,17 @@ test_attribute_io_tconv(void) TEST_ERROR; if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -2460,11 +2460,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Aclose(attr_id); H5Dclose(dset_id); @@ -2577,19 +2577,19 @@ test_attribute_io_compound(void) data_size *= dims[i]; data_size *= sizeof(tattr_cmpd_t); - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for attribute write\n"); TEST_ERROR; } - if (NULL == (read_buf = HDmalloc(data_size))) { + if (NULL == (read_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for attribute read\n"); TEST_ERROR; } - if (NULL == (fbuf = HDmalloc(data_size))) { + if (NULL == (fbuf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for attribute read verification\n"); TEST_ERROR; @@ -2835,22 +2835,22 @@ test_attribute_io_compound(void) TEST_ERROR; if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (fbuf) { - HDfree(fbuf); + free(fbuf); fbuf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -2867,13 +2867,13 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (fbuf) - HDfree(fbuf); + free(fbuf); if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Tclose(mtype_id); H5Tclose(ftype_id); @@ -3457,7 +3457,7 @@ test_ocopy_orefresh(void) TEST_ERROR; if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -3474,7 +3474,7 @@ error: H5E_BEGIN_TRY { if (dims) - HDfree(dims); + free(dims); H5Sclose(space_id); H5Dclose(dset_id); H5Gclose(parent_group_id); diff --git a/testpar/API/H5_api_dataset_test_parallel.c b/testpar/API/H5_api_dataset_test_parallel.c index 59e4248..6f9bf05 100644 --- a/testpar/API/H5_api_dataset_test_parallel.c +++ b/testpar/API/H5_api_dataset_test_parallel.c @@ -215,7 +215,7 @@ test_write_dataset_data_verification(void) data_size *= dims[i]; data_size *= DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE; - if (NULL != (write_buf = HDmalloc(data_size))) { + if (NULL != (write_buf = malloc(data_size))) { for (i = 0; i < data_size / DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE; i++) ((int *)write_buf)[i] = (int)i; @@ -227,7 +227,7 @@ test_write_dataset_data_verification(void) op_failed = TRUE; if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } } @@ -317,7 +317,7 @@ test_write_dataset_data_verification(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); PART_ERROR(H5Dwrite_all_read); @@ -338,7 +338,7 @@ test_write_dataset_data_verification(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -347,11 +347,11 @@ test_write_dataset_data_verification(void) PART_END(H5Dwrite_all_read); if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (fspace_id >= 0) { @@ -379,7 +379,7 @@ test_write_dataset_data_verification(void) data_size *= dims[i]; data_size *= DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); PART_ERROR(H5Dwrite_hyperslab_read); @@ -442,7 +442,7 @@ test_write_dataset_data_verification(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -525,7 +525,7 @@ test_write_dataset_data_verification(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); PART_ERROR(H5Dwrite_hyperslab_read); @@ -553,7 +553,7 @@ test_write_dataset_data_verification(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -562,11 +562,11 @@ test_write_dataset_data_verification(void) PART_END(H5Dwrite_hyperslab_read); if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (fspace_id >= 0) { @@ -602,7 +602,7 @@ test_write_dataset_data_verification(void) data_size *= dims[i]; data_size *= DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); PART_ERROR(H5Dwrite_point_sel_read); @@ -612,9 +612,9 @@ test_write_dataset_data_verification(void) for (i = 0; i < data_size / DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE; i++) ((int *)write_buf)[i] = mpi_size - mpi_rank; - if (NULL == (points = HDmalloc(DATASET_WRITE_DATA_VERIFY_TEST_SPACE_RANK * - (data_size / DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE) * - sizeof(hsize_t)))) { + if (NULL == (points = malloc(DATASET_WRITE_DATA_VERIFY_TEST_SPACE_RANK * + (data_size / DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE) * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for point selection\n"); PART_ERROR(H5Dwrite_point_sel_read); @@ -676,7 +676,7 @@ test_write_dataset_data_verification(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -759,7 +759,7 @@ test_write_dataset_data_verification(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_DATA_VERIFY_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); PART_ERROR(H5Dwrite_point_sel_read); @@ -787,7 +787,7 @@ test_write_dataset_data_verification(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -796,15 +796,15 @@ test_write_dataset_data_verification(void) PART_END(H5Dwrite_point_sel_read); if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (points) { - HDfree(points); + free(points); points = NULL; } if (fspace_id >= 0) { @@ -837,22 +837,22 @@ test_write_dataset_data_verification(void) TESTING_2("test cleanup"); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (points) { - HDfree(points); + free(points); points = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -873,13 +873,13 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (points) - HDfree(points); + free(points); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -988,7 +988,7 @@ test_write_dataset_independent(void) data_size *= dims[i]; data_size *= DATASET_INDEPENDENT_WRITE_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); goto error; @@ -1066,7 +1066,7 @@ test_write_dataset_independent(void) END_INDEPENDENT_OP(dset_write); if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } @@ -1139,7 +1139,7 @@ test_write_dataset_independent(void) goto error; } - if (NULL == (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_INDEPENDENT_WRITE_TEST_DTYPE_SIZE))) { + if (NULL == (read_buf = malloc((hsize_t)space_npoints * DATASET_INDEPENDENT_WRITE_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -1186,12 +1186,12 @@ test_write_dataset_independent(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -1218,11 +1218,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id1); @@ -1319,7 +1319,7 @@ test_write_dataset_one_proc_0_selection(void) BEGIN_INDEPENDENT_OP(write_buf_alloc) { if (!MAINPROCESS) { - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(write_buf_alloc); @@ -1376,7 +1376,7 @@ test_write_dataset_one_proc_0_selection(void) END_INDEPENDENT_OP(dset_write); if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -1457,8 +1457,7 @@ test_write_dataset_one_proc_0_selection(void) goto error; } - if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_ONE_PROC_0_SEL_TEST_DTYPE_SIZE))) { + if (NULL == (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_ONE_PROC_0_SEL_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -1487,12 +1486,12 @@ test_write_dataset_one_proc_0_selection(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -1517,11 +1516,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -1617,7 +1616,7 @@ test_write_dataset_one_proc_none_selection(void) BEGIN_INDEPENDENT_OP(write_buf_alloc) { if (!MAINPROCESS) { - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(write_buf_alloc); @@ -1687,7 +1686,7 @@ test_write_dataset_one_proc_none_selection(void) END_INDEPENDENT_OP(dset_write); if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -1770,7 +1769,7 @@ test_write_dataset_one_proc_none_selection(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_ONE_PROC_NONE_SEL_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_ONE_PROC_NONE_SEL_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -1800,12 +1799,12 @@ test_write_dataset_one_proc_none_selection(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -1830,11 +1829,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -1927,7 +1926,7 @@ test_write_dataset_one_proc_all_selection(void) BEGIN_INDEPENDENT_OP(write_buf_alloc) { if (MAINPROCESS) { - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(write_buf_alloc); @@ -1983,7 +1982,7 @@ test_write_dataset_one_proc_all_selection(void) END_INDEPENDENT_OP(dset_write); if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -2066,7 +2065,7 @@ test_write_dataset_one_proc_all_selection(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_ONE_PROC_ALL_SEL_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_ONE_PROC_ALL_SEL_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -2088,12 +2087,12 @@ test_write_dataset_one_proc_all_selection(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -2118,11 +2117,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -2221,7 +2220,7 @@ test_write_dataset_hyper_file_all_mem(void) data_size *= dims[i]; data_size *= DATASET_WRITE_HYPER_FILE_ALL_MEM_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); goto error; @@ -2258,7 +2257,7 @@ test_write_dataset_hyper_file_all_mem(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (fspace_id >= 0) { @@ -2333,7 +2332,7 @@ test_write_dataset_hyper_file_all_mem(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_HYPER_FILE_ALL_MEM_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_HYPER_FILE_ALL_MEM_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -2360,12 +2359,12 @@ test_write_dataset_hyper_file_all_mem(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -2394,11 +2393,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -2497,7 +2496,7 @@ test_write_dataset_all_file_hyper_mem(void) * buffer in order to prove that the mapping from hyperslab selection <-> all * selection works correctly. */ - if (NULL == (write_buf = HDmalloc(2 * data_size))) { + if (NULL == (write_buf = malloc(2 * data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(write_buf_alloc); @@ -2552,7 +2551,7 @@ test_write_dataset_all_file_hyper_mem(void) END_INDEPENDENT_OP(dset_write); if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -2635,7 +2634,7 @@ test_write_dataset_all_file_hyper_mem(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_ALL_FILE_HYPER_MEM_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_ALL_FILE_HYPER_MEM_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -2657,12 +2656,12 @@ test_write_dataset_all_file_hyper_mem(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -2687,11 +2686,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -2805,7 +2804,7 @@ test_write_dataset_all_file_point_mem(void) * buffer in order to prove that the mapping from point selection <-> all * selection works correctly. */ - if (NULL == (write_buf = HDmalloc(2 * data_size))) { + if (NULL == (write_buf = malloc(2 * data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(write_buf_alloc); @@ -2839,8 +2838,8 @@ test_write_dataset_all_file_point_mem(void) INDEPENDENT_OP_ERROR(dset_write); } - if (NULL == (points = HDmalloc((data_size / DATASET_WRITE_ALL_FILE_POINT_MEM_TEST_DTYPE_SIZE) * - sizeof(hsize_t)))) { + if (NULL == (points = malloc((data_size / DATASET_WRITE_ALL_FILE_POINT_MEM_TEST_DTYPE_SIZE) * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for point selection\n"); INDEPENDENT_OP_ERROR(dset_write); @@ -2872,11 +2871,11 @@ test_write_dataset_all_file_point_mem(void) END_INDEPENDENT_OP(dset_write); if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (points) { - HDfree(points); + free(points); points = NULL; } if (mspace_id >= 0) { @@ -2959,7 +2958,7 @@ test_write_dataset_all_file_point_mem(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_ALL_FILE_POINT_MEM_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_ALL_FILE_POINT_MEM_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -2981,12 +2980,12 @@ test_write_dataset_all_file_point_mem(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -3011,13 +3010,13 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (points) - HDfree(points); + free(points); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -3117,7 +3116,7 @@ test_write_dataset_hyper_file_point_mem(void) * buffer in order to prove that the mapping from point selection <-> hyperslab * selection works correctly. */ - if (NULL == (write_buf = HDmalloc(2 * data_size))) { + if (NULL == (write_buf = malloc(2 * data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); goto error; @@ -3161,8 +3160,8 @@ test_write_dataset_hyper_file_point_mem(void) goto error; } - if (NULL == (points = HDmalloc((data_size / DATASET_WRITE_HYPER_FILE_POINT_MEM_TEST_DTYPE_SIZE) * - sizeof(hsize_t)))) { + if (NULL == (points = malloc((data_size / DATASET_WRITE_HYPER_FILE_POINT_MEM_TEST_DTYPE_SIZE) * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for point selection\n"); goto error; @@ -3190,11 +3189,11 @@ test_write_dataset_hyper_file_point_mem(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (points) { - HDfree(points); + free(points); points = NULL; } if (mspace_id >= 0) { @@ -3277,7 +3276,7 @@ test_write_dataset_hyper_file_point_mem(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_HYPER_FILE_POINT_MEM_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_HYPER_FILE_POINT_MEM_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -3305,12 +3304,12 @@ test_write_dataset_hyper_file_point_mem(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -3335,13 +3334,13 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (points) - HDfree(points); + free(points); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -3437,7 +3436,7 @@ test_write_dataset_point_file_hyper_mem(void) * buffer in order to prove that the mapping from hyperslab selection <-> point * selection works correctly. */ - if (NULL == (write_buf = HDmalloc(2 * data_size))) { + if (NULL == (write_buf = malloc(2 * data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); goto error; @@ -3451,8 +3450,8 @@ test_write_dataset_point_file_hyper_mem(void) ((int *)write_buf)[i] = 0; } - if (NULL == (points = HDmalloc((data_size / DATASET_WRITE_POINT_FILE_HYPER_MEM_TEST_DTYPE_SIZE) * - DATASET_WRITE_POINT_FILE_HYPER_MEM_TEST_SPACE_RANK * sizeof(hsize_t)))) { + if (NULL == (points = malloc((data_size / DATASET_WRITE_POINT_FILE_HYPER_MEM_TEST_DTYPE_SIZE) * + DATASET_WRITE_POINT_FILE_HYPER_MEM_TEST_SPACE_RANK * sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for point selection\n"); goto error; @@ -3508,11 +3507,11 @@ test_write_dataset_point_file_hyper_mem(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (points) { - HDfree(points); + free(points); points = NULL; } if (mspace_id >= 0) { @@ -3595,7 +3594,7 @@ test_write_dataset_point_file_hyper_mem(void) } if (NULL == - (read_buf = HDmalloc((hsize_t)space_npoints * DATASET_WRITE_POINT_FILE_HYPER_MEM_TEST_DTYPE_SIZE))) { + (read_buf = malloc((hsize_t)space_npoints * DATASET_WRITE_POINT_FILE_HYPER_MEM_TEST_DTYPE_SIZE))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -3623,12 +3622,12 @@ test_write_dataset_point_file_hyper_mem(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -3653,13 +3652,13 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (points) - HDfree(points); + free(points); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -3758,7 +3757,7 @@ test_read_dataset_one_proc_0_selection(void) data_size *= dims[i]; data_size *= DATASET_READ_ONE_PROC_0_SEL_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -3793,7 +3792,7 @@ test_read_dataset_one_proc_0_selection(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -3889,7 +3888,7 @@ test_read_dataset_one_proc_0_selection(void) read_buf_size = ((size_t)(space_npoints / mpi_size) * DATASET_READ_ONE_PROC_0_SEL_TEST_DTYPE_SIZE); - if (NULL == (read_buf = HDmalloc(read_buf_size))) { + if (NULL == (read_buf = malloc(read_buf_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); INDEPENDENT_OP_ERROR(read_buf_alloc); @@ -3957,12 +3956,12 @@ test_read_dataset_one_proc_0_selection(void) END_INDEPENDENT_OP(data_verify); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -3989,11 +3988,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -4093,7 +4092,7 @@ test_read_dataset_one_proc_none_selection(void) data_size *= dims[i]; data_size *= DATASET_READ_ONE_PROC_NONE_SEL_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -4128,7 +4127,7 @@ test_read_dataset_one_proc_none_selection(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -4225,7 +4224,7 @@ test_read_dataset_one_proc_none_selection(void) read_buf_size = ((size_t)(space_npoints / mpi_size) * DATASET_READ_ONE_PROC_NONE_SEL_TEST_DTYPE_SIZE); - if (NULL == (read_buf = HDmalloc(read_buf_size))) { + if (NULL == (read_buf = malloc(read_buf_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); INDEPENDENT_OP_ERROR(read_buf_alloc); @@ -4306,12 +4305,12 @@ test_read_dataset_one_proc_none_selection(void) END_INDEPENDENT_OP(data_verify); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -4338,11 +4337,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -4439,7 +4438,7 @@ test_read_dataset_one_proc_all_selection(void) data_size *= dims[i]; data_size *= DATASET_READ_ONE_PROC_ALL_SEL_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -4474,7 +4473,7 @@ test_read_dataset_one_proc_all_selection(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -4569,7 +4568,7 @@ test_read_dataset_one_proc_all_selection(void) if (MAINPROCESS) { read_buf_size = (size_t)space_npoints * DATASET_READ_ONE_PROC_ALL_SEL_TEST_DTYPE_SIZE; - if (NULL == (read_buf = HDmalloc(read_buf_size))) { + if (NULL == (read_buf = malloc(read_buf_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); INDEPENDENT_OP_ERROR(read_buf_alloc); @@ -4643,12 +4642,12 @@ test_read_dataset_one_proc_all_selection(void) END_INDEPENDENT_OP(data_verify); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -4675,11 +4674,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -4791,7 +4790,7 @@ test_read_dataset_all_file_hyper_mem(void) data_size *= dims[i]; data_size *= DATASET_READ_ALL_FILE_HYPER_MEM_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -4828,7 +4827,7 @@ test_read_dataset_all_file_hyper_mem(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -4938,7 +4937,7 @@ test_read_dataset_all_file_hyper_mem(void) * selection works correctly. */ read_buf_size = (size_t)(2 * space_npoints) * DATASET_READ_ALL_FILE_HYPER_MEM_TEST_DTYPE_SIZE; - if (NULL == (read_buf = HDcalloc(1, read_buf_size))) { + if (NULL == (read_buf = calloc(1, read_buf_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); INDEPENDENT_OP_ERROR(dset_read); @@ -4992,12 +4991,12 @@ test_read_dataset_all_file_hyper_mem(void) END_INDEPENDENT_OP(dset_read); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -5022,11 +5021,11 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -5139,7 +5138,7 @@ test_read_dataset_all_file_point_mem(void) data_size *= dims[i]; data_size *= DATASET_READ_ALL_FILE_POINT_MEM_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -5176,7 +5175,7 @@ test_read_dataset_all_file_point_mem(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -5283,7 +5282,7 @@ test_read_dataset_all_file_point_mem(void) * selection works correctly. */ read_buf_size = (size_t)(2 * space_npoints) * DATASET_READ_ALL_FILE_POINT_MEM_TEST_DTYPE_SIZE; - if (NULL == (read_buf = HDcalloc(1, read_buf_size))) { + if (NULL == (read_buf = calloc(1, read_buf_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); INDEPENDENT_OP_ERROR(dset_read); @@ -5295,7 +5294,7 @@ test_read_dataset_all_file_point_mem(void) INDEPENDENT_OP_ERROR(dset_read); } - if (NULL == (points = HDmalloc((size_t)space_npoints * sizeof(hsize_t)))) { + if (NULL == (points = malloc((size_t)space_npoints * sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for point selection\n"); INDEPENDENT_OP_ERROR(dset_read); @@ -5348,17 +5347,17 @@ test_read_dataset_all_file_point_mem(void) END_INDEPENDENT_OP(dset_read); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (points) { - HDfree(points); + free(points); points = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -5383,13 +5382,13 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (points) - HDfree(points); + free(points); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -5492,7 +5491,7 @@ test_read_dataset_hyper_file_point_mem(void) data_size *= dims[i]; data_size *= DATASET_READ_HYPER_FILE_POINT_MEM_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -5529,7 +5528,7 @@ test_read_dataset_hyper_file_point_mem(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -5626,7 +5625,7 @@ test_read_dataset_hyper_file_point_mem(void) * selection works correctly. */ read_buf_size = (2 * (size_t)(space_npoints / mpi_size) * DATASET_READ_ONE_PROC_NONE_SEL_TEST_DTYPE_SIZE); - if (NULL == (read_buf = HDcalloc(1, read_buf_size))) { + if (NULL == (read_buf = calloc(1, read_buf_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; @@ -5662,7 +5661,7 @@ test_read_dataset_hyper_file_point_mem(void) goto error; } - if (NULL == (points = HDmalloc((size_t)(space_npoints / mpi_size) * sizeof(hsize_t)))) { + if (NULL == (points = malloc((size_t)(space_npoints / mpi_size) * sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for point selection\n"); goto error; @@ -5706,17 +5705,17 @@ test_read_dataset_hyper_file_point_mem(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (points) { - HDfree(points); + free(points); points = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -5741,13 +5740,13 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (points) - HDfree(points); + free(points); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -5846,7 +5845,7 @@ test_read_dataset_point_file_hyper_mem(void) data_size *= dims[i]; data_size *= DATASET_READ_POINT_FILE_HYPER_MEM_TEST_DTYPE_SIZE; - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -5883,7 +5882,7 @@ test_read_dataset_point_file_hyper_mem(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } if (mspace_id >= 0) { @@ -5981,15 +5980,15 @@ test_read_dataset_point_file_hyper_mem(void) */ read_buf_size = (2 * (size_t)(space_npoints / mpi_size) * DATASET_READ_POINT_FILE_HYPER_MEM_TEST_DTYPE_SIZE); - if (NULL == (read_buf = HDcalloc(1, read_buf_size))) { + if (NULL == (read_buf = calloc(1, read_buf_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset read\n"); goto error; } - if (NULL == (points = HDmalloc((size_t)((space_npoints / mpi_size) * - DATASET_READ_POINT_FILE_HYPER_MEM_TEST_SPACE_RANK) * - sizeof(hsize_t)))) { + if (NULL == (points = malloc((size_t)((space_npoints / mpi_size) * + DATASET_READ_POINT_FILE_HYPER_MEM_TEST_SPACE_RANK) * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for point selection\n"); goto error; @@ -6061,17 +6060,17 @@ test_read_dataset_point_file_hyper_mem(void) } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } if (points) { - HDfree(points); + free(points); points = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -6098,13 +6097,13 @@ error: H5E_BEGIN_TRY { if (read_buf) - HDfree(read_buf); + free(read_buf); if (write_buf) - HDfree(write_buf); + free(write_buf); if (points) - HDfree(points); + free(points); if (dims) - HDfree(dims); + free(dims); H5Sclose(mspace_id); H5Sclose(fspace_id); H5Dclose(dset_id); @@ -6166,14 +6165,14 @@ test_write_multi_chunk_dataset_same_shape_read(void) } if (NULL == - (dims = HDmalloc(DATASET_MULTI_CHUNK_WRITE_SAME_SPACE_READ_TEST_DSET_SPACE_RANK * sizeof(hsize_t)))) { + (dims = malloc(DATASET_MULTI_CHUNK_WRITE_SAME_SPACE_READ_TEST_DSET_SPACE_RANK * sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset dimensionality\n"); goto error; } - if (NULL == (chunk_dims = HDmalloc(DATASET_MULTI_CHUNK_WRITE_SAME_SPACE_READ_TEST_DSET_SPACE_RANK * - sizeof(hsize_t)))) { + if (NULL == (chunk_dims = malloc(DATASET_MULTI_CHUNK_WRITE_SAME_SPACE_READ_TEST_DSET_SPACE_RANK * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset dimensionality\n"); goto error; @@ -6286,7 +6285,7 @@ test_write_multi_chunk_dataset_same_shape_read(void) } } - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -6360,7 +6359,7 @@ test_write_multi_chunk_dataset_same_shape_read(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } @@ -6527,12 +6526,12 @@ test_write_multi_chunk_dataset_same_shape_read(void) } if (chunk_dims) { - HDfree(chunk_dims); + free(chunk_dims); chunk_dims = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -6559,11 +6558,11 @@ error: H5E_BEGIN_TRY { if (write_buf) - HDfree(write_buf); + free(write_buf); if (chunk_dims) - HDfree(chunk_dims); + free(chunk_dims); if (dims) - HDfree(dims); + free(dims); H5Pclose(dcpl_id); H5Sclose(mspace_id); H5Sclose(fspace_id); @@ -6629,14 +6628,14 @@ test_write_multi_chunk_dataset_diff_shape_read(void) } if (NULL == - (dims = HDmalloc(DATASET_MULTI_CHUNK_WRITE_DIFF_SPACE_READ_TEST_DSET_SPACE_RANK * sizeof(hsize_t)))) { + (dims = malloc(DATASET_MULTI_CHUNK_WRITE_DIFF_SPACE_READ_TEST_DSET_SPACE_RANK * sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset dimensionality\n"); goto error; } - if (NULL == (chunk_dims = HDmalloc(DATASET_MULTI_CHUNK_WRITE_DIFF_SPACE_READ_TEST_DSET_SPACE_RANK * - sizeof(hsize_t)))) { + if (NULL == (chunk_dims = malloc(DATASET_MULTI_CHUNK_WRITE_DIFF_SPACE_READ_TEST_DSET_SPACE_RANK * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset dimensionality\n"); goto error; @@ -6749,7 +6748,7 @@ test_write_multi_chunk_dataset_diff_shape_read(void) } } - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -6823,7 +6822,7 @@ test_write_multi_chunk_dataset_diff_shape_read(void) } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } @@ -6992,12 +6991,12 @@ test_write_multi_chunk_dataset_diff_shape_read(void) } if (chunk_dims) { - HDfree(chunk_dims); + free(chunk_dims); chunk_dims = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } @@ -7024,11 +7023,11 @@ error: H5E_BEGIN_TRY { if (write_buf) - HDfree(write_buf); + free(write_buf); if (chunk_dims) - HDfree(chunk_dims); + free(chunk_dims); if (dims) - HDfree(dims); + free(dims); H5Pclose(dcpl_id); H5Sclose(mspace_id); H5Sclose(fspace_id); @@ -7093,15 +7092,15 @@ test_overwrite_multi_chunk_dataset_same_shape_read(void) return 0; } - if (NULL == (dims = HDmalloc(DATASET_MULTI_CHUNK_OVERWRITE_SAME_SPACE_READ_TEST_DSET_SPACE_RANK * - sizeof(hsize_t)))) { + if (NULL == (dims = malloc(DATASET_MULTI_CHUNK_OVERWRITE_SAME_SPACE_READ_TEST_DSET_SPACE_RANK * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset dimensionality\n"); goto error; } - if (NULL == (chunk_dims = HDmalloc(DATASET_MULTI_CHUNK_OVERWRITE_SAME_SPACE_READ_TEST_DSET_SPACE_RANK * - sizeof(hsize_t)))) { + if (NULL == (chunk_dims = malloc(DATASET_MULTI_CHUNK_OVERWRITE_SAME_SPACE_READ_TEST_DSET_SPACE_RANK * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset dimensionality\n"); goto error; @@ -7222,7 +7221,7 @@ test_overwrite_multi_chunk_dataset_same_shape_read(void) } } - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -7514,17 +7513,17 @@ test_overwrite_multi_chunk_dataset_same_shape_read(void) } if (chunk_dims) { - HDfree(chunk_dims); + free(chunk_dims); chunk_dims = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } @@ -7547,11 +7546,11 @@ error: H5E_BEGIN_TRY { if (write_buf) - HDfree(write_buf); + free(write_buf); if (chunk_dims) - HDfree(chunk_dims); + free(chunk_dims); if (dims) - HDfree(dims); + free(dims); H5Pclose(dcpl_id); H5Sclose(mspace_id); H5Sclose(fspace_id); @@ -7619,15 +7618,15 @@ test_overwrite_multi_chunk_dataset_diff_shape_read(void) return 0; } - if (NULL == (dims = HDmalloc(DATASET_MULTI_CHUNK_OVERWRITE_DIFF_SPACE_READ_TEST_DSET_SPACE_RANK * - sizeof(hsize_t)))) { + if (NULL == (dims = malloc(DATASET_MULTI_CHUNK_OVERWRITE_DIFF_SPACE_READ_TEST_DSET_SPACE_RANK * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset dimensionality\n"); goto error; } - if (NULL == (chunk_dims = HDmalloc(DATASET_MULTI_CHUNK_OVERWRITE_DIFF_SPACE_READ_TEST_DSET_SPACE_RANK * - sizeof(hsize_t)))) { + if (NULL == (chunk_dims = malloc(DATASET_MULTI_CHUNK_OVERWRITE_DIFF_SPACE_READ_TEST_DSET_SPACE_RANK * + sizeof(hsize_t)))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset dimensionality\n"); goto error; @@ -7748,7 +7747,7 @@ test_overwrite_multi_chunk_dataset_diff_shape_read(void) } } - if (NULL == (write_buf = HDmalloc(data_size))) { + if (NULL == (write_buf = malloc(data_size))) { H5_FAILED(); printf(" couldn't allocate buffer for dataset write\n"); INDEPENDENT_OP_ERROR(dset_create); @@ -8042,17 +8041,17 @@ test_overwrite_multi_chunk_dataset_diff_shape_read(void) } if (chunk_dims) { - HDfree(chunk_dims); + free(chunk_dims); chunk_dims = NULL; } if (dims) { - HDfree(dims); + free(dims); dims = NULL; } if (write_buf) { - HDfree(write_buf); + free(write_buf); write_buf = NULL; } @@ -8075,11 +8074,11 @@ error: H5E_BEGIN_TRY { if (write_buf) - HDfree(write_buf); + free(write_buf); if (chunk_dims) - HDfree(chunk_dims); + free(chunk_dims); if (dims) - HDfree(dims); + free(dims); H5Pclose(dcpl_id); H5Sclose(mspace_id); H5Sclose(fspace_id); diff --git a/testpar/API/H5_api_test_parallel.c b/testpar/API/H5_api_test_parallel.c index c913746..47c974d 100644 --- a/testpar/API/H5_api_test_parallel.c +++ b/testpar/API/H5_api_test_parallel.c @@ -141,7 +141,7 @@ generate_random_parallel_dimensions(int space_rank, hsize_t **dims_out) if (space_rank <= 0) goto error; - if (NULL == (dims = HDmalloc((size_t)space_rank * sizeof(hsize_t)))) + if (NULL == (dims = malloc((size_t)space_rank * sizeof(hsize_t)))) goto error; if (MAINPROCESS) { for (i = 0; i < (size_t)space_rank; i++) { @@ -164,7 +164,7 @@ generate_random_parallel_dimensions(int space_rank, hsize_t **dims_out) error: if (dims) - HDfree(dims); + free(dims); return -1; } @@ -445,7 +445,7 @@ main(int argc, char **argv) HDexit(EXIT_SUCCESS); error: - HDfree(vol_connector_string_copy); + free(vol_connector_string_copy); H5E_BEGIN_TRY { diff --git a/testpar/API/t_bigio.c b/testpar/API/t_bigio.c index 307f749..ebecbdc 100644 --- a/testpar/API/t_bigio.c +++ b/testpar/API/t_bigio.c @@ -477,7 +477,7 @@ dataset_big_write(void) B_DATATYPE *wdata; /* allocate memory for data buffer */ - wdata = (B_DATATYPE *)HDmalloc(bigcount * sizeof(B_DATATYPE)); + wdata = (B_DATATYPE *)malloc(bigcount * sizeof(B_DATATYPE)); VRFY_G((wdata != NULL), "wdata malloc succeeded"); /* setup file access template */ @@ -700,7 +700,7 @@ dataset_big_write(void) num_points = bigcount; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords(start, count, stride, block, num_points, coords, IN_ORDER); @@ -749,7 +749,7 @@ dataset_big_write(void) ret = H5Dclose(dataset); VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - HDfree(wdata); + free(wdata); H5Fclose(fid); } @@ -782,9 +782,9 @@ dataset_big_read(void) herr_t ret; /* Generic return value */ /* allocate memory for data buffer */ - rdata = (B_DATATYPE *)HDmalloc(bigcount * sizeof(B_DATATYPE)); + rdata = (B_DATATYPE *)malloc(bigcount * sizeof(B_DATATYPE)); VRFY_G((rdata != NULL), "rdata malloc succeeded"); - wdata = (B_DATATYPE *)HDmalloc(bigcount * sizeof(B_DATATYPE)); + wdata = (B_DATATYPE *)malloc(bigcount * sizeof(B_DATATYPE)); VRFY_G((wdata != NULL), "wdata malloc succeeded"); HDmemset(rdata, 0, bigcount * sizeof(B_DATATYPE)); @@ -1020,7 +1020,7 @@ dataset_big_read(void) num_points = bigcount; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords(start, count, stride, block, num_points, coords, IN_ORDER); @@ -1031,7 +1031,7 @@ dataset_big_read(void) VRFY_G((ret >= 0), "H5Sselect_elements succeeded"); if (coords) - HDfree(coords); + free(coords); /* create a memory dataspace */ /* Warning: H5Screate_simple requires an array of hsize_t elements @@ -1068,8 +1068,8 @@ dataset_big_read(void) ret = H5Dclose(dataset); VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - HDfree(wdata); - HDfree(rdata); + free(wdata); + free(rdata); wdata = NULL; rdata = NULL; @@ -1096,9 +1096,9 @@ dataset_big_read(void) /* release data buffers */ if (rdata) - HDfree(rdata); + free(rdata); if (wdata) - HDfree(wdata); + free(wdata); } /* dataset_large_readAll */ @@ -1448,7 +1448,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap dims[1] = space_dim2; /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ @@ -1456,7 +1456,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* set up the coords array selection */ num_points = block[0] * block[1] * count[0] * count[1]; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY_G((coords != NULL), "coords malloc succeeded"); point_set(start, count, stride, block, num_points, coords, mode); @@ -1715,16 +1715,16 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap VRFY_G((status >= 0), ""); if (data_array1) - HDfree(data_array1); + free(data_array1); /* Use collective read to verify the correctness of collective write. */ /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* allocate memory for data buffer */ - data_origin1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_origin1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY_G((data_origin1 != NULL), "data_origin1 malloc succeeded"); acc_plist = create_faccess_plist(comm, info, facc_type); @@ -1847,11 +1847,11 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } int diff --git a/testpar/API/t_coll_chunk.c b/testpar/API/t_coll_chunk.c index eba08f4..e68bc68 100644 --- a/testpar/API/t_coll_chunk.c +++ b/testpar/API/t_coll_chunk.c @@ -789,7 +789,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap dims[1] = SPACE_DIM2; /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ @@ -797,7 +797,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* set up the coords array selection */ num_points = block[0] * block[1] * count[0] * count[1]; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); point_set(start, count, stride, block, num_points, coords, mode); @@ -1054,16 +1054,16 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap VRFY((status >= 0), ""); if (data_array1) - HDfree(data_array1); + free(data_array1); /* Use collective read to verify the correctness of collective write. */ /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* allocate memory for data buffer */ - data_origin1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_origin1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); acc_plist = create_faccess_plist(comm, info, facc_type); @@ -1182,11 +1182,11 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* Set up the selection */ diff --git a/testpar/API/t_coll_md_read.c b/testpar/API/t_coll_md_read.c index f6f99bf..805e2b7 100644 --- a/testpar/API/t_coll_md_read.c +++ b/testpar/API/t_coll_md_read.c @@ -113,7 +113,7 @@ test_partial_no_selection_coll_md_read(void) file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); VRFY((file_id >= 0), "H5Fcreate succeeded"); - dataset_dims = HDmalloc(PARTIAL_NO_SELECTION_DATASET_NDIMS * sizeof(*dataset_dims)); + dataset_dims = malloc(PARTIAL_NO_SELECTION_DATASET_NDIMS * sizeof(*dataset_dims)); VRFY((dataset_dims != NULL), "malloc succeeded"); dataset_dims[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_size; @@ -159,8 +159,8 @@ test_partial_no_selection_coll_md_read(void) mspace_id = H5Screate_simple(1, sel_dims, NULL); VRFY((mspace_id >= 0), "H5Screate_simple succeeded"); - data = HDcalloc(1, count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * - sizeof(int)); + data = calloc(1, count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * + sizeof(int)); VRFY((data != NULL), "calloc succeeded"); dxpl_id = H5Pcreate(H5P_DATASET_XFER); @@ -183,8 +183,8 @@ test_partial_no_selection_coll_md_read(void) VRFY((H5Pset_dxpl_mpio_chunk_opt(dxpl_id, H5FD_MPIO_CHUNK_ONE_IO) >= 0), "H5Pset_dxpl_mpio_chunk_opt succeeded"); - read_buf = HDmalloc(count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * - sizeof(int)); + read_buf = malloc(count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * + sizeof(int)); VRFY((read_buf != NULL), "malloc succeeded"); /* @@ -212,17 +212,17 @@ test_partial_no_selection_coll_md_read(void) } if (dataset_dims) { - HDfree(dataset_dims); + free(dataset_dims); dataset_dims = NULL; } if (data) { - HDfree(data); + free(data); data = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -346,13 +346,13 @@ test_multi_chunk_io_addrmap_issue(void) VRFY((H5Fflush(file_id, H5F_SCOPE_GLOBAL) >= 0), "H5Fflush succeeded"); - read_buf = HDmalloc(50 * sizeof(int)); + read_buf = malloc(50 * sizeof(int)); VRFY((read_buf != NULL), "malloc succeeded"); VRFY((H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, read_buf) >= 0), "H5Dread succeeded"); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -509,7 +509,7 @@ test_link_chunk_io_sort_chunk_issue(void) mspace_id = H5Screate_simple(1, sel_dims, NULL); VRFY((mspace_id >= 0), "H5Screate_simple succeeded"); - data = HDcalloc(1, count[0] * sizeof(int)); + data = calloc(1, count[0] * sizeof(int)); VRFY((data != NULL), "calloc succeeded"); dxpl_id = H5Pcreate(H5P_DATASET_XFER); @@ -532,7 +532,7 @@ test_link_chunk_io_sort_chunk_issue(void) VRFY((H5Pset_dxpl_mpio_chunk_opt(dxpl_id, H5FD_MPIO_CHUNK_ONE_IO) >= 0), "H5Pset_dxpl_mpio_chunk_opt succeeded"); - read_buf = HDmalloc(count[0] * sizeof(int)); + read_buf = malloc(count[0] * sizeof(int)); VRFY((read_buf != NULL), "malloc succeeded"); VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -552,12 +552,12 @@ test_link_chunk_io_sort_chunk_issue(void) "H5Dread succeeded"); if (data) { - HDfree(data); + free(data); data = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } diff --git a/testpar/API/t_dset.c b/testpar/API/t_dset.c index 3b7443e..14a5b6e 100644 --- a/testpar/API/t_dset.c +++ b/testpar/API/t_dset.c @@ -316,8 +316,8 @@ dataset_writeInd(void) } /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ---------------------------------------- * CREATE AN HDF5 FILE WITH PARALLEL ACCESS @@ -419,7 +419,7 @@ dataset_writeInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); } /* Example of using the parallel HDF5 library to read a dataset */ @@ -467,10 +467,10 @@ dataset_readInd(void) } /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* setup file access template */ acc_tpl = create_faccess_plist(comm, info, facc_type); @@ -540,9 +540,9 @@ dataset_readInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -611,12 +611,12 @@ dataset_writeAll(void) /* set up the coords array selection */ num_points = (size_t)dim1; - coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -927,7 +927,7 @@ dataset_writeAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); block[0] = 1; @@ -1076,9 +1076,9 @@ dataset_writeAll(void) /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); } /* @@ -1140,14 +1140,14 @@ dataset_readAll(void) /* set up the coords array selection */ num_points = (size_t)dim1; - coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)dim0 * (size_t)dim1 * RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -1323,9 +1323,9 @@ dataset_readAll(void) free(data_array1); if (data_origin1) free(data_origin1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); block[0] = 1; @@ -1384,7 +1384,7 @@ dataset_readAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset6: point selection in File - Point selection in Memory*/ @@ -1430,7 +1430,7 @@ dataset_readAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset7: point selection in memory - All selection in file*/ @@ -1498,11 +1498,11 @@ dataset_readAll(void) /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -1570,8 +1570,8 @@ extend_writeInd(void) chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -1742,7 +1742,7 @@ extend_writeInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); } /* @@ -1969,12 +1969,12 @@ extend_readInd(void) } /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array2 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array2 != NULL), "data_array2 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -2094,11 +2094,11 @@ extend_readInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_array2) - HDfree(data_array2); + free(data_array2); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -2167,8 +2167,8 @@ extend_writeAll(void) chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -2362,7 +2362,7 @@ extend_writeAll(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); } /* Example of using the parallel HDF5 library to read an extendible dataset */ @@ -2413,12 +2413,12 @@ extend_readAll(void) } /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array2 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array2 != NULL), "data_array2 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -2560,11 +2560,11 @@ extend_readAll(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_array2) - HDfree(data_array2); + free(data_array2); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } #ifdef H5_HAVE_FILTER_DEFLATE @@ -2614,10 +2614,10 @@ compress_readAll(void) } /* Allocate data buffer */ - data_orig = (DATATYPE *)HDmalloc((size_t)dim * sizeof(DATATYPE)); - VRFY((data_orig != NULL), "data_origin1 HDmalloc succeeded"); - data_read = (DATATYPE *)HDmalloc((size_t)dim * sizeof(DATATYPE)); - VRFY((data_read != NULL), "data_array1 HDmalloc succeeded"); + data_orig = (DATATYPE *)malloc((size_t)dim * sizeof(DATATYPE)); + VRFY((data_orig != NULL), "data_origin1 malloc succeeded"); + data_read = (DATATYPE *)malloc((size_t)dim * sizeof(DATATYPE)); + VRFY((data_read != NULL), "data_array1 malloc succeeded"); /* Initialize data buffers */ for (u = 0; u < dim; u++) @@ -2750,9 +2750,9 @@ compress_readAll(void) /* release data buffers */ if (data_read) - HDfree(data_read); + free(data_read); if (data_orig) - HDfree(data_orig); + free(data_orig); } #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -2874,11 +2874,11 @@ none_selection_chunk(void) /* allocate memory for data buffer. Only allocate enough buffer for * each processor's data. */ if (mpi_rank) { - data_origin = (DATATYPE *)HDmalloc(block[0] * block[1] * sizeof(DATATYPE)); - VRFY((data_origin != NULL), "data_origin HDmalloc succeeded"); + data_origin = (DATATYPE *)malloc(block[0] * block[1] * sizeof(DATATYPE)); + VRFY((data_origin != NULL), "data_origin malloc succeeded"); - data_array = (DATATYPE *)HDmalloc(block[0] * block[1] * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(block[0] * block[1] * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* put some trivial data in the data_array */ mstart[0] = mstart[1] = 0; @@ -2973,9 +2973,9 @@ none_selection_chunk(void) /* release data buffers */ if (data_origin) - HDfree(data_origin); + free(data_origin); if (data_array) - HDfree(data_array); + free(data_array); } /* Function: test_actual_io_mode @@ -3333,8 +3333,8 @@ test_actual_io_mode(int selection_mode) length = dim0 * dim1; /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); - VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); + buffer = (int *)malloc(sizeof(int) * (size_t)length); + VRFY((buffer != NULL), "malloc of buffer succeeded"); for (i = 0; i < length; i++) buffer[i] = i; @@ -3484,7 +3484,7 @@ test_actual_io_mode(int selection_mode) VRFY((ret >= 0), "H5Sclose succeeded"); ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); - HDfree(buffer); + free(buffer); return; } @@ -3768,8 +3768,8 @@ test_no_collective_cause_mode(int selection_mode) length = (int)(dims[0] * dims[1]); /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); - VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); + buffer = (int *)malloc(sizeof(int) * (size_t)length); + VRFY((buffer != NULL), "malloc of buffer succeeded"); for (i = 0; i < length; i++) buffer[i] = i; @@ -3861,7 +3861,7 @@ test_no_collective_cause_mode(int selection_mode) H5Sclose(file_space); if (fid) H5Fclose(fid); - HDfree(buffer); + free(buffer); /* clean up external file */ if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL) @@ -3971,11 +3971,11 @@ dataset_atomicity(void) buf_size = dim0 * dim1; /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); + write_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf calloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); + read_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf calloc succeeded"); /* setup file access template */ acc_tpl = create_faccess_plist(comm, info, facc_type); @@ -4123,20 +4123,20 @@ dataset_atomicity(void) /* release data buffers */ if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); /* open dataset2 (non-contiguous case) */ dataset2 = H5Dopen2(fid, DATASETNAME6, H5P_DEFAULT); VRFY((dataset2 >= 0), "H5Dopen2 succeeded"); /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); + write_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf calloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); + read_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf calloc succeeded"); for (i = 0; i < buf_size; i++) { write_buf[i] = 5; @@ -4249,9 +4249,9 @@ dataset_atomicity(void) /* release data buffers */ if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); diff --git a/testpar/API/t_file.c b/testpar/API/t_file.c index f296c8a..3c1247f 100644 --- a/testpar/API/t_file.c +++ b/testpar/API/t_file.c @@ -192,7 +192,7 @@ test_page_buffer_access(void) ret = H5Pset_file_space_page_size(fcpl, sizeof(int) * 100); VRFY((ret == 0), ""); - data = (int *)HDmalloc(sizeof(int) * (size_t)num_elements); + data = (int *)malloc(sizeof(int) * (size_t)num_elements); /* initialize all the elements to have a value of -1 */ for (i = 0; i < num_elements; i++) @@ -441,7 +441,7 @@ test_page_buffer_access(void) api_ctx_pushed = FALSE; } - HDfree(data); + free(data); data = NULL; MPI_Barrier(MPI_COMM_WORLD); } @@ -515,8 +515,8 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str num_elements = block[0] * block[1]; /* allocate memory for data buffer */ - data_array = (DATATYPE *)HDmalloc(num_elements * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(num_elements * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* put some trivial data in the data_array */ for (i = 0; i < num_elements; i++) data_array[i] = mpi_rank + 1; @@ -598,7 +598,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str } MPI_Barrier(MPI_COMM_WORLD); - HDfree(data_array); + free(data_array); return 0; } /* create_file */ @@ -674,8 +674,8 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, hsize_t num_elements = block[0] * block[1]; /* allocate memory for data buffer */ - data_array = (DATATYPE *)HDmalloc(num_elements * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(num_elements * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple(1, &num_elements, NULL); @@ -761,7 +761,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, hsize_t api_ctx_pushed = FALSE; } - HDfree(data_array); + free(data_array); return nerrors; } diff --git a/testpar/API/t_file_image.c b/testpar/API/t_file_image.c index 8edf0654..16cd521 100644 --- a/testpar/API/t_file_image.c +++ b/testpar/API/t_file_image.c @@ -127,7 +127,7 @@ file_image_daisy_chain_test(void) * to -1 everywhere else. */ - vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); + vector_ptr = (int *)malloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory representation of vector"); vector_ptr[0] = 0; @@ -137,7 +137,7 @@ file_image_daisy_chain_test(void) err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); VRFY((err >= 0), "wrote initial data to vector."); - HDfree(vector_ptr); + free(vector_ptr); vector_ptr = NULL; /* 3) Flush the core file, and get an image of it. Close @@ -149,7 +149,7 @@ file_image_daisy_chain_test(void) image_len = H5Fget_file_image(file_id, NULL, (size_t)0); VRFY((image_len > 0), "got image file size"); - image_ptr = (void *)HDmalloc((size_t)image_len); + image_ptr = (void *)malloc((size_t)image_len); VRFY(image_ptr != NULL, "allocated file image buffer."); bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_len); @@ -175,7 +175,7 @@ file_image_daisy_chain_test(void) mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, MPI_BYTE, 1, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), "sent image to process 1"); - HDfree(image_ptr); + free(image_ptr); image_ptr = NULL; image_len = 0; @@ -185,7 +185,7 @@ file_image_daisy_chain_test(void) MPI_COMM_WORLD, &rcvstat); VRFY((mpi_result == MPI_SUCCESS), "received image len from process n-1"); - image_ptr = (void *)HDmalloc((size_t)image_len); + image_ptr = (void *)malloc((size_t)image_len); VRFY(image_ptr != NULL, "allocated file image receive buffer."); mpi_result = @@ -227,7 +227,7 @@ file_image_daisy_chain_test(void) VRFY((space_ndims == 1), "verified data space num dims(2)"); VRFY((dims[0] == (hsize_t)mpi_size), "verified data space dims"); - vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); + vector_ptr = (int *)malloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); @@ -239,7 +239,7 @@ file_image_daisy_chain_test(void) vector_ok = FALSE; VRFY((vector_ok), "verified received vector."); - HDfree(vector_ptr); + free(vector_ptr); vector_ptr = NULL; /* 7) closes the core file and exit. */ @@ -256,7 +256,7 @@ file_image_daisy_chain_test(void) err = H5Pclose(fapl_id); VRFY((err >= 0), "closed fapl(1)."); - HDfree(image_ptr); + free(image_ptr); image_ptr = NULL; image_len = 0; } @@ -267,7 +267,7 @@ file_image_daisy_chain_test(void) MPI_COMM_WORLD, &rcvstat); VRFY((mpi_result == MPI_SUCCESS), "received image size from process mpi_rank-1"); - image_ptr = (void *)HDmalloc((size_t)image_len); + image_ptr = (void *)malloc((size_t)image_len); VRFY(image_ptr != NULL, "allocated file image receive buffer."); mpi_result = @@ -310,7 +310,7 @@ file_image_daisy_chain_test(void) VRFY((space_ndims == 1), "verified data space num dims(2)"); VRFY((dims[0] == (hsize_t)mpi_size), "verified data space dims"); - vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); + vector_ptr = (int *)malloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); @@ -336,7 +336,7 @@ file_image_daisy_chain_test(void) err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); VRFY((err >= 0), "wrote modified data to vector."); - HDfree(vector_ptr); + free(vector_ptr); vector_ptr = NULL; /* 4) Flush the core file and send it to process (mpi_rank + 1) % n. */ @@ -347,7 +347,7 @@ file_image_daisy_chain_test(void) image_len = H5Fget_file_image(file_id, NULL, (size_t)0); VRFY((image_len > 0), "got (possibly modified) image file len"); - image_ptr = (void *)HDrealloc((void *)image_ptr, (size_t)image_len); + image_ptr = (void *)realloc((void *)image_ptr, (size_t)image_len); VRFY(image_ptr != NULL, "re-allocated file image buffer."); bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_len); @@ -361,7 +361,7 @@ file_image_daisy_chain_test(void) MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), "sent image to process (mpi_rank + 1) % mpi_size"); - HDfree(image_ptr); + free(image_ptr); image_ptr = NULL; image_len = 0; diff --git a/testpar/API/t_filter_read.c b/testpar/API/t_filter_read.c index 0ea7040..4b62e55 100644 --- a/testpar/API/t_filter_read.c +++ b/testpar/API/t_filter_read.c @@ -129,11 +129,11 @@ filter_read_internal(const char *filename, hid_t dcpl, hsize_t *dset_size) VRFY(sid >= 0, "H5Screate_simple"); /* Create buffers */ - points = (int *)HDmalloc(size[0] * size[1] * sizeof(int)); - VRFY(points != NULL, "HDmalloc"); + points = (int *)malloc(size[0] * size[1] * sizeof(int)); + VRFY(points != NULL, "malloc"); - check = (int *)HDmalloc(hs_size[0] * hs_size[1] * sizeof(int)); - VRFY(check != NULL, "HDmalloc"); + check = (int *)malloc(hs_size[0] * hs_size[1] * sizeof(int)); + VRFY(check != NULL, "malloc"); /* Initialize writing buffer with random data */ for (i = 0; i < size[0]; i++) @@ -227,8 +227,8 @@ filter_read_internal(const char *filename, hid_t dcpl, hsize_t *dset_size) hrc = H5Fclose(file); VRFY(hrc >= 0, "H5Fclose"); - HDfree(points); - HDfree(check); + free(points); + free(check); MPI_Barrier(MPI_COMM_WORLD); } diff --git a/testpar/API/t_mdset.c b/testpar/API/t_mdset.c index ccca9d2..e0e1c07 100644 --- a/testpar/API/t_mdset.c +++ b/testpar/API/t_mdset.c @@ -185,8 +185,8 @@ multiple_dset_write(void) return; } - outme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); - VRFY((outme != NULL), "HDmalloc succeeded for outme"); + outme = malloc((size_t)size * (size_t)size * sizeof(double)); + VRFY((outme != NULL), "malloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); VRFY((plist >= 0), "create_faccess_plist succeeded"); @@ -236,7 +236,7 @@ multiple_dset_write(void) H5Pclose(dcpl); H5Fclose(iof); - HDfree(outme); + free(outme); } /* Example of using PHDF5 to create, write, and read compact dataset. @@ -275,11 +275,11 @@ compact_dataset(void) return; } - outme = HDmalloc((size_t)((size_t)size * (size_t)size * sizeof(double))); - VRFY((outme != NULL), "HDmalloc succeeded for outme"); + outme = malloc((size_t)((size_t)size * (size_t)size * sizeof(double))); + VRFY((outme != NULL), "malloc succeeded for outme"); - inme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); - VRFY((outme != NULL), "HDmalloc succeeded for inme"); + inme = malloc((size_t)size * (size_t)size * sizeof(double)); + VRFY((outme != NULL), "malloc succeeded for inme"); filename = PARATESTFILE /* GetTestParameters() */; VRFY((mpi_size <= size), "mpi_size <= size"); @@ -373,8 +373,8 @@ compact_dataset(void) H5Pclose(dxpl); H5Dclose(dataset); H5Fclose(iof); - HDfree(inme); - HDfree(outme); + free(inme); + free(outme); } /* @@ -683,10 +683,10 @@ dataset_fillvalue(void) dset_size = dset_dims[0] * dset_dims[1] * dset_dims[2] * dset_dims[3]; /* Allocate space for the buffers */ - rdata = HDmalloc((size_t)(dset_size * sizeof(int))); - VRFY((rdata != NULL), "HDcalloc succeeded for read buffer"); - wdata = HDmalloc((size_t)(dset_size * sizeof(int))); - VRFY((wdata != NULL), "HDmalloc succeeded for write buffer"); + rdata = malloc((size_t)(dset_size * sizeof(int))); + VRFY((rdata != NULL), "calloc succeeded for read buffer"); + wdata = malloc((size_t)(dset_size * sizeof(int))); + VRFY((wdata != NULL), "malloc succeeded for write buffer"); fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); VRFY((fapl >= 0), "create_faccess_plist succeeded"); @@ -885,8 +885,8 @@ dataset_fillvalue(void) VRFY((ret >= 0), "H5Pclose succeeded"); /* free the buffers */ - HDfree(rdata); - HDfree(wdata); + free(rdata); + free(wdata); } /* combined cngrpw and ingrpr tests because ingrpr reads file created by cngrpw. */ @@ -945,8 +945,8 @@ collective_group_write(void) chunk_size[0] = (hsize_t)(size / 2); chunk_size[1] = (hsize_t)(size / 2); - outme = HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((outme != NULL), "HDmalloc succeeded for outme"); + outme = malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((outme != NULL), "malloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); @@ -1011,7 +1011,7 @@ collective_group_write(void) ret1 = H5Fclose(fid); VRFY((ret1 == 0), "H5Fclose"); - HDfree(outme); + free(outme); } /* Let two sets of processes open and read different groups and chunked @@ -1086,11 +1086,11 @@ group_dataset_read(hid_t fid, int mpi_rank, int m) size = get_size(); - indata = (DATATYPE *)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((indata != NULL), "HDmalloc succeeded for indata"); + indata = (DATATYPE *)malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((indata != NULL), "malloc succeeded for indata"); - outdata = (DATATYPE *)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); + outdata = (DATATYPE *)malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((outdata != NULL), "malloc succeeded for outdata"); /* open every group under root group. */ HDsnprintf(gname, sizeof(gname), "group%d", m); @@ -1118,8 +1118,8 @@ group_dataset_read(hid_t fid, int mpi_rank, int m) ret = H5Gclose(gid); VRFY((ret == 0), "H5Gclose"); - HDfree(indata); - HDfree(outdata); + free(indata); + free(outdata); } /* @@ -1263,8 +1263,8 @@ write_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - outme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); - VRFY((outme != NULL), "HDmalloc succeeded for outme"); + outme = malloc((size_t)size * (size_t)size * sizeof(double)); + VRFY((outme != NULL), "malloc succeeded for outme"); for (n = 0; n < NDATASET; n++) { HDsnprintf(dname, sizeof(dname), "dataset%d", n); @@ -1282,7 +1282,7 @@ write_dataset(hid_t memspace, hid_t filespace, hid_t gid) H5Dclose(did); } - HDfree(outme); + free(outme); } /* @@ -1426,11 +1426,11 @@ read_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - indata = (DATATYPE *)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((indata != NULL), "HDmalloc succeeded for indata"); + indata = (DATATYPE *)malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((indata != NULL), "malloc succeeded for indata"); - outdata = (DATATYPE *)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); + outdata = (DATATYPE *)malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((outdata != NULL), "malloc succeeded for outdata"); for (n = 0; n < NDATASET; n++) { HDsnprintf(dname, sizeof(dname), "dataset%d", n); @@ -1457,8 +1457,8 @@ read_dataset(hid_t memspace, hid_t filespace, hid_t gid) H5Dclose(did); } - HDfree(indata); - HDfree(outdata); + free(indata); + free(outdata); return vrfy_errors; } diff --git a/testpar/API/t_prop.c b/testpar/API/t_prop.c index 3065404..9c91906 100644 --- a/testpar/API/t_prop.c +++ b/testpar/API/t_prop.c @@ -39,7 +39,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) ret = H5Pencode2(orig_pl, NULL, &buf_size, H5P_DEFAULT); VRFY((ret >= 0), "H5Pencode succeeded"); - sbuf = (uint8_t *)HDmalloc(buf_size); + sbuf = (uint8_t *)malloc(buf_size); ret = H5Pencode2(orig_pl, sbuf, &buf_size, H5P_DEFAULT); VRFY((ret >= 0), "H5Pencode succeeded"); @@ -58,7 +58,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) MPI_Recv(&recv_size, 1, MPI_INT, 0, 123, MPI_COMM_WORLD, &status); VRFY((recv_size >= 0), "MPI_Recv succeeded"); buf_size = (size_t)recv_size; - rbuf = (uint8_t *)HDmalloc(buf_size); + rbuf = (uint8_t *)malloc(buf_size); MPI_Recv(rbuf, recv_size, MPI_BYTE, 0, 124, MPI_COMM_WORLD, &status); pl = H5Pdecode(rbuf); @@ -70,7 +70,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) VRFY((ret >= 0), "H5Pclose succeeded"); if (NULL != rbuf) - HDfree(rbuf); + free(rbuf); } /* end if */ if (0 == mpi_rank) { @@ -85,7 +85,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) } if (NULL != sbuf) - HDfree(sbuf); + free(sbuf); MPI_Barrier(MPI_COMM_WORLD); return 0; diff --git a/testpar/API/t_pshutdown.c b/testpar/API/t_pshutdown.c index 269e6dd..e1f9189 100644 --- a/testpar/API/t_pshutdown.c +++ b/testpar/API/t_pshutdown.c @@ -99,8 +99,8 @@ main(int argc, char **argv) VRFY((dset_id >= 0), "H5Dcreate succeeded"); /* allocate memory for data buffer */ - data_array = (DATATYPE *)HDmalloc(dims[0] * dims[1] * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(dims[0] * dims[1] * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* Each process takes a slabs of rows. */ block[0] = dims[0] / (hsize_t)mpi_size; @@ -129,7 +129,7 @@ main(int argc, char **argv) /* release data buffers */ if (data_array) - HDfree(data_array); + free(data_array); MPI_Finalize(); diff --git a/testpar/API/t_shapesame.c b/testpar/API/t_shapesame.c index cb323e0..40e2aae 100644 --- a/testpar/API/t_shapesame.c +++ b/testpar/API/t_shapesame.c @@ -209,28 +209,28 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker tv_ptr->block_ptr = &(tv_ptr->block[PAR_SS_DR_MAX_RANK - tv_ptr->large_rank]); /* Allocate buffers */ - tv_ptr->small_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); + tv_ptr->small_ds_buf_0 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->small_ds_size); VRFY((tv_ptr->small_ds_buf_0 != NULL), "malloc of small_ds_buf_0 succeeded"); - tv_ptr->small_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); + tv_ptr->small_ds_buf_1 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->small_ds_size); VRFY((tv_ptr->small_ds_buf_1 != NULL), "malloc of small_ds_buf_1 succeeded"); - tv_ptr->small_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); + tv_ptr->small_ds_buf_2 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->small_ds_size); VRFY((tv_ptr->small_ds_buf_2 != NULL), "malloc of small_ds_buf_2 succeeded"); - tv_ptr->small_ds_slice_buf = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_slice_size); + tv_ptr->small_ds_slice_buf = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->small_ds_slice_size); VRFY((tv_ptr->small_ds_slice_buf != NULL), "malloc of small_ds_slice_buf succeeded"); - tv_ptr->large_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); + tv_ptr->large_ds_buf_0 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->large_ds_size); VRFY((tv_ptr->large_ds_buf_0 != NULL), "malloc of large_ds_buf_0 succeeded"); - tv_ptr->large_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); + tv_ptr->large_ds_buf_1 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->large_ds_size); VRFY((tv_ptr->large_ds_buf_1 != NULL), "malloc of large_ds_buf_1 succeeded"); - tv_ptr->large_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); + tv_ptr->large_ds_buf_2 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->large_ds_size); VRFY((tv_ptr->large_ds_buf_2 != NULL), "malloc of large_ds_buf_2 succeeded"); - tv_ptr->large_ds_slice_buf = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_slice_size); + tv_ptr->large_ds_slice_buf = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->large_ds_slice_size); VRFY((tv_ptr->large_ds_slice_buf != NULL), "malloc of large_ds_slice_buf succeeded"); /* initialize the buffers */ @@ -657,22 +657,22 @@ hs_dr_pio_test__takedown(struct hs_dr_pio_test_vars_t *tv_ptr) /* Free memory buffers */ if (tv_ptr->small_ds_buf_0 != NULL) - HDfree(tv_ptr->small_ds_buf_0); + free(tv_ptr->small_ds_buf_0); if (tv_ptr->small_ds_buf_1 != NULL) - HDfree(tv_ptr->small_ds_buf_1); + free(tv_ptr->small_ds_buf_1); if (tv_ptr->small_ds_buf_2 != NULL) - HDfree(tv_ptr->small_ds_buf_2); + free(tv_ptr->small_ds_buf_2); if (tv_ptr->small_ds_slice_buf != NULL) - HDfree(tv_ptr->small_ds_slice_buf); + free(tv_ptr->small_ds_slice_buf); if (tv_ptr->large_ds_buf_0 != NULL) - HDfree(tv_ptr->large_ds_buf_0); + free(tv_ptr->large_ds_buf_0); if (tv_ptr->large_ds_buf_1 != NULL) - HDfree(tv_ptr->large_ds_buf_1); + free(tv_ptr->large_ds_buf_1); if (tv_ptr->large_ds_buf_2 != NULL) - HDfree(tv_ptr->large_ds_buf_2); + free(tv_ptr->large_ds_buf_2); if (tv_ptr->large_ds_slice_buf != NULL) - HDfree(tv_ptr->large_ds_slice_buf); + free(tv_ptr->large_ds_slice_buf); return; @@ -4364,7 +4364,7 @@ main(int argc, char **argv) #if 0 HDmemset(filenames, 0, sizeof(filenames)); for (int i = 0; i < NFILENAME; i++) { - if (NULL == (filenames[i] = HDmalloc(PATH_MAX))) { + if (NULL == (filenames[i] = malloc(PATH_MAX))) { printf("couldn't allocate filename array\n"); MPI_Abort(MPI_COMM_WORLD, -1); } @@ -4495,7 +4495,7 @@ main(int argc, char **argv) #if 0 for (int i = 0; i < NFILENAME; i++) { - HDfree(filenames[i]); + free(filenames[i]); filenames[i] = NULL; } #endif diff --git a/testpar/API/t_span_tree.c b/testpar/API/t_span_tree.c index d806e12..f8a7edb 100644 --- a/testpar/API/t_span_tree.c +++ b/testpar/API/t_span_tree.c @@ -337,9 +337,9 @@ coll_write_test(int chunk_factor) fsdim[0] = FSPACE_DIM1; fsdim[1] = (hsize_t)(FSPACE_DIM2 * mpi_size); - vector = (int *)HDmalloc(sizeof(int) * (size_t)mdim1[0] * (size_t)mpi_size); - matrix_out = (int *)HDmalloc(sizeof(int) * (size_t)mdim[0] * (size_t)mdim[1] * (size_t)mpi_size); - matrix_out1 = (int *)HDmalloc(sizeof(int) * (size_t)mdim[0] * (size_t)mdim[1] * (size_t)mpi_size); + vector = (int *)malloc(sizeof(int) * (size_t)mdim1[0] * (size_t)mpi_size); + matrix_out = (int *)malloc(sizeof(int) * (size_t)mdim[0] * (size_t)mdim[1] * (size_t)mpi_size); + matrix_out1 = (int *)malloc(sizeof(int) * (size_t)mdim[0] * (size_t)mdim[1] * (size_t)mpi_size); HDmemset(vector, 0, sizeof(int) * (size_t)mdim1[0] * (size_t)mpi_size); vector[0] = vector[MSPACE1_DIM * mpi_size - 1] = -1; @@ -718,11 +718,11 @@ coll_write_test(int chunk_factor) VRFY((ret >= 0), ""); if (vector) - HDfree(vector); + free(vector); if (matrix_out) - HDfree(matrix_out); + free(matrix_out); if (matrix_out1) - HDfree(matrix_out1); + free(matrix_out1); return; } @@ -784,8 +784,8 @@ coll_read_test(void) mdim[0] = MSPACE_DIM1; mdim[1] = (hsize_t)(MSPACE_DIM2 * mpi_size); - matrix_out = (int *)HDmalloc(sizeof(int) * (size_t)MSPACE_DIM1 * (size_t)MSPACE_DIM2 * (size_t)mpi_size); - matrix_out1 = (int *)HDmalloc(sizeof(int) * (size_t)MSPACE_DIM1 * (size_t)MSPACE_DIM2 * (size_t)mpi_size); + matrix_out = (int *)malloc(sizeof(int) * (size_t)MSPACE_DIM1 * (size_t)MSPACE_DIM2 * (size_t)mpi_size); + matrix_out1 = (int *)malloc(sizeof(int) * (size_t)MSPACE_DIM1 * (size_t)MSPACE_DIM2 * (size_t)mpi_size); /*** For testing collective hyperslab selection read ***/ @@ -945,8 +945,8 @@ coll_read_test(void) /* * Free read buffers. */ - HDfree(matrix_out); - HDfree(matrix_out1); + free(matrix_out); + free(matrix_out1); /* * Close memory file and memory dataspaces. @@ -1625,16 +1625,16 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ /* Allocate buffers */ - small_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); + small_ds_buf_0 = (uint32_t *)malloc(sizeof(uint32_t) * small_ds_size); VRFY((small_ds_buf_0 != NULL), "malloc of small_ds_buf_0 succeeded"); - small_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); + small_ds_buf_1 = (uint32_t *)malloc(sizeof(uint32_t) * small_ds_size); VRFY((small_ds_buf_1 != NULL), "malloc of small_ds_buf_1 succeeded"); - large_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); + large_ds_buf_0 = (uint32_t *)malloc(sizeof(uint32_t) * large_ds_size); VRFY((large_ds_buf_0 != NULL), "malloc of large_ds_buf_0 succeeded"); - large_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); + large_ds_buf_1 = (uint32_t *)malloc(sizeof(uint32_t) * large_ds_size); VRFY((large_ds_buf_1 != NULL), "malloc of large_ds_buf_1 succeeded"); /* initialize the buffers */ @@ -2352,14 +2352,14 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ /* Free memory buffers */ if (small_ds_buf_0 != NULL) - HDfree(small_ds_buf_0); + free(small_ds_buf_0); if (small_ds_buf_1 != NULL) - HDfree(small_ds_buf_1); + free(small_ds_buf_1); if (large_ds_buf_0 != NULL) - HDfree(large_ds_buf_0); + free(large_ds_buf_0); if (large_ds_buf_1 != NULL) - HDfree(large_ds_buf_1); + free(large_ds_buf_1); return; diff --git a/testpar/API/testphdf5.c b/testpar/API/testphdf5.c index 6d34e1d..b02d0a3 100644 --- a/testpar/API/testphdf5.c +++ b/testpar/API/testphdf5.c @@ -353,7 +353,7 @@ main(int argc, char **argv) #if 0 HDmemset(filenames, 0, sizeof(filenames)); for (int i = 0; i < NFILENAME; i++) { - if (NULL == (filenames[i] = HDmalloc(PATH_MAX))) { + if (NULL == (filenames[i] = malloc(PATH_MAX))) { printf("couldn't allocate filename array\n"); MPI_Abort(MPI_COMM_WORLD, -1); } @@ -987,7 +987,7 @@ main(int argc, char **argv) #if 0 for (int i = 0; i < NFILENAME; i++) { - HDfree(filenames[i]); + free(filenames[i]); filenames[i] = NULL; } #endif diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index d3422e0..c9faa09 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -641,8 +641,8 @@ MpioTest2G(MPI_Comm comm) hsize_t); data_size = slice_per_process * shape[1] * shape[2]; data_size_bytes = sizeof(int) * data_size; - data = HDmalloc(data_size_bytes); - VRFY((data != NULL), "data HDmalloc succeeded"); + data = malloc(data_size_bytes); + VRFY((data != NULL), "data malloc succeeded"); for (size_t i = 0; i < data_size; i++) { data[i] = mpi_rank; @@ -738,8 +738,8 @@ dataset_writeInd(void) /* allocate memory for data buffer */ data_size = sizeof(DATATYPE); data_size *= (hsize_t)dim0 * (hsize_t)dim1; - data_array1 = (DATATYPE *)HDmalloc(data_size); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc(data_size); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ---------------------------------------- * CREATE AN HDF5 FILE WITH PARALLEL ACCESS @@ -841,7 +841,7 @@ dataset_writeInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); } /* Example of using the parallel HDF5 library to read a dataset */ @@ -876,10 +876,10 @@ dataset_readInd(void) MPI_Comm_rank(test_comm, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* setup file access template */ acc_tpl = create_faccess_plist(comm, info, facc_type); @@ -949,9 +949,9 @@ dataset_readInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -1010,12 +1010,12 @@ dataset_writeAll(void) /* set up the coords array selection */ num_points = (size_t)dim1; - coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)MAX_RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)dim1 * (size_t)MAX_RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -1326,7 +1326,7 @@ dataset_writeAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); block[0] = 1; @@ -1475,9 +1475,9 @@ dataset_writeAll(void) /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); } /* @@ -1526,14 +1526,14 @@ dataset_readAll(void) /* set up the coords array selection */ num_points = (size_t)dim1; - coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * MAX_RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)dim0 * (size_t)dim1 * MAX_RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -1709,9 +1709,9 @@ dataset_readAll(void) free(data_array1); if (data_origin1) free(data_origin1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); block[0] = 1; @@ -1770,7 +1770,7 @@ dataset_readAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset6: point selection in File - Point selection in Memory*/ @@ -1816,7 +1816,7 @@ dataset_readAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset7: point selection in memory - All selection in file*/ @@ -1884,11 +1884,11 @@ dataset_readAll(void) /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -1943,8 +1943,8 @@ extend_writeInd(void) chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -2116,7 +2116,7 @@ extend_writeInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); } /* @@ -2317,12 +2317,12 @@ extend_readInd(void) MPI_Comm_rank(test_comm, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array2 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array2 != NULL), "data_array2 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -2443,11 +2443,11 @@ extend_readInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_array2) - HDfree(data_array2); + free(data_array2); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -2503,8 +2503,8 @@ extend_writeAll(void) chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -2699,7 +2699,7 @@ extend_writeAll(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); } /* Example of using the parallel HDF5 library to read an extendible dataset */ @@ -2737,12 +2737,12 @@ extend_readAll(void) MPI_Comm_rank(test_comm, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array2 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array2 != NULL), "data_array2 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -2885,11 +2885,11 @@ extend_readAll(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_array2) - HDfree(data_array2); + free(data_array2); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -2928,10 +2928,10 @@ compress_readAll(void) MPI_Comm_rank(comm, &mpi_rank); /* Allocate data buffer */ - data_orig = (DATATYPE *)HDmalloc((size_t)dim * sizeof(DATATYPE)); - VRFY((data_orig != NULL), "data_origin1 HDmalloc succeeded"); - data_read = (DATATYPE *)HDmalloc((size_t)dim * sizeof(DATATYPE)); - VRFY((data_read != NULL), "data_array1 HDmalloc succeeded"); + data_orig = (DATATYPE *)malloc((size_t)dim * sizeof(DATATYPE)); + VRFY((data_orig != NULL), "data_origin1 malloc succeeded"); + data_read = (DATATYPE *)malloc((size_t)dim * sizeof(DATATYPE)); + VRFY((data_read != NULL), "data_array1 malloc succeeded"); /* Initialize data buffers */ for (u = 0; u < dim; u++) @@ -3064,9 +3064,9 @@ compress_readAll(void) /* release data buffers */ if (data_read) - HDfree(data_read); + free(data_read); if (data_orig) - HDfree(data_orig); + free(data_orig); } #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -3177,11 +3177,11 @@ none_selection_chunk(void) /* allocate memory for data buffer. Only allocate enough buffer for * each processor's data. */ if (mpi_rank) { - data_origin = (DATATYPE *)HDmalloc(block[0] * block[1] * sizeof(DATATYPE)); - VRFY((data_origin != NULL), "data_origin HDmalloc succeeded"); + data_origin = (DATATYPE *)malloc(block[0] * block[1] * sizeof(DATATYPE)); + VRFY((data_origin != NULL), "data_origin malloc succeeded"); - data_array = (DATATYPE *)HDmalloc(block[0] * block[1] * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(block[0] * block[1] * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* put some trivial data in the data_array */ mstart[0] = mstart[1] = 0; @@ -3276,9 +3276,9 @@ none_selection_chunk(void) /* release data buffers */ if (data_origin) - HDfree(data_origin); + free(data_origin); if (data_array) - HDfree(data_array); + free(data_array); } /* Function: test_actual_io_mode @@ -3625,8 +3625,8 @@ test_actual_io_mode(int selection_mode) length = dim0 * dim1; /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); - VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); + buffer = (int *)malloc(sizeof(int) * (size_t)length); + VRFY((buffer != NULL), "malloc of buffer succeeded"); for (i = 0; i < length; i++) buffer[i] = i; @@ -3767,7 +3767,7 @@ test_actual_io_mode(int selection_mode) ret = H5Sclose(mem_space); ret = H5Sclose(file_space); ret = H5Fclose(fid); - HDfree(buffer); + free(buffer); return; } @@ -4063,8 +4063,8 @@ test_no_collective_cause_mode(int selection_mode) H5_CHECKED_ASSIGN(length, int, dims[0] * dims[1], hsize_t); /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); - VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); + buffer = (int *)malloc(sizeof(int) * (size_t)length); + VRFY((buffer != NULL), "malloc of buffer succeeded"); for (i = 0; i < length; i++) buffer[i] = i; @@ -4178,7 +4178,7 @@ test_no_collective_cause_mode(int selection_mode) H5Sclose(file_space); if (fid) H5Fclose(fid); - HDfree(buffer); + free(buffer); /* clean up external file */ if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL) @@ -4272,11 +4272,11 @@ dataset_atomicity(void) buf_size = dim0 * dim1; /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); + write_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf calloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); + read_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf calloc succeeded"); /* setup file access template */ acc_tpl = create_faccess_plist(comm, info, facc_type); @@ -4422,20 +4422,20 @@ dataset_atomicity(void) /* release data buffers */ if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); /* open dataset2 (non-contiguous case) */ dataset2 = H5Dopen2(fid, DATASETNAME6, H5P_DEFAULT); VRFY((dataset2 >= 0), "H5Dopen2 succeeded"); /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); + write_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf calloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); + read_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf calloc succeeded"); for (i = 0; i < buf_size; i++) { write_buf[i] = 5; @@ -4549,9 +4549,9 @@ dataset_atomicity(void) /* release data buffers */ if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); @@ -4659,7 +4659,7 @@ main(int argc, char **argv) HDmemset(filenames, 0, sizeof(filenames)); for (int i = 0; i < NFILENAME; i++) { - if (NULL == (filenames[i] = HDmalloc(PATH_MAX))) { + if (NULL == (filenames[i] = malloc(PATH_MAX))) { printf("couldn't allocate filename array\n"); MPI_Abort(MPI_COMM_WORLD, -1); } @@ -4730,7 +4730,7 @@ main(int argc, char **argv) HDremove(FILENAME[0]); for (int i = 0; i < NFILENAME; i++) { - HDfree(filenames[i]); + free(filenames[i]); filenames[i] = NULL; } diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 1130e5d..6c1161d 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -474,7 +474,7 @@ dataset_big_write(void) B_DATATYPE *wdata; /* allocate memory for data buffer */ - wdata = (B_DATATYPE *)HDmalloc(bigcount * sizeof(B_DATATYPE)); + wdata = (B_DATATYPE *)malloc(bigcount * sizeof(B_DATATYPE)); VRFY_G((wdata != NULL), "wdata malloc succeeded"); /* setup file access template */ @@ -697,7 +697,7 @@ dataset_big_write(void) num_points = bigcount; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords(start, count, stride, block, num_points, coords, IN_ORDER); @@ -746,7 +746,7 @@ dataset_big_write(void) ret = H5Dclose(dataset); VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - HDfree(wdata); + free(wdata); H5Fclose(fid); } @@ -779,9 +779,9 @@ dataset_big_read(void) herr_t ret; /* Generic return value */ /* allocate memory for data buffer */ - rdata = (B_DATATYPE *)HDmalloc(bigcount * sizeof(B_DATATYPE)); + rdata = (B_DATATYPE *)malloc(bigcount * sizeof(B_DATATYPE)); VRFY_G((rdata != NULL), "rdata malloc succeeded"); - wdata = (B_DATATYPE *)HDmalloc(bigcount * sizeof(B_DATATYPE)); + wdata = (B_DATATYPE *)malloc(bigcount * sizeof(B_DATATYPE)); VRFY_G((wdata != NULL), "wdata malloc succeeded"); HDmemset(rdata, 0, bigcount * sizeof(B_DATATYPE)); @@ -1017,7 +1017,7 @@ dataset_big_read(void) num_points = bigcount; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords(start, count, stride, block, num_points, coords, IN_ORDER); @@ -1028,7 +1028,7 @@ dataset_big_read(void) VRFY_G((ret >= 0), "H5Sselect_elements succeeded"); if (coords) - HDfree(coords); + free(coords); /* create a memory dataspace */ /* Warning: H5Screate_simple requires an array of hsize_t elements @@ -1065,8 +1065,8 @@ dataset_big_read(void) ret = H5Dclose(dataset); VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - HDfree(wdata); - HDfree(rdata); + free(wdata); + free(rdata); wdata = NULL; rdata = NULL; @@ -1093,9 +1093,9 @@ dataset_big_read(void) /* release data buffers */ if (rdata) - HDfree(rdata); + free(rdata); if (wdata) - HDfree(wdata); + free(wdata); } /* dataset_large_readAll */ @@ -1443,7 +1443,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap dims[1] = space_dim2; /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ @@ -1451,7 +1451,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* set up the coords array selection */ num_points = block[0] * block[1] * count[0] * count[1]; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY_G((coords != NULL), "coords malloc succeeded"); point_set(start, count, stride, block, num_points, coords, mode); @@ -1710,16 +1710,16 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap VRFY_G((status >= 0), ""); if (data_array1) - HDfree(data_array1); + free(data_array1); /* Use collective read to verify the correctness of collective write. */ /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* allocate memory for data buffer */ - data_origin1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_origin1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY_G((data_origin1 != NULL), "data_origin1 malloc succeeded"); acc_plist = create_faccess_plist(comm, info, facc_type); @@ -1842,11 +1842,11 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } int diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 63e086c..1de9b56 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -6853,18 +6853,18 @@ main(int argc, char **argv) goto finish; } - if (NULL == (data = HDmalloc(NUM_DATA_ENTRIES * sizeof(*data)))) { + if (NULL == (data = malloc(NUM_DATA_ENTRIES * sizeof(*data)))) { printf(" Couldn't allocate data array. Exiting.\n"); MPI_Abort(MPI_COMM_WORLD, -1); } - if (NULL == (data_index = HDmalloc(NUM_DATA_ENTRIES * sizeof(*data_index)))) { + if (NULL == (data_index = malloc(NUM_DATA_ENTRIES * sizeof(*data_index)))) { printf(" Couldn't allocate data index array. Exiting.\n"); MPI_Abort(MPI_COMM_WORLD, -1); } HDmemset(filenames, 0, sizeof(filenames)); for (int i = 0; i < NFILENAME; i++) { - if (NULL == (filenames[i] = HDmalloc(PATH_MAX))) { + if (NULL == (filenames[i] = malloc(PATH_MAX))) { printf("couldn't allocate filename array\n"); MPI_Abort(MPI_COMM_WORLD, -1); } @@ -6986,9 +6986,9 @@ main(int argc, char **argv) finish: if (data_index) - HDfree(data_index); + free(data_index); if (data) - HDfree(data); + free(data); /* make sure all processes are finished before final report, cleanup * and exit. diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 1a483f4..3a59c6f 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -600,7 +600,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap dims[1] = SPACE_DIM2; /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ @@ -608,7 +608,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* set up the coords array selection */ num_points = block[0] * block[1] * count[0] * count[1]; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); point_set(start, count, stride, block, num_points, coords, mode); @@ -869,16 +869,16 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap VRFY((status >= 0), ""); if (data_array1) - HDfree(data_array1); + free(data_array1); /* Use collective read to verify the correctness of collective write. */ /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* allocate memory for data buffer */ - data_origin1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_origin1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); acc_plist = create_faccess_plist(comm, info, facc_type); @@ -997,11 +997,11 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* Set up the selection */ diff --git a/testpar/t_coll_md.c b/testpar/t_coll_md.c index aa72486..2ff6f77 100644 --- a/testpar/t_coll_md.c +++ b/testpar/t_coll_md.c @@ -99,7 +99,7 @@ test_partial_no_selection_coll_md_read(void) file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); VRFY((file_id >= 0), "H5Fcreate succeeded"); - dataset_dims = HDmalloc(PARTIAL_NO_SELECTION_DATASET_NDIMS * sizeof(*dataset_dims)); + dataset_dims = malloc(PARTIAL_NO_SELECTION_DATASET_NDIMS * sizeof(*dataset_dims)); VRFY((dataset_dims != NULL), "malloc succeeded"); dataset_dims[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_size; @@ -145,8 +145,8 @@ test_partial_no_selection_coll_md_read(void) mspace_id = H5Screate_simple(1, sel_dims, NULL); VRFY((mspace_id >= 0), "H5Screate_simple succeeded"); - data = HDcalloc(1, count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * - sizeof(int)); + data = calloc(1, count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * + sizeof(int)); VRFY((data != NULL), "calloc succeeded"); dxpl_id = H5Pcreate(H5P_DATASET_XFER); @@ -169,8 +169,8 @@ test_partial_no_selection_coll_md_read(void) VRFY((H5Pset_dxpl_mpio_chunk_opt(dxpl_id, H5FD_MPIO_CHUNK_ONE_IO) >= 0), "H5Pset_dxpl_mpio_chunk_opt succeeded"); - read_buf = HDmalloc(count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * - sizeof(int)); + read_buf = malloc(count[1] * (PARTIAL_NO_SELECTION_Y_DIM_SCALE * PARTIAL_NO_SELECTION_X_DIM_SCALE) * + sizeof(int)); VRFY((read_buf != NULL), "malloc succeeded"); /* @@ -198,17 +198,17 @@ test_partial_no_selection_coll_md_read(void) } if (dataset_dims) { - HDfree(dataset_dims); + free(dataset_dims); dataset_dims = NULL; } if (data) { - HDfree(data); + free(data); data = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -319,13 +319,13 @@ test_multi_chunk_io_addrmap_issue(void) VRFY((H5Fflush(file_id, H5F_SCOPE_GLOBAL) >= 0), "H5Fflush succeeded"); - read_buf = HDmalloc(50 * sizeof(int)); + read_buf = malloc(50 * sizeof(int)); VRFY((read_buf != NULL), "malloc succeeded"); VRFY((H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, read_buf) >= 0), "H5Dread succeeded"); if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } @@ -469,7 +469,7 @@ test_link_chunk_io_sort_chunk_issue(void) mspace_id = H5Screate_simple(1, sel_dims, NULL); VRFY((mspace_id >= 0), "H5Screate_simple succeeded"); - data = HDcalloc(1, count[0] * sizeof(int)); + data = calloc(1, count[0] * sizeof(int)); VRFY((data != NULL), "calloc succeeded"); dxpl_id = H5Pcreate(H5P_DATASET_XFER); @@ -492,7 +492,7 @@ test_link_chunk_io_sort_chunk_issue(void) VRFY((H5Pset_dxpl_mpio_chunk_opt(dxpl_id, H5FD_MPIO_CHUNK_ONE_IO) >= 0), "H5Pset_dxpl_mpio_chunk_opt succeeded"); - read_buf = HDmalloc(count[0] * sizeof(int)); + read_buf = malloc(count[0] * sizeof(int)); VRFY((read_buf != NULL), "malloc succeeded"); VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, stride, count, block) >= 0), @@ -512,12 +512,12 @@ test_link_chunk_io_sort_chunk_issue(void) "H5Dread succeeded"); if (data) { - HDfree(data); + free(data); data = NULL; } if (read_buf) { - HDfree(read_buf); + free(read_buf); read_buf = NULL; } diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 9ed753e..81edf17 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -302,8 +302,8 @@ dataset_writeInd(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ---------------------------------------- * CREATE AN HDF5 FILE WITH PARALLEL ACCESS @@ -405,7 +405,7 @@ dataset_writeInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); } /* Example of using the parallel HDF5 library to read a dataset */ @@ -440,10 +440,10 @@ dataset_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* setup file access template */ acc_tpl = create_faccess_plist(comm, info, facc_type); @@ -513,9 +513,9 @@ dataset_readInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -571,12 +571,12 @@ dataset_writeAll(void) /* set up the coords array selection */ num_points = (size_t)dim1; - coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -887,7 +887,7 @@ dataset_writeAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); block[0] = 1; @@ -1036,9 +1036,9 @@ dataset_writeAll(void) /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); } /* @@ -1087,14 +1087,14 @@ dataset_readAll(void) /* set up the coords array selection */ num_points = (size_t)dim1; - coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc((size_t)dim0 * (size_t)dim1 * RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -1270,9 +1270,9 @@ dataset_readAll(void) free(data_array1); if (data_origin1) free(data_origin1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); block[0] = 1; @@ -1331,7 +1331,7 @@ dataset_readAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset6: point selection in File - Point selection in Memory*/ @@ -1377,7 +1377,7 @@ dataset_readAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset7: point selection in memory - All selection in file*/ @@ -1445,11 +1445,11 @@ dataset_readAll(void) /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -1504,8 +1504,8 @@ extend_writeInd(void) chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -1676,7 +1676,7 @@ extend_writeInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); } /* @@ -1878,12 +1878,12 @@ extend_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array2 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array2 != NULL), "data_array2 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -2003,11 +2003,11 @@ extend_readInd(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_array2) - HDfree(data_array2); + free(data_array2); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -2063,8 +2063,8 @@ extend_writeAll(void) chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* ------------------- * START AN HDF5 FILE @@ -2258,7 +2258,7 @@ extend_writeAll(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); } /* Example of using the parallel HDF5 library to read an extendible dataset */ @@ -2296,12 +2296,12 @@ extend_readAll(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); - VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); + data_array1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + data_array2 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_array2 != NULL), "data_array2 malloc succeeded"); + data_origin1 = (DATATYPE *)malloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); + VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* ------------------- * OPEN AN HDF5 FILE @@ -2443,11 +2443,11 @@ extend_readAll(void) /* release data buffers */ if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_array2) - HDfree(data_array2); + free(data_array2); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } /* @@ -2486,10 +2486,10 @@ compress_readAll(void) MPI_Comm_rank(comm, &mpi_rank); /* Allocate data buffer */ - data_orig = (DATATYPE *)HDmalloc((size_t)dim * sizeof(DATATYPE)); - VRFY((data_orig != NULL), "data_origin1 HDmalloc succeeded"); - data_read = (DATATYPE *)HDmalloc((size_t)dim * sizeof(DATATYPE)); - VRFY((data_read != NULL), "data_array1 HDmalloc succeeded"); + data_orig = (DATATYPE *)malloc((size_t)dim * sizeof(DATATYPE)); + VRFY((data_orig != NULL), "data_origin1 malloc succeeded"); + data_read = (DATATYPE *)malloc((size_t)dim * sizeof(DATATYPE)); + VRFY((data_read != NULL), "data_array1 malloc succeeded"); /* Initialize data buffers */ for (u = 0; u < dim; u++) @@ -2622,9 +2622,9 @@ compress_readAll(void) /* release data buffers */ if (data_read) - HDfree(data_read); + free(data_read); if (data_orig) - HDfree(data_orig); + free(data_orig); } #endif /* H5_HAVE_FILTER_DEFLATE */ @@ -2735,11 +2735,11 @@ none_selection_chunk(void) /* allocate memory for data buffer. Only allocate enough buffer for * each processor's data. */ if (mpi_rank) { - data_origin = (DATATYPE *)HDmalloc(block[0] * block[1] * sizeof(DATATYPE)); - VRFY((data_origin != NULL), "data_origin HDmalloc succeeded"); + data_origin = (DATATYPE *)malloc(block[0] * block[1] * sizeof(DATATYPE)); + VRFY((data_origin != NULL), "data_origin malloc succeeded"); - data_array = (DATATYPE *)HDmalloc(block[0] * block[1] * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(block[0] * block[1] * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* put some trivial data in the data_array */ mstart[0] = mstart[1] = 0; @@ -2834,9 +2834,9 @@ none_selection_chunk(void) /* release data buffers */ if (data_origin) - HDfree(data_origin); + free(data_origin); if (data_array) - HDfree(data_array); + free(data_array); } /* Function: test_actual_io_mode @@ -3183,8 +3183,8 @@ test_actual_io_mode(int selection_mode) length = dim0 * dim1; /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); - VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); + buffer = (int *)malloc(sizeof(int) * (size_t)length); + VRFY((buffer != NULL), "malloc of buffer succeeded"); for (i = 0; i < length; i++) buffer[i] = i; @@ -3334,7 +3334,7 @@ test_actual_io_mode(int selection_mode) VRFY((ret >= 0), "H5Sclose succeeded"); ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); - HDfree(buffer); + free(buffer); return; } @@ -3647,8 +3647,8 @@ test_no_collective_cause_mode(int selection_mode) H5_CHECKED_ASSIGN(length, int, dims[0] * dims[1], uint64_t); /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); - VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); + buffer = (int *)malloc(sizeof(int) * (size_t)length); + VRFY((buffer != NULL), "malloc of buffer succeeded"); for (i = 0; i < length; i++) buffer[i] = i; @@ -3767,7 +3767,7 @@ test_no_collective_cause_mode(int selection_mode) H5Sclose(file_space); if (fid) H5Fclose(fid); - HDfree(buffer); + free(buffer); /* clean up external file */ if (selection_mode & TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL) @@ -3861,11 +3861,11 @@ dataset_atomicity(void) buf_size = dim0 * dim1; /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); + write_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf calloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); + read_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf calloc succeeded"); /* setup file access template */ acc_tpl = create_faccess_plist(comm, info, facc_type); @@ -4013,20 +4013,20 @@ dataset_atomicity(void) /* release data buffers */ if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); /* open dataset2 (non-contiguous case) */ dataset2 = H5Dopen2(fid, DATASETNAME6, H5P_DEFAULT); VRFY((dataset2 >= 0), "H5Dopen2 succeeded"); /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); + write_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((write_buf != NULL), "write_buf calloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); + read_buf = (int *)calloc((size_t)buf_size, sizeof(int)); + VRFY((read_buf != NULL), "read_buf calloc succeeded"); for (i = 0; i < buf_size; i++) { write_buf[i] = 5; @@ -4141,9 +4141,9 @@ dataset_atomicity(void) /* release data buffers */ if (write_buf) - HDfree(write_buf); + free(write_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); ret = H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded"); diff --git a/testpar/t_file.c b/testpar/t_file.c index 868af65..3c410dc 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -178,7 +178,7 @@ test_page_buffer_access(void) ret = H5Pset_file_space_page_size(fcpl, sizeof(int) * 100); VRFY((ret == 0), ""); - data = (int *)HDmalloc(sizeof(int) * (size_t)num_elements); + data = (int *)malloc(sizeof(int) * (size_t)num_elements); /* initialize all the elements to have a value of -1 */ for (i = 0; i < num_elements; i++) @@ -427,7 +427,7 @@ test_page_buffer_access(void) api_ctx_pushed = FALSE; } - HDfree(data); + free(data); data = NULL; MPI_Barrier(MPI_COMM_WORLD); } @@ -500,8 +500,8 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str num_elements = block[0] * block[1]; /* allocate memory for data buffer */ - data_array = (DATATYPE *)HDmalloc(num_elements * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(num_elements * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* put some trivial data in the data_array */ for (i = 0; i < num_elements; i++) data_array[i] = mpi_rank + 1; @@ -583,7 +583,7 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str } MPI_Barrier(MPI_COMM_WORLD); - HDfree(data_array); + free(data_array); return 0; } /* create_file */ @@ -658,8 +658,8 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, hsize_t num_elements = block[0] * block[1]; /* allocate memory for data buffer */ - data_array = (DATATYPE *)HDmalloc(num_elements * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(num_elements * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple(1, &num_elements, NULL); @@ -744,7 +744,7 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, hsize_t api_ctx_pushed = FALSE; } - HDfree(data_array); + free(data_array); return nerrors; } diff --git a/testpar/t_file_image.c b/testpar/t_file_image.c index 676978c..471494c 100644 --- a/testpar/t_file_image.c +++ b/testpar/t_file_image.c @@ -112,7 +112,7 @@ file_image_daisy_chain_test(void) * to -1 everywhere else. */ - vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); + vector_ptr = (int *)malloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory representation of vector"); vector_ptr[0] = 0; @@ -122,7 +122,7 @@ file_image_daisy_chain_test(void) err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); VRFY((err >= 0), "wrote initial data to vector."); - HDfree(vector_ptr); + free(vector_ptr); vector_ptr = NULL; /* 3) Flush the core file, and get an image of it. Close @@ -134,7 +134,7 @@ file_image_daisy_chain_test(void) image_len = H5Fget_file_image(file_id, NULL, (size_t)0); VRFY((image_len > 0), "got image file size"); - image_ptr = (void *)HDmalloc((size_t)image_len); + image_ptr = (void *)malloc((size_t)image_len); VRFY(image_ptr != NULL, "allocated file image buffer."); bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_len); @@ -160,7 +160,7 @@ file_image_daisy_chain_test(void) mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, MPI_BYTE, 1, 0, MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), "sent image to process 1"); - HDfree(image_ptr); + free(image_ptr); image_ptr = NULL; image_len = 0; @@ -170,7 +170,7 @@ file_image_daisy_chain_test(void) MPI_COMM_WORLD, &rcvstat); VRFY((mpi_result == MPI_SUCCESS), "received image len from process n-1"); - image_ptr = (void *)HDmalloc((size_t)image_len); + image_ptr = (void *)malloc((size_t)image_len); VRFY(image_ptr != NULL, "allocated file image receive buffer."); mpi_result = @@ -212,7 +212,7 @@ file_image_daisy_chain_test(void) VRFY((space_ndims == 1), "verified data space num dims(2)"); VRFY((dims[0] == (hsize_t)mpi_size), "verified data space dims"); - vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); + vector_ptr = (int *)malloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); @@ -224,7 +224,7 @@ file_image_daisy_chain_test(void) vector_ok = FALSE; VRFY((vector_ok), "verified received vector."); - HDfree(vector_ptr); + free(vector_ptr); vector_ptr = NULL; /* 7) closes the core file and exit. */ @@ -241,7 +241,7 @@ file_image_daisy_chain_test(void) err = H5Pclose(fapl_id); VRFY((err >= 0), "closed fapl(1)."); - HDfree(image_ptr); + free(image_ptr); image_ptr = NULL; image_len = 0; } @@ -252,7 +252,7 @@ file_image_daisy_chain_test(void) MPI_COMM_WORLD, &rcvstat); VRFY((mpi_result == MPI_SUCCESS), "received image size from process mpi_rank-1"); - image_ptr = (void *)HDmalloc((size_t)image_len); + image_ptr = (void *)malloc((size_t)image_len); VRFY(image_ptr != NULL, "allocated file image receive buffer."); mpi_result = @@ -295,7 +295,7 @@ file_image_daisy_chain_test(void) VRFY((space_ndims == 1), "verified data space num dims(2)"); VRFY((dims[0] == (hsize_t)mpi_size), "verified data space dims"); - vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); + vector_ptr = (int *)malloc((size_t)(mpi_size) * sizeof(int)); VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); @@ -321,7 +321,7 @@ file_image_daisy_chain_test(void) err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)vector_ptr); VRFY((err >= 0), "wrote modified data to vector."); - HDfree(vector_ptr); + free(vector_ptr); vector_ptr = NULL; /* 4) Flush the core file and send it to process (mpi_rank + 1) % n. */ @@ -332,7 +332,7 @@ file_image_daisy_chain_test(void) image_len = H5Fget_file_image(file_id, NULL, (size_t)0); VRFY((image_len > 0), "got (possibly modified) image file len"); - image_ptr = (void *)HDrealloc((void *)image_ptr, (size_t)image_len); + image_ptr = (void *)realloc((void *)image_ptr, (size_t)image_len); VRFY(image_ptr != NULL, "re-allocated file image buffer."); bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_len); @@ -346,7 +346,7 @@ file_image_daisy_chain_test(void) MPI_COMM_WORLD); VRFY((mpi_result == MPI_SUCCESS), "sent image to process (mpi_rank + 1) % mpi_size"); - HDfree(image_ptr); + free(image_ptr); image_ptr = NULL; image_len = 0; diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index d700da2..aa0fcb1 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -80,11 +80,11 @@ filter_read_internal(const char *filename, hid_t dcpl, hsize_t *dset_size) VRFY(sid >= 0, "H5Screate_simple"); /* Create buffers */ - points = (int *)HDmalloc(size[0] * size[1] * sizeof(int)); - VRFY(points != NULL, "HDmalloc"); + points = (int *)malloc(size[0] * size[1] * sizeof(int)); + VRFY(points != NULL, "malloc"); - check = (int *)HDmalloc(hs_size[0] * hs_size[1] * sizeof(int)); - VRFY(check != NULL, "HDmalloc"); + check = (int *)malloc(hs_size[0] * hs_size[1] * sizeof(int)); + VRFY(check != NULL, "malloc"); /* Initialize writing buffer with random data */ for (i = 0; i < size[0]; i++) @@ -176,8 +176,8 @@ filter_read_internal(const char *filename, hid_t dcpl, hsize_t *dset_size) hrc = H5Fclose(file); VRFY(hrc >= 0, "H5Fclose"); - HDfree(points); - HDfree(check); + free(points); + free(check); MPI_Barrier(MPI_COMM_WORLD); } diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 4024c34..8933e3a 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -490,11 +490,11 @@ test_write_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t fil (hsize_t)WRITE_ONE_CHUNK_FILTERED_DATASET_NCOLS * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -512,13 +512,13 @@ test_write_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t fil verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_ONE_CHUNK_FILTERED_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -529,9 +529,9 @@ test_write_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t fil VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -645,11 +645,11 @@ test_write_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fi data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -665,13 +665,13 @@ test_write_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fi verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_UNSHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -682,9 +682,9 @@ test_write_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fi VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -792,11 +792,11 @@ test_write_filtered_dataset_no_overlap_partial(const char *parent_group, H5Z_fil data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -821,13 +821,13 @@ test_write_filtered_dataset_no_overlap_partial(const char *parent_group, H5Z_fil verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_UNSHARED_FILTERED_CHUNKS_PARTIAL_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -838,9 +838,9 @@ test_write_filtered_dataset_no_overlap_partial(const char *parent_group, H5Z_fil VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -953,11 +953,11 @@ test_write_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filte data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -975,13 +975,13 @@ test_write_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filte verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_SHARED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -992,9 +992,9 @@ test_write_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filte VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1077,11 +1077,11 @@ test_write_filtered_dataset_single_unlim_dim_no_overlap(const char *parent_group /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - read_buf = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != read_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -1148,9 +1148,9 @@ test_write_filtered_dataset_single_unlim_dim_no_overlap(const char *parent_group } if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1231,11 +1231,11 @@ test_write_filtered_dataset_single_unlim_dim_overlap(const char *parent_group, H /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - read_buf = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != read_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -1301,9 +1301,9 @@ test_write_filtered_dataset_single_unlim_dim_overlap(const char *parent_group, H } if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1394,12 +1394,12 @@ test_write_filtered_dataset_multi_unlim_dim_no_overlap(const char *parent_group, /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - tmp_realloc = (C_DATATYPE *)HDrealloc(data, data_size); - VRFY((NULL != tmp_realloc), "HDrealloc succeeded"); + tmp_realloc = (C_DATATYPE *)realloc(data, data_size); + VRFY((NULL != tmp_realloc), "realloc succeeded"); data = tmp_realloc; - tmp_realloc = (C_DATATYPE *)HDrealloc(read_buf, data_size); - VRFY((NULL != tmp_realloc), "HDrealloc succeeded"); + tmp_realloc = (C_DATATYPE *)realloc(read_buf, data_size); + VRFY((NULL != tmp_realloc), "realloc succeeded"); read_buf = tmp_realloc; for (j = 0; j < data_size / sizeof(*data); j++) @@ -1470,9 +1470,9 @@ test_write_filtered_dataset_multi_unlim_dim_no_overlap(const char *parent_group, } if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1561,12 +1561,12 @@ test_write_filtered_dataset_multi_unlim_dim_overlap(const char *parent_group, H5 /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - tmp_realloc = (C_DATATYPE *)HDrealloc(data, data_size); - VRFY((NULL != tmp_realloc), "HDrealloc succeeded"); + tmp_realloc = (C_DATATYPE *)realloc(data, data_size); + VRFY((NULL != tmp_realloc), "realloc succeeded"); data = tmp_realloc; - tmp_realloc = (C_DATATYPE *)HDrealloc(read_buf, data_size); - VRFY((NULL != tmp_realloc), "HDrealloc succeeded"); + tmp_realloc = (C_DATATYPE *)realloc(read_buf, data_size); + VRFY((NULL != tmp_realloc), "realloc succeeded"); read_buf = tmp_realloc; for (j = 0; j < data_size / sizeof(*data); j++) @@ -1633,9 +1633,9 @@ test_write_filtered_dataset_multi_unlim_dim_overlap(const char *parent_group, H5 } if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1758,15 +1758,15 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); if (mpi_rank != WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) { - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); } - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (C_DATATYPE)((i % (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) + @@ -1785,13 +1785,13 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi verify_space_alloc_status(dset_id, plist_id, (mpi_size > 1 ? SOME_CHUNKS_WRITTEN : NO_CHUNKS_WRITTEN)); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_SINGLE_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -1802,9 +1802,9 @@ test_write_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fi VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1894,11 +1894,11 @@ test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filte data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -1910,13 +1910,13 @@ test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filte verify_space_alloc_status(dset_id, plist_id, NO_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_ALL_NO_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -1927,9 +1927,9 @@ test_write_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filte VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -2013,8 +2013,8 @@ test_write_filtered_dataset_point_selection(const char *parent_group, H5Z_filter num_points = (hsize_t)WRITE_POINT_SELECTION_FILTERED_CHUNKS_NROWS * (hsize_t)WRITE_POINT_SELECTION_FILTERED_CHUNKS_NCOLS / (hsize_t)mpi_size; - coords = (hsize_t *)HDcalloc(1, 2 * num_points * sizeof(*coords)); - VRFY((NULL != coords), "Coords HDcalloc succeeded"); + coords = (hsize_t *)calloc(1, 2 * num_points * sizeof(*coords)); + VRFY((NULL != coords), "Coords calloc succeeded"); for (i = 0; i < num_points; i++) for (j = 0; j < WRITE_POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS; j++) @@ -2030,11 +2030,11 @@ test_write_filtered_dataset_point_selection(const char *parent_group, H5Z_filter data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -2052,13 +2052,13 @@ test_write_filtered_dataset_point_selection(const char *parent_group, H5Z_filter verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_POINT_SELECTION_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -2069,11 +2069,11 @@ test_write_filtered_dataset_point_selection(const char *parent_group, H5Z_filter VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (coords) - HDfree(coords); + free(coords); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -2190,11 +2190,11 @@ test_write_filtered_dataset_interleaved_write(const char *parent_group, H5Z_filt data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -2220,13 +2220,13 @@ test_write_filtered_dataset_interleaved_write(const char *parent_group, H5Z_filt verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, INTERLEAVED_WRITE_FILTERED_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -2237,9 +2237,9 @@ test_write_filtered_dataset_interleaved_write(const char *parent_group, H5Z_filt VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -2361,11 +2361,11 @@ test_write_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -2385,13 +2385,13 @@ test_write_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z "Dataset write succeeded"); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -2409,9 +2409,9 @@ test_write_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -2534,11 +2534,11 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_grou data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -2553,13 +2553,13 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_grou verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_UNSHARED_FILTERED_CHUNKS_3D_SEP_PAGE_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -2570,9 +2570,9 @@ test_write_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_grou VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -2696,11 +2696,11 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -2716,13 +2716,13 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_UNSHARED_FILTERED_CHUNKS_3D_SAME_PAGE_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -2733,9 +2733,9 @@ test_write_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -2857,11 +2857,11 @@ test_write_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fi data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -2891,13 +2891,13 @@ test_write_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fi verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_SHARED_FILTERED_CHUNKS_3D_DATASET_NAME, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); @@ -2908,9 +2908,9 @@ test_write_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fi VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -3041,14 +3041,14 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), "Hyperslab selection succeeded"); - data = (COMPOUND_C_DATATYPE *)HDcalloc( + data = (COMPOUND_C_DATATYPE *)calloc( 1, (hsize_t)WRITE_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC * sizeof(*data)); - VRFY((NULL != data), "HDcalloc succeeded"); + VRFY((NULL != data), "calloc succeeded"); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(COMPOUND_C_DATATYPE); - correct_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); /* Fill data buffer */ for (i = 0; i < (hsize_t)WRITE_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) { @@ -3071,13 +3071,13 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_UNSHARED_DATASET_NAME, H5P_DEFAULT); @@ -3088,9 +3088,9 @@ test_write_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -3222,14 +3222,14 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), "Hyperslab selection succeeded"); - data = (COMPOUND_C_DATATYPE *)HDcalloc( + data = (COMPOUND_C_DATATYPE *)calloc( 1, (hsize_t)WRITE_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC * sizeof(*data)); - VRFY((NULL != data), "HDcalloc succeeded"); + VRFY((NULL != data), "calloc succeeded"); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(COMPOUND_C_DATATYPE); - correct_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); /* Fill data buffer */ for (i = 0; i < (hsize_t)WRITE_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) { @@ -3258,13 +3258,13 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); /* Verify the correct data was written */ - read_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_COMPOUND_FILTERED_CHUNKS_NO_CONVERSION_SHARED_DATASET_NAME, H5P_DEFAULT); @@ -3275,9 +3275,9 @@ test_write_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -3429,14 +3429,14 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), "Hyperslab selection succeeded"); - data = (COMPOUND_C_DATATYPE *)HDcalloc( + data = (COMPOUND_C_DATATYPE *)calloc( 1, (hsize_t)WRITE_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC * sizeof(*data)); - VRFY((NULL != data), "HDcalloc succeeded"); + VRFY((NULL != data), "calloc succeeded"); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(COMPOUND_C_DATATYPE); - correct_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); /* Fill data buffer */ for (i = 0; i < (hsize_t)WRITE_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_ENTRIES_PER_PROC; i++) { @@ -3456,13 +3456,13 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro verify_space_alloc_status(dset_id, plist_id, NO_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); /* Verify that no data was written */ VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); - read_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_UNSHARED_DATASET_NAME, H5P_DEFAULT); @@ -3473,9 +3473,9 @@ test_write_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_gro VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -3628,14 +3628,14 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group VRFY((H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, stride, count, block) >= 0), "Hyperslab selection succeeded"); - data = (COMPOUND_C_DATATYPE *)HDcalloc( + data = (COMPOUND_C_DATATYPE *)calloc( 1, (hsize_t)WRITE_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC * sizeof(*data)); - VRFY((NULL != data), "HDcalloc succeeded"); + VRFY((NULL != data), "calloc succeeded"); correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(COMPOUND_C_DATATYPE); - correct_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); /* Fill data buffer */ for (i = 0; i < (hsize_t)WRITE_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_ENTRIES_PER_PROC; i++) { @@ -3655,13 +3655,13 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group verify_space_alloc_status(dset_id, plist_id, NO_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); /* Verify that no data was written */ VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); - read_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); dset_id = H5Dopen2(group_id, WRITE_COMPOUND_FILTERED_CHUNKS_TYPE_CONVERSION_SHARED_DATASET_NAME, H5P_DEFAULT); @@ -3672,9 +3672,9 @@ test_write_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -3732,8 +3732,8 @@ test_read_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t filt /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = ((C_DATATYPE)i % (READ_ONE_CHUNK_FILTERED_DATASET_CH_NROWS / mpi_size * @@ -3842,24 +3842,24 @@ test_read_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t filt read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* Collect each piece of data from all ranks into a global buffer on all ranks */ - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) recvcounts[i] = (int)flat_dims[0]; - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) displs[i] = (int)(i * flat_dims[0]); @@ -3871,15 +3871,15 @@ test_read_one_chunk_filtered_dataset(const char *parent_group, H5Z_filter_t filt VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -3934,8 +3934,8 @@ test_read_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fil correct_buf_size = (hsize_t)READ_UNSHARED_FILTERED_CHUNKS_NROWS * (hsize_t)READ_UNSHARED_FILTERED_CHUNKS_NCOLS * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (C_DATATYPE)((i % (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) + @@ -4042,24 +4042,24 @@ test_read_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fil read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* Collect each piece of data from all ranks into a global buffer on all ranks */ - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) recvcounts[i] = (int)flat_dims[0]; - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) displs[i] = (int)(i * flat_dims[0]); @@ -4071,15 +4071,15 @@ test_read_filtered_dataset_no_overlap(const char *parent_group, H5Z_filter_t fil VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -4134,8 +4134,8 @@ test_read_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filter /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = @@ -4244,14 +4244,14 @@ test_read_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filter read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* * Since these chunks are shared, run multiple rounds of MPI_Allgatherv @@ -4263,11 +4263,11 @@ test_read_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filter size_t loop_count = count[0]; size_t total_recvcounts = 0; - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) { recvcounts[i] = (int)dataset_dims[1]; @@ -4289,15 +4289,15 @@ test_read_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t filter VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -4353,8 +4353,8 @@ test_read_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fil /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (C_DATATYPE)((i % (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) + @@ -4474,8 +4474,8 @@ test_read_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fil read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); if (mpi_rank == READ_SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC) { VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, NULL) >= 0), @@ -4486,20 +4486,20 @@ test_read_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fil "Dataset read succeeded"); } - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* Collect each piece of data from all ranks into a global buffer on all ranks */ - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) recvcounts[i] = (int)(READ_SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * READ_SINGLE_NO_SELECTION_FILTERED_CHUNKS_NCOLS); recvcounts[READ_SINGLE_NO_SELECTION_FILTERED_CHUNKS_NO_SELECT_PROC] = 0; - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) displs[i] = (int)(i * (size_t)(READ_SINGLE_NO_SELECTION_FILTERED_CHUNKS_CH_NROWS * @@ -4517,15 +4517,15 @@ test_read_filtered_dataset_single_no_selection(const char *parent_group, H5Z_fil VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -4573,8 +4573,8 @@ test_read_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filter /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); if (MAINPROCESS) { plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -4651,8 +4651,8 @@ test_read_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filter read_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); @@ -4660,9 +4660,9 @@ test_read_filtered_dataset_all_no_selection(const char *parent_group, H5Z_filter VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -4715,8 +4715,8 @@ test_read_filtered_dataset_point_selection(const char *parent_group, H5Z_filter_ /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = @@ -4801,8 +4801,8 @@ test_read_filtered_dataset_point_selection(const char *parent_group, H5Z_filter_ num_points = (hsize_t)READ_POINT_SELECTION_FILTERED_CHUNKS_NROWS * (hsize_t)READ_POINT_SELECTION_FILTERED_CHUNKS_NCOLS / (hsize_t)mpi_size; - coords = (hsize_t *)HDcalloc(1, 2 * num_points * sizeof(*coords)); - VRFY((NULL != coords), "Coords HDcalloc succeeded"); + coords = (hsize_t *)calloc(1, 2 * num_points * sizeof(*coords)); + VRFY((NULL != coords), "Coords calloc succeeded"); for (i = 0; i < num_points; i++) for (j = 0; j < READ_POINT_SELECTION_FILTERED_CHUNKS_DATASET_DIMS; j++) @@ -4816,14 +4816,14 @@ test_read_filtered_dataset_point_selection(const char *parent_group, H5Z_filter_ read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* * Since these chunks are shared, run multiple rounds of MPI_Allgatherv @@ -4836,11 +4836,11 @@ test_read_filtered_dataset_point_selection(const char *parent_group, H5Z_filter_ size_t cur_loop_count = original_loop_count; size_t total_recvcounts = 0; - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) { recvcounts[i] = (int)dataset_dims[1]; @@ -4863,17 +4863,17 @@ test_read_filtered_dataset_point_selection(const char *parent_group, H5Z_filter_ VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); - HDfree(coords); + free(coords); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -4931,8 +4931,8 @@ test_read_filtered_dataset_interleaved_read(const char *parent_group, H5Z_filter /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) /* Add Column Index */ @@ -5051,14 +5051,14 @@ test_read_filtered_dataset_interleaved_read(const char *parent_group, H5Z_filter read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* * Since these chunks are shared, run multiple rounds of MPI_Allgatherv @@ -5070,11 +5070,11 @@ test_read_filtered_dataset_interleaved_read(const char *parent_group, H5Z_filter size_t loop_count = count[0]; size_t total_recvcounts = 0; - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) { recvcounts[i] = (int)dataset_dims[1]; @@ -5096,15 +5096,15 @@ test_read_filtered_dataset_interleaved_read(const char *parent_group, H5Z_filter VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -5160,8 +5160,8 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_group /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (C_DATATYPE)((i % (hsize_t)mpi_size) + (i / (hsize_t)mpi_size)); @@ -5277,14 +5277,14 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_group read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* * Due to the nature of 3-dimensional reading, create an MPI vector type that allows each @@ -5312,11 +5312,11 @@ test_read_3d_filtered_dataset_no_overlap_separate_pages(const char *parent_group VRFY((MPI_SUCCESS == MPI_Type_free(&resized_vector_type)), "MPI_Type_free succeeded"); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -5379,8 +5379,8 @@ test_read_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z_ correct_buf_size = (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NROWS * (hsize_t)READ_UNSHARED_TRANSFORMED_FILTERED_CHUNKS_NCOLS * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (C_DATATYPE)((i % (dataset_dims[0] / (hsize_t)mpi_size * dataset_dims[1])) + @@ -5509,24 +5509,24 @@ test_read_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z_ read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, plist_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* Collect each piece of data from all ranks into a global buffer on all ranks */ - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) recvcounts[i] = (int)flat_dims[0]; - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) displs[i] = (int)(i * flat_dims[0]); @@ -5538,15 +5538,15 @@ test_read_transformed_filtered_dataset_no_overlap(const char *parent_group, H5Z_ VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -5604,8 +5604,8 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H5 /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (C_DATATYPE)((i % (dataset_dims[0] * dataset_dims[1])) + @@ -5721,24 +5721,24 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H5 read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* Collect each piece of data from all ranks into a global buffer on all ranks */ - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) recvcounts[i] = (int)flat_dims[0]; - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) displs[i] = (int)(i * flat_dims[0]); @@ -5750,15 +5750,15 @@ test_read_3d_filtered_dataset_no_overlap_same_pages(const char *parent_group, H5 VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -5815,8 +5815,8 @@ test_read_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fil /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) /* Add the Column Index */ @@ -5943,14 +5943,14 @@ test_read_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fil read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); { size_t run_length = @@ -5987,11 +5987,11 @@ test_read_3d_filtered_dataset_overlap(const char *parent_group, H5Z_filter_t fil VRFY((MPI_SUCCESS == MPI_Type_free(&resized_vector_type)), "MPI_Type_free succeeded"); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -6055,8 +6055,8 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group, /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) { correct_buf[i].field1 = (short)((i % dataset_dims[1]) + (i / dataset_dims[1])); @@ -6181,23 +6181,23 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group, read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (COMPOUND_C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, memtype, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* Collect each piece of data from all ranks into a global buffer on all ranks */ - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) recvcounts[i] = (int)(flat_dims[0] * sizeof(*read_buf)); - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) displs[i] = (int)(i * flat_dims[0] * sizeof(*read_buf)); @@ -6209,15 +6209,15 @@ test_read_cmpd_filtered_dataset_no_conversion_unshared(const char *parent_group, VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -6282,8 +6282,8 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, H /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) { correct_buf[i].field1 = @@ -6414,23 +6414,23 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, H read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (COMPOUND_C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, memtype, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* Collect each piece of data from all ranks into a global buffer on all ranks */ - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) recvcounts[i] = (int)(flat_dims[0] * sizeof(*read_buf)); - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) displs[i] = (int)(i * flat_dims[0] * sizeof(*read_buf)); @@ -6442,15 +6442,15 @@ test_read_cmpd_filtered_dataset_no_conversion_shared(const char *parent_group, H VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -6515,8 +6515,8 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_grou /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) { correct_buf[i].field1 = (short)((i % dataset_dims[1]) + (i / dataset_dims[1])); @@ -6649,23 +6649,23 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_grou read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (COMPOUND_C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, memtype, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* Collect each piece of data from all ranks into a global buffer on all ranks */ - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) recvcounts[i] = (int)(flat_dims[0] * sizeof(*read_buf)); - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) displs[i] = (int)(i * flat_dims[0] * sizeof(*read_buf)); @@ -6677,15 +6677,15 @@ test_read_cmpd_filtered_dataset_type_conversion_unshared(const char *parent_grou VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -6751,8 +6751,8 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group, /* Setup the buffer for writing and for comparison */ correct_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*correct_buf); - correct_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) { correct_buf[i].field1 = @@ -6891,23 +6891,23 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group, read_buf_size = flat_dims[0] * sizeof(*read_buf); - read_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (COMPOUND_C_DATATYPE *)calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); VRFY((H5Dread(dset_id, memtype, memspace, filespace, dxpl_id, read_buf) >= 0), "Dataset read succeeded"); - global_buf = (COMPOUND_C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != global_buf), "HDcalloc succeeded"); + global_buf = (COMPOUND_C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != global_buf), "calloc succeeded"); /* Collect each piece of data from all ranks into a global buffer on all ranks */ - recvcounts = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = (int *)calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) recvcounts[i] = (int)(flat_dims[0] * sizeof(*read_buf)); - displs = (int *)HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = (int *)calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) displs[i] = (int)(i * flat_dims[0] * sizeof(*read_buf)); @@ -6919,15 +6919,15 @@ test_read_cmpd_filtered_dataset_type_conversion_shared(const char *parent_group, VRFY((0 == HDmemcmp(global_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (global_buf) - HDfree(global_buf); + free(global_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -7016,8 +7016,8 @@ test_write_serial_read_parallel(const char *parent_group, H5Z_filter_t filter_id data_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*data); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -7029,7 +7029,7 @@ test_write_serial_read_parallel(const char *parent_group, H5Z_filter_t filter_id verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -7039,11 +7039,11 @@ test_write_serial_read_parallel(const char *parent_group, H5Z_filter_t filter_id correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (long)i; @@ -7064,9 +7064,9 @@ test_write_serial_read_parallel(const char *parent_group, H5Z_filter_t filter_id VRFY((0 == HDmemcmp(read_buf, correct_buf, correct_buf_size)), "Data verification succeeded"); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); VRFY((H5Gclose(group_id) >= 0), "Group close succeeded"); @@ -7186,8 +7186,8 @@ test_write_parallel_read_serial(const char *parent_group, H5Z_filter_t filter_id /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sel_dims[2] * sizeof(*data); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -7199,7 +7199,7 @@ test_write_parallel_read_serial(const char *parent_group, H5Z_filter_t filter_id verify_space_alloc_status(dset_id, plist_id, ALL_CHUNKS_WRITTEN); if (data) - HDfree(data); + free(data); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -7228,11 +7228,11 @@ test_write_parallel_read_serial(const char *parent_group, H5Z_filter_t filter_id correct_buf_size = dataset_dims[0] * dataset_dims[1] * dataset_dims[2] * sizeof(*correct_buf); - correct_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); - read_buf = (C_DATATYPE *)HDcalloc(1, correct_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, correct_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); for (i = 0; i < correct_buf_size / sizeof(*correct_buf); i++) correct_buf[i] = (C_DATATYPE)((i % (dataset_dims[0] * dataset_dims[1])) + @@ -7247,8 +7247,8 @@ test_write_parallel_read_serial(const char *parent_group, H5Z_filter_t filter_id VRFY((H5Gclose(group_id) >= 0), "Group close succeeded"); VRFY((H5Fclose(file_id) >= 0), "File close succeeded"); - HDfree(correct_buf); - HDfree(read_buf); + free(correct_buf); + free(read_buf); } return; @@ -7352,11 +7352,11 @@ test_shrinking_growing_chunks(const char *parent_group, H5Z_filter_t filter_id, data_size = sel_dims[0] * sel_dims[1] * sizeof(double); - data = (double *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (double *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - read_buf = (double *)HDcalloc(1, data_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (double *)calloc(1, data_size); + VRFY((NULL != read_buf), "calloc succeeded"); for (i = 0; i < SHRINKING_GROWING_CHUNKS_NLOOPS; i++) { /* Continually write random float data, followed by zeroed-out data */ @@ -7389,9 +7389,9 @@ test_shrinking_growing_chunks(const char *parent_group, H5Z_filter_t filter_id, } if (read_buf) - HDfree(read_buf); + free(read_buf); if (data) - HDfree(data); + free(data); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -7501,11 +7501,11 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - read_buf = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != read_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -7592,9 +7592,9 @@ test_edge_chunks_no_overlap(const char *parent_group, H5Z_filter_t filter_id, hi VRFY((0 == HDmemcmp(read_buf, data, data_size)), "Data verification succeeded"); if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -7704,11 +7704,11 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); - read_buf = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != read_buf), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -7796,9 +7796,9 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t VRFY((0 == HDmemcmp(read_buf, data, data_size)), "Data verification succeeded"); if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Sclose(filespace) >= 0), "File dataspace close succeeded"); @@ -7900,11 +7900,11 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Allocate buffer for reading entire dataset */ read_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*read_buf); - read_buf = HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); - correct_buf = HDcalloc(1, read_buf_size); - VRFY((NULL != correct_buf), "HDcalloc succeeded"); + correct_buf = calloc(1, read_buf_size); + VRFY((NULL != correct_buf), "calloc succeeded"); /* Read entire dataset and verify that the fill value is returned */ VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_buf) >= 0), @@ -7949,8 +7949,8 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -7974,11 +7974,11 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id * Each MPI rank communicates their written piece of data * into each other rank's correctness-checking buffer */ - recvcounts = HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); - displs = HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) { recvcounts[i] = (int)(count[1] * block[1]); @@ -8174,15 +8174,15 @@ test_fill_values(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id VRFY((read_buf[i] != FILL_VALUES_TEST_FILL_VAL), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); if (correct_buf) - HDfree(correct_buf); + free(correct_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -8263,8 +8263,8 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ /* Allocate buffer for reading entire dataset */ read_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*read_buf); - read_buf = HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); /* * Read entire dataset - nothing to verify since there's no fill value. @@ -8316,8 +8316,8 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -8380,9 +8380,9 @@ test_fill_value_undefined(const char *parent_group, H5Z_filter_t filter_id, hid_ "Dataset read succeeded"); if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -8486,11 +8486,11 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap /* Allocate buffer for reading entire dataset */ read_buf_size = dataset_dims[0] * dataset_dims[1] * sizeof(*read_buf); - read_buf = HDcalloc(1, read_buf_size); - VRFY((NULL != read_buf), "HDcalloc succeeded"); + read_buf = calloc(1, read_buf_size); + VRFY((NULL != read_buf), "calloc succeeded"); - fill_buf = HDcalloc(1, read_buf_size); - VRFY((NULL != fill_buf), "HDcalloc succeeded"); + fill_buf = calloc(1, read_buf_size); + VRFY((NULL != fill_buf), "calloc succeeded"); /* Read entire dataset and verify that the fill value isn't returned */ VRFY((H5Dread(dset_id, HDF5_DATATYPE_NAME, H5S_ALL, H5S_ALL, dxpl_id, read_buf) >= 0), @@ -8540,8 +8540,8 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap /* Fill data buffer */ data_size = sel_dims[0] * sel_dims[1] * sizeof(*data); - data = (C_DATATYPE *)HDcalloc(1, data_size); - VRFY((NULL != data), "HDcalloc succeeded"); + data = (C_DATATYPE *)calloc(1, data_size); + VRFY((NULL != data), "calloc succeeded"); for (i = 0; i < data_size / sizeof(*data); i++) data[i] = (C_DATATYPE)GEN_DATA(i); @@ -8565,11 +8565,11 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap * Each MPI rank communicates their written piece of data * into each other rank's correctness-checking buffer */ - recvcounts = HDcalloc(1, (size_t)mpi_size * sizeof(*recvcounts)); - VRFY((NULL != recvcounts), "HDcalloc succeeded"); + recvcounts = calloc(1, (size_t)mpi_size * sizeof(*recvcounts)); + VRFY((NULL != recvcounts), "calloc succeeded"); - displs = HDcalloc(1, (size_t)mpi_size * sizeof(*displs)); - VRFY((NULL != displs), "HDcalloc succeeded"); + displs = calloc(1, (size_t)mpi_size * sizeof(*displs)); + VRFY((NULL != displs), "calloc succeeded"); for (i = 0; i < (size_t)mpi_size; i++) { recvcounts[i] = (int)(count[1] * block[1]); @@ -8634,15 +8634,15 @@ test_fill_time_never(const char *parent_group, H5Z_filter_t filter_id, hid_t fap VRFY((read_buf[i] != FILL_TIME_NEVER_TEST_FILL_VAL), "Data verification succeeded"); if (displs) - HDfree(displs); + free(displs); if (recvcounts) - HDfree(recvcounts); + free(recvcounts); if (data) - HDfree(data); + free(data); if (read_buf) - HDfree(read_buf); + free(read_buf); if (fill_buf) - HDfree(fill_buf); + free(fill_buf); VRFY((H5Pclose(plist_id) >= 0), "DCPL close succeeded"); VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index a7498a8..2db7eff 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -156,8 +156,8 @@ multiple_dset_write(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - outme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); - VRFY((outme != NULL), "HDmalloc succeeded for outme"); + outme = malloc((size_t)size * (size_t)size * sizeof(double)); + VRFY((outme != NULL), "malloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); VRFY((plist >= 0), "create_faccess_plist succeeded"); @@ -207,7 +207,7 @@ multiple_dset_write(void) H5Pclose(dcpl); H5Fclose(iof); - HDfree(outme); + free(outme); } /* Example of using PHDF5 to create, write, and read compact dataset. @@ -235,11 +235,11 @@ compact_dataset(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - outme = HDmalloc((size_t)((size_t)size * (size_t)size * sizeof(double))); - VRFY((outme != NULL), "HDmalloc succeeded for outme"); + outme = malloc((size_t)((size_t)size * (size_t)size * sizeof(double))); + VRFY((outme != NULL), "malloc succeeded for outme"); - inme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); - VRFY((outme != NULL), "HDmalloc succeeded for inme"); + inme = malloc((size_t)size * (size_t)size * sizeof(double)); + VRFY((outme != NULL), "malloc succeeded for inme"); filename = GetTestParameters(); VRFY((mpi_size <= size), "mpi_size <= size"); @@ -333,8 +333,8 @@ compact_dataset(void) H5Pclose(dxpl); H5Dclose(dataset); H5Fclose(iof); - HDfree(inme); - HDfree(outme); + free(inme); + free(outme); } /* @@ -602,10 +602,10 @@ dataset_fillvalue(void) dset_size = dset_dims[0] * dset_dims[1] * dset_dims[2] * dset_dims[3]; /* Allocate space for the buffers */ - rdata = HDmalloc((size_t)(dset_size * sizeof(int))); - VRFY((rdata != NULL), "HDcalloc succeeded for read buffer"); - wdata = HDmalloc((size_t)(dset_size * sizeof(int))); - VRFY((wdata != NULL), "HDmalloc succeeded for write buffer"); + rdata = malloc((size_t)(dset_size * sizeof(int))); + VRFY((rdata != NULL), "calloc succeeded for read buffer"); + wdata = malloc((size_t)(dset_size * sizeof(int))); + VRFY((wdata != NULL), "malloc succeeded for write buffer"); fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); VRFY((fapl >= 0), "create_faccess_plist succeeded"); @@ -804,8 +804,8 @@ dataset_fillvalue(void) VRFY((ret >= 0), "H5Pclose succeeded"); /* free the buffers */ - HDfree(rdata); - HDfree(wdata); + free(rdata); + free(wdata); } /* combined cngrpw and ingrpr tests because ingrpr reads file created by cngrpw. */ @@ -847,8 +847,8 @@ collective_group_write(void) chunk_size[0] = (hsize_t)(size / 2); chunk_size[1] = (hsize_t)(size / 2); - outme = HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((outme != NULL), "HDmalloc succeeded for outme"); + outme = malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((outme != NULL), "malloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); @@ -913,7 +913,7 @@ collective_group_write(void) ret1 = H5Fclose(fid); VRFY((ret1 == 0), "H5Fclose"); - HDfree(outme); + free(outme); } /* Let two sets of processes open and read different groups and chunked @@ -971,11 +971,11 @@ group_dataset_read(hid_t fid, int mpi_rank, int m) size = get_size(); - indata = (DATATYPE *)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((indata != NULL), "HDmalloc succeeded for indata"); + indata = (DATATYPE *)malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((indata != NULL), "malloc succeeded for indata"); - outdata = (DATATYPE *)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); + outdata = (DATATYPE *)malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((outdata != NULL), "malloc succeeded for outdata"); /* open every group under root group. */ HDsnprintf(gname, sizeof(gname), "group%d", m); @@ -1003,8 +1003,8 @@ group_dataset_read(hid_t fid, int mpi_rank, int m) ret = H5Gclose(gid); VRFY((ret == 0), "H5Gclose"); - HDfree(indata); - HDfree(outdata); + free(indata); + free(outdata); } /* @@ -1131,8 +1131,8 @@ write_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - outme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); - VRFY((outme != NULL), "HDmalloc succeeded for outme"); + outme = malloc((size_t)size * (size_t)size * sizeof(double)); + VRFY((outme != NULL), "malloc succeeded for outme"); for (n = 0; n < NDATASET; n++) { HDsnprintf(dname, sizeof(dname), "dataset%d", n); @@ -1150,7 +1150,7 @@ write_dataset(hid_t memspace, hid_t filespace, hid_t gid) H5Dclose(did); } - HDfree(outme); + free(outme); } /* @@ -1277,11 +1277,11 @@ read_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - indata = (DATATYPE *)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((indata != NULL), "HDmalloc succeeded for indata"); + indata = (DATATYPE *)malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((indata != NULL), "malloc succeeded for indata"); - outdata = (DATATYPE *)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); - VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); + outdata = (DATATYPE *)malloc((size_t)size * (size_t)size * sizeof(DATATYPE)); + VRFY((outdata != NULL), "malloc succeeded for outdata"); for (n = 0; n < NDATASET; n++) { HDsnprintf(dname, sizeof(dname), "dataset%d", n); @@ -1308,8 +1308,8 @@ read_dataset(hid_t memspace, hid_t filespace, hid_t gid) H5Dclose(did); } - HDfree(indata); - HDfree(outdata); + free(indata); + free(outdata); return vrfy_errors; } diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 4dd6a95..48d0cc1 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -70,7 +70,7 @@ test_mpio_overlap_writes(char *filename) } bufsize = 4093; /* use some prime number for size */ - if (NULL == (buf = HDmalloc((size_t)bufsize))) { + if (NULL == (buf = malloc((size_t)bufsize))) { if (MAINPROCESS) printf("couldn't allocate buffer\n"); return 1; @@ -166,7 +166,7 @@ test_mpio_overlap_writes(char *filename) mrc = MPI_Barrier(MPI_COMM_WORLD); VRFY((mrc == MPI_SUCCESS), "Sync before leaving test"); - HDfree(buf); + free(buf); return (nerrs); } @@ -282,7 +282,7 @@ test_mpio_gb_file(char *filename) "because MPI_Offset cannot support it\n"); } else { - buf = (char *)HDmalloc(MB); + buf = (char *)malloc(MB); VRFY((buf != NULL), "malloc succeed"); /* open a new file. Remove it first in case it exists. */ @@ -399,7 +399,7 @@ test_mpio_gb_file(char *filename) finish: if (buf) - HDfree(buf); + free(buf); return (nerrs); } diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index d5a8d83..6a7a346 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -145,7 +145,7 @@ main(int argc, char *argv[]) HDexit(EXIT_FAILURE); } - if (NULL == (data_g = HDmalloc(100 * 100 * sizeof(*data_g)))) + if (NULL == (data_g = malloc(100 * 100 * sizeof(*data_g)))) goto error; if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) @@ -195,7 +195,7 @@ main(int argc, char *argv[]) HDfflush(stderr); if (data_g) { - HDfree(data_g); + free(data_g); data_g = NULL; } @@ -217,7 +217,7 @@ error: HDfflush(stdout); if (data_g) - HDfree(data_g); + free(data_g); HD_exit(EXIT_FAILURE); } /* end main() */ diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c index f12168a..6148bb6 100644 --- a/testpar/t_pflush2.c +++ b/testpar/t_pflush2.c @@ -170,7 +170,7 @@ main(int argc, char *argv[]) HDexit(EXIT_SUCCESS); } - if (NULL == (data_g = HDmalloc(100 * 100 * sizeof(*data_g)))) + if (NULL == (data_g = malloc(100 * 100 * sizeof(*data_g)))) goto error; if ((fapl_id1 = H5Pcreate(H5P_FILE_ACCESS)) < 0) @@ -217,7 +217,7 @@ main(int argc, char *argv[]) h5_clean_files(&FILENAME[1], fapl_id2); if (data_g) { - HDfree(data_g); + free(data_g); data_g = NULL; } @@ -227,7 +227,7 @@ main(int argc, char *argv[]) error: if (data_g) - HDfree(data_g); + free(data_g); HDexit(EXIT_FAILURE); } /* end main() */ diff --git a/testpar/t_pmulti_dset.c b/testpar/t_pmulti_dset.c index dd9a71a..145a427 100644 --- a/testpar/t_pmulti_dset.c +++ b/testpar/t_pmulti_dset.c @@ -160,15 +160,15 @@ test_pmdset(size_t niter, unsigned flags) dcpl_id[i] = -1; /* Allocate buffers */ - if (NULL == (rbuf = (unsigned *)HDmalloc(buf_size))) + if (NULL == (rbuf = (unsigned *)malloc(buf_size))) T_PMD_ERROR; - if (NULL == (erbuf = (unsigned *)HDmalloc(buf_size))) + if (NULL == (erbuf = (unsigned *)malloc(buf_size))) T_PMD_ERROR; - if (NULL == (wbuf = (unsigned *)HDmalloc(buf_size))) + if (NULL == (wbuf = (unsigned *)malloc(buf_size))) T_PMD_ERROR; - if (NULL == (efbuf = (unsigned *)HDmalloc(buf_size))) + if (NULL == (efbuf = (unsigned *)malloc(buf_size))) T_PMD_ERROR; - if (NULL == (dset_usage = (unsigned char *)HDmalloc(max_dsets * MAX_DSET_X * MAX_DSET_Y))) + if (NULL == (dset_usage = (unsigned char *)malloc(max_dsets * MAX_DSET_X * MAX_DSET_Y))) T_PMD_ERROR; /* Initialize buffer indices */ diff --git a/testpar/t_pread.c b/testpar/t_pread.c index d0bc09b..55e6516 100644 --- a/testpar/t_pread.c +++ b/testpar/t_pread.c @@ -162,7 +162,7 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) /* setup data to write */ if (pass) { - if ((data_slice = (float *)HDmalloc(COUNT * sizeof(float))) == NULL) { + if ((data_slice = (float *)malloc(COUNT * sizeof(float))) == NULL) { pass = FALSE; failure_mssg = "malloc of data_slice failed.\n"; } @@ -439,7 +439,7 @@ generate_test_file(MPI_Comm comm, int mpi_rank, int group_id) /* free data_slice if it has been allocated */ if (data_slice != NULL) { - HDfree(data_slice); + free(data_slice); data_slice = NULL; } @@ -536,7 +536,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) /* allocate space for the data_slice array */ if (pass) { - if ((data_slice = (float *)HDmalloc(COUNT * sizeof(float))) == NULL) { + if ((data_slice = (float *)malloc(COUNT * sizeof(float))) == NULL) { pass = FALSE; failure_mssg = "malloc of data_slice failed.\n"; } @@ -670,7 +670,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) /* free data_slice if it has been allocated */ if (data_slice != NULL) { - HDfree(data_slice); + free(data_slice); data_slice = NULL; } @@ -710,7 +710,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) failure_mssg = "H5Tclose failed.\n"; }; - if ((data_slice = (float *)HDmalloc((size_t)dset_size * filetype_size)) == NULL) { + if ((data_slice = (float *)malloc((size_t)dset_size * filetype_size)) == NULL) { pass = FALSE; failure_mssg = "malloc of data_slice failed.\n"; } @@ -861,7 +861,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) /* free data_slice if it has been allocated */ if (data_slice != NULL) { - HDfree(data_slice); + free(data_slice); data_slice = NULL; } @@ -869,7 +869,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) * Read an H5S_ALL filespace into a hyperslab defined memory space */ - if ((data_slice = (float *)HDmalloc((size_t)(dset_size * 2) * filetype_size)) == NULL) { + if ((data_slice = (float *)malloc((size_t)(dset_size * 2) * filetype_size)) == NULL) { pass = FALSE; failure_mssg = "malloc of data_slice failed.\n"; } @@ -958,7 +958,7 @@ test_parallel_read(MPI_Comm comm, int mpi_rank, int mpi_size, int group_id) /* free data_slice if it has been allocated */ if (data_slice != NULL) { - HDfree(data_slice); + free(data_slice); data_slice = NULL; } diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c index c80a78d..b3c9035 100644 --- a/testpar/t_prestart.c +++ b/testpar/t_prestart.c @@ -74,8 +74,8 @@ main(int argc, char **argv) VRFY(dims[1] == (hsize_t)(COL_FACTOR * mpi_size), "Wrong dataset dimensions"); /* allocate memory for data buffer */ - data_array = (DATATYPE *)HDmalloc(dims[0] * dims[1] * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(dims[0] * dims[1] * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* Each process takes a slabs of rows. */ block[0] = dims[0] / (hsize_t)mpi_size; @@ -116,7 +116,7 @@ main(int argc, char **argv) /* release data buffers */ if (data_array) - HDfree(data_array); + free(data_array); nerrors += GetTestNumErrs(); diff --git a/testpar/t_prop.c b/testpar/t_prop.c index 6768649..c6eb99c 100644 --- a/testpar/t_prop.c +++ b/testpar/t_prop.c @@ -35,7 +35,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) ret = H5Pencode2(orig_pl, NULL, &buf_size, H5P_DEFAULT); VRFY((ret >= 0), "H5Pencode succeeded"); - sbuf = (uint8_t *)HDmalloc(buf_size); + sbuf = (uint8_t *)malloc(buf_size); ret = H5Pencode2(orig_pl, sbuf, &buf_size, H5P_DEFAULT); VRFY((ret >= 0), "H5Pencode succeeded"); @@ -53,7 +53,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) MPI_Recv(&recv_size, 1, MPI_INT, 0, 123, MPI_COMM_WORLD, &status); buf_size = (size_t)recv_size; - rbuf = (uint8_t *)HDmalloc(buf_size); + rbuf = (uint8_t *)malloc(buf_size); MPI_Recv(rbuf, recv_size, MPI_BYTE, 0, 124, MPI_COMM_WORLD, &status); pl = H5Pdecode(rbuf); @@ -65,7 +65,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) VRFY((ret >= 0), "H5Pclose succeeded"); if (NULL != rbuf) - HDfree(rbuf); + free(rbuf); } /* end if */ if (0 == mpi_rank) { @@ -80,7 +80,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) } if (NULL != sbuf) - HDfree(sbuf); + free(sbuf); MPI_Barrier(MPI_COMM_WORLD); return 0; diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c index af98a76..7629b9f 100644 --- a/testpar/t_pshutdown.c +++ b/testpar/t_pshutdown.c @@ -73,8 +73,8 @@ main(int argc, char **argv) VRFY((dset_id >= 0), "H5Dcreate succeeded"); /* allocate memory for data buffer */ - data_array = (DATATYPE *)HDmalloc(dims[0] * dims[1] * sizeof(DATATYPE)); - VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + data_array = (DATATYPE *)malloc(dims[0] * dims[1] * sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array malloc succeeded"); /* Each process takes a slabs of rows. */ block[0] = dims[0] / (hsize_t)mpi_size; @@ -103,7 +103,7 @@ main(int argc, char **argv) /* release data buffers */ if (data_array) - HDfree(data_array); + free(data_array); MPI_Finalize(); diff --git a/testpar/t_select_io_dset.c b/testpar/t_select_io_dset.c index 14fc592..13c6743 100644 --- a/testpar/t_select_io_dset.c +++ b/testpar/t_select_io_dset.c @@ -353,11 +353,11 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) curr_nerrors = nerrors; - if ((wbuf = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) + if ((wbuf = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) P_TEST_ERROR; - if (mwbuf && (wbuf_bak = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) + if (mwbuf && (wbuf_bak = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) P_TEST_ERROR; - if ((rbuf = (char *)HDmalloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) + if ((rbuf = (char *)malloc((size_t)(4 * DSET_SELECT_DIM))) == NULL) P_TEST_ERROR; /* Create 1d data space */ @@ -467,13 +467,13 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; if (wbuf) - HDfree(wbuf); + free(wbuf); if (wbuf_bak) - HDfree(wbuf_bak); + free(wbuf_bak); if (rbuf) - HDfree(rbuf); + free(rbuf); CHECK_PASSED(); @@ -826,17 +826,17 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) curr_nerrors = nerrors; /* Allocate buffers for datasets */ - if (NULL == (s1_wbuf = (s1_t *)HDmalloc(sizeof(s1_t) * DSET_SELECT_DIM))) + if (NULL == (s1_wbuf = (s1_t *)malloc(sizeof(s1_t) * DSET_SELECT_DIM))) P_TEST_ERROR; - if (mwbuf && NULL == (s1_wbuf_bak = (s1_t *)HDmalloc(sizeof(s1_t) * DSET_SELECT_DIM))) + if (mwbuf && NULL == (s1_wbuf_bak = (s1_t *)malloc(sizeof(s1_t) * DSET_SELECT_DIM))) P_TEST_ERROR; - if (NULL == (s1_rbuf = (s1_t *)HDmalloc(sizeof(s1_t) * DSET_SELECT_DIM))) + if (NULL == (s1_rbuf = (s1_t *)malloc(sizeof(s1_t) * DSET_SELECT_DIM))) P_TEST_ERROR; - if (NULL == (s2_wbuf = (s2_t *)HDmalloc(sizeof(s2_t) * DSET_SELECT_DIM))) + if (NULL == (s2_wbuf = (s2_t *)malloc(sizeof(s2_t) * DSET_SELECT_DIM))) P_TEST_ERROR; - if (mwbuf && NULL == (s2_wbuf_bak = (s2_t *)HDmalloc(sizeof(s2_t) * DSET_SELECT_DIM))) + if (mwbuf && NULL == (s2_wbuf_bak = (s2_t *)malloc(sizeof(s2_t) * DSET_SELECT_DIM))) P_TEST_ERROR; - if (NULL == (s2_rbuf = (s2_t *)HDmalloc(sizeof(s2_t) * DSET_SELECT_DIM))) + if (NULL == (s2_rbuf = (s2_t *)malloc(sizeof(s2_t) * DSET_SELECT_DIM))) P_TEST_ERROR; /* Create the memory data type */ @@ -1093,12 +1093,12 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; /* Release buffers */ - HDfree(s1_wbuf); - HDfree(s1_wbuf_bak); - HDfree(s1_rbuf); - HDfree(s2_wbuf); - HDfree(s2_wbuf_bak); - HDfree(s2_rbuf); + free(s1_wbuf); + free(s1_wbuf_bak); + free(s1_rbuf); + free(s2_wbuf); + free(s2_wbuf_bak); + free(s2_rbuf); CHECK_PASSED(); @@ -1495,24 +1495,24 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m buf_size = ndsets * DSET_SELECT_DIM * sizeof(int); /* Allocate buffers for all datasets */ - if (NULL == (total_wbuf = (int *)HDmalloc(buf_size))) + if (NULL == (total_wbuf = (int *)malloc(buf_size))) P_TEST_ERROR; - if (mwbuf && NULL == (total_wbuf_bak = (int *)HDmalloc(buf_size))) + if (mwbuf && NULL == (total_wbuf_bak = (int *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_trans_wbuf = (int *)HDmalloc(buf_size))) + if (NULL == (total_trans_wbuf = (int *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_rbuf = (int *)HDmalloc(buf_size))) + if (NULL == (total_rbuf = (int *)malloc(buf_size))) P_TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(long); - if (NULL == (total_lwbuf = (long *)HDmalloc(buf_size))) + if (NULL == (total_lwbuf = (long *)malloc(buf_size))) P_TEST_ERROR; - if (mwbuf && NULL == (total_lwbuf_bak = (long *)HDmalloc(buf_size))) + if (mwbuf && NULL == (total_lwbuf_bak = (long *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_trans_lwbuf = (long *)HDmalloc(buf_size))) + if (NULL == (total_trans_lwbuf = (long *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_lrbuf = (long *)HDmalloc(buf_size))) + if (NULL == (total_lrbuf = (long *)malloc(buf_size))) P_TEST_ERROR; /* Initialize buffer indices */ @@ -1651,14 +1651,14 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m P_TEST_ERROR; } - HDfree(total_wbuf); - HDfree(total_wbuf_bak); - HDfree(total_rbuf); - HDfree(total_trans_wbuf); - HDfree(total_lwbuf); - HDfree(total_lwbuf_bak); - HDfree(total_trans_lwbuf); - HDfree(total_lrbuf); + free(total_wbuf); + free(total_wbuf_bak); + free(total_rbuf); + free(total_trans_wbuf); + free(total_lwbuf); + free(total_lwbuf_bak); + free(total_trans_lwbuf); + free(total_lrbuf); CHECK_PASSED(); @@ -1805,18 +1805,18 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) s2_buf_size = ndsets * DSET_SELECT_DIM * sizeof(s2_t); /* Allocate buffers for all datasets */ - if (NULL == (total_wbuf = (s1_t *)HDmalloc(buf_size))) + if (NULL == (total_wbuf = (s1_t *)malloc(buf_size))) P_TEST_ERROR; - if (mwbuf && NULL == (total_wbuf_bak = (s1_t *)HDmalloc(buf_size))) + if (mwbuf && NULL == (total_wbuf_bak = (s1_t *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_rbuf = (s1_t *)HDmalloc(buf_size))) + if (NULL == (total_rbuf = (s1_t *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (s2_total_wbuf = (s2_t *)HDmalloc(s2_buf_size))) + if (NULL == (s2_total_wbuf = (s2_t *)malloc(s2_buf_size))) P_TEST_ERROR; - if (mwbuf && NULL == (s2_total_wbuf_bak = (s2_t *)HDmalloc(s2_buf_size))) + if (mwbuf && NULL == (s2_total_wbuf_bak = (s2_t *)malloc(s2_buf_size))) P_TEST_ERROR; - if (NULL == (s2_total_rbuf = (s2_t *)HDmalloc(s2_buf_size))) + if (NULL == (s2_total_rbuf = (s2_t *)malloc(s2_buf_size))) P_TEST_ERROR; /* Initialize buffer indices */ @@ -2129,12 +2129,12 @@ test_multi_dsets_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; } - HDfree(total_wbuf); - HDfree(total_wbuf_bak); - HDfree(total_rbuf); - HDfree(s2_total_wbuf); - HDfree(s2_total_wbuf_bak); - HDfree(s2_total_rbuf); + free(total_wbuf); + free(total_wbuf_bak); + free(total_rbuf); + free(s2_total_wbuf); + free(s2_total_wbuf_bak); + free(s2_total_rbuf); CHECK_PASSED(); @@ -2254,11 +2254,11 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) buf_size = ndsets * ss * DSET_SELECT_DIM; /* Allocate buffers for all datasets */ - if (NULL == (total_wbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_wbuf = (uint8_t *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_wbuf_bak = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_wbuf_bak = (uint8_t *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_rbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_rbuf = (uint8_t *)malloc(buf_size))) P_TEST_ERROR; /* Initialize buffer indices */ @@ -2323,11 +2323,11 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) buf_size = ndsets * (ss * DSET_SELECT_DIM); /* Allocate buffers for all datasets */ - if (NULL == (total_lwbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_lwbuf = (uint8_t *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_lwbuf_bak = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_lwbuf_bak = (uint8_t *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_lrbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_lrbuf = (uint8_t *)malloc(buf_size))) P_TEST_ERROR; /* Initialize buffer indices */ @@ -2398,11 +2398,11 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) buf_size = ndsets * (ss * DSET_SELECT_DIM); /* Allocate buffers for all datasets */ - if (NULL == (total_swbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_swbuf = (uint8_t *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_swbuf_bak = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_swbuf_bak = (uint8_t *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_srbuf = (uint8_t *)HDmalloc(buf_size))) + if (NULL == (total_srbuf = (uint8_t *)malloc(buf_size))) P_TEST_ERROR; /* Initialize buffer indices */ @@ -2467,15 +2467,15 @@ test_multi_dsets_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf) P_TEST_ERROR; } - HDfree(total_wbuf); - HDfree(total_wbuf_bak); - HDfree(total_rbuf); - HDfree(total_lwbuf); - HDfree(total_lwbuf_bak); - HDfree(total_lrbuf); - HDfree(total_swbuf); - HDfree(total_swbuf_bak); - HDfree(total_srbuf); + free(total_wbuf); + free(total_wbuf_bak); + free(total_rbuf); + free(total_lwbuf); + free(total_lwbuf_bak); + free(total_lrbuf); + free(total_swbuf); + free(total_swbuf_bak); + free(total_srbuf); CHECK_PASSED(); @@ -2598,13 +2598,13 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un buf_size = ndsets * DSET_SELECT_DIM * sizeof(int); /* Allocate buffers for all datasets */ - if (NULL == (total_wbuf = (int *)HDmalloc(buf_size))) + if (NULL == (total_wbuf = (int *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_wbuf_bak = (int *)HDmalloc(buf_size))) + if (NULL == (total_wbuf_bak = (int *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_trans_wbuf = (int *)HDmalloc(buf_size))) + if (NULL == (total_trans_wbuf = (int *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_lrbuf = (long *)HDmalloc(ndsets * DSET_SELECT_DIM * sizeof(long)))) + if (NULL == (total_lrbuf = (long *)malloc(ndsets * DSET_SELECT_DIM * sizeof(long)))) P_TEST_ERROR; /* Initialize buffer indices */ @@ -2826,10 +2826,10 @@ test_multi_dsets_conv_sel_empty(hid_t fid, unsigned chunked, unsigned dtrans, un P_TEST_ERROR; } - HDfree(total_wbuf); - HDfree(total_wbuf_bak); - HDfree(total_trans_wbuf); - HDfree(total_lrbuf); + free(total_wbuf); + free(total_wbuf_bak); + free(total_trans_wbuf); + free(total_lrbuf); CHECK_PASSED(); @@ -3064,49 +3064,49 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) /* DSET_WITH_NO_CONV */ buf_size = ndsets * DSET_SELECT_DIM * sizeof(int); - if (NULL == (total_wbuf1 = (int *)HDmalloc(buf_size))) + if (NULL == (total_wbuf1 = (int *)malloc(buf_size))) P_TEST_ERROR; - if (mwbuf && NULL == (total_wbuf1_bak = (int *)HDmalloc(buf_size))) + if (mwbuf && NULL == (total_wbuf1_bak = (int *)malloc(buf_size))) P_TEST_ERROR; - if (NULL == (total_rbuf1 = (int *)HDmalloc(buf_size))) + if (NULL == (total_rbuf1 = (int *)malloc(buf_size))) P_TEST_ERROR; /* DSET_WITH_CONV_AND_NO_BKG */ buf_size = ndsets * DSET_SELECT_DIM * sizeof(unsigned long); - if (NULL == (ul_total_wbuf2 = (unsigned long *)HDmalloc(buf_size))) + if (NULL == (ul_total_wbuf2 = (unsigned long *)malloc(buf_size))) P_TEST_ERROR; - if (mwbuf && NULL == (ul_total_wbuf2_bak = (unsigned long *)HDmalloc(buf_size))) + if (mwbuf && NULL == (ul_total_wbuf2_bak = (unsigned long *)malloc(buf_size))) P_TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(long); - if (NULL == (l_total_rbuf2 = (long *)HDmalloc(buf_size))) + if (NULL == (l_total_rbuf2 = (long *)malloc(buf_size))) P_TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(long); - if (NULL == (l_total_wbuf2 = (long *)HDmalloc(buf_size))) + if (NULL == (l_total_wbuf2 = (long *)malloc(buf_size))) P_TEST_ERROR; - if (mwbuf && NULL == (l_total_wbuf2_bak = (long *)HDmalloc(buf_size))) + if (mwbuf && NULL == (l_total_wbuf2_bak = (long *)malloc(buf_size))) P_TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(short); - if (NULL == (s_total_rbuf2 = (short *)HDmalloc(buf_size))) + if (NULL == (s_total_rbuf2 = (short *)malloc(buf_size))) P_TEST_ERROR; /* DSET_WITH_CONV_AND_BKG */ buf_size = ndsets * DSET_SELECT_DIM * sizeof(s1_t); - if (NULL == (s1_total_wbuf3 = (s1_t *)HDmalloc(buf_size))) + if (NULL == (s1_total_wbuf3 = (s1_t *)malloc(buf_size))) P_TEST_ERROR; - if (mwbuf && NULL == (s1_total_wbuf3_bak = (s1_t *)HDmalloc(buf_size))) + if (mwbuf && NULL == (s1_total_wbuf3_bak = (s1_t *)malloc(buf_size))) P_TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(s3_t); - if (NULL == (s3_total_rbuf3 = (s3_t *)HDmalloc(buf_size))) + if (NULL == (s3_total_rbuf3 = (s3_t *)malloc(buf_size))) P_TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(s4_t); - if (NULL == (s4_total_wbuf3 = (s4_t *)HDmalloc(buf_size))) + if (NULL == (s4_total_wbuf3 = (s4_t *)malloc(buf_size))) P_TEST_ERROR; - if (mwbuf && NULL == (s4_total_wbuf3_bak = (s4_t *)HDmalloc(buf_size))) + if (mwbuf && NULL == (s4_total_wbuf3_bak = (s4_t *)malloc(buf_size))) P_TEST_ERROR; buf_size = ndsets * DSET_SELECT_DIM * sizeof(s1_t); - if (NULL == (s1_total_rbuf3 = (s1_t *)HDmalloc(buf_size))) + if (NULL == (s1_total_rbuf3 = (s1_t *)malloc(buf_size))) P_TEST_ERROR; /* Test with s settings for ndsets */ @@ -3344,37 +3344,37 @@ test_multi_dsets_all(int niter, hid_t fid, unsigned chunked, unsigned mwbuf) } /* Freeing */ - HDfree(total_wbuf1); + free(total_wbuf1); total_wbuf1 = NULL; - HDfree(total_wbuf1_bak); + free(total_wbuf1_bak); total_wbuf1_bak = NULL; - HDfree(total_rbuf1); + free(total_rbuf1); total_rbuf1 = NULL; - HDfree(ul_total_wbuf2); + free(ul_total_wbuf2); ul_total_wbuf2 = NULL; - HDfree(ul_total_wbuf2_bak); + free(ul_total_wbuf2_bak); ul_total_wbuf2_bak = NULL; - HDfree(l_total_rbuf2); + free(l_total_rbuf2); l_total_rbuf2 = NULL; - HDfree(l_total_wbuf2); + free(l_total_wbuf2); l_total_wbuf2 = NULL; - HDfree(l_total_wbuf2_bak); + free(l_total_wbuf2_bak); l_total_wbuf2_bak = NULL; - HDfree(s_total_rbuf2); + free(s_total_rbuf2); s_total_rbuf2 = NULL; - HDfree(s1_total_wbuf3); + free(s1_total_wbuf3); s1_total_wbuf3 = NULL; - HDfree(s1_total_wbuf3_bak); + free(s1_total_wbuf3_bak); s1_total_wbuf3_bak = NULL; - HDfree(s3_total_rbuf3); + free(s3_total_rbuf3); s3_total_rbuf3 = NULL; - HDfree(s4_total_wbuf3); + free(s4_total_wbuf3); s4_total_wbuf3 = NULL; - HDfree(s4_total_wbuf3_bak); + free(s4_total_wbuf3_bak); s4_total_wbuf3_bak = NULL; - HDfree(s1_total_rbuf3); + free(s1_total_rbuf3); s1_total_rbuf3 = NULL; } /* end for n niter */ diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index 38f9604..6aa74b3 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -191,28 +191,28 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker tv_ptr->block_ptr = &(tv_ptr->block[PAR_SS_DR_MAX_RANK - tv_ptr->large_rank]); /* Allocate buffers */ - tv_ptr->small_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); + tv_ptr->small_ds_buf_0 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->small_ds_size); VRFY((tv_ptr->small_ds_buf_0 != NULL), "malloc of small_ds_buf_0 succeeded"); - tv_ptr->small_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); + tv_ptr->small_ds_buf_1 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->small_ds_size); VRFY((tv_ptr->small_ds_buf_1 != NULL), "malloc of small_ds_buf_1 succeeded"); - tv_ptr->small_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_size); + tv_ptr->small_ds_buf_2 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->small_ds_size); VRFY((tv_ptr->small_ds_buf_2 != NULL), "malloc of small_ds_buf_2 succeeded"); - tv_ptr->small_ds_slice_buf = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->small_ds_slice_size); + tv_ptr->small_ds_slice_buf = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->small_ds_slice_size); VRFY((tv_ptr->small_ds_slice_buf != NULL), "malloc of small_ds_slice_buf succeeded"); - tv_ptr->large_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); + tv_ptr->large_ds_buf_0 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->large_ds_size); VRFY((tv_ptr->large_ds_buf_0 != NULL), "malloc of large_ds_buf_0 succeeded"); - tv_ptr->large_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); + tv_ptr->large_ds_buf_1 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->large_ds_size); VRFY((tv_ptr->large_ds_buf_1 != NULL), "malloc of large_ds_buf_1 succeeded"); - tv_ptr->large_ds_buf_2 = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_size); + tv_ptr->large_ds_buf_2 = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->large_ds_size); VRFY((tv_ptr->large_ds_buf_2 != NULL), "malloc of large_ds_buf_2 succeeded"); - tv_ptr->large_ds_slice_buf = (uint32_t *)HDmalloc(sizeof(uint32_t) * tv_ptr->large_ds_slice_size); + tv_ptr->large_ds_slice_buf = (uint32_t *)malloc(sizeof(uint32_t) * tv_ptr->large_ds_slice_size); VRFY((tv_ptr->large_ds_slice_buf != NULL), "malloc of large_ds_slice_buf succeeded"); /* initialize the buffers */ @@ -639,22 +639,22 @@ hs_dr_pio_test__takedown(struct hs_dr_pio_test_vars_t *tv_ptr) /* Free memory buffers */ if (tv_ptr->small_ds_buf_0 != NULL) - HDfree(tv_ptr->small_ds_buf_0); + free(tv_ptr->small_ds_buf_0); if (tv_ptr->small_ds_buf_1 != NULL) - HDfree(tv_ptr->small_ds_buf_1); + free(tv_ptr->small_ds_buf_1); if (tv_ptr->small_ds_buf_2 != NULL) - HDfree(tv_ptr->small_ds_buf_2); + free(tv_ptr->small_ds_buf_2); if (tv_ptr->small_ds_slice_buf != NULL) - HDfree(tv_ptr->small_ds_slice_buf); + free(tv_ptr->small_ds_slice_buf); if (tv_ptr->large_ds_buf_0 != NULL) - HDfree(tv_ptr->large_ds_buf_0); + free(tv_ptr->large_ds_buf_0); if (tv_ptr->large_ds_buf_1 != NULL) - HDfree(tv_ptr->large_ds_buf_1); + free(tv_ptr->large_ds_buf_1); if (tv_ptr->large_ds_buf_2 != NULL) - HDfree(tv_ptr->large_ds_buf_2); + free(tv_ptr->large_ds_buf_2); if (tv_ptr->large_ds_slice_buf != NULL) - HDfree(tv_ptr->large_ds_slice_buf); + free(tv_ptr->large_ds_slice_buf); return; @@ -4312,7 +4312,7 @@ main(int argc, char **argv) HDmemset(filenames, 0, sizeof(filenames)); for (int i = 0; i < NFILENAME; i++) { - if (NULL == (filenames[i] = HDmalloc(PATH_MAX))) { + if (NULL == (filenames[i] = malloc(PATH_MAX))) { printf("couldn't allocate filename array\n"); MPI_Abort(MPI_COMM_WORLD, -1); } @@ -4383,7 +4383,7 @@ main(int argc, char **argv) } for (int i = 0; i < NFILENAME; i++) { - HDfree(filenames[i]); + free(filenames[i]); filenames[i] = NULL; } diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 82da3bd..01f8889 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -238,9 +238,9 @@ coll_write_test(int chunk_factor) fsdim[0] = FSPACE_DIM1; fsdim[1] = (hsize_t)(FSPACE_DIM2 * mpi_size); - vector = (int *)HDmalloc(sizeof(int) * (size_t)mdim1[0] * (size_t)mpi_size); - matrix_out = (int *)HDmalloc(sizeof(int) * (size_t)mdim[0] * (size_t)mdim[1] * (size_t)mpi_size); - matrix_out1 = (int *)HDmalloc(sizeof(int) * (size_t)mdim[0] * (size_t)mdim[1] * (size_t)mpi_size); + vector = (int *)malloc(sizeof(int) * (size_t)mdim1[0] * (size_t)mpi_size); + matrix_out = (int *)malloc(sizeof(int) * (size_t)mdim[0] * (size_t)mdim[1] * (size_t)mpi_size); + matrix_out1 = (int *)malloc(sizeof(int) * (size_t)mdim[0] * (size_t)mdim[1] * (size_t)mpi_size); HDmemset(vector, 0, sizeof(int) * (size_t)mdim1[0] * (size_t)mpi_size); vector[0] = vector[MSPACE1_DIM * mpi_size - 1] = -1; @@ -619,11 +619,11 @@ coll_write_test(int chunk_factor) VRFY((ret >= 0), ""); if (vector) - HDfree(vector); + free(vector); if (matrix_out) - HDfree(matrix_out); + free(matrix_out); if (matrix_out1) - HDfree(matrix_out1); + free(matrix_out1); return; } @@ -685,8 +685,8 @@ coll_read_test(void) mdim[0] = MSPACE_DIM1; mdim[1] = (hsize_t)(MSPACE_DIM2 * mpi_size); - matrix_out = (int *)HDmalloc(sizeof(int) * (size_t)MSPACE_DIM1 * (size_t)MSPACE_DIM2 * (size_t)mpi_size); - matrix_out1 = (int *)HDmalloc(sizeof(int) * (size_t)MSPACE_DIM1 * (size_t)MSPACE_DIM2 * (size_t)mpi_size); + matrix_out = (int *)malloc(sizeof(int) * (size_t)MSPACE_DIM1 * (size_t)MSPACE_DIM2 * (size_t)mpi_size); + matrix_out1 = (int *)malloc(sizeof(int) * (size_t)MSPACE_DIM1 * (size_t)MSPACE_DIM2 * (size_t)mpi_size); /*** For testing collective hyperslab selection read ***/ @@ -846,8 +846,8 @@ coll_read_test(void) /* * Free read buffers. */ - HDfree(matrix_out); - HDfree(matrix_out1); + free(matrix_out); + free(matrix_out1); /* * Close memory file and memory dataspaces. @@ -1526,16 +1526,16 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ #endif /* LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG */ /* Allocate buffers */ - small_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); + small_ds_buf_0 = (uint32_t *)malloc(sizeof(uint32_t) * small_ds_size); VRFY((small_ds_buf_0 != NULL), "malloc of small_ds_buf_0 succeeded"); - small_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * small_ds_size); + small_ds_buf_1 = (uint32_t *)malloc(sizeof(uint32_t) * small_ds_size); VRFY((small_ds_buf_1 != NULL), "malloc of small_ds_buf_1 succeeded"); - large_ds_buf_0 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); + large_ds_buf_0 = (uint32_t *)malloc(sizeof(uint32_t) * large_ds_size); VRFY((large_ds_buf_0 != NULL), "malloc of large_ds_buf_0 succeeded"); - large_ds_buf_1 = (uint32_t *)HDmalloc(sizeof(uint32_t) * large_ds_size); + large_ds_buf_1 = (uint32_t *)malloc(sizeof(uint32_t) * large_ds_size); VRFY((large_ds_buf_1 != NULL), "malloc of large_ds_buf_1 succeeded"); /* initialize the buffers */ @@ -2249,14 +2249,14 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_ /* Free memory buffers */ if (small_ds_buf_0 != NULL) - HDfree(small_ds_buf_0); + free(small_ds_buf_0); if (small_ds_buf_1 != NULL) - HDfree(small_ds_buf_1); + free(small_ds_buf_1); if (large_ds_buf_0 != NULL) - HDfree(large_ds_buf_0); + free(large_ds_buf_0); if (large_ds_buf_1 != NULL) - HDfree(large_ds_buf_1); + free(large_ds_buf_1); return; diff --git a/testpar/t_subfiling_vfd.c b/testpar/t_subfiling_vfd.c index c30d551..f8043b1 100644 --- a/testpar/t_subfiling_vfd.c +++ b/testpar/t_subfiling_vfd.c @@ -322,8 +322,8 @@ test_config_file(void) VRFY((HDstat(SUBF_FILENAME, &file_info) >= 0), "HDstat succeeded"); - config_filename = HDmalloc(PATH_MAX); - VRFY(config_filename, "HDmalloc succeeded"); + config_filename = malloc(PATH_MAX); + VRFY(config_filename, "malloc succeeded"); HDsnprintf(config_filename, PATH_MAX, "%s/" H5FD_SUBFILING_CONFIG_FILENAME_TEMPLATE, config_dir, SUBF_FILENAME, (uint64_t)file_info.st_ino); @@ -331,7 +331,7 @@ test_config_file(void) config_file = HDfopen(config_filename, "r"); VRFY(config_file, "HDfopen succeeded"); - HDfree(config_filename); + free(config_filename); VRFY((HDfseek(config_file, 0, SEEK_END) >= 0), "HDfseek succeeded"); @@ -340,8 +340,8 @@ test_config_file(void) VRFY((HDfseek(config_file, 0, SEEK_SET) >= 0), "HDfseek succeeded"); - config_buf = HDmalloc((size_t)config_file_len + 1); - VRFY(config_buf, "HDmalloc succeeded"); + config_buf = malloc((size_t)config_file_len + 1); + VRFY(config_buf, "malloc succeeded"); VRFY((HDfread(config_buf, (size_t)config_file_len, 1, config_file) == 1), "HDfread succeeded"); config_buf[config_file_len] = '\0'; @@ -376,8 +376,8 @@ test_config_file(void) VRFY((H5_dirname(resolved_path, &subfile_dir) >= 0), "H5_dirname succeeded"); - tmp_buf = HDmalloc(PATH_MAX); - VRFY(tmp_buf, "HDmalloc succeeded"); + tmp_buf = malloc(PATH_MAX); + VRFY(tmp_buf, "malloc succeeded"); substr = HDstrstr(config_buf, "hdf5_file"); VRFY(substr, "HDstrstr succeeded"); @@ -395,12 +395,12 @@ test_config_file(void) VRFY((HDstrcmp(tmp_buf, subfile_dir) == 0), "HDstrcmp succeeded"); - HDfree(tmp_buf); + free(tmp_buf); H5MM_free(subfile_dir); - HDfree(resolved_path); + free(resolved_path); - subfile_name = HDmalloc(PATH_MAX); - VRFY(subfile_name, "HDmalloc succeeded"); + subfile_name = malloc(PATH_MAX); + VRFY(subfile_name, "malloc succeeded"); /* Verify the name of each subfile is in the configuration file */ num_digits = (int)(HDlog10(cfg.stripe_count) + 1); @@ -418,8 +418,8 @@ test_config_file(void) substr = HDstrstr(config_buf, subfile_name); VRFY(substr == NULL, "HDstrstr correctly failed"); - HDfree(subfile_name); - HDfree(config_buf); + free(subfile_name); + free(config_buf); VRFY((HDfclose(config_file) >= 0), "HDfclose on configuration file succeeded"); } @@ -462,8 +462,8 @@ test_stripe_sizes(void) if (MAINPROCESS) TESTING_2("random subfiling stripe sizes"); - tmp_filename = HDmalloc(PATH_MAX); - VRFY(tmp_filename, "HDmalloc succeeded"); + tmp_filename = malloc(PATH_MAX); + VRFY(tmp_filename, "malloc succeeded"); dxpl_id = H5Pcreate(H5P_DATASET_XFER); VRFY((dxpl_id >= 0), "DXPL creation succeeded"); @@ -511,8 +511,8 @@ test_stripe_sizes(void) nbytes = (size_t)(cfg.stripe_size * num_subfiles); - write_buf = HDmalloc(nbytes); - VRFY(write_buf, "HDmalloc succeeded"); + write_buf = malloc(nbytes); + VRFY(write_buf, "malloc succeeded"); HDmemset(write_buf, 255, nbytes); @@ -635,7 +635,7 @@ test_stripe_sizes(void) subfile_ptr = HDfopen(tmp_filename, "r"); VRFY(subfile_ptr == NULL, "HDfopen on subfile correctly failed"); - HDfree(write_buf); + free(write_buf); write_buf = NULL; VRFY((H5FDclose(file_ptr) >= 0), "H5FDclose succeeded"); @@ -673,8 +673,8 @@ test_stripe_sizes(void) nbytes = (size_t)(cfg.stripe_size * num_subfiles); - write_buf = HDmalloc(nbytes); - VRFY(write_buf, "HDmalloc succeeded"); + write_buf = malloc(nbytes); + VRFY(write_buf, "malloc succeeded"); HDmemset(write_buf, 255, nbytes); @@ -824,12 +824,12 @@ test_stripe_sizes(void) } H5E_END_TRY - HDfree(write_buf); + free(write_buf); VRFY((H5Pclose(fapl_id) >= 0), "FAPL close succeeded"); } - HDfree(tmp_filename); + free(tmp_filename); VRFY((H5Pclose(dxpl_id) >= 0), "DXPL close succeeded"); @@ -858,8 +858,8 @@ test_selection_strategies(void) if (MAINPROCESS) TESTING_2("I/O concentrator selection strategies"); - tmp_filename = HDmalloc(PATH_MAX); - VRFY(tmp_filename, "HDmalloc succeeded"); + tmp_filename = malloc(PATH_MAX); + VRFY(tmp_filename, "malloc succeeded"); for (H5FD_subfiling_ioc_select_t strategy = 0; strategy < ioc_selection_options; strategy++) { /* Skip 1 IOC per node strategy since we assume it's @@ -1024,7 +1024,7 @@ test_selection_strategies(void) mpi_code_g = MPI_Barrier(comm_g); VRFY((mpi_code_g == MPI_SUCCESS), "MPI_Barrier succeeded"); - HDfree(tmp_filename); + free(tmp_filename); CHECK_PASSED(); } @@ -1071,8 +1071,8 @@ test_read_different_stripe_size(void) if (MAINPROCESS) TESTING_2("file re-opening with different stripe size"); - tmp_filename = HDmalloc(PATH_MAX); - VRFY(tmp_filename, "HDmalloc succeeded"); + tmp_filename = malloc(PATH_MAX); + VRFY(tmp_filename, "malloc succeeded"); /* Use a 1MiB stripe size and a subfile for each IOC */ cfg.ioc_selection = SELECT_IOC_ONE_PER_NODE; @@ -1111,8 +1111,8 @@ test_read_different_stripe_size(void) VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, NULL, count, NULL) >= 0), "H5Sselect_hyperslab succeeded"); - buf = HDmalloc(count[0] * sizeof(SUBF_C_TYPE)); - VRFY(buf, "HDmalloc succeeded"); + buf = malloc(count[0] * sizeof(SUBF_C_TYPE)); + VRFY(buf, "malloc succeeded"); for (size_t i = 0; i < count[0]; i++) ((SUBF_C_TYPE *)buf)[i] = (SUBF_C_TYPE)((size_t)mpi_rank + i); @@ -1120,7 +1120,7 @@ test_read_different_stripe_size(void) VRFY((H5Dwrite(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, fspace_id, dxpl_id, buf) >= 0), "Dataset write succeeded"); - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Sclose(fspace_id) >= 0), "File dataspace close succeeded"); @@ -1181,8 +1181,8 @@ test_read_different_stripe_size(void) VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, NULL, count, NULL) >= 0), "H5Sselect_hyperslab succeeded"); - buf = HDcalloc(1, count[0] * sizeof(SUBF_C_TYPE)); - VRFY(buf, "HDcalloc succeeded"); + buf = calloc(1, count[0] * sizeof(SUBF_C_TYPE)); + VRFY(buf, "calloc succeeded"); VRFY((H5Dread(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, fspace_id, dxpl_id, buf) >= 0), "Dataset read succeeded"); @@ -1193,7 +1193,7 @@ test_read_different_stripe_size(void) VRFY((buf_value == (SUBF_C_TYPE)((size_t)mpi_rank + i)), "data verification succeeded"); } - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Sclose(fspace_id) >= 0), "File dataspace close succeeded"); @@ -1239,7 +1239,7 @@ test_read_different_stripe_size(void) VRFY((H5Pclose(dxpl_id) >= 0), "DXPL close succeeded"); VRFY((H5Pclose(fapl_id) >= 0), "FAPL close succeeded"); - HDfree(tmp_filename); + free(tmp_filename); CHECK_PASSED(); } @@ -1331,8 +1331,8 @@ test_subfiling_precreate_rank_0(void) H5Dcreate2(file_id, "DSET", SUBF_HDF5_TYPE, fspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset creation succeeded"); - buf = HDmalloc(dset_dims[0] * sizeof(SUBF_C_TYPE)); - VRFY(buf, "HDmalloc succeeded"); + buf = malloc(dset_dims[0] * sizeof(SUBF_C_TYPE)); + VRFY(buf, "malloc succeeded"); for (size_t i = 0; i < dset_dims[0]; i++) ((SUBF_C_TYPE *)buf)[i] = (SUBF_C_TYPE)((i / n_elements_per_rank) + (i % n_elements_per_rank)); @@ -1340,7 +1340,7 @@ test_subfiling_precreate_rank_0(void) VRFY((H5Dwrite(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, fspace_id, dxpl_id, buf) >= 0), "Dataset write succeeded"); - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Sclose(fspace_id) >= 0), "File dataspace close succeeded"); @@ -1357,8 +1357,8 @@ test_subfiling_precreate_rank_0(void) VRFY((HDstat(SUBF_FILENAME, &file_info) >= 0), "HDstat succeeded"); - tmp_filename = HDmalloc(PATH_MAX); - VRFY(tmp_filename, "HDmalloc succeeded"); + tmp_filename = malloc(PATH_MAX); + VRFY(tmp_filename, "malloc succeeded"); for (int i = 0; i < num_subfiles; i++) { h5_stat_t subfile_info; @@ -1386,7 +1386,7 @@ test_subfiling_precreate_rank_0(void) subfile_ptr = HDfopen(tmp_filename, "r"); VRFY(subfile_ptr == NULL, "HDfopen on subfile correctly failed"); - HDfree(tmp_filename); + free(tmp_filename); tmp_filename = NULL; } @@ -1413,8 +1413,8 @@ test_subfiling_precreate_rank_0(void) VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, NULL, count, NULL) >= 0), "H5Sselect_hyperslab succeeded"); - buf = HDcalloc(1, count[0] * sizeof(SUBF_C_TYPE)); - VRFY(buf, "HDcalloc succeeded"); + buf = calloc(1, count[0] * sizeof(SUBF_C_TYPE)); + VRFY(buf, "calloc succeeded"); VRFY((H5Dread(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, fspace_id, dxpl_id, buf) >= 0), "Dataset read succeeded"); @@ -1425,7 +1425,7 @@ test_subfiling_precreate_rank_0(void) VRFY((buf_value == (SUBF_C_TYPE)((size_t)mpi_rank + i)), "data verification succeeded"); } - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Sclose(fspace_id) >= 0), "File dataspace close succeeded"); @@ -1522,8 +1522,8 @@ test_subfiling_write_many_read_one(void) VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, NULL, count, NULL) >= 0), "H5Sselect_hyperslab succeeded"); - buf = HDmalloc(count[0] * sizeof(SUBF_C_TYPE)); - VRFY(buf, "HDmalloc succeeded"); + buf = malloc(count[0] * sizeof(SUBF_C_TYPE)); + VRFY(buf, "malloc succeeded"); for (size_t i = 0; i < count[0]; i++) ((SUBF_C_TYPE *)buf)[i] = (SUBF_C_TYPE)((size_t)mpi_rank + i); @@ -1531,7 +1531,7 @@ test_subfiling_write_many_read_one(void) VRFY((H5Dwrite(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, fspace_id, dxpl_id, buf) >= 0), "Dataset write succeeded"); - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1550,8 +1550,8 @@ test_subfiling_write_many_read_one(void) dset_id = H5Dopen2(file_id, "DSET", H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); - buf = HDcalloc(1, target_size); - VRFY(buf, "HDcalloc succeeded"); + buf = calloc(1, target_size); + VRFY(buf, "calloc succeeded"); VRFY((H5Dread(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, H5S_ALL, dxpl_id, buf) >= 0), "Dataset read succeeded"); @@ -1564,7 +1564,7 @@ test_subfiling_write_many_read_one(void) } } - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1678,8 +1678,8 @@ test_subfiling_write_many_read_few(void) VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, NULL, count, NULL) >= 0), "H5Sselect_hyperslab succeeded"); - buf = HDmalloc(count[0] * sizeof(SUBF_C_TYPE)); - VRFY(buf, "HDmalloc succeeded"); + buf = malloc(count[0] * sizeof(SUBF_C_TYPE)); + VRFY(buf, "malloc succeeded"); for (size_t i = 0; i < count[0]; i++) ((SUBF_C_TYPE *)buf)[i] = (SUBF_C_TYPE)((size_t)mpi_rank + i); @@ -1687,7 +1687,7 @@ test_subfiling_write_many_read_few(void) VRFY((H5Dwrite(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, fspace_id, dxpl_id, buf) >= 0), "Dataset write succeeded"); - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1736,8 +1736,8 @@ test_subfiling_write_many_read_few(void) dset_id = H5Dopen2(file_id, "DSET", H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); - buf = HDcalloc(1, target_size); - VRFY(buf, "HDcalloc succeeded"); + buf = calloc(1, target_size); + VRFY(buf, "calloc succeeded"); VRFY((H5Dread(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, H5S_ALL, dxpl_id, buf) >= 0), "Dataset read succeeded"); @@ -1750,7 +1750,7 @@ test_subfiling_write_many_read_few(void) } } - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -1903,8 +1903,8 @@ test_subfiling_h5fuse(void) VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, NULL, count, NULL) >= 0), "H5Sselect_hyperslab succeeded"); - buf = HDmalloc(count[0] * sizeof(SUBF_C_TYPE)); - VRFY(buf, "HDmalloc succeeded"); + buf = malloc(count[0] * sizeof(SUBF_C_TYPE)); + VRFY(buf, "malloc succeeded"); for (size_t i = 0; i < count[0]; i++) ((SUBF_C_TYPE *)buf)[i] = (SUBF_C_TYPE)((size_t)mpi_rank + i); @@ -1912,7 +1912,7 @@ test_subfiling_h5fuse(void) VRFY((H5Dwrite(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, fspace_id, dxpl_id, buf) >= 0), "Dataset write succeeded"); - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Sclose(fspace_id) >= 0), "File dataspace close succeeded"); @@ -1931,8 +1931,8 @@ test_subfiling_h5fuse(void) char *tmp_filename; char *args[7]; - tmp_filename = HDmalloc(PATH_MAX); - VRFY(tmp_filename, "HDmalloc succeeded"); + tmp_filename = malloc(PATH_MAX); + VRFY(tmp_filename, "malloc succeeded"); /* Generate name for configuration file */ HDsnprintf(tmp_filename, PATH_MAX, "%s/" H5FD_SUBFILING_CONFIG_FILENAME_TEMPLATE, config_dir, @@ -1980,8 +1980,8 @@ test_subfiling_h5fuse(void) dset_id = H5Dopen2(file_id, "DSET", H5P_DEFAULT); VRFY((dset_id >= 0), "Dataset open succeeded"); - buf = HDcalloc(1, target_size); - VRFY(buf, "HDcalloc succeeded"); + buf = calloc(1, target_size); + VRFY(buf, "calloc succeeded"); VRFY((H5Dread(dset_id, SUBF_HDF5_TYPE, H5S_BLOCK, H5S_ALL, dxpl_id, buf) >= 0), "Dataset read succeeded"); @@ -1994,7 +1994,7 @@ test_subfiling_h5fuse(void) } } - HDfree(buf); + free(buf); buf = NULL; VRFY((H5Dclose(dset_id) >= 0), "Dataset close succeeded"); @@ -2024,8 +2024,8 @@ test_subfiling_h5fuse(void) } H5E_END_TRY; - filename_buf = HDmalloc(PATH_MAX); - VRFY(filename_buf, "HDmalloc succeeded"); + filename_buf = malloc(PATH_MAX); + VRFY(filename_buf, "malloc succeeded"); /* Generate name for configuration file */ HDsnprintf(filename_buf, PATH_MAX, "%s/" H5FD_SUBFILING_CONFIG_FILENAME_TEMPLATE, config_dir, @@ -2049,7 +2049,7 @@ test_subfiling_h5fuse(void) } } - HDfree(filename_buf); + free(filename_buf); } VRFY((H5Pclose(fapl_id) >= 0), "FAPL close succeeded"); @@ -2248,7 +2248,7 @@ main(int argc, char **argv) printf("Using seed: %u\n\n", seed); /* Allocate buffer for possible config file directory specified */ - config_dir = HDmalloc(PATH_MAX); + config_dir = malloc(PATH_MAX); if (!config_dir) { if (MAINPROCESS) printf("couldn't allocate space for subfiling config file directory buffer\n"); diff --git a/testpar/t_vfd.c b/testpar/t_vfd.c index 88e6db1..d4ca277 100644 --- a/testpar/t_vfd.c +++ b/testpar/t_vfd.c @@ -141,11 +141,11 @@ alloc_and_init_file_images(int mpi_size) buf_len = INTS_PER_RANK * mpi_size; buf_size = sizeof(int32_t) * (size_t)INTS_PER_RANK * (size_t)mpi_size; - increasing_fi_buf = (int32_t *)HDmalloc(buf_size); - decreasing_fi_buf = (int32_t *)HDmalloc(buf_size); - negative_fi_buf = (int32_t *)HDmalloc(buf_size); - zero_fi_buf = (int32_t *)HDmalloc(buf_size); - read_fi_buf = (int32_t *)HDmalloc(buf_size); + increasing_fi_buf = (int32_t *)malloc(buf_size); + decreasing_fi_buf = (int32_t *)malloc(buf_size); + negative_fi_buf = (int32_t *)malloc(buf_size); + zero_fi_buf = (int32_t *)malloc(buf_size); + read_fi_buf = (int32_t *)malloc(buf_size); if ((!increasing_fi_buf) || (!decreasing_fi_buf) || (!negative_fi_buf) || (!zero_fi_buf) || (!read_fi_buf)) { @@ -203,31 +203,31 @@ free_file_images(void) { if (increasing_fi_buf) { - HDfree(increasing_fi_buf); + free(increasing_fi_buf); increasing_fi_buf = NULL; } if (decreasing_fi_buf) { - HDfree(decreasing_fi_buf); + free(decreasing_fi_buf); decreasing_fi_buf = NULL; } if (negative_fi_buf) { - HDfree(negative_fi_buf); + free(negative_fi_buf); negative_fi_buf = NULL; } if (zero_fi_buf) { - HDfree(zero_fi_buf); + free(zero_fi_buf); zero_fi_buf = NULL; } if (read_fi_buf) { - HDfree(read_fi_buf); + free(read_fi_buf); read_fi_buf = NULL; } diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index f83bd4e..dc28cc9 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -336,7 +336,7 @@ main(int argc, char **argv) HDmemset(filenames, 0, sizeof(filenames)); for (int i = 0; i < NFILENAME; i++) { - if (NULL == (filenames[i] = HDmalloc(PATH_MAX))) { + if (NULL == (filenames[i] = malloc(PATH_MAX))) { printf("couldn't allocate filename array\n"); MPI_Abort(MPI_COMM_WORLD, -1); } @@ -554,7 +554,7 @@ main(int argc, char **argv) } for (int i = 0; i < NFILENAME; i++) { - HDfree(filenames[i]); + free(filenames[i]); filenames[i] = NULL; } diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 8f8522b..cb3295f 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -297,7 +297,7 @@ free_exclude_path_list(diff_opt_t *opts) while (NULL != curr) { next = curr->next; - HDfree(curr); + free(curr); curr = next; } } @@ -315,7 +315,7 @@ free_exclude_attr_list(diff_opt_t *opts) while (NULL != curr) { next = curr->next; - HDfree(curr); + free(curr); curr = next; } } @@ -575,7 +575,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata) done: if (lnk_info.trg_path) - HDfree(lnk_info.trg_path); + free(lnk_info.trg_path); H5TOOLS_ENDDEBUG(" "); return ret_value; } @@ -710,7 +710,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - if ((obj1fullname = (char *)HDmalloc(HDstrlen(objname1) + 2)) == NULL) + if ((obj1fullname = (char *)malloc(HDstrlen(objname1) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); HDstrcpy(obj1fullname, "/"); @@ -729,7 +729,7 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); #else /* H5_HAVE_ASPRINTF */ /* (malloc 2 more for "/" and end-of-line) */ - if ((obj2fullname = (char *)HDmalloc(HDstrlen(objname2) + 2)) == NULL) + if ((obj2fullname = (char *)malloc(HDstrlen(objname2) + 2)) == NULL) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "name buffer allocation failed"); HDstrcpy(obj2fullname, "/"); HDstrcat(obj2fullname, objname2); @@ -1067,15 +1067,15 @@ done: /* free buffers */ if (obj1fullname) - HDfree(obj1fullname); + free(obj1fullname); if (obj2fullname) - HDfree(obj2fullname); + free(obj2fullname); /* free link info buffer */ if (trg_linfo1.trg_path) - HDfree(trg_linfo1.trg_path); + free(trg_linfo1.trg_path); if (trg_linfo2.trg_path) - HDfree(trg_linfo2.trg_path); + free(trg_linfo2.trg_path); /* close */ H5E_BEGIN_TRY @@ -1164,7 +1164,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, */ #ifdef H5_HAVE_PARALLEL { - char *workerTasks = (char *)HDmalloc((size_t)(g_nTasks - 1) * sizeof(char)); + char *workerTasks = (char *)malloc((size_t)(g_nTasks - 1) * sizeof(char)); int n; int busyTasks = 0; struct diffs_found nFoundbyWorker; @@ -1186,7 +1186,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ - if ((obj1_fullpath = (char *)HDmalloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == + if ((obj1_fullpath = (char *)malloc(HDstrlen(grp1_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } @@ -1204,7 +1204,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } #else /* H5_HAVE_ASPRINTF */ - if ((obj2_fullpath = (char *)HDmalloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == + if ((obj2_fullpath = (char *)malloc(HDstrlen(grp2_path) + HDstrlen(table->objs[i].name) + 1)) == NULL) { H5TOOLS_ERROR(H5DIFF_ERR, "name buffer allocation failed"); } @@ -1401,9 +1401,9 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, } /* end else */ #endif /* H5_HAVE_PARALLEL */ if (obj1_fullpath) - HDfree(obj1_fullpath); + free(obj1_fullpath); if (obj2_fullpath) - HDfree(obj2_fullpath); + free(obj2_fullpath); } /* end if */ } /* end for */ H5TOOLS_DEBUG("done with for loop - errstat:%d", opts->err_stat); @@ -1493,7 +1493,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, hid_t file2_id, } /* end if */ H5TOOLS_DEBUG("done with if block"); - HDfree(workerTasks); + free(workerTasks); } #endif /* H5_HAVE_PARALLEL */ @@ -1912,9 +1912,9 @@ done: /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + free(linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + free(linkinfo2.trg_path); /* close */ /* disable error reporting */ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 5cb22f1..37c17e5 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -1390,7 +1390,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di alloc_size = (hsize_t)nblocks1 * (unsigned)ndims1 * 2 * sizeof(ptdata1[0]); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if ((ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) { + if ((ptdata1 = (hsize_t *)malloc((size_t)alloc_size)) == NULL) { opts->err_stat = H5DIFF_ERR; H5TOOLS_INFO("Buffer allocation failed"); } @@ -1398,7 +1398,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t); H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1); - if ((ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) { + if ((ptdata2 = (hsize_t *)malloc((size_t)alloc_size)) == NULL) { opts->err_stat = H5DIFF_ERR; H5TOOLS_INFO("Buffer allocation failed"); } @@ -1446,10 +1446,10 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di parallel_print("\n"); } } - HDfree(ptdata2); + free(ptdata2); } /* else ptdata2 */ - HDfree(ptdata1); + free(ptdata1); } /* else ptdata1 */ } @@ -1462,7 +1462,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di alloc_size = (hsize_t)npoints1 * (unsigned)ndims1 * sizeof(ptdata1[0]); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if ((ptdata1 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) { + if ((ptdata1 = (hsize_t *)malloc((size_t)alloc_size)) == NULL) { opts->err_stat = H5DIFF_ERR; H5TOOLS_INFO("Buffer allocation failed"); } @@ -1470,7 +1470,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di H5_CHECK_OVERFLOW(npoints1, hssize_t, hsize_t); H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1); - if ((ptdata2 = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) { + if ((ptdata2 = (hsize_t *)malloc((size_t)alloc_size)) == NULL) { opts->err_stat = H5DIFF_ERR; H5TOOLS_INFO("Buffer allocation failed"); } @@ -1511,7 +1511,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di } } } - HDfree(ptdata2); + free(ptdata2); } /* else ptdata2 */ #if defined(H5DIFF_DEBUG) @@ -1526,7 +1526,7 @@ diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t region2_id, di parallel_print("\n"); #endif - HDfree(ptdata1); + free(ptdata1); } /* else ptdata1 */ } @@ -3101,7 +3101,7 @@ ull2float(unsigned long long ull_value, float *f_value) src_size = H5Tget_size(H5T_NATIVE_ULLONG); dst_size = H5Tget_size(H5T_NATIVE_FLOAT); - if ((buf = (unsigned char *)HDcalloc((size_t)1, MAX(src_size, dst_size))) == NULL) + if ((buf = (unsigned char *)calloc((size_t)1, MAX(src_size, dst_size))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for dims"); HDmemcpy(buf, &ull_value, src_size); @@ -3120,7 +3120,7 @@ done: H5E_END_TRY if (buf) - HDfree(buf); + free(buf); H5TOOLS_ENDDEBUG(" "); return ret_value; @@ -3493,14 +3493,14 @@ get_member_types(hid_t tid, mcomp_t *members) return; members->n = (unsigned)nmembs; - members->ids = (hid_t *)HDcalloc((size_t)members->n, sizeof(hid_t)); - members->offsets = (size_t *)HDcalloc((size_t)members->n, sizeof(size_t)); - members->m = (mcomp_t **)HDcalloc((size_t)members->n, sizeof(mcomp_t *)); + members->ids = (hid_t *)calloc((size_t)members->n, sizeof(hid_t)); + members->offsets = (size_t *)calloc((size_t)members->n, sizeof(size_t)); + members->m = (mcomp_t **)calloc((size_t)members->n, sizeof(mcomp_t *)); for (u = 0; u < members->n; u++) { members->ids[u] = H5Tget_member_type(tid, u); members->offsets[u] = H5Tget_member_offset(tid, u); - members->m[u] = (mcomp_t *)HDmalloc(sizeof(mcomp_t)); + members->m[u] = (mcomp_t *)malloc(sizeof(mcomp_t)); HDmemset(members->m[u], 0, sizeof(mcomp_t)); get_member_types(members->ids[u], members->m[u]); } @@ -3523,12 +3523,12 @@ close_member_types(mcomp_t *members) for (u = 0; u < members->n; u++) { if (members->m[u]) { close_member_types(members->m[u]); - HDfree(members->m[u]); + free(members->m[u]); } H5Tclose(members->ids[u]); } - HDfree(members->m); - HDfree(members->ids); - HDfree(members->offsets); + free(members->m); + free(members->ids); + free(members->offsets); } diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 5019a14..be70afd 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -45,7 +45,7 @@ typedef struct table_attrs_t { static void table_attrs_init(table_attrs_t **tbl) { - table_attrs_t *table_attrs = (table_attrs_t *)HDmalloc(sizeof(table_attrs_t)); + table_attrs_t *table_attrs = (table_attrs_t *)malloc(sizeof(table_attrs_t)); table_attrs->size = 0; table_attrs->nattrs = 0; @@ -77,13 +77,13 @@ table_attrs_free(table_attrs_t *table) if (table->attrs) { for (i = 0; i < table->nattrs; i++) { if (table->attrs[i].name) { - HDfree(table->attrs[i].name); + free(table->attrs[i].name); } } /* end for */ - HDfree(table->attrs); + free(table->attrs); table->attrs = NULL; } /* end if */ - HDfree(table); + free(table); table = NULL; } } @@ -109,7 +109,7 @@ table_attr_mark_exist(const unsigned *exist, char *name, table_attrs_t *table) match_attr_t *new_attrs; table->size = MAX(1, table->size * 2); - new_attrs = (match_attr_t *)HDrealloc(table->attrs, table->size * sizeof(match_attr_t)); + new_attrs = (match_attr_t *)realloc(table->attrs, table->size * sizeof(match_attr_t)); if (new_attrs) table->attrs = new_attrs; } /* end if */ @@ -396,7 +396,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na sz = HDstrlen(name1); H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); if (sz > 0) { - opts->obj_name[0] = (char *)HDmalloc(sz + 1); + opts->obj_name[0] = (char *)malloc(sz + 1); HDstrncpy(opts->obj_name[0], name1, sz + 1); } } @@ -404,7 +404,7 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na sz = HDstrlen(name2); H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); if (sz > 0) { - opts->obj_name[1] = (char *)HDmalloc(sz + 1); + opts->obj_name[1] = (char *)malloc(sz + 1); HDstrncpy(opts->obj_name[1], name2, sz + 1); } } @@ -440,8 +440,8 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na * read *---------------------------------------------------------------------- */ - buf1 = (void *)HDcalloc((size_t)(opts->nelmts), msize1); - buf2 = (void *)HDcalloc((size_t)(opts->nelmts), msize2); + buf1 = (void *)calloc((size_t)(opts->nelmts), msize1); + buf2 = (void *)calloc((size_t)(opts->nelmts), msize2); H5TOOLS_DEBUG("attr buffer size %ld * %ld", opts->nelmts, msize1); if (buf1 == NULL || buf2 == NULL) { parallel_print("cannot read into memory\n"); @@ -465,24 +465,24 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na /* format output string */ if (opts->obj_name[0] != NULL) - HDfree(opts->obj_name[0]); + free(opts->obj_name[0]); opts->obj_name[0] = NULL; if (opts->obj_name[1] != NULL) - HDfree(opts->obj_name[1]); + free(opts->obj_name[1]); opts->obj_name[1] = NULL; H5TOOLS_DEBUG("attr_names: %s - %s : %s - %s", name1, name2, path1, path2); if (name1) { sz = HDstrlen(name1) + HDstrlen(path1) + 7; H5TOOLS_DEBUG("attr1_name: %s - %d", name1, sz); - opts->obj_name[0] = (char *)HDcalloc(sz + 1, sizeof(char)); + opts->obj_name[0] = (char *)calloc(sz + 1, sizeof(char)); HDsnprintf(opts->obj_name[0], sz, "%s of <%s>", name1, path1); opts->obj_name[0][sz] = '\0'; } if (name2) { sz = HDstrlen(name2) + HDstrlen(path2) + 7; H5TOOLS_DEBUG("attr2_name: %s - %d", name2, sz); - opts->obj_name[1] = (char *)HDcalloc(sz + 1, sizeof(char)); + opts->obj_name[1] = (char *)calloc(sz + 1, sizeof(char)); HDsnprintf(opts->obj_name[1], sz, "%s of <%s>", name2, path2); opts->obj_name[1][sz] = '\0'; } @@ -531,22 +531,22 @@ diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const char *na *---------------------------------------------------------------------- */ if (opts->obj_name[0] != NULL) - HDfree(opts->obj_name[0]); + free(opts->obj_name[0]); opts->obj_name[0] = NULL; if (opts->obj_name[1] != NULL) - HDfree(opts->obj_name[1]); + free(opts->obj_name[1]); opts->obj_name[1] = NULL; /* Free buf1 and buf2, check both VLEN-data VLEN-string to reclaim any * VLEN memory first */ if (TRUE == h5tools_detect_vlen(mtype1_id)) H5Treclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1); - HDfree(buf1); + free(buf1); buf1 = NULL; if (TRUE == h5tools_detect_vlen(mtype2_id)) H5Treclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2); - HDfree(buf2); + free(buf2); buf2 = NULL; if (H5Tclose(ftype1_id) < 0) @@ -570,12 +570,12 @@ done: if (buf1) { if (buf1hasdata && TRUE == h5tools_detect_vlen(mtype1_id)) H5Treclaim(mtype1_id, space1_id, H5P_DEFAULT, buf1); - HDfree(buf1); + free(buf1); } /* end if */ if (buf2) { if (buf2hasdata && TRUE == h5tools_detect_vlen(mtype2_id)) H5Treclaim(mtype2_id, space2_id, H5P_DEFAULT, buf2); - HDfree(buf2); + free(buf2); } /* end if */ H5Tclose(ftype1_id); diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 61f4044..c0c5ba1 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -277,7 +277,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n j = (int)HDstrlen(obj1_name); H5TOOLS_DEBUG("obj1_name: %s - %d", obj1_name, j); if (j > 0) { - opts->obj_name[0] = (char *)HDmalloc((size_t)j + 1); + opts->obj_name[0] = (char *)malloc((size_t)j + 1); HDstrncpy(opts->obj_name[0], obj1_name, (size_t)j + 1); } } @@ -287,7 +287,7 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n j = (int)HDstrlen(obj2_name); H5TOOLS_DEBUG("obj2_name: %s - %d", obj2_name, j); if (j > 0) { - opts->obj_name[1] = (char *)HDmalloc((size_t)j + 1); + opts->obj_name[1] = (char *)malloc((size_t)j + 1); HDstrncpy(opts->obj_name[1], obj2_name, (size_t)j + 1); } } @@ -424,10 +424,10 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n H5TOOLS_DEBUG("obj_names: %s - %s", obj1_name, obj2_name); if (opts->obj_name[0] != NULL) - HDfree(opts->obj_name[0]); + free(opts->obj_name[0]); opts->obj_name[0] = NULL; if (opts->obj_name[1] != NULL) - HDfree(opts->obj_name[1]); + free(opts->obj_name[1]); opts->obj_name[1] = NULL; if (obj1_name) @@ -442,8 +442,8 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n *----------------------------------------------------------------- */ if (need < H5TOOLS_MALLOCSIZE) { - buf1 = HDmalloc(need); - buf2 = HDmalloc(need); + buf1 = malloc(need); + buf2 = malloc(need); } /* end if */ /* Assume entire data space to be printed */ @@ -478,11 +478,11 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n if (vl_data2) H5Treclaim(m_tid2, sid2, H5P_DEFAULT, buf2); if (buf1 != NULL) { - HDfree(buf1); + free(buf1); buf1 = NULL; } if (buf2 != NULL) { - HDfree(buf2); + free(buf2); buf2 = NULL; } } /* end if */ @@ -520,14 +520,14 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n /* reclaim any VL memory, if necessary */ if (vl_data1) H5Treclaim(m_tid1, sid1, H5P_DEFAULT, buf1); - HDfree(buf1); + free(buf1); buf1 = NULL; } if (buf2 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data2) H5Treclaim(m_tid2, sid2, H5P_DEFAULT, buf2); - HDfree(buf2); + free(buf2); buf2 = NULL; } @@ -557,26 +557,26 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n * dimensions */ if (!opts->sset[0]->start.data) { /* default to (0, 0, ...) for the start coord */ - opts->sset[0]->start.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->start.data = (hsize_t *)calloc((size_t)rank1, sizeof(hsize_t)); opts->sset[0]->start.len = (unsigned)rank1; } if (!opts->sset[0]->stride.data) { - opts->sset[0]->stride.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->stride.data = (hsize_t *)calloc((size_t)rank1, sizeof(hsize_t)); opts->sset[0]->stride.len = (unsigned)rank1; for (i = 0; i < rank1; i++) opts->sset[0]->stride.data[i] = 1; } if (!opts->sset[0]->count.data) { - opts->sset[0]->count.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->count.data = (hsize_t *)calloc((size_t)rank1, sizeof(hsize_t)); opts->sset[0]->count.len = (unsigned)rank1; for (i = 0; i < rank1; i++) opts->sset[0]->count.data[i] = 1; } if (!opts->sset[0]->block.data) { - opts->sset[0]->block.data = (hsize_t *)HDcalloc((size_t)rank1, sizeof(hsize_t)); + opts->sset[0]->block.data = (hsize_t *)calloc((size_t)rank1, sizeof(hsize_t)); opts->sset[0]->block.len = (unsigned)rank1; for (i = 0; i < rank1; i++) opts->sset[0]->block.data[i] = 1; @@ -618,26 +618,26 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n * dimensions */ if (!opts->sset[1]->start.data) { /* default to (0, 0, ...) for the start coord */ - opts->sset[1]->start.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->start.data = (hsize_t *)calloc((size_t)rank2, sizeof(hsize_t)); opts->sset[1]->start.len = (unsigned)rank2; } if (!opts->sset[1]->stride.data) { - opts->sset[1]->stride.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->stride.data = (hsize_t *)calloc((size_t)rank2, sizeof(hsize_t)); opts->sset[1]->stride.len = (unsigned)rank2; for (i = 0; i < rank2; i++) opts->sset[1]->stride.data[i] = 1; } if (!opts->sset[1]->count.data) { - opts->sset[1]->count.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->count.data = (hsize_t *)calloc((size_t)rank2, sizeof(hsize_t)); opts->sset[1]->count.len = (unsigned)rank2; for (i = 0; i < rank2; i++) opts->sset[1]->count.data[i] = 1; } if (!opts->sset[1]->block.data) { - opts->sset[1]->block.data = (hsize_t *)HDcalloc((size_t)rank2, sizeof(hsize_t)); + opts->sset[1]->block.data = (hsize_t *)calloc((size_t)rank2, sizeof(hsize_t)); opts->sset[1]->block.len = (unsigned)rank2; for (i = 0; i < rank2; i++) opts->sset[1]->block.data[i] = 1; @@ -696,9 +696,9 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n for (elmtno = 0; elmtno < opts->nelmts; elmtno += opts->hs_nelmts) { H5TOOLS_DEBUG("elmtno: %ld - hs_nelmts1: %ld", elmtno, hs_nelmts1); - if (NULL == (sm_buf1 = (unsigned char *)HDmalloc((size_t)sm_nbytes))) + if (NULL == (sm_buf1 = (unsigned char *)malloc((size_t)sm_nbytes))) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not allocate buffer for strip-mine"); - if (NULL == (sm_buf2 = (unsigned char *)HDmalloc((size_t)sm_nbytes))) + if (NULL == (sm_buf2 = (unsigned char *)malloc((size_t)sm_nbytes))) H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "Could not allocate buffer for strip-mine"); /* calculate the hyperslab size */ @@ -809,14 +809,14 @@ diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_n /* reclaim any VL memory, if necessary */ if (vl_data1) H5Treclaim(m_tid1, sm_space1, H5P_DEFAULT, sm_buf1); - HDfree(sm_buf1); + free(sm_buf1); sm_buf1 = NULL; } if (sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data2) H5Treclaim(m_tid2, sm_space2, H5P_DEFAULT, sm_buf2); - HDfree(sm_buf2); + free(sm_buf2); sm_buf2 = NULL; } @@ -878,10 +878,10 @@ done: H5TOOLS_DEBUG("free names - errstat:%d", opts->err_stat); /* free */ if (opts->obj_name[0] != NULL) - HDfree(opts->obj_name[0]); + free(opts->obj_name[0]); opts->obj_name[0] = NULL; if (opts->obj_name[1] != NULL) - HDfree(opts->obj_name[1]); + free(opts->obj_name[1]); opts->obj_name[1] = NULL; H5TOOLS_DEBUG("reclaim any VL memory"); @@ -889,14 +889,14 @@ done: /* reclaim any VL memory, if necessary */ if (vl_data1) H5Treclaim(m_tid1, sid1, H5P_DEFAULT, buf1); - HDfree(buf1); + free(buf1); buf1 = NULL; } if (buf2 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data2) H5Treclaim(m_tid2, sid2, H5P_DEFAULT, buf2); - HDfree(buf2); + free(buf2); buf2 = NULL; } H5TOOLS_DEBUG("reclaim any stripmine VL memory"); @@ -904,14 +904,14 @@ done: /* reclaim any VL memory, if necessary */ if (vl_data1) H5Treclaim(m_tid1, sm_space1, H5P_DEFAULT, sm_buf1); - HDfree(sm_buf1); + free(sm_buf1); sm_buf1 = NULL; } if (sm_buf2 != NULL) { /* reclaim any VL memory, if necessary */ if (vl_data2) H5Treclaim(m_tid2, sm_space2, H5P_DEFAULT, sm_buf2); - HDfree(sm_buf2); + free(sm_buf2); sm_buf2 = NULL; } diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index e0e3e06..50c6aae 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -2043,7 +2043,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t contai H5TOOLS_THROW((-1), "H5Dget_space failed"); /* Allocate space for the dimension array */ - if ((dims1 = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((dims1 = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for dims"); /* find the dimensions of each data space from the block coordinates */ @@ -2060,15 +2060,15 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, hid_t contai if ((type_size = H5Tget_size(type_id)) == 0) H5TOOLS_THROW((-1), "H5Tget_size failed"); - if ((region_buf = HDmalloc(type_size * (size_t)numelem)) == NULL) + if ((region_buf = malloc(type_size * (size_t)numelem)) == NULL) H5TOOLS_THROW((-1), "Could not allocate region buffer"); /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ /* 1 2 n 1 2 n */ - if ((start = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((start = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for start"); - if ((count = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((count = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for count"); for (blkndx = 0; blkndx < nblocks; blkndx++) { @@ -2093,10 +2093,10 @@ done:; } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ CATCH - HDfree(start); - HDfree(count); - HDfree(region_buf); - HDfree(dims1); + free(start); + free(count); + free(region_buf); + free(dims1); if (H5Sclose(mem_space) < 0) H5TOOLS_ERROR((-1), "H5Sclose failed"); @@ -2142,7 +2142,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *strea ndims = (unsigned)sndims; alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); - if ((ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) + if ((ptdata = (hsize_t *)malloc((size_t)alloc_size)) == NULL) H5TOOLS_GOTO_ERROR(FALSE, "Could not allocate buffer for ptdata"); if (H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0) @@ -2156,7 +2156,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *strea render_bin_output_region_data_blocks(region_id, stream, container, ndims, type_id, nblocks, ptdata); done: - HDfree(ptdata); + free(ptdata); if (type_id > 0 && H5Tclose(type_id) < 0) H5TOOLS_ERROR(FALSE, "H5Tclose failed"); @@ -2202,11 +2202,11 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE * if ((type_size = H5Tget_size(type_id)) == 0) H5TOOLS_GOTO_ERROR((-1), "H5Tget_size failed"); - if ((region_buf = HDmalloc(type_size * (size_t)npoints)) == NULL) + if ((region_buf = malloc(type_size * (size_t)npoints)) == NULL) H5TOOLS_GOTO_ERROR((-1), "Could not allocate buffer for region"); /* Allocate space for the dimension array */ - if ((dims1 = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((dims1 = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_GOTO_ERROR((-1), "Could not allocate buffer for dims"); dims1[0] = npoints; @@ -2222,8 +2222,8 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE * H5TOOLS_GOTO_ERROR((-1), "render_bin_output of data points failed"); done: - HDfree(region_buf); - HDfree(dims1); + free(region_buf); + free(dims1); if (H5Sclose(mem_space) < 0) H5TOOLS_ERROR((-1), "H5Sclose failed"); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 1273065..df91842 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -514,7 +514,7 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for H5TOOLS_GOTO_ERROR(FAIL, "H5Dget_space failed"); /* Allocate space for the dimension array */ - if ((dims1 = (hsize_t *)HDmalloc((size_t)(sizeof(hsize_t) * ndims))) == NULL) + if ((dims1 = (hsize_t *)malloc((size_t)(sizeof(hsize_t) * ndims))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for dims"); /* find the dimensions of each data space from the block coordinates */ @@ -528,15 +528,15 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for if ((mem_space = H5Screate_simple((int)ndims, dims1, NULL)) < 0) H5TOOLS_GOTO_ERROR(FAIL, "H5Screate_simple failed"); - if ((region_buf = HDmalloc(type_size * (size_t)numelem)) == NULL) + if ((region_buf = malloc(type_size * (size_t)numelem)) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate region buffer"); /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ /* 1 2 n 1 2 n */ - if ((start = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((start = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for start"); - if ((count = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((count = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "Could not allocate buffer for count"); curr_pos = 0; @@ -614,10 +614,10 @@ h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_for } /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */ done: - HDfree(start); - HDfree(count); - HDfree(region_buf); - HDfree(dims1); + free(start); + free(count); + free(region_buf); + free(dims1); if (H5Sclose(mem_space) < 0) H5TOOLS_ERROR(FAIL, "H5Sclose failed"); @@ -713,7 +713,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea alloc_size = nblocks * ndims * 2 * sizeof(ptdata[0]); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if ((ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)) == NULL) + if ((ptdata = (hsize_t *)malloc((size_t)alloc_size)) == NULL) H5TOOLS_GOTO_ERROR(dimension_break, "Could not allocate buffer for ptdata"); if (H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, nblocks, ptdata) < 0) @@ -809,7 +809,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id, FILE *strea } done: - HDfree(ptdata); + free(ptdata); if (type_id > 0 && H5Tclose(type_id) < 0) H5TOOLS_ERROR(dimension_break, "H5Tclose failed"); @@ -903,7 +903,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre HDmemset(&ctx, 0, sizeof(ctx)); /* Allocate space for the dimension array */ - if ((dims1 = (hsize_t *)HDmalloc(sizeof(hsize_t) * ndims)) == NULL) + if ((dims1 = (hsize_t *)malloc(sizeof(hsize_t) * ndims)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for dims"); dims1[0] = npoints; @@ -915,7 +915,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre if ((type_size = H5Tget_size(type_id)) == 0) H5TOOLS_THROW((-1), "H5Tget_size failed"); - if ((region_buf = HDmalloc(type_size * (size_t)npoints)) == NULL) + if ((region_buf = malloc(type_size * (size_t)npoints)) == NULL) H5TOOLS_THROW((-1), "Could not allocate buffer for region"); curr_pos = 0; @@ -978,9 +978,9 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, FILE *stre } /* end for (jndx = 0; jndx < npoints; jndx++, elmtno++) */ done: - HDfree(region_buf); + free(region_buf); CATCH - HDfree(dims1); + free(dims1); if (H5Sclose(mem_space) < 0) H5TOOLS_ERROR((-1), "H5Sclose failed"); @@ -1072,7 +1072,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea alloc_size = npoints * ndims * sizeof(ptdata[0]); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size))) + if (NULL == (ptdata = (hsize_t *)malloc((size_t)alloc_size))) H5TOOLS_GOTO_ERROR(dimension_break, "Could not allocate buffer for ptdata"); if (H5Sget_select_elem_pointlist(region_space, (hsize_t)0, npoints, ptdata) < 0) @@ -1164,7 +1164,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id, FILE *strea } done: - HDfree(ptdata); + free(ptdata); if (type_id > 0 && H5Tclose(type_id) < 0) H5TOOLS_ERROR(dimension_break, "H5Tclose failed"); @@ -1321,7 +1321,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c } 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))) + if (NULL == (sm_buf = (unsigned char *)malloc((size_t)sm_nelmts * p_type_nbytes))) H5TOOLS_THROW(FAIL, "Could not allocate buffer for strip-mine"); if ((sm_space = H5Screate_simple(1, &sm_nelmts, NULL)) < 0) @@ -1370,7 +1370,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c if (H5Sclose(sm_space) < 0) H5TOOLS_THROW(FAIL, "H5Sclose failed"); if (sm_buf) - HDfree(sm_buf); + free(sm_buf); sm_buf = NULL; } else @@ -1382,7 +1382,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c CATCH if (sm_buf) - HDfree(sm_buf); + free(sm_buf); H5TOOLS_ENDDEBUG(" "); return ret_value; @@ -1700,7 +1700,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont goto done; assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ - if (NULL != (sm_buf = (unsigned char *)HDmalloc((size_t)sm_nbytes))) { + if (NULL != (sm_buf = (unsigned char *)malloc((size_t)sm_nbytes))) { H5TOOLS_DEBUG("stripmine size:%ld", sm_nbytes); sm_nelmts = sm_nbytes / p_type_nbytes; @@ -1772,7 +1772,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont ctx->continuation++; H5TOOLS_DEBUG("stripmine read loop:%d complete", i); } - HDfree(sm_buf); + free(sm_buf); } /* if (NULL != (sm_buf...)) */ done: @@ -1849,7 +1849,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte alloc_size = p_nelmts * H5Tget_size(p_type); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - if (NULL != (buf = (unsigned char *)HDmalloc((size_t)alloc_size))) { + if (NULL != (buf = (unsigned char *)malloc((size_t)alloc_size))) { H5TOOLS_DEBUG("ctx->ndims:%d", ctx->ndims); H5TOOLS_DEBUG("Read the data"); @@ -1865,7 +1865,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte } else H5TOOLS_ERROR((-1), "H5Aread failed"); - HDfree(buf); + free(buf); } /* if (NULL != (buf...)) */ done: if (f_space >= 0 && H5Sclose(f_space) < 0) @@ -2776,9 +2776,9 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i dst_size = type_size; /* Get the names and raw values of all members */ - if (NULL == (name = (char **)HDcalloc((size_t)nmembs, sizeof(char *)))) + if (NULL == (name = (char **)calloc((size_t)nmembs, sizeof(char *)))) H5TOOLS_THROW((-1), "Could not allocate buffer for member name"); - if (NULL == (value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(type_size, dst_size)))) + if (NULL == (value = (unsigned char *)calloc((size_t)nmembs, MAX(type_size, dst_size)))) H5TOOLS_THROW((-1), "Could not allocate buffer for member value"); for (i = 0; i < nmembs; i++) { @@ -2840,11 +2840,11 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i for (i = 0; i < nmembs; i++) if (name[i]) H5free_memory(name[i]); - HDfree(name); + free(name); } /* end if */ if (value) - HDfree(value); + free(value); if (super >= 0 && H5Tclose(super) < 0) H5TOOLS_THROW((-1), "Could not close datatype's super class"); @@ -3081,7 +3081,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer /*in,out*/, const h5tool_format_t n_type = H5Tget_native_type(type_id, H5T_DIR_DEFAULT); size = H5Tget_size(n_type); - buf = HDmalloc(size); + buf = malloc(size); H5Pget_fill_value(dcpl, n_type, buf); @@ -3090,7 +3090,7 @@ h5tools_print_fill_value(h5tools_str_t *buffer /*in,out*/, const h5tool_format_t H5Tclose(n_type); if (buf) - HDfree(buf); + free(buf); } /*------------------------------------------------------------------------- @@ -3782,7 +3782,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_ /* call H5Oget_comment again with the correct value */ if (cmt_bufsize > 0) { - comment = (char *)HDmalloc((size_t)(cmt_bufsize + 1)); /* new_size including null terminator */ + comment = (char *)malloc((size_t)(cmt_bufsize + 1)); /* new_size including null terminator */ if (comment) { cmt_bufsize = H5Oget_comment(obj_id, comment, (size_t)cmt_bufsize); if (cmt_bufsize > 0) { @@ -3797,7 +3797,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, h5tools_context_ h5tools_str_close(&buffer); } - HDfree(comment); + free(comment); } } } /* end dump_comment() */ @@ -4356,23 +4356,23 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t * datactx.need_prefix = TRUE; if (NULL != - (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { + (ref_buf = (H5R_ref_t *)calloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { if (obj_data) { if (H5Dread(obj_id, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_buf) < 0) { - HDfree(ref_buf); + free(ref_buf); H5TOOLS_INFO("H5Dread reference failed"); H5TOOLS_GOTO_DONE_NO_RET(); } } else { if (H5Aread(obj_id, H5T_STD_REF, ref_buf) < 0) { - HDfree(ref_buf); + free(ref_buf); H5TOOLS_INFO("H5Aread reference failed"); H5TOOLS_GOTO_DONE_NO_RET(); } } h5tools_dump_reference(stream, &outputformat, &datactx, obj_id, ref_buf, ndims); - HDfree(ref_buf); + free(ref_buf); } ctx->indent_level--; } diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c index 33f9dd6..59f9ece 100644 --- a/tools/lib/h5tools_ref.c +++ b/tools/lib/h5tools_ref.c @@ -58,8 +58,8 @@ free_ref_path_info(void *item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op { ref_path_node_t *node = (ref_path_node_t *)item; - HDfree(node->path); - HDfree(node); + free(node->path); + free(node); return (0); } @@ -239,7 +239,7 @@ ref_path_table_put(const char *path, const H5O_token_t *token) ref_path_node_t *new_node; if (ref_path_table && path) { - if ((new_node = (ref_path_node_t *)HDmalloc(sizeof(ref_path_node_t))) == NULL) + if ((new_node = (ref_path_node_t *)malloc(sizeof(ref_path_node_t))) == NULL) return (-1); HDmemcpy(&new_node->obj_token, token, sizeof(H5O_token_t)); diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index a923a52..7428a78 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -64,7 +64,7 @@ void h5tools_str_close(h5tools_str_t *str) { if (str && str->nalloc) { - HDfree(str->s); + free(str->s); HDmemset(str, 0, sizeof(h5tools_str_t)); } } @@ -150,7 +150,7 @@ h5tools_str_append(h5tools_str_t *str /*in,out*/, const char *fmt, ...) */ size_t newsize = MAX(str->len + (size_t)nchars + 1, 2 * str->nalloc); assert(newsize > str->nalloc); /*overflow*/ - str->s = (char *)HDrealloc(str->s, newsize); + str->s = (char *)realloc(str->s, newsize); assert(str->s); str->nalloc = newsize; } @@ -183,7 +183,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); + str->s = (char *)malloc(str->nalloc); assert(str->s); } @@ -253,7 +253,7 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) size_t n = sizeof(_temp); if (str->len - start + 1 > n) { n = str->len - start + 1; - temp = (char *)HDmalloc(n); + temp = (char *)malloc(n); assert(temp); } @@ -269,7 +269,7 @@ h5tools_str_fmt(h5tools_str_t *str /*in,out*/, size_t start, const char *fmt) /* Free the temp buffer if we allocated one */ if (temp != _temp) - HDfree(temp); + free(temp); return str->s; } @@ -472,7 +472,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]); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata = (hsize_t *)HDmalloc((size_t)alloc_size); + ptdata = (hsize_t *)malloc((size_t)alloc_size); H5Sget_select_hyper_blocklist(rspace, (hsize_t)0, nblocks, ptdata); for (u = 0; u < nblocks; u++) { @@ -493,7 +493,7 @@ h5tools_str_dump_space_blocks(h5tools_str_t *str, hid_t rspace, const h5tool_for H5_GCC_CLANG_DIAG_ON("format-nonliteral") } - HDfree(ptdata); + free(ptdata); } /* end if (nblocks > 0) */ } @@ -533,7 +533,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]); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - ptdata = (hsize_t *)HDmalloc((size_t)alloc_size); + ptdata = (hsize_t *)malloc((size_t)alloc_size); H5Sget_select_elem_pointlist(rspace, (hsize_t)0, npoints, ptdata); for (u = 0; u < npoints; u++) { @@ -550,7 +550,7 @@ h5tools_str_dump_space_points(h5tools_str_t *str, hid_t rspace, const h5tool_for H5_GCC_CLANG_DIAG_ON("format-nonliteral") } - HDfree(ptdata); + free(ptdata); } /* end if (npoints > 0) */ } @@ -1442,38 +1442,38 @@ h5tools_str_sprint_reference(h5tools_str_t *str, H5R_ref_t *ref_vp) buf_size = H5Rget_file_name(ref_vp, NULL, 0); H5TOOLS_DEBUG("buf_size=%ld", buf_size); if (buf_size) { - char *file_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1); + char *file_name = (char *)malloc(sizeof(char) * (size_t)buf_size + 1); if (H5Rget_file_name(ref_vp, file_name, (size_t)buf_size + 1) >= 0) { file_name[buf_size] = '\0'; H5TOOLS_DEBUG("name=%s", file_name); h5tools_str_append(str, "%s", file_name); } - HDfree(file_name); + free(file_name); } buf_size = H5Rget_obj_name(ref_vp, H5P_DEFAULT, NULL, 0); H5TOOLS_DEBUG("buf_size=%ld", buf_size); if (buf_size) { - char *obj_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1); + char *obj_name = (char *)malloc(sizeof(char) * (size_t)buf_size + 1); if (H5Rget_obj_name(ref_vp, H5P_DEFAULT, obj_name, (size_t)buf_size + 1) >= 0) { obj_name[buf_size] = '\0'; H5TOOLS_DEBUG("name=%s", obj_name); h5tools_str_append(str, "%s", obj_name); } - HDfree(obj_name); + free(obj_name); } if (H5Rget_type(ref_vp) == H5R_ATTR) { buf_size = H5Rget_attr_name(ref_vp, NULL, 0); H5TOOLS_DEBUG("buf_size=%ld", buf_size); if (buf_size) { - char *attr_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1); + char *attr_name = (char *)malloc(sizeof(char) * (size_t)buf_size + 1); if (H5Rget_attr_name(ref_vp, attr_name, (size_t)buf_size + 1) >= 0) { attr_name[buf_size] = '\0'; H5TOOLS_DEBUG("name=%s", attr_name); h5tools_str_append(str, "/%s", attr_name); } - HDfree(attr_name); + free(attr_name); } } h5tools_str_append(str, "\""); @@ -1622,10 +1622,10 @@ h5tools_str_replace(const char *string, const char *substr, const char *replacem char *oldstr; oldstr = newstr; - newstr = (char *)HDmalloc(HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement) + 1); + newstr = (char *)malloc(HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement) + 1); if (newstr == NULL) { - HDfree(oldstr); + free(oldstr); return NULL; } HDmemcpy(newstr, oldstr, (size_t)(tok - oldstr)); @@ -1635,7 +1635,7 @@ h5tools_str_replace(const char *string, const char *substr, const char *replacem HDmemset(newstr + HDstrlen(oldstr) - HDstrlen(substr) + HDstrlen(replacement), 0, 1); /* move back head right after the last replacement */ head = newstr + (tok - oldstr) + HDstrlen(replacement); - HDfree(oldstr); + free(oldstr); } return newstr; diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 6cc9125..dd69eb8 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -205,7 +205,7 @@ parse_hsize_list(const char *h_list, subset_d *d) H5TOOLS_DEBUG("Number integers to read=%ld", size_count); /* allocate an array for the integers in the list */ - if ((p_list = (hsize_t *)HDcalloc(size_count, sizeof(hsize_t))) == NULL) + if ((p_list = (hsize_t *)calloc(size_count, sizeof(hsize_t))) == NULL) H5TOOLS_INFO("Unable to allocate space for subset data"); for (ptr = h_list; i < size_count && ptr && *ptr && *ptr != ';' && *ptr != ']'; ptr++) @@ -247,7 +247,7 @@ parse_subset_params(const char *dset) if ((brace = HDstrrchr(q_dset, '[')) != NULL) { *brace++ = '\0'; - s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); + s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); parse_hsize_list(brace, &s->start); while (*brace && *brace != ';') @@ -383,7 +383,7 @@ parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems, char * /* create list */ - elems = (char **)HDmalloc(sizeof(char *) * (init_slots + 1)); + elems = (char **)malloc(sizeof(char *) * (init_slots + 1)); if (elems == NULL) { ret_value = FAIL; goto done; @@ -391,8 +391,8 @@ parse_tuple(const char *start, int sep, char **cpy_out, unsigned *nelems, char * /* create destination string */ - start++; /* advance past opening paren '(' */ - cpy = (char *)HDmalloc(sizeof(char) * (HDstrlen(start))); /* no +1; less '(' */ + start++; /* advance past opening paren '(' */ + cpy = (char *)malloc(sizeof(char) * (HDstrlen(start))); /* no +1; less '(' */ if (cpy == NULL) { ret_value = FAIL; goto done; @@ -541,12 +541,12 @@ print_version(const char *progname) static void init_table(hid_t fid, table_t **tbl) { - table_t *table = (table_t *)HDmalloc(sizeof(table_t)); + table_t *table = (table_t *)malloc(sizeof(table_t)); table->fid = fid; table->size = 20; table->nobjs = 0; - table->objs = (obj_t *)HDmalloc(table->size * sizeof(obj_t)); + table->objs = (obj_t *)malloc(table->size * sizeof(obj_t)); *tbl = table; } @@ -568,10 +568,10 @@ free_table(table_t *table) /* Free the names for the objects in the table */ for (u = 0; u < table->nobjs; u++) if (table->objs[u].objname) - HDfree(table->objs[u].objname); + free(table->objs[u].objname); - HDfree(table->objs); - HDfree(table); + free(table->objs); + free(table); } #ifdef H5DUMP_DEBUG @@ -701,7 +701,7 @@ find_objs_cb(const char *name, const H5O_info2_t *oinfo, const char *already_see add_obj(info->type_table, &oinfo->token, name, TRUE); else { /* Use latest version of name */ - HDfree(found_obj->objname); + free(found_obj->objname); found_obj->objname = HDstrdup(name); /* Mark named datatype as having valid name */ @@ -780,7 +780,7 @@ add_obj(table_t *table, const H5O_token_t *obj_token, const char *objname, hbool /* See if we need to make table larger */ if (table->nobjs == table->size) { table->size *= 2; - table->objs = (struct obj_t *)HDrealloc(table->objs, table->size * sizeof(table->objs[0])); + table->objs = (struct obj_t *)realloc(table->objs, table->size * sizeof(table->objs[0])); } /* end if */ /* Increment number of objects in table */ @@ -870,7 +870,7 @@ H5tools_get_symlink_info(hid_t file_id, const char *linkpath, h5tool_link_info_t H5TOOLS_GOTO_DONE(2); /* trg_path must be freed out of this function when finished using */ - if ((link_info->trg_path = (char *)HDcalloc(link_info->linfo.u.val_size, sizeof(char))) == NULL) { + if ((link_info->trg_path = (char *)calloc(link_info->linfo.u.val_size, sizeof(char))) == NULL) { if (link_info->opt.msg_mode == 1) parallel_print("Warning: unable to allocate buffer for <%s>\n", linkpath); H5TOOLS_GOTO_DONE(FAIL); @@ -1053,9 +1053,9 @@ h5tools_parse_ros3_fapl_tuple(const char *tuple_str, int delim, H5FD_ros3_fapl_t done: if (s3cred) - HDfree(s3cred); + free(s3cred); if (s3cred_src) - HDfree(s3cred_src); + free(s3cred_src); return ret_value; } @@ -1291,9 +1291,9 @@ h5tools_parse_hdfs_fapl_tuple(const char *tuple_str, int delim, H5FD_hdfs_fapl_t done: if (props) - HDfree(props); + free(props); if (props_src) - HDfree(props_src); + free(props_src); return ret_value; } diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 4ee2914..060a33b 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -120,7 +120,7 @@ trav_token_add(trav_addr_t *visited, H5O_token_t *token, const char *path) if (visited->nused == visited->nalloc) { visited->nalloc = MAX(1, visited->nalloc * 2); visited->objs = - (trav_addr_path_t *)HDrealloc(visited->objs, visited->nalloc * sizeof(trav_addr_path_t)); + (trav_addr_path_t *)realloc(visited->objs, visited->nalloc * sizeof(trav_addr_path_t)); } /* end if */ /* Append it */ @@ -177,7 +177,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda size_t new_name_len = base_len + add_slash + HDstrlen(path) + 1 + 3; /* Extra "+3" to quiet GCC warning - 2019/07/05, QAK */ - if (NULL == (new_name = (char *)HDmalloc(new_name_len))) + if (NULL == (new_name = (char *)malloc(new_name_len))) return (H5_ITER_ERROR); if (add_slash) HDsnprintf(new_name, new_name_len, "%s/%s", udata->base_grp_name, path); @@ -195,7 +195,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda /* Get information about the object */ if (H5Oget_info_by_name3(loc_id, path, &oinfo, udata->fields, H5P_DEFAULT) < 0) { if (new_name) - HDfree(new_name); + free(new_name); return (H5_ITER_ERROR); } /* end if */ @@ -210,7 +210,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda if (udata->visitor->visit_obj) if ((*udata->visitor->visit_obj)(full_name, &oinfo, already_visited, udata->visitor->udata) < 0) { if (new_name) - HDfree(new_name); + free(new_name); return (H5_ITER_ERROR); } /* end if */ } /* end if */ @@ -219,13 +219,13 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info2_t *linfo, void *_uda if (udata->visitor->visit_lnk) if ((*udata->visitor->visit_lnk)(full_name, linfo, udata->visitor->udata) < 0) { if (new_name) - HDfree(new_name); + free(new_name); return (H5_ITER_ERROR); } /* end if */ } /* end else */ if (new_name) - HDfree(new_name); + free(new_name); return (H5_ITER_CONT); } /* end traverse_cb() */ @@ -295,8 +295,8 @@ traverse(hid_t file_id, const char *grp_name, hbool_t visit_start, hbool_t recur /* Free paths to objects */ for (u = 0; u < seen.nused; u++) - HDfree(seen.objs[u].path); - HDfree(seen.objs); + free(seen.objs[u].path); + free(seen.objs); } /* end if */ } /* end if */ @@ -321,7 +321,7 @@ trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type) /* Allocate space if necessary */ if (info->nused == info->nalloc) { info->nalloc = MAX(1, info->nalloc * 2); - info->paths = (trav_path_t *)HDrealloc(info->paths, info->nalloc * sizeof(trav_path_t)); + info->paths = (trav_path_t *)realloc(info->paths, info->nalloc * sizeof(trav_path_t)); } /* end if */ /* Append it */ @@ -474,7 +474,7 @@ h5trav_getindex(const trav_info_t *info, const char *obj) void trav_info_init(const char *filename, hid_t fileid, trav_info_t **_info) { - trav_info_t *info = (trav_info_t *)HDmalloc(sizeof(trav_info_t)); + trav_info_t *info = (trav_info_t *)malloc(sizeof(trav_info_t)); /* Init info structure */ info->nused = info->nalloc = 0; @@ -505,16 +505,16 @@ trav_info_free(trav_info_t *info) /* Free visited symbolic links path and file (if alloc) */ for (u = 0; u < info->symlink_visited.nused; u++) { if (info->symlink_visited.objs[u].file) - HDfree(info->symlink_visited.objs[u].file); - HDfree(info->symlink_visited.objs[u].path); + free(info->symlink_visited.objs[u].file); + free(info->symlink_visited.objs[u].path); } - HDfree(info->symlink_visited.objs); + free(info->symlink_visited.objs); /* Free path names */ for (u = 0; u < info->nused; u++) - HDfree(info->paths[u].path); - HDfree(info->paths); - HDfree(info); + free(info->paths[u].path); + free(info->paths); + free(info); } /* end if */ } /* end trav_info_free() */ @@ -653,7 +653,7 @@ trav_table_add(trav_table_t *table, const char *path, const H5O_info2_t *oinfo) if (table) { if (table->nobjs == table->size) { table->size = MAX(1, table->size * 2); - table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + table->objs = (trav_obj_t *)realloc(table->objs, table->size * sizeof(trav_obj_t)); } /* end if */ new_obj = table->nobjs++; @@ -700,7 +700,7 @@ trav_table_addlink(trav_table_t *table, const H5O_token_t *obj_token, const char /* allocate space if necessary */ if (table->objs[i].nlinks == (unsigned)table->objs[i].sizelinks) { table->objs[i].sizelinks = MAX(1, table->objs[i].sizelinks * 2); - table->objs[i].links = (trav_link_t *)HDrealloc( + table->objs[i].links = (trav_link_t *)realloc( table->objs[i].links, table->objs[i].sizelinks * sizeof(trav_link_t)); } /* end if */ @@ -730,7 +730,7 @@ trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_ if (table) { if (table->nobjs == table->size) { table->size = MAX(1, table->size * 2); - table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); + table->objs = (trav_obj_t *)realloc(table->objs, table->size * sizeof(trav_obj_t)); } /* end if */ new_obj = table->nobjs++; @@ -760,7 +760,7 @@ trav_table_addflags(const unsigned *flags, char *name, h5trav_type_t type, trav_ void trav_table_init(hid_t fid, trav_table_t **tbl) { - trav_table_t *table = (trav_table_t *)HDmalloc(sizeof(trav_table_t)); + trav_table_t *table = (trav_table_t *)malloc(sizeof(trav_table_t)); if (table) { table->fid = fid; table->size = 0; @@ -786,19 +786,19 @@ trav_table_free(trav_table_t *table) unsigned int i; for (i = 0; i < table->nobjs; i++) { - HDfree(table->objs[i].name); + free(table->objs[i].name); if (table->objs[i].nlinks) { unsigned int j; for (j = 0; j < table->objs[i].nlinks; j++) - HDfree(table->objs[i].links[j].new_name); + free(table->objs[i].links[j].new_name); - HDfree(table->objs[i].links); + free(table->objs[i].links); } /* end if */ } /* end for */ - HDfree(table->objs); + free(table->objs); } /* end if */ - HDfree(table); + free(table); } } @@ -947,14 +947,14 @@ trav_print_visit_lnk(const char *path, const H5L_info2_t *linfo, void *udata) switch (linfo->type) { case H5L_TYPE_SOFT: if (linfo->u.val_size > 0) { - char *targbuf = (char *)HDmalloc(linfo->u.val_size + 1); + char *targbuf = (char *)malloc(linfo->u.val_size + 1); if (targbuf) { if (H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) targbuf[0] = 0; printf(" %-10s %s -> %s\n", "link", path, targbuf); - HDfree(targbuf); + free(targbuf); } - } /* end if */ + } else printf(" %-10s %s ->\n", "link", path); break; @@ -965,13 +965,13 @@ trav_print_visit_lnk(const char *path, const H5L_info2_t *linfo, void *udata) const char *filename = NULL; const char *objname = NULL; - targbuf = (char *)HDmalloc(linfo->u.val_size + 1); + targbuf = (char *)malloc(linfo->u.val_size + 1); if (targbuf) { if (H5Lget_val(print_udata->fid, path, targbuf, linfo->u.val_size + 1, H5P_DEFAULT) < 0) targbuf[0] = 0; if (H5Lunpack_elink_val(targbuf, linfo->u.val_size, NULL, &filename, &objname) >= 0) printf(" %-10s %s -> %s %s\n", "ext link", path, filename, objname); - HDfree(targbuf); + free(targbuf); } } /* end if */ else @@ -1073,7 +1073,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co void *tmp_ptr; visited->nalloc = MAX(1, visited->nalloc * 2); - if (NULL == (tmp_ptr = HDrealloc(visited->objs, visited->nalloc * sizeof(symlink_trav_path_t)))) + if (NULL == (tmp_ptr = realloc(visited->objs, visited->nalloc * sizeof(symlink_trav_path_t)))) H5TOOLS_GOTO_ERROR(FAIL, "visited data structure realloc failed"); visited->objs = (symlink_trav_path_t *)tmp_ptr; } /* end if */ @@ -1095,7 +1095,7 @@ symlink_visit_add(symlink_trav_t *visited, H5L_type_t type, const char *file, co if (NULL == (visited->objs[idx].path = HDstrdup(path))) { visited->nused--; if (visited->objs[idx].file) - HDfree(visited->objs[idx].file); + free(visited->objs[idx].file); H5TOOLS_GOTO_ERROR(FAIL, "visited data structure path allocation failed"); } /* end if */ diff --git a/tools/lib/io_timer.c b/tools/lib/io_timer.c index 17d20f5..d21f919c 100644 --- a/tools/lib/io_timer.c +++ b/tools/lib/io_timer.c @@ -61,7 +61,7 @@ sub_time(struct timeval *a, struct timeval *b) io_time_t * io_time_new(clock_type type) { - io_time_t *pt = (io_time_t *)HDcalloc(1, sizeof(struct io_time_t)); + io_time_t *pt = (io_time_t *)calloc(1, sizeof(struct io_time_t)); /* set global timer variable */ timer_g = pt; @@ -81,7 +81,7 @@ io_time_new(clock_type type) void io_time_destroy(io_time_t *pt) { - HDfree(pt); + free(pt); /* reset the global timer pointer too. */ timer_g = NULL; } diff --git a/tools/libtest/h5tools_test_utils.c b/tools/libtest/h5tools_test_utils.c index d59978b..de8b3ef 100644 --- a/tools/libtest/h5tools_test_utils.c +++ b/tools/libtest/h5tools_test_utils.c @@ -553,9 +553,9 @@ test_parse_tuple(void) /* TEARDOWN */ assert(parsed != NULL); assert(cpy != NULL); - HDfree(parsed); + free(parsed); parsed = NULL; - HDfree(cpy); + free(cpy); cpy = NULL; } else { @@ -573,9 +573,9 @@ error: ***********/ if (parsed != NULL) - HDfree(parsed); + free(parsed); if (cpy != NULL) - HDfree(cpy); + free(cpy); return 1; diff --git a/tools/src/h5copy/h5copy.c b/tools/src/h5copy/h5copy.c index 62a3905..deae9a9 100644 --- a/tools/src/h5copy/h5copy.c +++ b/tools/src/h5copy/h5copy.c @@ -52,15 +52,15 @@ static void leave(int ret) { if (fname_src) - HDfree(fname_src); + free(fname_src); if (fname_dst) - HDfree(fname_dst); + free(fname_dst); if (oname_dst) - HDfree(oname_dst); + free(oname_dst); if (oname_src) - HDfree(oname_src); + free(oname_src); if (str_flag) - HDfree(str_flag); + free(str_flag); h5tools_close(); HDexit(ret); @@ -419,15 +419,15 @@ main(int argc, char *argv[]) if ('/' == oname_dst[i]) { char *str_ptr; - str_ptr = (char *)HDcalloc(i + 1, sizeof(char)); + str_ptr = (char *)calloc(i + 1, sizeof(char)); HDstrncpy(str_ptr, oname_dst, i); str_ptr[i] = '\0'; if (H5Lexists(fid_dst, str_ptr, H5P_DEFAULT) <= 0) { error_msg("group <%s> doesn't exist. Use -p to create parent groups.\n", str_ptr); - HDfree(str_ptr); + free(str_ptr); H5TOOLS_GOTO_ERROR(EXIT_FAILURE, "H5Lexists failed"); } - HDfree(str_ptr); + free(str_ptr); } } } @@ -458,7 +458,7 @@ main(int argc, char *argv[]) /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + free(linkinfo.trg_path); /* close propertis */ if (H5Pclose(ocpl_id) < 0) @@ -479,7 +479,7 @@ done: /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + free(linkinfo.trg_path); H5E_BEGIN_TRY { diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 5ae2a37..c15603d 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -216,7 +216,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const opts->exclude_path = 1; /* create linked list of excluding objects */ - if ((exclude_node = (struct exclude_path_list *)HDmalloc(sizeof(struct exclude_path_list))) == + if ((exclude_node = (struct exclude_path_list *)malloc(sizeof(struct exclude_path_list))) == NULL) { printf("Error: lack of memory!\n"); h5diff_exit(EXIT_FAILURE); @@ -249,7 +249,7 @@ parse_command_line(int argc, const char *const *argv, const char **fname1, const /* create linked list of excluding objects */ if ((exclude_attr_node = - (struct exclude_path_list *)HDmalloc(sizeof(struct exclude_path_list))) == NULL) { + (struct exclude_path_list *)malloc(sizeof(struct exclude_path_list))) == NULL) { printf("Error: lack of memory!\n"); h5diff_exit(EXIT_FAILURE); } diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c index 561f139..fd594db 100644 --- a/tools/src/h5diff/h5diff_main.c +++ b/tools/src/h5diff/h5diff_main.c @@ -89,15 +89,15 @@ main(int argc, char *argv[]) for (i = 0; i < 2; i++) { if (opts.sset[i]) { if (opts.sset[i]->start.data) - HDfree(opts.sset[i]->start.data); + free(opts.sset[i]->start.data); if (opts.sset[i]->stride.data) - HDfree(opts.sset[i]->stride.data); + free(opts.sset[i]->stride.data); if (opts.sset[i]->count.data) - HDfree(opts.sset[i]->count.data); + free(opts.sset[i]->count.data); if (opts.sset[i]->block.data) - HDfree(opts.sset[i]->block.data); + free(opts.sset[i]->block.data); - HDfree(opts.sset[i]); + free(opts.sset[i]); opts.sset[i] = NULL; } } diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c index 62ba1c9..3b17a34 100644 --- a/tools/src/h5dump/h5dump.c +++ b/tools/src/h5dump/h5dump.c @@ -416,7 +416,7 @@ table_list_add(hid_t oid, unsigned long file_no) h5dump_table_items_t *tmp_ptr; table_list.nalloc = MAX(1, table_list.nalloc * 2); - if (NULL == (tmp_ptr = (h5dump_table_items_t *)HDrealloc( + if (NULL == (tmp_ptr = (h5dump_table_items_t *)realloc( table_list.tables, table_list.nalloc * sizeof(table_list.tables[0])))) return -1; table_list.tables = tmp_ptr; @@ -493,7 +493,7 @@ table_list_free(void) } /* Free the table list */ - HDfree(table_list.tables); + free(table_list.tables); table_list.tables = NULL; table_list.nalloc = table_list.nused = 0; } /* end table_list_free() */ @@ -708,26 +708,26 @@ free_handler(struct handler_t *hand, int len) if (hand) { for (i = 0; i < len; i++) { if (hand[i].obj) { - HDfree(hand[i].obj); + free(hand[i].obj); hand[i].obj = NULL; } if (hand[i].subset_info) { if (hand[i].subset_info->start.data) - HDfree(hand[i].subset_info->start.data); + free(hand[i].subset_info->start.data); if (hand[i].subset_info->stride.data) - HDfree(hand[i].subset_info->stride.data); + free(hand[i].subset_info->stride.data); if (hand[i].subset_info->count.data) - HDfree(hand[i].subset_info->count.data); + free(hand[i].subset_info->count.data); if (hand[i].subset_info->block.data) - HDfree(hand[i].subset_info->block.data); + free(hand[i].subset_info->block.data); - HDfree(hand[i].subset_info); + free(hand[i].subset_info); hand[i].subset_info = NULL; } } - HDfree(hand); + free(hand); } } @@ -758,7 +758,7 @@ parse_command_line(int argc, const char *const *argv) } /* this will be plenty big enough to hold the info */ - if ((hand = (struct handler_t *)HDcalloc((size_t)argc, sizeof(struct handler_t))) == NULL) { + if ((hand = (struct handler_t *)calloc((size_t)argc, sizeof(struct handler_t))) == NULL) { goto error; } @@ -1078,7 +1078,7 @@ parse_start: s = last_dset->subset_info; } else { - last_dset->subset_info = s = (struct subset_t *)HDcalloc(1, sizeof(struct subset_t)); + last_dset->subset_info = s = (struct subset_t *)calloc(1, sizeof(struct subset_t)); } /* @@ -1096,28 +1096,28 @@ parse_start: switch ((char)opt) { case 's': if (s->start.data) { - HDfree(s->start.data); + free(s->start.data); s->start.data = NULL; } parse_hsize_list(H5_optarg, &s->start); break; case 'S': if (s->stride.data) { - HDfree(s->stride.data); + free(s->stride.data); s->stride.data = NULL; } parse_hsize_list(H5_optarg, &s->stride); break; case 'c': if (s->count.data) { - HDfree(s->count.data); + free(s->count.data); s->count.data = NULL; } parse_hsize_list(H5_optarg, &s->count); break; case 'k': if (s->block.data) { - HDfree(s->block.data); + free(s->block.data); s->block.data = NULL; } parse_hsize_list(H5_optarg, &s->block); @@ -1481,7 +1481,7 @@ main(int argc, char *argv[]) "xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File " "http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n", xmlnsprefix, ns); - HDfree(ns); + free(ns); } } else { @@ -1554,11 +1554,11 @@ main(int argc, char *argv[]) h5tools_setstatus(EXIT_FAILURE); if (prefix) { - HDfree(prefix); + free(prefix); prefix = NULL; } if (fname) { - HDfree(fname); + free(fname); fname = NULL; } } /* end while */ @@ -1584,11 +1584,11 @@ done: h5tools_setstatus(EXIT_FAILURE); if (prefix) { - HDfree(prefix); + free(prefix); prefix = NULL; } if (fname) { - HDfree(fname); + free(fname); fname = NULL; } @@ -1613,7 +1613,7 @@ static void init_prefix(char **prfx, size_t prfx_len) { if (prfx_len > 0) - *prfx = (char *)HDcalloc(prfx_len, 1); + *prfx = (char *)calloc(prfx_len, 1); else error_msg("unable to allocate prefix buffer\n"); } @@ -1635,7 +1635,7 @@ add_prefix(char **prfx, size_t *prfx_len, const char *name) /* Check if we need more space */ if (*prfx_len <= new_len) { *prfx_len = new_len + 1; - *prfx = (char *)HDrealloc(*prfx, *prfx_len); + *prfx = (char *)realloc(*prfx, *prfx_len); } /* Append object name to prefix */ diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c index 9d59c95..c15bd26 100644 --- a/tools/src/h5dump/h5dump_ddl.c +++ b/tools/src/h5dump/h5dump_ddl.c @@ -187,7 +187,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT outputformat = &string_dataformat; /* Build the object's path name */ - obj_path = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + obj_path = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); if (!obj_path) { ret = FAIL; goto done; @@ -229,7 +229,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT /* Restore old prefix name */ HDstrcpy(prefix, old_prefix); - HDfree(old_prefix); + free(old_prefix); } else error_msg("warning: null prefix\n"); @@ -386,7 +386,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT switch (linfo->type) { case H5L_TYPE_SOFT: - if ((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + if ((targbuf = (char *)malloc(linfo->u.val_size)) == NULL) { error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; @@ -436,12 +436,12 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(targbuf); + free(targbuf); } break; case H5L_TYPE_EXTERNAL: - if ((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + if ((targbuf = (char *)malloc(linfo->u.val_size)) == NULL) { error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; @@ -510,7 +510,7 @@ dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5_ATT h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(targbuf); + free(targbuf); } break; @@ -560,7 +560,7 @@ done: h5tools_str_close(&buffer); if (obj_path) - HDfree(obj_path); + free(obj_path); return ret; } @@ -1336,7 +1336,7 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a u = HDstrlen(buf); v = HDstrlen(op_name); w = u + 1 + v + 1 + 2; - obj_name = (char *)HDmalloc(w); + obj_name = (char *)malloc(w); if (obj_name == NULL) { h5tools_setstatus(EXIT_FAILURE); ret = FAIL; @@ -1359,10 +1359,10 @@ attr_search(hid_t oid, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *a buffer_space -= MIN(buffer_space, v); handle_attributes(oid, obj_name, NULL, 0, NULL); - HDfree(obj_name); + free(obj_name); } } - HDfree(obj_op_name); + free(obj_op_name); } return ret; } /* end attr_search() */ @@ -1420,7 +1420,7 @@ lnk_search(const char *path, const H5L_info2_t *li, void *_op_data) k = 2; else k = 1; - search_name = (char *)HDmalloc(search_len + k); + search_name = (char *)malloc(search_len + k); if (search_name == NULL) { error_msg("creating temporary link\n"); h5tools_setstatus(EXIT_FAILURE); @@ -1450,7 +1450,7 @@ lnk_search(const char *path, const H5L_info2_t *li, void *_op_data) break; } /* end switch() */ } - HDfree(search_name); + free(search_name); } return 0; } /* end lnk_search() */ @@ -1534,7 +1534,7 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 hsize_t curr_pos = 0; /* total data element position */ j = (int)HDstrlen(attr) - 1; - obj_name = (char *)HDmalloc((size_t)j + 2); + obj_name = (char *)malloc((size_t)j + 2); if (obj_name == NULL) goto error; @@ -1631,18 +1631,18 @@ handle_attributes(hid_t fid, const char *attr, void H5_ATTR_UNUSED *data, int H5 goto error; } /* end if */ - HDfree(obj_name); - HDfree(attr_name); + free(obj_name); + free(attr_name); dump_indent -= COL; return; error: h5tools_setstatus(EXIT_FAILURE); if (obj_name) - HDfree(obj_name); + free(obj_name); if (attr_name) - HDfree(attr_name); + free(attr_name); H5E_BEGIN_TRY { @@ -1709,7 +1709,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if (!sset->start.data) { /* default to (0, 0, ...) for the start coord */ if (ndims > 0) - sset->start.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); + sset->start.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); else sset->start.data = NULL; sset->start.len = ndims; @@ -1717,7 +1717,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if (!sset->stride.data) { if (ndims > 0) - sset->stride.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); + sset->stride.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); else sset->stride.data = NULL; sset->stride.len = ndims; @@ -1727,7 +1727,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if (!sset->count.data) { if (ndims > 0) - sset->count.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); + sset->count.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); else sset->count.data = NULL; sset->count.len = ndims; @@ -1737,7 +1737,7 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if (!sset->block.data) { if (ndims > 0) - sset->block.data = (hsize_t *)HDcalloc((size_t)ndims, sizeof(hsize_t)); + sset->block.data = (hsize_t *)calloc((size_t)ndims, sizeof(hsize_t)); else sset->block.data = NULL; sset->block.len = ndims; @@ -1856,7 +1856,7 @@ handle_groups(hid_t fid, const char *group, void H5_ATTR_UNUSED *data, int pe, c if (prefix_len <= new_len) { prefix_len = new_len; - prefix = (char *)HDrealloc(prefix, prefix_len); + prefix = (char *)realloc(prefix, prefix_len); } /* end if */ HDstrcpy(prefix, group); @@ -1893,7 +1893,7 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED *data, int H5_ATT h5tools_setstatus(EXIT_FAILURE); } else { - char *buf = (char *)HDmalloc(linfo.u.val_size); + char *buf = (char *)malloc(linfo.u.val_size); PRINTVALSTREAM(rawoutstream, "\n"); switch (linfo.type) { @@ -1951,7 +1951,7 @@ handle_links(hid_t fid, const char *links, void H5_ATTR_UNUSED *data, int H5_ATT end_obj(h5tools_dump_header_format->udlinkend, h5tools_dump_header_format->udlinkblockend); break; } /* end switch */ - HDfree(buf); + free(buf); } /* end else */ } diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 80f9142..485d6f6 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -165,7 +165,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 outputformat = &string_dataformat; /* Build the object's path name */ - obj_path = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + obj_path = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); if (!obj_path) { ret = FAIL; goto done; @@ -211,7 +211,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 /* Restore old prefix name */ HDstrcpy(prefix, old_prefix); - HDfree(old_prefix); + free(old_prefix); } /* Close group */ @@ -316,10 +316,10 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_name); - HDfree(t_obj_path); - HDfree(t_prefix); - HDfree(t_objname); + free(t_name); + free(t_obj_path); + free(t_prefix); + free(t_objname); H5Dclose(obj); goto done; @@ -364,7 +364,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 switch (linfo->type) { case H5L_TYPE_SOFT: - if ((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + if ((targbuf = (char *)malloc(linfo->u.val_size)) == NULL) { error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; @@ -388,7 +388,7 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 char *t_link_path; int res; - t_link_path = (char *)HDmalloc(HDstrlen(prefix) + linfo->u.val_size + 1); + t_link_path = (char *)malloc(HDstrlen(prefix) + linfo->u.val_size + 1); if (targbuf[0] == '/') HDstrcpy(t_link_path, targbuf); else { @@ -446,19 +446,19 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); } - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_targbuf); - HDfree(t_obj_path); - HDfree(t_link_path); + free(t_prefix); + free(t_name); + free(t_targbuf); + free(t_obj_path); + free(t_link_path); } - HDfree(targbuf); + free(targbuf); } break; case H5L_TYPE_EXTERNAL: - if ((targbuf = (char *)HDmalloc(linfo->u.val_size)) == NULL) { + if ((targbuf = (char *)malloc(linfo->u.val_size)) == NULL) { error_msg("unable to allocate buffer\n"); h5tools_setstatus(EXIT_FAILURE); ret = FAIL; @@ -512,14 +512,14 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_filename); - HDfree(t_targname); - HDfree(t_obj_path); + free(t_prefix); + free(t_name); + free(t_filename); + free(t_targname); + free(t_obj_path); } /* end else */ } /* end else */ - HDfree(targbuf); + free(targbuf); } break; @@ -556,9 +556,9 @@ xml_dump_all_cb(hid_t group, const char *name, const H5L_info2_t *linfo, void H5 h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_prefix); - HDfree(t_name); - HDfree(t_obj_path); + free(t_prefix); + free(t_name); + free(t_obj_path); } break; } /* end switch */ @@ -569,7 +569,7 @@ done: h5tools_str_close(&buffer); if (obj_path) - HDfree(obj_path); + free(obj_path); return ret; } @@ -689,7 +689,7 @@ xml_escape_the_name(const char *str) cp = str; ncp_len = len + extra + 1; - rcp = ncp = (char *)HDmalloc(ncp_len); + rcp = ncp = (char *)malloc(ncp_len); if (!ncp) return NULL; /* ?? */ @@ -782,7 +782,7 @@ xml_escape_the_string(const char *str, int slen) cp = str; ncp_len = len + extra + 1; - rcp = ncp = (char *)HDcalloc(ncp_len, sizeof(char)); + rcp = ncp = (char *)calloc(ncp_len, sizeof(char)); if (ncp == NULL) return NULL; /* ?? */ @@ -912,7 +912,7 @@ xml_print_datatype(hid_t type, unsigned in_group) /* This should be defined somewhere else */ /* These 2 cases are handled the same right now, but probably will have something different eventually */ - char *dtxid = (char *)HDmalloc((size_t)100); + char *dtxid = (char *)malloc((size_t)100); xml_name_to_XID(type, found_obj->objname, dtxid, 100, 1); if (!found_obj->recorded) { @@ -939,9 +939,9 @@ xml_print_datatype(hid_t type, unsigned in_group) dtxid, t_objname); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_objname); + free(t_objname); } - HDfree(dtxid); + free(dtxid); } else { ctx.need_prefix = TRUE; @@ -1286,7 +1286,7 @@ xml_print_datatype(hid_t type, unsigned in_group) (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); H5free_memory(mname); - HDfree(t_fname); + free(t_fname); dump_indent += COL; ctx.indent_level++; @@ -1612,7 +1612,7 @@ xml_dump_datatype(hid_t type) if (found_obj) { /* Shared datatype, must be entered as an object */ /* These 2 cases are the same now, but may change */ - char *dtxid = (char *)HDmalloc((size_t)100); + char *dtxid = (char *)malloc((size_t)100); xml_name_to_XID(type, found_obj->objname, dtxid, 100, 1); if (!found_obj->recorded) { @@ -1642,9 +1642,9 @@ xml_dump_datatype(hid_t type) xmlnsprefix, dtxid, t_objname); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_objname); + free(t_objname); } - HDfree(dtxid); + free(dtxid); } else { ctx.need_prefix = TRUE; @@ -2081,7 +2081,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED h5tools_str_append(&buffer, "<%sAttribute Name=\"%s\">", xmlnsprefix, t_aname); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_aname); + free(t_aname); if ((attr_id = H5Aopen(attr, attr_name, H5P_DEFAULT)) >= 0) { type = H5Aget_type(attr_id); @@ -2370,7 +2370,7 @@ xml_dump_named_datatype(hid_t type, const char *name) char *t_prefix = NULL; char *t_name = NULL; - tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + tmp = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); if (tmp == NULL) { indentation(dump_indent); error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); @@ -2406,8 +2406,8 @@ xml_dump_named_datatype(hid_t type, const char *name) string_dataformat.do_escape = dump_opts.display_escape; outputformat = &string_dataformat; - dtxid = (char *)HDmalloc((size_t)100); - parentxid = (char *)HDmalloc((size_t)100); + dtxid = (char *)malloc((size_t)100); + parentxid = (char *)malloc((size_t)100); t_tmp = xml_escape_the_name(tmp); t_prefix = xml_escape_the_name(prefix); t_name = xml_escape_the_name(name); @@ -2493,7 +2493,7 @@ xml_dump_named_datatype(hid_t type, const char *name) h5tools_str_append(&buffer, "", xmlnsprefix); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_objname); + free(t_objname); goto done; } else @@ -2541,12 +2541,12 @@ done: h5tools_str_close(&buffer); - HDfree(dtxid); - HDfree(parentxid); - HDfree(t_tmp); - HDfree(t_prefix); - HDfree(t_name); - HDfree(tmp); + free(dtxid); + free(parentxid); + free(t_tmp); + free(t_prefix); + free(t_name); + free(tmp); } /*------------------------------------------------------------------------- @@ -2631,7 +2631,7 @@ xml_dump_group(hid_t gid, const char *name) tmp = HDstrdup("/"); } else { - tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + tmp = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); if (tmp == NULL) { indentation(dump_indent); error_msg("internal error (file %s:line %d)\n", __FILE__, __LINE__); @@ -2665,11 +2665,11 @@ xml_dump_group(hid_t gid, const char *name) } else { char *t_name = xml_escape_the_name(name); - char *grpxid = (char *)HDmalloc((size_t)100); - char *parentxid = (char *)HDmalloc((size_t)100); + char *grpxid = (char *)malloc((size_t)100); + char *parentxid = (char *)malloc((size_t)100); if (found_obj->displayed) { - char *ptrstr = (char *)HDmalloc((size_t)100); + char *ptrstr = (char *)malloc((size_t)100); /* already seen: enter a groupptr */ if (isRoot) { @@ -2702,8 +2702,8 @@ xml_dump_group(hid_t gid, const char *name) par_name); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_objname); - HDfree(par_name); + free(t_objname); + free(par_name); ctx.indent_level++; @@ -2725,10 +2725,10 @@ xml_dump_group(hid_t gid, const char *name) ctx.indent_level--; - HDfree(t_objname); - HDfree(par_name); + free(t_objname); + free(par_name); } - HDfree(ptrstr); + free(ptrstr); } else { @@ -2763,8 +2763,8 @@ xml_dump_group(hid_t gid, const char *name) h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_tmp); - HDfree(par_name); + free(t_tmp); + free(par_name); } found_obj->displayed = TRUE; @@ -2820,16 +2820,16 @@ xml_dump_group(hid_t gid, const char *name) dump_indent -= COL; ctx.indent_level--; } - HDfree(t_name); - HDfree(grpxid); - HDfree(parentxid); + free(t_name); + free(grpxid); + free(parentxid); } } else { /* only link -- must be first time! */ char *t_name = xml_escape_the_name(name); - char *grpxid = (char *)HDmalloc((size_t)100); - char *parentxid = (char *)HDmalloc((size_t)100); + char *grpxid = (char *)malloc((size_t)100); + char *parentxid = (char *)malloc((size_t)100); ctx.need_prefix = TRUE; @@ -2851,15 +2851,15 @@ xml_dump_group(hid_t gid, const char *name) "<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" >", xmlnsprefix, t_name, grpxid, t_tmp, parentxid, par_name); - HDfree(t_tmp); - HDfree(par_name); + free(t_tmp); + free(par_name); } h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_name); - HDfree(grpxid); - HDfree(parentxid); + free(t_name); + free(grpxid); + free(parentxid); /* 1. do all the attributes of the group */ @@ -2928,9 +2928,9 @@ xml_dump_group(hid_t gid, const char *name) h5tools_str_close(&buffer); if (par) - HDfree(par); + free(par); if (tmp) - HDfree(tmp); + free(tmp); } /*------------------------------------------------------------------------- @@ -2983,7 +2983,7 @@ xml_print_refs(hid_t did, int source) if ((ssiz = H5Sget_simple_extent_npoints(space)) < 0) goto error; - buf = (char *)HDcalloc((size_t)ssiz, sizeof(H5R_ref_t)); + buf = (char *)calloc((size_t)ssiz, sizeof(H5R_ref_t)); if (buf == NULL) goto error; e = H5Dread(did, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); @@ -2996,7 +2996,7 @@ xml_print_refs(hid_t did, int source) if ((ssiz = H5Sget_simple_extent_npoints(space)) < 0) goto error; - buf = (char *)HDcalloc((size_t)ssiz, sizeof(H5R_ref_t)); + buf = (char *)calloc((size_t)ssiz, sizeof(H5R_ref_t)); if (buf == NULL) goto error; e = H5Aread(did, H5T_STD_REF, buf); @@ -3054,7 +3054,7 @@ xml_print_refs(hid_t did, int source) h5tools_str_append(&buffer, "\"%s\"", t_path); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_path); + free(t_path); } ctx.indent_level--; @@ -3065,14 +3065,14 @@ xml_print_refs(hid_t did, int source) h5tools_str_close(&buffer); - HDfree(buf); + free(buf); H5Tclose(type); H5Sclose(space); return SUCCEED; error: if (buf) - HDfree(buf); + free(buf); H5E_BEGIN_TRY { @@ -3133,7 +3133,7 @@ xml_print_strs(hid_t did, int source) if ((tsiz = H5Tget_size(type)) == 0) goto error; - buf = HDmalloc((size_t)ssiz * tsiz); + buf = malloc((size_t)ssiz * tsiz); if (buf == NULL) goto error; @@ -3148,7 +3148,7 @@ xml_print_strs(hid_t did, int source) if ((tsiz = H5Tget_size(type)) == 0) goto error; - buf = HDmalloc((size_t)ssiz * tsiz); + buf = malloc((size_t)ssiz * tsiz); if (buf == NULL) goto error; @@ -3159,7 +3159,7 @@ xml_print_strs(hid_t did, int source) bp = (char *)buf; if (!is_vlstr) { - onestring = (char *)HDcalloc(tsiz, sizeof(char)); + onestring = (char *)calloc(tsiz, sizeof(char)); if (onestring == NULL) goto error; } @@ -3219,7 +3219,7 @@ xml_print_strs(hid_t did, int source) h5tools_str_append(&buffer, "\"%s\"", t_onestring); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_onestring); + free(t_onestring); } } bp += tsiz; @@ -3230,11 +3230,11 @@ xml_print_strs(hid_t did, int source) /* Reclaim any VL memory, if necessary */ if (!is_vlstr) if (onestring) - HDfree(onestring); + free(onestring); if (buf) { if (is_vlstr) H5Treclaim(type, space, H5P_DEFAULT, buf); - HDfree(buf); + free(buf); } H5Tclose(type); H5Sclose(space); @@ -3242,7 +3242,7 @@ xml_print_strs(hid_t did, int source) error: if (buf) - HDfree(buf); + free(buf); H5E_BEGIN_TRY { @@ -3459,7 +3459,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) dump_indent += COL; space = H5Tget_size(type); - buf = HDmalloc((size_t)space); + buf = malloc((size_t)space); H5Pget_fill_value(dcpl, type, buf); @@ -3492,7 +3492,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) h5tools_str_append(&buffer, "\"%s\"", t_path); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_path); + free(t_path); } ctx.need_prefix = TRUE; @@ -3732,7 +3732,7 @@ xml_dump_fill_value(hid_t dcpl, hid_t type) break; } } - HDfree(buf); + free(buf); ctx.indent_level--; dump_indent -= COL; @@ -3782,15 +3782,15 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss h5tool_format_t string_dataformat; hsize_t curr_pos = 0; /* total data element position */ - char *rstr = (char *)HDmalloc((size_t)100); - char *pstr = (char *)HDmalloc((size_t)100); + char *rstr = (char *)malloc((size_t)100); + char *pstr = (char *)malloc((size_t)100); - tmp = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(name) + 2); + tmp = (char *)malloc(HDstrlen(prefix) + HDstrlen(name) + 2); if (tmp == NULL) { error_msg("buffer allocation failed\n"); h5tools_setstatus(EXIT_FAILURE); - HDfree(rstr); - HDfree(pstr); + free(rstr); + free(pstr); return; } @@ -3839,12 +3839,12 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_name); - HDfree(t_tmp); - HDfree(t_prefix); - HDfree(rstr); - HDfree(pstr); - HDfree(tmp); + free(t_name); + free(t_tmp); + free(t_prefix); + free(rstr); + free(pstr); + free(tmp); dcpl = H5Dget_create_plist(did); type = H5Dget_type(did); @@ -3860,7 +3860,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss h5tools_setstatus(EXIT_FAILURE); } else { - chsize = (hsize_t *)HDmalloc((size_t)maxdims * sizeof(hsize_t)); + chsize = (hsize_t *)malloc((size_t)maxdims * sizeof(hsize_t)); ctx.indent_level++; dump_indent += COL; @@ -3943,7 +3943,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t H5_ATTR_UNUSED *ss (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); ctx.indent_level--; dump_indent -= COL; - HDfree(chsize); + free(chsize); } } else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl)) { @@ -4457,8 +4457,8 @@ xml_print_enum(hid_t type) } /* Get the names and raw values of all members */ - name = (char **)HDcalloc((size_t)nmembs, sizeof(char *)); - value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size)); + name = (char **)calloc((size_t)nmembs, sizeof(char *)); + value = (unsigned char *)calloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size)); for (i = 0; i < nmembs; i++) { name[i] = H5Tget_member_name(type, i); @@ -4494,7 +4494,7 @@ xml_print_enum(hid_t type) h5tools_str_append(&buffer, "%s", t_name); h5tools_render_element(rawoutstream, outputformat, &ctx, &buffer, &curr_pos, (size_t)outputformat->line_ncols, (hsize_t)0, (hsize_t)0); - HDfree(t_name); + free(t_name); ctx.indent_level--; ctx.need_prefix = TRUE; @@ -4557,7 +4557,7 @@ xml_print_enum(hid_t type) for (i = 0; i < nmembs; i++) H5free_memory(name[i]); - HDfree(name); - HDfree(value); + free(name); + free(value); H5Tclose(super); } diff --git a/tools/src/h5format_convert/h5format_convert.c b/tools/src/h5format_convert/h5format_convert.c index ac98b25..648b9a8 100644 --- a/tools/src/h5format_convert/h5format_convert.c +++ b/tools/src/h5format_convert/h5format_convert.c @@ -453,9 +453,9 @@ done: } /* end if */ if (fname_g) - HDfree(fname_g); + free(fname_g); if (dname_g) - HDfree(dname_g); + free(dname_g); leave(h5tools_getstatus()); diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 05f51e4..d6273e2 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -101,7 +101,7 @@ main(int argc, char *argv[]) (void)HDsetvbuf(stderr, (char *)NULL, _IOLBF, 0); (void)HDsetvbuf(stdout, (char *)NULL, _IOLBF, 0); - if ((opt = (struct Options *)HDcalloc(1, sizeof(struct Options))) == NULL) + if ((opt = (struct Options *)calloc(1, sizeof(struct Options))) == NULL) goto err; if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) { @@ -242,17 +242,17 @@ main(int argc, char *argv[]) for (i = 0; i < opt->fcount; i++) { in = &(opt->infiles[i].in); if (in->sizeOfDimension) - HDfree(in->sizeOfDimension); + free(in->sizeOfDimension); if (in->sizeOfChunk) - HDfree(in->sizeOfChunk); + free(in->sizeOfChunk); if (in->maxsizeOfDimension) - HDfree(in->maxsizeOfDimension); + free(in->maxsizeOfDimension); if (in->externFilename) - HDfree(in->externFilename); + free(in->externFilename); if (in->data) - HDfree(in->data); + free(in->data); } - HDfree(opt); + free(opt); return EXIT_SUCCESS; err: @@ -260,17 +260,17 @@ err: for (i = 0; i < opt->fcount; i++) { in = &(opt->infiles[i].in); if (in->sizeOfDimension) - HDfree(in->sizeOfDimension); + free(in->sizeOfDimension); if (in->sizeOfChunk) - HDfree(in->sizeOfChunk); + free(in->sizeOfChunk); if (in->maxsizeOfDimension) - HDfree(in->maxsizeOfDimension); + free(in->maxsizeOfDimension); if (in->externFilename) - HDfree(in->externFilename); + free(in->externFilename); if (in->data) - HDfree(in->data); + free(in->data); } - HDfree(opt); + free(opt); return EXIT_FAILURE; } @@ -1267,28 +1267,28 @@ allocateIntegerStorage(struct Input *in) switch (in->inputSize) { case 8: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_INT8))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_INT8))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 16: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_INT16))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_INT16))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 32: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_INT32))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_INT32))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 64: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_INT64))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_INT64))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -1314,28 +1314,28 @@ allocateUIntegerStorage(struct Input *in) switch (in->inputSize) { case 8: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_UINT8))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_UINT8))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 16: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_UINT16))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_UINT16))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 32: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_UINT32))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_UINT32))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 64: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_UINT64))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_UINT64))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -1361,14 +1361,14 @@ allocateFloatStorage(struct Input *in) switch (in->inputSize) { case 32: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_FLOAT32))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_FLOAT32))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } break; case 64: - if ((in->data = (VOIDP)HDmalloc((size_t)len * sizeof(H5DT_FLOAT64))) == NULL) { + if ((in->data = (VOIDP)malloc((size_t)len * sizeof(H5DT_FLOAT64))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -1691,7 +1691,7 @@ processConfigurationFile(char *infile, struct Input *in) } } /* while (get_next_dim) */ - if ((in->sizeOfDimension = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == + if ((in->sizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { goto error; } @@ -1723,7 +1723,7 @@ processConfigurationFile(char *infile, struct Input *in) #endif if (!HDstrcmp("/", temp)) { /* / max dims */ if ((in->maxsizeOfDimension = - (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { goto error; } if (HDfscanf(strm, "%254s", temp) != 1) { /* start paren */ @@ -1821,7 +1821,7 @@ processConfigurationFile(char *infile, struct Input *in) printf("h5dump STORAGE_LAYOUT %s found\n", temp); #endif if (!HDstrcmp("CHUNKED", temp)) { /* CHUNKED */ - if ((in->sizeOfChunk = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->sizeOfChunk = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "Unable to allocate dynamic memory.\n"); goto error; } @@ -2565,7 +2565,7 @@ parseDimensions(struct Input *in, char *strm) i++; } in->rank = i + 1; - if ((in->sizeOfDimension = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->sizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3536,7 +3536,7 @@ getDimensionSizes(struct Input *in, FILE *strm) const char *err2 = "No. of dimensions for which dimension sizes provided is not equal to provided rank.\n"; - if ((in->sizeOfDimension = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->sizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3562,7 +3562,7 @@ getChunkedDimensionSizes(struct Input *in, FILE *strm) "No. of dimensions for which chunked dimension sizes provided is not equal to provided rank.\n"; const char *err3 = "The CHUNKED-DIMENSION-SIZES cannot exceed the sizes of DIMENSION-SIZES\n"; - if ((in->sizeOfChunk = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->sizeOfChunk = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3595,7 +3595,7 @@ getMaximumDimensionSizes(struct Input *in, FILE *strm) const char *err3 = "The MAXIMUM-DIMENSIONS cannot be less than the sizes of DIMENSION-SIZES. Exception: " "can be -1 to indicate unlimited size\n"; - if ((in->maxsizeOfDimension = (hsize_t *)HDmalloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { + if ((in->maxsizeOfDimension = (hsize_t *)malloc((size_t)in->rank * sizeof(hsize_t))) == NULL) { (void)fprintf(stderr, "%s", err1); return (-1); } @@ -3769,7 +3769,7 @@ getExternalFilename(struct Input *in, FILE *strm) } temp_len = HDstrlen(temp); - in->externFilename = (char *)HDmalloc((temp_len + 1) * sizeof(char)); + in->externFilename = (char *)malloc((temp_len + 1) * sizeof(char)); (void)HDstrcpy(in->externFilename, temp); in->externFilename[temp_len] = '\0'; return (0); diff --git a/tools/src/h5jam/h5jam.c b/tools/src/h5jam/h5jam.c index 2da104e..91eb937 100644 --- a/tools/src/h5jam/h5jam.c +++ b/tools/src/h5jam/h5jam.c @@ -330,11 +330,11 @@ main(int argc, char *argv[]) done: if (ub_file) - HDfree(ub_file); + free(ub_file); if (input_file) - HDfree(input_file); + free(input_file); if (output_file) - HDfree(output_file); + free(output_file); if (plist >= 0) H5Pclose(plist); diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 1cda5d4..34c817d 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -143,11 +143,11 @@ parse_command_line(int argc, const char *const *argv) done: if (input_file) - HDfree(input_file); + free(input_file); if (output_file) - HDfree(output_file); + free(output_file); if (ub_file) - HDfree(ub_file); + free(ub_file); return EXIT_FAILURE; } @@ -281,13 +281,13 @@ main(int argc, char *argv[]) done: if (input_file) - HDfree(input_file); + free(input_file); if (output_file) - HDfree(output_file); + free(output_file); if (ub_file) { - HDfree(ub_file); + free(ub_file); } leave(h5tools_getstatus()); diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 54c527a..219abfd 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -921,8 +921,8 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) dst_size = H5Tget_size(type); /* Get the names and raw values of all members */ - name = (char **)HDcalloc((size_t)nmembs, sizeof(char *)); - value = (unsigned char *)HDcalloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size)); + name = (char **)calloc((size_t)nmembs, sizeof(char *)); + value = (unsigned char *)calloc((size_t)nmembs, MAX(H5Tget_size(type), dst_size)); for (i = 0; i < (unsigned)nmembs; i++) { name[i] = H5Tget_member_name(type, i); H5Tget_member_value(type, i, value + i * H5Tget_size(type)); @@ -934,8 +934,8 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) /* Release resources */ for (i = 0; i < (unsigned)nmembs; i++) H5free_memory(name[i]); - HDfree(name); - HDfree(value); + free(name); + free(value); H5Tclose(super); return FALSE; @@ -976,8 +976,8 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) /* Release resources */ for (i = 0; i < (unsigned)nmembs; i++) H5free_memory(name[i]); - HDfree(name); - HDfree(value); + free(name); + free(value); } else h5tools_str_append(buffer, "\n%*s ", ind + 4, ""); @@ -1183,7 +1183,7 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) return FALSE; ndims = H5Tget_array_ndims(type); if (ndims) { - dims = (hsize_t *)HDmalloc((unsigned)ndims * sizeof(dims[0])); + dims = (hsize_t *)malloc((unsigned)ndims * sizeof(dims[0])); H5Tget_array_dims2(type, dims); /* Print dimensions */ @@ -1191,7 +1191,7 @@ print_array_type(h5tools_str_t *buffer, hid_t type, int ind) h5tools_str_append(buffer, "%s%" PRIuHSIZE, i ? "," : "[", dims[i]); h5tools_str_append(buffer, "]"); - HDfree(dims); + free(dims); } else h5tools_str_append(buffer, " [SCALAR]\n"); @@ -1436,17 +1436,17 @@ dump_dataset_values(hid_t dset) ctx.need_prefix = TRUE; if (NULL != - (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { + (ref_buf = (H5R_ref_t *)calloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { H5TOOLS_DEBUG("H5Dread reference read"); if (H5Dread(dset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_buf) < 0) { - HDfree(ref_buf); + free(ref_buf); H5TOOLS_INFO("H5Dread reference failed"); H5TOOLS_GOTO_DONE_NO_RET(); } h5tools_dump_reference(rawoutstream, info, &ctx, dset, ref_buf, ndims); PRINTVALSTREAM(rawoutstream, "\n"); - HDfree(ref_buf); + free(ref_buf); } } else { @@ -1606,10 +1606,10 @@ dump_attribute_values(hid_t attr) ctx.need_prefix = TRUE; if (NULL != - (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { + (ref_buf = (H5R_ref_t *)calloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { H5TOOLS_DEBUG("H5Aread reference read"); if (H5Aread(attr, H5T_STD_REF, ref_buf) < 0) { - HDfree(ref_buf); + free(ref_buf); H5TOOLS_INFO("H5Aread reference failed"); H5TOOLS_GOTO_DONE_NO_RET(); } @@ -1618,7 +1618,7 @@ dump_attribute_values(hid_t attr) PRINTVALSTREAM(rawoutstream, "\n"); ctx.indent_level--; - HDfree(ref_buf); + free(ref_buf); } } else { @@ -2208,7 +2208,7 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi */ if (cmt_bufsize > 0) { comment = - (char *)HDmalloc((size_t)cmt_bufsize + 1); /* new_size including null terminator */ + (char *)malloc((size_t)cmt_bufsize + 1); /* new_size including null terminator */ if (comment) { cmt_bufsize = H5Oget_comment(obj_id, comment, (size_t)cmt_bufsize); if (cmt_bufsize > 0) { @@ -2220,7 +2220,7 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); } /* end if */ - HDfree(comment); + free(comment); } } } @@ -2434,7 +2434,7 @@ done: h5tools_str_close(&buffer); if (buf) - HDfree(buf); + free(buf); return 0; } /* end list_lnk() */ @@ -3049,7 +3049,7 @@ main(int argc, char *argv[]) if (file_id < 0) { fprintf(rawerrorstream, "%s: unable to open file\n", argv[argno - 1]); - HDfree(fname); + free(fname); err_exit = 1; continue; } /* end if */ @@ -3126,17 +3126,17 @@ main(int argc, char *argv[]) list_lnk(oname, &li, &iter); } H5Fclose(file_id); - HDfree(fname); + free(fname); if (x) - HDfree(oname); + free(oname); for (u = 0; u < symlink_list.nused; u++) { if (symlink_list.objs[u].type == H5L_TYPE_EXTERNAL) - HDfree(symlink_list.objs[u].file); + free(symlink_list.objs[u].file); - HDfree(symlink_list.objs[u].path); + free(symlink_list.objs[u].path); } - HDfree(symlink_list.objs); + free(symlink_list.objs); /* if no-dangling-links option specified and dangling link found */ if (no_dangling_link_g && iter.symlink_list->dangle_link) diff --git a/tools/src/h5perf/pio_engine.c b/tools/src/h5perf/pio_engine.c index e6f0834..cbe9a17 100644 --- a/tools/src/h5perf/pio_engine.c +++ b/tools/src/h5perf/pio_engine.c @@ -166,7 +166,7 @@ do_pio(parameters param) /* IO type */ iot = param.io_type; - if (NULL == (fname = HDcalloc(FILENAME_MAX, sizeof(char)))) + if (NULL == (fname = calloc(FILENAME_MAX, sizeof(char)))) GOTOERROR(FAIL); switch (iot) { @@ -366,8 +366,8 @@ done: } /* release generic resources */ - HDfree(buffer); - HDfree(fname); + free(buffer); + free(fname); res.ret_code = ret_code; return res; } diff --git a/tools/src/h5perf/pio_perf.c b/tools/src/h5perf/pio_perf.c index 393a250..3be19f8 100644 --- a/tools/src/h5perf/pio_perf.c +++ b/tools/src/h5perf/pio_perf.c @@ -763,7 +763,7 @@ h5_set_info_object(void) /* copy key/value pair into temporary buffer */ len = strcspn(valp, ";"); next = &valp[len]; - key_val = (char *)HDcalloc(1, len + 1); + key_val = (char *)calloc(1, len + 1); /* increment the next pointer past the terminating semicolon */ if (*next == ';') @@ -811,10 +811,10 @@ h5_set_info_object(void) } valp = next; - HDfree(key_val); + free(key_val); } while (next && *next); - HDfree(envp); + free(envp); } return ret_value; @@ -1432,7 +1432,7 @@ parse_command_line(int argc, const char *const *argv) case '?': default: usage(progname); - HDfree(cl_opts); + free(cl_opts); return NULL; } } diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index 24c3f06..9fbe9eb 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -144,7 +144,7 @@ do_sio(parameters param, results *res) /* IO type */ iot = param.io_type; - if (NULL == (fname = HDcalloc(FILENAME_MAX, sizeof(char)))) + if (NULL == (fname = calloc(FILENAME_MAX, sizeof(char)))) GOTOERROR(FAIL); switch (iot) { @@ -268,8 +268,8 @@ done: } /* release generic resources */ - HDfree(buffer); - HDfree(fname); + free(buffer); + free(fname); res->ret_code = ret_code; } @@ -1169,7 +1169,7 @@ set_vfd(parameters *param) assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES); - if (NULL == (sv = HDcalloc(1, sizeof(*sv)))) + if (NULL == (sv = calloc(1, sizeof(*sv)))) return -1; for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { memb_fapl[mt] = H5P_DEFAULT; @@ -1179,11 +1179,11 @@ set_vfd(parameters *param) } if (H5Pset_fapl_multi(my_fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0) { - HDfree(sv); + free(sv); return -1; } - HDfree(sv); + free(sv); } else if (vfd == family) { hsize_t fam_size = 1 * 1024 * 1024; /*100 MB*/ @@ -1271,7 +1271,7 @@ do_cleanupfile(iotype iot, char *filename) hid_t driver; temp_sz = (4096 + sizeof("-?.h5")) * sizeof(char); - if (NULL == (temp = HDcalloc(1, temp_sz))) + if (NULL == (temp = calloc(1, temp_sz))) goto done; if (clean_file_g == -1) @@ -1332,5 +1332,5 @@ do_cleanupfile(iotype iot, char *filename) } done: - HDfree(temp); + free(temp); } diff --git a/tools/src/h5perf/sio_perf.c b/tools/src/h5perf/sio_perf.c index 5d88cd2..a991e19 100644 --- a/tools/src/h5perf/sio_perf.c +++ b/tools/src/h5perf/sio_perf.c @@ -214,7 +214,7 @@ main(int argc, char *argv[]) run_test_loop(opts); finish: - HDfree(opts); + free(opts); return exit_value; } @@ -500,16 +500,16 @@ run_test(iotype iot, parameters parms, struct options *opts) } /* clean up our mess */ - HDfree(write_sys_mm_table); - HDfree(write_mm_table); - HDfree(write_gross_mm_table); - HDfree(write_raw_mm_table); + free(write_sys_mm_table); + free(write_mm_table); + free(write_gross_mm_table); + free(write_raw_mm_table); if (!parms.h5_write_only) { - HDfree(read_sys_mm_table); - HDfree(read_mm_table); - HDfree(read_gross_mm_table); - HDfree(read_raw_mm_table); + free(read_sys_mm_table); + free(read_mm_table); + free(read_gross_mm_table); + free(read_raw_mm_table); } return ret_value; @@ -809,7 +809,7 @@ parse_command_line(int argc, const char *const *argv) struct options *cl_opts; int i, default_rank, actual_rank, ranks[4]; - cl_opts = (struct options *)HDmalloc(sizeof(struct options)); + cl_opts = (struct options *)malloc(sizeof(struct options)); cl_opts->page_buffer_size = 0; cl_opts->page_size = 0; @@ -1103,7 +1103,7 @@ parse_command_line(int argc, const char *const *argv) case '?': default: usage(progname); - HDfree(cl_opts); + free(cl_opts); return NULL; } } diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index 5c95b06..a6d83ea 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -132,7 +132,7 @@ h5repack_addfilter(const char *str, pack_opt_t *options) n = options->n_filter_g++; /* increase # of global filters */ if (options->n_filter_g > H5_REPACK_MAX_NFILTERS) { error_msg("maximum number of filters exceeded for <%s>\n", str); - HDfree(obj_list); + free(obj_list); return -1; } @@ -141,7 +141,7 @@ h5repack_addfilter(const char *str, pack_opt_t *options) else options_add_filter(obj_list, n_objs, filter, options->op_tbl); - HDfree(obj_list); + free(obj_list); return 0; } /* end h5repack_addfilter() */ @@ -195,7 +195,7 @@ h5repack_addlayout(const char *str, pack_opt_t *options) if (options->all_layout == 0) ret_value = options_add_layout(obj_list, n_objs, &pack, options->op_tbl); - HDfree(obj_list); + free(obj_list); ret_value = 0; } /* end if obj_list exists */ @@ -253,7 +253,7 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t for (i = 0; i < travt->nobjs; i++) { if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) { /* Push onto the stack */ - if (NULL == (dt = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) + if (NULL == (dt = (named_dt_t *)malloc(sizeof(named_dt_t)))) H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "buffer allocation failed failed"); dt->next = *named_dt_head_p; *named_dt_head_p = dt; @@ -276,7 +276,7 @@ copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, t */ if (!dt_ret) { /* Push the new datatype onto the stack */ - if (NULL == (dt_ret = (named_dt_t *)HDmalloc(sizeof(named_dt_t)))) + if (NULL == (dt_ret = (named_dt_t *)malloc(sizeof(named_dt_t)))) H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "buffer allocation failed failed"); dt_ret->next = *named_dt_head_p; *named_dt_head_p = dt_ret; @@ -330,7 +330,7 @@ named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err) if (H5Tclose(dt->id_out) < 0 && !ignore_err) H5TOOLS_GOTO_ERROR((-1), "H5Tclose failed"); dt = dt->next; - HDfree(*named_dt_head_p); + free(*named_dt_head_p); *named_dt_head_p = dt; } @@ -481,9 +481,9 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ *----------------------------------------------------------------- */ - buf = (void *)HDmalloc((size_t)(nelmts * msize)); + buf = (void *)malloc((size_t)(nelmts * msize)); if (buf == NULL) { - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); } /* end if */ if (options->verbose == 2) { H5_timer_init(&timer); @@ -526,7 +526,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_ if (TRUE == h5tools_detect_vlen(wtype_id)) H5Treclaim(wtype_id, space_id, H5P_DEFAULT, buf); - HDfree(buf); + free(buf); buf = NULL; } /*H5T_REFERENCE*/ @@ -566,7 +566,7 @@ done: H5Treclaim(wtype_id, space_id, H5P_DEFAULT, buf); /* Free buf */ - HDfree(buf); + free(buf); } H5Aclose(attr_out); diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 8b11974..be3fddf 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -1012,7 +1012,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti /* have to read the whole dataset if there is only one element in the * dataset */ if (need < H5TOOLS_MALLOCSIZE) - buf = HDmalloc(need); + buf = malloc(need); /* Set up collective write if using filters in parallel */ { @@ -1061,7 +1061,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti if (buf != NULL) { /* TODO: is buf potentially released by H5Dvlen_reclaim()? */ - HDfree(buf); + free(buf); buf = NULL; } } @@ -1108,7 +1108,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti &hslab_nbytes) < 0) H5TOOLS_GOTO_ERROR((-1), "get_hyperslab failed"); - hslab_buf = HDmalloc((size_t)hslab_nbytes); + hslab_buf = malloc((size_t)hslab_nbytes); if (hslab_buf == NULL) H5TOOLS_GOTO_ERROR((-1), "can't allocate space for hyperslab"); @@ -1189,7 +1189,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5Sclose(hslab_space); if (hslab_buf != NULL) { - HDfree(hslab_buf); + free(hslab_buf); hslab_buf = NULL; } } /* end if reading/writing by hyperslab */ @@ -1421,7 +1421,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + free(linkinfo.trg_path); linkinfo.trg_path = NULL; } /* options->merge */ else { @@ -1460,7 +1460,7 @@ done: /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + free(linkinfo.trg_path); H5E_BEGIN_TRY { @@ -1484,9 +1484,9 @@ done: /* free */ if (buf != NULL) - HDfree(buf); + free(buf); if (hslab_buf != NULL) - HDfree(hslab_buf); + free(hslab_buf); return ret_value; } /* end do_copy_objects() */ diff --git a/tools/src/h5repack/h5repack_opttable.c b/tools/src/h5repack/h5repack_opttable.c index 4e6e0f4..64f3011 100644 --- a/tools/src/h5repack/h5repack_opttable.c +++ b/tools/src/h5repack/h5repack_opttable.c @@ -104,7 +104,7 @@ aux_inctable(pack_opttbl_t *table, unsigned n_objs) int ret_value = 0; table->size += n_objs; - table->objs = (pack_info_t *)HDrealloc(table->objs, table->size * sizeof(pack_info_t)); + table->objs = (pack_info_t *)realloc(table->objs, table->size * sizeof(pack_info_t)); if (table->objs == NULL) { H5TOOLS_INFO("not enough memory for options table"); ret_value = -1; @@ -132,14 +132,14 @@ options_table_init(pack_opttbl_t **tbl) pack_opttbl_t *table; int ret_value = 0; - if (NULL == (table = (pack_opttbl_t *)HDmalloc(sizeof(pack_opttbl_t)))) { + if (NULL == (table = (pack_opttbl_t *)malloc(sizeof(pack_opttbl_t)))) { H5TOOLS_GOTO_ERROR((-1), "not enough memory for options table"); } table->size = 30; table->nelems = 0; - if (NULL == (table->objs = (pack_info_t *)HDmalloc(table->size * sizeof(pack_info_t)))) { - HDfree(table); + if (NULL == (table->objs = (pack_info_t *)malloc(table->size * sizeof(pack_info_t)))) { + free(table); H5TOOLS_GOTO_ERROR((-1), "not enough memory for options table"); } @@ -163,8 +163,8 @@ done: int options_table_free(pack_opttbl_t *table) { - HDfree(table->objs); - HDfree(table); + free(table->objs); + free(table); return 0; } diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index cee85ac..d4fa990 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -77,7 +77,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t else *n_objs = n; - obj_list = (obj_list_t *)HDmalloc(n * sizeof(obj_list_t)); + obj_list = (obj_list_t *)malloc(n * sizeof(obj_list_t)); if (obj_list == NULL) { error_msg("could not allocate object list\n"); return NULL; @@ -103,7 +103,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t /* nothing after : */ if (end_obj + 1 == (int)len) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("input Error: Invalid compression type in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -134,7 +134,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t c = str[u]; if (!HDisdigit(c) && l == -1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("compression parameter not digit in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -184,7 +184,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t c = str[u]; if (!HDisdigit(c) && l == -1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("compression parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -244,13 +244,13 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t c = str[u]; if (!HDisdigit(c) && l == -1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("filter number parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } else if (!HDisdigit(c) && f == -1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("filter flag parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -269,7 +269,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t c = str[u]; if (!HDisdigit(c)) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("compression parameter is not a digit in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -312,7 +312,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 1; if (no_param) { /*no more parameters, GZIP must have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("missing compression parameter in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -327,7 +327,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 2; if (no_param) { /*no more parameters, SZIP must have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("missing compression parameter in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -342,7 +342,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 0; if (m > 0) { /*shuffle does not have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("extra parameter in SHUF <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -356,7 +356,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 0; if (m > 0) { /*shuffle does not have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("extra parameter in FLET <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -370,7 +370,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 0; if (m > 0) { /*nbit does not have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("extra parameter in NBIT <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -384,7 +384,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t filt->cd_nelmts = 2; if (no_param) { /*no more parameters, SOFF must have parameter */ if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("missing compression parameter in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -397,14 +397,14 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t /* parameters does not match count */ if (filt->cd_nelmts != j) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("incorrect number of compression parameters in <%s>\n", str); HDexit(EXIT_FAILURE); } } else { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("invalid filter type in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -425,7 +425,7 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t case H5Z_FILTER_DEFLATE: if (filt->cd_values[0] > 9) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("invalid compression parameter in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -438,19 +438,19 @@ parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, pack_opt_t pixels_per_block = filt->cd_values[0]; if ((pixels_per_block % 2) == 1) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("pixels_per_block is not even in <%s>\n", str); HDexit(EXIT_FAILURE); } if (pixels_per_block > H5_SZIP_MAX_PIXELS_PER_BLOCK) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("pixels_per_block is too large in <%s>\n", str); HDexit(EXIT_FAILURE); } if ((HDstrcmp(smask, "NN") != 0) && (HDstrcmp(smask, "EC") != 0)) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("szip mask must be 'NN' or 'EC' \n"); HDexit(EXIT_FAILURE); } @@ -514,7 +514,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about } n++; - obj_list = (obj_list_t *)HDmalloc(n * sizeof(obj_list_t)); + obj_list = (obj_list_t *)malloc(n * sizeof(obj_list_t)); if (obj_list == NULL) { error_msg("could not allocate object list\n"); return NULL; @@ -541,7 +541,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about /* nothing after : */ if (end_obj + 1 == (int)len) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, no characters after : in <%s>\n", str); HDexit(EXIT_FAILURE); } @@ -575,7 +575,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about k = 0; if (j > len) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, <%s> Chunk dimensions missing\n", str); HDexit(EXIT_FAILURE); } @@ -587,7 +587,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about if (!HDisdigit(c) && c != 'x' && c != 'N' && c != 'O' && c != 'N' && c != 'E') { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, <%s> Not a valid character in <%s>\n", sdim, str); HDexit(EXIT_FAILURE); } @@ -599,7 +599,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about pack->chunk.chunk_lengths[c_index] = HDstrtoull(sdim, NULL, 0); if (pack->chunk.chunk_lengths[c_index] == 0) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim, str); HDexit(EXIT_FAILURE); } @@ -615,7 +615,7 @@ parse_layout(const char *str, unsigned *n_objs, pack_info_t *pack, /* info about pack->chunk.chunk_lengths[c_index] = HDstrtoull(sdim, NULL, 0); if (pack->chunk.chunk_lengths[c_index] == 0) { if (obj_list) - HDfree(obj_list); + free(obj_list); error_msg("in parse layout, <%s> conversion to number in <%s>\n", sdim, str); HDexit(EXIT_FAILURE); } diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index a9a5fd3..222447d 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -152,19 +152,19 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti *------------------------------------------------------------------------- */ if (nelmts) { - buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hobj_ref_t *)malloc((unsigned)(nelmts * msize)); if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dread failed"); - refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize); + refbuf = (hobj_ref_t *)calloc((unsigned)nelmts, msize); if (refbuf == NULL) { printf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); + } for (u = 0; u < nelmts; u++) { H5E_BEGIN_TRY { @@ -207,9 +207,9 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed"); if (buf) - HDfree(buf); + free(buf); if (refbuf) - HDfree(refbuf); + free(refbuf); /*------------------------------------------------------ * copy attrs @@ -234,11 +234,11 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti *------------------------------------------------------------------------- */ if (nelmts) { - buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hdset_reg_ref_t *)malloc((unsigned)(nelmts * msize)); if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Dread failed"); @@ -246,12 +246,12 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti * create output *------------------------------------------------------------------------- */ - refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), - (size_t)nelmts); /*init to zero */ + refbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), + (size_t)nelmts); /*init to zero */ if (refbuf == NULL) { printf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); + } for (u = 0; u < nelmts; u++) { H5E_BEGIN_TRY @@ -301,9 +301,9 @@ do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti H5TOOLS_GOTO_ERROR((-1), "H5Dwrite failed"); if (buf) - HDfree(buf); + free(buf); if (refbuf) - HDfree(refbuf); + free(refbuf); /*----------------------------------------------------- * copy attrs @@ -506,8 +506,8 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (nmembers < 1) H5TOOLS_GOTO_ERROR((-1), "H5Tget_nmembers failed"); - ref_comp_index = (unsigned *)HDmalloc((size_t)nmembers * sizeof(unsigned)); - ref_comp_size = (size_t *)HDmalloc((size_t)nmembers * sizeof(ref_comp_size)); + ref_comp_index = (unsigned *)malloc((size_t)nmembers * sizeof(unsigned)); + ref_comp_size = (size_t *)malloc((size_t)nmembers * sizeof(ref_comp_size)); ref_comp_field_n = 0; for (i = 0; i < (unsigned)nmembers; i++) { @@ -527,12 +527,12 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / * statement below. */ if (!ref_comp_field_n) { if (ref_comp_index) { - HDfree(ref_comp_index); + free(ref_comp_index); ref_comp_index = NULL; } if (ref_comp_size) { - HDfree(ref_comp_size); + free(ref_comp_size); ref_comp_size = NULL; } } @@ -598,19 +598,19 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / if (nelmts > 0) { /* handle object references */ if ((is_ref || is_ref_array) && (H5R_OBJ_REF_BUF_SIZE == msize)) { - buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hobj_ref_t *)malloc((unsigned)(nelmts * msize)); if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); - refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize); + refbuf = (hobj_ref_t *)calloc((unsigned)nelmts, msize); if (refbuf == NULL) { printf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); + } for (i = 0; i < (unsigned)nelmts; i++) if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, @@ -619,12 +619,12 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / } /* H5T_STD_REF_OBJ */ /* handle region references */ else if ((is_ref || is_ref_array) && (H5R_DSET_REG_REF_BUF_SIZE == msize)) { - buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); + buf = (hdset_reg_ref_t *)malloc((unsigned)(nelmts * msize)); if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -632,12 +632,11 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / * create output *------------------------------------------------------------------------- */ - refbuf = - (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ + refbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if (refbuf == NULL) { printf("cannot allocate memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDcalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "calloc failed"); + } for (i = 0; i < (unsigned)nelmts; i++) if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, @@ -647,13 +646,13 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / else if (is_ref_vlen) { /* handle VLEN of references */ - buf = (hvl_t *)HDmalloc((unsigned)(nelmts * sizeof(hvl_t))); + buf = (hvl_t *)malloc((unsigned)(nelmts * sizeof(hvl_t))); refbuf = buf; /* reuse the read buffer for write */ if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -689,13 +688,13 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / else if (is_ref_comp) { /* handle ref fields in a compound */ - buf = HDmalloc((unsigned)(nelmts * msize)); + buf = malloc((unsigned)(nelmts * msize)); refbuf = buf; /* reuse the read buffer for write */ if (buf == NULL) { printf("cannot read into memory\n"); - H5TOOLS_GOTO_ERROR((-1), "HDmalloc failed"); - } /* end if */ + H5TOOLS_GOTO_ERROR((-1), "malloc failed"); + } if (H5Aread(attr_id, mtype_id, buf) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Aread failed"); @@ -739,22 +738,22 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / refbuf = NULL; /* set it to NULL to avoid double free since buf and refbuf are the same. */ if (buf) { - HDfree(buf); + free(buf); buf = NULL; } if (refbuf) { - HDfree(refbuf); + free(refbuf); refbuf = NULL; } if (ref_comp_index) { - HDfree(ref_comp_index); + free(ref_comp_index); ref_comp_index = NULL; } if (ref_comp_size) { - HDfree(ref_comp_size); + free(ref_comp_size); ref_comp_size = NULL; } @@ -777,15 +776,15 @@ copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout) / done: if (refbuf) - HDfree(refbuf); + free(refbuf); if (buf) - HDfree(buf); + free(buf); if (ref_comp_index) - HDfree(ref_comp_index); + free(ref_comp_index); if (ref_comp_size) - HDfree(ref_comp_size); + free(ref_comp_size); H5E_BEGIN_TRY { diff --git a/tools/src/h5stat/h5stat.c b/tools/src/h5stat/h5stat.c index 9da6ba2..23bde1a 100644 --- a/tools/src/h5stat/h5stat.c +++ b/tools/src/h5stat/h5stat.c @@ -306,7 +306,7 @@ attribute_stats(iter_t *iter, const H5O_info2_t *oi, const H5O_native_info_t *na /* Add attribute count to proper bin */ 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)); + iter->attr_bins = (unsigned long *)realloc(iter->attr_bins, (bin + 1) * sizeof(unsigned long)); assert(iter->attr_bins); /* Initialize counts for intermediate bins */ @@ -367,7 +367,7 @@ group_stats(iter_t *iter, const char *name, const H5O_info2_t *oi, const H5O_nat if ((bin + 1) > iter->group_nbins) { /* Allocate more storage for info about dataset's datatype */ if ((iter->group_bins = - (unsigned long *)HDrealloc(iter->group_bins, (bin + 1) * sizeof(unsigned long))) == NULL) + (unsigned long *)realloc(iter->group_bins, (bin + 1) * sizeof(unsigned long))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "H5Drealloc() failed"); /* Initialize counts for intermediate bins */ @@ -502,8 +502,8 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info2_t *oi, const H5O_n bin = ceil_log10((unsigned long)dims[0]); if ((bin + 1) > iter->dset_dim_nbins) { /* Allocate more storage for info about dataset's datatype */ - if ((iter->dset_dim_bins = (unsigned long *)HDrealloc(iter->dset_dim_bins, - (bin + 1) * sizeof(unsigned long))) == NULL) + if ((iter->dset_dim_bins = (unsigned long *)realloc(iter->dset_dim_bins, + (bin + 1) * sizeof(unsigned long))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "H5Drealloc() failed"); /* Initialize counts for intermediate bins */ @@ -541,7 +541,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info2_t *oi, const H5O_n iter->dset_ntypes++; /* Allocate more storage for info about dataset's datatype */ - if ((iter->dset_type_info = (dtype_info_t *)HDrealloc( + if ((iter->dset_type_info = (dtype_info_t *)realloc( iter->dset_type_info, iter->dset_ntypes * sizeof(dtype_info_t))) == NULL) H5TOOLS_GOTO_ERROR(FAIL, "H5Drealloc() failed"); @@ -738,7 +738,7 @@ freespace_stats(hid_t fid, iter_t *iter) if ((nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, 0, NULL)) < 0) return (FAIL); else if (nsects) { - if (NULL == (sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)))) + if (NULL == (sect_info = (H5F_sect_info_t *)calloc((size_t)nsects, sizeof(H5F_sect_info_t)))) return (FAIL); nsects = H5Fget_free_sections(fid, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); assert(nsects); @@ -754,7 +754,7 @@ freespace_stats(hid_t fid, iter_t *iter) bin = ceil_log10((unsigned long)sect_info[u].size); 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)); + iter->sect_bins = (unsigned long *)realloc(iter->sect_bins, (bin + 1) * sizeof(unsigned long)); assert(iter->sect_bins); /* Initialize counts for intermediate bins */ @@ -770,7 +770,7 @@ freespace_stats(hid_t fid, iter_t *iter) } /* end for */ if (sect_info) - HDfree(sect_info); + free(sect_info); return 0; } /* end freespace_stats() */ @@ -794,12 +794,12 @@ hand_free(struct handler_t *hand) for (u = 0; u < hand->obj_count; u++) if (hand->obj[u]) { - HDfree(hand->obj[u]); + free(hand->obj[u]); hand->obj[u] = NULL; } /* end if */ hand->obj_count = 0; - HDfree(hand->obj); - HDfree(hand); + free(hand->obj); + free(hand); } /* end if */ } /* end hand_free() */ @@ -940,14 +940,14 @@ parse_command_line(int argc, const char *const *argv, struct handler_t **hand_re display_object = TRUE; /* Allocate space to hold the command line info */ - if (NULL == (hand = (struct handler_t *)HDcalloc((size_t)1, sizeof(struct handler_t)))) { + if (NULL == (hand = (struct handler_t *)calloc((size_t)1, sizeof(struct handler_t)))) { error_msg("unable to allocate memory for object struct\n"); goto error; } /* end if */ /* Allocate space to hold the object strings */ hand->obj_count = (size_t)argc; - if (NULL == (hand->obj = (char **)HDcalloc((size_t)argc, sizeof(char *)))) { + if (NULL == (hand->obj = (char **)calloc((size_t)argc, sizeof(char *)))) { error_msg("unable to allocate memory for object array\n"); goto error; } /* end if */ @@ -1031,49 +1031,49 @@ iter_free(iter_t *iter) /* Clear array of bins for group counts */ if (iter->group_bins) { - HDfree(iter->group_bins); + free(iter->group_bins); iter->group_bins = NULL; } /* end if */ /* Clear array for tracking small groups */ if (iter->num_small_groups) { - HDfree(iter->num_small_groups); + free(iter->num_small_groups); iter->num_small_groups = NULL; } /* end if */ /* Clear array of bins for attribute counts */ if (iter->attr_bins) { - HDfree(iter->attr_bins); + free(iter->attr_bins); iter->attr_bins = NULL; } /* end if */ /* Clear array for tracking small attributes */ if (iter->num_small_attrs) { - HDfree(iter->num_small_attrs); + free(iter->num_small_attrs); iter->num_small_attrs = NULL; } /* end if */ /* Clear dataset datatype information found */ if (iter->dset_type_info) { - HDfree(iter->dset_type_info); + free(iter->dset_type_info); iter->dset_type_info = NULL; } /* end if */ /* Clear array of bins for dataset dimensions */ if (iter->dset_dim_bins) { - HDfree(iter->dset_dim_bins); + free(iter->dset_dim_bins); iter->dset_dim_bins = NULL; } /* end if */ /* Clear array of tracking 1-D small datasets */ if (iter->small_dset_dims) { - HDfree(iter->small_dset_dims); + free(iter->small_dset_dims); iter->small_dset_dims = NULL; } /* end if */ /* Clear array of bins for free-space section sizes */ if (iter->sect_bins) { - HDfree(iter->sect_bins); + free(iter->sect_bins); iter->sect_bins = NULL; } /* end if */ } /* end iter_free() */ @@ -1732,10 +1732,9 @@ main(int argc, char *argv[]) iter.free_hdr = finfo.free.meta_size; } /* end else */ - iter.num_small_groups = (unsigned long *)HDcalloc((size_t)sgroups_threshold, sizeof(unsigned long)); - iter.num_small_attrs = - (unsigned long *)HDcalloc((size_t)(sattrs_threshold + 1), sizeof(unsigned long)); - iter.small_dset_dims = (unsigned long *)HDcalloc((size_t)sdsets_threshold, sizeof(unsigned long)); + iter.num_small_groups = (unsigned long *)calloc((size_t)sgroups_threshold, sizeof(unsigned long)); + iter.num_small_attrs = (unsigned long *)calloc((size_t)(sattrs_threshold + 1), sizeof(unsigned long)); + iter.small_dset_dims = (unsigned long *)calloc((size_t)sdsets_threshold, sizeof(unsigned long)); if (iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) { error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n"); diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index 5f26ef4..4a6029c 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -353,9 +353,9 @@ main(int argc, char *argv[]) done: if (fname) - HDfree(fname); + free(fname); if (fname_g) - HDfree(fname_g); + free(fname_g); H5E_BEGIN_TRY { diff --git a/tools/src/misc/h5mkgrp.c b/tools/src/misc/h5mkgrp.c index 98b6b76..a359db6 100644 --- a/tools/src/misc/h5mkgrp.c +++ b/tools/src/misc/h5mkgrp.c @@ -58,11 +58,11 @@ leave(int ret) size_t curr_group; if (params_g.fname) - HDfree(params_g.fname); + free(params_g.fname); if (params_g.ngroups) { for (curr_group = 0; curr_group < params_g.ngroups; curr_group++) - HDfree(params_g.groups[curr_group]); - HDfree(params_g.groups); + free(params_g.groups[curr_group]); + free(params_g.groups); } if (H5I_INVALID_HID != params_g.fapl_id && H5P_DEFAULT != params_g.fapl_id) if (H5Pclose(params_g.fapl_id) < 0) @@ -246,7 +246,7 @@ parse_command_line(int argc, const char *const *argv, mkgrp_opt_t *options) /* Allocate space for the group name pointers */ options->ngroups = (size_t)(argc - H5_optind); - options->groups = (char **)HDmalloc(options->ngroups * sizeof(char *)); + options->groups = (char **)malloc(options->ngroups * sizeof(char *)); /* Retrieve the group names */ curr_group = 0; diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index c4ea0a6..843e9a3 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -226,9 +226,9 @@ main(int argc, char *argv[]) } /* end while */ /* allocate names */ - if (NULL == (src_name = (char *)HDcalloc((size_t)NAMELEN, sizeof(char)))) + if (NULL == (src_name = (char *)calloc((size_t)NAMELEN, sizeof(char)))) HDexit(EXIT_FAILURE); - if (NULL == (dst_name = (char *)HDcalloc((size_t)NAMELEN, sizeof(char)))) + if (NULL == (dst_name = (char *)calloc((size_t)NAMELEN, sizeof(char)))) HDexit(EXIT_FAILURE); /* @@ -275,7 +275,7 @@ main(int argc, char *argv[]) usage(prog_name); /* Now the real work, split the file */ - buf = (char *)HDmalloc(blk_size); + buf = (char *)malloc(blk_size); while (src_offset < src_size) { /* Read a block. The amount to read is the minimum of: @@ -498,9 +498,9 @@ main(int argc, char *argv[]) } /* end if */ /* Free resources and return */ - HDfree(src_name); - HDfree(dst_name); - HDfree(buf); + free(src_name); + free(dst_name); + free(buf); return EXIT_SUCCESS; } /* end main */ H5_GCC_CLANG_DIAG_ON("format-nonliteral") diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 9fb5b74..899eaa7 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -238,10 +238,10 @@ gent_named_vl(hid_t loc_id) /* allocate and initialize VL dataset to write */ buf[0].len = 1; - buf[0].p = HDmalloc(1 * sizeof(int)); + buf[0].p = malloc(1 * sizeof(int)); ((int *)buf[0].p)[0] = 1; buf[1].len = 2; - buf[1].p = HDmalloc(2 * sizeof(int)); + buf[1].p = malloc(2 * sizeof(int)); ((int *)buf[1].p)[0] = 2; ((int *)buf[1].p)[1] = 3; @@ -284,16 +284,16 @@ gent_nested_vl(hid_t loc_id) /* allocate and initialize VL dataset to write */ buf[0].len = 1; - buf[0].p = HDmalloc(1 * sizeof(hvl_t)); + buf[0].p = malloc(1 * sizeof(hvl_t)); tvl = (hvl_t *)buf[0].p; - tvl->p = HDmalloc(1 * sizeof(int)); + tvl->p = malloc(1 * sizeof(int)); tvl->len = 1; ((int *)tvl->p)[0] = 1; buf[1].len = 1; - buf[1].p = HDmalloc(1 * sizeof(hvl_t)); + buf[1].p = malloc(1 * sizeof(hvl_t)); tvl = (hvl_t *)buf[1].p; - tvl->p = HDmalloc(2 * sizeof(int)); + tvl->p = malloc(2 * sizeof(int)); tvl->len = 2; ((int *)tvl->p)[0] = 2; ((int *)tvl->p)[1] = 3; diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 1700177..0c253d2 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -334,17 +334,17 @@ onion_filepaths_init(const char *basename) { struct onion_filepaths *paths = NULL; - if (NULL == (paths = HDcalloc(1, sizeof(struct onion_filepaths)))) + if (NULL == (paths = calloc(1, sizeof(struct onion_filepaths)))) goto error; if (NULL == (paths->canon = HDstrdup(basename))) goto error; - if (NULL == (paths->onion = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->onion = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); - if (NULL == (paths->recovery = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->recovery = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); @@ -352,10 +352,10 @@ onion_filepaths_init(const char *basename) error: if (paths != NULL) { - HDfree(paths->canon); - HDfree(paths->onion); - HDfree(paths->recovery); - HDfree(paths); + free(paths->canon); + free(paths->onion); + free(paths->recovery); + free(paths); } return NULL; } @@ -364,10 +364,10 @@ static void onion_filepaths_destroy(struct onion_filepaths *s) { if (s) { - HDfree(s->canon); - HDfree(s->onion); - HDfree(s->recovery); - HDfree(s); + free(s->canon); + free(s->onion); + free(s->recovery); + free(s); } } @@ -5020,7 +5020,7 @@ test_comps_vlen(const char *fname, const char *dset, const char *attr, int diff, /* Allocate and initialize VL data to write */ for (i = 0; i < SDIM_DSET; i++) { wdata[i].i1 = (int)i; - wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); + wdata[i].vl.p = malloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; for (j = 0; j < (i + 1); j++) { ((cmpd2_t *)wdata[i].vl.p)[j].i2 = (int)(i * 10 + (unsigned)diff); @@ -5141,7 +5141,7 @@ test_comps_array_vlen(const char *fname, const char *dset, const char *attr, int /* Allocate and initialize VL data to write in compound2 */ for (j = 0; j < SDIM_CMPD_ARRAY; j++) { wdata[i].cmpd2[j].i2 = (int)(j * 10); - wdata[i].cmpd2[j].vl.p = HDmalloc((j + 1) * sizeof(cmpd3_t)); + wdata[i].cmpd2[j].vl.p = malloc((j + 1) * sizeof(cmpd3_t)); wdata[i].cmpd2[j].vl.len = j + 1; for (k = 0; k < (j + 1); k++) { /* Initialize data of compound3 */ @@ -5280,7 +5280,7 @@ test_comps_vlen_arry(const char *fname, const char *dset, const char *attr, int for (i = 0; i < SDIM_DSET; i++) { /* compound 1 data */ wdata[i].i1 = (int)i; - wdata[i].vl.p = HDmalloc((i + 1) * sizeof(cmpd2_t)); + wdata[i].vl.p = malloc((i + 1) * sizeof(cmpd2_t)); wdata[i].vl.len = i + 1; for (j = 0; j < (i + 1); j++) { /* compound2 data */ @@ -6088,10 +6088,10 @@ write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -6349,7 +6349,7 @@ write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, n = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -6748,7 +6748,7 @@ write_attr_strings(hid_t loc_id, const char *dset_name, hid_t fid, for (i = 0; i < 4; i++) for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -7074,10 +7074,10 @@ write_attr_in(hid_t loc_id, const char *dset_name, hid_t fid, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -7338,7 +7338,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, hid_t fid, n = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -7738,7 +7738,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, hid_t fid, for (i = 0; i < 4; i++) for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -8041,10 +8041,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -8091,7 +8091,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, /* allocate and initialize array data to write */ size = (H5TOOLS_MALLOCSIZE / sizeof(double) + 1) * sizeof(double); - dbuf = (double *)HDmalloc(size); + dbuf = (double *)malloc(size); for (jj = 0; jj < (H5TOOLS_MALLOCSIZE / sizeof(double) + 1); jj++) dbuf[jj] = (double)jj; @@ -8114,7 +8114,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, H5Dclose(ldid); H5Tclose(ltid); H5Sclose(lsid); - HDfree(dbuf); + free(dbuf); } /*------------------------------------------------------------------------- @@ -8229,7 +8229,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, n = 0; for (i = 0; i < 3; i++) for (j = 0; j < 2; j++) { - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -8408,7 +8408,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, hid_t fid, for (i = 0; i < 4; i++) for (j = 0; j < 3; j++) for (k = 0; k < 2; k++) { - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -8500,10 +8500,10 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) int i; /* allocate the buffer for write the references */ - rbuf = (hdset_reg_ref_t *)HDcalloc((size_t)2, sizeof(hdset_reg_ref_t)); + rbuf = (hdset_reg_ref_t *)calloc((size_t)2, sizeof(hdset_reg_ref_t)); /* allocate the buffer for write the data dataset */ - buf = (int *)HDmalloc(10 * 10 * sizeof(int)); + buf = (int *)malloc(10 * 10 * sizeof(int)); for (i = 0; i < 10 * 10; i++) buf[i] = i; @@ -8579,8 +8579,8 @@ gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) status = H5Sclose(sid2); assert(status >= 0); - HDfree(rbuf); - HDfree(buf); + free(rbuf); + free(buf); } /*------------------------------------------------------------------------- @@ -8631,7 +8631,7 @@ test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers goto out; /* create a evenly divided buffer from 0 to 127 */ - buf = (char *)HDmalloc((size_t)(nelmts * size)); + buf = (char *)malloc((size_t)(nelmts * size)); s = 1024 * 1024 / 127; for (i = 0, j = 0, c = 0; i < 1024 * 1024; j++, i++) { if (j == s) { @@ -8656,7 +8656,7 @@ test_hyperslab(const char *fname, int make_diffs /* flag to modify data buffers goto out; } } - HDfree(buf); + free(buf); buf = NULL; /* close */ diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 82ac178..776e914 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -470,13 +470,13 @@ gent_dataset(void) int i, j; /* Set up data arrays */ - dset1_data = (int *)HDcalloc(10 * 20, sizeof(int)); - dset1 = (int **)HDcalloc(10, sizeof(dset1_data)); + dset1_data = (int *)calloc(10 * 20, sizeof(int)); + dset1 = (int **)calloc(10, sizeof(dset1_data)); for (i = 0; i < 10; i++) dset1[i] = dset1_data + (i * 20); - dset2_data = (double *)HDcalloc(30 * 20, sizeof(double)); - dset2 = (double **)HDcalloc(30, sizeof(dset2_data)); + dset2_data = (double *)calloc(30 * 20, sizeof(double)); + dset2 = (double **)calloc(30, sizeof(dset2_data)); for (i = 0; i < 30; i++) dset2[i] = dset2_data + (i * 20); @@ -512,10 +512,10 @@ gent_dataset(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dset1); - HDfree(dset1_data); - HDfree(dset2); - HDfree(dset2_data); + free(dset1); + free(dset1_data); + free(dset2); + free(dset2_data); } static void @@ -1808,8 +1808,8 @@ gent_str(void) hsize_t mdims[2]; /* Set up data array */ - comp1_data = (compound_t *)HDcalloc(3 * 6, sizeof(compound_t)); - comp1 = (compound_t **)HDcalloc(3, sizeof(comp1_data)); + comp1_data = (compound_t *)calloc(3 * 6, sizeof(compound_t)); + comp1 = (compound_t **)calloc(3, sizeof(comp1_data)); for (i = 0; i < 3; i++) comp1[i] = comp1_data + (i * 6); @@ -1909,8 +1909,8 @@ gent_str(void) H5Fclose(fid); - HDfree(comp1); - HDfree(comp1_data); + free(comp1); + free(comp1_data); } /* @@ -2126,9 +2126,9 @@ gent_objref(void) uint64_t supports_comments = 0; /* Allocate write & read buffers */ - wbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - rbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); - tbuf = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); + tbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * SPACE1_DIM1); /* Create file */ fid1 = H5Fcreate(FILE16, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2211,9 +2211,9 @@ gent_objref(void) H5Fclose(fid1); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(tbuf); + free(wbuf); + free(rbuf); + free(tbuf); } static void @@ -2240,10 +2240,10 @@ gent_datareg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE17, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2331,10 +2331,10 @@ gent_datareg(void) H5Fclose(fid1); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } static void @@ -2364,10 +2364,10 @@ gent_attrreg(void) int i; /* counting variables */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); - dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)malloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = (uint8_t *)malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = (uint8_t *)calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2); /* Create file */ fid1 = H5Fcreate(FILE64, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2464,10 +2464,10 @@ gent_attrreg(void) H5Fclose(fid1); /* Free memory buffers */ - HDfree(wbuf); - HDfree(rbuf); - HDfree(dwbuf); - HDfree(drbuf); + free(wbuf); + free(rbuf); + free(dwbuf); + free(drbuf); } /*taken from Elena's compound test file*/ @@ -2695,7 +2695,7 @@ gent_vldatatypes(void) for (i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + wdata[i].p = malloc((size_t)(i + 1) * sizeof(int)); wdata[i].len = (size_t)(i + 1); for (j = 0; j < i + 1; j++) @@ -2722,7 +2722,7 @@ gent_vldatatypes(void) for (i = 0; i < SPACE1_DIM1; i++) { int j; - wdata[i].p = HDmalloc((size_t)(i + 1) * sizeof(float)); + wdata[i].p = malloc((size_t)(i + 1) * sizeof(float)); wdata[i].len = (size_t)(i + 1); for (j = 0; j < i + 1; j++) @@ -2746,7 +2746,7 @@ gent_vldatatypes(void) assert(ret >= 0); /* Allocate and initialize a scalar VL dataset to write */ - adata.p = HDmalloc(37 * sizeof(int)); + adata.p = malloc(37 * sizeof(int)); adata.len = 37; for (i = 0; i < 37; i++) @@ -2786,14 +2786,14 @@ gent_vldatatypes2(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = (hvl_t *)HDmalloc((i + 1) * sizeof(hvl_t)); + wdata[i].p = (hvl_t *)malloc((i + 1) * sizeof(hvl_t)); if (wdata[i].p == NULL) { printf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + 1; for (t1 = (hvl_t *)wdata[i].p, j = 0; j < (i + 1); j++, t1++) { - t1->p = (unsigned *)HDmalloc((j + 1) * sizeof(unsigned)); + t1->p = (unsigned *)malloc((j + 1) * sizeof(unsigned)); if (t1->p == NULL) { printf("Cannot allocate memory for VL data! i=%u, j=%u\n", i, j); return; @@ -2861,7 +2861,7 @@ gent_vldatatypes3(void) for (i = 0; i < SPACE1_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)((float)(i * 20) / 3.0F); - wdata[i].v.p = HDmalloc((size_t)(i + 1) * sizeof(unsigned int)); + wdata[i].v.p = malloc((size_t)(i + 1) * sizeof(unsigned int)); wdata[i].v.len = (size_t)(i + 1); for (j = 0; j < (i + 1); j++) ((unsigned int *)wdata[i].v.p)[j] = i * 10 + j; @@ -2929,7 +2929,7 @@ gent_vldatatypes4(void) /* Allocate and initialize VL data to write */ for (i = 0; i < SPACE1_DIM1; i++) { - wdata[i].p = HDmalloc((i + 1) * sizeof(s1)); + wdata[i].p = malloc((i + 1) * sizeof(s1)); wdata[i].len = i + 1; for (j = 0; j < (i + 1); j++) { ((s1 *)wdata[i].p)[j].i = (int)(i * 10 + j); @@ -3000,7 +3000,7 @@ gent_vldatatypes5(void) } /* end if */ else { wdata[i].len = (size_t)(i + 5); - wdata[i].p = HDmalloc(sizeof(unsigned) * (size_t)(i + 5)); + wdata[i].p = malloc(sizeof(unsigned) * (size_t)(i + 5)); for (j = 0; j < i + 5; j++) ((unsigned *)wdata[i].p)[j] = (unsigned)(j * 2); } /* end else */ @@ -3079,8 +3079,8 @@ gent_array1_big(void) block[0] = 1; /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - wdata = (int *)HDmalloc(sizeof(int) * (size_t)(SPACE_ARRAY1BIG_DIM * ARRAY1BIG_DIM)); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); + wdata = (int *)malloc(sizeof(int) * (size_t)(SPACE_ARRAY1BIG_DIM * ARRAY1BIG_DIM)); /* Allocate and initialize array data to write */ for (i = 0; i < SPACE_ARRAY1BIG_DIM; i++) @@ -3137,8 +3137,8 @@ gent_array1_big(void) assert(ret >= 0); /* Release memory */ - HDfree(wbuf); - HDfree(wdata); + free(wbuf); + free(wdata); } static void @@ -3447,7 +3447,7 @@ gent_array6(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * sizeof(unsigned int)); + wdata[i][j].p = malloc((size_t)(i + j + 1) * sizeof(unsigned int)); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) ((unsigned int *)wdata[i][j].p)[k] = (unsigned)(i * 100 + j * 10 + k); @@ -3509,7 +3509,7 @@ gent_array7(void) /* Initialize array data to write */ for (i = 0; i < SPACE1_DIM1; i++) for (j = 0; j < ARRAY1_DIM1; j++) { - wdata[i][j].p = HDmalloc((size_t)(i + j + 1) * (sizeof(unsigned int) * ARRAY1_DIM1)); + wdata[i][j].p = malloc((size_t)(i + j + 1) * (sizeof(unsigned int) * ARRAY1_DIM1)); wdata[i][j].len = (size_t)(i + j + 1); for (k = 0; k < (i + j + 1); k++) for (l = 0; l < ARRAY1_DIM1; l++) @@ -3577,7 +3577,7 @@ gent_array8(void) unsigned int i; /* Allocate data buffer */ - wdata = (int *)HDmalloc(F64_DIM1 * sizeof(int)); + wdata = (int *)malloc(F64_DIM1 * sizeof(int)); assert(wdata); /* @@ -3624,7 +3624,7 @@ gent_array8(void) assert(status >= 0); status = H5Fclose(file); assert(status >= 0); - HDfree(wdata); + free(wdata); } static void @@ -3869,8 +3869,8 @@ gent_multi(void) char *sv_data = NULL; haddr_t memb_addr[H5FD_MEM_NTYPES]; - sv_data = (char *)HDcalloc(H5FD_MEM_NTYPES * 1024, sizeof(char)); - sv = (char **)HDcalloc(H5FD_MEM_NTYPES, sizeof(sv_data)); + sv_data = (char *)calloc(H5FD_MEM_NTYPES * 1024, sizeof(char)); + sv = (char **)calloc(H5FD_MEM_NTYPES, sizeof(sv_data)); for (i = 0; i < H5FD_MEM_NTYPES; i++) sv[i] = sv_data + (i * 1024); @@ -3914,8 +3914,8 @@ gent_multi(void) H5Fclose(fid); H5Pclose(fapl); - HDfree(sv); - HDfree(sv_data); + free(sv); + free(sv_data); } static void @@ -4157,10 +4157,10 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -4266,7 +4266,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { int l; - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; @@ -4396,7 +4396,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((size_t)(i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; @@ -4586,10 +4586,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -4695,7 +4695,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { int l; - buf52[i][j].p = HDmalloc((size_t)(i + 1) * sizeof(int)); + buf52[i][j].p = malloc((size_t)(i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf52[i][j].p)[l] = n++; @@ -4832,7 +4832,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { int l; - buf53[i][j][k].p = HDmalloc(((size_t)i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc(((size_t)i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) ((int *)buf53[i][j][k].p)[l] = n++; @@ -6022,10 +6022,10 @@ gent_fvalues(void) *------------------------------------------------------------------------- */ buf3[0].len = 1; - buf3[0].p = HDmalloc(1 * sizeof(int)); + buf3[0].p = malloc(1 * sizeof(int)); ((int *)buf3[0].p)[0] = 1; buf3[1].len = 2; - buf3[1].p = HDmalloc(2 * sizeof(int)); + buf3[1].p = malloc(2 * sizeof(int)); ((int *)buf3[1].p)[0] = 2; ((int *)buf3[1].p)[1] = 3; @@ -6276,7 +6276,7 @@ gent_longlinks(void) assert(gid >= 0); /* Construct very long file name */ - objname = (char *)HDmalloc((size_t)(F51_MAX_NAME_LEN + 1)); + objname = (char *)malloc((size_t)(F51_MAX_NAME_LEN + 1)); assert(objname); for (u = 0; u < F51_MAX_NAME_LEN; u++) objname[u] = 'a'; @@ -6299,7 +6299,7 @@ gent_longlinks(void) assert(H5Fclose(fid) >= 0); /* Release memory */ - HDfree(objname); + free(objname); } /*------------------------------------------------------------------------- @@ -6520,7 +6520,7 @@ gent_bigdims(void) if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0) goto out; - buf = (char *)HDmalloc((unsigned)(nelmts * size)); + buf = (char *)malloc((unsigned)(nelmts * size)); for (i = 0, c = 0; i < nelmts; i++, c++) { buf[i] = c; @@ -6531,7 +6531,7 @@ gent_bigdims(void) if (H5Dwrite(did, H5T_NATIVE_SCHAR, m_sid, f_sid, H5P_DEFAULT, buf) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; /* close */ @@ -6586,7 +6586,7 @@ gent_hyperslab(void) int i; int H5_ATTR_NDEBUG_UNUSED ret; - buf = (double *)HDmalloc(32 * 4097 * sizeof(double)); + buf = (double *)malloc(32 * 4097 * sizeof(double)); for (i = 0; i < 32 * 4097; i++) buf[i] = 1; @@ -6599,7 +6599,7 @@ gent_hyperslab(void) ret = H5Fclose(fid); assert(ret >= 0); - HDfree(buf); + free(buf); } /*------------------------------------------------------------------------- @@ -7479,15 +7479,15 @@ gent_packedbits(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -7733,15 +7733,15 @@ gent_attr_intsize(void) H5Gclose(root); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } static void @@ -7925,7 +7925,7 @@ gent_compound_intsizes(void) int m, n, o; /* Array init loop vars */ /* Allocate buffer */ - Array1 = (Array1Struct *)HDmalloc(sizeof(Array1Struct) * F70_LENGTH); + Array1 = (Array1Struct *)malloc(sizeof(Array1Struct) * F70_LENGTH); assert(Array1); /* Initialize the data in the arrays/datastructure */ @@ -8159,7 +8159,7 @@ gent_compound_intsizes(void) status = H5Fclose(fid); assert(status >= 0); - HDfree(Array1); + free(Array1); } static void @@ -8208,7 +8208,7 @@ gent_compound_attr_intsizes(void) int m, n, o; /* Array init loop vars */ - Array1 = (Array1Struct *)HDcalloc(F70_LENGTH, sizeof(Array1Struct)); + Array1 = (Array1Struct *)calloc(F70_LENGTH, sizeof(Array1Struct)); /* Initialize the data in the arrays/datastructure */ for (m = 0; m < F70_LENGTH; m++) { @@ -8451,7 +8451,7 @@ gent_compound_attr_intsizes(void) status = H5Fclose(fid); assert(status >= 0); - HDfree(Array1); + free(Array1); } static void @@ -8854,15 +8854,15 @@ gent_intscalars(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -9118,15 +9118,15 @@ gent_attr_intscalars(void) H5Gclose(root); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -9229,7 +9229,7 @@ gent_compound_int_array(void) int m, n; /* Array init loop vars */ /* Allocate buffer */ - Cmpd1 = (Cmpd1Struct *)HDmalloc(sizeof(Cmpd1Struct) * F76_LENGTH); + Cmpd1 = (Cmpd1Struct *)malloc(sizeof(Cmpd1Struct) * F76_LENGTH); assert(Cmpd1); /* Initialize the data in the arrays/datastructure */ @@ -9437,7 +9437,7 @@ gent_compound_int_array(void) status = H5Fclose(fid); assert(status >= 0); - HDfree(Cmpd1); + free(Cmpd1); } static void @@ -9487,9 +9487,9 @@ gent_compound_ints(void) int m; /* Array init loop vars */ /* Allocate buffers */ - Cmpd1 = (Cmpd1Struct *)HDmalloc(sizeof(Cmpd1Struct) * F77_LENGTH); + Cmpd1 = (Cmpd1Struct *)malloc(sizeof(Cmpd1Struct) * F77_LENGTH); assert(Cmpd1); - Cmpd2 = (Cmpd2Struct *)HDmalloc(sizeof(Cmpd2Struct) * F77_LENGTH); + Cmpd2 = (Cmpd2Struct *)malloc(sizeof(Cmpd2Struct) * F77_LENGTH); assert(Cmpd2); /* Initialize the data in the arrays/datastructure */ @@ -9669,8 +9669,8 @@ gent_compound_ints(void) status = H5Fclose(fid); assert(status >= 0); - HDfree(Cmpd1); - HDfree(Cmpd2); + free(Cmpd1); + free(Cmpd2); } /*------------------------------------------------------------------------- @@ -9958,15 +9958,15 @@ gent_intattrscalars(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); } /*------------------------------------------------------------------------- @@ -10049,15 +10049,15 @@ gent_intsattrs(void) dset64 = malloc(sizeof(*dset64)); dsetdbl = malloc(sizeof(*dsetdbl)); - asetu8 = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(uint8_t)); - asetu16 = HDcalloc(F66_XDIM * F66_YDIM16, sizeof(uint16_t)); - asetu32 = HDcalloc(F66_XDIM * F66_YDIM32, sizeof(uint32_t)); - asetu64 = HDcalloc(F66_XDIM * F66_YDIM64, sizeof(uint64_t)); - aset8 = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(int8_t)); - aset16 = HDcalloc(F66_XDIM * F66_YDIM16, sizeof(int16_t)); - aset32 = HDcalloc(F66_XDIM * F66_YDIM32, sizeof(int32_t)); - aset64 = HDcalloc(F66_XDIM * F66_YDIM64, sizeof(int64_t)); - asetdbl = HDcalloc(F66_XDIM * F66_YDIM8, sizeof(double)); + asetu8 = calloc(F66_XDIM * F66_YDIM8, sizeof(uint8_t)); + asetu16 = calloc(F66_XDIM * F66_YDIM16, sizeof(uint16_t)); + asetu32 = calloc(F66_XDIM * F66_YDIM32, sizeof(uint32_t)); + asetu64 = calloc(F66_XDIM * F66_YDIM64, sizeof(uint64_t)); + aset8 = calloc(F66_XDIM * F66_YDIM8, sizeof(int8_t)); + aset16 = calloc(F66_XDIM * F66_YDIM16, sizeof(int16_t)); + aset32 = calloc(F66_XDIM * F66_YDIM32, sizeof(int32_t)); + aset64 = calloc(F66_XDIM * F66_YDIM64, sizeof(int64_t)); + asetdbl = calloc(F66_XDIM * F66_YDIM8, sizeof(double)); fid = H5Fcreate(FILE79, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -10309,25 +10309,25 @@ gent_intsattrs(void) H5Dclose(dataset); H5Fclose(fid); - HDfree(dsetu8); - HDfree(dsetu16); - HDfree(dsetu32); - HDfree(dsetu64); - HDfree(dset8); - HDfree(dset16); - HDfree(dset32); - HDfree(dset64); - HDfree(dsetdbl); - - HDfree(asetu8); - HDfree(asetu16); - HDfree(asetu32); - HDfree(asetu64); - HDfree(aset8); - HDfree(aset16); - HDfree(aset32); - HDfree(aset64); - HDfree(asetdbl); + free(dsetu8); + free(dsetu16); + free(dsetu32); + free(dsetu64); + free(dset8); + free(dset16); + free(dset32); + free(dset64); + free(dsetdbl); + + free(asetu8); + free(asetu16); + free(asetu32); + free(asetu64); + free(aset8); + free(aset16); + free(aset32); + free(aset64); + free(asetdbl); } /*------------------------------------------------------------------------- @@ -10374,9 +10374,9 @@ gent_floatsattrs(void) dset64 = malloc(sizeof(*dset64)); dset128 = malloc(sizeof(*dset128)); - aset32 = HDcalloc(F89_XDIM * F89_YDIM32, sizeof(float)); - aset64 = HDcalloc(F89_XDIM * F89_YDIM64, sizeof(double)); - aset128 = HDcalloc(F89_XDIM * F89_YDIM128, sizeof(long double)); + aset32 = calloc(F89_XDIM * F89_YDIM32, sizeof(float)); + aset64 = calloc(F89_XDIM * F89_YDIM64, sizeof(double)); + aset128 = calloc(F89_XDIM * F89_YDIM128, sizeof(long double)); fid = H5Fcreate(FILE89, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -10473,13 +10473,13 @@ gent_floatsattrs(void) error: H5Fclose(fid); - HDfree(dset32); - HDfree(dset64); - HDfree(dset128); + free(dset32); + free(dset64); + free(dset128); - HDfree(aset32); - HDfree(aset64); - HDfree(aset128); + free(aset32); + free(aset64); + free(aset128); } static void @@ -10754,7 +10754,7 @@ gent_compound_complex2(void) hsize_t nelmts = F82_DIM32; /* Allocate buffer */ - buf = (compound *)HDmalloc(sizeof(compound) * F82_DIM32); + buf = (compound *)malloc(sizeof(compound) * F82_DIM32); assert(buf); file = H5Fcreate(FILE82, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -11010,7 +11010,7 @@ gent_compound_complex2(void) */ H5Fclose(file); - HDfree(buf); + free(buf); } /*------------------------------------------------------------------------- @@ -11367,17 +11367,17 @@ onion_filepaths_init(const char *basename) { struct onion_filepaths *paths = NULL; - if (NULL == (paths = HDcalloc(1, sizeof(struct onion_filepaths)))) + if (NULL == (paths = calloc(1, sizeof(struct onion_filepaths)))) goto error; if (NULL == (paths->canon = HDstrdup(basename))) goto error; - if (NULL == (paths->onion = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->onion = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->onion, ONION_TEST_FIXNAME_SIZE, "%s.onion", paths->canon); - if (NULL == (paths->recovery = HDmalloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) + if (NULL == (paths->recovery = malloc(sizeof(char) * ONION_TEST_FIXNAME_SIZE))) goto error; HDsnprintf(paths->recovery, ONION_TEST_FIXNAME_SIZE, "%s.onion.recovery", paths->canon); @@ -11385,10 +11385,10 @@ onion_filepaths_init(const char *basename) error: if (paths != NULL) { - HDfree(paths->canon); - HDfree(paths->onion); - HDfree(paths->recovery); - HDfree(paths); + free(paths->canon); + free(paths->onion); + free(paths->recovery); + free(paths); } return NULL; } @@ -11397,10 +11397,10 @@ static void onion_filepaths_destroy(struct onion_filepaths *s) { if (s) { - HDfree(s->canon); - HDfree(s->onion); - HDfree(s->recovery); - HDfree(s); + free(s->canon); + free(s->onion); + free(s->recovery); + free(s); } } diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c index 3718964..9a3a891 100644 --- a/tools/test/h5format_convert/h5fc_gentest.c +++ b/tools/test/h5format_convert/h5fc_gentest.c @@ -423,7 +423,7 @@ gen_err_level(const char *fname) goto error; /* Initialize data buffer */ - buf = (unsigned char *)HDmalloc(NUM * sizeof(unsigned char *)); + buf = (unsigned char *)malloc(NUM * sizeof(unsigned char *)); HDmemset(buf, 42, NUM * sizeof(unsigned char)); /* Create the test file */ diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c index 192371d..5ac9c7f 100644 --- a/tools/test/h5jam/getub.c +++ b/tools/test/h5jam/getub.c @@ -120,7 +120,7 @@ main(int argc, char *argv[]) goto error; } /* end if */ - if (NULL == (buf = (char *)HDmalloc((unsigned)(size + 1)))) { + if (NULL == (buf = (char *)malloc((unsigned)(size + 1)))) { error_msg("can't allocate buffer \n"); goto error; } /* end if */ @@ -137,15 +137,15 @@ main(int argc, char *argv[]) } /* end if */ /* close things and exit */ - HDfree(filename); - HDfree(buf); + free(filename); + free(buf); HDclose(fd); return EXIT_SUCCESS; error: - HDfree(filename); - HDfree(buf); + free(filename); + free(buf); if (fd >= 0) HDclose(fd); return EXIT_FAILURE; diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index a9df43b..96e6407 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -369,7 +369,7 @@ create_textfile(const char *name, size_t size) if ((fd = HDcreat(name, 0777)) < 0) goto error; - if (NULL == (buf = (char *)HDcalloc(size, 1))) + if (NULL == (buf = (char *)calloc(size, 1))) goto error; /* Fill buf with pattern */ @@ -380,13 +380,13 @@ create_textfile(const char *name, size_t size) if (HDwrite(fd, buf, size) < 0) goto error; - HDfree(buf); + free(buf); HDclose(fd); return SUCCEED; error: - HDfree(buf); + free(buf); if (fd >= 0) HDclose(fd); diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index ca56c79..9364ea8 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -2505,7 +2505,7 @@ make_szip(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2517,7 +2517,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2590,7 +2590,7 @@ make_deflate(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2602,7 +2602,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2660,7 +2660,7 @@ make_shuffle(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2672,7 +2672,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2733,7 +2733,7 @@ make_fletcher32(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2745,7 +2745,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2838,7 +2838,7 @@ make_nbit(hid_t loc_id) if (H5Tclose(dtid) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2853,7 +2853,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -2940,7 +2940,7 @@ make_scaleoffset(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -2955,7 +2955,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -3124,7 +3124,7 @@ make_all_filters(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -3139,7 +3139,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -3321,7 +3321,7 @@ make_layout(hid_t loc_id) if (H5Pclose(dcpl) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -3333,7 +3333,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return -1; } @@ -3406,7 +3406,7 @@ error: } H5E_END_TRY - HDfree(s_buf); + free(s_buf); return (ret_value); @@ -3533,8 +3533,8 @@ make_layout3(hid_t loc_id) if (H5Pclose(dcpl3) < 0) goto error; - HDfree(buf1); - HDfree(buf2); + free(buf1); + free(buf2); return 0; @@ -3549,8 +3549,8 @@ error: } H5E_END_TRY - HDfree(buf1); - HDfree(buf2); + free(buf1); + free(buf2); return -1; } @@ -3656,14 +3656,14 @@ make_big(hid_t loc_id) goto out; /* initialize buffer to 0 */ - buf = (signed char *)HDcalloc(nelmts, size); + buf = (signed char *)calloc(nelmts, size); if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, hs_start, NULL, hs_size, NULL) < 0) goto out; if (H5Dwrite(did, H5T_NATIVE_SCHAR, m_sid, f_sid, H5P_DEFAULT, buf) < 0) goto out; - HDfree(buf); + free(buf); buf = NULL; /* close */ @@ -4118,10 +4118,10 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -4177,7 +4177,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* allocate and initialize array data to write */ size = (TEST_BUFSIZE / sizeof(double) + 1) * sizeof(double); - dbuf = (double *)HDmalloc(size); + dbuf = (double *)malloc(size); if (NULL == dbuf) { printf("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int)size / 1000000); @@ -4194,16 +4194,16 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* create a type larger than TEST_BUFSIZE */ if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0) { - HDfree(dbuf); + free(dbuf); goto out; } size = H5Tget_size(tid); if ((sid = H5Screate_simple(1, sdims, NULL)) < 0) { - HDfree(dbuf); + free(dbuf); goto out; } if ((did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - HDfree(dbuf); + free(dbuf); goto out; } #if defined(WRITE_ARRAY) @@ -4214,7 +4214,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da H5Dclose(did); H5Tclose(tid); H5Sclose(sid); - HDfree(dbuf); + free(dbuf); } /*------------------------------------------------------------------------- @@ -4347,7 +4347,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { unsigned l; - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -4558,7 +4558,7 @@ write_dset_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { unsigned l; - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) { if (make_diffs) @@ -4682,8 +4682,8 @@ make_dset_reg_ref(hid_t loc_id) int retval = -1; /* return value */ /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - dwbuf = (int *)HDmalloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2); + wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + dwbuf = (int *)malloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2); /* Create dataspace for datasets */ if ((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0) @@ -4744,9 +4744,9 @@ make_dset_reg_ref(hid_t loc_id) out: if (wbuf) - HDfree(wbuf); + free(wbuf); if (dwbuf) - HDfree(dwbuf); + free(dwbuf); H5E_BEGIN_TRY { @@ -5016,10 +5016,10 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; - buf5[0].p = HDmalloc(1 * sizeof(int)); + buf5[0].p = malloc(1 * sizeof(int)); ((int *)buf5[0].p)[0] = 1; buf5[1].len = 2; - buf5[1].p = HDmalloc(2 * sizeof(int)); + buf5[1].p = malloc(2 * sizeof(int)); ((int *)buf5[1].p)[0] = 2; ((int *)buf5[1].p)[1] = 3; @@ -5324,7 +5324,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (j = 0; j < 2; j++) { unsigned l; - buf52[i][j].p = HDmalloc((i + 1) * sizeof(int)); + buf52[i][j].p = malloc((i + 1) * sizeof(int)); buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs) @@ -5771,7 +5771,7 @@ write_attr_in(hid_t loc_id, const char *dset_name, /* for saving reference to da for (k = 0; k < 2; k++) { unsigned l; - buf53[i][j][k].p = HDmalloc((i + 1) * sizeof(int)); + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); buf53[i][j][k].len = (size_t)i + 1; for (l = 0; l < i + 1; l++) if (make_diffs) @@ -6966,11 +6966,11 @@ make_complex_attr_references(hid_t loc_id) * prepare vlen data */ vlen_objref_data[0].len = LEN0_VLEN_OBJREF; - vlen_objref_data[0].p = HDmalloc(vlen_objref_data[0].len * sizeof(hobj_ref_t)); + vlen_objref_data[0].p = malloc(vlen_objref_data[0].len * sizeof(hobj_ref_t)); vlen_objref_data[1].len = LEN1_VLEN_OBJREF; - vlen_objref_data[1].p = HDmalloc(vlen_objref_data[1].len * sizeof(hobj_ref_t)); + vlen_objref_data[1].p = malloc(vlen_objref_data[1].len * sizeof(hobj_ref_t)); vlen_objref_data[2].len = LEN2_VLEN_OBJREF; - vlen_objref_data[2].p = HDmalloc(vlen_objref_data[2].len * sizeof(hobj_ref_t)); + vlen_objref_data[2].p = malloc(vlen_objref_data[2].len * sizeof(hobj_ref_t)); /* * create obj references @@ -7034,7 +7034,7 @@ make_complex_attr_references(hid_t loc_id) * prepare vlen data */ vlen_regref_data[0].len = LEN0_VLEN_REGREF; - vlen_regref_data[0].p = HDmalloc(vlen_regref_data[0].len * sizeof(hdset_reg_ref_t)); + vlen_regref_data[0].p = malloc(vlen_regref_data[0].len * sizeof(hdset_reg_ref_t)); /* * create region reference diff --git a/tools/test/misc/clear_open_chk.c b/tools/test/misc/clear_open_chk.c index ac31375..b57eb4a 100644 --- a/tools/test/misc/clear_open_chk.c +++ b/tools/test/misc/clear_open_chk.c @@ -54,10 +54,10 @@ main(int argc, char *argv[]) /* Try opening the file */ if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { fprintf(stderr, "clear_open_chk: unable to open the file\n"); - HDfree(fname); + free(fname); HDexit(EXIT_FAILURE); } - HDfree(fname); + free(fname); /* Close the file */ if (H5Fclose(fid) < 0) { diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 31796c1..3636c98 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -124,7 +124,7 @@ gen_cache_image_file(const char *fname) if (H5Fclose(fid) < 0) goto error; - HDfree(buf); + free(buf); return 0; @@ -140,7 +140,7 @@ error: } H5E_END_TRY - HDfree(buf); + free(buf); return 1; } /* gen_cache_image_file() */ diff --git a/tools/test/misc/h5repart_gentest.c b/tools/test/misc/h5repart_gentest.c index 04ac8e7..1f26c4d 100644 --- a/tools/test/misc/h5repart_gentest.c +++ b/tools/test/misc/h5repart_gentest.c @@ -36,12 +36,12 @@ main(void) hsize_t dims[2] = {FAMILY_NUMBER, FAMILY_SIZE}; /* Set up data array */ - if (NULL == (buf_data = (int *)HDcalloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) { - HDperror("HDcalloc"); + if (NULL == (buf_data = (int *)calloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int)))) { + HDperror("calloc"); HDexit(EXIT_FAILURE); } - if (NULL == (buf = (int **)HDcalloc(FAMILY_NUMBER, sizeof(buf_data)))) { - HDperror("HDcalloc"); + if (NULL == (buf = (int **)calloc(FAMILY_NUMBER, sizeof(buf_data)))) { + HDperror("calloc"); HDexit(EXIT_FAILURE); } for (i = 0; i < FAMILY_NUMBER; i++) @@ -103,8 +103,8 @@ main(void) HDexit(EXIT_FAILURE); } - HDfree(buf); - HDfree(buf_data); + free(buf); + free(buf_data); HDputs(" PASSED"); HDfflush(stdout); diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index 72b98ed..c876d9f 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -122,7 +122,7 @@ main(void) H5Dclose(set); /* Now open the set, and read it back in */ - data = (char *)HDmalloc(H5Tget_size(fix)); + data = (char *)malloc(H5Tget_size(fix)); if (!data) { HDperror("malloc() failed"); @@ -186,7 +186,7 @@ out: } if (data) - HDfree(data); + free(data); H5Sclose(spc); H5Tclose(cs6); H5Tclose(cmp); diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index 33ea706..3d258ea 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -134,7 +134,7 @@ create_dset1(hid_t file) H5Dclose(dataset); H5Pclose(dcpl); H5Sclose(dataspace); - HDfree(data); + free(data); return 0; error: @@ -145,7 +145,7 @@ error: H5Sclose(dataspace); } H5E_END_TRY - HDfree(data); + free(data); return 1; } @@ -198,7 +198,7 @@ create_dset2(hid_t file) H5Dclose(dataset); H5Pclose(dcpl); H5Sclose(dataspace); - HDfree(data); + free(data); return 0; @@ -210,7 +210,7 @@ error: H5Sclose(dataspace); } H5E_END_TRY - HDfree(data); + free(data); return 1; } diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index d47420a..8d0daf0 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -159,7 +159,7 @@ main(void) assert(file_space >= 0); dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(dset >= 0); - the_data = (unsigned char *)HDmalloc((size_t)(size[0] * size[1])); + the_data = (unsigned char *)malloc((size_t)(size[0] * size[1])); /* initial fill for lazy malloc */ HDmemset(the_data, 0xAA, (size_t)(size[0] * size[1])); @@ -347,7 +347,7 @@ main(void) H5Sclose(file_space); H5Fclose(file); - HDfree(the_data); + free(the_data); return 0; } diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c index abd1649..c891bf9 100644 --- a/tools/test/perform/zip_perf.c +++ b/tools/test/perform/zip_perf.c @@ -104,7 +104,7 @@ cleanup(void) { if (!HDgetenv(HDF5_NOCLEANUP)) HDunlink(filename); - HDfree(filename); + free(filename); } static void @@ -117,7 +117,7 @@ write_file(Bytef *source, uLongf sourceLen) /* destination buffer needs to be at least 0.1% larger than sourceLen * plus 12 bytes */ destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1)) + 12; - dest = (Bytef *)HDmalloc(destLen); + dest = (Bytef *)malloc(destLen); if (!dest) error("out of memory"); @@ -151,7 +151,7 @@ write_file(Bytef *source, uLongf sourceLen) d_ptr += rc; } - HDfree(dest); + free(dest); } /* @@ -211,9 +211,9 @@ get_unique_name(void) if (prefix) /* 2 = 1 for '/' + 1 for null terminator */ - filename = (char *)HDmalloc(HDstrlen(prefix) + HDstrlen(ZIP_PERF_FILE) + 2); + filename = (char *)malloc(HDstrlen(prefix) + HDstrlen(ZIP_PERF_FILE) + 2); else - filename = (char *)HDmalloc(HDstrlen(ZIP_PERF_FILE) + 1); + filename = (char *)malloc(HDstrlen(ZIP_PERF_FILE) + 1); if (!filename) error("out of memory"); @@ -364,7 +364,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long unsigned long i, iters; iters = file_size / src_len; - src = (Bytef *)HDcalloc(1, sizeof(Bytef) * src_len); + src = (Bytef *)calloc(1, sizeof(Bytef) * src_len); if (!src) { cleanup(); @@ -452,7 +452,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, unsigned long fprintf(stdout, "\tCompression Time: %gs\n", compression_time); HDunlink(filename); - HDfree(src); + free(src); } } diff --git a/utils/mirror_vfd/mirror_remote.c b/utils/mirror_vfd/mirror_remote.c index 065f2c8..aaa7515 100644 --- a/utils/mirror_vfd/mirror_remote.c +++ b/utils/mirror_vfd/mirror_remote.c @@ -150,7 +150,7 @@ mirror_log_init(char *path, const char *prefix, unsigned int verbosity) { loginfo_t *info = NULL; - info = (loginfo_t *)HDmalloc(sizeof(loginfo_t)); + info = (loginfo_t *)malloc(sizeof(loginfo_t)); if (info != NULL) { info->magic = MIRROR_LOG_INFO_MAGIC; info->verbosity = verbosity; @@ -168,7 +168,7 @@ mirror_log_init(char *path, const char *prefix, unsigned int verbosity) fprintf(MIRROR_LOG_DEFAULT_STREAM, "WARN custom logging path could not be opened: %s\n", path); info->magic += 1; - HDfree(info); + free(info); } else { info->stream = f; @@ -201,7 +201,7 @@ mirror_log_term(loginfo_t *info) } } info->magic += 1; - HDfree(info); + free(info); return SUCCEED; } /* end mirror_log_term() */ diff --git a/utils/mirror_vfd/mirror_server.c b/utils/mirror_vfd/mirror_server.c index 83d6f20..5278e7c 100644 --- a/utils/mirror_vfd/mirror_server.c +++ b/utils/mirror_vfd/mirror_server.c @@ -291,7 +291,7 @@ init_server_run(int argc, char **argv) { struct server_run *run; - run = (struct server_run *)HDmalloc(sizeof(struct server_run)); + run = (struct server_run *)malloc(sizeof(struct server_run)); if (run == NULL) { mirror_log(NULL, V_ERR, "can't allocate server_run struct"); return NULL; @@ -324,7 +324,7 @@ init_server_run(int argc, char **argv) error: if (run != NULL) { - HDfree(run); + free(run); } return NULL; @@ -362,7 +362,7 @@ term_server_run(struct server_run *run) (run->magic)++; (run->opts.magic)++; - HDfree(run); + free(run); return 0; } /* end term_server_run() */ @@ -479,11 +479,11 @@ handle_requests(struct server_run *run) return 1; } - if (NULL == (mybuf = HDmalloc(H5FD_MIRROR_XMIT_OPEN_SIZE * sizeof(char)))) { + if (NULL == (mybuf = malloc(H5FD_MIRROR_XMIT_OPEN_SIZE * sizeof(char)))) { mirror_log(NULL, V_ERR, "out of memory"); goto error; } - if (NULL == (xopen = HDmalloc(sizeof(H5FD_mirror_xmit_open_t)))) { + if (NULL == (xopen = malloc(sizeof(H5FD_mirror_xmit_open_t)))) { mirror_log(NULL, V_ERR, "out of memory"); goto error; } @@ -591,8 +591,8 @@ done: HDclose(connfd); } - HDfree(mybuf); - HDfree(xopen); + free(mybuf); + free(xopen); return ret_value; @@ -600,8 +600,8 @@ error: if (connfd >= 0) { HDclose(connfd); } - HDfree(mybuf); - HDfree(xopen); + free(mybuf); + free(xopen); return -1; } /* end handle_requests() */ diff --git a/utils/mirror_vfd/mirror_writer.c b/utils/mirror_vfd/mirror_writer.c index 4dbda3b..644fc77 100644 --- a/utils/mirror_vfd/mirror_writer.c +++ b/utils/mirror_vfd/mirror_writer.c @@ -178,7 +178,7 @@ session_init(struct mirror_writer_opts *opts) goto error; } - session = (struct mirror_session *)HDmalloc(sizeof(struct mirror_session)); + session = (struct mirror_session *)malloc(sizeof(struct mirror_session)); if (session == NULL) { mirror_log(NULL, V_ERR, "can't allocate session structure"); goto error; @@ -204,7 +204,7 @@ session_init(struct mirror_writer_opts *opts) error: if (session) { - HDfree(session); + free(session); } return NULL; } /* end session_init() */ @@ -247,7 +247,7 @@ session_stop(struct mirror_session *session) /* Invalidate and release structure */ session->magic++; - HDfree(session); + free(session); return ret_value; } /* end session_stop() */ @@ -730,7 +730,7 @@ do_write(struct mirror_session *session, const unsigned char *xmit_buf) /* Allocate the buffer once -- re-use between loops. */ - buf = (char *)HDmalloc(sizeof(char) * H5FD_MIRROR_DATA_BUFFER_MAX); + buf = (char *)malloc(sizeof(char) * H5FD_MIRROR_DATA_BUFFER_MAX); if (NULL == buf) { mirror_log(session->loginfo, V_ERR, "can't allocate databuffer"); reply_error(session, "can't allocate buffer for receiving data"); @@ -782,7 +782,7 @@ do_write(struct mirror_session *session, const unsigned char *xmit_buf) } while (sum_bytes_written < xmit_write.size); /* end while ingesting */ - HDfree(buf); + free(buf); /* signal that we're done here and a-ok */ if (reply_ok(session) < 0) { @@ -906,7 +906,7 @@ process_instructions(struct mirror_session *session) buf_size = H5FD_MIRROR_XMIT_BUFFER_MAX * sizeof(char); - if (NULL == (xmit_buf = HDmalloc(buf_size))) { + if (NULL == (xmit_buf = malloc(buf_size))) { mirror_log(session->loginfo, V_ERR, "out of memory"); goto error; } @@ -975,11 +975,11 @@ process_instructions(struct mirror_session *session) done: comm.magic = 0; /* invalidate structure, on principle */ xmit_recd.magic = 0; /* invalidate structure, on principle */ - HDfree(xmit_buf); + free(xmit_buf); return 0; error: - HDfree(xmit_buf); + free(xmit_buf); return -1; } /* end process_instructions() */ diff --git a/utils/tools/h5dwalk/h5dwalk.c b/utils/tools/h5dwalk/h5dwalk.c index ba7374d..5f0cf79 100644 --- a/utils/tools/h5dwalk/h5dwalk.c +++ b/utils/tools/h5dwalk/h5dwalk.c @@ -1311,7 +1311,7 @@ process_input_file(char *inputname, int myrank, int size) index++; } linebuf[0] = 0; - HDfree(cmdline); + free(cmdline); } if (output_log_file) { @@ -1568,7 +1568,7 @@ main(int argc, char *argv[]) if (tool_selected && (args_byte_length > 0)) { pred_head = mfu_pred_new(); - args_buf = (char *)HDmalloc((size_t)(args_byte_length + pathlen_total)); + args_buf = (char *)malloc((size_t)(args_byte_length + pathlen_total)); } /* filter files to only include hdf5 files */ -- cgit v0.12