Skip to content

Commit a86143a

Browse files
committed
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 <sw@weilnetz.de>
1 parent 29f2cff commit a86143a

File tree

7 files changed

+2
-28
lines changed

7 files changed

+2
-28
lines changed

src/ccmain/pgedit.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
#define DESC_HEIGHT 0
4545
#define MAXSPACING 128 /*max expected spacing in pix */
4646

47-
constexpr ERRCODE EMPTYBLOCKLIST("No blocks to edit");
48-
4947
enum CMD_EVENTS
5048
{
5149
NULL_CMD_EVENT,

src/ccstruct/werd.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
#define LAST_COLOUR ScrollView::AQUAMARINE ///< last rainbow colour
3030
#define CHILD_COLOUR ScrollView::BROWN ///< colour of children
3131

32-
constexpr ERRCODE CANT_SCALE_EDGESTEPS(
33-
"Attempted to scale an edgestep format word");
34-
3532
ELIST2IZE(WERD)
3633

3734
/**

src/ccutil/mainblk.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* File: mainblk.cpp (Formerly main.c)
33
* Description: Function to call from main() to setup.
44
* Author: Ray Smith
5-
* Created: Tue Oct 22 11:09:40 BST 1991
65
*
76
* (C) Copyright 1991, Hewlett-Packard Ltd.
87
** Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,10 +24,6 @@
2524
#include "fileerr.h"
2625
#include "ccutil.h"
2726

28-
const ERRCODE NO_PATH =
29-
"Warning:explicit path for executable will not be used for configs";
30-
static const ERRCODE USAGE = "Usage";
31-
3227
namespace tesseract {
3328
/**********************************************************************
3429
* main_setup

src/ccutil/strngs.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ using tesseract::TFile;
3131
// Size of buffer needed to host the decimal representation of the maximum
3232
// possible length of an int (in 64 bits), being -<20 digits>.
3333
const int kMaxIntSize = 22;
34-
// Size of buffer needed to host the decimal representation of the maximum
35-
// possible length of a %.8g being -1.2345678e+999<nul> = 16.
36-
const int kMaxDoubleSize = 16;
3734

3835
/**********************************************************************
3936
* STRING_HEADER provides metadata about the allocated buffer,

src/textord/bbgrid.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Description: Class to hold BLOBNBOXs in a grid for fast access
44
// to neighbours.
55
// Author: Ray Smith
6-
// Created: Wed Jun 06 17:22:01 PDT 2007
76
//
87
// (C) Copyright 2007, Google Inc.
98
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -100,7 +99,7 @@ void IntGrid::Clear() {
10099
void IntGrid::Rotate(const FCOORD& rotation) {
101100
ASSERT_HOST(rotation.x() == 0.0f || rotation.y() == 0.0f);
102101
ICOORD old_bleft(bleft());
103-
ICOORD old_tright(tright());
102+
//ICOORD old_tright(tright());
104103
int old_width = gridwidth();
105104
int old_height = gridheight();
106105
TBOX box(bleft(), tright());

src/textord/tablefind.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const double kTableColumnThreshold = 3.0;
8989

9090
// Search for horizontal ruling lines within the vertical margin as a
9191
// multiple of grid size
92-
const int kRulingVerticalMargin = 3;
92+
// const int kRulingVerticalMargin = 3;
9393

9494
// Minimum overlap that a colpartition must have with a table region
9595
// to become part of that table

src/viewer/svutil.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -315,18 +315,6 @@ static std::string ScrollViewCommand(std::string scrollview_path) {
315315
return command;
316316
}
317317

318-
319-
// Platform-independent freeaddrinfo()
320-
static void TessFreeAddrInfo(struct addrinfo* addr_info) {
321-
#if defined(__linux__)
322-
freeaddrinfo(addr_info);
323-
#else
324-
delete addr_info->ai_addr;
325-
delete addr_info;
326-
#endif
327-
}
328-
329-
330318
// Set up a connection to a ScrollView on hostname:port.
331319
SVNetwork::SVNetwork(const char* hostname, int port) {
332320
msg_buffer_in_ = new char[kMaxMsgSize + 1];

0 commit comments

Comments
 (0)