Skip to content

Commit

Permalink
Merge pull request tesseract-ocr#752 from stweil/warn
Browse files Browse the repository at this point in the history
Remove some unused local variables and functions
  • Loading branch information
zdenop authored Mar 10, 2017
2 parents ace9d2a + dabf3f3 commit fe986df
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 30 deletions.
6 changes: 0 additions & 6 deletions api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 6 additions & 7 deletions ccutil/scanutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))];
Expand Down Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions classify/trainingsampleset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lstm/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit fe986df

Please sign in to comment.