Skip to content

Commit

Permalink
Fix a couple of 'shadowed local variables' compiler warnings
Browse files Browse the repository at this point in the history
These fixes got through while I manually extracted the template work
from my mainline (warnings due to running MSVC at Level 4)

[sw]: Format commit message and use different fix for blamer.cpp

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
GerHobbelt authored and stweil committed Jul 20, 2021
1 parent 0fc6d8d commit 444fe14
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/api/hocrrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ char *TessBaseAPI::GetHOCRText(ETEXT_DESC *monitor, int page_number) {
hocr_str << "\n </span>";
++scnt;
} else if (lstm_choice_mode == 2) {
tesseract::ChoiceIterator ci(*res_it);
hocr_str << "\n <span class='ocrx_cinfo'"
<< " id='"
<< "lstm_choices_" << page_id << "_" << wcnt << "_" << tcnt << "'>";
Expand Down
1 change: 0 additions & 1 deletion src/ccstruct/blamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ void BlamerBundle::SetChopperBlame(const WERD_RES *word, bool debug) {
if (NoTruth() || !truth_has_char_boxes_ || word->chopped_word->blobs.empty()) {
return;
}
std::string debug_str;
bool missing_chop = false;
int num_blobs = word->chopped_word->blobs.size();
int box_index = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/ccstruct/mod128.cpp
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/lstm/recodebeam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 444fe14

Please sign in to comment.