Commit db146e66c6b39db32caedc4831029b3d94a40ab7

Sam Lantinga 2021-05-25T10:34:04

Fixed warnings building with Visual Studio

diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c
index ec0347b..72b2ca9 100644
--- a/src/audio/wasapi/SDL_wasapi.c
+++ b/src/audio/wasapi/SDL_wasapi.c
@@ -137,7 +137,7 @@ WASAPI_AddDevice(const SDL_bool iscapture, const char *devname, WAVEFORMATEXTENS
     deviceid_list = devidlist;
 
     SDL_zero(spec);
-    spec.channels = fmt->Format.nChannels;
+    spec.channels = (Uint8)fmt->Format.nChannels;
     spec.freq = fmt->Format.nSamplesPerSec;
     spec.format = WaveFormatToSDLFormat((WAVEFORMATEX *) fmt);
     SDL_AddAudioDevice(iscapture, devname, &spec, (void *) devid);
diff --git a/src/audio/winmm/SDL_winmm.c b/src/audio/winmm/SDL_winmm.c
index 5d221f6..8e0685d 100644
--- a/src/audio/winmm/SDL_winmm.c
+++ b/src/audio/winmm/SDL_winmm.c
@@ -86,7 +86,7 @@ static void DetectWave##typ##Devs(void) { \
                  * is not provided by the caps struct! At best, we get possible \
                  * sample formats, but not an _active_ format. \
                  */ \
-                spec.channels = caps.wChannels; \
+                spec.channels = (Uint8)caps.wChannels; \
                 SDL_AddAudioDevice((int) iscapture, name, &spec, (void *) ((size_t) i+1)); \
                 SDL_free(name); \
             } \