Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some unused local variables and functions #752

Merged
merged 4 commits into from
Mar 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Collaborator

@amitdo amitdo Mar 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole 'classify' directory will most likely be removed by Ray (it is part of the old engine). There is no point in applying any change to files under this directory.

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