diff options
author | Khem Raj <raj.khem@gmail.com> | 2015-09-08 22:12:46 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-12 22:48:42 +0100 |
commit | f9d230201e2cfc5b9a7c625a511e4775f6cc11b5 (patch) | |
tree | 5050d0e62a4a35dc0fe60d499028b0813b41ae6e /meta | |
parent | 7d018a6e4b32f56638e8a0465de801264bbdd58e (diff) | |
download | poky-f9d230201e2cfc5b9a7c625a511e4775f6cc11b5.tar.gz |
directfb: Avoid using VLAs and printf formats
These are not portable features and are flagged by clang
(From OE-Core rev: 8a577fa7cf54db646f4e61f383390054e5f04ca3)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-graphics/directfb/directfb.inc | 4 | ||||
-rw-r--r-- | meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch | 61 |
2 files changed, 64 insertions, 1 deletions
diff --git a/meta/recipes-graphics/directfb/directfb.inc b/meta/recipes-graphics/directfb/directfb.inc index 4fbca878ef..446aaeadb4 100644 --- a/meta/recipes-graphics/directfb/directfb.inc +++ b/meta/recipes-graphics/directfb/directfb.inc | |||
@@ -14,7 +14,9 @@ DEPENDS = "jpeg libpng freetype zlib tslib sysfsutils" | |||
14 | SRC_URI = "http://www.directfb.org/downloads/Core/DirectFB-1.7/DirectFB-${PV}.tar.gz \ | 14 | SRC_URI = "http://www.directfb.org/downloads/Core/DirectFB-1.7/DirectFB-${PV}.tar.gz \ |
15 | file://configurefix.patch \ | 15 | file://configurefix.patch \ |
16 | file://fusion.patch \ | 16 | file://fusion.patch \ |
17 | file://bashism.patch" | 17 | file://bashism.patch \ |
18 | file://0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch \ | ||
19 | " | ||
18 | 20 | ||
19 | S = "${WORKDIR}/DirectFB-${PV}" | 21 | S = "${WORKDIR}/DirectFB-${PV}" |
20 | 22 | ||
diff --git a/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch b/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch new file mode 100644 index 0000000000..76e0f75303 --- /dev/null +++ b/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From f43ef44806ffb8e3b35d99070dde9b6cc1714d3d Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 8 Sep 2015 21:32:20 +0000 | ||
4 | Subject: [PATCH] gfx,direct: Aboid usng VLAs and printf formats | ||
5 | |||
6 | VLAs are flagged by clang when using non-POD types, therefore replace | ||
7 | the usage with alloca which is exact same allocation on stack | ||
8 | |||
9 | __attribute__((__format__ (__printf__))) is not portable as used here | ||
10 | therefore disable the check for clang here, we lose no functionality | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | Upstream-Status: Pending | ||
15 | |||
16 | lib/direct/util.h | 2 +- | ||
17 | src/gfx/util.cpp | 8 ++++---- | ||
18 | 2 files changed, 5 insertions(+), 5 deletions(-) | ||
19 | |||
20 | diff --git a/lib/direct/util.h b/lib/direct/util.h | ||
21 | index 72941e9..8e7fa4a 100644 | ||
22 | --- a/lib/direct/util.h | ||
23 | +++ b/lib/direct/util.h | ||
24 | @@ -98,7 +98,7 @@ | ||
25 | #define D_CONST_FUNC | ||
26 | #endif | ||
27 | |||
28 | -#if __GNUC__ >= 3 | ||
29 | +#if __GNUC__ >= 3 && !defined __clang__ | ||
30 | #define D_FORMAT_PRINTF(n) __attribute__((__format__ (__printf__, n, n+1))) | ||
31 | #define D_FORMAT_VPRINTF(n) __attribute__((__format__ (__printf__, n, 0))) | ||
32 | #else | ||
33 | diff --git a/src/gfx/util.cpp b/src/gfx/util.cpp | ||
34 | index 40032bc..d1015d4 100644 | ||
35 | --- a/src/gfx/util.cpp | ||
36 | +++ b/src/gfx/util.cpp | ||
37 | @@ -294,8 +294,8 @@ dfb_gfx_copy_regions_stereo( CoreSurface *source, | ||
38 | { | ||
39 | unsigned int i, n = 0; | ||
40 | DFBRectangle rect = { 0, 0, source->config.size.w, source->config.size.h }; | ||
41 | - DFBRectangle rects[num]; | ||
42 | - DFBPoint points[num]; | ||
43 | + DFBRectangle *rects = (DFBRectangle*)alloca( sizeof(struct DFBRectangle) * num); | ||
44 | + DFBPoint *points = (DFBPoint*)alloca( sizeof(struct DFBPoint) * num); | ||
45 | |||
46 | for (i=0; i<num; i++) { | ||
47 | DFB_REGION_ASSERT( ®ions[i] ); | ||
48 | @@ -351,8 +351,8 @@ dfb_gfx_copy_regions_client( CoreSurface *source, | ||
49 | { | ||
50 | unsigned int i, n = 0; | ||
51 | DFBRectangle rect = { 0, 0, source->config.size.w, source->config.size.h }; | ||
52 | - DFBRectangle rects[num]; | ||
53 | - DFBPoint points[num]; | ||
54 | + DFBRectangle *rects = (DFBRectangle*)alloca( sizeof(struct DFBRectangle) * num); | ||
55 | + DFBPoint *points = (DFBPoint*)alloca( sizeof(struct DFBPoint) * num); | ||
56 | CoreGraphicsStateClient *client = _client ? _client : &StateClient::Get()->client; | ||
57 | CardState *state = client->state; | ||
58 | CardState backup; | ||
59 | -- | ||
60 | 2.5.1 | ||
61 | |||