minor windows warning fixes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
diff --git a/Makefile.w32 b/Makefile.w32
index ee5c4b1..fe19890 100644
--- a/Makefile.w32
+++ b/Makefile.w32
@@ -136,6 +136,8 @@ SDL_blendpoint.obj: SDL_blendpoint.c
wcc386 $(CFLAGS_DLL) -wcd=200 -fo=$^@ $<
SDL_RLEaccel.obj: SDL_RLEaccel.c
wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
+SDL_malloc.obj: SDL_malloc.c
+ wcc386 $(CFLAGS_DLL) -wcd=201 -fo=$^@ $<
# 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 &
diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c
index d515e2a..e6e9831 100644
--- a/src/joystick/windows/SDL_rawinputjoystick.c
+++ b/src/joystick/windows/SDL_rawinputjoystick.c
@@ -1349,15 +1349,15 @@ RAWINPUT_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint
static Uint32
RAWINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
{
- RAWINPUT_DeviceContext *ctx = joystick->hwdata;
Uint32 result = 0;
+#if defined(SDL_JOYSTICK_RAWINPUT_XINPUT) || defined(SDL_JOYSTICK_RAWINPUT_WGI)
+ RAWINPUT_DeviceContext *ctx = joystick->hwdata;
#ifdef SDL_JOYSTICK_RAWINPUT_XINPUT
if (ctx->is_xinput) {
result |= SDL_JOYCAP_RUMBLE;
}
#endif
-
#ifdef SDL_JOYSTICK_RAWINPUT_WGI
if (ctx->is_xinput) {
result |= SDL_JOYCAP_RUMBLE;
@@ -1367,6 +1367,7 @@ RAWINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
}
}
#endif
+#endif /**/
return result;
}
diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c
index c71798f..f2deadc 100644
--- a/src/video/windows/SDL_windowskeyboard.c
+++ b/src/video/windows/SDL_windowskeyboard.c
@@ -623,7 +623,7 @@ IME_GetId(SDL_VideoData *videodata, UINT uIndex)
dwRet[0] = dwRet[1] = 0;
return dwRet[0];
}
- if (ImmGetIMEFileNameA(hkl, szTemp, sizeof(szTemp) - 1) <= 0) {
+ if (!ImmGetIMEFileNameA(hkl, szTemp, sizeof(szTemp) - 1)) {
dwRet[0] = dwRet[1] = 0;
return dwRet[0];
}
@@ -689,7 +689,7 @@ IME_SetupAPI(SDL_VideoData *videodata)
return;
hkl = videodata->ime_hkl;
- if (ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1) <= 0)
+ if (!ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1))
return;
hime = SDL_LoadObject(ime_file);
diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c
index 5358e1d..32e21fb 100644
--- a/src/video/windows/SDL_windowsvideo.c
+++ b/src/video/windows/SDL_windowsvideo.c
@@ -334,6 +334,7 @@ WIN_DeclareDPIAwarePerMonitorV2(_THIS)
}
}
+#ifdef HIGHDPI_DEBUG
static const char*
WIN_GetDPIAwareness(_THIS)
{
@@ -357,6 +358,7 @@ WIN_GetDPIAwareness(_THIS)
return "";
}
+#endif
static void
WIN_InitDPIAwareness(_THIS)
diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c
index 00fe3e9..49cac88 100644
--- a/src/video/windows/SDL_windowswindow.c
+++ b/src/video/windows/SDL_windowswindow.c
@@ -118,13 +118,11 @@ GetWindowStyle(SDL_Window * window)
/**
* Returns arguments to pass to SetWindowPos - the window rect, including frame, in Windows coordinates.
- *
* Can be called before we have a HWND.
*/
static void
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;
RECT rect;
int dpi;
@@ -140,12 +138,12 @@ WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x
WIN_ScreenPointFromSDL(x, y, &dpi);
/* Note, use the guessed DPI returned from WIN_ScreenPointFromSDL rather than the cached one in
data->scaling_dpi.
-
+
- This is called before the window is created, so we can't rely on data->scaling_dpi
- Bug workaround: when leaving exclusive fullscreen, the cached DPI and window DPI reported
by GetDpiForWindow will be wrong, and would cause windows shrinking slightly when
going from exclusive fullscreen to windowed on a HighDPI monitor with scaling if we used them.
- */
+ */
*width = MulDiv(*width, dpi, 96);
*height = MulDiv(*height, dpi, 96);
@@ -163,7 +161,6 @@ WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, BOOL menu, int *x
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
AdjustWindowRectEx. */
-
UINT unused;
RECT screen_rect;
HMONITOR mon;
@@ -855,7 +852,6 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display,
{
SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
- SDL_VideoData *videodata = data->videodata;
HWND hwnd = data->hwnd;
MONITORINFO minfo;
DWORD style;