diff options
author | Sean McBride <sean@rogue-research.com> | 2023-06-19 05:13:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 05:13:38 (GMT) |
commit | 65d8c9347010771473b53c91adcec2f281772213 (patch) | |
tree | 487567dae0dc005de896f616b90e67744239a5e2 /test/cache_common.c | |
parent | 1f20354ee6cdfa9fd157ac9cdfff9acdf320a32d (diff) | |
download | hdf5-65d8c9347010771473b53c91adcec2f281772213.zip hdf5-65d8c9347010771473b53c91adcec2f281772213.tar.gz hdf5-65d8c9347010771473b53c91adcec2f281772213.tar.bz2 |
Many fixes to various compiler warnings (#3124)
* Fixed various -Wmissing-variable-declarations by adding static keyword
* In a few cases, renamed the variable suffix from _g to _s.
* Fixed some -Wmissing-variable-declarations by using different declaration macros
* Fixed various -Wconditional-uninitialized warnings by just initializing variable to zero
* Fixed various -Wcomma warnings
* Fixed clang -Wstrict-prototypes warnings
* Fixed various -Wunused-variable warnings
* Updated some casts to fix the only 3 -Wcast-qual warnings
* Fixed the only -Wsometimes-uninitialized warning
Diffstat (limited to 'test/cache_common.c')
-rw-r--r-- | test/cache_common.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/cache_common.c b/test/cache_common.c index d755e1e..82ef9e4 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -3024,7 +3024,7 @@ mark_entry_dirty(int32_t type, int32_t idx) void move_entry(H5C_t *cache_ptr, int32_t type, int32_t idx, hbool_t main_addr) { - herr_t result; + herr_t result = 0; hbool_t done = TRUE; /* will set to FALSE if we have work to do */ haddr_t old_addr = HADDR_UNDEF; haddr_t new_addr = HADDR_UNDEF; @@ -4946,7 +4946,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, double *hit_rate_ptr, hbool_t d int64_t cache_hits = 0; int64_t cache_accesses = 0; double expected_hit_rate; - double hit_rate; + double hit_rate = 0.0; H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; @@ -5059,15 +5059,15 @@ check_and_validate_cache_size(hid_t file_id, size_t *max_size_ptr, size_t *min_c { herr_t result; size_t expected_max_size; - size_t max_size; + size_t max_size = 0; size_t expected_min_clean_size; - size_t min_clean_size; + size_t min_clean_size = 0; size_t expected_cur_size; - size_t cur_size; + size_t cur_size = 0; uint32_t expected_cur_num_entries; - int cur_num_entries; - H5F_t *file_ptr = NULL; - H5C_t *cache_ptr = NULL; + int cur_num_entries = 0; + H5F_t *file_ptr = NULL; + H5C_t *cache_ptr = NULL; /* get a pointer to the files internal data structure */ if (pass) { |