From dcc86664e2d28796df4fb5a47b3a9883ec9f5aa3 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 8 Mar 2017 07:30:31 +0100 Subject: [PATCH 1/4] lstm: Remove unused variable This fixes a compiler warning: lstm/input.cpp:141:7: warning: unused variable 'width' [-Wunused-variable] Signed-off-by: Stefan Weil --- lstm/input.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/lstm/input.cpp b/lstm/input.cpp index 7cba0d794d..1bcf367e3c 100644 --- a/lstm/input.cpp +++ b/lstm/input.cpp @@ -138,7 +138,6 @@ void Input::PreparePixInput(const StaticShape& shape, const Pix* pix, else normed_pix = pixConvertTo8(var_pix, false); } - int width = pixGetWidth(normed_pix); int height = pixGetHeight(normed_pix); int target_height = shape.height(); if (target_height == 1) target_height = shape.depth(); From 7b33dad05908fc0725499294f705c3c17399d6ae Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 8 Mar 2017 07:38:46 +0100 Subject: [PATCH 2/4] api: Remove unused variables This fixes a compiler warning: api/baseapi.cpp:1621:17: warning: variable 'font_name' set but not used [-Wunused-but-set-variable] Signed-off-by: Stefan Weil --- api/baseapi.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/api/baseapi.cpp b/api/baseapi.cpp index eacfe7a933..2f22d6b504 100644 --- a/api/baseapi.cpp +++ b/api/baseapi.cpp @@ -1616,13 +1616,7 @@ char* TessBaseAPI::GetTSVText(int page_number) { // Now, process the word... int left, top, right, bottom; - bool bold, italic, underlined, monospace, serif, smallcaps; - int pointsize, font_id; - const char* font_name; res_it->BoundingBox(RIL_WORD, &left, &top, &right, &bottom); - font_name = - res_it->WordFontAttributes(&bold, &italic, &underlined, &monospace, - &serif, &smallcaps, &pointsize, &font_id); word_num++; tsv_str.add_str_int("5\t", page_num); // level 5 - word tsv_str.add_str_int("\t", block_num); From 363f13157b67ab5e4ba2ade9675111e9b6fd4088 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 8 Mar 2017 07:38:59 +0100 Subject: [PATCH 3/4] ccutil: Remove unused variable This fixes a compiler warning: ccutil/scanutils.cpp:284:7: warning: variable 'sign' set but not used [-Wunused-but-set-variable] Signed-off-by: Stefan Weil --- ccutil/scanutils.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ccutil/scanutils.cpp b/ccutil/scanutils.cpp index cba7d5491e..2d7cccced7 100644 --- a/ccutil/scanutils.cpp +++ b/ccutil/scanutils.cpp @@ -281,7 +281,6 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) { } state = ST_NORMAL; char *sarg = NULL; // %s %c or %[ string argument enum Bail bail = BAIL_NONE; - int sign; int converted = 0; // Successful conversions unsigned long matchmap[((1 << CHAR_BIT)+(CHAR_BIT * sizeof(long) - 1)) / (CHAR_BIT * sizeof(long))]; @@ -363,28 +362,28 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) { case 'P': // Upper case pointer case 'p': // Pointer rank = RANK_PTR; - base = 0; sign = 0; + base = 0; goto scan_int; case 'i': // Base-independent integer - base = 0; sign = 1; + base = 0; goto scan_int; case 'd': // Decimal integer - base = 10; sign = 1; + base = 10; goto scan_int; case 'o': // Octal integer - base = 8; sign = 0; + base = 8; goto scan_int; case 'u': // Unsigned decimal integer - base = 10; sign = 0; + base = 10; goto scan_int; case 'x': // Hexadecimal integer case 'X': - base = 16; sign = 0; + base = 16; goto scan_int; case 'n': // Number of characters consumed From dabf3f3dbd4b63193a7353273d36e5c4a54f09e1 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 9 Mar 2017 16:19:21 +0100 Subject: [PATCH 4/4] classify: Remove unused local function This fixes a compiler warning: classify/trainingsampleset.cpp:510:13: warning: 'Pix* tesseract::DebugSample(const UNICHARSET&, tesseract::TrainingSample*)' defined but not used [-Wunused-function] Signed-off-by: Stefan Weil --- classify/trainingsampleset.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/classify/trainingsampleset.cpp b/classify/trainingsampleset.cpp index 3d73825664..2531e5768f 100644 --- a/classify/trainingsampleset.cpp +++ b/classify/trainingsampleset.cpp @@ -507,22 +507,6 @@ bool TrainingSampleSet::DeleteableSample(const TrainingSample* sample) { return sample == NULL || sample->class_id() < 0; } -static Pix* DebugSample(const UNICHARSET& unicharset, - TrainingSample* sample) { - tprintf("\nOriginal features:\n"); - for (int i = 0; i < sample->num_features(); ++i) { - sample->features()[i].print(); - } - if (sample->features_are_mapped()) { - tprintf("\nMapped features:\n"); - for (int i = 0; i < sample->mapped_features().size(); ++i) { - tprintf("%d ", sample->mapped_features()[i]); - } - tprintf("\n"); - } - return sample->RenderToPix(&unicharset); -} - // Construct an array to access the samples by font,class pair. void TrainingSampleSet::OrganizeByFontAndClass() { // Font indexes are sparse, so we used a map to compact them, so we can