From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] package/expedite: fix build issue with gcc < 5
Date: Sun, 30 Apr 2017 12:25:28 +0200 [thread overview]
Message-ID: <20170430102528.11476-1-romain.naour@gmail.com> (raw)
The code use for loop initial declarations which are only allowed in
C99 mode which is not the default C standard with gcc < 5.
This way of writing for loop was added by the latest commit and it is
not consistent with the rest of the code.
So revert to the C89 for loop syntax.
Reported upstream:
https://phab.enlightenment.org/T5440
Fixes:
http://autobuild.buildroot.net/results/ed8/ed840755e8e486e48eab8c13a8bb5e9a448199ce
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
.../0001-fix-build-failure-with-gcc-5.patch | 289 +++++++++++++++++++++
1 file changed, 289 insertions(+)
create mode 100644 package/expedite/0001-fix-build-failure-with-gcc-5.patch
diff --git a/package/expedite/0001-fix-build-failure-with-gcc-5.patch b/package/expedite/0001-fix-build-failure-with-gcc-5.patch
new file mode 100644
index 0000000..2d5d6ef
--- /dev/null
+++ b/package/expedite/0001-fix-build-failure-with-gcc-5.patch
@@ -0,0 +1,289 @@
+From 01a29e6a1d2ed083d1a1884dbca37ae518f354c7 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@gmail.com>
+Date: Sun, 30 Apr 2017 12:07:02 +0200
+Subject: [PATCH] fix build failure with gcc < 5
+
+Definition of variables inside the initialization part of for() loops
+was added by [1] and produce some build failure with "old" gcc version
+(gcc < 5).
+
+This way of writing for loop is not consistent with the rest of the
+code. So revert to the C89 for loop syntax.
+
+Reported upstream:
+https://phab.enlightenment.org/T5440
+
+[1] https://git.enlightenment.org/tools/expedite.git/commit/?id=0529ce56b6fb01e9651e76461e9608e15a040fb3
+
+Fixes:
+http://autobuild.buildroot.net/results/930/930796603d37bc309a591eec68037192c51028ce
+
+Signed-off-by: Romain Naour <romain.naour@gmail.com>
+---
+ src/bin/image_data_argb.c | 9 ++++++---
+ src/bin/image_data_argb_alpha.c | 6 ++++--
+ src/bin/image_data_ycbcr601pl.c | 12 ++++++++----
+ .../image_data_ycbcr601pl_map_nearest_solid_rotate.c | 12 ++++++++----
+ src/bin/image_data_ycbcr601pl_map_solid_rotate.c | 12 ++++++++----
+ src/bin/image_data_ycbcr601pl_wide_stride.c | 17 +++++++++++------
+ 6 files changed, 45 insertions(+), 23 deletions(-)
+
+diff --git a/src/bin/image_data_argb.c b/src/bin/image_data_argb.c
+index d5889ce..9c607b2 100644
+--- a/src/bin/image_data_argb.c
++++ b/src/bin/image_data_argb.c
+@@ -20,12 +20,13 @@ static Evas_Object *o_images[1];
+ /* setup */
+ static void _setup(void)
+ {
++ int i;
+ Evas_Object *o;
+ Eina_Slice sl;
+
+ sl.len = 640 * 480 * 4;
+ sl.mem = malloc(sl.len);
+- for (int i = 0; i < 1; i++)
++ for (i = 0; i < 1; i++)
+ {
+ o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
+ o_images[i] = o;
+@@ -42,7 +43,8 @@ static void _setup(void)
+ /* cleanup */
+ static void _cleanup(void)
+ {
+- for (int i = 0; i < 1; i++)
++ int i;
++ for (i = 0; i < 1; i++)
+ {
+ Evas_Object *o = o_images[i];
+ Eina_Slice sl = {};
+@@ -56,7 +58,8 @@ static void _cleanup(void)
+ /* loop - do things */
+ static void _loop(double t, int f)
+ {
+- for (int i = 0; i < 1; i++)
++ int i;
++ for (i = 0; i < 1; i++)
+ {
+ Evas_Object *o = o_images[i];
+ unsigned int *data, *p;
+diff --git a/src/bin/image_data_argb_alpha.c b/src/bin/image_data_argb_alpha.c
+index 79f4c54..ffbe57e 100644
+--- a/src/bin/image_data_argb_alpha.c
++++ b/src/bin/image_data_argb_alpha.c
+@@ -20,12 +20,13 @@ static Evas_Object *o_images[1];
+ /* setup */
+ static void _setup(void)
+ {
++ int i;
+ Evas_Object *o;
+ Eina_Slice sl;
+
+ sl.len = 640 * 480 * 4;
+ sl.mem = malloc(sl.len);
+- for (int i = 0; i < 1; i++)
++ for (i = 0; i < 1; i++)
+ {
+ o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
+ o_images[i] = o;
+@@ -42,7 +43,8 @@ static void _setup(void)
+ /* cleanup */
+ static void _cleanup(void)
+ {
+- for (int i = 0; i < 1; i++)
++ int i;
++ for (i = 0; i < 1; i++)
+ {
+ Evas_Object *o = o_images[i];
+ Eina_Slice sl = {};
+diff --git a/src/bin/image_data_ycbcr601pl.c b/src/bin/image_data_ycbcr601pl.c
+index 032d5b3..e126e98 100644
+--- a/src/bin/image_data_ycbcr601pl.c
++++ b/src/bin/image_data_ycbcr601pl.c
+@@ -21,9 +21,11 @@ static Eina_Slice slice[3];
+ /* setup */
+ static void _setup(void)
+ {
++ int i;
+ FILE *f;
+- for (int i = 0; i < 1; i++)
++ for (i = 0; i < 1; i++)
+ {
++ int p;
+ Evas_Object *o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
+ o_images[i] = o;
+ efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
+@@ -37,7 +39,7 @@ static void _setup(void)
+ slice[2].len = 320 * 240;
+ f = fopen(build_path("tp.yuv"), "rb");
+ if (!f) continue;
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ {
+ slice[p].mem = malloc(slice[p].len);
+ fread((void *) slice[p].mem, slice[p].len, 1, f);
+@@ -51,10 +53,12 @@ static void _setup(void)
+ /* cleanup */
+ static void _cleanup(void)
+ {
+- for (int i = 0; i < 1; i++)
++ int i;
++ for (i = 0; i < 1; i++)
+ {
++ int p;
+ Evas_Object *o = o_images[i];
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ {
+ efl_gfx_buffer_managed_set(o, NULL, 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
+ free((void *) slice[p].mem);
+diff --git a/src/bin/image_data_ycbcr601pl_map_nearest_solid_rotate.c b/src/bin/image_data_ycbcr601pl_map_nearest_solid_rotate.c
+index 0a5bcf4..db52b0b 100644
+--- a/src/bin/image_data_ycbcr601pl_map_nearest_solid_rotate.c
++++ b/src/bin/image_data_ycbcr601pl_map_nearest_solid_rotate.c
+@@ -21,9 +21,11 @@ static Eina_Slice slice[3];
+ /* setup */
+ static void _setup(void)
+ {
++ int i;
+ FILE *f;
+- for (int i = 0; i < 1; i++)
++ for (i = 0; i < 1; i++)
+ {
++ int p;
+ Evas_Object *o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
+ o_images[i] = o;
+ efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
+@@ -37,7 +39,7 @@ static void _setup(void)
+ slice[2].len = 320 * 240;
+ f = fopen(build_path("tp.yuv"), "rb");
+ if (!f) continue;
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ {
+ slice[p].mem = malloc(slice[p].len);
+ fread((void *) slice[p].mem, slice[p].len, 1, f);
+@@ -51,10 +53,12 @@ static void _setup(void)
+ /* cleanup */
+ static void _cleanup(void)
+ {
+- for (int i = 0; i < 1; i++)
++ int i;
++ for (i = 0; i < 1; i++)
+ {
++ int p;
+ Evas_Object *o = o_images[i];
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ {
+ efl_gfx_buffer_managed_set(o, NULL, 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
+ free((void *) slice[p].mem);
+diff --git a/src/bin/image_data_ycbcr601pl_map_solid_rotate.c b/src/bin/image_data_ycbcr601pl_map_solid_rotate.c
+index 355293f..ac4364d 100644
+--- a/src/bin/image_data_ycbcr601pl_map_solid_rotate.c
++++ b/src/bin/image_data_ycbcr601pl_map_solid_rotate.c
+@@ -22,8 +22,10 @@ static Eina_Slice slice[3];
+ static void _setup(void)
+ {
+ FILE *f;
+- for (int i = 0; i < 1; i++)
++ int i;
++ for (i = 0; i < 1; i++)
+ {
++ int p;
+ Evas_Object *o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
+ o_images[i] = o;
+ efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
+@@ -37,7 +39,7 @@ static void _setup(void)
+ slice[2].len = 320 * 240;
+ f = fopen(build_path("tp.yuv"), "rb");
+ if (!f) continue;
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ {
+ slice[p].mem = malloc(slice[p].len);
+ fread((void *) slice[p].mem, slice[p].len, 1, f);
+@@ -51,10 +53,12 @@ static void _setup(void)
+ /* cleanup */
+ static void _cleanup(void)
+ {
+- for (int i = 0; i < 1; i++)
++ int i;
++ for (i = 0; i < 1; i++)
+ {
++ int p;
+ Evas_Object *o = o_images[i];
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ {
+ efl_gfx_buffer_managed_set(o, NULL, 640, 480, 0, EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
+ free((void *) slice[p].mem);
+diff --git a/src/bin/image_data_ycbcr601pl_wide_stride.c b/src/bin/image_data_ycbcr601pl_wide_stride.c
+index d4e8fa2..9adb62f 100644
+--- a/src/bin/image_data_ycbcr601pl_wide_stride.c
++++ b/src/bin/image_data_ycbcr601pl_wide_stride.c
+@@ -21,11 +21,13 @@ static Eina_Slice slice[3];
+ /* setup */
+ static void _setup(void)
+ {
++ int i;
+ int stride;
+ FILE *f;
+ int w = 320 - 16;
+- for (int i = 0; i < 1; i++)
++ for (i = 0; i < 1; i++)
+ {
++ int p;
+ Evas_Object *o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
+ o_images[i] = o;
+ efl_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
+@@ -41,7 +43,7 @@ static void _setup(void)
+ f = fopen(build_path("tp.yuv"), "rb");
+ if (!f) continue;
+ stride = 640;
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ {
+ slice[p].mem = malloc(slice[p].len);
+ fread((void *) slice[p].mem, slice[p].len, 1, f);
+@@ -57,10 +59,12 @@ static void _setup(void)
+ /* cleanup */
+ static void _cleanup(void)
+ {
+- for (int i = 0; i < 1; i++)
++ int i;
++ for (i = 0; i < 1; i++)
+ {
++ int p;
+ Evas_Object *o = o_images[i];
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ {
+ efl_gfx_buffer_managed_set(o, NULL, 640, 480, 0,
+ EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
+@@ -77,11 +81,12 @@ static void _loop(double t, int f)
+ Evas_Coord x, y, w, h;
+ for (i = 0; i < 1; i++)
+ {
++ int p;
+ Evas_Object *o = o_images[i];
+ Eina_Slice sl[3];
+ int stride;
+
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ efl_gfx_buffer_managed_get(o, &sl[p], p);
+
+ w = 640;
+@@ -97,7 +102,7 @@ static void _loop(double t, int f)
+ if (w > 640) w = 320;
+
+ stride = 640;
+- for (int p = 0; p < 3; p++)
++ for (p = 0; p < 3; p++)
+ {
+ efl_gfx_buffer_managed_set(o, &sl[p], w, 480, stride,
+ EFL_GFX_COLORSPACE_YCBCR422P601_PL, p);
+--
+2.9.3
+
--
2.9.3
next reply other threads:[~2017-04-30 10:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-30 10:25 Romain Naour [this message]
2017-04-30 21:02 ` [Buildroot] [PATCH v2] package/expedite: fix build issue with gcc < 5 Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170430102528.11476-1-romain.naour@gmail.com \
--to=romain.naour@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox