From: Cloudwalk Date: Fri, 30 Jul 2021 15:17:02 +0000 (-0400) Subject: sys: Rename Sys_Print(f)ToTerminal to Sys_Print(f) for consistency X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=b2a1a3ffa49a3f315f9f59aa011c5888ad4bea4b sys: Rename Sys_Print(f)ToTerminal to Sys_Print(f) for consistency --- diff --git a/cl_screen.c b/cl_screen.c index 50a9df41..44b493e4 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -1206,7 +1206,7 @@ static void SCR_CaptureVideo_VideoFrame(int newframestepframenum) double fps1 = (cls.capturevideo.frame - cls.capturevideo.lastfpsframe) / (t - cls.capturevideo.lastfpstime + 0.0000001); double fps = (cls.capturevideo.frame ) / (t - cls.capturevideo.starttime + 0.0000001); dpsnprintf(buf, sizeof(buf), "capturevideo: (%.1fs) last second %.3ffps, total %.3ffps\n", cls.capturevideo.frame / cls.capturevideo.framerate, fps1, fps); - Sys_PrintToTerminal(buf); + Sys_Print(buf); cls.capturevideo.lastfpstime = t; cls.capturevideo.lastfpsframe = cls.capturevideo.frame; } diff --git a/console.c b/console.c index e7e810e6..b0afdd4c 100644 --- a/console.c +++ b/console.c @@ -1361,11 +1361,11 @@ void Con_MaskPrint(int additionalmask, const char *msg) *out++ = 'm'; } *out++ = 0; - Sys_PrintToTerminal(printline); + Sys_Print(printline); } else if(sys_colortranslation.integer == 2) // Quake { - Sys_PrintToTerminal(line); + Sys_Print(line); } else // strip { @@ -1416,7 +1416,7 @@ void Con_MaskPrint(int additionalmask, const char *msg) } } *out++ = 0; - Sys_PrintToTerminal(printline); + Sys_Print(printline); } } // empty the line buffer @@ -1667,7 +1667,7 @@ static float Con_WordWidthFunc(void *passthrough, const char *w, size_t *length, return DrawQ_TextWidth(w, *length, ti->fontsize, ti->fontsize, false, ti->font); else { - Sys_PrintfToTerminal("Con_WordWidthFunc: can't get here (maxWidth should never be %f)\n", maxWidth); + Sys_Printf("Con_WordWidthFunc: can't get here (maxWidth should never be %f)\n", maxWidth); // Note: this is NOT a Con_Printf, as it could print recursively return 0; } diff --git a/sys.h b/sys.h index ea711f66..d9a9d335 100644 --- a/sys.h +++ b/sys.h @@ -209,8 +209,8 @@ char *Sys_TimeString(const char *timeformat); void Sys_Error (const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN; /// (may) output text to terminal which launched program -void Sys_PrintToTerminal(const char *text); -void Sys_PrintfToTerminal(const char *fmt, ...); +void Sys_Print(const char *text); +void Sys_Printf(const char *fmt, ...); /// INFO: This is only called by Host_Shutdown so we dont need testing for recursion void Sys_Shutdown (void); diff --git a/sys_sdl.c b/sys_sdl.c index 3f37a8e4..4a144414 100644 --- a/sys_sdl.c +++ b/sys_sdl.c @@ -70,7 +70,7 @@ void Sys_Error (const char *error, ...) exit (1); } -void Sys_PrintToTerminal(const char *text) +void Sys_Print(const char *text) { #ifdef __ANDROID__ if (developer.integer > 0) diff --git a/sys_shared.c b/sys_shared.c index 3c6b0356..39c9bf8b 100644 --- a/sys_shared.c +++ b/sys_shared.c @@ -504,11 +504,11 @@ void Sys_Sleep(int microseconds) if(sys_debugsleep.integer) { t = Sys_DirtyTime() - t; - Sys_PrintfToTerminal("%d %d # debugsleep\n", microseconds, (unsigned int)(t * 1000000)); + Sys_Printf("%d %d # debugsleep\n", microseconds, (unsigned int)(t * 1000000)); } } -void Sys_PrintfToTerminal(const char *fmt, ...) +void Sys_Printf(const char *fmt, ...) { va_list argptr; char msg[MAX_INPUTLINE]; @@ -517,7 +517,7 @@ void Sys_PrintfToTerminal(const char *fmt, ...) dpvsnprintf(msg,sizeof(msg),fmt,argptr); va_end(argptr); - Sys_PrintToTerminal(msg); + Sys_Print(msg); } #ifndef WIN32 diff --git a/sys_unix.c b/sys_unix.c index eccf986e..ff332a68 100644 --- a/sys_unix.c +++ b/sys_unix.c @@ -46,7 +46,7 @@ void Sys_Error (const char *error, ...) exit (1); } -void Sys_PrintToTerminal(const char *text) +void Sys_Print(const char *text) { if(sys.outfd < 0) return; diff --git a/sys_win.c b/sys_win.c index 8ae3bbe9..237670fc 100644 --- a/sys_win.c +++ b/sys_win.c @@ -112,7 +112,7 @@ void Sys_Shutdown (void) #endif } -void Sys_PrintToTerminal(const char *text) +void Sys_Print(const char *text) { DWORD dummy; extern HANDLE houtput; diff --git a/thread.h b/thread.h index 05b0f859..ac72b282 100644 --- a/thread.h +++ b/thread.h @@ -3,7 +3,7 @@ #include "qtypes.h" -// enable Sys_PrintfToTerminal calls on nearly every threading call +// enable Sys_Printf calls on nearly every threading call //#define THREADDEBUG //#define THREADDISABLE // use recursive mutex (non-posix) extensions in thread_pthread diff --git a/thread_pthread.c b/thread_pthread.c index 2f8273ab..bd96b101 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -28,7 +28,7 @@ void *_Thread_CreateMutex(const char *filename, int fileline) #endif pthread_mutex_t *mutexp = (pthread_mutex_t *) Z_Malloc(sizeof(pthread_mutex_t)); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex create %s:%i\n" , mutexp, filename, fileline); + Sys_Printf("%p mutex create %s:%i\n" , mutexp, filename, fileline); #endif #ifdef THREADRECURSIVE pthread_mutexattr_init(&attr); @@ -45,7 +45,7 @@ void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline) { pthread_mutex_t *mutexp = (pthread_mutex_t *) mutex; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex destroy %s:%i\n", mutex, filename, fileline); + Sys_Printf("%p mutex destroy %s:%i\n", mutex, filename, fileline); #endif pthread_mutex_destroy(mutexp); Z_Free(mutexp); @@ -55,7 +55,7 @@ int _Thread_LockMutex(void *mutex, const char *filename, int fileline) { pthread_mutex_t *mutexp = (pthread_mutex_t *) mutex; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex lock %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex lock %s:%i\n" , mutex, filename, fileline); #endif return pthread_mutex_lock(mutexp); } @@ -64,7 +64,7 @@ int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline) { pthread_mutex_t *mutexp = (pthread_mutex_t *) mutex; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex unlock %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex unlock %s:%i\n" , mutex, filename, fileline); #endif return pthread_mutex_unlock(mutexp); } @@ -74,7 +74,7 @@ void *_Thread_CreateCond(const char *filename, int fileline) pthread_cond_t *condp = (pthread_cond_t *) Z_Malloc(sizeof(pthread_cond_t)); pthread_cond_init(condp, NULL); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond create %s:%i\n" , condp, filename, fileline); + Sys_Printf("%p cond create %s:%i\n" , condp, filename, fileline); #endif return condp; } @@ -83,7 +83,7 @@ void _Thread_DestroyCond(void *cond, const char *filename, int fileline) { pthread_cond_t *condp = (pthread_cond_t *) cond; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond destroy %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond destroy %s:%i\n" , cond, filename, fileline); #endif pthread_cond_destroy(condp); Z_Free(condp); @@ -93,7 +93,7 @@ int _Thread_CondSignal(void *cond, const char *filename, int fileline) { pthread_cond_t *condp = (pthread_cond_t *) cond; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond signal %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond signal %s:%i\n" , cond, filename, fileline); #endif return pthread_cond_signal(condp); } @@ -102,7 +102,7 @@ int _Thread_CondBroadcast(void *cond, const char *filename, int fileline) { pthread_cond_t *condp = (pthread_cond_t *) cond; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond broadcast %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond broadcast %s:%i\n" , cond, filename, fileline); #endif return pthread_cond_broadcast(condp); } @@ -112,7 +112,7 @@ int _Thread_CondWait(void *cond, void *mutex, const char *filename, int fileline pthread_cond_t *condp = (pthread_cond_t *) cond; pthread_mutex_t *mutexp = (pthread_mutex_t *) mutex; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond wait %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond wait %s:%i\n" , cond, filename, fileline); #endif return pthread_cond_wait(condp, mutexp); } @@ -121,7 +121,7 @@ void *_Thread_CreateThread(int (*fn)(void *), void *data, const char *filename, { pthread_t *threadp = (pthread_t *) Z_Malloc(sizeof(pthread_t)); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p thread create %s:%i\n" , threadp, filename, fileline); + Sys_Printf("%p thread create %s:%i\n" , threadp, filename, fileline); #endif int r = pthread_create(threadp, NULL, (void * (*) (void *)) fn, data); if(r) @@ -137,7 +137,7 @@ int _Thread_WaitThread(void *thread, int retval, const char *filename, int filel pthread_t *threadp = (pthread_t *) thread; void *status = (void *) (intptr_t) retval; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p thread wait %s:%i\n" , thread, filename, fileline); + Sys_Printf("%p thread wait %s:%i\n" , thread, filename, fileline); #endif pthread_join(*threadp, &status); Z_Free(threadp); @@ -149,7 +149,7 @@ void *_Thread_CreateBarrier(unsigned int count, const char *filename, int fileli { pthread_barrier_t *b = (pthread_barrier_t *) Z_Malloc(sizeof(pthread_barrier_t)); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); + Sys_Printf("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); #endif pthread_barrier_init(b, NULL, count); return (void *) b; @@ -159,7 +159,7 @@ void _Thread_DestroyBarrier(void *barrier, const char *filename, int fileline) { pthread_barrier_t *b = (pthread_barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier destroy %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier destroy %s:%i\n", b, filename, fileline); #endif pthread_barrier_destroy(b); } @@ -168,7 +168,7 @@ void _Thread_WaitBarrier(void *barrier, const char *filename, int fileline) { pthread_barrier_t *b = (pthread_barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier wait %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier wait %s:%i\n", b, filename, fileline); #endif pthread_barrier_wait(b); } @@ -186,7 +186,7 @@ void *_Thread_CreateBarrier(unsigned int count, const char *filename, int fileli { volatile barrier_t *b = (volatile barrier_t *) Z_Malloc(sizeof(barrier_t)); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); + Sys_Printf("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); #endif b->needed = count; b->called = 0; @@ -199,7 +199,7 @@ void _Thread_DestroyBarrier(void *barrier, const char *filename, int fileline) { volatile barrier_t *b = (volatile barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier destroy %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier destroy %s:%i\n", b, filename, fileline); #endif Thread_DestroyMutex(b->mutex); Thread_DestroyCond(b->cond); @@ -209,7 +209,7 @@ void _Thread_WaitBarrier(void *barrier, const char *filename, int fileline) { volatile barrier_t *b = (volatile barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier wait %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier wait %s:%i\n", b, filename, fileline); #endif Thread_LockMutex(b->mutex); b->called++; diff --git a/thread_sdl.c b/thread_sdl.c index 3ce56c89..8e0f49b7 100644 --- a/thread_sdl.c +++ b/thread_sdl.c @@ -28,7 +28,7 @@ void *_Thread_CreateMutex(const char *filename, int fileline) { void *mutex = SDL_CreateMutex(); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex create %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex create %s:%i\n" , mutex, filename, fileline); #endif return mutex; } @@ -36,7 +36,7 @@ void *_Thread_CreateMutex(const char *filename, int fileline) void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex destroy %s:%i\n", mutex, filename, fileline); + Sys_Printf("%p mutex destroy %s:%i\n", mutex, filename, fileline); #endif SDL_DestroyMutex((SDL_mutex *)mutex); } @@ -44,7 +44,7 @@ void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline) int _Thread_LockMutex(void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex lock %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex lock %s:%i\n" , mutex, filename, fileline); #endif return SDL_LockMutex((SDL_mutex *)mutex); } @@ -52,7 +52,7 @@ int _Thread_LockMutex(void *mutex, const char *filename, int fileline) int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex unlock %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex unlock %s:%i\n" , mutex, filename, fileline); #endif return SDL_UnlockMutex((SDL_mutex *)mutex); } @@ -61,7 +61,7 @@ void *_Thread_CreateCond(const char *filename, int fileline) { void *cond = (void *)SDL_CreateCond(); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond create %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond create %s:%i\n" , cond, filename, fileline); #endif return cond; } @@ -69,7 +69,7 @@ void *_Thread_CreateCond(const char *filename, int fileline) void _Thread_DestroyCond(void *cond, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond destroy %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond destroy %s:%i\n" , cond, filename, fileline); #endif SDL_DestroyCond((SDL_cond *)cond); } @@ -77,7 +77,7 @@ void _Thread_DestroyCond(void *cond, const char *filename, int fileline) int _Thread_CondSignal(void *cond, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond signal %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond signal %s:%i\n" , cond, filename, fileline); #endif return SDL_CondSignal((SDL_cond *)cond); } @@ -85,7 +85,7 @@ int _Thread_CondSignal(void *cond, const char *filename, int fileline) int _Thread_CondBroadcast(void *cond, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond broadcast %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond broadcast %s:%i\n" , cond, filename, fileline); #endif return SDL_CondBroadcast((SDL_cond *)cond); } @@ -93,7 +93,7 @@ int _Thread_CondBroadcast(void *cond, const char *filename, int fileline) int _Thread_CondWait(void *cond, void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond wait %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond wait %s:%i\n" , cond, filename, fileline); #endif return SDL_CondWait((SDL_cond *)cond, (SDL_mutex *)mutex); } @@ -102,7 +102,7 @@ void *_Thread_CreateThread(int (*fn)(void *), void *data, const char *filename, { void *thread = (void *)SDL_CreateThread(fn, filename, data); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p thread create %s:%i\n" , thread, filename, fileline); + Sys_Printf("%p thread create %s:%i\n" , thread, filename, fileline); #endif return thread; } @@ -111,7 +111,7 @@ int _Thread_WaitThread(void *thread, int retval, const char *filename, int filel { int status = retval; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p thread wait %s:%i\n" , thread, filename, fileline); + Sys_Printf("%p thread wait %s:%i\n" , thread, filename, fileline); #endif SDL_WaitThread((SDL_Thread *)thread, &status); return status; @@ -130,7 +130,7 @@ void *_Thread_CreateBarrier(unsigned int count, const char *filename, int fileli { volatile barrier_t *b = (volatile barrier_t *) Z_Malloc(sizeof(barrier_t)); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); + Sys_Printf("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); #endif b->needed = count; b->called = 0; @@ -143,7 +143,7 @@ void _Thread_DestroyBarrier(void *barrier, const char *filename, int fileline) { volatile barrier_t *b = (volatile barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier destroy %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier destroy %s:%i\n", b, filename, fileline); #endif Thread_DestroyMutex(b->mutex); Thread_DestroyCond(b->cond); @@ -153,7 +153,7 @@ void _Thread_WaitBarrier(void *barrier, const char *filename, int fileline) { volatile barrier_t *b = (volatile barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier wait %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier wait %s:%i\n", b, filename, fileline); #endif Thread_LockMutex(b->mutex); b->called++; @@ -171,7 +171,7 @@ void _Thread_WaitBarrier(void *barrier, const char *filename, int fileline) int _Thread_AtomicGet(Thread_Atomic *a, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p atomic get at %s:%i\n", a, filename, fileline); + Sys_Printf("%p atomic get at %s:%i\n", a, filename, fileline); #endif return SDL_AtomicGet((SDL_atomic_t *)a); } @@ -179,7 +179,7 @@ int _Thread_AtomicGet(Thread_Atomic *a, const char *filename, int fileline) int _Thread_AtomicSet(Thread_Atomic *a, int v, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p atomic set %v at %s:%i\n", a, v, filename, fileline); + Sys_Printf("%p atomic set %v at %s:%i\n", a, v, filename, fileline); #endif return SDL_AtomicSet((SDL_atomic_t *)a, v); } @@ -187,7 +187,7 @@ int _Thread_AtomicSet(Thread_Atomic *a, int v, const char *filename, int filelin int _Thread_AtomicAdd(Thread_Atomic *a, int v, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p atomic add %v at %s:%i\n", a, v, filename, fileline); + Sys_Printf("%p atomic add %v at %s:%i\n", a, v, filename, fileline); #endif return SDL_AtomicAdd((SDL_atomic_t *)a, v); } @@ -195,7 +195,7 @@ int _Thread_AtomicAdd(Thread_Atomic *a, int v, const char *filename, int filelin void _Thread_AtomicIncRef(Thread_Atomic *a, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p atomic incref %s:%i\n", a, filename, fileline); + Sys_Printf("%p atomic incref %s:%i\n", a, filename, fileline); #endif SDL_AtomicIncRef((SDL_atomic_t *)a); } @@ -203,7 +203,7 @@ void _Thread_AtomicIncRef(Thread_Atomic *a, const char *filename, int fileline) qbool _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p atomic decref %s:%i\n", a, filename, fileline); + Sys_Printf("%p atomic decref %s:%i\n", a, filename, fileline); #endif return SDL_AtomicDecRef((SDL_atomic_t *)a) != SDL_FALSE; } @@ -211,7 +211,7 @@ qbool _Thread_AtomicDecRef(Thread_Atomic *a, const char *filename, int fileline) qbool _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p atomic try lock %s:%i\n", lock, filename, fileline); + Sys_Printf("%p atomic try lock %s:%i\n", lock, filename, fileline); #endif return SDL_AtomicTryLock(lock) != SDL_FALSE; } @@ -219,7 +219,7 @@ qbool _Thread_AtomicTryLock(Thread_SpinLock *lock, const char *filename, int fil void _Thread_AtomicLock(Thread_SpinLock *lock, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p atomic lock %s:%i\n", lock, filename, fileline); + Sys_Printf("%p atomic lock %s:%i\n", lock, filename, fileline); #endif SDL_AtomicLock(lock); } @@ -227,7 +227,7 @@ void _Thread_AtomicLock(Thread_SpinLock *lock, const char *filename, int filelin void _Thread_AtomicUnlock(Thread_SpinLock *lock, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p atomic unlock %s:%i\n", lock, filename, fileline); + Sys_Printf("%p atomic unlock %s:%i\n", lock, filename, fileline); #endif SDL_AtomicUnlock(lock); } diff --git a/thread_win.c b/thread_win.c index fa282f4d..1cfad9a4 100644 --- a/thread_win.c +++ b/thread_win.c @@ -27,7 +27,7 @@ void *_Thread_CreateMutex(const char *filename, int fileline) { void *mutex = (void *)CreateMutex(NULL, FALSE, NULL); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex create %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex create %s:%i\n" , mutex, filename, fileline); #endif return mutex; } @@ -35,7 +35,7 @@ void *_Thread_CreateMutex(const char *filename, int fileline) void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex destroy %s:%i\n", mutex, filename, fileline); + Sys_Printf("%p mutex destroy %s:%i\n", mutex, filename, fileline); #endif CloseHandle(mutex); } @@ -43,7 +43,7 @@ void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline) int _Thread_LockMutex(void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex lock %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex lock %s:%i\n" , mutex, filename, fileline); #endif return (WaitForSingleObject(mutex, INFINITE) == WAIT_FAILED) ? -1 : 0; } @@ -51,7 +51,7 @@ int _Thread_LockMutex(void *mutex, const char *filename, int fileline) int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline) { #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p mutex unlock %s:%i\n" , mutex, filename, fileline); + Sys_Printf("%p mutex unlock %s:%i\n" , mutex, filename, fileline); #endif return (ReleaseMutex(mutex) == false) ? -1 : 0; } @@ -118,7 +118,7 @@ void *_Thread_CreateCond(const char *filename, int fileline) c->waiting = 0; c->signals = 0; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond create %s:%i\n" , c, filename, fileline); + Sys_Printf("%p cond create %s:%i\n" , c, filename, fileline); #endif return c; } @@ -127,7 +127,7 @@ void _Thread_DestroyCond(void *cond, const char *filename, int fileline) { thread_cond_t *c = (thread_cond_t *)cond; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond destroy %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond destroy %s:%i\n" , cond, filename, fileline); #endif Thread_DestroySemaphore(c->sem); Thread_DestroySemaphore(c->done); @@ -139,7 +139,7 @@ int _Thread_CondSignal(void *cond, const char *filename, int fileline) thread_cond_t *c = (thread_cond_t *)cond; int n; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond signal %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond signal %s:%i\n" , cond, filename, fileline); #endif WaitForSingleObject(c->mutex, INFINITE); n = c->waiting - c->signals; @@ -160,7 +160,7 @@ int _Thread_CondBroadcast(void *cond, const char *filename, int fileline) int i = 0; int n = 0; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond broadcast %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond broadcast %s:%i\n" , cond, filename, fileline); #endif WaitForSingleObject(c->mutex, INFINITE); n = c->waiting - c->signals; @@ -181,7 +181,7 @@ int _Thread_CondWait(void *cond, void *mutex, const char *filename, int fileline thread_cond_t *c = (thread_cond_t *)cond; int waitresult; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p cond wait %s:%i\n" , cond, filename, fileline); + Sys_Printf("%p cond wait %s:%i\n" , cond, filename, fileline); #endif WaitForSingleObject(c->mutex, INFINITE); @@ -228,7 +228,7 @@ void *_Thread_CreateThread(int (*fn)(void *), void *data, const char *filename, { threadwrapper_t *w = (threadwrapper_t *)calloc(sizeof(*w), 1); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p thread create %s:%i\n" , w, filename, fileline); + Sys_Printf("%p thread create %s:%i\n" , w, filename, fileline); #endif w->fn = fn; w->data = data; @@ -242,7 +242,7 @@ int _Thread_WaitThread(void *d, int retval, const char *filename, int fileline) { threadwrapper_t *w = (threadwrapper_t *)d; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p thread wait %s:%i\n" , w, filename, fileline); + Sys_Printf("%p thread wait %s:%i\n" , w, filename, fileline); #endif WaitForSingleObject(w->handle, INFINITE); CloseHandle(w->handle); @@ -264,7 +264,7 @@ void *_Thread_CreateBarrier(unsigned int count, const char *filename, int fileli { volatile barrier_t *b = (volatile barrier_t *) Z_Malloc(sizeof(barrier_t)); #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); + Sys_Printf("%p barrier create(%d) %s:%i\n", b, count, filename, fileline); #endif b->needed = count; b->called = 0; @@ -277,7 +277,7 @@ void _Thread_DestroyBarrier(void *barrier, const char *filename, int fileline) { volatile barrier_t *b = (volatile barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier destroy %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier destroy %s:%i\n", b, filename, fileline); #endif Thread_DestroyMutex(b->mutex); Thread_DestroyCond(b->cond); @@ -287,7 +287,7 @@ void _Thread_WaitBarrier(void *barrier, const char *filename, int fileline) { volatile barrier_t *b = (volatile barrier_t *) barrier; #ifdef THREADDEBUG - Sys_PrintfToTerminal("%p barrier wait %s:%i\n", b, filename, fileline); + Sys_Printf("%p barrier wait %s:%i\n", b, filename, fileline); #endif Thread_LockMutex(b->mutex); b->called++;