Skip to content

Commit

Permalink
Merge pull request #531 from stweil/guards
Browse files Browse the repository at this point in the history
Fix header file guards and replace reserved identifiers
  • Loading branch information
zdenop authored Dec 15, 2016
2 parents 9d6e4f6 + 533399e commit da4c064
Show file tree
Hide file tree
Showing 65 changed files with 213 additions and 195 deletions.
6 changes: 3 additions & 3 deletions api/apitypes.h
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 @@ -911,4 +911,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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_
9 changes: 5 additions & 4 deletions ccmain/paramsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
//
// Tesseract parameter editor is used to edit all the parameters used
// within tesseract from the ui.
#ifndef TESSERACT_CCMAIN_PARAMSD_H_
#define TESSERACT_CCMAIN_PARAMSD_H_

#ifndef GRAPHICS_DISABLED
#ifndef VARABLED_H
#define VARABLED_H

#include "elst.h"
#include "params.h"
Expand Down Expand Up @@ -119,5 +120,5 @@ class ParamsEditor : public SVEventHandler {
ScrollView* sv_window_;
};

#endif
#endif
#endif // GRAPHICS_DISABLED
#endif // TESSERACT_CCMAIN_PARAMSD_H_
6 changes: 3 additions & 3 deletions ccmain/resultiterator.h
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 @@ -1226,4 +1226,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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 @@ -271,4 +271,4 @@ enum OcrEngineMode {

} // namespace tesseract.

#endif // TESSERACT_CCSTRUCT_PUBLICTYPES_H__
#endif // TESSERACT_CCSTRUCT_PUBLICTYPES_H_
6 changes: 3 additions & 3 deletions ccutil/bitvector.h
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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/genericheap.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
//
///////////////////////////////////////////////////////////////////////

#include "errcode.h"
#include "genericvector.h"

#ifndef TESSERACT_CCUTIL_GENERICHEAP_H_
#define TESSERACT_CCUTIL_GENERICHEAP_H_

#include "errcode.h"
#include "genericvector.h"

namespace tesseract {

// GenericHeap requires 1 template argument:
Expand Down
6 changes: 3 additions & 3 deletions ccutil/host.h
Original file line number Diff line number Diff line change
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_
Loading

0 comments on commit da4c064

Please sign in to comment.