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
Expand Up @@ -38,7 +38,7 @@ struct SDL_semaphore {
#else
HANDLE id;
#endif
Uint32 volatile count;
volatile LONG count;
};


Expand All @@ -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);
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions src/thread/win32/SDL_systhread.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/video/windib/SDL_dibevents.c
Expand Up @@ -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");
Expand Down

0 comments on commit 3e25bf3

Please sign in to comment.