Commit Graph

5220 Commits

Author SHA1 Message Date
zdenop
defc44e3a2
Merge pull request #3033 from stweil/cprintf
Replace cprintf by tprintf and remove cprintf and fix insecure call of tprintf
2020-06-22 09:02:14 +02:00
Stefan Weil
b2cc00d97f Replace cprintf by tprintf and remove cprintf
cprintf was an indirect way to call tprintf.
This indirection is not needed, so remove it and use tprintf directly.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-21 19:07:09 +02:00
Stefan Weil
ea1f597fc1 Fix insecure call of tprintf
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-21 19:03:03 +02:00
Stefan Weil
bf39019d95 Remove obsolescent macro AC_HEADER_STDC
See
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Particular-Headers.html.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-21 18:50:06 +02:00
Stefan Weil
27b254476f Remove obsolescent macro AC_HEADER_TIME
See
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Particular-Headers.html.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-21 18:48:20 +02:00
Stefan Weil
0a63484644 Remove checks for unused types off_t, mbstate_t, _Bool
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-21 12:04:16 +02:00
Stefan Weil
4a10bb68c7 Fix conversion of images with 16 bpp or 24 bpp to grey
The old code used pixConvertRGBToLuminance which only converts 32 bpp images.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-21 09:09:49 +02:00
Stefan Weil
6f6100ff9f Classify: Run sort only for more than one element
This fixes calls of qsort with a nullptr argument (reported by sanitizers).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-20 21:43:22 +02:00
zdenop
5a698c278d
Merge pull request #3031 from stweil/clean
thanks
2020-06-20 11:48:49 +02:00
Stefan Weil
958b90d785 Don't check for unused sys/wait.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-20 11:01:20 +02:00
Stefan Weil
a1aea84a27 Don't check for unused sys/shm.h and sys/ipc.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-20 10:59:54 +02:00
Stefan Weil
fd30c86674 Remove endianness test (WORDS_BIGENDIAN is unused)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-20 10:47:00 +02:00
Stefan Weil
c1494fb710 Don't check for stdbool.h (only used in capi.h)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-20 10:42:28 +02:00
Stefan Weil
d4cf77c92b Don't check for limits.h (now unused)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-20 10:39:13 +02:00
zdenop
d6a5fb2db5
Merge pull request #3027 from amitdo/master
Disabled legacy build: Don't compile permdawg.cpp
2020-06-19 08:18:58 +02:00
Stefan Weil
a1d161326e Don't check for unused malloc.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-19 07:30:00 +02:00
amitdo
eb5ad74665 Disabled legacy build: Don't compile permdawg.cpp 2020-06-18 18:24:17 +03:00
Matej Knopp
e900252c1a Fix CMake build with DISABLED_LEGACY_ENGINE 2020-06-17 19:42:49 +02:00
Stefan Weil
d6ca7a5298 ScrollView: Fix typo in comment
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-17 16:26:41 +02:00
Stefan Weil
380466e0d3 Allow inlining of function TruncateParam
It is only used locally in intproto.cpp, so defining it before the first
use and adding the static attribute allows the compiler to inline it.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-16 20:17:41 +02:00
Stefan Weil
93cfffeb87 Remove unused argument from function TruncateParam
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-16 20:17:41 +02:00
Stefan Weil
f08b16a5a0 Remove assertion which is triggered by tests
oss-fuzz issue 15149 triggers this assertion. See test case here:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=15149

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-16 20:17:26 +02:00
Stefan Weil
18d9983f69 StrokeWidth: Remove unused local variable (fixes compiler warning)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-16 20:17:09 +02:00
zdenop
7f14f11f80
Merge pull request #3023 from stweil/inline 2020-06-16 20:03:42 +02:00
Stefan Weil
bc61038dd4 SPLIT: Make function bounding_box inline for better performance
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-16 17:21:36 +02:00
Stefan Weil
0e7701bc3c SEAM: More inline functions for better performance
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-16 17:20:14 +02:00
Stefan Weil
e45100ebf7 TBOX: Use inline constructor for better performance
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-16 17:17:55 +02:00
zdenop
58c60e6c98
Merge pull request #3022 from stweil/fix
Fix undefined shift with negative value (oss-fuzz issue 14658)
2020-06-16 13:48:22 +02:00
Stefan Weil
c110958ffa Fix undefined shift with negative value (oss-fuzz issue 14658)
This fixes a bug reported by OSS Fuzz:
https://oss-fuzz.com/issue/5697280134348800

