]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test/objectstore: Fix signed comparison warning
authorAdam Emerson <aemerson@redhat.com>
Thu, 28 Nov 2024 05:54:19 +0000 (00:54 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 3 Apr 2025 21:48:33 +0000 (17:48 -0400)
Signed-off-by: Adam Emerson <aemerson@redhat.com>
src/test/objectstore/allocsim/ops_replayer.cc

index 057d19d90993cd86a1bff3c6601834a51dbbccac..4f309d3431a73cad18a60ca0b6763ce94fe0c70f 100644 (file)
@@ -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<ParserContext> context = make_shared<ParserContext>();
@@ -480,7 +480,7 @@ int main(int argc, char** argv) {
 
   // process ops
   vector<thread> 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) {