diff options
author | dyoung <dyoung@jelly.ad.hdfgroup.org> | 2019-08-22 19:10:11 (GMT) |
---|---|---|
committer | dyoung <dyoung@jelly.ad.hdfgroup.org> | 2019-08-22 19:10:11 (GMT) |
commit | 61109c76b2975c6c8347bfa6c0779624fbef1acc (patch) | |
tree | b6198a4eeabc14b372d75455fa3c7df6dc8c99be | |
parent | f85986fa9f50431f89d6fb2f6edfcc8ec52bcf78 (diff) | |
download | hdf5-61109c76b2975c6c8347bfa6c0779624fbef1acc.zip hdf5-61109c76b2975c6c8347bfa6c0779624fbef1acc.tar.gz hdf5-61109c76b2975c6c8347bfa6c0779624fbef1acc.tar.bz2 |
Quiet warnings, especially signed/unsigned casts.
-rw-r--r-- | src/H5C.c | 4 | ||||
-rw-r--r-- | src/H5Fint.c | 56 | ||||
-rw-r--r-- | src/H5Fpkg.h | 8 | ||||
-rw-r--r-- | src/H5PB.c | 18 | ||||
-rw-r--r-- | src/H5PBprivate.h | 6 |
5 files changed, 51 insertions, 41 deletions
@@ -7096,7 +7096,9 @@ H5C_load_entry(H5F_t * f, void * thing = NULL; /* Pointer to thing loaded */ H5C_cache_entry_t *entry = NULL; /* Alias for thing loaded, as */ /* cache entry */ +#if 0 size_t init_len; +#endif size_t len; /* Size of image in file */ #ifdef H5_HAVE_PARALLEL int mpi_rank = 0; /* MPI process rank */ @@ -7147,7 +7149,9 @@ H5C_load_entry(H5F_t * f, HDassert(len > 0); +#if 0 init_len = len; +#endif /* Check for possible speculative read off the end of the file */ if ( type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG ) { diff --git a/src/H5Fint.c b/src/H5Fint.c index 45f84c0..918c257 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -124,7 +124,9 @@ static herr_t H5F__vfd_swmr_close_or_flush(H5F_t *f, hbool_t closing); static herr_t H5F__vfd_swmr_update_end_of_tick_and_tick_num(H5F_t *f, hbool_t incr_tick_num); static herr_t H5F__vfd_swmr_construct_write_md_hdr(H5F_t *f, uint32_t num_entries); static herr_t H5F__vfd_swmr_construct_write_md_idx(H5F_t *f, uint32_t num_entries, struct H5FD_vfd_swmr_idx_entry_t index[]); +#if 0 static herr_t H5F__vfd_swmr_writer__dump_index(H5F_t * f); +#endif static herr_t H5F__idx_entry_cmp(const void *_entry1, const void *_entry2); static herr_t H5F__vfd_swmr_writer__create_index(H5F_t * f); static herr_t H5F_vfd_swmr_writer__prep_for_flush_or_close(H5F_t *f); @@ -4496,9 +4498,9 @@ herr_t H5F_vfd_swmr_writer__delay_write(H5F_t *f, uint64_t page, uint64_t * delay_write_until_ptr) { - int32_t top = -1; - int32_t bottom = 0; - int32_t probe; + uint32_t top = 0; + uint32_t bottom = 1; + uint32_t probe; uint64_t delay_write_until = 0; H5FD_vfd_swmr_idx_entry_t * ie_ptr = NULL; H5FD_vfd_swmr_idx_entry_t * idx = NULL; @@ -4768,10 +4770,10 @@ done: herr_t H5F_vfd_swmr_writer_end_of_tick(void) { - int32_t idx_entries_added = 0; - int32_t idx_entries_modified = 0; - int32_t idx_ent_not_in_tl = 0; - int32_t idx_ent_not_in_tl_flushed = 0; + uint32_t idx_entries_added = 0; + uint32_t idx_entries_modified = 0; + uint32_t idx_ent_not_in_tl = 0; + uint32_t idx_ent_not_in_tl_flushed = 0; H5F_t * f; herr_t ret_value = SUCCEED; /* Return value */ @@ -4960,9 +4962,9 @@ done: herr_t H5F__vfd_swmr_writer__create_index(H5F_t * f) { - int i; + unsigned int i; size_t bytes_available; - int32_t entries_in_index; + size_t entries_in_index; size_t index_size; H5FD_vfd_swmr_idx_entry_t * index = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -4984,11 +4986,11 @@ H5F__vfd_swmr_writer__create_index(H5F_t * f) HDassert(bytes_available > 0); - entries_in_index = (int32_t)(bytes_available / H5FD_MD_INDEX_ENTRY_SIZE); + entries_in_index = bytes_available / H5FD_MD_INDEX_ENTRY_SIZE; HDassert(entries_in_index > 0); - index_size = sizeof(H5FD_vfd_swmr_idx_entry_t) * (size_t)entries_in_index; + index_size = sizeof(H5FD_vfd_swmr_idx_entry_t) * entries_in_index; index = (H5FD_vfd_swmr_idx_entry_t *)HDmalloc(index_size); if ( index == NULL ) @@ -5010,8 +5012,10 @@ H5F__vfd_swmr_writer__create_index(H5F_t * f) index[i].moved_to_hdf5_file = FALSE; } + HDassert(entries_in_index <= UINT32_MAX); + f->shared->mdf_idx = index; - f->shared->mdf_idx_len = entries_in_index; + f->shared->mdf_idx_len = (uint32_t)entries_in_index; f->shared->mdf_idx_entries_used = 0; done: @@ -5021,6 +5025,7 @@ done: } /* end H5F__vfd_swmr_writer__create_index() */ +#if 0 /*------------------------------------------------------------------------- * * Function: H5F__vfd_swmr_writer__dump_index @@ -5038,9 +5043,9 @@ done: herr_t H5F__vfd_swmr_writer__dump_index(H5F_t * f) { - int i; - int32_t mdf_idx_len; - int32_t mdf_idx_entries_used; + unsigned int i; + uint32_t mdf_idx_len; + uint32_t mdf_idx_entries_used; H5FD_vfd_swmr_idx_entry_t * index = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -5073,6 +5078,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__vfd_swmr_writer__create_index() */ +#endif /*------------------------------------------------------------------------- * Function: H5F_vfd_swmr_reader_end_of_tick @@ -5120,11 +5126,11 @@ H5F_vfd_swmr_reader_end_of_tick(void) uint64_t tmp_tick_num = 0; H5F_t * f; H5FD_vfd_swmr_idx_entry_t * tmp_mdf_idx; - int32_t entries_added = 0; - int32_t entries_removed = 0; - int32_t entries_changed = 0; - int32_t tmp_mdf_idx_len; - int32_t tmp_mdf_idx_entries_used; + uint32_t entries_added = 0; + uint32_t entries_removed = 0; + uint32_t entries_changed = 0; + uint32_t tmp_mdf_idx_len; + uint32_t tmp_mdf_idx_entries_used; uint32_t mdf_idx_entries_used; herr_t ret_value = SUCCEED; /* Return value */ @@ -5201,7 +5207,7 @@ H5F_vfd_swmr_reader_end_of_tick(void) HDassert(mdf_idx_entries_used <= (uint32_t)(f->shared->mdf_idx_len)); - f->shared->mdf_idx_entries_used = (int32_t)mdf_idx_entries_used; + f->shared->mdf_idx_entries_used = mdf_idx_entries_used; #if 0 /* JRM */ HDfprintf(stderr, "--- reader EOT index used / len = %d/%d ---\n", @@ -5222,12 +5228,12 @@ H5F_vfd_swmr_reader_end_of_tick(void) while ( pass <= 1 ) { haddr_t page_addr; - int32_t i = 0; - int32_t j = 0; + uint32_t i = 0; + uint32_t j = 0; H5FD_vfd_swmr_idx_entry_t * new_mdf_idx; H5FD_vfd_swmr_idx_entry_t * old_mdf_idx; - int32_t new_mdf_idx_entries_used; - int32_t old_mdf_idx_entries_used; + uint32_t new_mdf_idx_entries_used; + uint32_t old_mdf_idx_entries_used; new_mdf_idx = f->shared->mdf_idx; new_mdf_idx_entries_used = f->shared->mdf_idx_entries_used; diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 357ac07..9fa7c29 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -417,14 +417,14 @@ struct H5F_file_t { * This field should be NULL unless * the index is defined. */ - int32_t mdf_idx_len; /* number of entries in the array + uint32_t mdf_idx_len; /* number of entries in the array * of instances of * H5FD_vfd_swmr_idx_entry_t pointed * to by mdf_idx above. Note that * not all entries in the index * need be used. */ - int32_t mdf_idx_entries_used; /* Number of entries in *mdf_idx + uint32_t mdf_idx_entries_used; /* Number of entries in *mdf_idx * that are in use -- these will * be contiguous at indicies 0 * through mdf_idx_entries_used - 1. @@ -437,8 +437,8 @@ struct H5F_file_t { * must be evicted or refreshed to avoid message from the past bugs. */ H5FD_vfd_swmr_idx_entry_t * old_mdf_idx; - int32_t old_mdf_idx_len; - int32_t old_mdf_idx_entries_used; + uint32_t old_mdf_idx_len; + uint32_t old_mdf_idx_entries_used; /* Metadata file for VFD SWMR writer */ int vfd_swmr_md_fd; /* POSIX: file descriptor for the @@ -1662,16 +1662,16 @@ done: */ herr_t H5PB_vfd_swmr__update_index(H5F_t * f, - int * idx_ent_added_ptr, - int * idx_ent_modified_ptr, - int * idx_ent_not_in_tl_ptr, - int * idx_ent_not_in_tl_flushed_ptr) + uint32_t * idx_ent_added_ptr, + uint32_t * idx_ent_modified_ptr, + uint32_t * idx_ent_not_in_tl_ptr, + uint32_t * idx_ent_not_in_tl_flushed_ptr) { - int32_t i; - int32_t idx_ent_added = 0; - int32_t idx_ent_modified = 0; - int32_t idx_ent_not_in_tl = 0; - int32_t idx_ent_not_in_tl_flushed = 0; + uint32_t i; + uint32_t idx_ent_added = 0; + uint32_t idx_ent_modified = 0; + uint32_t idx_ent_not_in_tl = 0; + uint32_t idx_ent_not_in_tl_flushed = 0; H5PB_t * pb_ptr = NULL; H5PB_entry_t *pbe_ptr = NULL; H5FD_vfd_swmr_idx_entry_t * ie_ptr = NULL; diff --git a/src/H5PBprivate.h b/src/H5PBprivate.h index d1b6510..0149a6d 100644 --- a/src/H5PBprivate.h +++ b/src/H5PBprivate.h @@ -686,9 +686,9 @@ H5_DLL herr_t H5PB_vfd_swmr__release_tick_list(H5F_t * f); H5_DLL herr_t H5PB_vfd_swmr__set_tick(H5F_t * f); -H5_DLL herr_t H5PB_vfd_swmr__update_index(H5F_t * f, int * idx_ent_added_ptr, - int * idx_ent_modified_ptr, int * idx_ent_not_in_tl_ptr, - int * idx_ent_not_in_tl_flushed_ptr); +H5_DLL herr_t H5PB_vfd_swmr__update_index(H5F_t * f, + uint32_t * idx_ent_added_ptr, uint32_t * idx_ent_modified_ptr, + uint32_t * idx_ent_not_in_tl_ptr, uint32_t * idx_ent_not_in_tl_flushed_ptr); /* Statistics routines */ |