From bc7a7eea2f9b897095ab2f296e70617d4afeafd7 Mon Sep 17 00:00:00 2001 From: zdenop Date: Sun, 4 Dec 2022 18:56:30 +0100 Subject: [PATCH] fix: index variable in OpenMP 'for' statement must have signed integral type --- src/ccmain/par_control.cpp | 2 +- src/lstm/parallel.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ccmain/par_control.cpp b/src/ccmain/par_control.cpp index efad3355..0f916c6e 100644 --- a/src/ccmain/par_control.cpp +++ b/src/ccmain/par_control.cpp @@ -55,7 +55,7 @@ void Tesseract::PrerecAllWordsPar(const std::vector &words) { # pragma omp parallel for num_threads(10) #endif // _OPENMP // NOLINTNEXTLINE(modernize-loop-convert) - for (size_t b = 0; b < blobs.size(); ++b) { + for (auto b = 0; b < blobs.size(); ++b) { *blobs[b].choices = blobs[b].tesseract->classify_blob(blobs[b].blob, "par", ScrollView::WHITE, nullptr); } diff --git a/src/lstm/parallel.cpp b/src/lstm/parallel.cpp index 2713314c..5b3fd1d4 100644 --- a/src/lstm/parallel.cpp +++ b/src/lstm/parallel.cpp @@ -137,7 +137,7 @@ bool Parallel::Backward(bool debug, const NetworkIO &fwd_deltas, NetworkScratch #ifdef _OPENMP # pragma omp parallel for num_threads(stack_size) #endif - for (unsigned i = 0; i < stack_size; ++i) { + for (auto i = 0; i < stack_size; ++i) { stack_[i]->Backward(debug, *in_deltas[i], scratch, i == 0 ? back_deltas : out_deltas[i]); } if (needs_to_backprop_) {