diff --git a/Makefile.am b/Makefile.am index 6db0d0c008..46021d5d9b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -346,7 +346,6 @@ noinst_HEADERS += src/ccutil/elst.h noinst_HEADERS += src/ccutil/errcode.h noinst_HEADERS += src/ccutil/fileerr.h noinst_HEADERS += src/ccutil/genericheap.h -noinst_HEADERS += src/ccutil/globaloc.h noinst_HEADERS += src/ccutil/host.h noinst_HEADERS += src/ccutil/kdpair.h noinst_HEADERS += src/ccutil/lsterr.h @@ -376,7 +375,6 @@ libtesseract_ccutil_la_SOURCES += src/ccutil/clst.cpp libtesseract_ccutil_la_SOURCES += src/ccutil/elst2.cpp libtesseract_ccutil_la_SOURCES += src/ccutil/elst.cpp libtesseract_ccutil_la_SOURCES += src/ccutil/errcode.cpp -libtesseract_ccutil_la_SOURCES += src/ccutil/globaloc.cpp libtesseract_ccutil_la_SOURCES += src/ccutil/mainblk.cpp libtesseract_ccutil_la_SOURCES += src/ccutil/serialis.cpp libtesseract_ccutil_la_SOURCES += src/ccutil/strngs.cpp diff --git a/src/ccmain/control.cpp b/src/ccmain/control.cpp index 52e4be14a1..8964f62e48 100644 --- a/src/ccmain/control.cpp +++ b/src/ccmain/control.cpp @@ -400,7 +400,6 @@ bool Tesseract::recog_all_words(PAGE_RES* page_res, if (AnyTessLang() && !AnyLSTMLang()) { // ****************** Pass 3 ******************* // Fix fuzzy spaces. - set_global_loc_code(LOC_FUZZY_SPACE); if (!tessedit_test_adaption && tessedit_fix_fuzzy_spaces && !tessedit_word_for_word && !right_to_left()) @@ -425,7 +424,6 @@ bool Tesseract::recog_all_words(PAGE_RES* page_res, #endif // ndef DISABLED_LEGACY_ENGINE // Write results pass. - set_global_loc_code(LOC_WRITE_RESULTS); // This is now redundant, but retained commented so show how to obtain // bounding boxes and style information. @@ -616,7 +614,6 @@ void Tesseract::rejection_passes(PAGE_RES* page_res, // Gather statistics on rejects. int word_index = 0; while (!tessedit_test_adaption && page_res_it.word() != nullptr) { - set_global_loc_code(LOC_MM_ADAPT); WERD_RES* word = page_res_it.word(); word_index++; if (monitor != nullptr) { @@ -697,7 +694,6 @@ void Tesseract::rejection_passes(PAGE_RES* page_res, // ****************** Pass 6 ******************* // Do whole document or whole block rejection pass if (!tessedit_test_adaption) { - set_global_loc_code(LOC_DOC_BLK_REJ); quality_based_rejection(page_res_it, good_quality_doc); } } @@ -1580,7 +1576,6 @@ void Tesseract::classify_word_pass2(const WordData& word_data, prev_word_best_choice_ = word_data.prev_word != nullptr ? word_data.prev_word->word->best_choice : nullptr; - set_global_subloc_code(SUBLOC_NORM); check_debug_pt(word, 30); if (!word->done) { word->caps_height = 0.0; @@ -1598,8 +1593,6 @@ void Tesseract::classify_word_pass2(const WordData& word_data, // Use the tops and bottoms since they are available. TrainedXheightFix(word, block, row); } - - set_global_subloc_code(SUBLOC_NORM); } #ifndef GRAPHICS_DISABLED if (tessedit_display_outwords) { @@ -1613,7 +1606,6 @@ void Tesseract::classify_word_pass2(const WordData& word_data, ScrollView::Update(); } #endif - set_global_subloc_code(SUBLOC_NORM); check_debug_pt(word, 50); #endif // ndef DISABLED_LEGACY_ENGINE } diff --git a/src/ccutil/errcode.h b/src/ccutil/errcode.h index 9173c24a9e..5cd7c8961b 100644 --- a/src/ccutil/errcode.h +++ b/src/ccutil/errcode.h @@ -35,36 +35,6 @@ enum TessErrorLogCode { #define MEMORY_ABORT 2 #define FILE_ABORT 3 -/* Location of code at error codes Reserve 0..2 (status codes 0..23 for UNLV)*/ -#define LOC_UNUSED0 0 -#define LOC_UNUSED1 1 -#define LOC_UNUSED2 2 -#define LOC_INIT 3 -#define LOC_EDGE_PROG 4 -#define LOC_TEXT_ORD_ROWS 5 -#define LOC_TEXT_ORD_WORDS 6 -#define LOC_PASS1 7 -#define LOC_PASS2 8 -/* Reserve up to 8..13 for adding subloc 0/3 plus subsubloc 0/1/2 */ -#define LOC_FUZZY_SPACE 14 -/* Reserve up to 14..20 for adding subloc 0/3 plus subsubloc 0/1/2 */ -#define LOC_MM_ADAPT 21 -#define LOC_DOC_BLK_REJ 22 -#define LOC_WRITE_RESULTS 23 -#define LOC_ADAPTIVE 24 -/* DON'T DEFINE ANY LOCATION > 31 !!! */ - -/* Sub locatation determines whether pass2 was in normal mode or fix xht mode*/ -#define SUBLOC_NORM 0 -#define SUBLOC_FIX_XHT 3 - -/* Sub Sub locatation determines whether match_word_pass2 was in Tess - matcher, NN matcher or somewhere else */ - -#define SUBSUBLOC_OTHER 0 -#define SUBSUBLOC_TESS 1 -#define SUBSUBLOC_NN 2 - class TESS_API ERRCODE { // error handler class const char *message; // error message public: @@ -95,12 +65,4 @@ constexpr ERRCODE ASSERT_FAILED("Assert failed"); ASSERT_FAILED.error(#x, ABORT, "in file %s, line %d", __FILE__, __LINE__); \ } -void signal_exit(int signal_code); - -void set_global_loc_code(int loc_code); - -void set_global_subloc_code(int loc_code); - -void set_global_subsubloc_code(int loc_code); - #endif diff --git a/src/ccutil/globaloc.cpp b/src/ccutil/globaloc.cpp deleted file mode 100644 index 053dec4031..0000000000 --- a/src/ccutil/globaloc.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/********************************************************************** - * File: errcode.cpp (Formerly error.c) - * Description: Generic error handler function - * Author: Ray Smith - * - * (C) Copyright 1989, Hewlett-Packard Ltd. - ** Licensed under the Apache License, Version 2.0 (the "License"); - ** you may not use this file except in compliance with the License. - ** You may obtain a copy of the License at - ** http://www.apache.org/licenses/LICENSE-2.0 - ** Unless required by applicable law or agreed to in writing, software - ** distributed under the License is distributed on an "AS IS" BASIS, - ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ** See the License for the specific language governing permissions and - ** limitations under the License. - * - **********************************************************************/ - -#include "globaloc.h" -#include "allheaders.h" -#include "errcode.h" -#include "tprintf.h" - -// TODO: remove empty function? -void set_global_loc_code(int loc_code) { - // global_loc_code = loc_code; -} - -// TODO: remove empty function? -void set_global_subloc_code(int loc_code) { - // global_subloc_code = loc_code; -} - -// TODO: remove empty function? -void set_global_subsubloc_code(int loc_code) { - // global_subsubloc_code = loc_code; -} diff --git a/src/ccutil/globaloc.h b/src/ccutil/globaloc.h deleted file mode 100644 index a826c8270b..0000000000 --- a/src/ccutil/globaloc.h +++ /dev/null @@ -1,29 +0,0 @@ -/********************************************************************** - * File: globaloc.h (Formerly error.h) - * Description: Header file for generic error handler class - * Author: Ray Smith - * - * (C) Copyright 1990, Hewlett-Packard Ltd. - ** Licensed under the Apache License, Version 2.0 (the "License"); - ** you may not use this file except in compliance with the License. - ** You may obtain a copy of the License at - ** http://www.apache.org/licenses/LICENSE-2.0 - ** Unless required by applicable law or agreed to in writing, software - ** distributed under the License is distributed on an "AS IS" BASIS, - ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ** See the License for the specific language governing permissions and - ** limitations under the License. - * - **********************************************************************/ - -#ifndef GLOBALOC_H -#define GLOBALOC_H - - -void set_global_loc_code(int loc_code); - -void set_global_subloc_code(int loc_code); - -void set_global_subsubloc_code(int loc_code); - -#endif diff --git a/src/textord/tordmain.cpp b/src/textord/tordmain.cpp index ce2dcb56cf..41bcdd3b71 100644 --- a/src/textord/tordmain.cpp +++ b/src/textord/tordmain.cpp @@ -33,7 +33,7 @@ #include "coutln.h" // for C_OUTLINE_IT, C_OUTLINE_LIST, C_OUTLINE #include "drawtord.h" // for plot_box_list, to_win, create_to_win #include "edgblob.h" // for extract_edges -#include "errcode.h" // for set_global_loc_code, ASSERT_HOST, LOC... +#include "errcode.h" // for ASSERT_HOST, ... #include // for PointerVector, GenericVector #include "makerow.h" // for textord_test_x, textord_test_y, texto... #include "morph.h" // for L_BOUNDARY_BG @@ -225,8 +225,6 @@ void Textord::find_components(Pix* pix, BLOCK_LIST *blocks, return; // Can't handle it. } - set_global_loc_code(LOC_EDGE_PROG); - BLOCK_IT block_it(blocks); // iterator for (block_it.mark_cycle_pt(); !block_it.cycled_list(); block_it.forward()) {