diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 8c5b5d4f09..f7c3ec81b3 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -666,7 +666,7 @@ static int SDLCALL SDL_RunAudio(void *devicep) /* Fill the current buffer with sound */ if (!device->stream && SDL_AtomicGet(&device->enabled)) { - SDL_assert(data_len == device->spec.size); + SDL_assert((Uint32)data_len == device->spec.size); data = current_audio.impl.GetDeviceBuf(device); } else { /* if the device isn't enabled, we still write to the @@ -700,13 +700,13 @@ static int SDLCALL SDL_RunAudio(void *devicep) int got; data = SDL_AtomicGet(&device->enabled) ? current_audio.impl.GetDeviceBuf(device) : NULL; got = SDL_GetAudioStreamData(device->stream, data ? data : device->work_buffer, device->spec.size); - SDL_assert((got <= 0) || (got == device->spec.size)); + SDL_assert((got <= 0) || ((Uint32)got == device->spec.size)); if (data == NULL) { /* device is having issues... */ const Uint32 delay = ((device->spec.samples * 1000) / device->spec.freq); SDL_Delay(delay); /* wait for as long as this buffer would have played. Maybe device recovers later? */ } else { - if (got != device->spec.size) { + if ((Uint32)got != device->spec.size) { SDL_memset(data, device->spec.silence, device->spec.size); } current_audio.impl.PlayDevice(device); @@ -814,8 +814,8 @@ static int SDLCALL SDL_CaptureAudio(void *devicep) while (SDL_GetAudioStreamAvailable(device->stream) >= ((int)device->callbackspec.size)) { const int got = SDL_GetAudioStreamData(device->stream, device->work_buffer, device->callbackspec.size); - SDL_assert((got < 0) || (got == device->callbackspec.size)); - if (got != device->callbackspec.size) { + SDL_assert((got < 0) || ((Uint32)got == device->callbackspec.size)); + if ((Uint32)got != device->callbackspec.size) { SDL_memset(device->work_buffer, device->spec.silence, device->callbackspec.size); } diff --git a/src/audio/directsound/SDL_directsound.c b/src/audio/directsound/SDL_directsound.c index b1ce62a451..39e3f334f5 100644 --- a/src/audio/directsound/SDL_directsound.c +++ b/src/audio/directsound/SDL_directsound.c @@ -328,7 +328,7 @@ static int DSOUND_CaptureFromDevice(_THIS, void *buffer, int buflen) DWORD junk, cursor, ptr1len, ptr2len; VOID *ptr1, *ptr2; - SDL_assert(buflen == this->spec.size); + SDL_assert((Uint32)buflen == this->spec.size); while (SDL_TRUE) { if (SDL_AtomicGet(&this->shutdown)) { /* in case the buffer froze... */ diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c index 5de499dd48..56da8fb7d3 100644 --- a/src/audio/wasapi/SDL_wasapi.c +++ b/src/audio/wasapi/SDL_wasapi.c @@ -448,7 +448,7 @@ int WASAPI_PrepDevice(_THIS, const SDL_bool updatestream) this->spec.freq = waveformat->nSamplesPerSec; /* force sampling rate so our resampler kicks in, if necessary. */ #else /* favor WASAPI's resampler over our own */ - if (this->spec.freq != waveformat->nSamplesPerSec) { + if ((DWORD)this->spec.freq != waveformat->nSamplesPerSec) { streamflags |= (AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM | AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY); waveformat->nSamplesPerSec = this->spec.freq; waveformat->nAvgBytesPerSec = waveformat->nSamplesPerSec * waveformat->nChannels * (waveformat->wBitsPerSample / 8); diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index 26f5f67469..b14c5bf31b 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -1472,14 +1472,15 @@ int SDL_AddGamepadMappingsFromRW(SDL_RWops *rw, int freerw) const char *platform = SDL_GetPlatform(); int gamepads = 0; char *buf, *line, *line_end, *tmp, *comma, line_platform[64]; - size_t db_size, platform_len; + Sint64 db_size; + size_t platform_len; if (rw == NULL) { return SDL_SetError("Invalid RWops"); } - db_size = (size_t)SDL_RWsize(rw); + db_size = SDL_RWsize(rw); - buf = (char *)SDL_malloc(db_size + 1); + buf = (char *)SDL_malloc((size_t)db_size + 1); if (buf == NULL) { if (freerw) { SDL_RWclose(rw); diff --git a/src/libm/e_pow.c b/src/libm/e_pow.c index 8acb1f5ff7..d1a141ec4b 100644 --- a/src/libm/e_pow.c +++ b/src/libm/e_pow.c @@ -139,7 +139,7 @@ double attribute_hidden __ieee754_pow(double x, double y) k = (iy>>20)-0x3ff; /* exponent */ if(k>20) { j = ly>>(52-k); - if((j<<(52-k))==ly) yisint = 2-(j&1); + if(((u_int32_t)j<<(52-k))==ly) yisint = 2-(j&1); } else if(ly==0) { j = iy>>(20-k); if((j<<(20-k))==iy) yisint = 2-(j&1); diff --git a/src/libm/e_sqrt.c b/src/libm/e_sqrt.c index 7d96e512cd..8ac58c62ac 100644 --- a/src/libm/e_sqrt.c +++ b/src/libm/e_sqrt.c @@ -149,7 +149,7 @@ double attribute_hidden __ieee754_sqrt(double x) t = s0; if((t (UINT)pitch) { diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index f00f2e9443..010fc8a898 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -1579,7 +1579,7 @@ static int GLES2_TexSubImage2D(GLES2_RenderData *data, GLenum target, GLint xoff /* Reformat the texture data into a tightly packed array */ src_pitch = (size_t)width * bpp; src = (Uint8 *)pixels; - if (pitch != src_pitch) { + if ((size_t)pitch != src_pitch) { blob = (Uint8 *)SDL_malloc(src_pitch * height); if (blob == NULL) { return SDL_OutOfMemory(); diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index 6b83871457..1229c3798a 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -576,7 +576,7 @@ SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_ c = (unsigned char)src[i]; trailing_bytes = UTF8_GetTrailingBytes(c); if (trailing_bytes) { - if (bytes - i != trailing_bytes + 1) { + if ((bytes - i) != ((size_t)trailing_bytes + 1)) { bytes = i; } diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index c9293aad69..ff64586510 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -4698,7 +4698,7 @@ static SDL_bool SDL_IsMessageboxValidForDriver(const SDL_MessageBoxData *message if (window == NULL || SDL_GetWindowWMInfo(window, &info, SDL_SYSWM_CURRENT_VERSION) < 0) { return SDL_TRUE; } else { - return info.subsystem == drivertype; + return info.subsystem == (Uint32)drivertype; } } #endif diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 989a0a8391..65b1e07426 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -1673,7 +1673,7 @@ static void IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) bottom = size.cy - listborder - listpadding - candmargin; } - if (i == videodata->ime_candsel) { + if ((DWORD)i == videodata->ime_candsel) { SelectObject(hdc, selpen); SelectObject(hdc, selbrush); SetTextColor(hdc, seltextcolor); diff --git a/src/video/yuv2rgb/yuv_rgb_sse_func.h b/src/video/yuv2rgb/yuv_rgb_sse_func.h index a3c15f2585..5d1ea3bccd 100644 --- a/src/video/yuv2rgb/yuv_rgb_sse_func.h +++ b/src/video/yuv2rgb/yuv_rgb_sse_func.h @@ -491,7 +491,7 @@ void SDL_TARGETING("sse2") SSE_FUNCTION_NAME(uint32_t width, uint32_t height, /* Catch the right column, if needed */ { - int converted = (width & ~31); + uint32_t converted = (width & ~31); if (fix_read_nv12) { converted -= 32; }