Skip to content

Commit

Permalink
Remove unused macros
Browse files Browse the repository at this point in the history
This fixes compiler warnings from clang++ like these ones:

    src/ccutil/params.cpp:34:9: warning: macro is not used [-Wunused-macros]
    src/cutil/oldlist.cpp:67:9: warning: macro is not used [-Wunused-macros]
    src/cutil/oldlist.cpp:68:9: warning: macro is not used [-Wunused-macros]
    src/cutil/oldlist.cpp:78:9: warning: macro is not used [-Wunused-macros]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed May 26, 2019
1 parent 3971562 commit ac999b2
Show file tree
Hide file tree
Showing 20 changed files with 7 additions and 79 deletions.
3 changes: 0 additions & 3 deletions src/ccmain/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
#include "tessvars.h"
#include "werdit.h"

#define MIN_FONT_ROW_COUNT 8
#define MAX_XHEIGHT_DIFF 3

const char* const kBackUpConfigFile = "tempconfigdata.config";
// Min believable x-height for any text when refitting as a fraction of
// original x-height
Expand Down
1 change: 0 additions & 1 deletion src/ccmain/fixspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class BLOCK;
class ROW;

#define PERFECT_WERDS 999
#define MAXSPACING 128 /*max expected spacing in pix */

namespace tesseract {

Expand Down
9 changes: 1 addition & 8 deletions src/ccmain/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,7 @@
#include "reject.h"
#endif

#define EPAPER_EXT ".ep"
#define PAGE_YSIZE 3508
#define CTRL_INSET '\024' //dc4=text inset
#define CTRL_FONT '\016' //so=font change
#define CTRL_DEFAULT '\017' //si=default font
#define CTRL_SHIFT '\022' //dc2=x shift
#define CTRL_TAB '\011' //tab
#define CTRL_NEWLINE '\012' //newline
#define CTRL_NEWLINE '\012' //newline
#define CTRL_HARDLINE '\015' //cr

namespace tesseract {
Expand Down
1 change: 0 additions & 1 deletion src/ccmain/pgedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#define X_HEIGHT (kBlnBaselineOffset + kBlnXHeight)
#define BL_HEIGHT kBlnBaselineOffset
#define DESC_HEIGHT 0
#define MAXSPACING 128 /*max expected spacing in pix */

enum CMD_EVENTS
{
Expand Down
3 changes: 0 additions & 3 deletions src/ccmain/tessedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
# include "lstmrecognizer.h"
#endif

// config under api
#define API_CONFIG "configs/api_config"

namespace tesseract {

// Read a "config" file containing a set of variable, value pairs.
Expand Down
2 changes: 0 additions & 2 deletions src/ccstruct/ocrblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#include "stepblob.h"
#include "tprintf.h"

#define BLOCK_LABEL_HEIGHT 150 //char height of block id

ELISTIZE (BLOCK)
/**
* BLOCK::BLOCK
Expand Down
1 change: 0 additions & 1 deletion src/ccstruct/polyaprx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "tprintf.h" // for tprintf
#include "vecfuncs.h" // for LENGTH, point_diff, CROSS

#define EXTERN
#define FASTEDGELENGTH 256

static BOOL_VAR(poly_debug, false, "Debug old poly");
Expand Down
1 change: 0 additions & 1 deletion src/ccutil/params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

#define PLUS '+' //flag states
#define MINUS '-'
#define EQUAL '='

tesseract::ParamsVectors *GlobalParams() {
static tesseract::ParamsVectors global_params = tesseract::ParamsVectors();
Expand Down
2 changes: 0 additions & 2 deletions src/classify/cutoffs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#include "serialis.h"
#include "unichar.h"

#define REALLY_QUOTE_IT(x) QUOTE_IT(x)

#define MAX_CUTOFF 1000

namespace tesseract {
Expand Down
8 changes: 0 additions & 8 deletions src/classify/mfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
Include Files and Type Defines
----------------------------------------------------------------------------*/

#define _USE_MATH_DEFINES // for M_PI
#include "mfx.h"
#include <cmath> // for M_PI
#include "mfdefs.h"
#include "mfoutline.h"
#include "clusttool.h" //NEEDED
Expand All @@ -38,12 +36,6 @@ double_VAR(classify_min_slope, 0.414213562,
double_VAR(classify_max_slope, 2.414213562,
"Slope above which lines are called vertical");

/*----------------------------------------------------------------------------
Macros
----------------------------------------------------------------------------*/
/* miscellaneous macros */
#define NormalizeAngle(A) ((((A) < 0) ? ((A) + 2 * M_PI) : (A)) / (2 * M_PI))

/*----------------------------------------------------------------------------
Private Function Prototypes
-----------------------------------------------------------------------------*/
Expand Down
17 changes: 0 additions & 17 deletions src/cutil/oldlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,6 @@
#include "errcode.h" // for ASSERT_HOST
#include "structures.h"

/*----------------------------------------------------------------------
M a c r o s
----------------------------------------------------------------------*/
#define add_on(l, x) l = push(l, first_node(x))
#define next_one(l) l = list_rest(l)

/**********************************************************************
* c o p y f i r s t
*
* Do the appropriate kind a push operation to copy the first node from
* one list to another.
*
**********************************************************************/

#define copy_first(l1,l2) \
(l2=push(l2, first_node(l1)))

/*----------------------------------------------------------------------
F u n c t i o n s
----------------------------------------------------------------------*/
Expand Down
2 changes: 0 additions & 2 deletions src/textord/edgblob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "config_auto.h"
#endif

#define EXTERN

// Control parameters used in outline_complexity(), which rejects an outline
// if any one of the 3 conditions is satisfied:
// - number of children exceeds edges_max_children_per_outline
Expand Down
5 changes: 1 addition & 4 deletions src/textord/oldbasel.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**********************************************************************
* File: oldbasel.cpp (Formerly oldbl.c)
* Description: A re-implementation of the old baseline algorithm.
* Author: Ray Smith
* Author: Ray Smith
*
* (C) Copyright 1993, Hewlett-Packard Ltd.
** Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -65,9 +65,6 @@ static double_VAR (textord_oldbl_jumplimit, 0.15,
#define MAXOVERLAP 0.1 /*max 10% missed overlap */
#define MAXBADRUN 2 /*max non best for failed */
#define HEIGHTBUCKETS 200 /* Num of buckets */
#define DELTAHEIGHT 5.0 /* Small amount of diff */
#define GOODHEIGHT 5
#define MAXLOOPS 10
#define MODENUM 10
#define MAXPARTS 6
#define SPLINESIZE 23
Expand Down
2 changes: 0 additions & 2 deletions src/textord/pithsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include "pithsync.h"
#include "tprintf.h"

#define PROJECTION_MARGIN 10 //arbitrary

/**********************************************************************
* FPCUTPT::setup
*
Expand Down
1 change: 0 additions & 1 deletion src/textord/topitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ EXTERN double_VAR (textord_projection_scale, 0.200, "Ding rate for mid-cuts");
EXTERN double_VAR (textord_balance_factor, 1.0,
"Ding rate for unbalanced char cells");

#define FIXED_WIDTH_MULTIPLE 5
#define BLOCK_STATS_CLUSTERS 10
#define MAX_ALLOWED_PITCH 100 //max pixel pitch.

Expand Down
8 changes: 2 additions & 6 deletions src/textord/underlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@

#include "underlin.h"

#define PROJECTION_MARGIN 10 //arbitrary
#define EXTERN

EXTERN double_VAR (textord_underline_offset, 0.1, "Fraction of x to ignore");
EXTERN BOOL_VAR (textord_restore_underlines, true,
"Chop underlines & put back");
double_VAR (textord_underline_offset, 0.1, "Fraction of x to ignore");
BOOL_VAR (textord_restore_underlines, true, "Chop underlines & put back");

/**********************************************************************
* restore_underlined_blobs
Expand Down
1 change: 0 additions & 1 deletion src/textord/wordseg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ EXTERN BOOL_VAR(textord_force_make_prop_words, false,
EXTERN BOOL_VAR(textord_chopper_test, false,
"Chopper is being tested.");

#define FIXED_WIDTH_MULTIPLE 5
#define BLOCK_STATS_CLUSTERS 10


Expand Down
2 changes: 0 additions & 2 deletions src/training/mftraining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ using tesseract::MasterTrainer;
using tesseract::Shape;
using tesseract::ShapeTable;

#define PROGRAM_FEATURE_TYPE "mf"

// Max length of a fake shape label.
const int kMaxShapeLabelLength = 10;

Expand Down
16 changes: 3 additions & 13 deletions src/wordrec/drawfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,13 @@
#define FXDEMOYSIZE 256
#define BLN_MAX 512 //max coord for bln
#define WERDWIDTH (BLN_MAX*20)
#define DECENT_WERD_WIDTH (5*kBlnXHeight)
//title of window
#define DEBUG_WIN_NAME "FXDebug"
#define DEBUG_XPOS 0
#define DEBUG_YPOS 120
#define DEBUG_XSIZE 80
#define DEBUG_YSIZE 32
#define YMAX 3508
#define XMAX 2550
#define MAXEDGELENGTH 1024 //max steps inoutline

#define EXTERN
STRING_VAR(fx_debugfile, DEBUG_WIN_NAME, "Name of debugfile");

EXTERN STRING_VAR (fx_debugfile, DEBUG_WIN_NAME, "Name of debugfile");

EXTERN ScrollView* fx_win = nullptr;
EXTERN FILE *fx_debug = nullptr;
ScrollView* fx_win = nullptr;
FILE* fx_debug = nullptr;

/**********************************************************************
* create_fx_win
Expand Down
1 change: 0 additions & 1 deletion src/wordrec/findseam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
/* How many to keep */
#define MAX_NUM_SEAMS 150
/* How many to keep */
#define MAX_OLD_SEAMS 150
#define NO_FULL_PRIORITY -1/* Special marker for pri. */
/* Evaluate right away */
#define BAD_PRIORITY 9999.0
Expand Down

0 comments on commit ac999b2

Please sign in to comment.