Skip to content

Commit 70c6f16

Browse files
committed
Fix #define guards in header files
Some guards were missing, others were not the first statement. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 4897796 commit 70c6f16

File tree

10 files changed

+48
-24
lines changed

10 files changed

+48
-24
lines changed

ccmain/paramsd.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
//
2020
// Tesseract parameter editor is used to edit all the parameters used
2121
// within tesseract from the ui.
22+
#ifndef TESSERACT_CCMAIN_PARAMSD_H_
23+
#define TESSERACT_CCMAIN_PARAMSD_H_
24+
2225
#ifndef GRAPHICS_DISABLED
23-
#ifndef VARABLED_H
24-
#define VARABLED_H
2526

2627
#include "elst.h"
2728
#ifndef NO_CUBE_BUILD
@@ -122,5 +123,5 @@ class ParamsEditor : public SVEventHandler {
122123
ScrollView* sv_window_;
123124
};
124125

125-
#endif
126-
#endif
126+
#endif // GRAPHICS_DISABLED
127+
#endif // TESSERACT_CCMAIN_PARAMSD_H_

ccutil/genericheap.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
//
2020
///////////////////////////////////////////////////////////////////////
2121

22-
#include "errcode.h"
23-
#include "genericvector.h"
24-
2522
#ifndef TESSERACT_CCUTIL_GENERICHEAP_H_
2623
#define TESSERACT_CCUTIL_GENERICHEAP_H_
2724

25+
#include "errcode.h"
26+
#include "genericvector.h"
27+
2828
namespace tesseract {
2929

3030
// GenericHeap requires 1 template argument:

ccutil/lsterr.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
*
1818
**********************************************************************/
1919

20-
#include "errcode.h" //must be last include
20+
#ifndef TESSERACT_CCUTIL_LSTERR_H_
21+
#define TESSERACT_CCUTIL_LSTERR_H_
2122

22-
#ifndef LSTERR_H
23-
#define LSTERR_H
23+
#include "errcode.h" //must be last include
2424

2525
const ERRCODE DONT_CONSTRUCT_LIST_BY_COPY =
2626
"Can't create a list by assignment";
@@ -39,5 +39,6 @@ const ERRCODE EMPTY_LIST = "List is empty";
3939
const ERRCODE BAD_PARAMETER = "List parameter error";
4040
const ERRCODE STILL_LINKED =
4141
"Attempting to add an element with non NULL links, to a list";
42-
#endif
43-
#endif
42+
43+
#endif // !NDEBUG
44+
#endif // TESSERACT_CCUTIL_LSTERR_H_

ccutil/universalambigs.h

+5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@
1818
//
1919
///////////////////////////////////////////////////////////////////////
2020

21+
#ifndef TESSERACT_CCUTIL_UNIVERSALAMBIGS_H_
22+
#define TESSERACT_CCUTIL_UNIVERSALAMBIGS_H_
23+
2124
namespace tesseract {
2225

2326
extern const char kUniversalAmbigsFile[];
2427
extern const int ksizeofUniversalAmbigsFile;
2528

2629
} // namespace tesseract
30+
31+
#endif // TESSERACT_CCUTIL_UNIVERSALAMBIGS_H_

classify/clusttool.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
** See the License for the specific language governing permissions and
1616
** limitations under the License.
1717
******************************************************************************/
18-
#ifndef __CLUSTERTOOL__
19-
#define __CLUSTERTOOL__
18+
19+
#ifndef TESSERACT_CLASSIFY_CLUSTTOOL_H_
20+
#define TESSERACT_CLASSIFY_CLUSTTOOL_H_
2021

2122
//--------------------------Include Files---------------------------------------
2223
#include "host.h"
@@ -61,4 +62,4 @@ void WriteProtoList(FILE *File, uinT16 N, PARAM_DESC ParamDesc[],
6162
#define ILLEGALDISTRIBUTION 5008
6263
#define ILLEGALFLOAT 5009
6364
#define ILLEGALESSENTIALSPEC 5013
64-
#endif
65+
#endif // TESSERACT_CLASSIFY_CLUSTTOOL_H_

opencl/opencl_device_selection.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
88
// See the License for the specific language governing permissions and
99
// limitations under the License.
10-
#ifdef USE_OPENCL
10+
1111
#ifndef DEVICE_SELECTION_H
1212
#define DEVICE_SELECTION_H
1313

14+
#ifdef USE_OPENCL
1415

1516
#ifdef _MSC_VER
1617
#define _CRT_SECURE_NO_WARNINGS
@@ -580,5 +581,5 @@ static ds_status readProfileFromFile(ds_profile* profile,
580581
return status;
581582
}
582583

583-
#endif
584-
#endif
584+
#endif // USE_OPENCL
585+
#endif // DEVICE_SELECTION_H

opencl/openclwrapper.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
88
// See the License for the specific language governing permissions and
99
// limitations under the License.
10+
11+
#ifndef TESSERACT_OPENCL_OPENCLWRAPPER_H_
12+
#define TESSERACT_OPENCL_OPENCLWRAPPER_H_
13+
1014
#include <stdio.h>
1115
#include "allheaders.h"
1216
#include "pix.h"
@@ -323,4 +327,5 @@ class OpenclDevice
323327
};
324328

325329

326-
#endif
330+
#endif // USE_OPENCL
331+
#endif // TESSERACT_OPENCL_OPENCLWRAPPER_H_

training/mergenf.h

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
** See the License for the specific language governing permissions and
1616
** limitations under the License.
1717
******************************************************************************/
18+
19+
#ifndef TESSERACT_TRAINING_MERGENF_H_
20+
#define TESSERACT_TRAINING_MERGENF_H_
21+
1822
/**----------------------------------------------------------------------------
1923
Include Files and Type Defines
2024
----------------------------------------------------------------------------**/
@@ -95,3 +99,5 @@ BOOL8 PointInside (
9599
FRECT *Rectangle,
96100
FLOAT32 X,
97101
FLOAT32 Y);
102+
103+
#endif // TESSERACT_TRAINING_MERGENF_H_

training/tessopt.h

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
*
1818
**********************************************************************/
1919

20+
#ifndef TESSERACT_TRAINING_TESSOPT_H_
21+
#define TESSERACT_TRAINING_TESSOPT_H_
22+
2023
#include "host.h"
2124

2225
extern int tessoptind;
@@ -27,3 +30,5 @@ inT32 argc, //arg count
2730
char *argv[], //args
2831
const char *arglist //string of arg chars
2932
);
33+
34+
#endif // TESSERACT_TRAINING_TESSOPT_H_

wordrec/lm_consistency.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
//
1919
////////////////////////////////////////////////////////////////////////
2020

21+
#ifndef TESSERACT_WORDREC_LM_CONSISTENCY_H_
22+
#define TESSERACT_WORDREC_LM_CONSISTENCY_H_
23+
2124
#include "dawg.h"
2225
#include "dict.h"
2326
#include "host.h"
2427
#include "ratngs.h"
2528

26-
#ifndef TESSERACT_WORDREC_CONSISTENCY_H_
27-
#define TESSERACT_WORDREC_CONSISTENCY_H_
28-
2929
namespace tesseract {
3030

3131
static const char * const XHeightConsistencyEnumName[] = {
@@ -137,7 +137,6 @@ struct LMConsistencyInfo {
137137
XHeightConsistencyEnum xht_decision;
138138
};
139139

140-
141140
} // namespace tesseract
142141

143-
#endif // TESSERACT_WORDREC_CONSISTENCY_H_
142+
#endif // TESSERACT_WORDREC_LM_CONSISTENCY_H_

0 commit comments

Comments
 (0)