Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed a bunch of compiler warnings with Cygwin/MingW.

  • Loading branch information
icculus committed Aug 24, 2012
1 parent 22eacc8 commit fdbbf309c0fe29d43b54bbdd922c31230d8ec6d8
@@ -120,12 +120,7 @@ DI_SetError(const char *str, HRESULT err)
static int
DI_GUIDIsSame(const GUID * a, const GUID * b)
{
if (((a)->Data1 == (b)->Data1) &&
((a)->Data2 == (b)->Data2) &&
((a)->Data3 == (b)->Data3) &&
(SDL_strcmp((a)->Data4, (b)->Data4) == 0))
return 1;
return 0;
return (SDL_memcmp(a, b, sizeof (GUID)) == 0);
}


@@ -65,7 +65,6 @@ extern HRESULT(WINAPI * DInputCreate) (HINSTANCE hinst, DWORD dwVersion,
static DIDEVICEINSTANCE SYS_Joystick[MAX_JOYSTICKS]; /* array to hold joystick ID values */
static char *SYS_JoystickNames[MAX_JOYSTICKS];
static int SYS_NumJoysticks;
static HINSTANCE DInputDLL = NULL;


/* local prototypes */
@@ -681,9 +681,6 @@ GetScaleQuality(void)
static int
D3D_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
{
D3D_RenderData *renderdata = (D3D_RenderData *) renderer->driverdata;
SDL_Window *window = renderer->window;
D3DFORMAT display_format = renderdata->pparams.BackBufferFormat;
D3D_TextureData *data;
D3DPOOL pool;
DWORD usage;
@@ -572,20 +572,20 @@ IME_GetId(SDL_VideoData *videodata, UINT uIndex)
#define pVerFixedInfo ((VS_FIXEDFILEINFO FAR*)lpVerData)
DWORD dwVer = pVerFixedInfo->dwFileVersionMS;
dwVer = (dwVer & 0x00ff0000) << 8 | (dwVer & 0x000000ff) << 16;
if (videodata->GetReadingString ||
dwLang == LANG_CHT && (
if ((videodata->GetReadingString) ||
((dwLang == LANG_CHT) && (
dwVer == MAKEIMEVERSION(4, 2) ||
dwVer == MAKEIMEVERSION(4, 3) ||
dwVer == MAKEIMEVERSION(4, 4) ||
dwVer == MAKEIMEVERSION(5, 0) ||
dwVer == MAKEIMEVERSION(5, 1) ||
dwVer == MAKEIMEVERSION(5, 2) ||
dwVer == MAKEIMEVERSION(6, 0))
dwVer == MAKEIMEVERSION(6, 0)))
||
dwLang == LANG_CHS && (
((dwLang == LANG_CHS) && (
dwVer == MAKEIMEVERSION(4, 1) ||
dwVer == MAKEIMEVERSION(4, 2) ||
dwVer == MAKEIMEVERSION(5, 3))) {
dwVer == MAKEIMEVERSION(5, 3)))) {
dwRet[0] = dwVer | dwLang;
dwRet[1] = pVerFixedInfo->dwFileVersionLS;
SDL_free(lpVerBuffer);
@@ -1050,7 +1050,6 @@ STDMETHODIMP UIElementSink_BeginUIElement(TSFSink *sink, DWORD dwUIElementId, BO
if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) {
BSTR bstr;
if (SUCCEEDED(preading->lpVtbl->GetString(preading, &bstr)) && bstr) {
WCHAR *s = (WCHAR *)bstr;
SysFreeString(bstr);
}
preading->lpVtbl->Release(preading);
@@ -1133,7 +1132,7 @@ STDMETHODIMP IPPASink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv)

STDMETHODIMP IPPASink_OnActivated(TSFSink *sink, DWORD dwProfileType, LANGID langid, REFCLSID clsid, REFGUID catid, REFGUID guidProfile, HKL hkl, DWORD dwFlags)
{
static GUID TF_PROFILE_DAYI = {0x037B2C25, 0x480C, 0x4D7F, 0xB0, 0x27, 0xD6, 0xCA, 0x6B, 0x69, 0x78, 0x8A};
static const GUID TF_PROFILE_DAYI = { 0x037B2C25, 0x480C, 0x4D7F, { 0xB0, 0x27, 0xD6, 0xCA, 0x6B, 0x69, 0x78, 0x8A } };
SDL_VideoData *videodata = (SDL_VideoData *)sink->data;
videodata->ime_candlistindexbase = SDL_IsEqualGUID(&TF_PROFILE_DAYI, guidProfile) ? 0 : 1;
if (SDL_IsEqualIID(catid, &GUID_TFCAT_TIP_KEYBOARD) && (dwFlags & TF_IPSINK_FLAG_ACTIVE))
@@ -65,11 +65,14 @@ Win32_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShape
SDL_ShapeData *data;
HRGN mask_region = NULL;

if (shaper == NULL || shape == NULL)
if( (shaper == NULL) ||
(shape == NULL) ||
((shape->format->Amask == 0) && (shape_mode->mode != ShapeModeColorKey)) ||
(shape->w != shaper->window->w) ||
(shape->h != shaper->window->h) ) {
return SDL_INVALID_SHAPE_ARGUMENT;
if(shape->format->Amask == 0 && shape_mode->mode != ShapeModeColorKey || shape->w != shaper->window->w || shape->h != shaper->window->h)
return SDL_INVALID_SHAPE_ARGUMENT;

}

data = (SDL_ShapeData*)shaper->driverdata;
if(data->mask_tree != NULL)
SDL_FreeShapeTree(&data->mask_tree);
@@ -74,7 +74,6 @@ static int
SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
{
SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
SDL_WindowData *data;

/* Allocate the window data */
@@ -193,7 +192,6 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
int
WIN_CreateWindow(_THIS, SDL_Window * window)
{
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
HWND hwnd;
RECT rect;
DWORD style = STYLE_BASIC;
@@ -344,7 +342,6 @@ WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
void
WIN_SetWindowPosition(_THIS, SDL_Window * window)
{
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
RECT rect;
DWORD style;
@@ -481,11 +478,12 @@ void
WIN_MaximizeWindow(_THIS, SDL_Window * window)
{
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;

#ifdef _WIN32_WCE
if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen)
if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen) {
SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
videodata->SHFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
}
#endif

ShowWindow(hwnd, SW_MAXIMIZE);
@@ -495,13 +493,14 @@ void
WIN_MinimizeWindow(_THIS, SDL_Window * window)
{
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;

ShowWindow(hwnd, SW_MINIMIZE);

#ifdef _WIN32_WCE
if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen)
if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen) {
SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
videodata->SHFullScreen(hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
}
#endif
}

0 comments on commit fdbbf30

Please sign in to comment.