From: Adam Emerson Date: Thu, 28 Nov 2024 05:54:19 +0000 (-0500) Subject: test/objectstore: Fix signed comparison warning X-Git-Tag: testing/wip-rishabh-testing-20250617.173904~20^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=876cb5f2c4d97631dda63ee0d606b5e0976d4630;p=ceph-ci.git test/objectstore: Fix signed comparison warning Signed-off-by: Adam Emerson --- diff --git a/src/test/objectstore/allocsim/ops_replayer.cc b/src/test/objectstore/allocsim/ops_replayer.cc index 057d19d9099..4f309d3431a 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) {