Fixed a bunch of compiler warnings with Cygwin/MingW.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 24 Aug 2012 19:34:28 -0400
changeset 64038d34c6248f4a
parent 6401 a4bd9821a796
child 6404 724e1fba7933
Fixed a bunch of compiler warnings with Cygwin/MingW.
src/haptic/windows/SDL_syshaptic.c
src/joystick/windows/SDL_dxjoystick.c
src/render/direct3d/SDL_render_d3d.c
src/video/windows/SDL_windowskeyboard.c
src/video/windows/SDL_windowsshape.c
src/video/windows/SDL_windowswindow.c
     1.1 --- a/src/haptic/windows/SDL_syshaptic.c	Fri Aug 24 10:03:05 2012 -0700
     1.2 +++ b/src/haptic/windows/SDL_syshaptic.c	Fri Aug 24 19:34:28 2012 -0400
     1.3 @@ -120,12 +120,7 @@
     1.4  static int
     1.5  DI_GUIDIsSame(const GUID * a, const GUID * b)
     1.6  {
     1.7 -    if (((a)->Data1 == (b)->Data1) &&
     1.8 -        ((a)->Data2 == (b)->Data2) &&
     1.9 -        ((a)->Data3 == (b)->Data3) &&
    1.10 -        (SDL_strcmp((a)->Data4, (b)->Data4) == 0))
    1.11 -        return 1;
    1.12 -    return 0;
    1.13 +    return (SDL_memcmp(a, b, sizeof (GUID)) == 0);
    1.14  }
    1.15  
    1.16  
     2.1 --- a/src/joystick/windows/SDL_dxjoystick.c	Fri Aug 24 10:03:05 2012 -0700
     2.2 +++ b/src/joystick/windows/SDL_dxjoystick.c	Fri Aug 24 19:34:28 2012 -0400
     2.3 @@ -65,7 +65,6 @@
     2.4  static DIDEVICEINSTANCE SYS_Joystick[MAX_JOYSTICKS];    /* array to hold joystick ID values */
     2.5  static char *SYS_JoystickNames[MAX_JOYSTICKS];
     2.6  static int SYS_NumJoysticks;
     2.7 -static HINSTANCE DInputDLL = NULL;
     2.8  
     2.9  
    2.10  /* local prototypes */
     3.1 --- a/src/render/direct3d/SDL_render_d3d.c	Fri Aug 24 10:03:05 2012 -0700
     3.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Fri Aug 24 19:34:28 2012 -0400
     3.3 @@ -681,9 +681,6 @@
     3.4  static int
     3.5  D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
     3.6  {
     3.7 -    D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata;
     3.8 -    SDL_Window *window = renderer->window;
     3.9 -    D3DFORMAT display_format = renderdata->pparams.BackBufferFormat;
    3.10      D3D_TextureData *data;
    3.11      D3DPOOL pool;
    3.12      DWORD usage;
     4.1 --- a/src/video/windows/SDL_windowskeyboard.c	Fri Aug 24 10:03:05 2012 -0700
     4.2 +++ b/src/video/windows/SDL_windowskeyboard.c	Fri Aug 24 19:34:28 2012 -0400
     4.3 @@ -572,20 +572,20 @@
     4.4                          #define pVerFixedInfo   ((VS_FIXEDFILEINFO FAR*)lpVerData)
     4.5                          DWORD dwVer = pVerFixedInfo->dwFileVersionMS;
     4.6                          dwVer = (dwVer & 0x00ff0000) << 8 | (dwVer & 0x000000ff) << 16;
     4.7 -                        if (videodata->GetReadingString ||
     4.8 -                            dwLang == LANG_CHT && (
     4.9 +                        if ((videodata->GetReadingString) ||
    4.10 +                            ((dwLang == LANG_CHT) && (
    4.11                              dwVer == MAKEIMEVERSION(4, 2) ||
    4.12                              dwVer == MAKEIMEVERSION(4, 3) ||
    4.13                              dwVer == MAKEIMEVERSION(4, 4) ||
    4.14                              dwVer == MAKEIMEVERSION(5, 0) ||
    4.15                              dwVer == MAKEIMEVERSION(5, 1) ||
    4.16                              dwVer == MAKEIMEVERSION(5, 2) ||
    4.17 -                            dwVer == MAKEIMEVERSION(6, 0))
    4.18 +                            dwVer == MAKEIMEVERSION(6, 0)))
    4.19                              ||
    4.20 -                            dwLang == LANG_CHS && (
    4.21 +                            ((dwLang == LANG_CHS) && (
    4.22                              dwVer == MAKEIMEVERSION(4, 1) ||
    4.23                              dwVer == MAKEIMEVERSION(4, 2) ||
    4.24 -                            dwVer == MAKEIMEVERSION(5, 3))) {
    4.25 +                            dwVer == MAKEIMEVERSION(5, 3)))) {
    4.26                              dwRet[0] = dwVer | dwLang;
    4.27                              dwRet[1] = pVerFixedInfo->dwFileVersionLS;
    4.28                              SDL_free(lpVerBuffer);
    4.29 @@ -1050,7 +1050,6 @@
    4.30      if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) {
    4.31          BSTR bstr;
    4.32          if (SUCCEEDED(preading->lpVtbl->GetString(preading, &bstr)) && bstr) {
    4.33 -            WCHAR *s = (WCHAR *)bstr;
    4.34              SysFreeString(bstr);
    4.35          }
    4.36          preading->lpVtbl->Release(preading);
    4.37 @@ -1133,7 +1132,7 @@
    4.38  
    4.39  STDMETHODIMP IPPASink_OnActivated(TSFSink *sink, DWORD dwProfileType, LANGID langid, REFCLSID clsid, REFGUID catid, REFGUID guidProfile, HKL hkl, DWORD dwFlags)
    4.40  {
    4.41 -    static GUID TF_PROFILE_DAYI = {0x037B2C25, 0x480C, 0x4D7F, 0xB0, 0x27, 0xD6, 0xCA, 0x6B, 0x69, 0x78, 0x8A};
    4.42 +    static const GUID TF_PROFILE_DAYI = { 0x037B2C25, 0x480C, 0x4D7F, { 0xB0, 0x27, 0xD6, 0xCA, 0x6B, 0x69, 0x78, 0x8A } };
    4.43      SDL_VideoData *videodata = (SDL_VideoData *)sink->data;
    4.44      videodata->ime_candlistindexbase = SDL_IsEqualGUID(&TF_PROFILE_DAYI, guidProfile) ? 0 : 1;
    4.45      if (SDL_IsEqualIID(catid, &GUID_TFCAT_TIP_KEYBOARD) && (dwFlags & TF_IPSINK_FLAG_ACTIVE))
     5.1 --- a/src/video/windows/SDL_windowsshape.c	Fri Aug 24 10:03:05 2012 -0700
     5.2 +++ b/src/video/windows/SDL_windowsshape.c	Fri Aug 24 19:34:28 2012 -0400
     5.3 @@ -65,11 +65,14 @@
     5.4      SDL_ShapeData *data;
     5.5      HRGN mask_region = NULL;
     5.6  
     5.7 -    if (shaper == NULL || shape == NULL)
     5.8 +    if( (shaper == NULL) ||
     5.9 +        (shape == NULL) ||
    5.10 +        ((shape->format->Amask == 0) && (shape_mode->mode != ShapeModeColorKey)) ||
    5.11 +        (shape->w != shaper->window->w) ||
    5.12 +        (shape->h != shaper->window->h) ) {
    5.13          return SDL_INVALID_SHAPE_ARGUMENT;
    5.14 -    if(shape->format->Amask == 0 && shape_mode->mode != ShapeModeColorKey || shape->w != shaper->window->w || shape->h != shaper->window->h)
    5.15 -        return SDL_INVALID_SHAPE_ARGUMENT;
    5.16 -    
    5.17 +    }
    5.18 +
    5.19      data = (SDL_ShapeData*)shaper->driverdata;
    5.20      if(data->mask_tree != NULL)
    5.21          SDL_FreeShapeTree(&data->mask_tree);
     6.1 --- a/src/video/windows/SDL_windowswindow.c	Fri Aug 24 10:03:05 2012 -0700
     6.2 +++ b/src/video/windows/SDL_windowswindow.c	Fri Aug 24 19:34:28 2012 -0400
     6.3 @@ -74,7 +74,6 @@
     6.4  SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
     6.5  {
     6.6      SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
     6.7 -    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
     6.8      SDL_WindowData *data;
     6.9  
    6.10      /* Allocate the window data */
    6.11 @@ -193,7 +192,6 @@
    6.12  int
    6.13  WIN_CreateWindow(_THIS, SDL_Window * window)
    6.14  {
    6.15 -    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
    6.16      HWND hwnd;
    6.17      RECT rect;
    6.18      DWORD style = STYLE_BASIC;
    6.19 @@ -344,7 +342,6 @@
    6.20  void
    6.21  WIN_SetWindowPosition(_THIS, SDL_Window * window)
    6.22  {
    6.23 -    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
    6.24      HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
    6.25      RECT rect;
    6.26      DWORD style;
    6.27 @@ -481,11 +478,12 @@
    6.28  WIN_MaximizeWindow(_THIS, SDL_Window * window)
    6.29  {
    6.30      HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
    6.31 -    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
    6.32  
    6.33  #ifdef _WIN32_WCE
    6.34 -    if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen)
    6.35 +    if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen) {
    6.36 +        SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
    6.37          videodata->SHFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
    6.38 +    }
    6.39  #endif
    6.40  
    6.41      ShowWindow(hwnd, SW_MAXIMIZE);
    6.42 @@ -495,13 +493,14 @@
    6.43  WIN_MinimizeWindow(_THIS, SDL_Window * window)
    6.44  {
    6.45      HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
    6.46 -    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
    6.47  
    6.48      ShowWindow(hwnd, SW_MINIMIZE);
    6.49  
    6.50  #ifdef _WIN32_WCE
    6.51 -    if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen)
    6.52 +    if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen) {
    6.53 +        SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
    6.54          videodata->SHFullScreen(hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
    6.55 +    }
    6.56  #endif
    6.57  }
    6.58