From c80dce3bd7c62a3a23fb41aabd36a19b62f1d933 Mon Sep 17 00:00:00 2001 From: Earle Lowe Date: Wed, 19 Feb 2025 13:24:05 -0800 Subject: [PATCH] use [[maybe_unused]] to squelch some warnings --- src/b17phase3.hpp | 2 +- src/phase3.hpp | 2 +- src/prover_disk.hpp | 4 ++-- src/uniformsort.hpp | 2 +- tests/test.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/b17phase3.hpp b/src/b17phase3.hpp index 62d24f8d4..8ec323d95 100644 --- a/src/b17phase3.hpp +++ b/src/b17phase3.hpp @@ -357,7 +357,7 @@ b17Phase3Results b17RunPhase3( // The final table will simply store the deltas between each line_point, in fixed space // groups(parks), with a checkpoint in each group. Bits right_entry_bits; - int added_to_cache = 0; + [[maybe_unused]] int added_to_cache = 0; uint8_t index_size = table_index == 6 ? k + 1 : k; for (uint64_t index = 0; index < total_r_entries; index++) { right_reader_entry_buf = R_sort_manager->ReadEntry(right_reader, 2); diff --git a/src/phase3.hpp b/src/phase3.hpp index 6fbbf508e..63fb034b1 100644 --- a/src/phase3.hpp +++ b/src/phase3.hpp @@ -405,7 +405,7 @@ Phase3Results RunPhase3( // Now we will write on of the final tables, since we have a table sorted by line point. // The final table will simply store the deltas between each line_point, in fixed space // groups(parks), with a checkpoint in each group. - int added_to_cache = 0; + [[maybe_unused]] int added_to_cache = 0; uint8_t const sort_key_shift = 128 - right_sort_key_size; uint8_t const index_shift = sort_key_shift - (k + (table_index == 6 ? 1 : 0)); for (uint64_t index = 0; index < total_r_entries; index++) { diff --git a/src/prover_disk.hpp b/src/prover_disk.hpp index 6326e3480..d31fd85af 100644 --- a/src/prover_disk.hpp +++ b/src/prover_disk.hpp @@ -554,7 +554,7 @@ class DiskProver { { std::vector qualities; - uint32_t p7_entries_size = 0; + [[maybe_unused]] uint32_t p7_entries_size = 0; { std::lock_guard l(_mtx); @@ -585,7 +585,7 @@ class DiskProver { #endif // This inner loop goes from table 6 to table 1, getting the two backpointers, // and following one of them. - uint64_t alt_position; + [[maybe_unused]] uint64_t alt_position; for (uint8_t table_index = 6; table_index > GetEndTable(); table_index--) { uint128_t line_point = ReadLinePoint(disk_file, table_index, position); diff --git a/src/uniformsort.hpp b/src/uniformsort.hpp index 56fb172fe..f481e72a2 100644 --- a/src/uniformsort.hpp +++ b/src/uniformsort.hpp @@ -55,7 +55,7 @@ namespace UniformSort { uint64_t read_pos = input_disk_begin; uint64_t buf_size = 0; uint64_t buf_ptr = 0; - uint64_t swaps = 0; + [[maybe_unused]] uint64_t swaps = 0; for (uint64_t i = 0; i < num_entries; i++) { if (buf_size == 0) { // If read buffer is empty, read from disk and refill it. diff --git a/tests/test.cpp b/tests/test.cpp index 44c35284d..dced88f89 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -838,7 +838,7 @@ TEST_CASE("Sort on disk") vector input; const uint32_t memory_len = 1000000; SortManager manager(memory_len, 16, 4, size, ".", "test-files", 0, 1); - int total_written_1 = 0; + [[maybe_unused]] int total_written_1 = 0; for (uint32_t i = 0; i < iters; i++) { vector hash_input = intToBytes(i, 4); vector hash(picosha2::k_digest_size); @@ -866,7 +866,7 @@ TEST_CASE("Sort on disk") vector input; const uint32_t memory_len = 1000000; SortManager manager(memory_len, 16, 4, size, ".", "test-files", 0, 1); - int total_written_1 = 0; + [[maybe_unused]] int total_written_1 = 0; for (uint32_t i = 0; i < iters; i++) { vector hash_input = intToBytes(i, 4); vector hash(picosha2::k_digest_size);