Commit Graph

2844 Commits

Author SHA1 Message Date
zdenop
cf6c79d842
Merge pull request #1746 from stweil/fix
Fix some warnings from clang compiler
2018-07-04 22:09:17 +02:00
Stefan Weil
d960a50c12 Fix compiler warning [-Wshadow-field-in-constructor]
clang warning:

src/ccstruct/polyblk.cpp:48:36: warning:
 constructor parameter 'box' shadows the field 'box' of 'POLY_BLOCK'
 [-Wshadow-field-in-constructor]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-04 21:58:33 +02:00
Stefan Weil
c1be1024be Fix compiler warning [-Wtautological-undefined-compare]
clang warning:

src/lstm/networkio.cpp:56:15: warning:
 'this' pointer cannot be null in well-defined C++ code;
 comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-04 21:58:33 +02:00
Stefan Weil
52d392da50 Fix compiler warning [-Wunused-function]
clang warning:

src/lstm/lstmrecognizer.cpp:411:13: warning:
 unused function 'NullIsBest' [-Wunused-function]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-04 21:58:33 +02:00
Stefan Weil
6cc35646f8 Fix compiler warning [-Wunreachable-code-break]
clang warning:

src/lstm/network.cpp:249:7:
 warning: 'break' will never be executed [-Wunreachable-code-break]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-04 21:58:33 +02:00
Egor Pugin
a24d7cf868
Merge pull request #1745 from stweil/nullptr
Fix compiler warnings [-Wzero-as-null-pointer-constant]
2018-07-04 22:48:22 +03:00
Stefan Weil
bdf09f40b1 Fix compiler warnings [-Wzero-as-null-pointer-constant]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-04 20:40:56 +02:00
zdenop
d1e0a4b9e3
Merge pull request #1744 from stweil/fix
Fix build with legacy engine disabled
2018-07-04 18:18:59 +02:00
Stefan Weil
60fcff5ed9 Fix build with legacy engine disabled (part 2)
The functions TessBaseAPIInitLangMod, TessBaseAPIClearAdaptiveClassifier
and TessBaseAPIDetectOrientationScript need conditional compilation.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-04 17:56:42 +02:00
Stefan Weil
081793ff48 Fix build with legacy engine disabled
Instead of defining the DISABLED_LEGACY_ENGINE macro in config_auto.h
(which is not included by all source files), define it as a preprocessor
option for those parts of the code which require it.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-04 17:56:42 +02:00
zdenop
20e53b119a
Merge pull request #1742 from stweil/casts
Remove unneeded type casts
2018-07-04 15:35:49 +02:00
Stefan Weil
c8b5a29ce9 Remove unneeded type casts
This removes unneded type casts to (char*) and (const char*).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-04 14:23:55 +02:00
zdenop
6d3b6b1f7b
Merge pull request #1740 from amitdo/disable-legacy
Add an option to compile tesseract without the code of the legacy OCR engine
2018-07-04 12:46:34 +02:00
Amit D
62c7b796da
Merge branch 'master' into disable-legacy 2018-07-04 11:14:33 +03:00
amitdo
15fb491be4 Add missing #ifdef in tesseractmain.cpp 2018-07-04 09:57:12 +03:00
amitdo
134779f758 Fix duplicate #ifndef in blobclass.cpp 2018-07-04 08:49:58 +03:00
zdenop
b502bbf58e
Merge pull request #1738 from stweil/whitespace
Replace tabs by blanks in source code
2018-07-03 18:17:07 +02:00
amitdo
aa9f4b4861 Add an option to compile tesseract without the code of the legacy OCR engine 2018-07-03 18:49:42 +03:00
Stefan Weil
6d170a15ec Replace tabs by blanks in source code
blobs.cpp had many tabs and was formatted with clang-format.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-03 16:29:14 +02:00
zdenop
c9efe5f509
Merge pull request #1737 from stweil/nwmain
Remove nwmain.h and fix syntax error
2018-07-03 16:12:57 +02:00
Stefan Weil
626a229cac Remove nwmain.h
The macro DECLARE_MAIN is not used by the current Tesseract code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-03 15:54:41 +02:00
Stefan Weil
f8684cb0fd Fix syntax error (regression)
It was introduced in commit bb7bb1f0b8.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-03 15:53:42 +02:00
zdenop
4b26b8d9a9
Merge pull request #1735 from stweil/pdblock
Remove blckerr.h
2018-07-03 15:24:09 +02:00
zdenop
04e0273a59
Merge pull request #1736 from stweil/comments
Remove old comments for exceptions
2018-07-03 15:23:27 +02:00
Stefan Weil
bb7bb1f0b8 Remove old comments for exceptions
Exceptions are no longer used.

