Commit Graph

2519 Commits

Author SHA1 Message Date
Alexander Zaitsev
3ce2cab742 Merge remote-tracking branch 'my_repo/small_fixes' into small_fixes 2018-05-20 17:50:29 +03:00
Alexander Zaitsev
d54d7486b4 Use std::max/std::min instead of MAX/MIN macros. 2018-05-20 17:49:48 +03:00
Alexander Zaitsev
14ae0b8727 Use std::max/std::min instead of MAX/MIN macros. 2018-05-20 16:18:07 +03:00
Alexander Zaitsev
c34e145b1a Use numeric_limits instead of INT_MAX. 2018-05-20 14:49:35 +03:00
Alexander Zaitsev
7d08e117d8 Added more const. 2018-05-20 14:21:07 +03:00
Alexander Zaitsev
e7e8e20119 Remove deprecated in C++11 'register' keyword (removed since C++17). 2018-05-20 01:49:26 +03:00
Alexander Zaitsev
a50b966af5 Added more const and one small fix. 2018-05-20 01:43:43 +03:00
Alexander Zaitsev
0697235bb2 Use using instead of typedef. Reason: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rt-using 2018-05-20 01:31:03 +03:00
Alexander Zaitsev
0248c7ff9d Rename all C-style headers (e.g. <stdio.h>) to C++ style (<cstdio>). 2018-05-20 00:52:04 +03:00
Alexander Zaitsev
96f8f853c8 Small enhancements (adding const, etc.) 2018-05-19 23:07:28 +03:00
zdenop
6f4e195489
Merge pull request #1581 from Shreeshrii/patch-1
Copy .box and .tif files along with .lstmf files from /tmp
2018-05-19 13:17:49 +02:00
Egor Pugin
a9c123342b
Merge pull request #1584 from RNCTX/master
Fix for too many leading slashes before TESSDATA folder
2018-05-19 13:42:24 +03:00
Robert Clayton
663b4d2d4b
Update Makefile.am 2018-05-19 01:43:31 -05:00
Robert Clayton
684e875612
Update Makefile.am 2018-05-19 01:42:57 -05:00
zdenop
1b8ab8e43b
Merge pull request #1583 from stweil/warn
Fix compiler warnings caused by initialization order in constructor
2018-05-18 22:13:49 +02:00
Stefan Weil
c8f8f6365c TabFind: Change order of initialization code
This fixes a compiler warning:

warning: ‘tesseract::TabFind::v_it_’ will be initialized after [-Wreorder]
warning:   ‘ICOORD tesseract::TabFind::image_origin_’ [-Wreorder]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-18 12:08:22 +02:00
Stefan Weil
6436a69677 BLOCK: Change order of initialization code
This fixes a compiler warning:

