Another shot at fixing the compiler warnings under Cygwin/MingW. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Sun, 11 Sep 2011 13:23:36 -0400
branchSDL-1.2
changeset 5892eca95aaa02a2
parent 5891 9086ec040519
child 5893 f3adae5e12cd
Another shot at fixing the compiler warnings under Cygwin/MingW.
include/SDL_thread.h
src/thread/win32/SDL_systhread.c
src/video/wincommon/SDL_sysevents.c
     1.1 --- a/include/SDL_thread.h	Sun Sep 11 10:48:36 2011 -0400
     1.2 +++ b/include/SDL_thread.h	Sun Sep 11 13:23:36 2011 -0400
     1.3 @@ -68,11 +68,6 @@
     1.4  #ifdef __OS2__
     1.5  typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); 
     1.6  typedef void (*pfnSDL_CurrentEndThread)(void);
     1.7 -#elif __GNUC__
     1.8 -typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
     1.9 -        unsigned (__stdcall *func)(void *), void *arg, 
    1.10 -        unsigned, unsigned *threadID);
    1.11 -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
    1.12  #else
    1.13  typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
    1.14          unsigned (__stdcall *func)(void *), void *arg, 
     2.1 --- a/src/thread/win32/SDL_systhread.c	Sun Sep 11 10:48:36 2011 -0400
     2.2 +++ b/src/thread/win32/SDL_systhread.c	Sun Sep 11 13:23:36 2011 -0400
     2.3 @@ -36,12 +36,7 @@
     2.4  #include <process.h>
     2.5  #endif
     2.6  
     2.7 -#if __GNUC__
     2.8 -typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned,
     2.9 -        unsigned (__stdcall *func)(void *), void *arg, 
    2.10 -        unsigned, unsigned *threadID);
    2.11 -typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code);
    2.12 -#elif defined(__WATCOMC__)
    2.13 +#if defined(__WATCOMC__)
    2.14  /* This is for Watcom targets except OS2 */
    2.15  #if __WATCOMC__ < 1240
    2.16  #define __watcall
    2.17 @@ -65,7 +60,7 @@
    2.18    pfnSDL_CurrentEndThread pfnCurrentEndThread;
    2.19  } tThreadStartParms, *pThreadStartParms;
    2.20  
    2.21 -static unsigned __stdcall RunThread(void *data)
    2.22 +static DWORD WINAPI RunThread(LPVOID data)
    2.23  {
    2.24    pThreadStartParms pThreadParms = (pThreadStartParms)data;
    2.25    pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL;
     3.1 --- a/src/video/wincommon/SDL_sysevents.c	Sun Sep 11 10:48:36 2011 -0400
     3.2 +++ b/src/video/wincommon/SDL_sysevents.c	Sun Sep 11 13:23:36 2011 -0400
     3.3 @@ -820,7 +820,8 @@
     3.4  {
     3.5  	BYTE	chars[2];
     3.6  
     3.7 -	if (ToAsciiEx(vkey, scancode, keystate, (WORD*)chars, 0, GetKeyboardLayout(0)) == 1) {
     3.8 +	/* arg #3 should be const BYTE *, but cygwin lists it as PBYTE. */
     3.9 +	if (ToAsciiEx(vkey, scancode, (PBYTE) keystate, (WORD*)chars, 0, GetKeyboardLayout(0)) == 1) {
    3.10  		return MultiByteToWideChar(codepage, 0, chars, 1, wchars, wsize);
    3.11  	}
    3.12  	return 0;