minor windows warning fixes.

This commit is contained in:
Ozkan Sezer 2022-06-13 22:15:56 +03:00
parent e974985998
commit 714502d373
5 changed files with 11 additions and 10 deletions

View File

@ -136,6 +136,8 @@ SDL_blendpoint.obj: SDL_blendpoint.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $< wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_RLEaccel.obj: SDL_RLEaccel.c SDL_RLEaccel.obj: SDL_RLEaccel.c
wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $< wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
SDL_malloc.obj: SDL_malloc.c
wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
# SDL2libm # SDL2libm
MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c & MSRCS= e_atan2.c e_exp.c e_fmod.c e_log10.c e_log.c e_pow.c e_rem_pio2.c e_sqrt.c &

View File

@ -1349,15 +1349,15 @@ RAWINPUT_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint
static Uint32 static Uint32
RAWINPUT_JoystickGetCapabilities(SDL_Joystick *joystick) RAWINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
{ {
RAWINPUT_DeviceContext *ctx = joystick->hwdata;
Uint32 result = 0; Uint32 result = 0;
#if defined(SDL_JOYSTICK_RAWINPUT_XINPUT) || defined(SDL_JOYSTICK_RAWINPUT_WGI)
RAWINPUT_DeviceContext *ctx = joystick->hwdata;
#ifdef SDL_JOYSTICK_RAWINPUT_XINPUT #ifdef SDL_JOYSTICK_RAWINPUT_XINPUT
if (ctx->is_xinput) { if (ctx->is_xinput) {
result |= SDL_JOYCAP_RUMBLE; result |= SDL_JOYCAP_RUMBLE;
} }
#endif #endif
#ifdef SDL_JOYSTICK_RAWINPUT_WGI #ifdef SDL_JOYSTICK_RAWINPUT_WGI
if (ctx->is_xinput) { if (ctx->is_xinput) {
result |= SDL_JOYCAP_RUMBLE; result |= SDL_JOYCAP_RUMBLE;
@ -1367,6 +1367,7 @@ RAWINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
} }
} }
#endif #endif
#endif /**/
return result; return result;
} }

View File

@ -623,7 +623,7 @@ IME_GetId(SDL_VideoData *videodata, UINT uIndex)
dwRet[0] = dwRet[1] = 0; dwRet[0] = dwRet[1] = 0;
return dwRet[0]; return dwRet[0];
} }
if (ImmGetIMEFileNameA(hkl, szTemp, sizeof(szTemp) - 1) <= 0) { if (!ImmGetIMEFileNameA(hkl, szTemp, sizeof(szTemp) - 1)) {
dwRet[0] = dwRet[1] = 0; dwRet[0] = dwRet[1] = 0;
return dwRet[0]; return dwRet[0];
} }
@ -689,7 +689,7 @@ IME_SetupAPI(SDL_VideoData *videodata)
return; return;
hkl = videodata->ime_hkl; hkl = videodata->ime_hkl;
if (ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1) <= 0) if (!ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1))
return; return;
hime = SDL_LoadObject(ime_file); hime = SDL_LoadObject(ime_file);

View File

@ -334,6 +334,7 @@ WIN_DeclareDPIAwarePerMonitorV2(_THIS)
} }
} }
#ifdef HIGHDPI_DEBUG
static const char* static const char*
WIN_GetDPIAwareness(_THIS) WIN_GetDPIAwareness(_THIS)
{ {
@ -357,6 +358,7 @@ WIN_GetDPIAwareness(_THIS)
return ""; return "";
} }
#endif
static void static void
WIN_InitDPIAwareness(_THIS) WIN_InitDPIAwareness(_THIS)

View File

@ -118,13 +118,11 @@ GetWindowStyle(SDL_Window * window)
/** /**
* Returns arguments to pass to SetWindowPos - the window rect, including frame, in Windows coordinates. * Returns arguments to pass to SetWindowPos - the window rect, including frame, in Windows coordinates.
*
* Can be called before we have a HWND. * Can be called before we have a HWND.
*/ */
static void static void
WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x, int *y, int *width, int *height, SDL_bool use_current) WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x, int *y, int *width, int *height, SDL_bool use_current)
{ {
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
SDL_VideoData* videodata = SDL_GetVideoDevice() ? SDL_GetVideoDevice()->driverdata : NULL; SDL_VideoData* videodata = SDL_GetVideoDevice() ? SDL_GetVideoDevice()->driverdata : NULL;
RECT rect; RECT rect;
int dpi; int dpi;
@ -163,7 +161,6 @@ WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x
if (WIN_IsPerMonitorV2DPIAware(SDL_GetVideoDevice())) { if (WIN_IsPerMonitorV2DPIAware(SDL_GetVideoDevice())) {
/* With per-monitor v2, the window border/titlebar size depend on the DPI, so we need to call AdjustWindowRectExForDpi instead of /* With per-monitor v2, the window border/titlebar size depend on the DPI, so we need to call AdjustWindowRectExForDpi instead of
AdjustWindowRectEx. */ AdjustWindowRectEx. */
UINT unused; UINT unused;
RECT screen_rect; RECT screen_rect;
HMONITOR mon; HMONITOR mon;
@ -855,7 +852,6 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display,
{ {
SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata; SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
SDL_WindowData *data = (SDL_WindowData *) window->driverdata; SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
SDL_VideoData *videodata = data->videodata;
HWND hwnd = data->hwnd; HWND hwnd = data->hwnd;
MONITORINFO minfo; MONITORINFO minfo;
DWORD style; DWORD style;