From 893cd2b472c035d2f0973c975bd2eb26663e1652 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 29 Dec 2017 04:46:13 +0100 Subject: [PATCH] Make this C89-compatible --- gfx/drivers/switch_gfx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gfx/drivers/switch_gfx.c b/gfx/drivers/switch_gfx.c index 317c54088f..82bd9e8232 100644 --- a/gfx/drivers/switch_gfx.c +++ b/gfx/drivers/switch_gfx.c @@ -139,6 +139,7 @@ static bool switch_frame(void *data, const void *frame, { for(y = 0; y < height; y++) { + unsigned subx, suby; uint32_t spixel = frame_pixels[(y*pitch/sizeof(uint16_t)) + x]; uint32_t dpixel = 0; uint8_t r = (spixel >> 11) & 31; @@ -149,8 +150,8 @@ static bool switch_frame(void *data, const void *frame, b = (b * 256) / 32; dpixel = (r << 0) | (g << 8) | (b << 16) | (0xFF << 24); - for (int subx = 0; subx < xsf; subx++) - for (int suby = 0; suby < ysf; suby++) + for (subx = 0; subx < xsf; subx++) + for (suby = 0; suby < ysf; suby++) image[(((y*sf)+suby+centery)*1280) + ((x*sf)+subx+centerx)] = dpixel; }