Commit Graph

1093 Commits

Author SHA1 Message Date
Stefan Weil
8c4b027292 tesseractmain: Fix unterminated string
Coverity bug report: CID 1270421 "Buffer not null terminated".

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:15:06 +01:00
Stefan Weil
af9212c459 ccmain: Remove unused private class member
This fixes a warning from clang.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:14:55 +01:00
Stefan Weil
56c2347e98 Remove checks for this == NULL
This fixes warnings from clang.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:14:41 +01:00
Stefan Weil
c6b758b11d Remove register attribute for local variables
This fixes clang compiler warnings like this one:

wordrec/gradechop.cpp:52:3: warning:
 'register' storage class specifier is deprecated [-Wdeprecated-register]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:14:29 +01:00
Stefan Weil
c8114811a5 Fix compiler warnings for copy constructors
gcc reports these warnings with -Wextra:

ccstruct/pageres.h:330:3: warning:
 base class 'class ELIST_LINK' should be explicitly initialized
 in the copy constructor [-Wextra]
ccstruct/ratngs.cpp:115:1: warning:
 base class 'class ELIST_LINK' should be explicitly initialized
 in the copy constructor [-Wextra]
ccstruct/ratngs.h:291:3: warning:
 base class 'class ELIST_LINK' should be explicitly initialized
 in the copy constructor [-Wextra]
ccutil/genericvector.h:435:3: warning:
 base class 'class GenericVector<WERD_RES*>' should be explicitly initialized
 in the copy constructor [-Wextra]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:13:51 +01:00
Stefan Weil
18939a725f ccstruct: Fix compiler warning (disable buggy code)
gcc reports a potential bad array access:

ccstruct/mod128.cpp:98:20: warning:
 array subscript has type 'char' [-Wchar-subscripts]

dir is of type 'char'. Most compilers use signed char by default.
Then the value of dir is in the range -128 ... 127 and cannot be
used to access an array with 256 elements.

Don't fix that but disable the buggy code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:13:41 +01:00
Stefan Weil
cd946dc30d api: Fix printing of a size_t value
size_t is not always the same as long, especially not for 64 bit Windows:

api/pdfrenderer.cpp:549:31: warning:
 format '%ld' expects argument of type 'long int',
 but argument 4 has type 'size_t {aka long long unsigned int}' [-Wformat=]

size_t normally requires a format string "%zu", but this is unsupported
by Visual Studio, so use a type cast.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:13:34 +01:00
Stefan Weil
c0f4e86ef5 Fix case of include file name
Windows.h works on Windows, but not for cross builds on Linux hosts
with case sensitive file systems which only provide windows.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:13:23 +01:00
Stefan Weil
f7368ecb14 Don't use NULL for integer arguments
This fixes compiler warnings:

api/baseapi.cpp:1422:49: warning:
 passing NULL to non-pointer argument 6 of
 'int MultiByteToWideChar(UINT, DWORD, LPCCH, int, LPWSTR, int)'
 [-Wconversion-null]
api/baseapi.cpp:1427:54:
 warning: passing NULL to non-pointer argument 6 of
 'int WideCharToMultiByte(UINT, DWORD, LPCWCH, int, LPSTR, int, LPCCH, LPBOOL)'
 [-Wconversion-null]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:13:15 +01:00
Stefan Weil
1f4c8d0567 Remove unneeded const qualifiers
This fixes compiler warnings like this one:

api/baseapi.h:739:32: warning:
 type qualifiers ignored on function return type [-Wignored-qualifiers]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:13:00 +01:00