The old code passed a negative value (-1) as argument to step_dir
when destindex was 0.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-16 13:25:32 +02:00
Stefan Weil
6ee3698958 Remove old unused code from imagedata.h
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-14 16:02:27 +02:00
Stefan Weil
d8500adcf4 Fix crash caused by missing thread synchronization (issues #757, #1168 and #2191)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-06-14 15:53:17 +02:00
Stefan Weil
62eae84fea
Merge pull request #2991 from robinwatts/pushback9
Fix intsimdmatrixneon.cpp stack corruption.
2020-05-27 16:31:23 +02:00
Robin Watts
6fec69de1a Fix intsimdmatrixneon.cpp stack corruption.
The intsimdmatrix mechanism ensures that inputs would be
resized so that we'd only ever get "whole blocks" of data.
I'd assumed that that meant the same thing for scales/outputs
too, but this appears not to to be the case, as we can get
called (sometimes) with num_out % 8 == 7.

Possibly we could benefit from resizing those matrices so
that special cases in this innermost loop are not actually
required, but unless and until that is done, let's fix the
inner loop.
2020-05-27 13:40:17 +01:00
Stefan Weil
ff0a7a38f7 Check compiler options depending on host cpu
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-05-27 06:52:36 +02:00
Stefan Weil
a06d0d8449 Add missing include statements for config_auto.h
They are required to get the macro DISABLED_LEGACY_ENGINE.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-05-22 16:34:28 +02:00
Stefan Weil
6732eb9eb5 Clean code for NEON support
Include it only for NEON and remove unneeded code.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-05-21 07:03:37 +02:00
Stefan Weil
7b0e5b0722
Merge pull request #2978 from robinwatts/pushback6
Add NEON SIMD code
2020-05-21 06:59:01 +02:00
Robin Watts
f79e52a7cc NEON SIMD code.
In tests on my pi3b+, a release build of my ghostscript integration
takes 2 minutes 27 seconds to render a PDF and OCR it with the
vanilla sources. With this NEON coded added the time drops to 37
seconds.

I have not tested the configure/Makefile changes as I'm not using
them.
2020-05-20 18:54:42 +01:00
zdenop
3a3c41d1ab try to fix cmake gcc build - make simd configuration (HAVE_?) global (as autotools). 2020-05-19 18:02:16 +02:00
zdenop
32b3ab40f1 fix cmake msvc build 2020-05-19 16:16:38 +02:00
zdenop
90e81ac939 supress VS warnings in release target C4267 (conversion from 'size_t' to 'type', possible loss of data), C4305 ('context' : truncation from 'type1' to 'type2') and C4267 (var' : conversion from 'size_t' to 'type', possible loss of data) 2020-05-19 16:06:03 +02:00
zdenop
b5d639dcc5
Merge pull request #2965 from robinwatts/pushback1
thanks.
2020-05-16 20:35:19 +02:00
zdenop
064b4403de
Merge pull request #2966 from robinwatts/pushback2 2020-05-16 20:06:31 +02:00
Stefan Weil
5d9b181d67
Merge pull request #2982 from robinwatts/pushback8
Guard #include "config_auto.h" with HAVE_CONFIG_H.
2020-05-16 15:00:40 +02:00
zdenop
acaa90c971 cmake: dont use vector unit compile definition globaly 2020-05-16 12:30:20 +02:00
Robin Watts
3408c36eab Guard #include "config_auto.h" with HAVE_CONFIG_H.
Every other file already does this.
2020-05-15 19:29:03 +01:00
Amit D
b4d3bf616a
Merge pull request #2981 from robinwatts/pushback7
Fix OEM_DEFAULT in DISABLED_LEGACY_ENGINE builds.
2020-05-15 18:09:06 +03:00
Robin Watts
43437a540b Fix OEM_DEFAULT in DISABLED_LEGACY_ENGINE builds.
If api->Init is called with OEM_DEFAULT in DISABLED_LEGACY_ENGINE
build modes, the engine mode is never set, resulting in no
words being found.
2020-05-15 14:56:41 +01:00
Stefan Weil
84721e9049
Merge pull request #2979 from juliangilbey/correct_swap_comment
Trivial code documentation fix: move comment about swap meaning for DeSerialize to correct function
2020-05-13 09:32:55 +02:00
Julian Gilbey
e7e6999d3b Move comment about swap meaning for DeSerialize to correct function 2020-05-13 07:02:59 +01:00