It is only used locally in opencl/openclwrapper.cpp.
For all other files which include openclwrapper.h, the compiler
complained about an unused static variable:
opencl/openclwrapper.h:175:16: warning:
‘MORPH_BC’ defined but not used [-Wunused-variable]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Both arrays are only used in openclwrapper.cpp, so move them into that
file.
The first element of both arrays was unused. Remove it and fix the code
which reads the array elements accordingly. Sort this code, too.
These changes reduce the code size a little bit:
text data bss dec hex filename
2461743 6676 2742784 5211203 4f8443 1/api/tesseract (old)
2461599 6676 2742784 5211059 4f83b3 2/api/tesseract (new)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
openclwrapper calls function TIFFReadRGBAImageOriented which is provided
by libtiff, so add that library to OPENCL_LIBS.
This fixes a linker error (unresolved symbol) when opencl is enabled.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
valgrind report: Mismatched free() / delete / delete []
gpuInfo->mpArryDevsID is created by "new cl_device_id[1]",
so it must be destroyed by delete[].
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc report:
opencl/openclwrapper.cpp:3245:22: warning:
deprecated conversion from string constant to 'char*' [-Wwrite-strings]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc report:
opencl/openclwrapper.cpp:84:23: warning:
converting to non-pointer type 'char' from NULL [-Wconversion-null]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
POSIX provides portable data types for signed and unsigned integer values
of different size.
This patch maps those POSIX data types to the Tesseract specific types.
In a next step, the Tesseract data types can be eliminated by replacing
them with the POSIX data types.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Calling TessBaseAPI::Clear() which calls TessBaseAPI::ClearResults()
which calls SavePixForCrash(0, NULL) is needed to release objects
allocated in global_crash_pixes.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Avoid dynamic memory allocation for the static variable 'cache'.
Now the destructor for that variable is called automatically
when Tesseract terminates and releases all associated memory.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
When exit() is called from ParseArgs(), no destructors are executed
for the auto variables vars_vec and vars_values.
Making both variables static fixes the memory leaks, because now the
destructors are always executed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1164526 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK)
2. alloc_fn: Calling allocation function socket.
The previous stream_ must be closed before opening a new one.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1340280 (#1 of 1): Resource leak (RESOURCE_LEAK)
7. leaked_storage: Variable FloatFeatures going out of scope leaks the storage it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1340278 (#1 of 1): Resource leak (RESOURCE_LEAK)
11. leaked_storage: Variable output_file going out of scope leaks the storage it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1164739 (#1 of 1): Resource leak (RESOURCE_LEAK)
18. leaked_storage: Variable frag going out of scope leaks the storage it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1164738 (#1 of 1): Resource leak (RESOURCE_LEAK)
7. leaked_storage: Variable sample going out of scope leaks the storage it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1164737 (#1 of 1): Resource leak (RESOURCE_LEAK)
49. leaked_storage: Variable p going out of scope leaks the storage it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1164730 (#1 of 1): Resource leak (RESOURCE_LEAK)
4. leaked_storage: Variable lines going out of scope leaks the storage it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1164728 (#1 of 1): Resource leak (RESOURCE_LEAK)
33. leaked_storage: Variable argv going out of scope leaks the storage it points to.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This fixes several gcc warnings:
warning:
type qualifiers ignored on function return type [-Wignored-qualifiers]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
In osdetect.cpp, a local definition of kMinCredibleResolution was
identical to a global one, so the local one could be removed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This fixes a compiler warning:
api/baseapi.cpp:1743:11: warning:
unused variable 'kBytesPerBlob' [-Wunused-const-variable]
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This fixes a compiler warning:
classify/intfeaturemap.cpp:33:14: warning:
unused variable 'kMinPCLengthIncrease' [-Wunused-const-variable]
Signed-off-by: Stefan Weil <sw@weilnetz.de>