Skip to content

Commit

Permalink
Fix compiler warnings (-Wimplicit-fallthrough)
Browse files Browse the repository at this point in the history
gcc warnings:

    src/ccmain/docqual.cpp:734:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
    src/ccmain/docqual.cpp:764:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
    src/ccmain/docqual.cpp:782:26: warning: this statement may fall through [-Wimplicit-fallthrough=]
    [...]

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Feb 9, 2019
1 parent aa2dcca commit 2a355ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ccmain/docqual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ GARBAGE_LEVEL Tesseract::garbage_word(WERD_RES *word, BOOL8 ok_dict_word) {
break;
case FIRST_NUM:
isolated_digits++;
// Fall through.
default:
state = FIRST_UPPER;
last_char = word->uch_set->unichar_to_id(str, *lengths);
Expand Down Expand Up @@ -762,6 +763,7 @@ GARBAGE_LEVEL Tesseract::garbage_word(WERD_RES *word, BOOL8 ok_dict_word) {
break;
case FIRST_NUM:
isolated_digits++;
// Fall through.
default:
state = FIRST_LOWER;
last_char = word->uch_set->unichar_to_id(str, *lengths);
Expand All @@ -780,6 +782,7 @@ GARBAGE_LEVEL Tesseract::garbage_word(WERD_RES *word, BOOL8 ok_dict_word) {
case FIRST_UPPER:
case FIRST_LOWER:
isolated_alphas++;
// Fall through.
default:
state = FIRST_NUM;
break;
Expand Down
1 change: 1 addition & 0 deletions src/ccmain/resultiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ bool ResultIterator::Next(PageIteratorLevel level) {
}
level = RIL_WORD; // we've fallen through to the next word.
}
// Fall through.
case RIL_WORD: // explicit fall-through.
{
if (it_->word() == nullptr) return Next(RIL_BLOCK);
Expand Down
3 changes: 3 additions & 0 deletions src/ccutil/unichar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,15 @@ int UNICHAR::first_uni() const {
case 4:
uni += static_cast<unsigned char>(*src++);
uni <<= 6;
// Fall through.
case 3:
uni += static_cast<unsigned char>(*src++);
uni <<= 6;
// Fall through.
case 2:
uni += static_cast<unsigned char>(*src++);
uni <<= 6;
// Fall through.
case 1:
uni += static_cast<unsigned char>(*src++);
}
Expand Down

0 comments on commit 2a355ea

Please sign in to comment.