From 52e1c38cf1e988f038537ff0d6fd839707f0dada Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 5 Jun 2020 16:27:41 +0200 Subject: [PATCH] Fix C89 variable declaration issue --- cores/libretro-ffmpeg/ffmpeg_core.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/cores/libretro-ffmpeg/ffmpeg_core.c b/cores/libretro-ffmpeg/ffmpeg_core.c index ec9dd35306..00276db3db 100644 --- a/cores/libretro-ffmpeg/ffmpeg_core.c +++ b/cores/libretro-ffmpeg/ffmpeg_core.c @@ -710,6 +710,10 @@ void CORE_PREFIX(retro_run)(void) #if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) if (use_gl) { + const uint8_t *src; + int stride, width; + unsigned y; + #ifndef HAVE_OPENGLES glBindBuffer(GL_PIXEL_UNPACK_BUFFER, frames[1].pbo); #ifdef __MACH__ @@ -719,11 +723,10 @@ void CORE_PREFIX(retro_run)(void) 0, media.width * media.height * sizeof(uint32_t), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT); #endif #endif - - const uint8_t *src = ctx->target->data[0]; - int stride = ctx->target->linesize[0]; - int width = media.width * sizeof(uint32_t); - for (unsigned y = 0; y < media.height; y++, src += stride, data += width/4) + src = ctx->target->data[0]; + stride = ctx->target->linesize[0]; + width = media.width * sizeof(uint32_t); + for (y = 0; y < media.height; y++, src += stride, data += width/4) memcpy(data, src, width); #ifndef HAVE_OPENGLES @@ -745,10 +748,11 @@ void CORE_PREFIX(retro_run)(void) else #endif { + unsigned y; const uint8_t *src = ctx->target->data[0]; - int stride = ctx->target->linesize[0]; - size_t width = media.width * sizeof(uint32_t); - for (unsigned y = 0; y < media.height; y++, src += stride, data += width/4) + int stride = ctx->target->linesize[0]; + size_t width = media.width * sizeof(uint32_t); + for (y = 0; y < media.height; y++, src += stride, data += width/4) memcpy(data, src, width); dupe = false;