Commit Graph

2978 Commits

Author SHA1 Message Date
Stefan Weil
68bcd6ba90 Validator: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/training/validator.h:72:7: warning:
 'Validator' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:48:43 +02:00
Stefan Weil
0d211f9ed5 Dawg: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/dict/dawg.h:119:7: warning:
 'Dawg' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:47:29 +02:00
Stefan Weil
ac8afc57bb CUtil: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/cutil/cutil_class.h:27:7: warning:
 'CUtil' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:46:31 +02:00
Stefan Weil
32098b7d4d IndexMap: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/ccutil/indexmapbidi.h:102:7: warning:
 'IndexMapBiDi' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:45:28 +02:00
Stefan Weil
5b8162f0ef CCUtil: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/ccutil/ccutil.h:51:7: warning:
 'CCUtil' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:44:27 +02:00
Stefan Weil
14c23c9f13 MATRIX: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/ccstruct/matrix.h:575:7: warning:
 'MATRIX' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:43:17 +02:00
Stefan Weil
bde8f08003 CCStruct: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/ccstruct/ccstruct.h:25:7: warning:
 'CCStruct' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:42:06 +02:00
Stefan Weil
8317371f24 LTRResultIterator 2018-09-04 07:39:34 +02:00
Stefan Weil
b612c2c53d SVEventHandler 2018-09-04 07:39:20 +02:00
Stefan Weil
1c9bd51de8 SVEventHandler: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/viewer/scrollview.h:86:7: warning:
 'SVEventHandler' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:35:30 +02:00
Stefan Weil
8e55146938 MutableIterator: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/ccmain/mutableiterator.h:44:7: warning:
 'MutableIterator' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:35:30 +02:00
Stefan Weil
d926655cfe LTRResultIterator: Define virtual destructor in .cpp file
This fixes compiler warnings from clang:

src/ccmain/ltrresultiterator.h:48:16: warning:
 'LTRResultIterator' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:35:30 +02:00
Stefan Weil
c635cdf5d5 Do not define or use macro __UNIX__
Either it was not needed, or it could be replaced by checking
for not _WIN32.

This fixes a compiler warning from clang:

src/ccutil/platform.h:41:9: warning:
 macro name is a reserved identifier [-Wreserved-id-macro]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-04 07:34:11 +02:00
Egor Pugin
3a7cd2bb31
Merge pull request #1892 from Lin-Buo-Ren/improve-snap-packaging
Improve snap packaging
2018-09-03 23:24:03 +03:00
Egor Pugin
56b449f745
Merge pull request #1893 from stweil/clean
Fix some compiler warnings and clean code
2018-09-03 23:22:24 +03:00
Stefan Weil
9f8ed31a26 api/pdfrenderer.cpp: Fix compiler warning
Compiler warning from clang:

src/api/pdfrenderer.cpp:848:28: warning:
 cast from 'const char *' to 'char *' drops const qualifier [-Wcast-qual]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-03 12:32:35 +02:00
Stefan Weil
08e25d41b7 textord/cjkpitch: Fix mismatch between format string and argument
size_t would require a different format string. Here an unsigned int
is sufficient in both cases, so use that.

This error was found by lgtm, see
https://lgtm.com/projects/g/tesseract-ocr/tesseract/.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-03 12:17:47 +02:00
Stefan Weil
2cc7839af7 textord/makerow.cpp: Fix compiler warnings
Compiler warnings from clang:

src/textord/makerow.cpp:2579:36: warning:
 cast from 'const void *' to 'BLOBNBOX **' drops const qualifier [-Wcast-qual]
src/textord/makerow.cpp:2581:36: warning:
 cast from 'const void *' to 'BLOBNBOX **' drops const qualifier [-Wcast-qual]
src/textord/makerow.cpp:2601:31: warning:
 cast from 'const void *' to 'TO_ROW **' drops const qualifier [-Wcast-qual]
src/textord/makerow.cpp:2603:31: warning:
 cast from 'const void *' to 'TO_ROW **' drops const qualifier [-Wcast-qual]
src/textord/makerow.cpp:2623:31: warning:
 cast from 'const void *' to 'TO_ROW **' drops const qualifier [-Wcast-qual]
src/textord/makerow.cpp:2625:31: warning:
 cast from 'const void *' to 'TO_ROW **' drops const qualifier [-Wcast-qual]

Warning from lgtm:

Local variable 'blob' hides a parameter of the same name.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-03 12:05:56 +02:00
Stefan Weil
e74c88a4d3 ccstruct/werd.cpp: Fix compiler warnings
Compiler warnings from clang:

src/ccstruct/werd.cpp:128:4: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/werd.cpp:394:18: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/werd.cpp:394:27: warning:
 cast from 'const void *' to 'WERD **' drops const qualifier [-Wcast-qual]
