From 9b50a5d22dd15407c910695eba3bc952f50136bc Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 11 Sep 2011 13:23:36 -0400 Subject: [PATCH] Another shot at fixing the compiler warnings under Cygwin/MingW. --- include/SDL_thread.h | 5 ----- src/thread/win32/SDL_systhread.c | 9 ++------- src/video/wincommon/SDL_sysevents.c | 3 ++- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/include/SDL_thread.h b/include/SDL_thread.h index 1ca9a1bc4..dec713766 100644 --- a/include/SDL_thread.h +++ b/include/SDL_thread.h @@ -68,11 +68,6 @@ typedef struct SDL_Thread SDL_Thread; #ifdef __OS2__ typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); typedef void (*pfnSDL_CurrentEndThread)(void); -#elif __GNUC__ -typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); #else typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, unsigned (__stdcall *func)(void *), void *arg, diff --git a/src/thread/win32/SDL_systhread.c b/src/thread/win32/SDL_systhread.c index 368dbf4b7..73238422a 100644 --- a/src/thread/win32/SDL_systhread.c +++ b/src/thread/win32/SDL_systhread.c @@ -36,12 +36,7 @@ #include #endif -#if __GNUC__ -typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall *func)(void *), void *arg, - unsigned, unsigned *threadID); -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); -#elif defined(__WATCOMC__) +#if defined(__WATCOMC__) /* This is for Watcom targets except OS2 */ #if __WATCOMC__ < 1240 #define __watcall @@ -65,7 +60,7 @@ typedef struct ThreadStartParms pfnSDL_CurrentEndThread pfnCurrentEndThread; } tThreadStartParms, *pThreadStartParms; -static unsigned __stdcall RunThread(void *data) +static DWORD WINAPI RunThread(LPVOID data) { pThreadStartParms pThreadParms = (pThreadStartParms)data; pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL; diff --git a/src/video/wincommon/SDL_sysevents.c b/src/video/wincommon/SDL_sysevents.c index 37d73d429..1d9548097 100644 --- a/src/video/wincommon/SDL_sysevents.c +++ b/src/video/wincommon/SDL_sysevents.c @@ -820,7 +820,8 @@ static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, const BYTE *keystate, { BYTE chars[2]; - if (ToAsciiEx(vkey, scancode, keystate, (WORD*)chars, 0, GetKeyboardLayout(0)) == 1) { + /* arg #3 should be const BYTE *, but cygwin lists it as PBYTE. */ + if (ToAsciiEx(vkey, scancode, (PBYTE) keystate, (WORD*)chars, 0, GetKeyboardLayout(0)) == 1) { return MultiByteToWideChar(codepage, 0, chars, 1, wchars, wsize); } return 0;