warning: ‘BLOCK::filename’ will be initialized after [-Wreorder]
warning:   ‘PDBLK BLOCK::pdblk’ [-Wreorder]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-18 12:08:10 +02:00
Shreeshrii
6c08ec02e4
Copy .box and .tif files along with .lstmf files from /tmp 2018-05-17 22:45:22 +05:30
zdenop
45a6546324
Merge pull request #1569 from noahmetzger/winfix
Added downward compatibility for older APIs
2018-05-08 21:43:46 +02:00
Noah Metzger
43d47f3583 Added downward compatibility for older APIs
The commit effa574 in 20.01.2017 added the bool textonly to the constructor of TessPDFRenderer. To maintain the compatibility to older APIs which are still using only two parameter, a default value for the textonly parameter is set.

Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
2018-05-08 17:22:06 +02:00
zdenop
8a7f3a9c6b
Merge pull request #1568 from amitdo/authors
Update AUTHORS
2018-05-08 16:04:32 +02:00
Amit D
af1af22fc0
Update AUTHORS 2018-05-08 16:52:32 +03:00
zdenop
d057050230
Merge pull request #1567 from stweil/utf8
Revert "fixes #388 by using raw bytes utf8 encoding"
2018-05-07 10:11:22 +02:00
Stefan Weil
932a108b4d Revert "fixes #388 by using raw bytes utf8 encoding"
This reverts commit 941e1c4c84. It is no
longer needed since commit f54800f14b.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-07 06:06:42 +02:00
zdenop
2236caec7c
Merge pull request #1563 from Shreeshrii/Shreeshrii-unittest-logging
remove non-essential logging function
2018-05-05 13:36:19 +02:00
Shreeshrii
07a6e64174
remove non-essential logging function
Also got error while building on  
Linux tesseract-ocr 4.4.0-122-generic #146-Ubuntu SMP Mon Apr 23 15:33:25 UTC 2018 ppc64le ppc64le ppc64le GNU/Linux
with 
g++ (Ubuntu/IBM 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609

```
g++ -DHAVE_CONFIG_H -I. -I..  -DNDEBUG -DTESSDATA_DIR="\"/home/ubuntu/tessdata\"" -DTESTING_DIR="\"/home/ubuntu/tesseract/testing\"" -DPANGO_ENABLE_ENGINE -I../src/api -I../src/api -I../src/arch -I../src/ccmain -I../src/ccstruct -I../src/ccutil -I../src/classify -I../src/cutil -I../src/dict -I../src/display -I../src/lstm -I../src/textord -I../src/viewer -I../src/wordrec -isystem ../googletest/googletest/include -I/usr/local/include/leptonica -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/powerpc64le-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12  -g -O2 -std=c++11 -MT osd_test.o -MD -MP -MF $depbase.Tpo -c -o osd_test.o osd_test.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/features.h:367:0,
                 from /usr/include/powerpc64le-linux-gnu/c++/5/bits/os_defines.h:39,
                 from /usr/include/powerpc64le-linux-gnu/c++/5/bits/c++config.h:482,
                 from /usr/include/c++/5/iostream:38,
                 from log.h:19,
                 from osd_test.cc:20:
/usr/include/powerpc64le-linux-gnu/bits/mathcalls.h:109:1: error: ‘double log(double)’ redeclared as different kind of symbol
 __MATHCALL_VEC (log,, (_Mdouble_ __x));
 ^
In file included from osd_test.cc:20:0:
log.h:26:3: note: previous declaration ‘LOG log’
 } log;
   ^
```
2018-05-05 16:34:26 +05:30
zdenop
8e2344a4b0
Merge pull request #1561 from stweil/cid
Fix CID 1390821 (Uninitialized variable)
2018-05-04 20:34:29 +02:00
Stefan Weil
7cf7d62929 Fix CID 1390821 (Uninitialized variable)
It was introduced by my latest commit 21d5ce5717.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-04 17:57:37 +02:00
zdenop
7dea671774
Merge pull request #1557 from stweil/cid
Fix CID 1386109 (Logically dead code)
2018-05-03 19:20:01 +02:00
Stefan Weil
11609f9509 Fix CID 1386109 (Logically dead code)
The else statement is never executed.

Remove also an unused element from the names array
and add the "static" attribute.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-03 18:32:42 +02:00
zdenop
c3ed6f0360
Merge pull request #1556 from noahmetzger/winfix
Fixed CID 1164537 (possible division by zero)
2018-05-03 17:45:24 +02:00
Noah Metzger
2193f81702 Fixed CID 1164537 (possible division by zero)
If height_count stays zero the maximal error calculation contains a division by zero.

Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
2018-05-03 14:55:41 +02:00
zdenop
2645f72c4a
Merge pull request #1555 from stweil/msvc
Don't disable compiler warnings for Visual Studio
2018-05-03 14:48:31 +02:00
Stefan Weil
c9b585cfc5 Don't disable compiler warnings for Visual Studio
It's still possible to set the warning level in the project settings,
but single source files should normally not disable compiler warnings.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-03 14:26:20 +02:00
Egor Pugin
fd5c93e667
Merge pull request #1554 from stweil/msvc
Add /utf-8 for MSVC
2018-05-03 15:24:52 +03:00
Stefan Weil
f54800f14b Add /utf-8 for MSVC
This fixes 208 compiler warnings of this form:

C4566: character represented by universal-character-name [...]
       cannot be represented in the current code page (1252)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-03 14:01:28 +02:00
zdenop
9ae97508ae
Merge pull request #1551 from stweil/bigendian
Fix Tesseract for big endian machines
2018-05-03 08:22:32 +02:00
zdenop
f53290ac61
Merge pull request #1552 from stweil/override
Use more override specifiers
2018-05-03 08:21:03 +02:00
Stefan Weil
dc3d28ccd7 Use more override specifiers
Now all methods which override Network methods use the override specifier.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-03 08:06:00 +02:00
Stefan Weil
21d5ce5717 Fix issue with big endian handling
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-03 07:19:59 +02:00
Stefan Weil
9c1fe092f1 Add assertion to detect wrong endianness handling
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-03 07:18:55 +02:00
zdenop
bf9b72c62b
Merge pull request #1546 from noahmetzger/winfix
Fixed access to uninitialized variable
2018-05-02 21:35:47 +02:00
Noah Metzger
a7d1402e5d Fixed access to uninitialized variable
Coverity ID: 1386084 the set_font method has accessed resolution_ before it was initialized by the set_resolution method.

Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
2018-05-02 16:11:35 +02:00
zdenop
984a9817fe
Merge pull request #1540 from stweil/strings
Remove unneeded include statements for string / strings.h
2018-05-01 10:15:40 +02:00
Stefan Weil
0efc528684 Remove unneeded include statements for string / strings.h
Tesseract code does not use strings.h (strngs.h was once called strings.h),
so that dependency can also be removed from cmake and cppan configuration.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-04-30 18:16:34 +02:00
zdenop
de78ef873e
Merge pull request #1539 from stweil/msvc
Remove old hack for Visual Studio
2018-04-30 17:49:54 +02:00
Stefan Weil
950469e645 Remove old hack for Visual Studio
It should not be needed with newer versions of Visual Studio.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-04-30 15:21:04 +02:00
zdenop
45bb9427e0
Merge pull request #1534 from UniQP/override
Add missing override specifiers
2018-04-28 19:30:47 +02:00
Egor Pugin
938bba3df3 Add missing file. 2018-04-28 12:04:47 +03:00
Sebastian Buchwald
4ac3063cbf Add missing override specifiers 2018-04-27 22:59:19 +02:00