src/ccstruct/werd.cpp:395:18: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/werd.cpp:395:27: warning:
 cast from 'const void *' to 'WERD **' drops const qualifier [-Wcast-qual]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-03 11:42:59 +02:00
Stefan Weil
4934b2e8eb ccstruct/polyblk.cpp: Fix compiler warnings
Compiler warnings from clang:

src/ccstruct/polyblk.cpp:194:16: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/polyblk.cpp:195:16: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/polyblk.cpp:292:45: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/polyblk.cpp:30:9: warning:
 macro is not used [-Wunused-macros]
src/ccstruct/polyblk.cpp:348:8: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/polyblk.cpp:358:12: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/polyblk.cpp:362:26: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/polyblk.cpp:383:21: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/polyblk.cpp:383:36: warning:
 cast from 'const void *' to 'ICOORDELT **' drops const qualifier [-Wcast-qual]
src/ccstruct/polyblk.cpp:384:21: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/polyblk.cpp:384:36:
 warning: cast from 'const void *' to 'ICOORDELT **' drops const qualifier [-Wcast-qual]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-03 11:42:59 +02:00
Stefan Weil
4f32b8fd05 ccstruct/ocrblock.cpp: Fix compiler warnings
Compiler warnings from clang:

src/ccstruct/ocrblock.cpp:74:12: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/ocrblock.cpp:74:21: warning:
 cast from 'const void *' to 'ROW **' drops const qualifier [-Wcast-qual]
src/ccstruct/ocrblock.cpp:75:16: warning:
 cast from 'const void *' to 'ROW **' drops const qualifier [-Wcast-qual]
src/ccstruct/ocrblock.cpp:75:7: warning:
 use of old-style cast [-Wold-style-cast]

Make also the function decreasing_top_order a local function as it is
only used locally and remove its global declarations (2 locations).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-03 11:42:59 +02:00
Stefan Weil
59b637efcf ccstruct/mod128.cpp: Fix compiler warnings
Compiler warnings from clang:

src/ccstruct/mod128.cpp:57:15: warning:
 no previous extern declaration for non-static variable 'dirtab' [-Wmissing-variable-declarations]
src/ccstruct/mod128.cpp:57:24: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/mod128.cpp:57:35: warning:
 cast from 'const short *' to 'ICOORD *' drops const qualifier [-Wcast-qual]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-03 11:42:59 +02:00
林博仁(Buo-ren, Lin)
31de2cf60e Add newline at end of file
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2018-09-03 17:13:45 +08:00
林博仁(Buo-ren, Lin)
ccbda7a20f Stage packages that provides the depending libraries
Snapcraft will soonly drop the feature to automatic staging the
depending libraries into the snap, specify it manually to avoid breakage
in the future.

This deals with the following warning message in the build:

```
Priming leptonica
Files from the build host were migrated into the snap to satisfy
dependencies that would otherwise not be met. This feature will be
removed in a future release. If these libraries are needed in the final
snap, ensure that the following are either satisfied by a stage-packages
entry or through a part:
usr/lib/x86_64-linux-gnu/libjbig.so.0
usr/lib/x86_64-linux-gnu/libjpeg.so.8
usr/lib/x86_64-linux-gnu/libopenjp2.so.7
usr/lib/x86_64-linux-gnu/libtiff.so.5
Priming tesseract
Files from the build host were migrated into the snap to satisfy
dependencies that would otherwise not be met. This feature will be
removed in a future release. If these libraries are needed in the final
snap, ensure that the following are either satisfied by a stage-packages
entry or through a part:
usr/lib/x86_64-linux-gnu/libgomp.so.1
```

Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2018-09-03 17:13:06 +08:00
Stefan Weil
2a61f6dfcd Fix compiler warnings in c_blob_comparator and make it a local function
Compiler warnings from clang:

src/ccstruct/genblob.cpp:34:20: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/genblob.cpp:34:32: warning:
 cast from 'const void *' to 'C_BLOB **' drops const qualifier [-Wcast-qual]
src/ccstruct/genblob.cpp:35:20: warning:
 use of old-style cast [-Wold-style-cast]
src/ccstruct/genblob.cpp:35:32: warning:
 cast from 'const void *' to 'C_BLOB **' drops const qualifier [-Wcast-qual]

The function c_blob_comparator is only used in fixspace.cpp,
so move it to that file, make it a local function, and remove
genblob.cpp and genblob.h which are no longer needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-09-03 10:59:11 +02:00
林博仁(Buo-ren, Lin)
9c8a585107 Add git tracking ignore rules for snap packaging
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2018-09-03 16:47:39 +08:00
林博仁(Buo-ren, Lin)
aa48247f1a Assert removable-media interface in the snap
This allows access to the files under `/media/*` and `/run/media/*`, as
the connection is not automatic connect instructions is also added to
the snap's description.

