From acdb1bf04d654e9cb440b6886a2e0eee8207e8c4 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 17 Feb 2021 17:53:57 -0500 Subject: [PATCH 1/3] Fixed all -Wsometimes-uninitialized warnings by initializing variables --- src/H5Dvirtual.c | 2 +- src/H5Obtreek.c | 2 +- src/H5Pfapl.c | 2 +- src/H5SL.c | 20 ++++++++++---------- src/H5VLnative_blob.c | 2 +- tools/src/misc/h5debug.c | 4 ++-- tools/src/misc/h5repart.c | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 89fa5eb5be7..ea423ccaf04 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -2299,7 +2299,7 @@ H5D__virtual_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id) hbool_t H5D__virtual_is_space_alloc(const H5O_storage_t H5_ATTR_UNUSED *storage) { - hbool_t ret_value; /* Return value */ + hbool_t ret_value = FALSE; /* Return value */ FUNC_ENTER_PACKAGE_NOERR diff --git a/src/H5Obtreek.c b/src/H5Obtreek.c index bf876e82f80..a107ddc411b 100644 --- a/src/H5Obtreek.c +++ b/src/H5Obtreek.c @@ -198,7 +198,7 @@ static size_t H5O__btreek_size(const H5F_t H5_ATTR_UNUSED *f, hbool_t H5_ATTR_UNUSED disable_shared, const void H5_ATTR_UNUSED *_mesg) { - size_t ret_value; + size_t ret_value = 0; FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 3872afec5e0..f240680bfe1 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -4272,7 +4272,7 @@ H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled /*out*/, char *locati size_t *location_size /*out*/, hbool_t *start_on_access /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ - char * location_ptr; /* Pointer to location string */ + char * location_ptr = NULL; /* Pointer to location string */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) diff --git a/src/H5SL.c b/src/H5SL.c index a2a424a3e64..51a1da7da94 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -746,10 +746,10 @@ H5SL__new_node(void *item, const void *key, uint32_t hashval) static H5SL_node_t * H5SL__insert_common(H5SL_t *slist, void *item, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - H5SL_node_t *prev; /* Node before the new node */ - uint32_t hashval = 0; /* Hash value for key */ - H5SL_node_t *ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + H5SL_node_t *prev; /* Node before the new node */ + uint32_t hashval = 0; /* Hash value for key */ + H5SL_node_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -1378,9 +1378,9 @@ H5SL_remove_first(H5SL_t *slist) void * H5SL_search(H5SL_t *slist, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ - void * ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + uint32_t hashval = 0; /* Hash value for key */ + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1676,9 +1676,9 @@ H5SL_greater(H5SL_t *slist, const void *key) H5SL_node_t * H5SL_find(H5SL_t *slist, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ - H5SL_node_t *ret_value; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + uint32_t hashval = 0; /* Hash value for key */ + H5SL_node_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5VLnative_blob.c b/src/H5VLnative_blob.c index aaac2b373b3..db69a3f545b 100644 --- a/src/H5VLnative_blob.c +++ b/src/H5VLnative_blob.c @@ -104,7 +104,7 @@ H5VL__native_blob_get(void *obj, const void *blob_id, void *buf, size_t size, vo H5F_t * f = (H5F_t *)obj; /* Retrieve file pointer */ const uint8_t *id = (const uint8_t *)blob_id; /* Pointer to the disk blob ID */ H5HG_t hobjid; /* Global heap ID for sequence */ - size_t hobj_size; /* Global heap object size returned from H5HG_read() */ + size_t hobj_size = 0; /* Global heap object size returned from H5HG_read() */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index 343d8e211b9..8b7bb9b8f5d 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -246,8 +246,8 @@ main(int argc, char *argv[]) haddr_t extra[10]; uint8_t sig[H5F_SIGNATURE_LEN]; size_t u; - H5E_auto2_t func; - void * edata; + H5E_auto2_t func = NULL; + void * edata = NULL; hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t status = SUCCEED; int exit_value = 0; diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index 65ceb4f0378..2298e5a274f 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -97,7 +97,7 @@ static off_t get_size(const char *progname, int *argno, int argc, char *argv[]) { off_t retval = -1; - char *suffix; + char *suffix = NULL; if (isdigit((int)(argv[*argno][2]))) { retval = HDstrtol(argv[*argno] + 2, &suffix, 10); From 1042fcd243124cf7eacc4f0c3f55f0dc7b358507 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 17 Feb 2021 18:44:03 -0500 Subject: [PATCH 2/3] Fixed all -Wconditional-uninitialized warnings by initializing variables --- src/H5B2int.c | 16 ++++++++-------- src/H5B2leaf.c | 2 +- src/H5C.c | 2 +- src/H5Dchunk.c | 2 +- src/H5Dvirtual.c | 2 +- src/H5EA.c | 2 +- src/H5FDlog.c | 14 +++++++------- src/H5FDmulti.c | 2 +- src/H5FSsection.c | 10 +++++----- src/H5HFdbg.c | 2 +- src/H5HFman.c | 6 +++--- src/H5HFsection.c | 2 +- src/H5HL.c | 4 ++-- src/H5MF.c | 26 +++++++++++++------------- src/H5Oalloc.c | 4 ++-- src/H5PB.c | 4 ++-- src/H5Pdapl.c | 4 ++-- src/H5Pdcpl.c | 2 +- src/H5Shyper.c | 16 ++++++++-------- src/H5system.c | 2 +- src/H5timer.c | 8 ++++---- src/H5trace.c | 2 +- tools/lib/h5tools.c | 2 +- tools/src/h5ls/h5ls.c | 2 +- 24 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/H5B2int.c b/src/H5B2int.c index 6d704a0dbd3..0cc04293061 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -139,7 +139,7 @@ H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */ uint16_t * left_nrec, *right_nrec; /* Pointers to child # of records */ uint8_t * left_native, *right_native; /* Pointers to childs' native records */ @@ -424,7 +424,7 @@ herr_t H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */ uint16_t * left_nrec, *right_nrec; /* Pointers to child # of records */ uint8_t * left_native, *right_native; /* Pointers to childs' native records */ @@ -699,8 +699,8 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ H5B2_node_ptr_t * middle_node_ptrs = NULL; /* Pointers to childs' node pointer info */ const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ - haddr_t middle_addr; /* Address of middle child node */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ + haddr_t middle_addr = HADDR_UNDEF; /* Address of middle child node */ void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */ void * middle_child = NULL; /* Pointers to middle child node */ uint16_t * left_nrec, *right_nrec; /* Pointers to child # of records */ @@ -1123,7 +1123,7 @@ H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */ uint16_t * left_nrec, *right_nrec; /* Pointers to left & right child # of records */ uint8_t * left_native, *right_native; /* Pointers to left & right children's native records */ @@ -1298,8 +1298,8 @@ H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr, right_addr; /* Addresses of left & right child nodes */ - haddr_t middle_addr; /* Address of middle child node */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ + haddr_t middle_addr = HADDR_UNDEF; /* Address of middle child node */ void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */ void * middle_child = NULL; /* Pointer to middle child node */ uint16_t * left_nrec, *right_nrec; /* Pointers to left & right child # of records */ @@ -1933,7 +1933,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t /* If the node is in the cache, check for retargeting its parent */ if (node_status & H5AC_ES__IN_CACHE) { - void ** parent_ptr; /* Pointer to child node's parent */ + void ** parent_ptr = NULL; /* Pointer to child node's parent */ hbool_t update_deps = FALSE; /* Whether to update flush dependencies */ /* Get child node pointer */ diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index 99174311e21..640f63aabe9 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -608,7 +608,7 @@ H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsi unsigned idx, void *swap_loc) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t child_addr; /* Address of child node */ + haddr_t child_addr = HADDR_UNDEF; /* Address of child node */ void * child = NULL; /* Pointer to child node */ uint8_t * child_native; /* Pointer to child's native records */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5C.c b/src/H5C.c index bedf68c28db..2bff91b7138 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -2229,7 +2229,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign #ifdef H5_HAVE_PARALLEL hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ #endif /* H5_HAVE_PARALLEL */ - hbool_t write_permitted; + hbool_t write_permitted = FALSE; hbool_t was_loaded = FALSE; /* Whether the entry was loaded as a result of the protect */ size_t empty_space; void * thing; diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 4c9dffa09ba..2d18e104ce3 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -3153,7 +3153,7 @@ H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udat { H5D_rdcc_ent_t * ent = NULL; /* Cache entry */ H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); - unsigned idx; /* Index of chunk in cache, if present */ + unsigned idx = 0; /* Index of chunk in cache, if present */ hbool_t found = FALSE; /* In cache? */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index ea423ccaf04..18f6c2d1f99 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -2383,7 +2383,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, H5O_storage_virtual_t *storage, cons hssize_t select_nelmts; /* Number of elements in selection */ hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounds start */ hsize_t bounds_end[H5S_MAX_RANK]; /* Selection bounds end */ - int rank; + int rank = 0; hbool_t bounds_init = FALSE; /* Whether bounds_start, bounds_end, and rank are valid */ size_t i, j, k; /* Local index variables */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5EA.c b/src/H5EA.c index f601e28da91..5932dd88fad 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -722,7 +722,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_get(const H5EA_t *ea, hsize_t /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ void *thing = NULL; /* Pointer to the array metadata containing the array index we are interested in */ - H5EA__unprotect_func_t thing_unprot_func; /* Function pointer for unprotecting the array metadata */ + H5EA__unprotect_func_t thing_unprot_func = NULL; /* Function pointer for unprotecting the array metadata */ /* * Check arguments. diff --git a/src/H5FDlog.c b/src/H5FDlog.c index fc2cb12c0b5..768c410ac23 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -484,8 +484,8 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) #ifdef H5_HAVE_WIN32_API struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif - H5_timer_t open_timer; /* Timer for open() call */ - H5_timer_t stat_timer; /* Timer for stat() call */ + H5_timer_t open_timer = {{0}, {0}, {0}, FALSE}; /* Timer for open() call */ + H5_timer_t stat_timer = {{0}, {0}, {0}, FALSE}; /* Timer for stat() call */ h5_stat_t sb; H5FD_t * ret_value = NULL; /* Return value */ @@ -678,7 +678,7 @@ static herr_t H5FD__log_close(H5FD_t *_file) { H5FD_log_t *file = (H5FD_log_t *)_file; - H5_timer_t close_timer; /* Timer for close() call */ + H5_timer_t close_timer = {{0}, {0}, {0}, FALSE}; /* Timer for close() call */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1177,7 +1177,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had H5FD_log_t * file = (H5FD_log_t *)_file; size_t orig_size = size; /* Save the original size for later */ haddr_t orig_addr = addr; - H5_timer_t read_timer; /* Timer for read operation */ + H5_timer_t read_timer = {{0}, {0}, {0}, FALSE}; /* Timer for read operation */ H5_timevals_t read_times; /* Elapsed time for read operation */ #ifndef H5_HAVE_PREADWRITE H5_timer_t seek_timer; /* Timer for seek operation */ @@ -1391,7 +1391,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha H5FD_log_t * file = (H5FD_log_t *)_file; size_t orig_size = size; /* Save the original size for later */ haddr_t orig_addr = addr; - H5_timer_t write_timer; /* Timer for write operation */ + H5_timer_t write_timer = {{0}, {0}, {0}, FALSE}; /* Timer for write operation */ H5_timevals_t write_times; /* Elapsed time for write operation */ #ifndef H5_HAVE_PREADWRITE H5_timer_t seek_timer; /* Timer for seek operation */ @@ -1612,8 +1612,8 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ /* Extend the file to make sure it's large enough */ if (!H5F_addr_eq(file->eoa, file->eof)) { - H5_timer_t trunc_timer; /* Timer for truncate operation */ - H5_timevals_t trunc_times; /* Elapsed time for truncate operation */ + H5_timer_t trunc_timer = {{0}, {0}, {0}, FALSE}; /* Timer for truncate operation */ + H5_timevals_t trunc_times; /* Elapsed time for truncate operation */ /* Start timer for truncate operation */ if (file->fa.flags & H5FD_LOG_TIME_TRUNCATE) { diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index d60ddadd76a..c9643863fc4 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -1822,7 +1822,7 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw) { H5FD_multi_t * file = (H5FD_multi_t *)_file; int nerrors = 0; - H5FD_mem_t out_mt; + H5FD_mem_t out_mt = H5FD_MEM_DEFAULT; static const char *func = "H5FD_multi_unlock"; /* Function Name for error reporting */ /* Clear the error stack */ diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 565a7099b83..93c59f44c33 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -1154,11 +1154,11 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) /* Loop until no more merging */ if (fspace->sinfo->merge_list) { do { - H5SL_node_t * less_sect_node; /* Skip list node for section less than new section */ - H5SL_node_t * greater_sect_node; /* Skip list node for section greater than new section */ - H5FS_section_info_t * tmp_sect; /* Temporary free space section */ - H5FS_section_class_t *tmp_sect_cls; /* Temporary section's class */ - hbool_t greater_sect_node_valid = FALSE; /* Indicate if 'greater than' section node is valid */ + H5SL_node_t * less_sect_node; /* Skip list node for section less than new section */ + H5SL_node_t * greater_sect_node = NULL; /* Skip list node for section greater than new section */ + H5FS_section_info_t * tmp_sect; /* Temporary free space section */ + H5FS_section_class_t *tmp_sect_cls; /* Temporary section's class */ + hbool_t greater_sect_node_valid = FALSE; /* Indicate if 'greater than' section node is valid */ /* Reset 'modification occurred' flag */ modified = FALSE; diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 9d1adb14951..47460463435 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -692,7 +692,7 @@ H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, { H5HF_hdr_t * hdr = NULL; /* Fractal heap header info */ H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5HFman.c b/src/H5HFman.c index 54f80ffe68a..51575bc5473 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -297,9 +297,9 @@ H5HF__man_op_real(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void * * H5AC__NO_FLAGS_SET or * H5AC__READ_ONLY_FLAG */ - haddr_t dblock_addr; /* Direct block address */ + haddr_t dblock_addr = HADDR_UNDEF; /* Direct block address */ size_t dblock_size; /* Direct block size */ - unsigned dblock_cache_flags; /* Flags for unprotecting direct block */ + unsigned dblock_cache_flags = 0; /* Flags for unprotecting direct block */ hsize_t obj_off; /* Object's offset in heap */ size_t obj_len; /* Object's length in heap */ size_t blk_off; /* Offset of object in block */ @@ -547,7 +547,7 @@ H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) { H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section for block */ H5HF_indirect_t * iblock = NULL; /* Pointer to indirect block */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ hsize_t obj_off; /* Object's offset in heap */ size_t obj_len; /* Object's length in heap */ size_t dblock_size; /* Direct block size */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index a91b34bc561..47926f4c9e1 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -2475,7 +2475,7 @@ H5HF__sect_indirect_init_rows(H5HF_hdr_t *hdr, H5HF_free_section_t *sect, hbool_ /* Add an indirect section for each indirect block in the row */ for (v = 0; v < row_entries; v++) { - hbool_t did_protect; /* Whether we protected the indirect block or not */ + hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ /* Try to get the child section's indirect block, if it's available */ if (sect->sect_info.state == H5FS_SECT_LIVE) { diff --git a/src/H5HL.c b/src/H5HL.c index 4186d2a4d8b..bf3203bdd30 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -930,7 +930,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_get_size(H5F_t *f, haddr_t add H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t * prfx = NULL; /* Local heap prefix */ - H5HL_t * heap; /* Heap data structure */ + H5HL_t * heap = NULL; /* Heap data structure */ /* check arguments */ HDassert(f); @@ -977,7 +977,7 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5HL_heapsize(H5F_t *f, haddr_t add H5HL_cache_prfx_ud_t prfx_udata; /* User data for protecting local heap prefix */ H5HL_prfx_t * prfx = NULL; /* Local heap prefix */ - H5HL_t * heap; /* Heap data structure */ + H5HL_t * heap = NULL; /* Heap data structure */ /* check arguments */ HDassert(f); diff --git a/src/H5MF.c b/src/H5MF.c index 2fe78a336a6..0ba2246f8a6 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -3081,19 +3081,19 @@ H5MF_settle_raw_data_fsm(H5F_t *f, hbool_t *fsm_settled) herr_t H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) { - H5F_mem_page_t sm_fshdr_fs_type; /* small fs hdr fsm */ - H5F_mem_page_t sm_fssinfo_fs_type; /* small fs sinfo fsm */ - H5F_mem_page_t lg_fshdr_fs_type; /* large fs hdr fsm */ - H5F_mem_page_t lg_fssinfo_fs_type; /* large fs sinfo fsm */ - H5FS_t * sm_hdr_fspace = NULL; /* ptr to sm FSM hdr alloc FSM */ - H5FS_t * sm_sinfo_fspace = NULL; /* ptr to sm FSM sinfo alloc FSM */ - H5FS_t * lg_hdr_fspace = NULL; /* ptr to lg FSM hdr alloc FSM */ - H5FS_t * lg_sinfo_fspace = NULL; /* ptr to lg FSM sinfo alloc FSM */ - haddr_t eoa_fsm_fsalloc; /* eoa after file space allocation */ - /* for self referential FSMs */ - hbool_t continue_alloc_fsm = FALSE; /* Continue allocating addr and sect_addr for FSMs */ - H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - herr_t ret_value = SUCCEED; /* Return value */ + H5F_mem_page_t sm_fshdr_fs_type; /* small fs hdr fsm */ + H5F_mem_page_t sm_fssinfo_fs_type; /* small fs sinfo fsm */ + H5F_mem_page_t lg_fshdr_fs_type = H5F_MEM_PAGE_DEFAULT; /* large fs hdr fsm */ + H5F_mem_page_t lg_fssinfo_fs_type = H5F_MEM_PAGE_DEFAULT; /* large fs sinfo fsm */ + H5FS_t * sm_hdr_fspace = NULL; /* ptr to sm FSM hdr alloc FSM */ + H5FS_t * sm_sinfo_fspace = NULL; /* ptr to sm FSM sinfo alloc FSM */ + H5FS_t * lg_hdr_fspace = NULL; /* ptr to lg FSM hdr alloc FSM */ + H5FS_t * lg_sinfo_fspace = NULL; /* ptr to lg FSM sinfo alloc FSM */ + haddr_t eoa_fsm_fsalloc; /* eoa after file space allocation */ + /* for self referential FSMs */ + hbool_t continue_alloc_fsm = FALSE; /* Continue allocating addr and sect_addr for FSMs */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index b8567eea40d..0c53b7dadd2 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -2005,8 +2005,8 @@ H5O__merge_null(H5F_t *f, H5O_t *oh) for (v = 0, curr_msg2 = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg2++) { if (u != v && H5O_NULL_ID == curr_msg2->type->id && curr_msg->chunkno == curr_msg2->chunkno) { - ssize_t adj_raw; /* Amount to adjust raw message pointer */ - size_t adj_raw_size; /* Amount to adjust raw message size */ + ssize_t adj_raw = 0; /* Amount to adjust raw message pointer */ + size_t adj_raw_size = 0; /* Amount to adjust raw message size */ /* Check for second message after first message */ if ((curr_msg->raw + curr_msg->raw_size) == diff --git a/src/H5PB.c b/src/H5PB.c index 47deafc59dc..2508b9b11e7 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -682,7 +682,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * haddr_t offset; haddr_t search_addr; /* Address of current page */ hsize_t num_touched_pages; /* Number of pages accessed */ - size_t access_size; + size_t access_size = 0; hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */ hsize_t i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -983,7 +983,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const haddr_t offset; haddr_t search_addr; /* Address of current page */ hsize_t num_touched_pages; /* Number of pages accessed */ - size_t access_size; + size_t access_size = 0; hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */ hsize_t i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 6d012fe6495..6e273ed755f 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -866,7 +866,7 @@ H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots /*out*/, size_t *rdcc_nbyt static herr_t H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) { - uint64_t enc_value; /* Property value to encode */ + uint64_t enc_value = 0; /* Property value to encode */ uint8_t **pp = (uint8_t **)_pp; unsigned enc_size; /* Size of encoded property */ @@ -966,7 +966,7 @@ H5P__decode_chunk_cache_nslots(const void **_pp, void *_value) static herr_t H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) { - uint64_t enc_value; /* Property value to encode */ + uint64_t enc_value = 0; /* Property value to encode */ uint8_t **pp = (uint8_t **)_pp; unsigned enc_size; /* Size of encoded property */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 523553b63d3..985a3d31df3 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -2215,7 +2215,7 @@ herr_t H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, const char *src_dset_name, hid_t src_space_id) { - H5P_genplist_t * plist; /* Property list pointer */ + H5P_genplist_t * plist = NULL; /* Property list pointer */ H5O_layout_t virtual_layout; /* Layout information for setting virtual info */ H5S_t * vspace; /* Virtual dataset space selection */ H5S_t * src_space; /* Source dataset space selection */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 28683474d22..b66eec6097a 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1104,10 +1104,10 @@ H5S__hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem) } /* end if */ /* Must be an irregular hyperslab selection */ else { - H5S_hyper_span_t * curr_span; /* Current hyperslab span node */ - H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */ - hsize_t * abs_arr; /* Absolute hyperslab span position */ - int curr_dim; /* Temporary rank holder */ + H5S_hyper_span_t * curr_span = NULL; /* Current hyperslab span node */ + H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */ + hsize_t * abs_arr; /* Absolute hyperslab span position */ + int curr_dim; /* Temporary rank holder */ /* Set the rank of the fastest changing dimension */ ndims = iter->rank; @@ -1296,10 +1296,10 @@ H5S__hyper_iter_next_block(H5S_sel_iter_t *iter) } /* end if */ /* Must be an irregular hyperslab selection */ else { - H5S_hyper_span_t * curr_span; /* Current hyperslab span node */ - H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */ - hsize_t * abs_arr; /* Absolute hyperslab span position */ - int curr_dim; /* Temporary rank holder */ + H5S_hyper_span_t * curr_span = NULL; /* Current hyperslab span node */ + H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */ + hsize_t * abs_arr; /* Absolute hyperslab span position */ + int curr_dim; /* Temporary rank holder */ /* Set the rank of the fastest changing dimension */ ndims = iter->rank; diff --git a/src/H5system.c b/src/H5system.c index 4026752039a..0ffebc03163 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -986,7 +986,7 @@ H5_build_extpath(const char *name, char **extpath /*out*/) herr_t H5_combine_path(const char *path1, const char *path2, char **full_name /*out*/) { - size_t path1_len; /* length of path1 */ + size_t path1_len = 0; /* length of path1 */ size_t path2_len; /* length of path2 */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5timer.c b/src/H5timer.c index b53c3025304..c0045c3cf83 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -583,10 +583,10 @@ H5_timer_get_time_string(double seconds) char *s; /* output string */ /* Used when the time is greater than 59 seconds */ - double days; - double hours; - double minutes; - double remainder_sec; + double days = 0.0; + double hours = 0.0; + double minutes = 0.0; + double remainder_sec = 0.0; /* Extract larger time units from count of seconds */ if (seconds > (double)60.0F) { diff --git a/src/H5trace.c b/src/H5trace.c index 911aac3d67f..81e7187b016 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -3883,7 +3883,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) hssize_t i; FILE * out = H5_debug_g.trace; static hbool_t is_first_invocation = TRUE; - H5_timer_t function_timer; + H5_timer_t function_timer = {{0}, {0}, {0}, FALSE}; H5_timevals_t function_times; static H5_timer_t running_timer; H5_timevals_t running_times; diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 921abb7c6e1..1f4bafefce0 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1778,7 +1778,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t } break; case H5T_ARRAY: { int k, ndims; - hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts; + hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts = 0; hid_t memb = H5I_INVALID_HID; H5TOOLS_DEBUG("H5T_ARRAY"); diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index eacb7509ed0..a699487638c 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -2648,7 +2648,7 @@ int main(int argc, const char *argv[]) { hid_t file_id = H5I_INVALID_HID; - char * fname = NULL, *oname = NULL, *x; + char * fname = NULL, *oname = NULL, *x = NULL; const char * s = NULL; char * rest; int argno; From d171e1122853fffed69ddfcf4212044181103dd6 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Fri, 19 Feb 2021 10:52:27 -0600 Subject: [PATCH 3/3] Commit alignment changes from running bin/format_source with clang version 10.0.1. --- src/H5B2int.c | 108 +++++++++++++++++++-------------------- src/H5B2leaf.c | 10 ++-- src/H5C.c | 2 +- src/H5Dchunk.c | 4 +- src/H5Dvirtual.c | 2 +- src/H5EA.c | 3 +- src/H5FDlog.c | 24 ++++----- src/H5FDmulti.c | 4 +- src/H5FSsection.c | 10 ++-- src/H5HFdbg.c | 8 +-- src/H5HFman.c | 4 +- src/H5MF.c | 16 +++--- src/H5Oalloc.c | 2 +- src/H5PB.c | 4 +- src/H5Pdapl.c | 4 +- src/H5Pfapl.c | 6 +-- src/H5SL.c | 12 ++--- src/H5timer.c | 6 +-- src/H5trace.c | 2 +- tools/src/misc/h5debug.c | 4 +- 20 files changed, 118 insertions(+), 117 deletions(-) diff --git a/src/H5B2int.c b/src/H5B2int.c index 0cc04293061..8f98ba9eda3 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -138,15 +138,15 @@ H5B2__split1(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { - const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ - void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */ - uint16_t * left_nrec, *right_nrec; /* Pointers to child # of records */ - uint8_t * left_native, *right_native; /* Pointers to childs' native records */ - H5B2_node_ptr_t * left_node_ptrs = NULL, - *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ - uint16_t mid_record; /* Index of "middle" record in current node */ - uint16_t old_node_nrec; /* Number of records in internal node split */ + const H5AC_class_t *child_class; /* Pointer to child node's class info */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ + void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */ + uint16_t *left_nrec, *right_nrec; /* Pointers to child # of records */ + uint8_t * left_native, *right_native; /* Pointers to childs' native records */ + H5B2_node_ptr_t *left_node_ptrs = NULL, + *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ + uint16_t mid_record; /* Index of "middle" record in current node */ + uint16_t old_node_nrec; /* Number of records in internal node split */ unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ @@ -423,13 +423,13 @@ H5B2__split_root(H5B2_hdr_t *hdr) herr_t H5B2__redistribute2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned idx) { - const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ - void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */ - uint16_t * left_nrec, *right_nrec; /* Pointers to child # of records */ - uint8_t * left_native, *right_native; /* Pointers to childs' native records */ - H5B2_node_ptr_t * left_node_ptrs = NULL, - *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ + const H5AC_class_t *child_class; /* Pointer to child node's class info */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ + void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */ + uint16_t *left_nrec, *right_nrec; /* Pointers to child # of records */ + uint8_t * left_native, *right_native; /* Pointers to childs' native records */ + H5B2_node_ptr_t *left_node_ptrs = NULL, + *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ hssize_t left_moved_nrec = 0, right_moved_nrec = 0; /* Number of records moved, for internal redistrib */ unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ @@ -696,20 +696,20 @@ H5B2__redistribute3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned idx) { H5B2_node_ptr_t *left_node_ptrs = NULL, - *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ - H5B2_node_ptr_t * middle_node_ptrs = NULL; /* Pointers to childs' node pointer info */ - const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ - haddr_t middle_addr = HADDR_UNDEF; /* Address of middle child node */ - void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */ - void * middle_child = NULL; /* Pointers to middle child node */ - uint16_t * left_nrec, *right_nrec; /* Pointers to child # of records */ - uint16_t * middle_nrec; /* Pointers to middle child # of records */ - uint8_t * left_native, *right_native; /* Pointers to childs' native records */ - uint8_t * middle_native; /* Pointers to middle child's native records */ - hssize_t left_moved_nrec = 0, right_moved_nrec = 0; /* Number of records moved, for internal split */ - hssize_t middle_moved_nrec = 0; /* Number of records moved, for internal split */ - unsigned left_child_flags = H5AC__NO_FLAGS_SET, + *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ + H5B2_node_ptr_t * middle_node_ptrs = NULL; /* Pointers to childs' node pointer info */ + const H5AC_class_t *child_class; /* Pointer to child node's class info */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ + haddr_t middle_addr = HADDR_UNDEF; /* Address of middle child node */ + void * left_child = NULL, *right_child = NULL; /* Pointers to child nodes */ + void * middle_child = NULL; /* Pointers to middle child node */ + uint16_t *left_nrec, *right_nrec; /* Pointers to child # of records */ + uint16_t *middle_nrec; /* Pointers to middle child # of records */ + uint8_t * left_native, *right_native; /* Pointers to childs' native records */ + uint8_t * middle_native; /* Pointers to middle child's native records */ + hssize_t left_moved_nrec = 0, right_moved_nrec = 0; /* Number of records moved, for internal split */ + hssize_t middle_moved_nrec = 0; /* Number of records moved, for internal split */ + unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ unsigned middle_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1122,16 +1122,16 @@ H5B2__merge2(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { - const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ - void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */ - uint16_t * left_nrec, *right_nrec; /* Pointers to left & right child # of records */ - uint8_t * left_native, *right_native; /* Pointers to left & right children's native records */ - H5B2_node_ptr_t * left_node_ptrs = NULL, - *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ - unsigned left_child_flags = H5AC__NO_FLAGS_SET, - right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5AC_class_t *child_class; /* Pointer to child node's class info */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ + void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */ + uint16_t *left_nrec, *right_nrec; /* Pointers to left & right child # of records */ + uint8_t * left_native, *right_native; /* Pointers to left & right children's native records */ + H5B2_node_ptr_t *left_node_ptrs = NULL, + *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ + unsigned left_child_flags = H5AC__NO_FLAGS_SET, + right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -1297,19 +1297,19 @@ H5B2__merge3(H5B2_hdr_t *hdr, uint16_t depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { - const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ - haddr_t middle_addr = HADDR_UNDEF; /* Address of middle child node */ - void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */ - void * middle_child = NULL; /* Pointer to middle child node */ - uint16_t * left_nrec, *right_nrec; /* Pointers to left & right child # of records */ - uint16_t * middle_nrec; /* Pointer to middle child # of records */ - uint8_t * left_native, *right_native; /* Pointers to left & right children's native records */ - uint8_t * middle_native; /* Pointer to middle child's native records */ - H5B2_node_ptr_t * left_node_ptrs = NULL, - *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ - H5B2_node_ptr_t *middle_node_ptrs = NULL; /* Pointer to child's node pointer info */ - hsize_t middle_moved_nrec; /* Number of records moved, for internal split */ + const H5AC_class_t *child_class; /* Pointer to child node's class info */ + haddr_t left_addr = HADDR_UNDEF, right_addr = HADDR_UNDEF; /* Addresses of left & right child nodes */ + haddr_t middle_addr = HADDR_UNDEF; /* Address of middle child node */ + void * left_child = NULL, *right_child = NULL; /* Pointers to left & right child nodes */ + void * middle_child = NULL; /* Pointer to middle child node */ + uint16_t *left_nrec, *right_nrec; /* Pointers to left & right child # of records */ + uint16_t *middle_nrec; /* Pointer to middle child # of records */ + uint8_t * left_native, *right_native; /* Pointers to left & right children's native records */ + uint8_t * middle_native; /* Pointer to middle child's native records */ + H5B2_node_ptr_t *left_node_ptrs = NULL, + *right_node_ptrs = NULL; /* Pointers to childs' node pointer info */ + H5B2_node_ptr_t *middle_node_ptrs = NULL; /* Pointer to child's node pointer info */ + hsize_t middle_moved_nrec; /* Number of records moved, for internal split */ unsigned left_child_flags = H5AC__NO_FLAGS_SET, right_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ unsigned middle_child_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting child nodes */ @@ -1933,7 +1933,7 @@ H5B2__update_flush_depend(H5B2_hdr_t *hdr, unsigned depth, const H5B2_node_ptr_t /* If the node is in the cache, check for retargeting its parent */ if (node_status & H5AC_ES__IN_CACHE) { - void ** parent_ptr = NULL; /* Pointer to child node's parent */ + void ** parent_ptr = NULL; /* Pointer to child node's parent */ hbool_t update_deps = FALSE; /* Whether to update flush dependencies */ /* Get child node pointer */ diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index 640f63aabe9..393e08d8f13 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -607,11 +607,11 @@ herr_t H5B2__swap_leaf(H5B2_hdr_t *hdr, uint16_t depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc) { - const H5AC_class_t *child_class; /* Pointer to child node's class info */ - haddr_t child_addr = HADDR_UNDEF; /* Address of child node */ - void * child = NULL; /* Pointer to child node */ - uint8_t * child_native; /* Pointer to child's native records */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5AC_class_t *child_class; /* Pointer to child node's class info */ + haddr_t child_addr = HADDR_UNDEF; /* Address of child node */ + void * child = NULL; /* Pointer to child node */ + uint8_t * child_native; /* Pointer to child's native records */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5C.c b/src/H5C.c index 2bff91b7138..eaea7c49148 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -2230,7 +2230,7 @@ H5C_protect(H5F_t *f, const H5C_class_t *type, haddr_t addr, void *udata, unsign hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ #endif /* H5_HAVE_PARALLEL */ hbool_t write_permitted = FALSE; - hbool_t was_loaded = FALSE; /* Whether the entry was loaded as a result of the protect */ + hbool_t was_loaded = FALSE; /* Whether the entry was loaded as a result of the protect */ size_t empty_space; void * thing; H5C_cache_entry_t *entry_ptr; diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 2d18e104ce3..71013ab10f7 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -3151,8 +3151,8 @@ H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled) herr_t H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udata) { - H5D_rdcc_ent_t * ent = NULL; /* Cache entry */ - H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); + H5D_rdcc_ent_t * ent = NULL; /* Cache entry */ + H5O_storage_chunk_t *sc = &(dset->shared->layout.storage.u.chunk); unsigned idx = 0; /* Index of chunk in cache, if present */ hbool_t found = FALSE; /* In cache? */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 18f6c2d1f99..18fbf14d5d1 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -2383,7 +2383,7 @@ H5D__virtual_pre_io(H5D_io_info_t *io_info, H5O_storage_virtual_t *storage, cons hssize_t select_nelmts; /* Number of elements in selection */ hsize_t bounds_start[H5S_MAX_RANK]; /* Selection bounds start */ hsize_t bounds_end[H5S_MAX_RANK]; /* Selection bounds end */ - int rank = 0; + int rank = 0; hbool_t bounds_init = FALSE; /* Whether bounds_start, bounds_end, and rank are valid */ size_t i, j, k; /* Local index variables */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5EA.c b/src/H5EA.c index 5932dd88fad..c45944ef96f 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -722,7 +722,8 @@ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, H5EA_get(const H5EA_t *ea, hsize_t /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ void *thing = NULL; /* Pointer to the array metadata containing the array index we are interested in */ - H5EA__unprotect_func_t thing_unprot_func = NULL; /* Function pointer for unprotecting the array metadata */ + H5EA__unprotect_func_t thing_unprot_func = + NULL; /* Function pointer for unprotecting the array metadata */ /* * Check arguments. diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 768c410ac23..25aee06f08d 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -677,9 +677,9 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) static herr_t H5FD__log_close(H5FD_t *_file) { - H5FD_log_t *file = (H5FD_log_t *)_file; - H5_timer_t close_timer = {{0}, {0}, {0}, FALSE}; /* Timer for close() call */ - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_log_t *file = (H5FD_log_t *)_file; + H5_timer_t close_timer = {{0}, {0}, {0}, FALSE}; /* Timer for close() call */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1174,11 +1174,11 @@ static herr_t H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, void *buf /*out*/) { - H5FD_log_t * file = (H5FD_log_t *)_file; - size_t orig_size = size; /* Save the original size for later */ - haddr_t orig_addr = addr; + H5FD_log_t * file = (H5FD_log_t *)_file; + size_t orig_size = size; /* Save the original size for later */ + haddr_t orig_addr = addr; H5_timer_t read_timer = {{0}, {0}, {0}, FALSE}; /* Timer for read operation */ - H5_timevals_t read_times; /* Elapsed time for read operation */ + H5_timevals_t read_times; /* Elapsed time for read operation */ #ifndef H5_HAVE_PREADWRITE H5_timer_t seek_timer; /* Timer for seek operation */ H5_timevals_t seek_times; /* Elapsed time for seek operation */ @@ -1388,11 +1388,11 @@ static herr_t H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { - H5FD_log_t * file = (H5FD_log_t *)_file; - size_t orig_size = size; /* Save the original size for later */ - haddr_t orig_addr = addr; + H5FD_log_t * file = (H5FD_log_t *)_file; + size_t orig_size = size; /* Save the original size for later */ + haddr_t orig_addr = addr; H5_timer_t write_timer = {{0}, {0}, {0}, FALSE}; /* Timer for write operation */ - H5_timevals_t write_times; /* Elapsed time for write operation */ + H5_timevals_t write_times; /* Elapsed time for write operation */ #ifndef H5_HAVE_PREADWRITE H5_timer_t seek_timer; /* Timer for seek operation */ H5_timevals_t seek_times; /* Elapsed time for seek operation */ @@ -1613,7 +1613,7 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ /* Extend the file to make sure it's large enough */ if (!H5F_addr_eq(file->eoa, file->eof)) { H5_timer_t trunc_timer = {{0}, {0}, {0}, FALSE}; /* Timer for truncate operation */ - H5_timevals_t trunc_times; /* Elapsed time for truncate operation */ + H5_timevals_t trunc_times; /* Elapsed time for truncate operation */ /* Start timer for truncate operation */ if (file->fa.flags & H5FD_LOG_TIME_TRUNCATE) { diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index c9643863fc4..65a767c1d5c 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -1822,8 +1822,8 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw) { H5FD_multi_t * file = (H5FD_multi_t *)_file; int nerrors = 0; - H5FD_mem_t out_mt = H5FD_MEM_DEFAULT; - static const char *func = "H5FD_multi_unlock"; /* Function Name for error reporting */ + H5FD_mem_t out_mt = H5FD_MEM_DEFAULT; + static const char *func = "H5FD_multi_unlock"; /* Function Name for error reporting */ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 93c59f44c33..9b369305471 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -1154,11 +1154,11 @@ H5FS__sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) /* Loop until no more merging */ if (fspace->sinfo->merge_list) { do { - H5SL_node_t * less_sect_node; /* Skip list node for section less than new section */ - H5SL_node_t * greater_sect_node = NULL; /* Skip list node for section greater than new section */ - H5FS_section_info_t * tmp_sect; /* Temporary free space section */ - H5FS_section_class_t *tmp_sect_cls; /* Temporary section's class */ - hbool_t greater_sect_node_valid = FALSE; /* Indicate if 'greater than' section node is valid */ + H5SL_node_t *less_sect_node; /* Skip list node for section less than new section */ + H5SL_node_t *greater_sect_node = NULL; /* Skip list node for section greater than new section */ + H5FS_section_info_t * tmp_sect; /* Temporary free space section */ + H5FS_section_class_t *tmp_sect_cls; /* Temporary section's class */ + hbool_t greater_sect_node_valid = FALSE; /* Indicate if 'greater than' section node is valid */ /* Reset 'modification occurred' flag */ modified = FALSE; diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 47460463435..909a467ad68 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -690,10 +690,10 @@ herr_t H5HF_iblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows) { - H5HF_hdr_t * hdr = NULL; /* Fractal heap header info */ - H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */ - hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HF_hdr_t * hdr = NULL; /* Fractal heap header info */ + H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */ + hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5HFman.c b/src/H5HFman.c index 51575bc5473..123906d0746 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -545,8 +545,8 @@ H5HF__man_op(H5HF_hdr_t *hdr, const uint8_t *id, H5HF_operator_t op, void *op_da herr_t H5HF__man_remove(H5HF_hdr_t *hdr, const uint8_t *id) { - H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section for block */ - H5HF_indirect_t * iblock = NULL; /* Pointer to indirect block */ + H5HF_free_section_t *sec_node = NULL; /* Pointer to free space section for block */ + H5HF_indirect_t * iblock = NULL; /* Pointer to indirect block */ hbool_t did_protect = FALSE; /* Whether we protected the indirect block or not */ hsize_t obj_off; /* Object's offset in heap */ size_t obj_len; /* Object's length in heap */ diff --git a/src/H5MF.c b/src/H5MF.c index 0ba2246f8a6..2712ec12b5b 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -3083,17 +3083,17 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled) { H5F_mem_page_t sm_fshdr_fs_type; /* small fs hdr fsm */ H5F_mem_page_t sm_fssinfo_fs_type; /* small fs sinfo fsm */ - H5F_mem_page_t lg_fshdr_fs_type = H5F_MEM_PAGE_DEFAULT; /* large fs hdr fsm */ + H5F_mem_page_t lg_fshdr_fs_type = H5F_MEM_PAGE_DEFAULT; /* large fs hdr fsm */ H5F_mem_page_t lg_fssinfo_fs_type = H5F_MEM_PAGE_DEFAULT; /* large fs sinfo fsm */ - H5FS_t * sm_hdr_fspace = NULL; /* ptr to sm FSM hdr alloc FSM */ - H5FS_t * sm_sinfo_fspace = NULL; /* ptr to sm FSM sinfo alloc FSM */ - H5FS_t * lg_hdr_fspace = NULL; /* ptr to lg FSM hdr alloc FSM */ - H5FS_t * lg_sinfo_fspace = NULL; /* ptr to lg FSM sinfo alloc FSM */ + H5FS_t * sm_hdr_fspace = NULL; /* ptr to sm FSM hdr alloc FSM */ + H5FS_t * sm_sinfo_fspace = NULL; /* ptr to sm FSM sinfo alloc FSM */ + H5FS_t * lg_hdr_fspace = NULL; /* ptr to lg FSM hdr alloc FSM */ + H5FS_t * lg_sinfo_fspace = NULL; /* ptr to lg FSM sinfo alloc FSM */ haddr_t eoa_fsm_fsalloc; /* eoa after file space allocation */ /* for self referential FSMs */ - hbool_t continue_alloc_fsm = FALSE; /* Continue allocating addr and sect_addr for FSMs */ - H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t continue_alloc_fsm = FALSE; /* Continue allocating addr and sect_addr for FSMs */ + H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_TAG(H5AC__FREESPACE_TAG, FAIL) diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 0c53b7dadd2..c0a898fd7a4 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -2005,7 +2005,7 @@ H5O__merge_null(H5F_t *f, H5O_t *oh) for (v = 0, curr_msg2 = &oh->mesg[0]; v < oh->nmesgs; v++, curr_msg2++) { if (u != v && H5O_NULL_ID == curr_msg2->type->id && curr_msg->chunkno == curr_msg2->chunkno) { - ssize_t adj_raw = 0; /* Amount to adjust raw message pointer */ + ssize_t adj_raw = 0; /* Amount to adjust raw message pointer */ size_t adj_raw_size = 0; /* Amount to adjust raw message size */ /* Check for second message after first message */ diff --git a/src/H5PB.c b/src/H5PB.c index 2508b9b11e7..323636520a4 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -683,7 +683,7 @@ H5PB_read(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, void * haddr_t search_addr; /* Address of current page */ hsize_t num_touched_pages; /* Number of pages accessed */ size_t access_size = 0; - hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */ + hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */ hsize_t i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -984,7 +984,7 @@ H5PB_write(H5F_shared_t *f_sh, H5FD_mem_t type, haddr_t addr, size_t size, const haddr_t search_addr; /* Address of current page */ hsize_t num_touched_pages; /* Number of pages accessed */ size_t access_size = 0; - hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */ + hbool_t bypass_pb = FALSE; /* Whether to bypass page buffering */ hsize_t i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 6e273ed755f..353b3316c42 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -867,7 +867,7 @@ static herr_t H5P__encode_chunk_cache_nslots(const void *value, void **_pp, size_t *size) { uint64_t enc_value = 0; /* Property value to encode */ - uint8_t **pp = (uint8_t **)_pp; + uint8_t **pp = (uint8_t **)_pp; unsigned enc_size; /* Size of encoded property */ FUNC_ENTER_STATIC_NOERR @@ -967,7 +967,7 @@ static herr_t H5P__encode_chunk_cache_nbytes(const void *value, void **_pp, size_t *size) { uint64_t enc_value = 0; /* Property value to encode */ - uint8_t **pp = (uint8_t **)_pp; + uint8_t **pp = (uint8_t **)_pp; unsigned enc_size; /* Size of encoded property */ FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index f240680bfe1..2a66b7f493a 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -4271,9 +4271,9 @@ herr_t H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled /*out*/, char *location /*out*/, size_t *location_size /*out*/, hbool_t *start_on_access /*out*/) { - H5P_genplist_t *plist; /* Property list pointer */ - char * location_ptr = NULL; /* Pointer to location string */ - herr_t ret_value = SUCCEED; /* Return value */ + H5P_genplist_t *plist; /* Property list pointer */ + char * location_ptr = NULL; /* Pointer to location string */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "ixxxx", plist_id, is_enabled, location, location_size, start_on_access); diff --git a/src/H5SL.c b/src/H5SL.c index 51a1da7da94..f30f5e83ba9 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -746,10 +746,10 @@ H5SL__new_node(void *item, const void *key, uint32_t hashval) static H5SL_node_t * H5SL__insert_common(H5SL_t *slist, void *item, const void *key) { - H5SL_node_t *x; /* Current node to examine */ - H5SL_node_t *prev; /* Node before the new node */ - uint32_t hashval = 0; /* Hash value for key */ - H5SL_node_t *ret_value = NULL; /* Return value */ + H5SL_node_t *x; /* Current node to examine */ + H5SL_node_t *prev; /* Node before the new node */ + uint32_t hashval = 0; /* Hash value for key */ + H5SL_node_t *ret_value = NULL; /* Return value */ FUNC_ENTER_STATIC @@ -1379,7 +1379,7 @@ void * H5SL_search(H5SL_t *slist, const void *key) { H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ + uint32_t hashval = 0; /* Hash value for key */ void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1677,7 +1677,7 @@ H5SL_node_t * H5SL_find(H5SL_t *slist, const void *key) { H5SL_node_t *x; /* Current node to examine */ - uint32_t hashval = 0; /* Hash value for key */ + uint32_t hashval = 0; /* Hash value for key */ H5SL_node_t *ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5timer.c b/src/H5timer.c index c0045c3cf83..ce7a32ec8b5 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -583,9 +583,9 @@ H5_timer_get_time_string(double seconds) char *s; /* output string */ /* Used when the time is greater than 59 seconds */ - double days = 0.0; - double hours = 0.0; - double minutes = 0.0; + double days = 0.0; + double hours = 0.0; + double minutes = 0.0; double remainder_sec = 0.0; /* Extract larger time units from count of seconds */ diff --git a/src/H5trace.c b/src/H5trace.c index 81e7187b016..d3666666bd0 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -3883,7 +3883,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) hssize_t i; FILE * out = H5_debug_g.trace; static hbool_t is_first_invocation = TRUE; - H5_timer_t function_timer = {{0}, {0}, {0}, FALSE}; + H5_timer_t function_timer = {{0}, {0}, {0}, FALSE}; H5_timevals_t function_times; static H5_timer_t running_timer; H5_timevals_t running_times; diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c index 8b7bb9b8f5d..d5cce9664dd 100644 --- a/tools/src/misc/h5debug.c +++ b/tools/src/misc/h5debug.c @@ -246,8 +246,8 @@ main(int argc, char *argv[]) haddr_t extra[10]; uint8_t sig[H5F_SIGNATURE_LEN]; size_t u; - H5E_auto2_t func = NULL; - void * edata = NULL; + H5E_auto2_t func = NULL; + void * edata = NULL; hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t status = SUCCEED; int exit_value = 0;