From b03332b68dd6cac069874ad45d208963dd004fcd Mon Sep 17 00:00:00 2001 From: captain0xff Date: Wed, 12 Feb 2025 02:30:25 +0530 Subject: [PATCH] updated bytepusher demo to be C++ compatible --- examples/demo/04-bytepusher/bytepusher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/demo/04-bytepusher/bytepusher.c b/examples/demo/04-bytepusher/bytepusher.c index 01b0e1a4a9..acb2ea48e8 100644 --- a/examples/demo/04-bytepusher/bytepusher.c +++ b/examples/demo/04-bytepusher/bytepusher.c @@ -156,7 +156,7 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]) { return SDL_APP_FAILURE; } - if (!(vm = SDL_calloc(1, sizeof(*vm)))) { + if (!(vm = (BytePusher *)SDL_calloc(1, sizeof(*vm)))) { return SDL_APP_FAILURE; } *(BytePusher**)appstate = vm; @@ -199,7 +199,7 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]) { for (r = 0; r < 6; ++r) { for (g = 0; g < 6; ++g) { for (b = 0; b < 6; ++b, ++i) { - SDL_Color color = { r * 0x33, g * 0x33, b * 0x33, SDL_ALPHA_OPAQUE }; + SDL_Color color = { (Uint8)(r * 0x33), (Uint8)(g * 0x33), (Uint8)(b * 0x33), SDL_ALPHA_OPAQUE }; palette->colors[i] = color; } }