Skip to content

Commit 2a355ea

Browse files
committed
Fix compiler warnings (-Wimplicit-fallthrough)
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 <sw@weilnetz.de>
1 parent aa2dcca commit 2a355ea

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/ccmain/docqual.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@ GARBAGE_LEVEL Tesseract::garbage_word(WERD_RES *word, BOOL8 ok_dict_word) {
732732
break;
733733
case FIRST_NUM:
734734
isolated_digits++;
735+
// Fall through.
735736
default:
736737
state = FIRST_UPPER;
737738
last_char = word->uch_set->unichar_to_id(str, *lengths);
@@ -762,6 +763,7 @@ GARBAGE_LEVEL Tesseract::garbage_word(WERD_RES *word, BOOL8 ok_dict_word) {
762763
break;
763764
case FIRST_NUM:
764765
isolated_digits++;
766+
// Fall through.
765767
default:
766768
state = FIRST_LOWER;
767769
last_char = word->uch_set->unichar_to_id(str, *lengths);
@@ -780,6 +782,7 @@ GARBAGE_LEVEL Tesseract::garbage_word(WERD_RES *word, BOOL8 ok_dict_word) {
780782
case FIRST_UPPER:
781783
case FIRST_LOWER:
782784
isolated_alphas++;
785+
// Fall through.
783786
default:
784787
state = FIRST_NUM;
785788
break;

src/ccmain/resultiterator.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ bool ResultIterator::Next(PageIteratorLevel level) {
452452
}
453453
level = RIL_WORD; // we've fallen through to the next word.
454454
}
455+
// Fall through.
455456
case RIL_WORD: // explicit fall-through.
456457
{
457458
if (it_->word() == nullptr) return Next(RIL_BLOCK);

src/ccutil/unichar.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,15 @@ int UNICHAR::first_uni() const {
110110
case 4:
111111
uni += static_cast<unsigned char>(*src++);
112112
uni <<= 6;
113+
// Fall through.
113114
case 3:
114115
uni += static_cast<unsigned char>(*src++);
115116
uni <<= 6;
117+
// Fall through.
116118
case 2:
117119
uni += static_cast<unsigned char>(*src++);
118120
uni <<= 6;
121+
// Fall through.
119122
case 1:
120123
uni += static_cast<unsigned char>(*src++);
121124
}

0 commit comments

Comments
 (0)