mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 12:49:35 +08:00
Fix compiler warnings [-Wunreachable-code-return]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
36d44a1497
commit
24dd72603b
@ -114,7 +114,6 @@ Network *NetworkBuilder::BuildFromString(const StaticShape &input_shape, const c
|
||||
return ParseOutput(input_shape, str);
|
||||
default:
|
||||
tprintf("Invalid network spec:%s\n", *str);
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -344,7 +344,7 @@ SEAM *Wordrec::improve_one_blob(const std::vector<BLOB_CHOICE *> &blob_choices,
|
||||
// TODO(rays) it may eventually help to allow italic_blob to be true,
|
||||
seam = chop_numbered_blob(word->chopped_word, *blob_number, italic_blob, word->seam_array);
|
||||
if (seam != nullptr) {
|
||||
return seam; // Success!
|
||||
break; // Success!
|
||||
}
|
||||
if (blob_choices[*blob_number] == nullptr) {
|
||||
return nullptr;
|
||||
|
@ -64,7 +64,6 @@ protected:
|
||||
if (!SetImage(imagefile)) {
|
||||
// eng.traineddata not found or other problem during Init.
|
||||
GTEST_SKIP();
|
||||
return;
|
||||
}
|
||||
if (line_mode) {
|
||||
api_.SetVariable("tessedit_resegment_from_line_boxes", "1");
|
||||
|
@ -124,7 +124,6 @@ TEST_F(TesseractTest, HOCRWorksWithoutSetInputName) {
|
||||
if (api.Init(TessdataPath().c_str(), "eng", tesseract::OEM_TESSERACT_ONLY) == -1) {
|
||||
// eng.traineddata not found.
|
||||
GTEST_SKIP();
|
||||
return;
|
||||
}
|
||||
Image src_pix = pixRead(TestDataNameToPath("HelloGoogle.tif").c_str());
|
||||
CHECK(src_pix);
|
||||
@ -143,7 +142,6 @@ TEST_F(TesseractTest, HOCRContainsBaseline) {
|
||||
if (api.Init(TessdataPath().c_str(), "eng", tesseract::OEM_TESSERACT_ONLY) == -1) {
|
||||
// eng.traineddata not found.
|
||||
GTEST_SKIP();
|
||||
return;
|
||||
}
|
||||
Image src_pix = pixRead(TestDataNameToPath("HelloGoogle.tif").c_str());
|
||||
CHECK(src_pix);
|
||||
@ -179,7 +177,6 @@ TEST_F(TesseractTest, AdaptToWordStrTest) {
|
||||
if (api.Init(TessdataPath().c_str(), "eng", tesseract::OEM_TESSERACT_ONLY) == -1) {
|
||||
// eng.traineddata not found.
|
||||
GTEST_SKIP();
|
||||
return;
|
||||
}
|
||||
api.SetVariable("matcher_sufficient_examples_for_prototyping", "1");
|
||||
api.SetVariable("classify_class_pruner_threshold", "220");
|
||||
@ -215,7 +212,6 @@ TEST_F(TesseractTest, BasicLSTMTest) {
|
||||
if (api.Init(TessdataPath().c_str(), "eng", tesseract::OEM_LSTM_ONLY) == -1) {
|
||||
// eng.traineddata not found.
|
||||
GTEST_SKIP();
|
||||
return;
|
||||
}
|
||||
Image src_pix = pixRead(TestDataNameToPath("phototest_2.tif").c_str());
|
||||
CHECK(src_pix);
|
||||
@ -239,7 +235,6 @@ TEST_F(TesseractTest, LSTMGeometryTest) {
|
||||
if (api.Init(TessdataPath().c_str(), "eng", tesseract::OEM_LSTM_ONLY) == -1) {
|
||||
// eng.traineddata not found.
|
||||
GTEST_SKIP();
|
||||
return;
|
||||
}
|
||||
api.SetImage(src_pix);
|
||||
ASSERT_EQ(api.Recognize(nullptr), 0);
|
||||
|
Loading…
Reference in New Issue
Block a user