summaryrefslogtreecommitdiffstats
path: root/src/H5Cmpio.c
diff options
context:
space:
mode:
authorQuincey Koziol <quincey@koziol.cc>2023-05-09 20:19:18 (GMT)
committerGitHub <noreply@github.com>2023-05-09 20:19:18 (GMT)
commit1a89fa23fc017d498c6add662d7c3cb707be511f (patch)
treec24a9e2f67b59da880f66d2e67f5ffba63f2bc62 /src/H5Cmpio.c
parent80cf4066473736d4c050a9ac47a43551ac3657a5 (diff)
downloadhdf5-1a89fa23fc017d498c6add662d7c3cb707be511f.zip
hdf5-1a89fa23fc017d498c6add662d7c3cb707be511f.tar.gz
hdf5-1a89fa23fc017d498c6add662d7c3cb707be511f.tar.bz2
More code duplication reduction (#2930)
* Add failure value where it's missing from 1+ macros. Clean up whitespace / continuation characters ('\'). Made hash-table macros generic for use in both the package header and test header. Remove duplicated copy & pasted macros (by hoisting difference into #ifdef'd macro). Updated and re-flowed comments to read better. Also clean up a few compiler warnings in production builds. Signed-off-by: Quincey Koziol <quincey@koziol.cc> * Committing clang-format changes * Remove unused variable warning in H5C.c (#2844) * Remove trailing /* NDEBUG */ comment from #endif's * Committing clang-format changes --------- Signed-off-by: Quincey Koziol <quincey@koziol.cc> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5Cmpio.c')
-rw-r--r--src/H5Cmpio.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index a92ac10..5822746 100644
--- a/src/H5Cmpio.c
+++ b/src/H5Cmpio.c
@@ -159,10 +159,12 @@ herr_t
H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, haddr_t *candidates_list_ptr,
int mpi_rank, int mpi_size)
{
- unsigned first_entry_to_flush;
- unsigned last_entry_to_flush;
- unsigned total_entries_to_clear = 0;
- unsigned total_entries_to_flush = 0;
+ unsigned first_entry_to_flush;
+ unsigned last_entry_to_flush;
+#ifndef NDEBUG
+ unsigned total_entries_to_clear = 0;
+ unsigned total_entries_to_flush = 0;
+#endif
unsigned *candidate_assignment_table = NULL;
unsigned entries_to_flush[H5C_RING_NTYPES];
unsigned entries_to_clear[H5C_RING_NTYPES];
@@ -316,12 +318,16 @@ H5C_apply_candidate_list(H5F_t *f, H5C_t *cache_ptr, unsigned num_candidates, ha
* markings.
*/
if (u >= first_entry_to_flush && u <= last_entry_to_flush) {
+#ifndef NDEBUG
total_entries_to_flush++;
+#endif
entries_to_flush[entry_ptr->ring]++;
entry_ptr->flush_immediately = TRUE;
} /* end if */
else {
+#ifndef NDEBUG
total_entries_to_clear++;
+#endif
entries_to_clear[entry_ptr->ring]++;
entry_ptr->clear_on_unprotect = TRUE;
} /* end else */