Merge pull request #752 from stweil/warn

Remove some unused local variables and functions
This commit is contained in:
zdenop 2017-03-10 08:13:06 +01:00 committed by GitHub
commit fe986dfd34
4 changed files with 6 additions and 30 deletions

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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();