[Commits] SDL: Another shot at fixing the compiler warnings under Cygwin/M...
libsdl.org revision control
commits-owner at libsdl.org
Sun Sep 11 10:24:50 PDT 2011
details: http://hg.libsdl.org/SDL/rev/eca95aaa02a2
changeset: 5892:eca95aaa02a2
user: Ryan C. Gordon <icculus at icculus.org>
date: Sun Sep 11 13:23:36 2011 -0400
description:
Another shot at fixing the compiler warnings under Cygwin/MingW.
diffstat:
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(-)
diffs (54 lines):
diff -r 9086ec040519 -r eca95aaa02a2 include/SDL_thread.h
--- a/include/SDL_thread.h Sun Sep 11 10:48:36 2011 -0400
+++ b/include/SDL_thread.h Sun Sep 11 13:23:36 2011 -0400
@@ -68,11 +68,6 @@
#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 -r 9086ec040519 -r eca95aaa02a2 src/thread/win32/SDL_systhread.c
--- a/src/thread/win32/SDL_systhread.c Sun Sep 11 10:48:36 2011 -0400
+++ b/src/thread/win32/SDL_systhread.c Sun Sep 11 13:23:36 2011 -0400
@@ -36,12 +36,7 @@
#include <process.h>
#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 @@
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 -r 9086ec040519 -r eca95aaa02a2 src/video/wincommon/SDL_sysevents.c
--- a/src/video/wincommon/SDL_sysevents.c Sun Sep 11 10:48:36 2011 -0400
+++ b/src/video/wincommon/SDL_sysevents.c Sun Sep 11 13:23:36 2011 -0400
@@ -820,7 +820,8 @@
{
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;
More information about the commits
mailing list