From 00b59c96f189507431fcbd357e2904489b895bb3 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 8 Aug 2024 00:43:44 +0200
Subject: [PATCH] Fix /W3 warnings in examples
---
examples/audio/03-load-wav/load-wav.c | 2 +-
examples/game/01-snake/main.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/examples/audio/03-load-wav/load-wav.c b/examples/audio/03-load-wav/load-wav.c
index d8d74cd516450..6467ce7e4aa30 100644
--- a/examples/audio/03-load-wav/load-wav.c
+++ b/examples/audio/03-load-wav/load-wav.c
@@ -80,7 +80,7 @@ int SDL_AppIterate(void *appstate)
We're being lazy here, but if there's less than the entire wav file left to play,
just shove a whole copy of it into the queue, so we always have _tons_ of
data queued for playback. */
- if (SDL_GetAudioStreamAvailable(stream) < wav_data_len) {
+ if (SDL_GetAudioStreamAvailable(stream) < (int)wav_data_len) {
/* feed more data to the stream. It will queue at the end, and trickle out as the hardware needs more data. */
SDL_PutAudioStreamData(stream, wav_data, wav_data_len);
}
diff --git a/examples/game/01-snake/main.c b/examples/game/01-snake/main.c
index 37c873bcfb47a..d09f008cb2ec9 100644
--- a/examples/game/01-snake/main.c
+++ b/examples/game/01-snake/main.c
@@ -72,8 +72,8 @@ static int handle_key_event_(SnakeContext *ctx, SDL_Scancode key_code)
static void set_rect_xy_(SDL_FRect *r, short x, short y)
{
- r->x = x * SNAKE_BLOCK_SIZE_IN_PIXELS;
- r->y = y * SNAKE_BLOCK_SIZE_IN_PIXELS;
+ r->x = (float)(x * SNAKE_BLOCK_SIZE_IN_PIXELS);
+ r->y = (float)(y * SNAKE_BLOCK_SIZE_IN_PIXELS);
}
int SDL_AppIterate(void *appstate)