mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-14 00:31:47 +08:00
featdefs: Optimize code by using constexpr
This also fixes some warnings from clang++: src/classify/featdefs.cpp:47:15: warning: declaration requires a global constructor [-Wglobal-constructors] src/classify/featdefs.cpp:57:15: warning: declaration requires a global constructor [-Wglobal-constructors] src/classify/featdefs.cpp:66:15: warning: declaration requires a global constructor [-Wglobal-constructors] src/classify/featdefs.cpp:75:15: warning: declaration requires a global constructor [-Wglobal-constructors] Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
a4e1378218
commit
cb6cf802e0
@ -29,10 +29,10 @@
|
||||
/*-----------------------------------------------------------------------------
|
||||
Global Data Definitions and Declarations
|
||||
-----------------------------------------------------------------------------*/
|
||||
const char* kMicroFeatureType = "mf";
|
||||
const char* kCNFeatureType = "cn";
|
||||
const char* kIntFeatureType = "if";
|
||||
const char* kGeoFeatureType = "tb";
|
||||
constexpr const char* kMicroFeatureType = "mf";
|
||||
constexpr const char* kCNFeatureType = "cn";
|
||||
constexpr const char* kIntFeatureType = "if";
|
||||
constexpr const char* kGeoFeatureType = "tb";
|
||||
|
||||
// Define all of the parameters for the MicroFeature type.
|
||||
StartParamDesc(MicroFeatureParams)
|
||||
|
@ -26,10 +26,10 @@
|
||||
|
||||
/* Enumerate the different types of features currently defined. */
|
||||
#define NUM_FEATURE_TYPES 4
|
||||
extern const char* kMicroFeatureType;
|
||||
extern const char* kCNFeatureType;
|
||||
extern const char* kIntFeatureType;
|
||||
extern const char* kGeoFeatureType;
|
||||
extern const char* const kMicroFeatureType;
|
||||
extern const char* const kCNFeatureType;
|
||||
extern const char* const kIntFeatureType;
|
||||
extern const char* const kGeoFeatureType;
|
||||
|
||||
/* A character is described by multiple sets of extracted features. Each
|
||||
set contains a number of features of a particular type, for example, a
|
||||
|
Loading…
Reference in New Issue
Block a user