]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Remove various warnings terencehill/warnings_removal
authorterencehill <piuntn@gmail.com>
Tue, 4 Aug 2015 12:48:40 +0000 (14:48 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 4 Aug 2015 12:49:41 +0000 (14:49 +0200)
Signed-off-by: terencehill <piuntn@gmail.com>
cd_win.c
keys.c
vid_null.c
vid_sdl.c
vid_wgl.c

index 76ac51edec3ca461dd9db7b54e61131c4f36454c..00cc4254f723133155acd6bd9e1365972ff2d93c 100644 (file)
--- 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 6022f6bbfe175880eb4b0ada5510eeb784c82daf..74ab3343ab615e30681256fc67d412bd0702dfdd 100644 (file)
--- 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;
        }
 }
index a53997796db5411147e9eefbad5dc3940048aa44..36ee248687046cb0109b0078812d4d8d698211c2 100644 (file)
@@ -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)
 {
index e3c934a7adac167d2e208bc99650f645e43f38d5..5374e68e4006cf517a0b6474805769c2014e03a7 100644 (file)
--- 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;
index 24bcdabc943ffabf7bf63e877ae3e96108f716b4..c79508a48e5ceb1adccd92abf61b08afd6da28ad 100644 (file)
--- 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;