Stefan Weil
03a6e516ca viewer: Fix typos in comments
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:12:46 +01:00
Stefan Weil
9cbda9238e training: Fix typos in comments and strings
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:12:39 +01:00
Stefan Weil
9daf61f4d9 textord: Fix typos in comments and strings
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:12:29 +01:00
Stefan Weil
40dc71676b testing: Fix typo in comment (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:12:21 +01:00
Stefan Weil
02a071c593 opencl: Fix typos in comments and strings
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:12:02 +01:00
Stefan Weil
32d179e0a6 Fix more typos in comments (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:11:54 +01:00
Zdenko Podobný
1890ba5f2a autotools: fail if g++ or clang++ compiler is not found; Fixes #130 (commit 34f34ead) 2016-02-05 11:11:39 +01:00
Stefan Weil
7e9a7827c1 viewer: Fix format string
Variable port is an int, so "%d" is needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:03:10 +01:00
Stefan Weil
3de9dd91f5 cube: Use local variable which was reported as unused
The local variable first_lower was assigned a value which was not used.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:03:02 +01:00
Stefan Weil
7a14c0114f ccmain: Remove unused local variables
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 11:02:53 +01:00
Zdenko Podobný
90b5947b5f Detect presence of 'off_t' by configure test (partial cherry-pick from 87c21aaa5c) 2016-02-05 11:02:15 +01:00
Felix Janda
24fe797734 viewer/svutils.cpp: Include <sys/select.h> for FD_SET, ... 2016-02-05 10:58:40 +01:00
amitdo
0bb5a7d6f0 Added osd renderer for psm 0.
Works for single page and multi-page.
2016-02-05 10:58:29 +01:00
ws233
bceb532a2f Type mismatch on a 64bit platforms has been fixed. 2016-02-05 10:58:11 +01:00
amitdo
79ed9a30c7 OSD: Print script name instead of meaningless script id 2016-02-05 10:57:45 +01:00
John Slade
0fdfa98c0f training/unicharset_extractor.cpp: Print whether WCTYPE is included
Character properties are autogenerated only if wctype is found on the
system.  However, it is not possible to know if a version of
unicharset_extractor was compiled with this support (especially if it
was installed as a pre-compiled binary).

This commit adds a print to the usage details to output if the binary
was compiled with wctype support.
2016-02-05 10:56:26 +01:00
John Slade
85c404e582 configure.ac: Detect wchar_t using wchar.h header
The wchar_t type is defined in `wchar.h` and if this header is not
included by autoconf the detection of the type will fail.  This type is
required by `unicharset_extractor` to autogenerate the character
properties.

This problem was detected when running under Fedora 21.
2016-02-05 10:56:18 +01:00
Pepe Bawagan
a153a51f39 adds sudo to "make install" command
for consistency with instructions that show up while installing
2016-02-05 10:55:52 +01:00
Stefan Weil
67c7d4a2cb wordrec: Fix typos in comments
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:55:32 +01:00
Stefan Weil
bb2e239989 Java: Fix typos in comments and strings
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:55:19 +01:00
Stefan Weil
4a85f4b6bd Doxyfile: Fix typo in comment (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:55:11 +01:00
Stefan Weil
e9cf8cf95e dict: Fix typos in comments and strings
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:55:03 +01:00
Stefan Weil
72ee298e4d cutil: Fix typos in comments
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:54:51 +01:00
Stefan Weil
a190f340cb cube: Fix typos in comments
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:54:41 +01:00
Stefan Weil
2e73c9d5ea classify: Fix typos in comments and strings
All of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:54:26 +01:00
Stefan Weil
3a385569fe ccutil: Fix typos in comments and strings
Most of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:54:19 +01:00
Stefan Weil
fbc07c0f1b ccstruct: Fix typos in comments and strings
Most of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:54:10 +01:00
Zdenko Podobný
d7a96db827 fix typo 2016-02-05 10:53:14 +01:00
Stefan Weil
bd3cd8f447 ccmain: Fix typos in comments and strings
Most of them were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:52:16 +01:00
Stefan Weil
f72e65b36e api: Fix typos in comments (all found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:52:06 +01:00
Stefan Weil
8f465ca01e COPYING: Fix typo found by codespell
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-02-05 10:51:56 +01:00
Nick White
d31ffc292f Use mktemp to create workspace directory
mktemp is a better idea for security, as well as enabling users to
specify a different directory using the TMPDIR environment variable,
which is useful if /tmp is a small tmpfs.

Also fix a bug where the first few log messages were failing as the
workspace directory wasn't been created early enough.
2016-02-05 10:51:43 +01:00
Nick White
143ef735a4 Add --exposures option to tesstrain.sh
This flag can be used to specify multiple different exposure levels
for a training. There was some code already in tesstrain_utils.sh
to deal with multiple exposure levels, so it looks like this
functionality was always intended.

The default usage does not change, with exposure level 0 being the
only one used if --exposures is not used.
2016-02-05 10:51:34 +01:00
Nick White
45590ba1c1 Remove --bin_dir option from tesstrain.sh (should use $PATH instead)
The --bin_dir option to tesstrain.sh is not useful, as $PATH does the
same job much better, so switch to relying on that instead.

This also makes the code a bit more readable, as it removes the need
to refer to binaries as COMMAND_NAME_EXE rather than just command_name.
2016-02-05 10:51:23 +01:00
Nick White
b581c33789 tesstrain.sh: Initialise fontconfig even if Arial isn't available
The fontconfig initialisation hardcodes using Arial. However it may
not be available, whereas the fonts being used later will be, so use
one of them for initialisation instead.
2016-02-05 10:51:14 +01:00
Nick White
83f757985f tesstrain.sh: Only set FONTS if they weren't set on the command line
Previously the fonts specified in language-selection.sh would override
any specified on the command line.

This changes language-specific.sh from overriding a user request to
just setting the default fonts if none are specified with --fontlist.
2016-02-05 10:51:04 +01:00
Nick White
caab05b0bb tesstrain.sh: Only fall back to default Latin fonts if none were provided
The --fontlist argument to tesstrain.sh was always ignored, even if
the language had no specific fonts specified in language-specific.sh.

Change this behaviour so the --fontlist argument is used if no specifc
fonts are selected by language-specific.sh.
2016-02-05 10:50:54 +01:00
Tom Morris
1b4f83a1c9 Simplify build and run of ScrollView 2016-02-05 10:50:05 +01:00
Tom Morris
109c309356 Add ULL to constants which overflow 32 bits 2016-02-05 10:49:50 +01:00
James R. Barlow
b3eaf6d748 Fix configure.ac unconditionally enabling OpenCL 2016-02-05 10:47:27 +01:00