diff --git a/ccmain/control.cpp b/ccmain/control.cpp index b2377e0c3..80bc09823 100644 --- a/ccmain/control.cpp +++ b/ccmain/control.cpp @@ -431,7 +431,6 @@ bool Tesseract::recog_all_words(PAGE_RES* page_res, if (word->best_choice == NULL || word->best_choice->length() == 0) page_res_it.DeleteCurrentWord(); } - if (monitor != NULL) { monitor->progress = 100; diff --git a/ccutil/scanutils.cpp b/ccutil/scanutils.cpp index 94e3c8517..1ac98963f 100644 --- a/ccutil/scanutils.cpp +++ b/ccutil/scanutils.cpp @@ -72,8 +72,7 @@ inline size_t LongBit() { } static inline int -SkipSpace(FILE *s) -{ +SkipSpace(FILE *s) { int p; while (isspace(p = fgetc(s))); ungetc(p, s); // Make sure next char is available for reading @@ -81,19 +80,16 @@ SkipSpace(FILE *s) } static inline void -SetBit(unsigned long *bitmap, unsigned int bit) -{ +SetBit(unsigned long *bitmap, unsigned int bit) { bitmap[bit/LongBit()] |= 1UL << (bit%LongBit()); } static inline int -TestBit(unsigned long *bitmap, unsigned int bit) -{ +TestBit(unsigned long *bitmap, unsigned int bit) { return static_cast(bitmap[bit/LongBit()] >> (bit%LongBit())) & 1; } -static inline int DigitValue(int ch) -{ +static inline int DigitValue(int ch) { if (ch >= '0' && ch <= '9') { return ch-'0'; } else if (ch >= 'A' && ch <= 'Z') { @@ -106,8 +102,7 @@ static inline int DigitValue(int ch) } // IO (re-)implementations ----------------------------------------------------- -uintmax_t streamtoumax(FILE* s, int base) -{ +uintmax_t streamtoumax(FILE* s, int base) { int minus = 0; uintmax_t v = 0; int d, c = 0; @@ -148,8 +143,7 @@ uintmax_t streamtoumax(FILE* s, int base) return minus ? -v : v; } -double streamtofloat(FILE* s) -{ +double streamtofloat(FILE* s) { int minus = 0; int v = 0; int d, c = 0; @@ -184,8 +178,7 @@ double streamtofloat(FILE* s) return minus ? -f : f; } -double strtofloat(const char* s) -{ +double strtofloat(const char* s) { int minus = 0; int v = 0; int d; @@ -219,8 +212,7 @@ double strtofloat(const char* s) static int tvfscanf(FILE* stream, const char *format, va_list ap); -int tfscanf(FILE* stream, const char *format, ...) -{ +int tfscanf(FILE* stream, const char *format, ...) { va_list ap; int rv; @@ -233,8 +225,7 @@ int tfscanf(FILE* stream, const char *format, ...) #ifdef EMBEDDED -int fscanf(FILE* stream, const char *format, ...) -{ +int fscanf(FILE* stream, const char *format, ...) { va_list ap; int rv; @@ -245,8 +236,7 @@ int fscanf(FILE* stream, const char *format, ...) return rv; } -int vfscanf(FILE* stream, const char *format, ...) -{ +int vfscanf(FILE* stream, const char *format, ...) { va_list ap; int rv; @@ -258,8 +248,7 @@ int vfscanf(FILE* stream, const char *format, ...) } #endif -static int tvfscanf(FILE* stream, const char *format, va_list ap) -{ +static int tvfscanf(FILE* stream, const char *format, va_list ap) { const char *p = format; char ch; int q = 0; @@ -281,7 +270,8 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) enum Bail bail = BAIL_NONE; int sign; int converted = 0; // Successful conversions - unsigned long matchmap[((1 << CHAR_BIT)+(CHAR_BIT * sizeof(long) - 1))/ (CHAR_BIT * sizeof(long))]; + unsigned long matchmap[((1 << CHAR_BIT)+(CHAR_BIT * sizeof(long) - 1)) / + (CHAR_BIT * sizeof(long))]; int matchinv = 0; // Is match map inverted? unsigned char range_start = 0; off_t start_off = ftell(stream); @@ -575,8 +565,7 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) } #ifdef EMBEDDED -int creat(const char *pathname, mode_t mode) -{ +int creat(const char *pathname, mode_t mode) { return open(pathname, O_CREAT | O_TRUNC | O_WRONLY, mode); } diff --git a/training/degradeimage.cpp b/training/degradeimage.cpp index 79f1da5d0..f9c3cfb04 100644 --- a/training/degradeimage.cpp +++ b/training/degradeimage.cpp @@ -41,7 +41,7 @@ const int kMinRampSize = 1000; // If rotation is NULL, rotation is skipped. If *rotation is non-zero, the pix // is rotated by *rotation else it is randomly rotated and *rotation is // modified. -// +// // HOW IT WORKS: // Most of the process is really dictated by the fact that the minimum // available convolution is 3X3, which is too big really to simulate a diff --git a/training/pango_font_info.cpp b/training/pango_font_info.cpp index d4b993a52..44a7ba803 100644 --- a/training/pango_font_info.cpp +++ b/training/pango_font_info.cpp @@ -349,7 +349,8 @@ bool PangoFontInfo::CanRenderString(const char* utf8_word, int len, PangoContext* context = pango_context_new(); pango_context_set_font_map(context, font_map); PangoLayout* layout; - { // Pango is not relasing the cached layout. + { + // Pango is not relasing the cached layout. #ifndef USE_STD_NAMESPACE DISABLE_HEAP_LEAK_CHECK; #endif diff --git a/training/text2image.cpp b/training/text2image.cpp index 438849405..7901bc288 100644 --- a/training/text2image.cpp +++ b/training/text2image.cpp @@ -363,7 +363,8 @@ bool MakeIndividualGlyphs(Pix* pix, FLAGS_glyph_num_border_pixels_to_pad, 0); if (!pix_glyph_sq_pad) { - tprintf("ERROR: MakeIndividualGlyphs(): Failed to zero-pad, at i=%d\n", i); + tprintf("ERROR: MakeIndividualGlyphs(): Failed to zero-pad, at i=%d\n", + i); continue; } // Write out