diff --git a/src/thread/win32/SDL_syssem.c b/src/thread/win32/SDL_syssem.c index 43c2f957c..01d48cabf 100644 --- a/src/thread/win32/SDL_syssem.c +++ b/src/thread/win32/SDL_syssem.c @@ -38,7 +38,7 @@ struct SDL_semaphore { #else HANDLE id; #endif - Uint32 volatile count; + volatile LONG count; }; @@ -56,7 +56,7 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) #else sem->id = CreateSemaphore(NULL, initial_value, 32*1024, NULL); #endif - sem->count = initial_value; + sem->count = (LONG) initial_value; if ( ! sem->id ) { SDL_SetError("Couldn't create semaphore"); SDL_free(sem); @@ -136,7 +136,7 @@ Uint32 SDL_SemValue(SDL_sem *sem) SDL_SetError("Passed a NULL sem"); return 0; } - return sem->count; + return (Uint32) sem->count; } int SDL_SemPost(SDL_sem *sem) diff --git a/src/thread/win32/SDL_systhread.c b/src/thread/win32/SDL_systhread.c index 6f50617d6..b98afbfe9 100644 --- a/src/thread/win32/SDL_systhread.c +++ b/src/thread/win32/SDL_systhread.c @@ -65,7 +65,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; @@ -99,7 +99,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) pfnSDL_CurrentEndThread pfnEndThread = _endthreadex; #endif #endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */ - unsigned threadid; + DWORD threadid = 0; pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms)); if (!pThreadParms) { SDL_OutOfMemory(); @@ -112,8 +112,9 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) pThreadParms->args = args; if (pfnBeginThread) { - thread->handle = (SYS_ThreadHandle) pfnBeginThread(NULL, 0, RunThread, - pThreadParms, 0, &threadid); + thread->handle = (SYS_ThreadHandle) + ((size_t) pfnBeginThread(NULL, 0, RunThread, + pThreadParms, 0, &threadid)); } else { thread->handle = CreateThread(NULL, 0, RunThread, pThreadParms, 0, &threadid); } diff --git a/src/video/windib/SDL_dibevents.c b/src/video/windib/SDL_dibevents.c index 0f030b460..43982d54d 100644 --- a/src/video/windib/SDL_dibevents.c +++ b/src/video/windib/SDL_dibevents.c @@ -655,7 +655,7 @@ int DIB_CreateWindow(_THIS) SDL_Window = (HWND)wcstol(windowid_t, NULL, 0); SDL_free(windowid_t); #else - SDL_Window = (HWND)SDL_strtoull(windowid, NULL, 0); + SDL_Window = (HWND)((size_t)SDL_strtoull(windowid, NULL, 0)); #endif if ( SDL_Window == NULL ) { SDL_SetError("Couldn't get user specified window");