Skip to content

Commit

Permalink
Remove some unused functions, constants and variables
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
stweil committed May 26, 2019
1 parent 29f2cff commit a86143a
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 28 deletions.
2 changes: 0 additions & 2 deletions src/ccmain/pgedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions src/ccstruct/werd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

/**
Expand Down
5 changes: 0 additions & 5 deletions src/ccutil/mainblk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/ccutil/strngs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<nul> = 16.
const int kMaxDoubleSize = 16;

/**********************************************************************
* STRING_HEADER provides metadata about the allocated buffer,
Expand Down
3 changes: 1 addition & 2 deletions src/textord/bbgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/textord/tablefind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions src/viewer/svutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit a86143a

Please sign in to comment.