From 3722e4c267257b88e268636839d63fcef6ad8d9e Mon Sep 17 00:00:00 2001 From: Toby Jaffey Date: Fri, 12 Dec 2025 15:02:20 +0000 Subject: [PATCH] Cleanup --- hosts/host-sdl/Makefile | 2 +- hosts/host-sdl/host-sdl.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hosts/host-sdl/Makefile b/hosts/host-sdl/Makefile index 8c424df..ae884ec 100644 --- a/hosts/host-sdl/Makefile +++ b/hosts/host-sdl/Makefile @@ -9,7 +9,7 @@ LIBS = `pkg-config sdl3 --libs --static` CFLAGS += `pkg-config sdl3 --cflags` endif -#CFLAGS += -Wall -Werror +CFLAGS += -Wall -Werror CFLAGS += -pedantic -std=c99 -O3 CFLAGS += -DUVM32_MEMORY_SIZE=$(shell echo "1024 * 1024 * 8" | bc) diff --git a/hosts/host-sdl/host-sdl.c b/hosts/host-sdl/host-sdl.c index 03ed768..02f1f8f 100644 --- a/hosts/host-sdl/host-sdl.c +++ b/hosts/host-sdl/host-sdl.c @@ -101,8 +101,6 @@ int main(int argc, char *argv[]) { SDL_Renderer *renderer = NULL; SDL_Window *screen = NULL; SDL_Event event; - SDL_Surface *surface = NULL; - SDL_Texture *tex = NULL; SDL_Texture *render_target = NULL; // memory for vmst is very large, so allocate @@ -263,14 +261,15 @@ int main(int argc, char *argv[]) { case UVM32_SYSCALL_RENDER: { uvm32_evt_syscall_buf_t buf = uvm32_getbuf(vmst, &evt, ARG0, ARG1); + // copy into texture void* dst; - const unsigned char* src = buf.ptr; + const uint8_t* src = buf.ptr; int src_pitch = WIDTH * 4; int dst_pitch; if (SDL_LockTexture(render_target, NULL, &dst, &dst_pitch)) { for (int y = 0; y < HEIGHT; y++) { memcpy(dst, src, src_pitch); - dst = (unsigned char*)dst + dst_pitch; + dst = (uint8_t*)dst + dst_pitch; src += src_pitch; } SDL_UnlockTexture(render_target);