From 876cb5f2c4d97631dda63ee0d606b5e0976d4630 Mon Sep 17 00:00:00 2001 From: Adam Emerson Date: Thu, 28 Nov 2024 00:54:19 -0500 Subject: [PATCH] test/objectstore: Fix signed comparison warning Signed-off-by: Adam Emerson --- src/test/objectstore/allocsim/ops_replayer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/objectstore/allocsim/ops_replayer.cc b/src/test/objectstore/allocsim/ops_replayer.cc index 057d19d90993c..4f309d3431a73 100644 --- a/src/test/objectstore/allocsim/ops_replayer.cc +++ b/src/test/objectstore/allocsim/ops_replayer.cc @@ -414,12 +414,12 @@ int main(int argc, char** argv) { } uint64_t start_offset = 0; uint64_t step_size = file_stat.st_size / nparser_threads; - for (int i = 0; i < nparser_threads; i++) { + for (int i = 0; std::cmp_less(i, nparser_threads); i++) { char* end = mapped_buffer + start_offset + step_size; while(*end != '\n') { end--; } - if (i == nparser_threads - 1) { + if (std::cmp_equal(i, nparser_threads - 1)) { end = mapped_buffer + file_stat.st_size; } shared_ptr context = make_shared(); @@ -480,7 +480,7 @@ int main(int argc, char** argv) { // process ops vector worker_threads; - for (int i = 0; i < nworker_threads; i++) { + for (int i = 0; std::cmp_less(i, nworker_threads); i++) { worker_threads.push_back(thread(worker_thread_entry, i, nworker_threads, std::ref(ops), max_buffer_size, io_depth, &io)); } for (auto& worker : worker_threads) { -- 2.39.5