From b5d2759381d66ea880d46c171430414f3153d662 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 4 Aug 2015 14:48:40 +0200 Subject: [PATCH] Remove various warnings Signed-off-by: terencehill --- cd_win.c | 2 ++ keys.c | 1 - vid_null.c | 2 ++ vid_sdl.c | 24 ++++++++++++++---------- vid_wgl.c | 10 ++++++---- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/cd_win.c b/cd_win.c index 76ac51ed..00cc4254 100644 --- a/cd_win.c +++ b/cd_win.c @@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "cdaudio.h" +LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); + #if defined(_MSC_VER) && (_MSC_VER < 1300) typedef DWORD DWORD_PTR; #endif diff --git a/keys.c b/keys.c index 6022f6bb..74ab3343 100644 --- a/keys.c +++ b/keys.c @@ -1183,7 +1183,6 @@ Key_Console (int key, int unicode) memcpy(key_line + key_linepos, buf, blen); if (blen > len) key_line[key_linepos + blen] = 0; - // END OF FIXME key_linepos += blen; } } diff --git a/vid_null.c b/vid_null.c index a5399779..36ee2486 100644 --- a/vid_null.c +++ b/vid_null.c @@ -29,11 +29,13 @@ void VID_Shutdown(void) { } +#ifndef WIN32 static void signal_handler(int sig) { Con_Printf("Received signal %d, exiting...\n", sig); Sys_Quit(1); } +#endif static void InitSig(void) { diff --git a/vid_sdl.c b/vid_sdl.c index e3c934a7..5374e68e 100644 --- a/vid_sdl.c +++ b/vid_sdl.c @@ -2420,6 +2420,10 @@ static void AdjustWindowBounds(viddef_mode_t *mode, RECT *rect) LONG width = mode->width; // vid_width LONG height = mode->height; // vid_height + RECT workArea; + int workWidth, workHeight; + int titleBarPixels, screenHeight; + // adjust width and height for the space occupied by window decorators (title bar, borders) rect->top = 0; rect->left = 0; @@ -2427,16 +2431,15 @@ static void AdjustWindowBounds(viddef_mode_t *mode, RECT *rect) rect->bottom = height; AdjustWindowRectEx(rect, WS_CAPTION|WS_THICKFRAME, false, 0); - RECT workArea; SystemParametersInfo(SPI_GETWORKAREA, 0, &workArea, 0); - int workWidth = workArea.right - workArea.left; - int workHeight = workArea.bottom - workArea.top; + workWidth = workArea.right - workArea.left; + workHeight = workArea.bottom - workArea.top; // SDL forces the window height to be <= screen height - 27px (on Win8.1 - probably intended for the title bar) // If the task bar is docked to the the left screen border and we move the window to negative y, // there would be some part of the regular desktop visible on the bottom of the screen. - int titleBarPixels = 2; - int screenHeight = GetSystemMetrics(SM_CYSCREEN); + titleBarPixels = 2; + screenHeight = GetSystemMetrics(SM_CYSCREEN); if (screenHeight == workHeight) titleBarPixels = -rect->top; @@ -2453,7 +2456,7 @@ static void AdjustWindowBounds(viddef_mode_t *mode, RECT *rect) else { rect->left = workArea.left + max(0, (workWidth - width) / 2); - rect->top = workArea.top + (0, (workHeight - height) / 2); + rect->top = workArea.top + max(0, (workHeight - height) / 2); } } #endif @@ -2470,6 +2473,7 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode) int i; const char *drivername; #endif + int xPos, yPos; win_half_width = mode->width>>1; win_half_height = mode->height>>1; @@ -2527,8 +2531,8 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode) // Knghtbrd: should do platform-specific extension string function here vid_isfullscreen = false; - int xPos = SDL_WINDOWPOS_UNDEFINED; - int yPos = SDL_WINDOWPOS_UNDEFINED; + xPos = SDL_WINDOWPOS_UNDEFINED; + yPos = SDL_WINDOWPOS_UNDEFINED; #if SDL_MAJOR_VERSION == 1 { const SDL_VideoInfo *vi = SDL_GetVideoInfo(); @@ -2553,7 +2557,8 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode) if (mode->fullscreen) { if (vid_desktopfullscreen.integer) { - vid_mode_t *m = VID_GetDesktopMode(); + vid_mode_t *m; + m = VID_GetDesktopMode(); mode->width = m->width; mode->height = m->height; windowflags |= SDL_WINDOW_FULLSCREEN_DESKTOP; @@ -2564,7 +2569,6 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode) } else { #ifdef WIN32 - DWORD windowStyle = 0; RECT rect; AdjustWindowBounds(mode, &rect); xPos = rect.left; diff --git a/vid_wgl.c b/vid_wgl.c index 24bcdabc..c79508a4 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -1342,13 +1342,15 @@ static void AdjustWindowBounds(int fullscreen, int *width, int *height, viddef_m else { RECT workArea; - SystemParametersInfo(SPI_GETWORKAREA, NULL, &workArea, 0); - int workWidth = workArea.right - workArea.left; - int workHeight = workArea.bottom - workArea.top; + int workWidth, workHeight; + const int titleBarPixels = 2; + + SystemParametersInfo(SPI_GETWORKAREA, 0, &workArea, 0); + workWidth = workArea.right - workArea.left; + workHeight = workArea.bottom - workArea.top; // if height/width matches physical screen height/width, adjust it to available desktop size // and allow 2 pixels on top for the title bar so the window can be moved - const int titleBarPixels = 2; if (*width == GetSystemMetrics(SM_CXSCREEN) && (*height == GetSystemMetrics(SM_CYSCREEN) || *height == workHeight - titleBarPixels)) { rect->right -= *width - workWidth; -- 2.39.2