Skip to content

Commit 3f77354

Browse files
committed
Removed unnecessary using statements and cleaned up google/non-google distinction
1 parent cec1037 commit 3f77354

13 files changed

+13
-37
lines changed

training/boxchar.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@
2727
#include <vector>
2828

2929
#include "allheaders.h" // from Leptonica
30-
31-
#ifdef USE_STD_NAMESPACE
32-
using std::string;
33-
using std::vector;
34-
#endif
30+
#include "platform.h"
3531

3632
struct Box;
3733

training/classifier_tester.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
// Author: Ray Smith
1818

1919
#include <stdio.h>
20-
#ifndef USE_STD_NAMESPACE
20+
#ifdef GOOGLE_TESSERACT
2121
#include "base/commandlineflags.h"
22-
#endif // USE_STD_NAMESPACE
22+
#endif // GOOGLE_TESSERACT
2323
#include "baseapi.h"
2424
#include "commontraining.h"
2525
#include "mastertrainer.h"

training/commandlineflags.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// limitations under the License.
1010
#include "commandlineflags.h"
1111

12-
#ifdef USE_STD_NAMESPACE
12+
#ifndef GOOGLE_TESSERACT
1313

1414
namespace tesseract {
1515
bool IntFlagExists(const char* flag_name, inT32* value) {

training/commandlineflags.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef TESSERACT_TRAINING_COMMANDLINEFLAGS_H_
2020
#define TESSERACT_TRAINING_COMMANDLINEFLAGS_H_
2121

22-
#ifdef USE_STD_NAMESPACE
22+
#ifndef GOOGLE_TESSERACT
2323

2424
#include <stdlib.h>
2525
#include "tprintf.h"

training/fileio.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
#include <cstdio>
2222
#include <string>
2323

24-
#ifdef USE_STD_NAMESPACE
25-
using std::string;
26-
#endif
24+
#include "platform.h"
2725

2826
namespace tesseract {
2927

training/lstmeval.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// limitations under the License.
1717
///////////////////////////////////////////////////////////////////////
1818

19-
#ifndef USE_STD_NAMESPACE
19+
#ifdef GOOGLE_TESSERACT
2020
#include "base/commandlineflags.h"
2121
#endif
2222
#include "commontraining.h"

training/lstmtraining.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// limitations under the License.
1717
///////////////////////////////////////////////////////////////////////
1818

19-
#ifndef USE_STD_NAMESPACE
19+
#ifdef GOOGLE_TESSERACT
2020
#include "base/commandlineflags.h"
2121
#endif
2222
#include "commontraining.h"

training/pango_font_info.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
STRING_PARAM_FLAG(fontconfig_tmpdir, "/tmp",
5050
"Overrides fontconfig default temporary dir");
5151

52-
#ifndef USE_STD_NAMESPACE
52+
#ifdef GOOGLE_TESSERACT
5353
#include "ocr/trainingdata/typesetting/legacy_fonts.h"
5454
BOOL_PARAM_FLAG(use_only_legacy_fonts, false,
5555
"Overrides --fonts_dir and sets the known universe of fonts to"
@@ -544,7 +544,7 @@ const std::vector<string>& FontUtils::ListAvailableFonts() {
544544
if (!available_fonts_.empty()) {
545545
return available_fonts_;
546546
}
547-
#ifndef USE_STD_NAMESPACE
547+
#ifdef GOOGLE_TESSERACT
548548
if (FLAGS_use_only_legacy_fonts) {
549549
// Restrict view to list of fonts in legacy_fonts.h
550550
tprintf("Using list of legacy fonts only\n");

training/shapeclustering.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "config_auto.h"
2121
#endif
2222

23-
#ifndef USE_STD_NAMESPACE
23+
#ifdef GOOGLE_TESSERACT
2424
#include "base/commandlineflags.h"
2525
#endif
2626
#include "commontraining.h"

training/stringrenderer.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@
3939
#include "unicode/uchar.h" // from libicu
4040
#include "util.h"
4141

42-
#ifdef USE_STD_NAMESPACE
43-
using std::map;
44-
using std::max;
45-
using std::min;
46-
using std::swap;
47-
#endif
48-
4942
namespace tesseract {
5043

5144
static const int kDefaultOutputResolution = 300;

training/text2image.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@
5050
#include "unicharset.h"
5151
#include "util.h"
5252

53-
#ifdef USE_STD_NAMESPACE
54-
using std::make_pair;
55-
using std::map;
56-
using std::pair;
57-
#endif
58-
5953
// A number with which to initialize the random number generator.
6054
const int kRandomSeed = 0x18273645;
6155

training/unicharset_training_utils.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222

2323
#include <string>
2424

25-
#ifdef USE_STD_NAMESPACE
26-
using std::string;
27-
#endif
25+
#include "platform.h"
2826

2927
class STATS;
3028
class UNICHARSET;

training/util.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
#include <string>
2626
#include <vector>
2727

28-
#ifdef USE_STD_NAMESPACE
29-
using std::string;
30-
using std::vector;
31-
#endif
28+
#include "platform.h"
3229

3330
// StringHash is the hashing functor needed by the stl hash map.
3431
#ifndef COMPILER_MSVC

0 commit comments

Comments
 (0)