Skip to content

Commit

Permalink
Replace reserved identifiers used in #define guards header files
Browse files Browse the repository at this point in the history
Use macro names as suggested by the Google C++ Style Guide
(https://google.github.io/styleguide/cppguide.html#The__define_Guard).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Dec 4, 2016
1 parent 3e11fc1 commit 4897796
Show file tree
Hide file tree
Showing 55 changed files with 165 additions and 163 deletions.
6 changes: 3 additions & 3 deletions api/apitypes.h
Expand Up @@ -17,8 +17,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_API_APITYPES_H__
#define TESSERACT_API_APITYPES_H__
#ifndef TESSERACT_API_APITYPES_H_
#define TESSERACT_API_APITYPES_H_

#include "publictypes.h"

Expand All @@ -30,4 +30,4 @@
// than the lower-level one, and lower-level code should be sure to include
// only the lower-level file.

#endif // TESSERACT_API_APITYPES_H__
#endif // TESSERACT_API_APITYPES_H_
6 changes: 3 additions & 3 deletions api/baseapi.h
Expand Up @@ -17,8 +17,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_API_BASEAPI_H__
#define TESSERACT_API_BASEAPI_H__
#ifndef TESSERACT_API_BASEAPI_H_
#define TESSERACT_API_BASEAPI_H_

#define TESSERACT_VERSION_STR "4.00.00alpha"
#define TESSERACT_VERSION 0x040000
Expand Down Expand Up @@ -909,4 +909,4 @@ class TESS_API TessBaseAPI {
STRING HOcrEscape(const char* text);
} // namespace tesseract.

#endif // TESSERACT_API_BASEAPI_H__
#endif // TESSERACT_API_BASEAPI_H_
6 changes: 3 additions & 3 deletions api/renderer.h
Expand Up @@ -15,8 +15,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_API_RENDERER_H__
#define TESSERACT_API_RENDERER_H__
#ifndef TESSERACT_API_RENDERER_H_
#define TESSERACT_API_RENDERER_H_

// To avoid collision with other typenames include the ABSOLUTE MINIMUM
// complexity of includes here. Use forward declarations wherever possible
Expand Down Expand Up @@ -251,4 +251,4 @@ class TESS_API TessOsdRenderer : public TessResultRenderer {

} // namespace tesseract.

#endif // TESSERACT_API_RENDERER_H__
#endif // TESSERACT_API_RENDERER_H_
4 changes: 2 additions & 2 deletions ccmain/equationdetect.h
Expand Up @@ -17,8 +17,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCMAIN_EQUATIONDETECT_H__
#define TESSERACT_CCMAIN_EQUATIONDETECT_H__
#ifndef TESSERACT_CCMAIN_EQUATIONDETECT_H_
#define TESSERACT_CCMAIN_EQUATIONDETECT_H_

#include "blobbox.h"
#include "equationdetectbase.h"
Expand Down
6 changes: 3 additions & 3 deletions ccmain/ltrresultiterator.h
Expand Up @@ -18,8 +18,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCMAIN_LTR_RESULT_ITERATOR_H__
#define TESSERACT_CCMAIN_LTR_RESULT_ITERATOR_H__
#ifndef TESSERACT_CCMAIN_LTR_RESULT_ITERATOR_H_
#define TESSERACT_CCMAIN_LTR_RESULT_ITERATOR_H_

#include "platform.h"
#include "pageiterator.h"
Expand Down Expand Up @@ -218,4 +218,4 @@ class ChoiceIterator {

} // namespace tesseract.

#endif // TESSERACT_CCMAIN_LTR_RESULT_ITERATOR_H__
#endif // TESSERACT_CCMAIN_LTR_RESULT_ITERATOR_H_
6 changes: 3 additions & 3 deletions ccmain/mutableiterator.h
Expand Up @@ -18,8 +18,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCMAIN_MUTABLEITERATOR_H__
#define TESSERACT_CCMAIN_MUTABLEITERATOR_H__
#ifndef TESSERACT_CCMAIN_MUTABLEITERATOR_H_
#define TESSERACT_CCMAIN_MUTABLEITERATOR_H_

#include "resultiterator.h"

Expand Down Expand Up @@ -61,4 +61,4 @@ class MutableIterator : public ResultIterator {

} // namespace tesseract.

#endif // TESSERACT_CCMAIN_MUTABLEITERATOR_H__
#endif // TESSERACT_CCMAIN_MUTABLEITERATOR_H_
6 changes: 3 additions & 3 deletions ccmain/osdetect.h
Expand Up @@ -17,8 +17,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCMAIN_OSDETECT_H__
#define TESSERACT_CCMAIN_OSDETECT_H__
#ifndef TESSERACT_CCMAIN_OSDETECT_H_
#define TESSERACT_CCMAIN_OSDETECT_H_

#include "strngs.h"
#include "unicharset.h"
Expand Down Expand Up @@ -135,4 +135,4 @@ bool os_detect_blob(BLOBNBOX* bbox, OrientationDetector* o,
// applied for the text to be upright (readable).
TESS_API int OrientationIdToValue(const int& id);

#endif // TESSERACT_CCMAIN_OSDETECT_H__
#endif // TESSERACT_CCMAIN_OSDETECT_H_
6 changes: 3 additions & 3 deletions ccmain/pageiterator.h
Expand Up @@ -18,8 +18,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCMAIN_PAGEITERATOR_H__
#define TESSERACT_CCMAIN_PAGEITERATOR_H__
#ifndef TESSERACT_CCMAIN_PAGEITERATOR_H_
#define TESSERACT_CCMAIN_PAGEITERATOR_H_

#include "publictypes.h"
#include "platform.h"
Expand Down Expand Up @@ -361,4 +361,4 @@ class TESS_API PageIterator {

} // namespace tesseract.

#endif // TESSERACT_CCMAIN_PAGEITERATOR_H__
#endif // TESSERACT_CCMAIN_PAGEITERATOR_H_
6 changes: 3 additions & 3 deletions ccmain/resultiterator.h
Expand Up @@ -19,8 +19,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCMAIN_RESULT_ITERATOR_H__
#define TESSERACT_CCMAIN_RESULT_ITERATOR_H__
#ifndef TESSERACT_CCMAIN_RESULT_ITERATOR_H_
#define TESSERACT_CCMAIN_RESULT_ITERATOR_H_

#include "platform.h"
#include "ltrresultiterator.h"
Expand Down Expand Up @@ -241,4 +241,4 @@ class TESS_API ResultIterator : public LTRResultIterator {

} // namespace tesseract.

#endif // TESSERACT_CCMAIN_RESULT_ITERATOR_H__
#endif // TESSERACT_CCMAIN_RESULT_ITERATOR_H_
6 changes: 3 additions & 3 deletions ccmain/tesseractclass.h
Expand Up @@ -23,8 +23,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCMAIN_TESSERACTCLASS_H__
#define TESSERACT_CCMAIN_TESSERACTCLASS_H__
#ifndef TESSERACT_CCMAIN_TESSERACTCLASS_H_
#define TESSERACT_CCMAIN_TESSERACTCLASS_H_

#include "allheaders.h"
#include "control.h"
Expand Down Expand Up @@ -1277,4 +1277,4 @@ class Tesseract : public Wordrec {
} // namespace tesseract


#endif // TESSERACT_CCMAIN_TESSERACTCLASS_H__
#endif // TESSERACT_CCMAIN_TESSERACTCLASS_H_
6 changes: 3 additions & 3 deletions ccmain/thresholder.h
Expand Up @@ -17,8 +17,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCMAIN_THRESHOLDER_H__
#define TESSERACT_CCMAIN_THRESHOLDER_H__
#ifndef TESSERACT_CCMAIN_THRESHOLDER_H_
#define TESSERACT_CCMAIN_THRESHOLDER_H_

#include "platform.h"
#include "publictypes.h"
Expand Down Expand Up @@ -186,4 +186,4 @@ class TESS_API ImageThresholder {

} // namespace tesseract.

#endif // TESSERACT_CCMAIN_THRESHOLDER_H__
#endif // TESSERACT_CCMAIN_THRESHOLDER_H_
6 changes: 3 additions & 3 deletions ccstruct/boxread.h
Expand Up @@ -17,8 +17,8 @@
*
**********************************************************************/

#ifndef TESSERACT_CCUTIL_BOXREAD_H__
#define TESSERACT_CCUTIL_BOXREAD_H__
#ifndef TESSERACT_CCUTIL_BOXREAD_H_
#define TESSERACT_CCUTIL_BOXREAD_H_

#include <stdio.h>
#include "genericvector.h"
Expand Down Expand Up @@ -82,4 +82,4 @@ bool ParseBoxFileStr(const char* boxfile_str, int* page_number,
void MakeBoxFileStr(const char* unichar_str, const TBOX& box, int page_num,
STRING* box_str);

#endif // TESSERACT_CCUTIL_BOXREAD_H__
#endif // TESSERACT_CCUTIL_BOXREAD_H_
6 changes: 3 additions & 3 deletions ccstruct/boxword.h
Expand Up @@ -17,8 +17,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CSTRUCT_BOXWORD_H__
#define TESSERACT_CSTRUCT_BOXWORD_H__
#ifndef TESSERACT_CSTRUCT_BOXWORD_H_
#define TESSERACT_CSTRUCT_BOXWORD_H_

#include "genericvector.h"
#include "rect.h"
Expand Down Expand Up @@ -98,4 +98,4 @@ class BoxWord {
} // namespace tesseract.


#endif // TESSERACT_CSTRUCT_BOXWORD_H__
#endif // TESSERACT_CSTRUCT_BOXWORD_H_
6 changes: 3 additions & 3 deletions ccstruct/ccstruct.h
Expand Up @@ -16,8 +16,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCSTRUCT_CCSTRUCT_H__
#define TESSERACT_CCSTRUCT_CCSTRUCT_H__
#ifndef TESSERACT_CCSTRUCT_CCSTRUCT_H_
#define TESSERACT_CCSTRUCT_CCSTRUCT_H_

#include "cutil.h"

Expand All @@ -41,4 +41,4 @@ class Tesseract;
} // namespace tesseract


#endif // TESSERACT_CCSTRUCT_CCSTRUCT_H__
#endif // TESSERACT_CCSTRUCT_CCSTRUCT_H_
6 changes: 3 additions & 3 deletions ccstruct/dppoint.h
Expand Up @@ -17,8 +17,8 @@
*
**********************************************************************/

#ifndef TESSERACT_CCSTRUCT_DPPOINT_H__
#define TESSERACT_CCSTRUCT_DPPOINT_H__
#ifndef TESSERACT_CCSTRUCT_DPPOINT_H_
#define TESSERACT_CCSTRUCT_DPPOINT_H_

#include "host.h"

Expand Down Expand Up @@ -98,5 +98,5 @@ class DPPoint {

} // namespace tesseract.

#endif // TESSERACT_CCSTRUCT_DPPOINT_H__
#endif // TESSERACT_CCSTRUCT_DPPOINT_H_

6 changes: 3 additions & 3 deletions ccstruct/matrix.h
Expand Up @@ -26,8 +26,8 @@
** limitations under the License.
*
*********************************************************************************/
#ifndef TESSERACT_CCSTRUCT_MATRIX_H__
#define TESSERACT_CCSTRUCT_MATRIX_H__
#ifndef TESSERACT_CCSTRUCT_MATRIX_H_
#define TESSERACT_CCSTRUCT_MATRIX_H_

#include <math.h>
#include "kdpair.h"
Expand Down Expand Up @@ -632,4 +632,4 @@ struct MATRIX_COORD {
// The MatrixCoordPair contains a MATRIX_COORD and its priority.
typedef tesseract::KDPairInc<float, MATRIX_COORD> MatrixCoordPair;

#endif // TESSERACT_CCSTRUCT_MATRIX_H__
#endif // TESSERACT_CCSTRUCT_MATRIX_H_
6 changes: 3 additions & 3 deletions ccstruct/otsuthr.h
Expand Up @@ -17,8 +17,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCMAIN_OTSUTHR_H__
#define TESSERACT_CCMAIN_OTSUTHR_H__
#ifndef TESSERACT_CCMAIN_OTSUTHR_H_
#define TESSERACT_CCMAIN_OTSUTHR_H_

struct Pix;

Expand Down Expand Up @@ -53,4 +53,4 @@ int OtsuStats(const int* histogram, int* H_out, int* omega0_out);

} // namespace tesseract.

#endif // TESSERACT_CCMAIN_OTSUTHR_H__
#endif // TESSERACT_CCMAIN_OTSUTHR_H_
6 changes: 3 additions & 3 deletions ccstruct/publictypes.h
Expand Up @@ -17,8 +17,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCSTRUCT_PUBLICTYPES_H__
#define TESSERACT_CCSTRUCT_PUBLICTYPES_H__
#ifndef TESSERACT_CCSTRUCT_PUBLICTYPES_H_
#define TESSERACT_CCSTRUCT_PUBLICTYPES_H_

// This file contains types that are used both by the API and internally
// to Tesseract. In order to decouple the API from Tesseract and prevent cyclic
Expand Down Expand Up @@ -276,4 +276,4 @@ enum OcrEngineMode {

} // namespace tesseract.

#endif // TESSERACT_CCSTRUCT_PUBLICTYPES_H__
#endif // TESSERACT_CCSTRUCT_PUBLICTYPES_H_
6 changes: 3 additions & 3 deletions ccutil/bitvector.h
Expand Up @@ -20,8 +20,8 @@
///////////////////////////////////////////////////////////////////////


#ifndef TESSERACT_CCUTIL_BITVECTOR_H__
#define TESSERACT_CCUTIL_BITVECTOR_H__
#ifndef TESSERACT_CCUTIL_BITVECTOR_H_
#define TESSERACT_CCUTIL_BITVECTOR_H_

#include <assert.h>
#include <stdio.h>
Expand Down Expand Up @@ -140,4 +140,4 @@ class BitVector {

} // namespace tesseract.

#endif // TESSERACT_CCUTIL_BITVECTOR_H__
#endif // TESSERACT_CCUTIL_BITVECTOR_H_
6 changes: 3 additions & 3 deletions ccutil/ccutil.h
Expand Up @@ -16,8 +16,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCUTIL_CCUTIL_H__
#define TESSERACT_CCUTIL_CCUTIL_H__
#ifndef TESSERACT_CCUTIL_CCUTIL_H_
#define TESSERACT_CCUTIL_CCUTIL_H_

#include "ambigs.h"
#include "errcode.h"
Expand Down Expand Up @@ -94,4 +94,4 @@ class CCUtil {
extern CCUtilMutex tprintfMutex; // should remain global
} // namespace tesseract

#endif // TESSERACT_CCUTIL_CCUTIL_H__
#endif // TESSERACT_CCUTIL_CCUTIL_H_
6 changes: 3 additions & 3 deletions ccutil/host.h
Expand Up @@ -42,8 +42,8 @@
** limitations under the License.
*/

#ifndef __HOST__
#define __HOST__
#ifndef TESSERACT_CCUTIL_HOST_H_
#define TESSERACT_CCUTIL_HOST_H_

/******************************************************************************
** IMPORTANT!!! **
Expand Down Expand Up @@ -146,4 +146,4 @@ template<class T> bool NearlyEqual(T x, T y, T tolerance) {
return diff <= tolerance && -diff <= tolerance;
}

#endif
#endif // TESSERACT_CCUTIL_HOST_H_
6 changes: 3 additions & 3 deletions ccutil/platform.h
Expand Up @@ -17,8 +17,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef TESSERACT_CCUTIL_PLATFORM_H__
#define TESSERACT_CCUTIL_PLATFORM_H__
#ifndef TESSERACT_CCUTIL_PLATFORM_H_
#define TESSERACT_CCUTIL_PLATFORM_H_

#include <string.h>

Expand Down Expand Up @@ -89,4 +89,4 @@
(strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#endif

#endif // TESSERACT_CCUTIL_PLATFORM_H__
#endif // TESSERACT_CCUTIL_PLATFORM_H_
6 changes: 3 additions & 3 deletions ccutil/tesscallback.h
Expand Up @@ -16,8 +16,8 @@
//
///////////////////////////////////////////////////////////////////////

#ifndef _TESS_CALLBACK_SPECIALIZATIONS_H
#define _TESS_CALLBACK_SPECIALIZATIONS_H
#ifndef TESS_CALLBACK_SPECIALIZATIONS_H_
#define TESS_CALLBACK_SPECIALIZATIONS_H_

#include "host.h" // For NULL.

Expand Down Expand Up @@ -9718,4 +9718,4 @@ NewPermanentTessCallback(R (*function)(P1,P2,P3,P4,P5,P6,A1,A2,A3,A4,A5), typena
return new _TessFunctionResultCallback_6_5<false,R,P1,P2,P3,P4,P5,P6,A1,A2,A3,A4,A5>(function, p1, p2, p3, p4, p5, p6);
}

#endif /* _TESS_CALLBACK_SPECIALIZATIONS_H */
#endif // TESS_CALLBACK_SPECIALIZATIONS_H_

0 comments on commit 4897796

Please sign in to comment.