Commit Graph

4232 Commits

Author SHA1 Message Date
Stefan Weil
80c36095fa Fix 1164647 (Uninitialized members)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:25:22 +01:00
zdenop
567fc17377 Fix CID 1366450 (Uninitialized scalar field) for class RecodeBeamSearch
secondary_beam_size_ is set but never used, so remove it.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

# Conflicts:
#	src/lstm/recodebeam.cpp
2019-11-01 14:25:00 +01:00
Stefan Weil
b1965ad0fe Fix CID 1164662 (Uninitialized scalar field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:16:15 +01:00
Stefan Weil
73de2d99f5 Fix CID 1164659 (Uninitialized scalar field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:16:09 +01:00
Stefan Weil
90936b98c6 Fix CID 1164657 (Uninitialized scalar field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:16:03 +01:00
Stefan Weil
f9dd65a246 Fix CID 1164649 (Uninitialized scalar field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:15:57 +01:00
Stefan Weil
77bdad4b5e Fix CID 1164648 (Uninitialized scalar field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:15:51 +01:00
Stefan Weil
f4b4e47698 Fix CID 1164644 (Uninitialized scalar field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:15:45 +01:00
Stefan Weil
54d84989fe Fix CID 1164643 (Uninitialized scalar field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:15:40 +01:00
Stefan Weil
7c7494723f Fix CID 1164638 (Uninitialized scalar field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:15:34 +01:00
Stefan Weil
60f3b89a45 Fix CID 1164636 (Uninitialized pointer field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:15:28 +01:00
Stefan Weil
33e6d0496c Fix CID 1164634, CID 1164635 (Uninitialized pointer field)
Remove the unused dummy member variables.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:15:21 +01:00
Stefan Weil
ffd6f96654 Fix CID 1164633 (Uninitialized pointer field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:13:57 +01:00
Stefan Weil
09abbc3348 Fix CID 1164628 ff (Uninitialized pointer field) and optimize class ParamContent
Only one of bIt, dIt, iIt and sIt is used, so put all four in a union.
This fixes CID 1164628, CID 1164629, CID 1164630 and CID 1164631.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:13:50 +01:00
Stefan Weil
a1c8841725 Remove unused FeatureEnabled from FEATURE_DEFS_STRUCT
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:13:33 +01:00
Stefan Weil
b38c6d6ce4 Fix CID 1164622 (Uninitialized pointer field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:13:26 +01:00
Stefan Weil
b5655827c1 Fix CID 1164620 (Uninitialized pointer field)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:13:20 +01:00
Stefan Weil
33ee0694d1 Fix CID 1386105 (Logically dead code)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:13:13 +01:00
Stefan Weil
d6401f924c Fix CID 1402767 (Invalid type in argument to printf format specifier)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:13:07 +01:00
Stefan Weil
c09eea18ae Remove unused italic, bold in class BLOCK_RES and class WORD_RES
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:13:00 +01:00
Stefan Weil
3a88b99c2b Fix CID 1340276 (Uninitialized scalar field) for class BLOB_CHOICE
xgap_before_ and xgap_after_ are never used, so remove them.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:12:51 +01:00
Stefan Weil
3f86fc8f1a Fix CID 1400760 (Uninitialized scalar field) for class BLOCK
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:10:52 +01:00
zdenop
0a5443c93c Fix two issues reported by Coverity Scan and modernize class WERD_RES
Report from Coverity Scan:

    CID 1405560 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
    2. uninit_member: Non-static class member end is not initialized in
    this constructor nor in any functions that it calls.

    CID 1405561 [...]

Modernize and optimize class WERD_RES. This not only fixes the issues
but also reduces the size and eliminates the functions InitNonPointers
and InitPointers.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

# Conflicts:
#	src/ccstruct/pageres.h
2019-11-01 14:10:32 +01:00
Stefan Weil
f86f839ab8 Optimize classes Trie, Dawg and DawgPosition
Reduce size from 368 to 352 bytes for Trie, 72 to 64 bytes for Dawg
and 40 to 24 bytes for DawgPosition by avoiding holes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:06:14 +01:00
Stefan Weil
e6728ff055 Optimize classes CLIST_ITERATOR, ELIST_ITERATOR, ELIST2_ITERATOR
Reduce size from 56 to 48 bytes by avoiding holes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:06:07 +01:00
Stefan Weil
7601034772 Optimize class Classify
Reduce size from 138016 to 13000 bytes by avoiding holes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:06:02 +01:00
Stefan Weil
39788fc7eb Optimize class TFile
Reduce size from 24 to 16 bytes by avoiding holes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:05:56 +01:00
Stefan Weil
fbb9db8352 Optimize class ColPartition
Reduce size from 248 to 224 bytes by avoiding holes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:05:50 +01:00
Stefan Weil
e77f957357 Optimize struct LMConsistencyInfo
Reduce size from 104 to 96 bytes by avoiding holes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:05:44 +01:00
Stefan Weil
c48315ec21 Optimize class ViterbiStateEntry
Reduce size from 232 to 216 bytes by avoiding holes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:05:38 +01:00
Stefan Weil
69c4829743 Modernize and optimize BLOBNBOX and remove BLOBNBOX::ConstructionInit
The class no longer uses bit fields. Re-ordering the member variables
avoids holes and reduces the size of BLOBNBOX from 168 to 152 bytes.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:03:29 +01:00
Stefan Weil
b8c516de9c tfnetwork: Fix info text
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:03:22 +01:00
Stefan Weil
591110ecac Re-order commands in autogen.sh
This avoids an unnecessary reconfiguration when running

    ./autogen.sh && ./configure && make

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:03:16 +01:00
Stefan Weil
8615e6e36c RecodedCharIDHash: Fix runtime errors detected by UndefinedBehaviorSanitizer
Fix this runtime error in recodebeam_test and unicharcompress_test:

    src/ccutil/unicharcompress.h:84:27: runtime error:
      left shift of 267 by 28 places cannot be represented in type 'int'

code has up to kMaxCodeLen (9) values, so the highest possible value for
i is 8, and the shift value can reach 7 * 8 = 56.

That requires an uint64_t data type.
size_t would fit for 64 bit hosts, but be too small for 32 bit hosts.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:03:07 +01:00
Stefan Weil
e4389be97e OSResults: Fix runtime errors detected by UndefinedBehaviorSanitizer
Fix this runtime error in osd_test and textlineprojection_test:

    src/ccmain/osdetect.cpp:109:14: runtime error: division by zero

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:03:00 +01:00
Stefan Weil
3951f840b9 BitVector: Fix runtime errors detected by UndefinedBehaviorSanitizer
Fix these runtime errors in mastertrainer_test:

    src/ccutil/bitvector.cpp:119:18: runtime error:
      null pointer passed as argument 2, which is declared to never be null
    src/ccutil/bitvector.cpp:124:10: runtime error:
      null pointer passed as argument 1, which is declared to never be null

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:02:53 +01:00
Stefan Weil
e11e50fda7 ccutil: Remove old comments
There is no CLIST2 in the current code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:02:20 +01:00
Stefan Weil
e142b5ec26 Use type bool for boolean values in class BLOBNBOX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:02:12 +01:00
Stefan Weil
df3612d366 Fix warnings from LGTM
This fixes three LGTM warnings:

    Multiplication result may overflow 'float' before it is converted to 'double'.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:01:19 +01:00
Stefan Weil
84083138fb fuzzer-api: Use optional macro LIB_FUZZING_ENGINE for build
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:01:13 +01:00
Stefan Weil
0a9ef388b5 Add missing TensorFlow libraries for fuzzer-api
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:01:04 +01:00
Stefan Weil
e892cc272f Fix crash when function lookup tables are accessed with NaN
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:00:49 +01:00
Stefan Weil
863a5b4232 capi: Add missing PSM_RAW_LINE to TessPageSegMode
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:00:31 +01:00
zdenop
f15e2cc174 fix typo 2019-11-01 14:00:22 +01:00
Stefan Weil
7e980df016 simd: Check whether the OS supports FMA, AVX, ...
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 14:00:00 +01:00
Stefan Weil
e413b9318b classify/Makefile: Fix inconsistent style
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 13:59:33 +01:00
Julian Gilbey
d8f695271f fix #2616: allow building of training data
This fixes Issue #2616 by preventing an attempt to build the recognition engine when running tesstrain.sh.
2019-11-01 13:59:26 +01:00
Egor Pugin
55b4099ad1 Export some classify vars. 2019-11-01 13:59:14 +01:00
zdenop
0d8be252cc Remove more code for builds with disabled legacy engine
Now the Tesseract library no longer includes unused code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

# Conflicts:
#	src/cutil/Makefile.am
#	unittest/Makefile.am
2019-11-01 13:58:37 +01:00
Stefan Weil
b52c466ab4 [sw] Update build for commit e84cb24def
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-11-01 13:51:01 +01:00