Skip to content

Commit

Permalink
Fixed some compiler warnings on Cygwin.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 11, 2011
1 parent d9d8502 commit 3e25bf3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/thread/win32/SDL_syssem.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct SDL_semaphore {
#else #else
HANDLE id; HANDLE id;
#endif #endif
Uint32 volatile count; volatile LONG count;
}; };




Expand All @@ -56,7 +56,7 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
#else #else
sem->id = CreateSemaphore(NULL, initial_value, 32*1024, NULL); sem->id = CreateSemaphore(NULL, initial_value, 32*1024, NULL);
#endif #endif
sem->count = initial_value; sem->count = (LONG) initial_value;
if ( ! sem->id ) { if ( ! sem->id ) {
SDL_SetError("Couldn't create semaphore"); SDL_SetError("Couldn't create semaphore");
SDL_free(sem); SDL_free(sem);
Expand Down Expand Up @@ -136,7 +136,7 @@ Uint32 SDL_SemValue(SDL_sem *sem)
SDL_SetError("Passed a NULL sem"); SDL_SetError("Passed a NULL sem");
return 0; return 0;
} }
return sem->count; return (Uint32) sem->count;
} }


int SDL_SemPost(SDL_sem *sem) int SDL_SemPost(SDL_sem *sem)
Expand Down
9 changes: 5 additions & 4 deletions src/thread/win32/SDL_systhread.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef struct ThreadStartParms
pfnSDL_CurrentEndThread pfnCurrentEndThread; pfnSDL_CurrentEndThread pfnCurrentEndThread;
} tThreadStartParms, *pThreadStartParms; } tThreadStartParms, *pThreadStartParms;


static unsigned __stdcall RunThread(void *data) static DWORD WINAPI RunThread(LPVOID *data)
{ {
pThreadStartParms pThreadParms = (pThreadStartParms)data; pThreadStartParms pThreadParms = (pThreadStartParms)data;
pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL; pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL;
Expand Down Expand Up @@ -99,7 +99,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
pfnSDL_CurrentEndThread pfnEndThread = _endthreadex; pfnSDL_CurrentEndThread pfnEndThread = _endthreadex;
#endif #endif
#endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */ #endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */
unsigned threadid; DWORD threadid = 0;
pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms)); pThreadStartParms pThreadParms = (pThreadStartParms)SDL_malloc(sizeof(tThreadStartParms));
if (!pThreadParms) { if (!pThreadParms) {
SDL_OutOfMemory(); SDL_OutOfMemory();
Expand All @@ -112,8 +112,9 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
pThreadParms->args = args; pThreadParms->args = args;


if (pfnBeginThread) { if (pfnBeginThread) {
thread->handle = (SYS_ThreadHandle) pfnBeginThread(NULL, 0, RunThread, thread->handle = (SYS_ThreadHandle)
pThreadParms, 0, &threadid); ((size_t) pfnBeginThread(NULL, 0, RunThread,
pThreadParms, 0, &threadid));
} else { } else {
thread->handle = CreateThread(NULL, 0, RunThread, pThreadParms, 0, &threadid); thread->handle = CreateThread(NULL, 0, RunThread, pThreadParms, 0, &threadid);
} }
Expand Down
2 changes: 1 addition & 1 deletion src/video/windib/SDL_dibevents.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ int DIB_CreateWindow(_THIS)
SDL_Window = (HWND)wcstol(windowid_t, NULL, 0); SDL_Window = (HWND)wcstol(windowid_t, NULL, 0);
SDL_free(windowid_t); SDL_free(windowid_t);
#else #else
SDL_Window = (HWND)SDL_strtoull(windowid, NULL, 0); SDL_Window = (HWND)((size_t)SDL_strtoull(windowid, NULL, 0));
#endif #endif
if ( SDL_Window == NULL ) { if ( SDL_Window == NULL ) {
SDL_SetError("Couldn't get user specified window"); SDL_SetError("Couldn't get user specified window");
Expand Down

0 comments on commit 3e25bf3

Please sign in to comment.