From 5755de07a66b400d58c20d88ed04c91e4b38b4a0 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 25 Aug 2023 08:45:33 -0700
Subject: [PATCH] Fixed build warnings
---
src/audio/directsound/SDL_directsound.c | 4 ++--
src/video/SDL_bmp.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/audio/directsound/SDL_directsound.c b/src/audio/directsound/SDL_directsound.c
index f1ab29706b0d..35c0f97f69d5 100644
--- a/src/audio/directsound/SDL_directsound.c
+++ b/src/audio/directsound/SDL_directsound.c
@@ -378,7 +378,7 @@ static int DSOUND_CaptureFromDevice(SDL_AudioDevice *device, void *buffer, int b
return -1;
}
- SDL_assert(ptr1len == buflen);
+ SDL_assert(ptr1len == (DWORD)buflen);
SDL_assert(ptr2 == NULL);
SDL_assert(ptr2len == 0);
@@ -614,7 +614,7 @@ static int DSOUND_OpenDevice(SDL_AudioDevice *device)
}
wfmt.Format.wBitsPerSample = SDL_AUDIO_BITSIZE(device->spec.format);
- wfmt.Format.nChannels = device->spec.channels;
+ wfmt.Format.nChannels = (WORD)device->spec.channels;
wfmt.Format.nSamplesPerSec = device->spec.freq;
wfmt.Format.nBlockAlign = wfmt.Format.nChannels * (wfmt.Format.wBitsPerSample / 8);
wfmt.Format.nAvgBytesPerSec = wfmt.Format.nSamplesPerSec * wfmt.Format.nBlockAlign;
diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c
index 68e634fd4a89..44111a8f4f6a 100644
--- a/src/video/SDL_bmp.c
+++ b/src/video/SDL_bmp.c
@@ -743,7 +743,7 @@ int SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, SDL_bool freedst)
}
if (SDL_LockSurface(intermediate_surface) == 0) {
- const int bw = intermediate_surface->w * intermediate_surface->format->BytesPerPixel;
+ const size_t bw = intermediate_surface->w * intermediate_surface->format->BytesPerPixel;
/* Set the BMP file header values */
bfSize = 0; /* We'll write this when we're done */