summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKimmy Mu <kmu@hdfgroup.org>2020-01-29 20:12:18 (GMT)
committerKimmy Mu <kmu@hdfgroup.org>2020-01-29 20:12:18 (GMT)
commit8c60f6264c46cd9155ce34e12e29e9b0272c0c67 (patch)
tree4ee7db9cfd3ff489825e82a23b6e010245fe4183 /src
parent91d29817413e00f1dcd006d13790df6ce7aeb5c0 (diff)
parent781fa57f6ee816e037dd12fff02d37ff7ec9c2b1 (diff)
downloadhdf5-8c60f6264c46cd9155ce34e12e29e9b0272c0c67.zip
hdf5-8c60f6264c46cd9155ce34e12e29e9b0272c0c67.tar.gz
hdf5-8c60f6264c46cd9155ce34e12e29e9b0272c0c67.tar.bz2
Merge pull request #2324 in HDFFV/hdf5 from ~KMU/hdf5:hdf5_1_12 to hdf5_1_12
* commit '781fa57f6ee816e037dd12fff02d37ff7ec9c2b1': pick up missing piece from merge Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop remove redundent definition Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop Merge pull request #2315 in HDFFV/hdf5 from ~KMU/hdf5:develop to develop missing prototype warning prototype issue Merge pull request #2306 in HDFFV/hdf5 from ~KMU/hdf5:develop to develop Merge pull request #2300 in HDFFV/hdf5 from ~KMU/hdf5:squashed_cast to develop Merge pull request #2291 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/uninitialized to develop Merge pull request #2295 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/float to develop Merge pull request #2292 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/prototype to develop Merge pull request #2094 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/unused to develop
Diffstat (limited to 'src')
-rw-r--r--src/H5ACmpio.c2
-rw-r--r--src/H5Aint.c2
-rw-r--r--src/H5B.c4
-rw-r--r--src/H5B2cache.c4
-rw-r--r--src/H5B2dbg.c6
-rw-r--r--src/H5B2internal.c4
-rw-r--r--src/H5B2leaf.c3
-rw-r--r--src/H5C.c10
-rw-r--r--src/H5CX.c4
-rw-r--r--src/H5Clog_json.c2
-rw-r--r--src/H5Cmpio.c37
-rw-r--r--src/H5Dbtree.c4
-rw-r--r--src/H5Dchunk.c33
-rw-r--r--src/H5Dfill.c5
-rw-r--r--src/H5Dint.c7
-rw-r--r--src/H5Dio.c22
-rw-r--r--src/H5Dmpio.c36
-rw-r--r--src/H5Dnone.c2
-rw-r--r--src/H5Dsingle.c2
-rw-r--r--src/H5EAcache.c4
-rw-r--r--src/H5EAtest.c2
-rw-r--r--src/H5FAcache.c6
-rw-r--r--src/H5FS.c3
-rw-r--r--src/H5FScache.c53
-rw-r--r--src/H5FSprivate.h2
-rw-r--r--src/H5Fint.c4
-rw-r--r--src/H5Fsuper_cache.c10
-rw-r--r--src/H5Gnode.c5
-rw-r--r--src/H5HFcache.c18
-rw-r--r--src/H5HFsection.c12
-rw-r--r--src/H5HFspace.c2
-rw-r--r--src/H5HGcache.c4
-rw-r--r--src/H5HLcache.c12
-rw-r--r--src/H5MF.c2
-rw-r--r--src/H5Oainfo.c6
-rw-r--r--src/H5Oalloc.c2
-rw-r--r--src/H5Ocache.c6
-rw-r--r--src/H5Omessage.c9
-rw-r--r--src/H5Oshared.c4
-rw-r--r--src/H5Oshared.h2
-rw-r--r--src/H5Pfapl.c8
-rw-r--r--src/H5Pint.c15
-rw-r--r--src/H5Plapl.c2
-rw-r--r--src/H5Pmapl.c3
-rw-r--r--src/H5Rint.c3
-rw-r--r--src/H5SL.c2
-rw-r--r--src/H5SMcache.c12
-rw-r--r--src/H5Smpio.c37
-rw-r--r--src/H5Tconv.c2
-rw-r--r--src/H5Tref.c8
-rw-r--r--src/H5Ztrans.c2
-rw-r--r--src/H5mpi.c8
-rw-r--r--src/H5overflow.txt1
-rw-r--r--src/H5private.h31
54 files changed, 250 insertions, 241 deletions
diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c
index e4b81fa..fadde28 100644
--- a/src/H5ACmpio.c
+++ b/src/H5ACmpio.c
@@ -498,7 +498,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t *aux_ptr,
+H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t H5_ATTR_NDEBUG_UNUSED *aux_ptr,
int sync_point_op)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Aint.c b/src/H5Aint.c
index 046af87..4690616 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -2061,7 +2061,7 @@ done:
*/
H5A_t *
H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size,
- H5O_copy_t *cpy_info)
+ H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info)
{
H5A_t *attr_dst = NULL; /* Destination attribute */
hid_t tid_src = -1; /* Datatype ID for source datatype */
diff --git a/src/H5B.c b/src/H5B.c
index 2a34fae..4c1abfd 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -2020,7 +2020,6 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr)
{
H5B_t *bt = NULL; /* The B-tree */
H5UC_t *rc_shared; /* Ref-counted shared info */
- H5B_shared_t *shared; /* Pointer to shared B-tree info */
H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */
htri_t ret_value = SUCCEED; /* Return value */
@@ -2038,8 +2037,7 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr)
/* Get shared info for B-tree */
if(NULL == (rc_shared = (type->get_shared)(f, NULL)))
HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object")
- shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared);
- HDassert(shared);
+ HDassert((H5B_shared_t *)H5UC_GET_OBJ(rc_shared));
/*
* Load the tree node.
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index 65286e6..80cb6c5 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -654,6 +654,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len,
uint32_t stored_chksum; /* Stored metadata checksum value */
unsigned u; /* Local index variable */
H5B2_internal_t *ret_value = NULL; /* Return value */
+ int node_nrec = 0;
FUNC_ENTER_STATIC
@@ -716,7 +717,8 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len,
for(u = 0; u < (unsigned)(internal->nrec + 1); u++) {
/* Decode node pointer */
H5F_addr_decode(udata->f, (const uint8_t **)&image, &(int_node_ptr->addr));
- UINT64DECODE_VAR(image, int_node_ptr->node_nrec, udata->hdr->max_nrec_size);
+ UINT64DECODE_VAR(image, node_nrec, udata->hdr->max_nrec_size);
+ H5_CHECKED_ASSIGN(int_node_ptr->node_nrec, uint16_t, node_nrec, int);
if(udata->depth > 1)
UINT64DECODE_VAR(image, int_node_ptr->all_nrec, udata->hdr->node_info[udata->depth - 1].cum_max_nrec_size)
else
diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c
index 0e3ebd5..b5b1c03 100644
--- a/src/H5B2dbg.c
+++ b/src/H5B2dbg.c
@@ -87,7 +87,7 @@
*/
herr_t
H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- const H5B2_class_t *type, haddr_t obj_addr)
+ const H5B2_class_t H5_ATTR_NDEBUG_UNUSED *type, haddr_t H5_ATTR_NDEBUG_UNUSED obj_addr)
{
H5B2_hdr_t *hdr = NULL; /* B-tree header info */
unsigned u; /* Local index variable */
@@ -182,7 +182,7 @@ done:
*/
herr_t
H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t obj_addr)
+ const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t H5_ATTR_NDEBUG_UNUSED obj_addr)
{
H5B2_hdr_t *hdr = NULL; /* B-tree header */
H5B2_internal_t *internal = NULL; /* B-tree internal node */
@@ -294,7 +294,7 @@ done:
*/
herr_t
H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth,
- const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr)
+ const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t H5_ATTR_NDEBUG_UNUSED obj_addr)
{
H5B2_hdr_t *hdr = NULL; /* B-tree header */
H5B2_leaf_t *leaf = NULL; /* B-tree leaf node */
diff --git a/src/H5B2internal.c b/src/H5B2internal.c
index 7f6b80a..92c802e 100644
--- a/src/H5B2internal.c
+++ b/src/H5B2internal.c
@@ -1355,7 +1355,7 @@ done:
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE herr_t
-H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal)
+H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_internal_t *internal)
{
hsize_t tot_all_nrec; /* Total number of records at or below this node */
uint16_t u, v; /* Local index variables */
@@ -1396,7 +1396,7 @@ H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE herr_t
-H5B2__assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal, const H5B2_internal_t *internal2)
+H5B2__assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_internal_t *internal, const H5B2_internal_t *internal2)
{
hsize_t tot_all_nrec; /* Total number of records at or below this node */
uint16_t u, v; /* Local index variables */
diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c
index beca40c..7ed0468 100644
--- a/src/H5B2leaf.c
+++ b/src/H5B2leaf.c
@@ -1027,7 +1027,8 @@ done:
*-------------------------------------------------------------------------
*/
H5_ATTR_PURE herr_t
-H5B2__assert_leaf(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf)
+H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr,
+ const H5B2_leaf_t H5_ATTR_NDEBUG_UNUSED *leaf)
{
/* General sanity checking on node */
HDassert(leaf->nrec <= hdr->node_info->split_nrec);
diff --git a/src/H5C.c b/src/H5C.c
index 3e0cf95..2a90bd1 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -1056,7 +1056,6 @@ H5C_flush_cache(H5F_t *f, unsigned flags)
H5C_ring_t ring;
H5C_t * cache_ptr;
hbool_t destroy;
- hbool_t ignore_protected;
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI(FAIL)
@@ -1101,9 +1100,8 @@ H5C_flush_cache(H5F_t *f, unsigned flags)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
- ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 );
destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 );
- HDassert( ! ( destroy && ignore_protected ) );
+ HDassert( ! ( destroy && ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 )) );
HDassert( ! ( cache_ptr->flush_in_progress ) );
cache_ptr->flush_in_progress = TRUE;
@@ -3856,7 +3854,11 @@ H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr,
{
herr_t ret_value = SUCCEED; /* Return value */
+#if H5C_DO_SANITY_CHECKS
FUNC_ENTER_STATIC
+#else
+ FUNC_ENTER_STATIC_NOERR
+#endif
/* Sanity checking */
HDassert(cache_ptr);
@@ -3873,7 +3875,9 @@ H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr,
/* Update the stats for an unpin operation */
H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr)
+#if H5C_DO_SANITY_CHECKS
done:
+#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C__unpin_entry_real() */
diff --git a/src/H5CX.c b/src/H5CX.c
index 649bd8f..160aa84 100644
--- a/src/H5CX.c
+++ b/src/H5CX.c
@@ -105,7 +105,7 @@
} /* end if */
#endif /* H5_HAVE_PARALLEL */
-#ifdef H5_HAVE_PARALLEL
+#if defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_INSTRUMENTED_LIBRARY)
/* Macro for the duplicated code to test and set properties for a property list */
#define H5CX_TEST_SET_PROP(PROP_NAME, PROP_FIELD) \
{ \
@@ -127,7 +127,9 @@
(*head)->ctx.H5_GLUE(PROP_FIELD,_set) = TRUE; \
} /* end if */ \
}
+#endif /* defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_INSTRUMENTED_LIBRARY) */
+#ifdef H5_HAVE_PARALLEL
/* Macro for the duplicated code to test and set properties for a property list */
#define H5CX_SET_PROP(PROP_NAME, PROP_FIELD) \
if((*head)->ctx.H5_GLUE(PROP_FIELD,_set)) { \
diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c
index dd9e9b2..5ac354d 100644
--- a/src/H5Clog_json.c
+++ b/src/H5Clog_json.c
@@ -1281,7 +1281,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5C__json_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t *config,
+H5C__json_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t H5_ATTR_NDEBUG_UNUSED *config,
herr_t fxn_ret_value)
{
H5C_log_json_udata_t *json_udata = (H5C_log_json_udata_t *)(udata);
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index e784487..2c176e4 100644
--- a/src/H5Cmpio.c
+++ b/src/H5Cmpio.c
@@ -174,13 +174,13 @@ H5C_apply_candidate_list(H5F_t * f,
int mpi_size)
{
int i;
- int m;
- int n;
- unsigned first_entry_to_flush;
- unsigned last_entry_to_flush;
- unsigned total_entries_to_clear = 0;
- unsigned total_entries_to_flush = 0;
- int * candidate_assignment_table = NULL;
+ int m;
+ unsigned n;
+ unsigned first_entry_to_flush;
+ unsigned last_entry_to_flush;
+ unsigned total_entries_to_clear = 0;
+ unsigned total_entries_to_flush = 0;
+ unsigned * candidate_assignment_table = NULL;
unsigned entries_to_flush[H5C_RING_NTYPES];
unsigned entries_to_clear[H5C_RING_NTYPES];
haddr_t addr;
@@ -231,17 +231,18 @@ H5C_apply_candidate_list(H5F_t * f,
HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create skip list for entries")
} /* end if */
- n = num_candidates / mpi_size;
- m = num_candidates % mpi_size;
- HDassert(n >= 0);
- if(NULL == (candidate_assignment_table = (int *)H5MM_malloc(sizeof(int) * (size_t)(mpi_size + 1))))
+ n = num_candidates / (unsigned)mpi_size;
+ if(num_candidates % (unsigned)mpi_size > INT_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "m overflow")
+ m = (int)(num_candidates % (unsigned)mpi_size);
+
+ if(NULL == (candidate_assignment_table = (unsigned *)H5MM_malloc(sizeof(unsigned) * (size_t)(mpi_size + 1))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for candidate assignment table")
candidate_assignment_table[0] = 0;
candidate_assignment_table[mpi_size] = num_candidates;
if(m == 0) { /* mpi_size is an even divisor of num_candidates */
- HDassert(n > 0);
for(i = 1; i < mpi_size; i++)
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n;
} /* end if */
@@ -249,7 +250,7 @@ H5C_apply_candidate_list(H5F_t * f,
for(i = 1; i <= m; i++)
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1;
- if(num_candidates < mpi_size) {
+ if(num_candidates < (unsigned)mpi_size) {
for(i = m + 1; i < mpi_size; i++)
candidate_assignment_table[i] = num_candidates;
} /* end if */
@@ -263,7 +264,7 @@ H5C_apply_candidate_list(H5F_t * f,
#if H5C_DO_SANITY_CHECKS
/* Verify that the candidate assignment table has the expected form */
for(i = 1; i < mpi_size - 1; i++) {
- int a, b;
+ unsigned a, b;
a = candidate_assignment_table[i] - candidate_assignment_table[i - 1];
b = candidate_assignment_table[i + 1] - candidate_assignment_table[i];
@@ -282,7 +283,7 @@ H5C_apply_candidate_list(H5F_t * f,
tbl_buf[i] = '\0';
HDsprintf(&(tbl_buf[0]), "candidate assignment table = ");
for(i = 0; i <= mpi_size; i++)
- HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %d", candidate_assignment_table[i]);
+ HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %u", candidate_assignment_table[i]);
HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
HDfprintf(stdout, "%s", tbl_buf);
@@ -359,11 +360,11 @@ H5C_apply_candidate_list(H5F_t * f,
n = 0;
for(i = 0; i < H5C_RING_NTYPES; i++) {
m += (int)entries_to_flush[i];
- n += (int)entries_to_clear[i];
+ n += entries_to_clear[i];
} /* end if */
HDassert((unsigned)m == total_entries_to_flush);
- HDassert((unsigned)n == total_entries_to_clear);
+ HDassert(n == total_entries_to_clear);
#endif /* H5C_DO_SANITY_CHECKS */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
@@ -397,7 +398,7 @@ H5C_apply_candidate_list(H5F_t * f,
done:
if(candidate_assignment_table != NULL)
- candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table);
+ candidate_assignment_table = (unsigned *)H5MM_xfree((void *)candidate_assignment_table);
if(cache_ptr->coll_write_list) {
if(H5SL_close(cache_ptr->coll_write_list) < 0)
HDONE_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "failed to destroy skip list")
diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c
index c13c36a..098e01b 100644
--- a/src/H5Dbtree.c
+++ b/src/H5Dbtree.c
@@ -253,7 +253,7 @@ H5D__btree_get_shared(const H5F_t H5_ATTR_UNUSED *f, const void *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__btree_new_node(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_udata,
+H5D__btree_new_node(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5B_ins_t op, void *_lt_key, void *_udata,
void *_rt_key, haddr_t *addr_p/*out*/)
{
H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key;
@@ -536,7 +536,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5B_ins_t
-H5D__btree_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed,
+H5D__btree_insert(H5F_t H5_ATTR_NDEBUG_UNUSED *f, haddr_t H5_ATTR_NDEBUG_UNUSED addr, void *_lt_key, hbool_t *lt_key_changed,
void *_md_key, void *_udata, void *_rt_key, hbool_t H5_ATTR_UNUSED *rt_key_changed,
haddr_t *new_node_p/*out*/)
{
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 2e4a3f6..8d1ba80 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -1683,7 +1683,7 @@ H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t
/* Iterate through each chunk in the dataset */
while(sel_points) {
H5D_chunk_info_t *new_chunk_info; /* chunk information to insert into skip list */
- hssize_t schunk_points; /* Number of elements in chunk selection */
+ hsize_t chunk_points; /* Number of elements in chunk selection */
/* Add temporary chunk to the list of chunks */
@@ -1727,12 +1727,11 @@ H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t
} /* end if */
/* Get number of elements selected in chunk */
- if((schunk_points = H5S_GET_SELECT_NPOINTS(new_chunk_info->fspace)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection # of elements")
- H5_CHECKED_ASSIGN(new_chunk_info->chunk_points, uint32_t, schunk_points, hssize_t);
+ chunk_points = H5S_GET_SELECT_NPOINTS(new_chunk_info->fspace);
+ H5_CHECKED_ASSIGN(new_chunk_info->chunk_points, uint32_t, chunk_points, hsize_t);
/* Decrement # of points left in file selection */
- sel_points -= (hsize_t)schunk_points;
+ sel_points -= chunk_points;
/* Advance to next chunk if we are not done */
if(sel_points > 0) {
@@ -1870,7 +1869,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
/* (Casting away const OK - QAK) */
if(TRUE == H5S_SELECT_INTERSECT_BLOCK(fm->file_space, coords, end)) {
H5D_chunk_info_t *new_chunk_info; /* chunk information to insert into skip list */
- hssize_t schunk_points; /* Number of elements in chunk selection */
+ hsize_t chunk_points; /* Number of elements in chunk selection */
/* Create dataspace for chunk, 'AND'ing the overall selection with
* the current chunk.
@@ -1923,12 +1922,11 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
} /* end if */
/* Get number of elements selected in chunk */
- if((schunk_points = H5S_GET_SELECT_NPOINTS(new_chunk_info->fspace)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection # of elements")
- H5_CHECKED_ASSIGN(new_chunk_info->chunk_points, uint32_t, schunk_points, hssize_t);
+ chunk_points = H5S_GET_SELECT_NPOINTS(new_chunk_info->fspace);
+ H5_CHECKED_ASSIGN(new_chunk_info->chunk_points, uint32_t, chunk_points, hsize_t);
/* Decrement # of points left in file selection */
- sel_points -= (hsize_t)schunk_points;
+ sel_points -= chunk_points;
/* Leave if we are done */
if(sel_points == 0)
@@ -2131,7 +2129,7 @@ H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm)
{
H5D_chunk_info_t *chunk_info; /* Pointer to chunk information */
H5SL_node_t *curr_node; /* Current node in skip list */
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -4983,12 +4981,12 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
/* Distribute evenly the number of blocks between processes. */
if(mpi_size == 0)
HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Resulted in division by zero")
- num_blocks = chunk_info->num_io / mpi_size; /* value should be the same on all procs */
+ num_blocks = (size_t)(chunk_info->num_io / (size_t)mpi_size); /* value should be the same on all procs */
/* after evenly distributing the blocks between processes, are
there any leftover blocks for each individual process
(round-robin) */
- leftover_blocks = chunk_info->num_io % mpi_size;
+ leftover_blocks = (size_t)(chunk_info->num_io % (size_t)mpi_size);
/* Cast values to types needed by MPI */
H5_CHECKED_ASSIGN(blocks, int, num_blocks, size_t);
@@ -4997,9 +4995,9 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
/* Allocate buffers */
/* (MSC - should not need block_lens if MPI_type_create_hindexed_block is working) */
- if(NULL == (block_lens = (int *)H5MM_malloc((blocks + 1) * sizeof(int))))
+ if(NULL == (block_lens = (int *)H5MM_malloc((size_t)(blocks + 1) * sizeof(int))))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk lengths buffer")
- if(NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((blocks + 1) * sizeof(MPI_Aint))))
+ if(NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((size_t)(blocks + 1) * sizeof(MPI_Aint))))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk file displacement buffer")
for(i = 0 ; i < blocks ; i++) {
@@ -5104,7 +5102,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk)
const hsize_t *scaled = udata->common.scaled; /* Scaled chunk offset */
H5S_sel_iter_t *chunk_iter = NULL; /* Memory selection iteration info */
hbool_t chunk_iter_init = FALSE; /* Whether the chunk iterator has been initialized */
- hssize_t sel_nelmts; /* Number of elements in selection */
+ hsize_t sel_nelmts; /* Number of elements in selection */
hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */
size_t chunk_size; /*size of a chunk */
void *chunk; /* The file chunk */
@@ -5165,8 +5163,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk)
/* Get the number of elements in the selection */
sel_nelmts = H5S_GET_SELECT_NPOINTS(udata->chunk_space);
- HDassert(sel_nelmts >= 0);
- H5_CHECK_OVERFLOW(sel_nelmts, hssize_t, size_t);
+ H5_CHECK_OVERFLOW(sel_nelmts, hsize_t, size_t);
/* Check for VL datatype & non-default fill value */
if(udata->fb_info.has_vlen_fill_type)
diff --git a/src/H5Dfill.c b/src/H5Dfill.c
index 3ccee90..f5a5238 100644
--- a/src/H5Dfill.c
+++ b/src/H5Dfill.c
@@ -249,12 +249,11 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf,
* of the VL data.
*/
if(TRUE == H5T_detect_class(fill_type, H5T_VLEN, FALSE)) {
- hssize_t nelmts; /* Number of data elements */
+ hsize_t nelmts; /* Number of data elements */
/* Get the number of elements in the selection */
nelmts = H5S_GET_SELECT_NPOINTS(space);
- HDassert(nelmts >= 0);
- H5_CHECK_OVERFLOW(nelmts, hssize_t, size_t);
+ H5_CHECK_OVERFLOW(nelmts, hsize_t, size_t);
/* Allocate a temporary buffer */
if(NULL == (tmp_buf = H5FL_BLK_MALLOC(type_conv, (size_t)nelmts * buf_size)))
diff --git a/src/H5Dint.c b/src/H5Dint.c
index c3e0c0d..436a507 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -89,7 +89,7 @@ static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overw
hsize_t old_dim[]);
static herr_t H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id);
static herr_t H5D__close_cb(H5VL_object_t *dset_vol_obj);
-static herr_t H5D__use_minimized_dset_headers(H5F_t *file, H5D_t *dset, hbool_t *minimize);
+static herr_t H5D__use_minimized_dset_headers(H5F_t *file, hbool_t *minimize);
static herr_t H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc);
static size_t H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr);
static void *H5D__vlen_get_buf_size_alloc(size_t size, void *info);
@@ -737,14 +737,13 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__use_minimized_dset_headers(H5F_t *file, H5D_t *dset, hbool_t *minimize)
+H5D__use_minimized_dset_headers(H5F_t *file, hbool_t *minimize)
{
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT;
HDassert(file);
- HDassert(dset);
HDassert(minimize);
/* Get the dataset object header minimize flag for this call */
@@ -1015,7 +1014,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set fill value info")
} /* end if */
- if(H5D__use_minimized_dset_headers(file, dset, &minimize_header) == FAIL)
+ if(H5D__use_minimized_dset_headers(file, &minimize_header) == FAIL)
HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get minimize settings")
if(TRUE == minimize_header) {
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 6b02b68..0f4e703 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -409,9 +409,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* Note that if this variable is used, the */
/* projected mem space must be discarded at the */
/* end of the function to avoid a memory leak. */
- H5D_storage_t store; /*union of EFL and chunk pointer in file space */
- hssize_t snelmts; /*total number of elmts (signed) */
- hsize_t nelmts; /*total number of elmts */
+ H5D_storage_t store; /* union of EFL and chunk pointer in file space */
+ hsize_t nelmts; /* total number of elmts */
hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */
char fake_char; /* Temporary variable for NULL buffer pointers */
herr_t ret_value = SUCCEED; /* Return value */
@@ -425,9 +424,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
file_space = dataset->shared->space;
if(!mem_space)
mem_space = file_space;
- if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection")
- H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t);
+ nelmts = H5S_GET_SELECT_NPOINTS(mem_space);
/* Set up datatype info for operation */
if(H5D__typeinfo_init(dataset, mem_type_id, FALSE, &type_info) < 0)
@@ -450,7 +447,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
#endif /*H5_HAVE_PARALLEL*/
/* Make certain that the number of elements in each selection is the same */
- if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space))
+ if(nelmts != H5S_GET_SELECT_NPOINTS(file_space))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest dataspaces have different number of elements selected")
/* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */
@@ -623,9 +620,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* Note that if this variable is used, the */
/* projected mem space must be discarded at the */
/* end of the function to avoid a memory leak. */
- H5D_storage_t store; /*union of EFL and chunk pointer in file space */
- hssize_t snelmts; /*total number of elmts (signed) */
- hsize_t nelmts; /*total number of elmts */
+ H5D_storage_t store; /* union of EFL and chunk pointer in file space */
+ hsize_t nelmts; /* total number of elmts */
hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */
char fake_char; /* Temporary variable for NULL buffer pointers */
herr_t ret_value = SUCCEED; /* Return value */
@@ -680,12 +676,10 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
if(!mem_space)
mem_space = file_space;
- if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection")
- H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t);
+ nelmts = H5S_GET_SELECT_NPOINTS(mem_space);
/* Make certain that the number of elements in each selection is the same */
- if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space))
+ if(nelmts != H5S_GET_SELECT_NPOINTS(file_space))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest dataspaces have different number of elements selected")
/* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 0dbbe9f..91557c3 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -2524,7 +2524,9 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm,
} /* end if */
/* Broadcasting the MPI_IO option info. and chunk address info. */
- if(MPI_SUCCESS != (mpi_code = MPI_Bcast(mergebuf, ((sizeof(haddr_t) + 1) * total_chunks), MPI_BYTE, root, comm)))
+ if((sizeof(haddr_t) + 1) * total_chunks > INT_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "result overflow")
+ if(MPI_SUCCESS != (mpi_code = MPI_Bcast(mergebuf, (int)((sizeof(haddr_t) + 1) * total_chunks), MPI_BYTE, root, comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_BCast failed", mpi_code)
H5MM_memcpy(assign_io_mode, mergebuf, total_chunks);
@@ -2606,7 +2608,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ
H5D_chunk_info_t *chunk_info;
H5D_chunk_ud_t udata;
H5SL_node_t *chunk_node;
- hssize_t select_npoints;
+ hsize_t select_npoints;
hssize_t chunk_npoints;
if(NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(H5D_filtered_collective_io_info_t))))
@@ -2632,8 +2634,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ
H5MM_memcpy(local_info_array[i].scaled, chunk_info->scaled, sizeof(chunk_info->scaled));
- if ((select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace);
local_info_array[i].io_size = (size_t) select_npoints * type_info->src_type_size;
/* Currently the full overwrite status of a chunk is only obtained on a per-process
@@ -2841,7 +2842,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
if (mpi_rank != chunk_entry->owners.new_owner) {
H5D_chunk_info_t *chunk_info = NULL;
unsigned char *mod_data_p = NULL;
- hssize_t iter_nelmts;
+ hsize_t iter_nelmts;
size_t mod_data_size;
/* Look up the chunk and get its file and memory dataspaces */
@@ -2854,9 +2855,9 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
if(H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size")
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace);
+ H5_CHECK_OVERFLOW(iter_nelmts, hsize_t, size_t);
mod_data_size += (size_t) iter_nelmts * type_info->src_type_size;
if(NULL == (mod_data[num_send_requests] = (unsigned char *) H5MM_malloc(mod_data_size)))
@@ -3088,7 +3089,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
H5Z_EDC_t err_detect; /* Error detection info */
H5Z_cb_t filter_cb; /* I/O filter callback function */
unsigned filter_mask = 0;
- hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */
+ hsize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */
hssize_t extent_npoints;
hsize_t true_chunk_size;
hbool_t mem_iter_init = FALSE;
@@ -3193,17 +3194,15 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information")
file_iter_init = TRUE;
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace);
- if(NULL == (tmp_gath_buf = H5MM_malloc((hsize_t) iter_nelmts * type_info->src_type_size)))
+ if(NULL == (tmp_gath_buf = H5MM_malloc(iter_nelmts * type_info->src_type_size)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate temporary gather buffer")
if(!H5D__gather_mem(chunk_entry->buf, file_iter, (size_t) iter_nelmts, tmp_gath_buf))
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't gather from chunk buffer")
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace);
if(H5D__scatter_mem(tmp_gath_buf, mem_iter, (size_t) iter_nelmts, io_info->u.rbuf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to read buffer")
@@ -3211,10 +3210,9 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
break;
case H5D_IO_OP_WRITE:
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace);
- if(NULL == (tmp_gath_buf = H5MM_malloc((hsize_t) iter_nelmts * type_info->src_type_size)))
+ if(NULL == (tmp_gath_buf = H5MM_malloc(iter_nelmts * type_info->src_type_size)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate temporary gather buffer")
/* Gather modification data from the application write buffer into a temporary buffer */
@@ -3230,8 +3228,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information")
mem_iter_init = TRUE;
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace);
/* Scatter the owner's modification data into the chunk data buffer according to
* the file space.
@@ -3262,8 +3259,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information")
mem_iter_init = TRUE;
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace);
/* Update the chunk data with the received modification data */
if(H5D__scatter_mem(mod_data_p, mem_iter, (size_t) iter_nelmts, chunk_entry->buf) < 0)
diff --git a/src/H5Dnone.c b/src/H5Dnone.c
index 9346220..2093512 100644
--- a/src/H5Dnone.c
+++ b/src/H5Dnone.c
@@ -378,7 +378,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__none_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
+H5D__none_idx_copy_setup(const H5D_chk_idx_info_t H5_ATTR_NDEBUG_UNUSED *idx_info_src,
const H5D_chk_idx_info_t *idx_info_dst)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c
index 4510a03..8efa771 100644
--- a/src/H5Dsingle.c
+++ b/src/H5Dsingle.c
@@ -437,7 +437,7 @@ H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D__single_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
+H5D__single_idx_copy_setup(const H5D_chk_idx_info_t H5_ATTR_NDEBUG_UNUSED *idx_info_src,
const H5D_chk_idx_info_t *idx_info_dst)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index 1fd9c44..1d182a4 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -1543,7 +1543,7 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
*/
BEGIN_FUNC(STATIC, ERR,
void *, NULL, NULL,
-H5EA__cache_dblock_deserialize(const void *_image, size_t len,
+H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_udata, hbool_t H5_ATTR_UNUSED *dirty))
/* Local variables */
@@ -2080,7 +2080,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */
*/
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
-H5EA__cache_dblk_page_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
+H5EA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image, size_t H5_ATTR_UNUSED len,
void *_thing))
/* Local variables */
diff --git a/src/H5EAtest.c b/src/H5EAtest.c
index 814e64f..58e255a 100644
--- a/src/H5EAtest.c
+++ b/src/H5EAtest.c
@@ -279,7 +279,7 @@ END_FUNC(STATIC) /* end H5EA__test_encode() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
-H5EA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx))
+H5EA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_NDEBUG_UNUSED *_ctx))
/* Local variables */
#ifndef NDEBUG
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index 2f0d1b4..922153c 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -253,7 +253,7 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */
*/
BEGIN_FUNC(STATIC, ERR,
void *, NULL, NULL,
-H5FA__cache_hdr_deserialize(const void *_image, size_t len,
+H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_udata, hbool_t H5_ATTR_UNUSED *dirty))
/* Local variables */
@@ -651,7 +651,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */
*/
BEGIN_FUNC(STATIC, ERR,
void *, NULL, NULL,
-H5FA__cache_dblock_deserialize(const void *_image, size_t len,
+H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_udata, hbool_t H5_ATTR_UNUSED *dirty))
/* Local variables */
@@ -1178,7 +1178,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */
*/
BEGIN_FUNC(STATIC, ERR,
herr_t, SUCCEED, FAIL,
-H5FA__cache_dblk_page_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
+H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image, size_t H5_ATTR_UNUSED len,
void *_thing))
/* Local variables */
diff --git a/src/H5FS.c b/src/H5FS.c
index dbcb6b5..1bd56b8 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -665,14 +665,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size)
+H5FS_size(const H5FS_t *fspace, hsize_t *meta_size)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
/*
* Check arguments.
*/
- HDassert(f);
HDassert(fspace);
HDassert(meta_size);
diff --git a/src/H5FScache.c b/src/H5FScache.c
index cb0abe9..d5f2817 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -241,7 +241,7 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE
*-------------------------------------------------------------------------
*/
static void *
-H5FS__cache_hdr_deserialize(const void *_image, size_t len, void *_udata,
+H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
hbool_t H5_ATTR_UNUSED *dirty)
{
H5FS_t *fspace = NULL; /* Free space header info */
@@ -404,8 +404,8 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len)
*/
static herr_t
H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing,
- haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t *new_len,
- unsigned *flags)
+ haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t H5_ATTR_NDEBUG_UNUSED *new_addr,
+ size_t H5_ATTR_NDEBUG_UNUSED *new_len, unsigned *flags)
{
H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */
H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */
@@ -694,7 +694,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len,
+H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_thing)
{
H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */
@@ -979,8 +979,8 @@ H5FS__cache_sinfo_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU
*-------------------------------------------------------------------------
*/
static void *
-H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t *dirty)
+H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
+ hbool_t H5_ATTR_NDEBUG_UNUSED *dirty)
{
H5FS_sinfo_cache_ud_t *udata = (H5FS_sinfo_cache_ud_t *)_udata; /* User data for callback */
H5FS_t *fspace; /* free space manager */
@@ -1025,11 +1025,11 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata,
/* Check for any serialized sections */
if(fspace->serial_sect_count > 0) {
- hsize_t old_tot_sect_count; /* Total section count from header */
- hsize_t old_serial_sect_count; /* Total serializable section count from header */
- hsize_t old_ghost_sect_count; /* Total ghost section count from header */
- hsize_t old_tot_space; /* Total space managed from header */
- unsigned sect_cnt_size; /* The size of the section size counts */
+ hsize_t old_tot_sect_count; /* Total section count from header */
+ hsize_t H5_ATTR_NDEBUG_UNUSED old_serial_sect_count; /* Total serializable section count from header */
+ hsize_t H5_ATTR_NDEBUG_UNUSED old_ghost_sect_count; /* Total ghost section count from header */
+ hsize_t H5_ATTR_NDEBUG_UNUSED old_tot_space; /* Total space managed from header */
+ unsigned sect_cnt_size; /* The size of the section size counts */
/* Compute the size of the section counts */
sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count);
@@ -1141,7 +1141,6 @@ static herr_t
H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len)
{
const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)_thing; /* Pointer to the object */
- const H5FS_t *fspace; /* Free space header */
FUNC_ENTER_STATIC_NOERR
@@ -1149,10 +1148,9 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len)
HDassert(sinfo);
HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO);
- fspace = sinfo->fspace;
- HDassert(fspace);
- HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
- HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR);
+ HDassert(sinfo->fspace);
+ HDassert(sinfo->fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR);
HDassert(image_len);
/* Set the image length size */
@@ -1180,7 +1178,8 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len)
*/
static herr_t
H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *_thing, haddr_t addr,
- size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags)
+ size_t H5_ATTR_NDEBUG_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_NDEBUG_UNUSED *new_len,
+ unsigned *flags)
{
H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */
H5FS_t *fspace; /* Free space header */
@@ -1267,7 +1266,6 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len,
void *_thing)
{
H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */
- H5FS_t *fspace; /* Free space header */
H5FS_iter_ud_t udata; /* User data for callbacks */
uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint8_t *chksum_image = NULL; /* Points to chksum location */
@@ -1283,12 +1281,11 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len,
HDassert(sinfo);
HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO);
- fspace = sinfo->fspace;
- HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
- HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR);
- HDassert(fspace->cache_info.is_pinned);
- HDassert(fspace->sect_size == len);
- HDassert(fspace->sect_cls);
+ HDassert(sinfo->fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR);
+ HDassert(sinfo->fspace->cache_info.is_pinned);
+ HDassert(sinfo->fspace->sect_size == len);
+ HDassert(sinfo->fspace->sect_cls);
/* Magic number */
H5MM_memcpy(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC);
@@ -1418,7 +1415,6 @@ static herr_t
H5FS__cache_sinfo_free_icr(void *_thing)
{
H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */
- H5FS_t *fspace; /* Free space header */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -1427,10 +1423,9 @@ H5FS__cache_sinfo_free_icr(void *_thing)
HDassert(sinfo);
HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC);
HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO);
- fspace = sinfo->fspace;
- HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
- HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR);
- HDassert(fspace->cache_info.is_pinned);
+ HDassert(sinfo->fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR);
+ HDassert(sinfo->fspace->cache_info.is_pinned);
/* Destroy free space info */
if(H5FS__sinfo_dest(sinfo) < 0)
diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h
index 31fc63c..d2e1f90 100644
--- a/src/H5FSprivate.h
+++ b/src/H5FSprivate.h
@@ -182,7 +182,7 @@ H5_DLL H5FS_t *H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_c
H5_DLL H5FS_t *H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses,
const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment,
hsize_t threshold);
-H5_DLL herr_t H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size);
+H5_DLL herr_t H5FS_size(const H5FS_t *fspace, hsize_t *meta_size);
H5_DLL herr_t H5FS_delete(H5F_t *f, haddr_t fs_addr);
H5_DLL herr_t H5FS_close(H5F_t *f, H5FS_t *fspace);
H5_DLL herr_t H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr);
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 1fd8f48..74189c1 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -1509,8 +1509,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
H5P_genplist_t *a_plist; /*file access property list */
H5F_close_degree_t fc_degree; /*file close degree */
size_t page_buf_size;
- unsigned page_buf_min_meta_perc;
- unsigned page_buf_min_raw_perc;
+ unsigned page_buf_min_meta_perc = 0;
+ unsigned page_buf_min_raw_perc = 0;
hbool_t set_flag = FALSE; /*set the status_flags in the superblock */
hbool_t clear = FALSE; /*clear the status_flags */
hbool_t evict_on_close; /* evict on close value from plist */
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index 125d6cf..f95f13d 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -344,7 +344,7 @@ H5F__cache_superblock_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t
*-------------------------------------------------------------------------
*/
static herr_t
-H5F__cache_superblock_get_final_load_size(const void *_image, size_t image_len,
+H5F__cache_superblock_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len,
void *_udata, size_t *actual_len)
{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
@@ -434,7 +434,7 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata
*-------------------------------------------------------------------------
*/
static void *
-H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata,
+H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
hbool_t H5_ATTR_UNUSED *dirty)
{
H5F_super_t *sblock = NULL; /* File's superblock */
@@ -867,7 +867,7 @@ H5F__cache_drvrinfo_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *i
*-------------------------------------------------------------------------
*/
static herr_t
-H5F__cache_drvrinfo_get_final_load_size(const void *_image, size_t image_len,
+H5F__cache_drvrinfo_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len,
void *_udata, size_t *actual_len)
{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
@@ -911,7 +911,7 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata,
+H5F__cache_drvrinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
hbool_t H5_ATTR_UNUSED *dirty)
{
H5O_drvinfo_t *drvinfo = NULL; /* Driver info */
@@ -1006,7 +1006,7 @@ H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len)
*-------------------------------------------------------------------------
*/
static herr_t
-H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t len,
+H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_thing)
{
H5O_drvinfo_t *drvinfo = (H5O_drvinfo_t *)_thing; /* Pointer to the object */
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index d11d7a0..35b90f3 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -762,12 +762,11 @@ done:
*-------------------------------------------------------------------------
*/
static H5B_ins_t
-H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/,
+H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key/*in,out*/,
hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/,
void *_udata/*in,out*/, void *_rt_key/*in,out*/,
hbool_t *rt_key_changed/*out*/)
{
- H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key;
H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key;
H5G_bt_rm_t *udata = (H5G_bt_rm_t *)_udata;
H5G_node_t *sn = NULL;
@@ -781,7 +780,7 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/,
/* Check arguments */
HDassert(f);
HDassert(H5F_addr_defined(addr));
- HDassert(lt_key);
+ HDassert((H5G_node_key_t *)_lt_key);
HDassert(rt_key);
HDassert(udata && udata->common.heap);
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index 2d1c1f2..4a2ff91 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -403,7 +403,7 @@ H5HF__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len)
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF__cache_hdr_get_final_load_size(const void *_image, size_t image_len,
+H5HF__cache_hdr_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len,
void *_udata, size_t *actual_len)
{
H5HF_hdr_t hdr; /* Temporary fractal heap header */
@@ -749,7 +749,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len,
+H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_thing)
{
H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */
@@ -979,8 +979,8 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN
*-------------------------------------------------------------------------
*/
static void *
-H5HF__cache_iblock_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty)
+H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
+ void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
{
H5HF_hdr_t *hdr; /* Shared fractal heap information */
H5HF_iblock_cache_ud_t *udata = (H5HF_iblock_cache_ud_t *)_udata; /* User data for callback */
@@ -1326,7 +1326,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t len,
+H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_thing)
{
H5HF_hdr_t *hdr; /* Shared fractal heap information */
@@ -1471,8 +1471,8 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing)
else {
/* if this is a child iblock, verify that the pointers are */
/* either uninitialized or set up correctly. */
- H5HF_indirect_t *par_iblock = iblock->parent;
- unsigned indir_idx; /* Index in parent's child iblock pointer array */
+ H5HF_indirect_t H5_ATTR_NDEBUG_UNUSED *par_iblock = iblock->parent;
+ unsigned H5_ATTR_NDEBUG_UNUSED indir_idx; /* Index in parent's child iblock pointer array */
/* Sanity check */
HDassert(par_iblock->child_iblocks);
@@ -2438,8 +2438,8 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF__cache_dblock_serialize(const H5F_t *f, void *image, size_t len,
- void *_thing)
+H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image,
+ size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing)
{
H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Direct block info */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5HFsection.c b/src/H5HFsection.c
index f5ac8e5..c11bc34 100644
--- a/src/H5HFsection.c
+++ b/src/H5HFsection.c
@@ -1185,9 +1185,9 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5
H5HF_indirect_t *iblock; /* Indirect block that section's direct block resides in */
haddr_t dblock_addr; /* Direct block address */
size_t dblock_size; /* Direct block size */
- size_t dblock_overhead; /* Direct block's overhead */
unsigned dblock_status = 0; /* Direct block's status in the metadata cache */
- herr_t status; /* Generic status value */
+ size_t H5_ATTR_NDEBUG_UNUSED dblock_overhead; /* Direct block's overhead */
+ herr_t H5_ATTR_NDEBUG_UNUSED status; /* Generic status value */
/* Sanity check settings for section's direct block's parent */
iblock = sect->u.single.parent;
@@ -2038,7 +2038,7 @@ H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t
const H5HF_hdr_t *hdr; /* Fractal heap header */
const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Pointer to section to check */
const H5HF_free_section_t *indir_sect; /* Pointer to underlying indirect section */
- unsigned indir_idx; /* Index of row in underlying indirect section's row array */
+ unsigned H5_ATTR_NDEBUG_UNUSED indir_idx; /* Index of row in underlying indirect section's row array */
FUNC_ENTER_STATIC_NOERR
@@ -4125,7 +4125,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
dir_nrows = (max_dir_row - start_row) + 1;
HDassert(dir_nrows == sect->u.indirect.dir_nrows);
for(u = 0; u < dir_nrows; u++) {
- const H5HF_free_section_t *tmp_row_sect; /* Pointer to row section */
+ const H5HF_free_section_t H5_ATTR_NDEBUG_UNUSED *tmp_row_sect; /* Pointer to row section */
tmp_row_sect = sect->u.indirect.dir_rows[u];
HDassert(tmp_row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW
@@ -4133,7 +4133,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
HDassert(tmp_row_sect->u.row.under == sect);
HDassert(tmp_row_sect->u.row.row == (start_row + u));
if(u > 0) {
- const H5HF_free_section_t *tmp_row_sect2; /* Pointer to row section */
+ const H5HF_free_section_t H5_ATTR_NDEBUG_UNUSED *tmp_row_sect2; /* Pointer to row section */
tmp_row_sect2 = sect->u.indirect.dir_rows[u - 1];
HDassert(tmp_row_sect2->u.row.row < tmp_row_sect->u.row.row);
@@ -4160,7 +4160,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect)
HDassert(tmp_child_sect->sect_info.type == H5HF_FSPACE_SECT_INDIRECT);
HDassert(tmp_child_sect->u.indirect.parent == sect);
if(u > 0) {
- const H5HF_free_section_t *tmp_child_sect2; /* Pointer to child indirect section */
+ const H5HF_free_section_t H5_ATTR_NDEBUG_UNUSED *tmp_child_sect2; /* Pointer to child indirect section */
tmp_child_sect2 = sect->u.indirect.indir_ents[u - 1];
HDassert(H5F_addr_lt(tmp_child_sect2->sect_info.addr, tmp_child_sect->sect_info.addr));
diff --git a/src/H5HFspace.c b/src/H5HFspace.c
index 37a0502..ad5ff0f 100644
--- a/src/H5HFspace.c
+++ b/src/H5HFspace.c
@@ -447,7 +447,7 @@ H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size)
/* Get free space metadata size */
if(hdr->fspace) {
- if(H5FS_size(hdr->f, hdr->fspace, fs_size) < 0)
+ if(H5FS_size(hdr->fspace, fs_size) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't retrieve FS meta storage info")
} /* end if */
else
diff --git a/src/H5HGcache.c b/src/H5HGcache.c
index 29e88df..18625cc 100644
--- a/src/H5HGcache.c
+++ b/src/H5HGcache.c
@@ -202,7 +202,7 @@ H5HG__cache_heap_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *imag
*-------------------------------------------------------------------------
*/
static herr_t
-H5HG__cache_heap_get_final_load_size(const void *image, size_t image_len,
+H5HG__cache_heap_get_final_load_size(const void *image, size_t H5_ATTR_NDEBUG_UNUSED image_len,
void *udata, size_t *actual_len)
{
H5HG_heap_t heap; /* Global heap */
@@ -432,7 +432,7 @@ H5HG__cache_heap_image_len(const void *_thing, size_t *image_len)
*-------------------------------------------------------------------------
*/
static herr_t
-H5HG__cache_heap_serialize(const H5F_t *f, void *image, size_t len,
+H5HG__cache_heap_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, size_t len,
void *_thing)
{
H5HG_heap_t *heap = (H5HG_heap_t *)_thing;
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index 8b04b47..b0ac05f 100644
--- a/src/H5HLcache.c
+++ b/src/H5HLcache.c
@@ -364,7 +364,7 @@ H5HL__cache_prefix_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *im
*-------------------------------------------------------------------------
*/
static herr_t
-H5HL__cache_prefix_get_final_load_size(const void *_image, size_t image_len,
+H5HL__cache_prefix_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len,
void *_udata, size_t *actual_len)
{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
@@ -415,8 +415,8 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty)
+H5HL__cache_prefix_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
+ void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
{
H5HL_t *heap = NULL; /* Local heap */
H5HL_prfx_t *prfx = NULL; /* Heap prefix deserialized */
@@ -555,7 +555,7 @@ H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len)
*-------------------------------------------------------------------------
*/
static herr_t
-H5HL__cache_prefix_serialize(const H5F_t *f, void *_image, size_t len,
+H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_thing)
{
H5HL_prfx_t *prfx = (H5HL_prfx_t *)_thing; /* Pointer to local heap prefix to query */
@@ -826,8 +826,8 @@ H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len)
*-------------------------------------------------------------------------
*/
static herr_t
-H5HL__cache_datablock_serialize(const H5F_t *f, void *image, size_t len,
- void *_thing)
+H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image,
+ size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing)
{
H5HL_t *heap; /* Pointer to the local heap */
H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */
diff --git a/src/H5MF.c b/src/H5MF.c
index c100637..df1c88a 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -2290,7 +2290,7 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size)
/* Retrieve free space size from free space manager */
if(H5FS_sect_stats(f->shared->fs_man[type], &type_fs_size, NULL) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query free space stats")
- if(H5FS_size(f, f->shared->fs_man[type], &type_meta_size) < 0)
+ if(H5FS_size(f->shared->fs_man[type], &type_meta_size) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query free space metadata stats")
/* Increment total free space for types */
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c
index 23aba09..2d95ee9 100644
--- a/src/H5Oainfo.c
+++ b/src/H5Oainfo.c
@@ -334,7 +334,7 @@ H5O__ainfo_free(void *mesg)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg)
+H5O__ainfo_delete(H5F_t *f, H5O_t H5_ATTR_NDEBUG_UNUSED *open_oh, void *_mesg)
{
H5O_ainfo_t *ainfo = (H5O_ainfo_t *)_mesg;
herr_t ret_value = SUCCEED; /* Return value */
@@ -405,9 +405,9 @@ H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE
*-------------------------------------------------------------------------
*/
static void *
-H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
+H5O__ainfo_copy_file(H5F_t H5_ATTR_NDEBUG_UNUSED *file_src, void *mesg_src, H5F_t *file_dst,
hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags,
- H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata)
+ H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata)
{
H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src;
H5O_ainfo_t *ainfo_dst = NULL;
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index c1f90cb..8850ef6 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -111,7 +111,7 @@ H5FL_EXTERN(H5O_cont_t);
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied,
+H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied,
size_t idx, uint8_t *new_gap_loc, size_t new_gap_size)
{
hbool_t merged_with_null; /* Whether the gap was merged with a null message */
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index 683d155..8bad181 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -201,7 +201,7 @@ H5O__cache_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *image_len)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__cache_get_final_load_size(const void *image, size_t image_len,
+H5O__cache_get_final_load_size(const void *image, size_t H5_ATTR_NDEBUG_UNUSED image_len,
void *_udata, size_t *actual_len)
{
H5O_cache_ud_t *udata = (H5O_cache_ud_t *)_udata; /* User data for callback */
@@ -306,7 +306,7 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata)
*-------------------------------------------------------------------------
*/
static void *
-H5O__cache_deserialize(const void *image, size_t len, void *_udata,
+H5O__cache_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
hbool_t *dirty)
{
H5O_t *oh = NULL; /* Object header read in */
@@ -763,7 +763,7 @@ H5O__cache_chk_verify_chksum(const void *_image, size_t len, void *_udata)
*-------------------------------------------------------------------------
*/
static void *
-H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata,
+H5O__cache_chk_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
hbool_t *dirty)
{
H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk proxy object */
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index 18f3706..d66ea69 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -1686,17 +1686,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O_msg_reset_share(unsigned type_id, void *mesg)
+H5O_msg_reset_share(unsigned H5_ATTR_NDEBUG_UNUSED type_id, void *mesg)
{
- const H5O_msg_class_t *type; /* Actual H5O class type for the ID */
-
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Check args */
HDassert(type_id < NELMTS(H5O_msg_class_g));
- type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */
- HDassert(type);
- HDassert(type->share_flags & H5O_SHARE_IS_SHARABLE);
+ HDassert(H5O_msg_class_g[type_id]); /* map the type ID to the actual type object */
+ HDassert(H5O_msg_class_g[type_id]->share_flags & H5O_SHARE_IS_SHARABLE);
HDassert(mesg);
/* Reset the shared component in the message to zero. */
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index 67ca76f..b49e501 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -589,9 +589,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O__shared_copy_file(H5F_t *file_src, H5F_t *file_dst,
+H5O__shared_copy_file(H5F_t H5_ATTR_NDEBUG_UNUSED *file_src, H5F_t *file_dst,
const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst,
- hbool_t H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info,
+ hbool_t H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info,
void H5_ATTR_UNUSED *udata)
{
const H5O_shared_t *shared_src = (const H5O_shared_t *)_native_src; /* Alias to shared info in native source */
diff --git a/src/H5Oshared.h b/src/H5Oshared.h
index 8040a6a..e4ad980 100644
--- a/src/H5Oshared.h
+++ b/src/H5Oshared.h
@@ -381,7 +381,7 @@ done:
*-------------------------------------------------------------------------
*/
static H5_INLINE herr_t
-H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src,
+H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const void *mesg_src,
H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags,
H5O_copy_t *cpy_info)
{
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 22252d3..3668229 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -5753,10 +5753,10 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED
{
const H5VL_connector_prop_t *info1 = (const H5VL_connector_prop_t *)_info1; /* Create local aliases for values */
const H5VL_connector_prop_t *info2 = (const H5VL_connector_prop_t *)_info2;
- H5VL_class_t *cls1, *cls2; /* connector class for each property */
- int cmp_value = 0; /* Value from comparison */
- herr_t status; /* Status from info comparison */
- int ret_value = 0; /* Return value */
+ H5VL_class_t *cls1, *cls2; /* connector class for each property */
+ int cmp_value = 0; /* Value from comparison */
+ herr_t H5_ATTR_NDEBUG_UNUSED status; /* Status from info comparison */
+ int ret_value = 0; /* Return value */
FUNC_ENTER_STATIC_NOERR
diff --git a/src/H5Pint.c b/src/H5Pint.c
index 2911eef..0810427 100644
--- a/src/H5Pint.c
+++ b/src/H5Pint.c
@@ -2780,8 +2780,8 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5P__poke_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop,
- void *_udata)
+H5P__poke_plist_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name,
+ H5P_genprop_t *prop, void *_udata)
{
H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2827,7 +2827,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5P__poke_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop,
+H5P__poke_pclass_cb(H5P_genplist_t *plist, const char H5_ATTR_NDEBUG_UNUSED *name, H5P_genprop_t *prop,
void *_udata)
{
H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */
@@ -4260,10 +4260,9 @@ property list class.
REVISION LOG
--------------------------------------------------------------------------*/
static int
-H5P__iterate_pclass_cb(void *_item, void *_key, void *_udata)
+H5P__iterate_pclass_cb(void *_item, void H5_ATTR_NDEBUG_UNUSED *_key, void *_udata)
{
H5P_genprop_t *item = (H5P_genprop_t *)_item; /* Pointer to the property */
- char *key = (char *)_key; /* Pointer to the property's name */
H5P_iter_pclass_ud_t *udata = (H5P_iter_pclass_ud_t *)_udata; /* Pointer to user data */
int ret_value = 0; /* Return value */
@@ -4271,7 +4270,7 @@ H5P__iterate_pclass_cb(void *_item, void *_key, void *_udata)
/* Sanity check */
HDassert(item);
- HDassert(key);
+ HDassert((char *)_key);
/* Check if we've found the correctly indexed property */
if(*udata->curr_idx_ptr >= udata->prev_idx) {
@@ -4397,8 +4396,8 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5P__peek_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop,
- void *_udata)
+H5P__peek_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name,
+ H5P_genprop_t *prop, void *_udata)
{
H5P_prop_get_ud_t *udata = (H5P_prop_get_ud_t *)_udata; /* User data for callback */
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Plapl.c b/src/H5Plapl.c
index 7a7cc23..c4642e2 100644
--- a/src/H5Plapl.c
+++ b/src/H5Plapl.c
@@ -567,7 +567,7 @@ H5P__lacc_elink_fapl_cmp(const void *value1, const void *value2, size_t H5_ATTR_
if(obj1 == NULL && obj2 != NULL) HGOTO_DONE(1);
if(obj1 != NULL && obj2 == NULL) HGOTO_DONE(-1);
if(obj1 && obj2) {
- herr_t status;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
status = H5P__cmp_plist(obj1, obj2, &ret_value);
HDassert(status >= 0);
diff --git a/src/H5Pmapl.c b/src/H5Pmapl.c
index fe5be0f..3a3f619 100644
--- a/src/H5Pmapl.c
+++ b/src/H5Pmapl.c
@@ -137,6 +137,7 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5P__macc_reg_prop() */
+#ifdef H5_HAVE_MAP_API
/*-------------------------------------------------------------------------
* Function: H5Pset_map_iterate_hints
@@ -214,4 +215,4 @@ H5Pget_map_iterate_hints(hid_t mapl_id, size_t *key_prefetch_size, size_t *key_a
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Pget_map_iterate_hints() */
-
+#endif
diff --git a/src/H5Rint.c b/src/H5Rint.c
index af1b6e2..486c1ff 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -819,6 +819,7 @@ H5R__set_obj_token(H5R_ref_priv_t *ref, const H5O_token_t *obj_token,
HDassert(token_size <= H5O_MAX_TOKEN_SIZE);
H5MM_memcpy(&ref->info.obj.token, obj_token, sizeof(H5O_token_t));
+ HDassert(token_size <= 255);
ref->token_size = (uint8_t)token_size;
FUNC_LEAVE_NOAPI(ret_value)
@@ -1200,7 +1201,7 @@ H5R__decode_obj_token(const unsigned char *buf, size_t *nbytes,
/* Decode token */
H5MM_memcpy(obj_token, p, *token_size);
- *nbytes = (size_t)*token_size + H5_SIZEOF_UINT8_T;
+ *nbytes = (size_t)(*token_size + H5_SIZEOF_UINT8_T);
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5SL.c b/src/H5SL.c
index 5f00fb8..ff8edb8 100644
--- a/src/H5SL.c
+++ b/src/H5SL.c
@@ -652,7 +652,7 @@ int H5SL_term_package(void)
/* Terminate all the factories */
if(H5SL_fac_nused_g > 0) {
size_t i;
- herr_t ret;
+ herr_t H5_ATTR_NDEBUG_UNUSED ret;
for(i = 0; i < H5SL_fac_nused_g; i++) {
ret = H5FL_fac_term(H5SL_fac_g[i]);
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index ee28fa4..6d0f2b0 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -212,8 +212,8 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU
*-------------------------------------------------------------------------
*/
static void *
-H5SM__cache_table_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty)
+H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
+ void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
{
H5F_t *f; /* File pointer -- from user data */
H5SM_master_table_t *table = NULL; /* Shared message table that we deserializing */
@@ -364,7 +364,7 @@ H5SM__cache_table_image_len(const void *_thing, size_t *image_len)
*-------------------------------------------------------------------------
*/
static herr_t
-H5SM__cache_table_serialize(const H5F_t *f, void *_image, size_t len,
+H5SM__cache_table_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_thing)
{
H5SM_master_table_t *table = (H5SM_master_table_t *)_thing; /* Shared message table to encode */
@@ -568,8 +568,8 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo
*-------------------------------------------------------------------------
*/
static void *
-H5SM__cache_list_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty)
+H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
+ void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
{
H5SM_list_t *list = NULL; /* The SOHM list being read in */
H5SM_list_cache_ud_t *udata = (H5SM_list_cache_ud_t *)_udata; /* User data for callback */
@@ -687,7 +687,7 @@ H5SM__cache_list_image_len(const void *_thing, size_t *image_len)
*-------------------------------------------------------------------------
*/
static herr_t
-H5SM__cache_list_serialize(const H5F_t *f, void *_image, size_t len,
+H5SM__cache_list_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len,
void *_thing)
{
H5SM_list_t *list = (H5SM_list_t *)_thing ; /* Instance being serialized */
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 800913f..6397f4b 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -293,8 +293,8 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points,
for(i = 0; i < num_big_types; i++) {
#if MPI_VERSION >= 3
- if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block(bigio_count,
- 1, &disp[i*bigio_count], elmt_type, &inner_types[i])))
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block((int)bigio_count,
+ 1, &disp[(hsize_t)i*bigio_count], elmt_type, &inner_types[i])))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code)
#else
if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)bigio_count,
@@ -308,7 +308,7 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points,
if(remaining_points) {
#if MPI_VERSION >= 3
if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block(remaining_points,
- 1, &disp[num_big_types*bigio_count], elmt_type, &inner_types[num_big_types])))
+ 1, &disp[(hsize_t)num_big_types*bigio_count], elmt_type, &inner_types[num_big_types])))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code)
#else
if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)remaining_points,
@@ -403,8 +403,11 @@ H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_typ
curr = space->select.sel_info.pnt_lst->head;
for(u = 0 ; u < num_points ; u++) {
/* Calculate the displacement of the current point */
- disp[u] = H5VM_array_offset(space->extent.rank, space->extent.size, curr->pnt);
- disp[u] *= elmt_size;
+ hsize_t disp_tmp = H5VM_array_offset(space->extent.rank, space->extent.size, curr->pnt);
+ if(disp_tmp > LONG_MAX) /* Maximum value of type long */
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "disp overflow")
+ disp[u] = (MPI_Aint)disp_tmp;
+ disp[u] *= (MPI_Aint)elmt_size;
/* This is a File Space used to set the file view, so adjust the displacements
* to have them monotonically non-decreasing.
@@ -423,7 +426,7 @@ H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_typ
*/
if(do_permute) {
if(u > 0 && disp[u] < disp[u - 1]) {
- unsigned s = 0, l = u, m = u / 2;
+ hsize_t s = 0, l = u, m = u / 2;
*is_permuted = TRUE;
do {
@@ -565,7 +568,9 @@ H5S__mpio_permute_type(const H5S_t *space, size_t elmt_size, hsize_t **permute,
/* Loop, while bytes left in sequence */
while(curr_len > 0) {
/* Set the displacement of the current point */
- disp[u] = curr_off;
+ if(curr_off > LONG_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "curr_off overflow")
+ disp[u] = (MPI_Aint)curr_off;
/* This is a memory displacement, so for each point selected,
* apply the map that was generated by the file selection */
@@ -893,8 +898,14 @@ if(H5DEBUG(S))
****************************************/
/* Calculate start and extent values of this dimension */
- start_disp = d[i].start * offset[i] * elmt_size;
- new_extent = (MPI_Aint)elmt_size * max_xtent[i];
+ /* Check if value overflow to cast to type MPI_Aint */
+ if(d[i].start > LONG_MAX || offset[i] > LONG_MAX || elmt_size > LONG_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "result overflow")
+ start_disp = (MPI_Aint)d[i].start * (MPI_Aint)offset[i] * (MPI_Aint)elmt_size;
+
+ if(max_xtent[i] > LONG_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "max_xtent overflow")
+ new_extent = (MPI_Aint)elmt_size * (MPI_Aint)max_xtent[i];
if(MPI_SUCCESS != (mpi_code = MPI_Type_get_extent(outer_type, &lb, &extent_len)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_get_extent failed", mpi_code)
@@ -1161,7 +1172,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down,
nelmts = (span->high - span->low) + 1;
/* Store displacement & block length */
- disp[outercount] = (MPI_Aint)elmt_size * span->low;
+ disp[outercount] = (MPI_Aint)elmt_size * (MPI_Aint)span->low;
H5_CHECK_OVERFLOW(nelmts, hsize_t, int)
blocklen[outercount] = (int)nelmts;
@@ -1183,7 +1194,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down,
/* create the block type from elmt_type while checking the 32 bit int limit */
if((hsize_t)(blocklen[u]) > bigio_count) {
- if(H5_mpio_create_large_type(blocklen[u], 0, *elmt_type, &temp_type) < 0)
+ if(H5_mpio_create_large_type((hsize_t)blocklen[u], 0, *elmt_type, &temp_type) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large element datatype in span_hyper selection")
} /* end if */
else
@@ -1219,7 +1230,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down,
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of inner MPI datatypes")
/* Calculate the total bytes of the lower dimension */
- stride = (*down) * elmt_size;
+ stride = (MPI_Aint)(*down) * (MPI_Aint)elmt_size;
/* Loop over span nodes */
outercount = 0;
@@ -1251,7 +1262,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down,
/* Displacement should be in byte and should have dimension information */
/* First using MPI Type vector to build derived data type for this span only */
/* Need to calculate the disp in byte for this dimension. */
- disp[outercount] = span->low * stride;
+ disp[outercount] = (MPI_Aint)span->low * stride;
blocklen[outercount] = 1;
/* Generate MPI datatype for next dimension down */
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 8a0c562..29fd582 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -1848,7 +1848,7 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv)
for(i = 0; i < priv->src_nmembs; i++)
if(src2dst[i] >= 0) {
- int status;
+ int H5_ATTR_NDEBUG_UNUSED status;
status = H5I_dec_ref(src_memb_id[i]);
HDassert(status >= 0);
diff --git a/src/H5Tref.c b/src/H5Tref.c
index 83604c1..f97b78a 100644
--- a/src/H5Tref.c
+++ b/src/H5Tref.c
@@ -784,7 +784,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_size,
+H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_NDEBUG_UNUSED src_size,
H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, size_t dst_size)
{
const uint8_t *p = (const uint8_t *)src_buf;
@@ -1101,7 +1101,11 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file,
{
size_t ret_value = sizeof(struct H5Tref_dsetreg);
+#ifndef NDEBUG
FUNC_ENTER_STATIC
+#else
+ FUNC_ENTER_STATIC_NOERR
+#endif
HDassert(src_buf);
@@ -1125,7 +1129,9 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file,
}
#endif /* NDEBUG */
+#ifndef NDEBUG
done:
+#endif
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T__ref_dsetreg_disk_getsize() */
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index 2245bd3..6d07513 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -324,7 +324,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
#define H5Z_XFORM_DO_OP5(TYPE, SIZE) \
{ \
- TYPE val = (TYPE)((tree->type == H5Z_XFORM_INTEGER) ? tree->value.int_val : tree->value.float_val); \
+ TYPE val = ((tree->type == H5Z_XFORM_INTEGER) ? (TYPE)tree->value.int_val : (TYPE)tree->value.float_val); \
H5VM_array_fill(array, &val, sizeof(TYPE), (SIZE)); \
}
diff --git a/src/H5mpi.c b/src/H5mpi.c
index b25f744..d9f161c 100644
--- a/src/H5mpi.c
+++ b/src/H5mpi.c
@@ -75,7 +75,7 @@ H5_mpi_set_bigio_count(hsize_t new_count)
*-------------------------------------------------------------------------
*/
hsize_t
-H5_mpi_get_bigio_count()
+H5_mpi_get_bigio_count(void)
{
return bigio_count;
}
@@ -482,7 +482,7 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes,
/* Calculate how many Big MPI datatypes are needed to represent the buffer */
num_big_types = (int)(num_elements/bigio_count);
- leftover = num_elements - num_big_types * (hsize_t)bigio_count;
+ leftover = (hsize_t)num_elements - (hsize_t)num_big_types * bigio_count;
H5_CHECKED_ASSIGN(remaining_bytes, int, leftover, hsize_t);
/* Create a contiguous datatype of size equal to the largest
@@ -491,11 +491,11 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes,
* use type_hvector to create the type with the displacement provided
*/
if (0 == stride_bytes) {
- if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(bigio_count, old_type, &inner_type)))
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)bigio_count, old_type, &inner_type)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code)
} /* end if */
else
- if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector(bigio_count, 1, stride_bytes, old_type, &inner_type)))
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector((int)bigio_count, 1, stride_bytes, old_type, &inner_type)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code)
/* Create a contiguous datatype of the buffer (minus the remaining < 2GB part)
diff --git a/src/H5overflow.txt b/src/H5overflow.txt
index ed71b98..9fb3b89 100644
--- a/src/H5overflow.txt
+++ b/src/H5overflow.txt
@@ -31,6 +31,7 @@
unsigned, UNSIGNED;
int8_t, SIGNED;
int, SIGNED;
+long, SIGNED;
int64_t, SIGNED;
uint8_t, UNSIGNED;
uint16_t, UNSIGNED;
diff --git a/src/H5private.h b/src/H5private.h
index f46a3a8..74fab79 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -305,15 +305,21 @@
*/
#ifdef __cplusplus
# define H5_ATTR_FORMAT(X,Y,Z) /*void*/
-# define H5_ATTR_UNUSED /*void*/
-# define H5_ATTR_NORETURN /*void*/
-# define H5_ATTR_CONST /*void*/
-# define H5_ATTR_PURE /*void*/
-# define H5_ATTR_FALLTHROUGH /*void*/
+# define H5_ATTR_UNUSED /*void*/
+# define H5_ATTR_NDEBUG_UNUSED /*void*/
+# define H5_ATTR_NORETURN /*void*/
+# define H5_ATTR_CONST /*void*/
+# define H5_ATTR_PURE /*void*/
+# define H5_ATTR_FALLTHROUGH /*void*/
#else /* __cplusplus */
#if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C)
# define H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z)))
# define H5_ATTR_UNUSED __attribute__((unused))
+#ifndef NDEBUG
+#define H5_ATTR_NDEBUG_UNUSED /*void*/
+#else /* NDEBUG */
+#define H5_ATTR_NDEBUG_UNUSED H5_ATTR_UNUSED
+#endif /* NDEBUG */
# define H5_ATTR_NORETURN __attribute__((noreturn))
# define H5_ATTR_CONST __attribute__((const))
# define H5_ATTR_PURE __attribute__((pure))
@@ -324,11 +330,12 @@
#endif
#else
# define H5_ATTR_FORMAT(X,Y,Z) /*void*/
-# define H5_ATTR_UNUSED /*void*/
-# define H5_ATTR_NORETURN /*void*/
-# define H5_ATTR_CONST /*void*/
-# define H5_ATTR_PURE /*void*/
-# define H5_ATTR_FALLTHROUGH /*void*/
+# define H5_ATTR_UNUSED /*void*/
+# define H5_ATTR_NDEBUG_UNUSED /*void*/
+# define H5_ATTR_NORETURN /*void*/
+# define H5_ATTR_CONST /*void*/
+# define H5_ATTR_PURE /*void*/
+# define H5_ATTR_FALLTHROUGH /*void*/
#endif
#endif /* __cplusplus */
@@ -1609,7 +1616,7 @@ extern char *strdup(const char *s);
srctype _tmp_src = (srctype)(src); \
dsttype _tmp_dst = (dsttype)(_tmp_src); \
HDassert(_tmp_src >= 0); \
- HDassert(_tmp_src == _tmp_dst); \
+ HDassert(_tmp_src == (srctype)_tmp_dst); \
(dst) = _tmp_dst; \
}
@@ -2677,7 +2684,7 @@ H5_DLL herr_t H5_combine_path(const char *path1, const char *path2, char **ful
#ifdef H5_HAVE_PARALLEL
/* Generic MPI functions */
H5_DLL hsize_t H5_mpi_set_bigio_count(hsize_t new_count);
-H5_DLL hsize_t H5_mpi_get_bigio_count();
+H5_DLL hsize_t H5_mpi_get_bigio_count(void);
H5_DLL herr_t H5_mpi_comm_dup(MPI_Comm comm, MPI_Comm *comm_new);
H5_DLL herr_t H5_mpi_info_dup(MPI_Info info, MPI_Info *info_new);
H5_DLL herr_t H5_mpi_comm_free(MPI_Comm *comm);