Rename all C-style headers (e.g. <stdio.h>) to C++ style (<cstdio>).

This commit is contained in:
Alexander Zaitsev 2018-05-20 00:52:04 +03:00
parent 96f8f853c8
commit 0248c7ff9d
123 changed files with 191 additions and 191 deletions

View File

@ -20,7 +20,7 @@
#ifndef TESSERACT_API_BASEAPI_H_
#define TESSERACT_API_BASEAPI_H_
#include <stdio.h>
#include <cstdio>
// To avoid collision with other typenames include the ABSOLUTE MINIMUM
// complexity of includes here. Use forward declarations wherever possible
// and hide includes of complex types in baseapi.cpp.

View File

@ -20,8 +20,8 @@
// Implementation for non-avx archs.
#include "dotproductavx.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
namespace tesseract {
double DotProductAVX(const double* u, const double* v, int n) {
@ -33,7 +33,7 @@ double DotProductAVX(const double* u, const double* v, int n) {
#else // !defined(__AVX__)
// Implementation for avx capable archs.
#include <immintrin.h>
#include <stdint.h>
#include <cstdint>
#include "dotproductavx.h"
#include "host.h"

View File

@ -20,8 +20,8 @@
// This code can't compile with "-msse4.1", so use dummy stubs.
#include "dotproductsse.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
namespace tesseract {
double DotProductSSE(const double* u, const double* v, int n) {
@ -39,7 +39,7 @@ int32_t IntDotProductSSE(const int8_t* u, const int8_t* v, int n) {
#include <emmintrin.h>
#include <smmintrin.h>
#include <stdint.h>
#include <cstdint>
#include "dotproductsse.h"
#include "host.h"

View File

@ -19,7 +19,7 @@
#ifndef TESSERACT_ARCH_INTSIMDMATRIX_H_
#define TESSERACT_ARCH_INTSIMDMATRIX_H_
#include <stdint.h>
#include <cstdint>
#include <vector>
#include "genericvector.h"
#include "matrix.h"

View File

@ -20,7 +20,7 @@
#ifdef __AVX2__
#include <immintrin.h>
#include <stdint.h>
#include <cstdint>
#include <algorithm>
#include <vector>

View File

@ -18,7 +18,7 @@
#include "intsimdmatrixsse.h"
#include <stdint.h>
#include <cstdint>
#include <vector>
#include "dotproductsse.h"

View File

@ -24,7 +24,7 @@
#endif
#include <string.h>
#include <math.h>
#include <cmath>
#ifdef __UNIX__
#include <assert.h>
#include <unistd.h>

View File

@ -21,8 +21,8 @@
// tesseract from the ui.
#ifdef _WIN32
#else
#include <stdlib.h>
#include <stdio.h>
#include <cstdlib>
#include <cstdio>
#endif
#include <map>

View File

@ -17,7 +17,7 @@
*
**********************************************************************/
#include <stdio.h>
#include <cstdio>
#include "tessvars.h"

View File

@ -20,7 +20,7 @@
#ifndef TESSVARS_H
#define TESSVARS_H
#include <stdio.h>
#include <cstdio>
extern FILE *debug_fp; // write debug stuff here

View File

@ -17,7 +17,7 @@
*
**********************************************************************/
#include <math.h>
#include <cmath>
#include "blamer.h"
#include "errcode.h"

View File

@ -21,7 +21,7 @@
#ifndef TESSERACT_CCSTRUCT_BLAMER_H_
#define TESSERACT_CCSTRUCT_BLAMER_H_
#include <stdio.h>
#include <cstdio>
#include "boxword.h"
#include "genericvector.h"
#include "matrix.h"

View File

@ -20,7 +20,7 @@
#ifndef TESSERACT_CCUTIL_BOXREAD_H_
#define TESSERACT_CCUTIL_BOXREAD_H_
#include <stdio.h>
#include <cstdio>
#include "genericvector.h"
#include "strngs.h"

View File

@ -29,7 +29,7 @@
#ifndef TESSERACT_CCSTRUCT_MATRIX_H_
#define TESSERACT_CCSTRUCT_MATRIX_H_
#include <math.h>
#include <cmath>
#include "kdpair.h"
#include "points.h"
#include "serialis.h"

View File

@ -19,7 +19,7 @@
#include "normalis.h"
#include <stdlib.h>
#include <cstdlib>
#include "allheaders.h"
#include "blobs.h"

View File

@ -20,7 +20,7 @@
#ifndef NORMALIS_H
#define NORMALIS_H
#include <stdio.h>
#include <cstdio>
#include "genericvector.h"
#include "host.h"

View File

@ -18,7 +18,7 @@
**********************************************************************/
#include "ocrblock.h"
#include <stdlib.h>
#include <cstdlib>
#include <memory> // std::unique_ptr
#include "blckerr.h"
#include "stepblob.h"

View File

@ -17,7 +17,7 @@
//
///////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <cstdio>
#include "ocrpara.h"
#include "host.h" // For NearlyEqual()

View File

@ -20,7 +20,7 @@
#ifndef OCRROW_H
#define OCRROW_H
#include <stdio.h>
#include <cstdio>
#include "quspline.h"
#include "werd.h"

View File

@ -18,7 +18,7 @@
**********************************************************************/
#include "pdblock.h"
#include <stdlib.h>
#include <cstdlib>
#include <memory> // std::unique_ptr
#include "allheaders.h"
#include "blckerr.h"

View File

@ -19,8 +19,8 @@
#include "polyblk.h"
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <cmath>
#include <cstdio>
#include <memory> // std::unique_ptr
#include "elst.h"

View File

@ -17,8 +17,8 @@
*
**********************************************************************/
#include <stdio.h>
#include <math.h>
#include <cstdio>
#include <cmath>
#include "quadlsq.h"
#include "tprintf.h"

View File

@ -20,7 +20,7 @@
#ifndef RECT_H
#define RECT_H
#include <math.h>
#include <cmath>
#include "points.h"
#include "ndminx.h"
#include "scrollview.h"

View File

@ -20,7 +20,7 @@
#ifndef TESSERACT_CCSTRUCT_STATISTC_H_
#define TESSERACT_CCSTRUCT_STATISTC_H_
#include <stdio.h>
#include <cstdio>
#include "host.h"
#include "kdpair.h"
#include "scrollview.h"

View File

@ -25,7 +25,7 @@
#ifndef VECFUNCS_H
#define VECFUNCS_H
#include <math.h>
#include <cmath>
struct EDGEPT;

View File

@ -20,7 +20,7 @@
#include "ambigs.h"
#include <stdio.h>
#include <cstdio>
#include "helpers.h"
#include "universalambigs.h"

View File

@ -22,8 +22,8 @@
#ifndef TESSERACT_CCUTIL_BITVECTOR_H_
#define TESSERACT_CCUTIL_BITVECTOR_H_
#include <assert.h>
#include <stdio.h>
#include <cassert>
#include <cstdio>
#include "host.h"
namespace tesseract {

View File

@ -17,7 +17,7 @@
*
**********************************************************************/
#include <stdlib.h>
#include <cstdlib>
#include "clst.h"
/***********************************************************************

View File

@ -20,7 +20,7 @@
#ifndef CLST_H
#define CLST_H
#include <stdio.h>
#include <cstdio>
#include "host.h"
#include "serialis.h"
#include "lsterr.h"

View File

@ -17,7 +17,7 @@
*
**********************************************************************/
#include <stdlib.h>
#include <cstdlib>
#include "elst.h"
/***********************************************************************

View File

@ -20,7 +20,7 @@
#ifndef ELST_H
#define ELST_H
#include <stdio.h>
#include <cstdio>
#include "host.h"
#include "serialis.h"
#include "lsterr.h"

View File

@ -17,7 +17,7 @@
*
**********************************************************************/
#include <stdlib.h>
#include <cstdlib>
#include "host.h"
#include "elst2.h"

View File

@ -20,7 +20,7 @@
#ifndef ELST2_H
#define ELST2_H
#include <stdio.h>
#include <cstdio>
#include "host.h"
#include "serialis.h"
#include "lsterr.h"

View File

@ -20,9 +20,9 @@
#ifndef TESSERACT_CCUTIL_GENERICVECTOR_H_
#define TESSERACT_CCUTIL_GENERICVECTOR_H_
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include "tesscallback.h"
#include "errcode.h"

View File

@ -26,8 +26,8 @@
#define TESSERACT_CCUTIL_HELPERS_H_
#include <cassert>
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstring>
#include <functional>
#include <string>

View File

@ -20,7 +20,7 @@
#ifndef TESSERACT_CCUTIL_INDEXMAPBIDI_H_
#define TESSERACT_CCUTIL_INDEXMAPBIDI_H_
#include <stdio.h>
#include <cstdio>
#include "genericvector.h"
namespace tesseract {

View File

@ -27,7 +27,7 @@
#ifndef TESSERACT_CCUTIL_QRSEQUENCE_H_
#define TESSERACT_CCUTIL_QRSEQUENCE_H_
#include <math.h>
#include <cmath>
class QRSequenceGenerator {
public:

View File

@ -23,13 +23,13 @@
#include "config_auto.h"
#endif
#include <ctype.h>
#include <math.h>
#include <stdarg.h>
#include <stddef.h>
#include <string.h>
#include <limits.h>
#include <stdio.h>
#include <cctype>
#include <cmath>
#include <cstdarg>
#include <cstddef>
#include <cstring>
#include <climits>
#include <cstdio>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

View File

@ -19,9 +19,9 @@
#ifndef TESSERACT_CCUTIL_SCANUTILS_H_
#define TESSERACT_CCUTIL_SCANUTILS_H_
#include <stdint.h>
#include <stddef.h>
#include <stdio.h>
#include <cstdint>
#include <cstddef>
#include <cstdio>
#include <sys/stat.h>
/**

View File

@ -18,7 +18,7 @@
**********************************************************************/
#include "serialis.h"
#include <stdio.h>
#include <cstdio>
#include "genericvector.h"
namespace tesseract {

View File

@ -20,9 +20,9 @@
#ifndef SERIALIS_H
#define SERIALIS_H
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include "host.h"
template <typename T> class GenericVector;

View File

@ -20,7 +20,7 @@
#ifndef TESSERACT_CCUTIL_SORTHELPER_H_
#define TESSERACT_CCUTIL_SORTHELPER_H_
#include <stdlib.h>
#include <cstdlib>
#include "genericvector.h"
// Generic class to provide functions based on a <value,count> pair.

View File

@ -20,9 +20,9 @@
#ifndef STRNGS_H
#define STRNGS_H
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <cassert>
#include <cstdio>
#include <cstring>
#include "memry.h"
#include "platform.h"

View File

@ -23,7 +23,7 @@
#include "tessdatamanager.h"
#include <stdio.h>
#include <cstdio>
#include "helpers.h"
#include "serialis.h"

View File

@ -19,9 +19,9 @@
#include "unicharset.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <cassert>
#include <cstdio>
#include <cstring>
#include "params.h"
#include "serialis.h"

View File

@ -23,7 +23,7 @@
----------------------------------------------------------------------------*/
#include "oldlist.h"
#include "intproto.h"
#include <stdio.h>
#include <cstdio>
typedef struct
{

View File

@ -55,10 +55,10 @@
#include "unicharset.h"
#include "werd.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#ifdef __UNIX__
#include <assert.h>
#endif

View File

@ -24,7 +24,7 @@
#include "matrix.h"
#include "tprintf.h"
#include "danerror.h"
#include <math.h>
#include <cmath>
#define HOTELLING 1 // If true use Hotelling's test to decide where to split.
#define FTABLE_X 10 // Size of FTable.

View File

@ -22,8 +22,8 @@
#include "danerror.h"
#include "emalloc.h"
#include "scanutils.h"
#include <stdio.h>
#include <math.h>
#include <cstdio>
#include <cmath>
using tesseract::TFile;

View File

@ -20,7 +20,7 @@
#define TESSERACT_CLASSIFY_CLUSTTOOL_H_
//--------------------------Include Files---------------------------------------
#include <stdio.h>
#include <cstdio>
#include "cluster.h"
#include "host.h"
#include "serialis.h"

View File

@ -20,7 +20,7 @@
----------------------------------------------------------------------------*/
#include "cutoffs.h"
#include <stdio.h>
#include <cstdio>
#include "classify.h"
#include "efio.h"

View File

@ -23,8 +23,8 @@
#include "danerror.h"
#include "scanutils.h"
#include <string.h>
#include <stdio.h>
#include <cstring>
#include <cstdio>
/** define errors triggered by this module */
#define ILLEGAL_NUM_SETS 3001

View File

@ -22,8 +22,8 @@
Include Files and Type Defines
----------------------------------------------------------------------------**/
#include "host.h"
#include <stdio.h>
#include <math.h>
#include <cstdio>
#include <cmath>
/* define data structure to hold 2D points or vectors using floating point */
typedef struct

View File

@ -24,7 +24,7 @@
#include "blobs.h"
#include "intproto.h"
#include "normalis.h"
#include <math.h>
#include <cmath>
class DENORM;

View File

@ -36,7 +36,7 @@
#include "helpers.h"
#include "classify.h"
#include "shapetable.h"
#include <math.h>
#include <cmath>
using tesseract::ScoredFont;
using tesseract::UnicharRating;

View File

@ -19,9 +19,9 @@
Include Files and Type Defines
-----------------------------------------------------------------------------*/
#include <math.h>
#include <stdio.h>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cassert>
#ifdef __UNIX__
#include <unistd.h>
#endif

View File

@ -24,8 +24,8 @@
#include "kdtree.h"
#include "const.h"
#include "emalloc.h"
#include <stdio.h>
#include <math.h>
#include <cstdio>
#include <cmath>
#define Magnitude(X) ((X) < 0 ? -(X) : (X))
#define NodeFound(N,K,D) (( (N)->Key == (K) ) && ( (N)->Data == (D) ))

View File

@ -25,8 +25,8 @@
#endif
#include "mastertrainer.h"
#include <math.h>
#include <time.h>
#include <cmath>
#include <ctime>
#include "allheaders.h"
#include "boxread.h"
#include "classify.h"

View File

@ -24,7 +24,7 @@
#include "mfdefs.h"
#include "mfx.h"
#include <math.h>
#include <cmath>
/*----------------------------------------------------------------------------
Global Data Definitions and Declarations

View File

@ -20,7 +20,7 @@
----------------------------------------------------------------------------**/
#include "mfdefs.h"
#include "emalloc.h"
#include <math.h>
#include <cmath>
/*----------------------------------------------------------------------------
Public Code

View File

@ -27,8 +27,8 @@
#include "params.h"
#include "classify.h"
#include <math.h>
#include <stdio.h>
#include <cmath>
#include <cstdio>
/*----------------------------------------------------------------------------
Public Code

View File

@ -26,7 +26,7 @@
#include "normalis.h"
#include "params.h"
#include <math.h>
#include <cmath>
/*----------------------------------------------------------------------------
Variables

View File

@ -20,8 +20,8 @@
----------------------------------------------------------------------------*/
#include "normmatch.h"
#include <stdio.h>
#include <math.h>
#include <cstdio>
#include <cmath>
#include "classify.h"
#include "clusttool.h"

View File

@ -24,8 +24,8 @@
#include "danerror.h"
#include "scanutils.h"
#include <assert.h>
#include <math.h>
#include <cassert>
#include <cmath>
/*----------------------------------------------------------------------------
Public Code

View File

@ -23,7 +23,7 @@
----------------------------------------------------------------------------**/
#include "blobs.h"
#include <stdio.h>
#include <cstdio>
class DENORM;
struct INT_FX_RESULT_STRUCT;

View File

@ -26,7 +26,7 @@
#include "mfoutline.h"
#include "ocrfeatures.h"
#include <stdio.h>
#include <cstdio>
/*----------------------------------------------------------------------------
Public Code

View File

@ -29,8 +29,8 @@
#include "params.h"
#include "trainingsample.h"
#include <math.h>
#include <stdio.h>
#include <cmath>
#include <cstdio>
/*---------------------------------------------------------------------------
Variables

View File

@ -35,8 +35,8 @@
#include "classify.h"
#include "params.h"
#include <stdio.h>
#include <math.h>
#include <cstdio>
#include <cmath>
#define PROTO_INCREMENT 32
#define CONFIG_INCREMENT 16

View File

@ -21,7 +21,7 @@
-----------------------------------------------------------------------------*/
#include "bitvec.h"
#include <stdio.h>
#include <cstdio>
#include "emalloc.h"
#include "tprintf.h"

View File

@ -42,7 +42,7 @@ Import original HP distribution
#include "tprintf.h"
#include "callcpp.h"
#include <stdlib.h>
#include <cstdlib>
#define RESET_COUNT 2000

View File

@ -36,9 +36,9 @@ Import original HP distribution
/*----------------------------------------------------------------------
I n c l u d e s
----------------------------------------------------------------------*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include "host.h"
#include "tprintf.h"

View File

@ -26,7 +26,7 @@
#include "assert.h"
#endif
#include <stdio.h>
#include <cstdio>
/**
* This routine prints the specified error message to stderr.

View File

@ -20,8 +20,8 @@
----------------------------------------------------------------------------*/
#include "efio.h"
#include "danerror.h"
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstring>
#define MAXERRORMESSAGE 256

View File

@ -21,7 +21,7 @@
/**----------------------------------------------------------------------------
Include Files and Type Defines
----------------------------------------------------------------------------**/
#include <stdio.h>
#include <cstdio>
#define FOPENERROR 3000

View File

@ -26,7 +26,7 @@
----------------------------------------------------------------------------*/
#include "emalloc.h"
#include "danerror.h"
#include <stdlib.h>
#include <cstdlib>
/*----------------------------------------------------------------------------
Public Code

View File

@ -29,7 +29,7 @@
#include "unicharset.h"
#include "strngs.h"
#include <stdio.h>
#include <cstdio>
#endif

View File

@ -83,7 +83,7 @@
******************************************************************************/
#include "oldlist.h"
#include <stdio.h>
#include <cstdio>
#include "structures.h"
/*----------------------------------------------------------------------

View File

@ -27,7 +27,7 @@
----------------------------------------------------------------------*/
#include "structures.h"
#include <stdio.h>
#include <cstdio>
/*----------------------------------------------------------------------

View File

@ -16,7 +16,7 @@
//
///////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <cstdio>
#include "dict.h"
#include "unicodes.h"

View File

@ -22,7 +22,7 @@
Include Files and Type Defines
----------------------------------------------------------------------------**/
#include "host.h"
#include <stdio.h>
#include <cstdio>
#include "unichar.h"
/* define the maximum number of classes defined for any matcher

View File

@ -16,10 +16,10 @@
** limitations under the License.
******************************************************************************/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include "stopper.h"
#include "ambigs.h"

View File

@ -21,8 +21,8 @@
#ifdef _OPENMP
#include <omp.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include "functions.h"
#include "networkscratch.h"

View File

@ -21,8 +21,8 @@
#ifdef _OPENMP
#include <omp.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#if !defined(__GNUC__) && defined(_MSC_VER)
#include <intrin.h> // _BitScanReverse

View File

@ -23,7 +23,7 @@
#include "network.h"
#include <stdlib.h>
#include <cstdlib>
// This base class needs to know about all its sub-classes because of the
// factory deserializing method: CreateFromFile.

View File

@ -19,7 +19,7 @@
#ifndef TESSERACT_LSTM_NETWORK_H_
#define TESSERACT_LSTM_NETWORK_H_
#include <stdio.h>
#include <cstdio>
#include <cmath>
#include "genericvector.h"

View File

@ -19,8 +19,8 @@
#ifndef TESSERACT_LSTM_NETWORKIO_H_
#define TESSERACT_LSTM_NETWORKIO_H_
#include <math.h>
#include <stdio.h>
#include <cmath>
#include <cstdio>
#include <vector>
#include "genericvector.h"

View File

@ -18,7 +18,7 @@
#include "reversed.h"
#include <stdio.h>
#include <cstdio>
#include "networkscratch.h"

View File

@ -17,9 +17,9 @@
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#ifdef __APPLE__
#include <OpenCL/cl.h>

View File

@ -24,7 +24,7 @@
#if ON_APPLE
#include <mach/mach_time.h>
#include <stdio.h>
#include <cstdio>
#endif
#define CALLOC LEPT_CALLOC

View File

@ -11,7 +11,7 @@
#ifndef TESSERACT_OPENCL_OPENCLWRAPPER_H_
#define TESSERACT_OPENCL_OPENCLWRAPPER_H_
#include <stdio.h>
#include <cstdio>
#include "allheaders.h"
#include "pix.h"
#include "tprintf.h"

View File

@ -27,7 +27,7 @@
#include "baselinedetect.h"
#include <math.h>
#include <cmath>
#include "allheaders.h"
#include "blobbox.h"
#include "detlinefit.h"

View File

@ -29,7 +29,7 @@
*/
#include <ctype.h>
#include <math.h>
#include <cmath>
#include "errcode.h"
#include "drawtord.h"
#include "blkocc.h"

View File

@ -23,7 +23,7 @@
#include "strokewidth.h"
#include <math.h>
#include <cmath>
#include "blobbox.h"
#include "colpartition.h"

View File

@ -22,7 +22,7 @@
#endif
#include "tablefind.h"
#include <math.h>
#include <cmath>
#include "allheaders.h"

View File

@ -22,7 +22,7 @@
#include "boxchar.h"
#include <stddef.h>
#include <cstddef>
#include <algorithm>
#include <vector>

View File

@ -16,7 +16,7 @@
// but doesn't have to be the same as the training data.
// Author: Ray Smith
#include <stdio.h>
#include <cstdio>
#ifdef GOOGLE_TESSERACT
#include "base/commandlineflags.h"
#endif // GOOGLE_TESSERACT

View File

@ -32,8 +32,8 @@
#include "clusttool.h"
#include "cluster.h"
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <cstdio>
#include <cmath>
#include "unichar.h"
#include "commontraining.h"

View File

@ -21,7 +21,7 @@
#ifndef GOOGLE_TESSERACT
#include <stdlib.h>
#include <cstdlib>
#include "tprintf.h"
#include "params.h"

View File

@ -14,7 +14,7 @@
#include "commontraining.h"
#include <assert.h>
#include <math.h>
#include <cmath>
#include "allheaders.h"
#include "ccutil.h"

View File

@ -20,7 +20,7 @@
#include "degradeimage.h"
#include <stdlib.h>
#include <cstdlib>
#include "allheaders.h" // from leptonica
#include "genericvector.h"
#include "helpers.h" // For TRand.

Some files were not shown because too many files have changed in this diff Show More