diff options
Diffstat (limited to 'test')
122 files changed, 3188 insertions, 3191 deletions
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; @@ -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() */ @@ -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 */ @@ -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() */ /**************************************************************** @@ -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 <progname>.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 <progname>.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"); @@ -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 @@ -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() */ @@ -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; |