diff options
author | David Young <dyoung@hdfgroup.org> | 2019-12-13 16:24:02 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2019-12-13 16:24:02 (GMT) |
commit | 93175a115c1f4dac777643bdd0c6be04eb358473 (patch) | |
tree | 405f52f4fcc3f8ed38bb3e725f05a7cb45c056ea /test/vfd_swmr.c | |
parent | 5d163c8d781027fd5ab94fd0b420e243e038f463 (diff) | |
download | hdf5-93175a115c1f4dac777643bdd0c6be04eb358473.zip hdf5-93175a115c1f4dac777643bdd0c6be04eb358473.tar.gz hdf5-93175a115c1f4dac777643bdd0c6be04eb358473.tar.bz2 |
Remove the ugly casts on calloc() and malloc(). Change some malloc() to
calloc() so that all bytes are initialized to something.
Diffstat (limited to 'test/vfd_swmr.c')
-rw-r--r-- | test/vfd_swmr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c index 57c58ba..6b9e2dc 100644 --- a/test/vfd_swmr.c +++ b/test/vfd_swmr.c @@ -874,11 +874,12 @@ test_writer_md(void) /* Allocate num_entries for the data buffer */ num_entries = 10; - if((buf = (uint8_t *)HDmalloc((num_entries * FS_PAGE_SIZE * sizeof(uint8_t)))) == NULL) + if((buf = HDcalloc(num_entries, FS_PAGE_SIZE)) == NULL) FAIL_STACK_ERROR; /* Allocate memory for num_entries index */ - if(NULL == (index = (H5FD_vfd_swmr_idx_entry_t *)HDcalloc(num_entries, sizeof(H5FD_vfd_swmr_idx_entry_t)))) + index = HDcalloc(num_entries, sizeof(H5FD_vfd_swmr_idx_entry_t)); + if(NULL == index) FAIL_STACK_ERROR; /* (A) Construct index for updating the metadata file */ @@ -1489,13 +1490,12 @@ test_reader_md_concur(void) num_entries = 12; /* Allocate num_entries for the data buffer */ - if((buf = (uint8_t *)HDmalloc((num_entries * FS_PAGE_SIZE * - sizeof(uint8_t)))) == NULL) + if((buf = HDcalloc(num_entries, FS_PAGE_SIZE)) == NULL) FAIL_STACK_ERROR; /* Allocate memory for num_entries index */ - if(NULL == (index = (H5FD_vfd_swmr_idx_entry_t *) - HDcalloc(num_entries, sizeof(H5FD_vfd_swmr_idx_entry_t)))) + index = HDcalloc(num_entries, sizeof(H5FD_vfd_swmr_idx_entry_t)); + if(NULL == index) FAIL_STACK_ERROR; /* Construct index for updating the metadata file */ |