Skip to content

Commit a74d467

Browse files
committed
Fix compiler warnings [-Wcomma]
clang warnings: src/api/baseapi.cpp:1642:18: warning: possible misuse of comma operator here [-Wcomma] src/api/baseapi.cpp:1642:31: warning: possible misuse of comma operator here [-Wcomma] src/api/baseapi.cpp:1642:45: warning: possible misuse of comma operator here [-Wcomma] src/api/baseapi.cpp:1652:16: warning: possible misuse of comma operator here [-Wcomma] src/api/baseapi.cpp:1652:30: warning: possible misuse of comma operator here [-Wcomma] src/api/baseapi.cpp:1662:17: warning: possible misuse of comma operator here [-Wcomma] Signed-off-by: Stefan Weil <[email protected]>
1 parent 296a836 commit a74d467

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/api/baseapi.cpp

+17-8
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ void TessBaseAPI::GetAvailableLanguagesAsVector(
456456
}
457457
}
458458

459-
//TODO(amit): Adapt to lstm
459+
//TODO(amit): Adapt to lstm
460460
#ifndef DISABLED_LEGACY_ENGINE
461461
/**
462462
* Init only the lang model component of Tesseract. The only functions
@@ -833,8 +833,8 @@ int TessBaseAPI::Recognize(ETEXT_DESC* monitor) {
833833
page_res_ = tesseract_->ApplyBoxes(*input_file_, true, block_list_);
834834
} else if (tesseract_->tessedit_resegment_from_boxes) {
835835
page_res_ = tesseract_->ApplyBoxes(*input_file_, false, block_list_);
836-
} else
837-
#endif // ndef DISABLED_LEGACY_ENGINE
836+
} else
837+
#endif // ndef DISABLED_LEGACY_ENGINE
838838
{
839839
page_res_ = new PAGE_RES(tesseract_->AnyLSTMLang(),
840840
block_list_, &tesseract_->prev_word_best_choice_);
@@ -1616,8 +1616,11 @@ char* TessBaseAPI::GetTSVText(int page_number) {
16161616

16171617
STRING tsv_str("");
16181618

1619-
int page_num = page_id, block_num = 0, par_num = 0, line_num = 0,
1620-
word_num = 0;
1619+
int page_num = page_id;
1620+
int block_num = 0;
1621+
int par_num = 0;
1622+
int line_num = 0;
1623+
int word_num = 0;
16211624

16221625
tsv_str.add_str_int("1\t", page_num); // level 1 - page
16231626
tsv_str.add_str_int("\t", block_num);
@@ -1639,7 +1642,10 @@ char* TessBaseAPI::GetTSVText(int page_number) {
16391642

16401643
// Add rows for any new block/paragraph/textline.
16411644
if (res_it->IsAtBeginningOf(RIL_BLOCK)) {
1642-
block_num++, par_num = 0, line_num = 0, word_num = 0;
1645+
block_num++;
1646+
par_num = 0;
1647+
line_num = 0;
1648+
word_num = 0;
16431649
tsv_str.add_str_int("2\t", page_num); // level 2 - block
16441650
tsv_str.add_str_int("\t", block_num);
16451651
tsv_str.add_str_int("\t", par_num);
@@ -1649,7 +1655,9 @@ char* TessBaseAPI::GetTSVText(int page_number) {
16491655
tsv_str += "\t-1\t\n"; // end of row for block
16501656
}
16511657
if (res_it->IsAtBeginningOf(RIL_PARA)) {
1652-
par_num++, line_num = 0, word_num = 0;
1658+
par_num++;
1659+
line_num = 0;
1660+
word_num = 0;
16531661
tsv_str.add_str_int("3\t", page_num); // level 3 - paragraph
16541662
tsv_str.add_str_int("\t", block_num);
16551663
tsv_str.add_str_int("\t", par_num);
@@ -1659,7 +1667,8 @@ char* TessBaseAPI::GetTSVText(int page_number) {
16591667
tsv_str += "\t-1\t\n"; // end of row for para
16601668
}
16611669
if (res_it->IsAtBeginningOf(RIL_TEXTLINE)) {
1662-
line_num++, word_num = 0;
1670+
line_num++;
1671+
word_num = 0;
16631672
tsv_str.add_str_int("4\t", page_num); // level 4 - line
16641673
tsv_str.add_str_int("\t", block_num);
16651674
tsv_str.add_str_int("\t", par_num);

0 commit comments

Comments
 (0)