Skip to content

Commit

Permalink
Merge pull request tesseract-ocr#132 from stweil/warnings
Browse files Browse the repository at this point in the history
Fix some compiler warnings
  • Loading branch information
zdenop committed Nov 4, 2015
2 parents 33f3eda + 99a5717 commit ab9e9a8
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion ccmain/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,6 @@ void Tesseract::ReportXhtFixResult(bool accept_new_word, float new_x_ht,
// Returns true if the word was changed.
// See the comment in fixxht.cpp for a description of the overall process.
bool Tesseract::TrainedXheightFix(WERD_RES *word, BLOCK* block, ROW *row) {
bool accept_new_x_ht = false;
int original_misfits = CountMisfitTops(word);
if (original_misfits == 0)
return false;
Expand Down
2 changes: 0 additions & 2 deletions ccmain/fixspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,6 @@ namespace tesseract {
inT16 Tesseract::fp_eval_word_spacing(WERD_RES_LIST &word_res_list) {
WERD_RES_IT word_it(&word_res_list);
WERD_RES *word;
inT16 word_length;
inT16 score = 0;
inT16 i;
float small_limit = kBlnXHeight * fixsp_small_outlines_size;
Expand All @@ -840,7 +839,6 @@ inT16 Tesseract::fp_eval_word_spacing(WERD_RES_LIST &word_res_list) {
word = word_it.data();
if (word->rebuild_word == NULL)
continue; // Can't handle cube words.
word_length = word->reject_map.length();
if (word->done ||
word->tess_accepted ||
word->best_choice->permuter() == SYSTEM_DAWG_PERM ||
Expand Down
4 changes: 2 additions & 2 deletions cube/cube_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ bool CubeUtils::IsCaseInvariant(const char_32 *str32, CharSet *char_set) {
if (first_upper)
capitalized = true;
prev_upper = first_upper;
prev_lower = islower(str32[0]);
prev_lower = first_lower;
for (int c = 1; str32[c] != 0; ++c) {
cur_upper = isupper(str32[c]);
cur_lower = islower(str32[c]);
Expand All @@ -329,7 +329,7 @@ bool CubeUtils::IsCaseInvariant(const char_32 *str32, CharSet *char_set) {
if (first_upper)
capitalized = true;
prev_upper = first_upper;
prev_lower = unicharset->get_islower(char_set->ClassID(str32[0]));
prev_lower = first_lower;

for (int c = 1; c < StrLen(str32); ++c) {
cur_upper = unicharset->get_isupper(char_set->ClassID(str32[c]));
Expand Down
2 changes: 1 addition & 1 deletion viewer/svutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static int GetAddrInfo(const char* hostname, int port,
struct addrinfo** address) {
#if defined(__linux__)
char port_str[40];
snprintf(port_str, 40, "%ld", port);
snprintf(port_str, 40, "%d", port);
return getaddrinfo(hostname, port_str, NULL, address);
#else
return GetAddrInfoNonLinux(hostname, port, address);
Expand Down

0 comments on commit ab9e9a8

Please sign in to comment.