From a86143a41dbb18d2b35e39e8e31fc291e1619ff8 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 26 May 2019 11:52:31 +0200 Subject: [PATCH] Remove some unused functions, constants and variables This fixes compiler warnings, for example: src/ccutil/strngs.cpp:36:11: warning: unused variable 'kMaxDoubleSize' [-Wunused-const-variable] src/viewer/svutil.cpp:320:13: warning: unused function 'TessFreeAddrInfo' [-Wunused-function] src/ccstruct/werd.cpp:32:19: warning: unused variable 'CANT_SCALE_EDGESTEPS' [-Wunused-const-variable] src/textord/bbgrid.cpp:103:10: warning: unused variable 'old_tright' [-Wunused-variable] Signed-off-by: Stefan Weil --- src/ccmain/pgedit.cpp | 2 -- src/ccstruct/werd.cpp | 3 --- src/ccutil/mainblk.cpp | 5 ----- src/ccutil/strngs.cpp | 3 --- src/textord/bbgrid.cpp | 3 +-- src/textord/tablefind.cpp | 2 +- src/viewer/svutil.cpp | 12 ------------ 7 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/ccmain/pgedit.cpp b/src/ccmain/pgedit.cpp index a7607f3f53..e4f02c2b92 100644 --- a/src/ccmain/pgedit.cpp +++ b/src/ccmain/pgedit.cpp @@ -44,8 +44,6 @@ #define DESC_HEIGHT 0 #define MAXSPACING 128 /*max expected spacing in pix */ -constexpr ERRCODE EMPTYBLOCKLIST("No blocks to edit"); - enum CMD_EVENTS { NULL_CMD_EVENT, diff --git a/src/ccstruct/werd.cpp b/src/ccstruct/werd.cpp index 6d724b3807..831657436c 100644 --- a/src/ccstruct/werd.cpp +++ b/src/ccstruct/werd.cpp @@ -29,9 +29,6 @@ #define LAST_COLOUR ScrollView::AQUAMARINE ///< last rainbow colour #define CHILD_COLOUR ScrollView::BROWN ///< colour of children -constexpr ERRCODE CANT_SCALE_EDGESTEPS( - "Attempted to scale an edgestep format word"); - ELIST2IZE(WERD) /** diff --git a/src/ccutil/mainblk.cpp b/src/ccutil/mainblk.cpp index e1741de69f..98fd527152 100644 --- a/src/ccutil/mainblk.cpp +++ b/src/ccutil/mainblk.cpp @@ -2,7 +2,6 @@ * File: mainblk.cpp (Formerly main.c) * Description: Function to call from main() to setup. * Author: Ray Smith - * Created: Tue Oct 22 11:09:40 BST 1991 * * (C) Copyright 1991, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,10 +24,6 @@ #include "fileerr.h" #include "ccutil.h" -const ERRCODE NO_PATH = -"Warning:explicit path for executable will not be used for configs"; -static const ERRCODE USAGE = "Usage"; - namespace tesseract { /********************************************************************** * main_setup diff --git a/src/ccutil/strngs.cpp b/src/ccutil/strngs.cpp index f23265335a..d1575791f3 100644 --- a/src/ccutil/strngs.cpp +++ b/src/ccutil/strngs.cpp @@ -31,9 +31,6 @@ using tesseract::TFile; // Size of buffer needed to host the decimal representation of the maximum // possible length of an int (in 64 bits), being -<20 digits>. const int kMaxIntSize = 22; -// Size of buffer needed to host the decimal representation of the maximum -// possible length of a %.8g being -1.2345678e+999 = 16. -const int kMaxDoubleSize = 16; /********************************************************************** * STRING_HEADER provides metadata about the allocated buffer, diff --git a/src/textord/bbgrid.cpp b/src/textord/bbgrid.cpp index 5f758fcac8..6e3e334679 100644 --- a/src/textord/bbgrid.cpp +++ b/src/textord/bbgrid.cpp @@ -3,7 +3,6 @@ // Description: Class to hold BLOBNBOXs in a grid for fast access // to neighbours. // Author: Ray Smith -// Created: Wed Jun 06 17:22:01 PDT 2007 // // (C) Copyright 2007, Google Inc. // Licensed under the Apache License, Version 2.0 (the "License"); @@ -100,7 +99,7 @@ void IntGrid::Clear() { void IntGrid::Rotate(const FCOORD& rotation) { ASSERT_HOST(rotation.x() == 0.0f || rotation.y() == 0.0f); ICOORD old_bleft(bleft()); - ICOORD old_tright(tright()); + //ICOORD old_tright(tright()); int old_width = gridwidth(); int old_height = gridheight(); TBOX box(bleft(), tright()); diff --git a/src/textord/tablefind.cpp b/src/textord/tablefind.cpp index 1c2ca56166..4f2529f473 100644 --- a/src/textord/tablefind.cpp +++ b/src/textord/tablefind.cpp @@ -89,7 +89,7 @@ const double kTableColumnThreshold = 3.0; // Search for horizontal ruling lines within the vertical margin as a // multiple of grid size -const int kRulingVerticalMargin = 3; +// const int kRulingVerticalMargin = 3; // Minimum overlap that a colpartition must have with a table region // to become part of that table diff --git a/src/viewer/svutil.cpp b/src/viewer/svutil.cpp index 1fcb33a638..b1d03c14aa 100644 --- a/src/viewer/svutil.cpp +++ b/src/viewer/svutil.cpp @@ -315,18 +315,6 @@ static std::string ScrollViewCommand(std::string scrollview_path) { return command; } - -// Platform-independent freeaddrinfo() -static void TessFreeAddrInfo(struct addrinfo* addr_info) { - #if defined(__linux__) - freeaddrinfo(addr_info); - #else - delete addr_info->ai_addr; - delete addr_info; - #endif -} - - // Set up a connection to a ScrollView on hostname:port. SVNetwork::SVNetwork(const char* hostname, int port) { msg_buffer_in_ = new char[kMaxMsgSize + 1];