Refer-to: Interfaces - doc - snapcraft.io
<https://forum.snapcraft.io/t/interfaces/6154>
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2018-09-03 16:45:08 +08:00
林博仁(Buo-ren, Lin)
b5ff354d06 Split app. command arguments into separate lines
This allows cleaner diffs for future modifications using the YAML's
"folded" block scalar style.

Refer-to: Folded Style - Block Scalar Styles - Block Styles
<http://yaml.org/spec/1.2/spec.html#id2796251>
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2018-09-03 16:32:09 +08:00
林博仁(Buo-ren, Lin)
5ea8bf64f5 Flip snap packaging's grade to stable
This change allows downstream packagers to publish the snap to the
candidate and stable channels.

Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2018-09-03 16:20:15 +08:00
林博仁(Buo-ren, Lin)
554450c943 Use automatic git-based versioning for the snap
Snapcraft supports automatic `git describe` based versioning when the
`version` key is set to `git`.  This gives more information of the
source status of a snap distribution.

Refer-to: Snapcraft.yaml reference - doc - snapcraft.io
<https://forum.snapcraft.io/t/snapcraft-yaml-reference/4276>
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2018-09-03 16:17:47 +08:00
Stefan Weil
69a111a739 Clean use of qsort function sort_floats
It is only used in textord/topitch.cpp, so move it into that file.

Remove also the inline attribute as it has not effect here and
update the type casts to fix some compiler warnings from clang.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-31 23:17:27 +02:00
Egor Pugin
e4b9cfffcb
Merge pull request #1887 from Shreeshrii/newjava
Add langtests framework with frk example
2018-08-30 17:34:03 +03:00
Shree Devi Kumar
92922b421c Add langtests framework with frk example 2018-08-30 14:28:34 +00:00
Egor Pugin
bc536dcc19
Merge pull request #1884 from Shreeshrii/newjava
Add $(LEPTONICA_LIBS) to applybox_test_LDADD
2018-08-30 12:17:17 +03:00
Shree Devi Kumar
a849860c6e add prime test programs to gitignore 2018-08-30 04:32:04 +00:00
Shree Devi Kumar
4aaad7b7d1 add /unittest/*_test to gitignore 2018-08-30 04:30:01 +00:00
Shree Devi Kumar
b5d41b77eb Add leptonica-libs for apply-boxes test 2018-08-30 04:25:28 +00:00
Egor Pugin
2645dfce1b
Merge pull request #1882 from Shreeshrii/newjava
DISABLE some tests
2018-08-29 23:58:05 +03:00
Shree Devi Kumar
85b03723ea DISABLE some tests by default since they take long to run. They can be forced to run by --gtest_also_run_disabled_tests argument 2018-08-29 20:28:20 +00:00
zdenop
a78bbd2f72
Merge pull request #1876 from stweil/unittest
unittest: Fix and enable applybox_test
2018-08-28 21:11:22 +02:00
Stefan Weil
46f65bf0c2 unittest: Fix and enable applybox_test
It needs an update of the test submodule.

The tests only pass with a small modification of the ground truth texts
(kTruthTextWords, kTruthTextLine).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-28 21:03:49 +02:00
Egor Pugin
abd1c3d879
Merge pull request #1870 from Shreeshrii/newjava
Javanese Virama and pre-base vowel fix
2018-08-28 13:57:08 +03:00
Shree Devi Kumar
70daecf267 Javanese Validation works now - for the most part 2018-08-27 21:00:35 +00:00
Shree Devi Kumar
3e8e338c06 taking as kCOnsonant in validate_grapheme 2018-08-27 12:09:34 +00:00
Shree Devi Kumar
a6c6b34bac Workaround for Javanese Aksara's Taling, do not label it as a combiner 2018-08-27 12:09:34 +00:00
zdenop
5b31213764
Merge pull request #1866 from stweil/unittests
Fix and enable two more unit tests
2018-08-27 12:34:46 +02:00
zdenop
c773092446
Merge pull request #1865 from noahmetzger/winfix
Added detailed value description for glyph_confidences parameter
2018-08-27 12:34:03 +02:00
Stefan Weil
c1af1f6694 unittest: Fix and enable commandlineflags_test
It only works if training is enabled and built.

The test "PrintUsageAndExit" had to be disabled because it
currently fails.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-27 11:55:23 +02:00
Stefan Weil
ca7ae1c3a6 unittest: Fix and enable validator_test
It requires additional training libraries, so this test only works
if training is enabled and build.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-08-27 11:45:35 +02:00
Noah Metzger
f7663c69f6 Added detailed value description for glyph_confidences parameter
Signed-off-by: Noah Metzger <noah.metzger@bib.uni-mannheim.de>
2018-08-27 10:52:15 +02:00