diff render_sdl.c @ 1952:42c12d141f6e

Remove usage of GCC pointer arithmetic on void * extension
author Michael Pavone <pavone@retrodev.com>
date Thu, 30 Apr 2020 23:30:22 -0700
parents 5a76a7373823
children bd70f1e15684
line wrap: on
line diff
--- a/render_sdl.c	Thu Apr 30 23:21:23 2020 -0700
+++ b/render_sdl.c	Thu Apr 30 23:30:22 2020 -0700
@@ -1361,14 +1361,14 @@
 			warning("Request for invalid framebuffer number %d\n", which);
 			return NULL;
 		}
-		void *pixels;
-		if (SDL_LockTexture(sdl_textures[which], NULL, &pixels, pitch) < 0) {
+		uint8_t *pixels;
+		if (SDL_LockTexture(sdl_textures[which], NULL, (void **)&pixels, pitch) < 0) {
 			warning("Failed to lock texture: %s\n", SDL_GetError());
 			return NULL;
 		}
 		static uint8_t last;
 		if (which <= FRAMEBUFFER_EVEN) {
-			locked_pixels = pixels;
+			locked_pixels = (uint32_t *)pixels;
 			if (which == FRAMEBUFFER_EVEN) {
 				pixels += *pitch;
 			}
@@ -1378,7 +1378,7 @@
 			}
 			last = which;
 		}
-		return pixels;
+		return (uint32_t *)pixels;
 #ifndef DISABLE_OPENGL
 	}
 #endif