Skip to content

Commit 7a116ce

Browse files
committed
More formatting fixes from clang tidy
1 parent 7701552 commit 7a116ce

File tree

10 files changed

+182
-192
lines changed

10 files changed

+182
-192
lines changed

api/baseapi.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1998,8 +1998,7 @@ bool TessBaseAPI::AdaptToWordStr(PageSegMode mode, const char* wordstr) {
19981998
for (t = 0; text[t] != '\0'; ++t) {
19991999
if (text[t] == '\n' || text[t] == ' ')
20002000
continue;
2001-
while (wordstr[w] == ' ')
2002-
++w;
2001+
while (wordstr[w] == ' ') ++w;
20032002
if (text[t] != wordstr[w])
20042003
break;
20052004
++w;

arch/simddetect.cpp

+17-16
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@
2020

2121
#undef X86_BUILD
2222
#if defined(__x86_64__) || defined(__i386__) || defined(_WIN32)
23-
# if !defined(ANDROID_BUILD)
24-
# define X86_BUILD 1
25-
# endif // !ANDROID_BUILD
26-
#endif // x86 target
23+
#if !defined(ANDROID_BUILD)
24+
#define X86_BUILD 1
25+
#endif // !ANDROID_BUILD
26+
#endif // x86 target
2727

2828
#if defined(X86_BUILD)
29-
# if defined(__GNUC__)
30-
# include <cpuid.h>
31-
# elif defined(_WIN32)
32-
# include <intrin.h>
33-
# endif
29+
#if defined(__GNUC__)
30+
#include <cpuid.h>
31+
#elif defined(_WIN32)
32+
#include <intrin.h>
33+
#endif
3434
#endif
3535

3636
SIMDDetect SIMDDetect::detector;
@@ -43,25 +43,26 @@ bool SIMDDetect::sse_available_;
4343
// Constructor.
4444
// Tests the architecture in a system-dependent way to detect AVX, SSE and
4545
// any other available SIMD equipment.
46-
// __GNUC__ is also defined by compilers that include GNU extensions such as clang.
46+
// __GNUC__ is also defined by compilers that include GNU extensions such as
47+
// clang.
4748
SIMDDetect::SIMDDetect() {
4849
#if defined(X86_BUILD)
49-
# if defined(__GNUC__)
50+
#if defined(__GNUC__)
5051
unsigned int eax, ebx, ecx, edx;
5152
if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) != 0) {
5253
sse_available_ = (ecx & 0x00080000) != 0;
5354
avx_available_ = (ecx & 0x10000000) != 0;
5455
}
55-
# elif defined(_WIN32)
56+
#elif defined(_WIN32)
5657
int cpuInfo[4];
5758
__cpuid(cpuInfo, 0);
5859
if (cpuInfo[0] >= 1) {
5960
__cpuid(cpuInfo, 1);
6061
sse_available_ = (cpuInfo[2] & 0x00080000) != 0;
6162
avx_available_ = (cpuInfo[2] & 0x10000000) != 0;
6263
}
63-
# else
64-
# error "I don't know how to test for SIMD with this compiler"
65-
# endif
66-
#endif // X86_BUILD
64+
#else
65+
#error "I don't know how to test for SIMD with this compiler"
66+
#endif
67+
#endif // X86_BUILD
6768
}

arch/simddetect.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,9 @@
2323
class SIMDDetect {
2424
public:
2525
// Returns true if AVX is available on this system.
26-
static inline bool IsAVXAvailable() {
27-
return detector.avx_available_;
28-
}
26+
static inline bool IsAVXAvailable() { return detector.avx_available_; }
2927
// Returns true if SSE4.1 is available on this system.
30-
static inline bool IsSSEAvailable() {
31-
return detector.sse_available_;
32-
}
28+
static inline bool IsSSEAvailable() { return detector.sse_available_; }
3329

3430
private:
3531
// Constructor, must set all static member variables.

ccmain/tesseractclass.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ class Tesseract : public Wordrec {
203203
pix_original_ = original_pix;
204204
// Clone to sublangs as well.
205205
for (int i = 0; i < sub_langs_.size(); ++i)
206-
sub_langs_[i]->set_pix_original(
207-
original_pix ? pixClone(original_pix) : nullptr);
206+
sub_langs_[i]->set_pix_original(original_pix ? pixClone(original_pix)
207+
: nullptr);
208208
}
209209
// Returns a pointer to a Pix representing the best available (original) image
210210
// of the page. Can be of any bit depth, but never color-mapped, as that has

ccstruct/debugpixa.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class DebugPixa {
4444
// The collection of images to put in the PDF.
4545
Pixa* pixa_;
4646
// The fonts used to draw text captions.
47-
L_BMF* fonts_;
47+
L_Bmf* fonts_;
4848
};
4949

5050
} // namespace tesseract

ccstruct/publictypes.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ enum PageIteratorLevel {
235235
*
236236
* JUSTIFICATION_RIGHT
237237
* Each line, except possibly the first, is flush to the same right tab stop.
238-
*/
238+
*/
239239
enum ParagraphJustification {
240240
JUSTIFICATION_UNKNOWN,
241241
JUSTIFICATION_LEFT,

ccutil/scanutils.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -363,28 +363,28 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) {
363363
case 'p': // Pointer
364364
rank = RANK_PTR;
365365
base = 0;
366-
goto scan_int;
366+
goto scan_int;
367367

368368
case 'i': // Base-independent integer
369369
base = 0;
370-
goto scan_int;
370+
goto scan_int;
371371

372372
case 'd': // Decimal integer
373373
base = 10;
374-
goto scan_int;
374+
goto scan_int;
375375

376376
case 'o': // Octal integer
377377
base = 8;
378-
goto scan_int;
378+
goto scan_int;
379379

380380
case 'u': // Unsigned decimal integer
381381
base = 10;
382-
goto scan_int;
382+
goto scan_int;
383383

384384
case 'x': // Hexadecimal integer
385385
case 'X':
386386
base = 16;
387-
goto scan_int;
387+
goto scan_int;
388388

389389
case 'n': // Number of characters consumed
390390
val = ftell(stream) - start_off;

0 commit comments

Comments
 (0)