summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-08-21 14:50:49 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-08-21 14:50:49 (GMT)
commit88342f8b3f8658bf82ce5d25d5597f237f23c544 (patch)
tree3a055b382bb110e77868815b79e51f69339c7519 /test
parent2fe7d17a766faab80edb4f0e094f2dc3f8210d01 (diff)
downloadhdf5-88342f8b3f8658bf82ce5d25d5597f237f23c544.zip
hdf5-88342f8b3f8658bf82ce5d25d5597f237f23c544.tar.gz
hdf5-88342f8b3f8658bf82ce5d25d5597f237f23c544.tar.bz2
Use the safe calloc() idiom, p = calloc(1, sizeof(*p)), and do
not gratuitously cast to p's type.
Diffstat (limited to 'test')
-rw-r--r--test/vfd_swmr_addrem_writer.c2
-rw-r--r--test/vfd_swmr_generator.c2
-rw-r--r--test/vfd_swmr_remove_reader.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/test/vfd_swmr_addrem_writer.c b/test/vfd_swmr_addrem_writer.c
index 51b2470..2b93926 100644
--- a/test/vfd_swmr_addrem_writer.c
+++ b/test/vfd_swmr_addrem_writer.c
@@ -107,7 +107,7 @@ open_skeleton(const char *filename, unsigned verbose)
goto error;
/* Allocate memory for the configuration structure */
- if((config = (H5F_vfd_swmr_config_t *)calloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL)
+ if((config = calloc(1, sizeof(*config))) == NULL)
goto error;
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
diff --git a/test/vfd_swmr_generator.c b/test/vfd_swmr_generator.c
index 13fc941..35a1ac5 100644
--- a/test/vfd_swmr_generator.c
+++ b/test/vfd_swmr_generator.c
@@ -144,7 +144,7 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t vfd_swmr_write,
return -1;
/* Allocate memory for the VFD SWMR configuration structure */
- if((config = (H5F_vfd_swmr_config_t *)HDcalloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL)
+ if((config = HDcalloc(1, sizeof(*config))) == NULL)
return -1;
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
diff --git a/test/vfd_swmr_remove_reader.c b/test/vfd_swmr_remove_reader.c
index c7689c0..f56fce3 100644
--- a/test/vfd_swmr_remove_reader.c
+++ b/test/vfd_swmr_remove_reader.c
@@ -309,7 +309,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds,
goto error;
/* Allocate memory for the configuration structure */
- if((config = (H5F_vfd_swmr_config_t *)HDcalloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL)
+ if((config = HDcalloc(1, sizeof(*config))) == NULL)
goto error;
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;