afaerber / meson-tools

Tools for Amlogic Meson ARM platforms
GNU General Public License v2.0
43 stars 27 forks source link

amlbootenc-glx.c: fix build without -std=gnu99 #8

Open ffontaine opened 3 years ago

ffontaine commented 3 years ago

Fix the following build failure with old gcc and without -std=gnu99:

amlbootenc-gxl.c:136:2: error: 'for' loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < sizeof(hdr.iv); i++) {
  ^
amlbootenc-gxl.c:154:11: error: redefinition of 'i'
  for (int i = 1; i < hdr.payload_size / hdr.block_size; i++) {
           ^
amlbootenc-gxl.c:136:11: note: previous definition of 'i' was here
  for (int i = 0; i < sizeof(hdr.iv); i++) {
           ^
amlbootenc-gxl.c:154:2: error: 'for' loop initial declarations are only allowed in C99 mode
  for (int i = 1; i < hdr.payload_size / hdr.block_size; i++) {
  ^

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com