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>
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>
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>
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>
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>
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>
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.
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.
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.
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.
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.
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.
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.
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.