While "echo -n" works on Debian GNU Linux, it fails to produce a valid
configure file on macOS, so try a different shorter solution.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Fix these gcc warnings:
arch/dotproductavx.cpp:53:45: warning:
type qualifiers ignored on cast result type [-Wignored-qualifiers]
arch/dotproductavx.cpp:54:45: warning:
type qualifiers ignored on cast result type [-Wignored-qualifiers]
arch/dotproductsse.cpp:59:45: warning:
type qualifiers ignored on cast result type [-Wignored-qualifiers]
arch/dotproductsse.cpp:60:45: warning:
type qualifiers ignored on cast result type [-Wignored-qualifiers]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc warnings:
viewer/scrollview.cpp:72:10: warning:
‘char* strncpy(char*, const char*, size_t)’ output truncated before
terminating nul copying as many bytes from a string as its length
[-Wstringop-truncation]
viewer/scrollview.cpp:118:14: warning:
‘char* strncpy(char*, const char*, size_t)’ specified bound depends on
the length of the source argument [-Wstringop-overflow=]
viewer/scrollview.cpp:746:10: warning:
‘char* strncpy(char*, const char*, size_t)’ output truncated before
terminating nul copying as many bytes from a string as its length
[-Wstringop-truncation]
viewer/scrollview.cpp:830:10: warning:
‘char* strncpy(char*, const char*, size_t)’ output truncated before
terminating nul copying as many bytes from a string as its length
[-Wstringop-truncation]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc warning:
wordrec/language_model.cpp:959:16: warning:
‘char* strncpy(char*, const char*, size_t)’ output truncated before
terminating nul copying as many bytes from a string as its length
[-Wstringop-truncation]
memcpy could also be a little bit faster than strncpy.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* autogen: Report missing autoconf-archive
autoconf-archive is required, but users often missed that requirement.
The script now detects and reports missing autoconf-archive and removes
the incomplete generated configure script.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* autogen: Report missing pkg-config
pkg-config is required.
The script now detects and reports missing pkg-config and removes
the incomplete generated configure script.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* api: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccmain: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccstruct: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* classify: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* cutil: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* dict: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* textord: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* training: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* wordrec: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccutil: Replace Tesseract data types by POSIX data types
Now all Tesseract data types which are no longer needed can be removed
from ccutil/host.h.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccmain: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccstruct: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* classify: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* dict: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* lstm: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* textord: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* wordrec: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* ccutil: Replace Tesseract's MIN_*INT, MAX_*INT* by POSIX *INT*_MIN, *INT*_MAX
Remove the macros which are now unused from ccutil/host.h.
Remove also the obsolete history comments.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Fix build error caused by ambiguous ClipToRange
Error message vom Appveyor CI:
C:\projects\tesseract\ccstruct\coutln.cpp(818): error C2672: 'ClipToRange': no matching overloaded function found [C:\projects\tesseract\build\libtesseract.vcxproj]
C:\projects\tesseract\ccstruct\coutln.cpp(818): error C2782: 'T ClipToRange(const T &,const T &,const T &)': template parameter 'T' is ambiguous [C:\projects\tesseract\build\libtesseract.vcxproj]
c:\projects\tesseract\ccutil\helpers.h(122): note: see declaration of 'ClipToRange'
C:\projects\tesseract\ccstruct\coutln.cpp(818): note: could be 'char'
C:\projects\tesseract\ccstruct\coutln.cpp(818): note: or 'int'
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* unittest: Replace Tesseract's MAX_INT8 by POSIX INT8_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* arch: Replace Tesseract's MAX_INT8 by POSIX INT8_MAX
Signed-off-by: Stefan Weil <sw@weilnetz.de>
tessdata_best and tessdata_fast recently changed the path for script data,
so the tests have to be updated, too.
In addition, the relative paths did not work with out-of-tree builds.
Use absolute paths and add them as C macros to the compiler flags.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Replace the Tesseract specific data types in header files which are
part of Debian package libtesseract-dev by POSIX data types.
Update also matching cpp files.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc reports this warning about 250 times:
ccutil/genericvector.h:378:48: warning:
comparison between signed and unsigned integer expressions [-Wsign-compare]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Fix 306 warnings from MS C:
tesseract\ccutil\unicharset.h(242): warning C4267:
'argument': conversion from 'size_t' to 'int', possible loss of data
The change also avoids some type conversions.
The related code in training/util.h now uses the GOOGLE_TESSERACT macro
to enable Google specific code to disable heap checking.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Remove old code for string class (no longer needed)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Add std namespace to string class
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Replace log2(n) by faster local function
This also adds support for environments without a log2 function (Android).
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Provide local log2 function on platforms without log2 function
The existing implementation in wordrec/language_model.cpp is modified
to use a local inline function in the tesseract namespace and copied
to lstm/weightmatrix.cpp, too.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
If equ_detect_ can be NULL, we must catch that case and show a warning
instead of crashing in method SetEquationDetect.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It looks like those files were added accidentally
in commit fc6a390c6c.
Add them to .gitignore to avoid that from now on.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Restore support for the legacy engine
It is still needed to get text attributes which are unsupported by the
LSTM engine, and it also has better recognition rates for some texts.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* tesseractmain: Add missing 'static' attributes
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Support different help texts for normal and advanced users
The old option --help now shows a very basic help text.
The new option --help-extra shows the full help information.
It now also includes a hint that Tesseract supports lists of images.
Fix also the indentation in the PSM help and
use a more neutral text in the OEM help.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Add missing line feed in error message
Signed-off-by: Stefan Weil <sw@weilnetz.de>