Mercurial > sdl-ios-xcode
diff src/thread/win32/SDL_systhread.c @ 1668:4da1ee79c9af SDL-1.3
more tweaking indent options
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 29 May 2006 04:04:35 +0000 |
parents | 782fd950bd46 |
children |
line wrap: on
line diff
--- a/src/thread/win32/SDL_systhread.c Mon May 29 03:53:21 2006 +0000 +++ b/src/thread/win32/SDL_systhread.c Mon May 29 04:04:35 2006 +0000 @@ -63,12 +63,12 @@ *threadID); typedef void (__watcall * pfnSDL_CurrentEndThread) (unsigned code); #else -typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, - unsigned (__stdcall * - func) (void - *), - void *arg, unsigned, - unsigned *threadID); +typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall * + func) (void + *), + void *arg, unsigned, + unsigned *threadID); typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); #endif #endif /* !SDL_PASSED_BEGINTHREAD_ENDTHREAD */ @@ -81,18 +81,18 @@ } tThreadStartParms, *pThreadStartParms; static unsigned __stdcall -RunThread (void *data) +RunThread(void *data) { pThreadStartParms pThreadParms = (pThreadStartParms) data; pfnSDL_CurrentEndThread pfnCurrentEndThread = NULL; // Call the thread function! - SDL_RunThread (pThreadParms->args); + SDL_RunThread(pThreadParms->args); // Get the current endthread we have to use! if (pThreadParms) { pfnCurrentEndThread = pThreadParms->pfnCurrentEndThread; - SDL_free (pThreadParms); + SDL_free(pThreadParms); } // Call endthread! if (pfnCurrentEndThread) @@ -102,13 +102,13 @@ #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD int -SDL_SYS_CreateThread (SDL_Thread * thread, void *args, - pfnSDL_CurrentBeginThread pfnBeginThread, - pfnSDL_CurrentEndThread pfnEndThread) +SDL_SYS_CreateThread(SDL_Thread * thread, void *args, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread) { #else int -SDL_SYS_CreateThread (SDL_Thread * thread, void *args) +SDL_SYS_CreateThread(SDL_Thread * thread, void *args) { #ifdef _WIN32_WCE pfnSDL_CurrentBeginThread pfnBeginThread = NULL; @@ -120,9 +120,9 @@ #endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */ unsigned threadid; pThreadStartParms pThreadParms = - (pThreadStartParms) SDL_malloc (sizeof (tThreadStartParms)); + (pThreadStartParms) SDL_malloc(sizeof(tThreadStartParms)); if (!pThreadParms) { - SDL_OutOfMemory (); + SDL_OutOfMemory(); return (-1); } // Save the function which we will have to call to clear the RTL of calling app! @@ -132,36 +132,36 @@ if (pfnBeginThread) { thread->handle = - (SYS_ThreadHandle) pfnBeginThread (NULL, 0, RunThread, - pThreadParms, 0, &threadid); + (SYS_ThreadHandle) pfnBeginThread(NULL, 0, RunThread, + pThreadParms, 0, &threadid); } else { thread->handle = - CreateThread (NULL, 0, RunThread, pThreadParms, 0, &threadid); + CreateThread(NULL, 0, RunThread, pThreadParms, 0, &threadid); } if (thread->handle == NULL) { - SDL_SetError ("Not enough resources to create thread"); + SDL_SetError("Not enough resources to create thread"); return (-1); } return (0); } void -SDL_SYS_SetupThread (void) +SDL_SYS_SetupThread(void) { return; } Uint32 -SDL_ThreadID (void) +SDL_ThreadID(void) { - return ((Uint32) GetCurrentThreadId ()); + return ((Uint32) GetCurrentThreadId()); } void -SDL_SYS_WaitThread (SDL_Thread * thread) +SDL_SYS_WaitThread(SDL_Thread * thread) { - WaitForSingleObject (thread->handle, INFINITE); - CloseHandle (thread->handle); + WaitForSingleObject(thread->handle, INFINITE); + CloseHandle(thread->handle); } /* WARNING: This function is really a last resort. @@ -169,9 +169,9 @@ * TerminateThread() doesn't perform stack and DLL cleanup. */ void -SDL_SYS_KillThread (SDL_Thread * thread) +SDL_SYS_KillThread(SDL_Thread * thread) { - TerminateThread (thread->handle, FALSE); + TerminateThread(thread->handle, FALSE); } /* vi: set ts=4 sw=4 expandtab: */