Replacing inttypes.h by cinttypes fixes a problem with glibc < 2.18:
In older inttypes.h, the standard C format macros are only defined for
C++ when the macro __STDC_FORMAT_MACROS is set.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Several code locations call that method with a normal C string,
so overload it to accept that without a conversion to a STRING
object. This saves unneeded new / memcpy / delete operations.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Fix this automake warning for java/Makefile.am:
java/Makefile.am:67: warning: user target 'clean' defined here ...
automake: ... overrides Automake target 'clean' defined here
java/Makefile.am:67: consider using clean-local instead of clean
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Tesseract crashes with an unhandled exception (std::bad_alloc) if it gets
a bad tessdata file where the numEntries data field is very large (also
after swapping), for example 0x77777777.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
When Tesseract terminates by calling the exit function,
the destructor of any local auto variable is not called.
Fix two cases by using static variables.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It's not necessary to initialize the vector with 0,
because the initial values are read from file.
Fix also an assertion when trying to read an empty file.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
libtiff is no longer needed for OpenCL, so remove that dependency.
It is still suggested for Windows to redirect warning messages
from the tesseract executable to the console.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The first parameter is casted to an unsigned byte by Leptonica,
so we don't need additional type casts in Tesseract code.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
The size() method returns a size_type value which is an unsigned type.
As there is no portable format string for that type, a type cast is needed.
Fix also several signed / unsigned mismatches which resulted in compiler
warnings.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
There exist standard macro definitions for the printf format specifiers.
MS Visual Studio does not support that standard (at least not in older
versions), so local definitions are needed there.
Signed-off-by: Stefan Weil <sw@weilnetz.de>