From 5d620a5f068510e91e1605095c2fa968923a7892 Mon Sep 17 00:00:00 2001 From: Ger Hobbelt Date: Tue, 13 Jul 2021 16:39:08 +0200 Subject: [PATCH] just a couple of 'shadowed local variables' compiler warning fixes that got through while I manually extracted the template work from my mainline (warnings due to running MSVC at Level 4) --- src/api/hocrrenderer.cpp | 1 - src/ccstruct/blamer.cpp | 1 - src/ccstruct/mod128.cpp | 2 +- src/lstm/recodebeam.cpp | 4 ++-- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/api/hocrrenderer.cpp b/src/api/hocrrenderer.cpp index b7541c3e01..8015f88b8a 100644 --- a/src/api/hocrrenderer.cpp +++ b/src/api/hocrrenderer.cpp @@ -319,7 +319,6 @@ char *TessBaseAPI::GetHOCRText(ETEXT_DESC *monitor, int page_number) { hocr_str << "\n "; ++scnt; } else if (lstm_choice_mode == 2) { - tesseract::ChoiceIterator ci(*res_it); hocr_str << "\n "; diff --git a/src/ccstruct/blamer.cpp b/src/ccstruct/blamer.cpp index bb257f98d9..606bb0c77c 100644 --- a/src/ccstruct/blamer.cpp +++ b/src/ccstruct/blamer.cpp @@ -331,7 +331,6 @@ void BlamerBundle::SetChopperBlame(const WERD_RES *word, bool debug) { } } if (missing_chop || box_index < norm_truth_word_.length()) { - std::string debug_str; if (missing_chop) { debug_str += "Detected missing chop (tolerance=" + std::to_string(norm_box_tolerance_); debug_str += ") at Bounding Box="; diff --git a/src/ccstruct/mod128.cpp b/src/ccstruct/mod128.cpp index 4b862ef535..abebe296f4 100644 --- a/src/ccstruct/mod128.cpp +++ b/src/ccstruct/mod128.cpp @@ -1,7 +1,7 @@ /********************************************************************** * File: mod128.cpp (Formerly dir128.c) * Description: Code to convert a DIR128 to an ICOORD. - * Author: Ray Smith + * Author: Ray Smith * * (C) Copyright 1991, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/lstm/recodebeam.cpp b/src/lstm/recodebeam.cpp index 7861052e04..52cd6ab8b5 100644 --- a/src/lstm/recodebeam.cpp +++ b/src/lstm/recodebeam.cpp @@ -928,7 +928,7 @@ void RecodeBeamSearch::ContinueContext(const RecodeNode *prev, int index, const (code == top_code_ && prev->code == second_code_))) { prob += outputs[prev->code]; } - float cert = NetworkIO::ProbToCertainty(prob) + cert_offset; + cert = NetworkIO::ProbToCertainty(prob) + cert_offset; ContinueUnichar(code, unichar_id, cert, worst_dict_cert, dict_ratio, use_dawgs, NC_ONLY_DUP, prev, step); } @@ -953,7 +953,7 @@ void RecodeBeamSearch::ContinueContext(const RecodeNode *prev, int index, const (code == top_code_ && prev->code == second_code_))) { prob += outputs[prev->code]; } - float cert = NetworkIO::ProbToCertainty(prob) + cert_offset; + cert = NetworkIO::ProbToCertainty(prob) + cert_offset; PushDupOrNoDawgIfBetter(length + 1, false, code, INVALID_UNICHAR_ID, cert, worst_dict_cert, dict_ratio, use_dawgs, NC_ONLY_DUP, prev, step); }