Remove also some history comments and fix several comments.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-03 14:53:00 +02:00
Stefan Weil
889f7eaa1b Remove blckerr.h
Move the two ERRCODE constants which are still in use to pdblock.cpp.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-03 14:08:57 +02:00
zdenop
b0c9d5b4f4
Merge pull request #1734 from stweil/danerror
Replace function DoError and remove danerror.cpp, danerror.h
2018-07-03 13:30:42 +02:00
Stefan Weil
872813245d Replace function DoError and remove danerror.cpp, danerror.h
This allows also removing all error trap macros.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-03 13:21:17 +02:00
zdenop
412186b396
Merge pull request #1733 from stweil/cutil
Clean up cutil.h
2018-07-03 12:51:35 +02:00
Stefan Weil
6a553f9f28 Clean up cutil.h
* Remove unrelated include statements from cutil.h.
* Remove macros FALSE, TRUE.
* Move macro CHARS_PER_LINE from cutil.h to dict.h.
* Remove unneeded macro _ARGS.
* Remove unused typedef statements.
* Remove macro new_line (only used once).
* Remove unused macro print_string.
* Update include statements for other source files.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-03 11:31:41 +02:00
zdenop
a0ed0b4987
Merge pull request #1732 from stweil/headerfiles
Remove unused include files
2018-07-03 07:57:15 +02:00
zdenop
7437a03698
Merge pull request #1728 from Ranigad/patch-1
Update tesseract.1.asc
2018-07-03 07:27:57 +02:00
zdenop
66ea6c4470
Merge pull request #1730 from stweil/pi
Remove unneeded macro definition for M_PI
2018-07-03 07:26:59 +02:00
zdenop
58b1755bbd
Merge pull request #1731 from stweil/cutil
Remove functions open_file, exists_file
2018-07-03 07:26:41 +02:00
Stefan Weil
9325fbe322 Remove unused include files
ccstruct/hpdsizes.h was not used at all.
cutil/const.h was included, but not needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-03 07:25:38 +02:00
Stefan Weil
2cd2d3200f Remove functions open_file, exists_file
cutil.cpp is now no longer needed and removed, too.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-03 06:45:34 +02:00
Charles Li
84f315db6c
Update tesseract.1.asc
Minor typo in options section for --user-patterns
2018-07-02 13:27:45 -07:00
Stefan Weil
cbd7b15788 Remove unneeded macro definition for M_PI
There is already one in platform.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-02 21:59:16 +02:00
zdenop
a0291c7651
Merge pull request #1727 from stweil/pi
Replace macro PI by macro M_PI
2018-07-02 21:53:39 +02:00
Stefan Weil
f7b61891bc Replace macro PI by macro M_PI
One definition for pi is sufficient.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-02 21:26:53 +02:00
zdenop
c323312c17
Merge pull request #1725 from stweil/doerror
Replace Efopen by fopen and remove efio.cpp, efio.h
2018-07-02 20:53:28 +02:00
zdenop
2227474331
Merge pull request #1726 from stweil/rand
Remove unused function long_rand
2018-07-02 20:51:21 +02:00
Stefan Weil
3840a769d6 Remove unused function long_rand
Remove also some old comments.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-02 20:11:42 +02:00
Stefan Weil
b57afc7c78 Replace Efopen by fopen and remove efio.cpp, efio.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-02 17:46:28 +02:00
zdenop
909af5d978
Merge pull request #1724 from stweil/float
Replace FLOAT32 by float data type and remove MAX_FLOAT32, MIN_FLOAT32
2018-07-02 13:57:16 +02:00
Stefan Weil
faae87beaa Replace FLOAT32 by float data type
On most systems float is the IEEE 754 single-precision binary
floating-point format (32 bits). Tesseract does not support other systems.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-02 13:29:39 +02:00
Stefan Weil
f6c3c8cf4d Replace MAX_FLOAT32 by standard FLT_MAX and remove unused MIN_FLOAT32
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-02 13:29:39 +02:00
zdenop
7ec337d9b8
Merge pull request #1723 from stweil/double
Replace FLOAT64 by double data type
2018-07-02 09:45:07 +02:00
Stefan Weil
919901eb19 Replace FLOAT64 by double data type
On most systems double is the IEEE 754 double-precision binary
floating-point format (64 bits). Tesseract does not support other systems.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-07-02 08:07:37 +02:00
zdenop
1a181a3150
Merge pull request #1722 from stweil/cov
Fix several issues reported by Coverity Scan
2018-07-01 21:03:42 +02:00