summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-04-25 17:16:18 (GMT)
committerGitHub <noreply@github.com>2022-04-25 17:16:18 (GMT)
commit2b323159a7e6be0cfa7bd996de945e2d44fc721d (patch)
tree20d4ff81fbff743f04503178c303d7189c1f08e5 /src
parentc8b87fa3200228b8689f77d325646d6f77502cfa (diff)
downloadhdf5-2b323159a7e6be0cfa7bd996de945e2d44fc721d.zip
hdf5-2b323159a7e6be0cfa7bd996de945e2d44fc721d.tar.gz
hdf5-2b323159a7e6be0cfa7bd996de945e2d44fc721d.tar.bz2
Warnings fixes (#1680)
Diffstat (limited to 'src')
-rw-r--r--src/H5Cmpio.c6
-rw-r--r--src/H5Dchunk.c7
-rw-r--r--src/H5Dcontig.c12
-rw-r--r--src/H5Dmpio.c10
-rw-r--r--src/H5FD.c6
-rw-r--r--src/H5FDmpio.c2
-rw-r--r--src/H5FDsec2.c10
-rw-r--r--src/H5Oint.c2
-rw-r--r--src/H5Pfapl.c2
-rw-r--r--src/H5Tref.c4
10 files changed, 33 insertions, 28 deletions
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index ba6ff56..a0cc6bb 100644
--- a/src/H5Cmpio.c
+++ b/src/H5Cmpio.c
@@ -898,7 +898,11 @@ H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial)
H5C_cache_entry_t *entry_ptr = NULL;
herr_t ret_value = SUCCEED;
+#if H5C_DO_SANITY_CHECKS
FUNC_ENTER_NOAPI_NOINIT
+#else
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
+#endif
entry_ptr = cache_ptr->coll_tail_ptr;
clear_cnt = (partial ? cache_ptr->coll_list_len / 2 : cache_ptr->coll_list_len);
@@ -919,7 +923,7 @@ H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial)
entry_ptr = prev_ptr;
} /* end while */
-#ifdef H5C_DO_SANITY_CHECKS
+#if H5C_DO_SANITY_CHECKS
done:
#endif /* H5C_DO_SANITY_CHECKS */
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 9167085..eac48a9 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -8124,8 +8124,8 @@ H5D__chunk_iter(const H5D_t *dset, H5D_chunk_iter_op_t op, void *op_data)
/* Compose chunked index info struct */
idx_info.f = dset->oloc.file;
idx_info.pline = &dset->shared->dcpl_cache.pline;
- idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
+ idx_info.layout = &layout->u.chunk;
+ idx_info.storage = &layout->storage.u.chunk;
/* If the dataset is not written, return without errors */
if (H5F_addr_defined(idx_info.storage->idx_addr)) {
@@ -8136,8 +8136,7 @@ H5D__chunk_iter(const H5D_t *dset, H5D_chunk_iter_op_t op, void *op_data)
ud.op_data = op_data;
/* Iterate over the allocated chunks calling the iterator callback */
- if ((ret_value =
- (dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_iter_cb, &ud)) < 0)
+ if ((ret_value = (layout->storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_iter_cb, &ud)) < 0)
HERROR(H5E_DATASET, H5E_CANTNEXT, "chunk iteration failed");
} /* end if H5F_addr_defined */
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index e02d91a..b03ad47 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -605,23 +605,25 @@ done:
static htri_t
H5D__contig_may_use_select_io(const H5D_io_info_t *io_info, H5D_io_op_type_t op_type)
{
- const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */
- htri_t ret_value = FAIL; /* Return value */
+ const H5D_t *dataset = NULL; /* Local pointer to dataset info */
+ htri_t ret_value = FAIL; /* Return value */
FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(io_info);
- HDassert(dataset);
+ HDassert(io_info->dset);
HDassert(op_type == H5D_IO_OP_READ || op_type == H5D_IO_OP_WRITE);
+ dataset = io_info->dset;
+
/* Don't use selection I/O if it's globally disabled, if there is a type
* conversion, or if it's not a contiguous dataset, or if the sieve buffer
* exists (write) or is dirty (read) */
if (!H5_use_selection_io_g || io_info->io_ops.single_read != H5D__select_read ||
io_info->layout_ops.readvv != H5D__contig_readvv ||
- (op_type == H5D_IO_OP_READ && io_info->dset->shared->cache.contig.sieve_dirty) ||
- (op_type == H5D_IO_OP_WRITE && io_info->dset->shared->cache.contig.sieve_buf))
+ (op_type == H5D_IO_OP_READ && dataset->shared->cache.contig.sieve_dirty) ||
+ (op_type == H5D_IO_OP_WRITE && dataset->shared->cache.contig.sieve_buf))
ret_value = FALSE;
else {
hbool_t page_buf_enabled;
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index cb6f5c3..a7908fe 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -3467,8 +3467,9 @@ done:
static herr_t
H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chunk_list,
size_t *num_chunks_assigned_map, hbool_t all_ranks_involved,
- const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm,
- int mpi_rank, int mpi_size)
+ const H5D_io_info_t * io_info,
+ const H5D_chunk_map_t H5_ATTR_NDEBUG_UNUSED *fm, int mpi_rank,
+ int mpi_size)
{
MPI_Datatype struct_type;
MPI_Datatype packed_type;
@@ -3797,7 +3798,8 @@ done:
static herr_t
H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk_list,
size_t *chunk_list_num_entries, H5D_io_info_t *io_info,
- const H5D_type_info_t *type_info, int mpi_rank, int mpi_size,
+ const H5D_type_info_t *type_info, int mpi_rank,
+ int H5_ATTR_NDEBUG_UNUSED mpi_size,
H5D_filtered_collective_io_info_t **chunk_hash_table,
unsigned char ***chunk_msg_bufs, int *chunk_msg_bufs_len)
{
@@ -4547,7 +4549,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch
H5D_filtered_collective_io_info_t *chunk_hash_table,
unsigned char **chunk_msg_bufs, int chunk_msg_bufs_len,
const H5D_io_info_t *io_info, const H5D_type_info_t *type_info,
- int mpi_rank, int mpi_size)
+ int H5_ATTR_NDEBUG_UNUSED mpi_rank, int mpi_size)
{
H5D_fill_buf_info_t fb_info;
H5D_chunk_info_t * chunk_info = NULL;
diff --git a/src/H5FD.c b/src/H5FD.c
index 3597050..4357aa4 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -2261,8 +2261,10 @@ H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle /*out*/)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver")
done:
- if (FAIL == ret_value)
- *file_handle = NULL;
+ if (FAIL == ret_value) {
+ if (file_handle)
+ *file_handle = NULL;
+ }
FUNC_LEAVE_API(ret_value)
} /* end H5FDget_vfd_handle() */
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index fe9a3c2..1be4779 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -1914,7 +1914,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[
if (!sub_types) {
HDassert(!sub_types_created);
- if (NULL == (sub_types = (int *)HDmalloc((size_t)count * sizeof(MPI_Datatype))))
+ if (NULL == (sub_types = HDmalloc((size_t)count * sizeof(MPI_Datatype))))
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sub types array")
if (NULL == (sub_types_created = (uint8_t *)HDcalloc((size_t)count, 1))) {
H5MM_free(sub_types);
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 01c1179..aabee0f 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -1075,17 +1075,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD__sec2_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void H5_ATTR_UNUSED *input,
- void H5_ATTR_UNUSED **output)
+H5FD__sec2_ctl(H5FD_t H5_ATTR_UNUSED *_file, uint64_t op_code, uint64_t flags,
+ const void H5_ATTR_UNUSED *input, void H5_ATTR_UNUSED **output)
{
- H5FD_sec2_t *file = (H5FD_sec2_t *)_file;
- herr_t ret_value = SUCCEED;
+ herr_t ret_value = SUCCEED;
FUNC_ENTER_PACKAGE
- /* Sanity checks */
- HDassert(file);
-
switch (op_code) {
/* Unknown op code */
default:
diff --git a/src/H5Oint.c b/src/H5Oint.c
index 93501a2..70661ad 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -3014,7 +3014,7 @@ H5O_get_proxy(const H5O_t *oh)
*-------------------------------------------------------------------------
*/
herr_t
-H5O__free(H5O_t *oh, hbool_t force)
+H5O__free(H5O_t *oh, hbool_t H5_ATTR_NDEBUG_UNUSED force)
{
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index a3ce2f7..d8221a3 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -1636,7 +1636,7 @@ H5Pget_driver_config_str(hid_t fapl_id, char *config_buf, size_t buf_size)
size_t config_str_len = HDstrlen(config_str);
if (config_buf) {
- HDstrncpy(config_buf, config_str, MIN(config_str_len + 1, buf_size));
+ HDstrncpy(config_buf, config_str, buf_size);
if (config_str_len >= buf_size)
config_buf[buf_size - 1] = '\0';
}
diff --git a/src/H5Tref.c b/src/H5Tref.c
index 967f48d..b6b26ce 100644
--- a/src/H5Tref.c
+++ b/src/H5Tref.c
@@ -638,8 +638,8 @@ done:
*/
static herr_t
H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size, H5R_type_t src_type,
- H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, size_t dst_size,
- void H5_ATTR_UNUSED *bg_buf)
+ H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf,
+ size_t H5_ATTR_NDEBUG_UNUSED dst_size, void H5_ATTR_UNUSED *bg_buf)
{
H5F_t * src_f = NULL;
hid_t file_id = H5I_INVALID_HID;