* Add OPENMP_CXXFLAGS for ccmain.
* Replace OPENMP_CFLAGS by OPENMP_CXXFLAGS.
* Always use _OPENMP for conditional compilation.
* Remove OPENMP as there is already _OPENMP.
* Include omp.h conditionally.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Fix builds in subdirectories:
* Add srcdir to Manifest.txt.
* Remove srcdir from piccolo2d-core-3.0.jar and piccolo2d-extras-3.0.jar.
* Add dependency of SCROLLVIEW_CLASSES on SCROLLVIEW_LIBS.
The SCROLLVIEW_LIBS are now automatically fetched when needed.
* Add .PHONY target for fetch-jars.
* Improve rule for clean target.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
See issue #424.
The existing C API for TessBaseAPIDetectOS requires a C caller to successfully allocate struct OSResults which is actually a C++ class. Generally it won't
be possible for a regular C compiler to do this properly.
It's also assumed that most API level users of Tesseract are only interested in Tesseract's best guess as to script and orientation, not the individual values for all possible scripts.
This introduces a new API with a better name that is more closely aligned with the output of 'tesseract -psm 0'. Both tesseract -psm 0 and this API now share the same code in baseapi.cpp.
clang++ report:
api/baseapi.h:852:4: warning:
extra ';' after member function definition [-Wextra-semi]
[...]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Commit 03eec61a2f removed unneeded
null pointer checks after new, but missed one which now raises
a warning from coverity scan. Remove that one, too.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1366758: Memory - corruptions (USE_AFTER_FREE)
Calling "operator delete[]" frees pointer "label32"
which has already been freed.
Commit f60ff4d575 fixed several memory leaks
but also added this wrong delete operation.
label32 is assigned to char_samp->label32_, so it is freed when deleting
char_samp.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It was introduced recently in commit f24ef67d, so there is no need
to support the old variant for compatibility reasons.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It is not necessary to check for null pointers after new.
Simplify also two delete operations which were missing
in the previous commit.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1164722 (#9 of 9): Resource leak (RESOURCE_LEAK)
20. leaked_storage: Variable label32 going out of scope leaks the storage
it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1164717 (#1 of 1): Resource leak (RESOURCE_LEAK)
10. leaked_storage: Variable upper_32 going out of scope leaks
the storage it points to.
CID 1164718 (#1 of 1): Resource leak (RESOURCE_LEAK)
10. leaked_storage: Variable lower_32 going out of scope leaks
the storage it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
It is not necessary to check for null pointers.
Remove also unneeded delete operations and add missing delete operations
in cube/bmp_8.cpp.
Simplify also a conditional statement in cube/cube_object.cpp.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
GNU compiler report (cross build for Windows on Debian):
In file included from ../ccutil/host.h:63:0,
from ../arch/dotproductsse.h:22,
from ../arch/dotproductsse.cpp:43:
../ccutil/platform.h:27:0: warning: "NOMINMAX" redefined
#define NOMINMAX
In file included from /usr/lib/gcc/i686-w64-mingw32/6.1-win32/include/c++/i686-w64-mingw32/bits/c++config.h:495:0,
from /usr/lib/gcc/i686-w64-mingw32/6.1-win32/include/c++/cstdlib:41,
from /usr/lib/gcc/i686-w64-mingw32/6.1-win32/include/c++/stdlib.h:36,
from /usr/lib/gcc/i686-w64-mingw32/6.1-win32/include/mm_malloc.h:27,
from /usr/lib/gcc/i686-w64-mingw32/6.1-win32/include/xmmintrin.h:34,
from /usr/lib/gcc/i686-w64-mingw32/6.1-win32/include/emmintrin.h:31,
from ../arch/dotproductsse.cpp:40:
/usr/lib/gcc/i686-w64-mingw32/6.1-win32/include/c++/i686-w64-mingw32/bits/os_defines.h:45:0:
note: this is the location of the previous definition
#define NOMINMAX 1
Signed-off-by: Stefan Weil <sw@weilnetz.de>
With Debian package beignet-opencl-icd 1.2.1-1, Tesseract + OpenCL fails:
[DS] Profile file not available (tesseract_opencl_profile_devices.dat); performing profiling.
[DS] Device: "Intel(R) HD Graphics IvyBridge M GT2" (OpenCL) evaluation...
ASSERTION FAILED: sel.hasDoubleType()
at file /home/geier/beignet/backend/src/backend/gen_insn_selection.cpp, function void gbe::ConvertInstructionPattern::convertDoubleToSmallInts(gbe::Selection::Opaque&, const gbe::ir::ConvertInstruction&, bool&) const, line 5269
Trace/breakpoint trap
Using a pure float expression (instead of double) fixes this issue.
Signed-off-by: Stefan Weil <sw@weilnetz.de>