diff options
author | EuAndreh <eu@euandre.org> | 2025-01-17 10:53:59 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-01-17 10:53:59 -0300 |
commit | 6339fc0f869fe275acdd70e47a4c64100cdcf28a (patch) | |
tree | d3fc0eaec22eaabee053979c9649b6043cde5702 /src | |
parent | src/trace.c: Replace thread_local with pthreads (diff) | |
download | pindaiba-6339fc0f869fe275acdd70e47a4c64100cdcf28a.tar.gz pindaiba-6339fc0f869fe275acdd70e47a4c64100cdcf28a.tar.xz |
src/trace.c: Add explicit cast for uintptr_t
Diffstat (limited to 'src')
-rw-r--r-- | src/trace.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/trace.c b/src/trace.c index d21a792..f4994c8 100644 --- a/src/trace.c +++ b/src/trace.c @@ -4,6 +4,7 @@ #include <errno.h> #include <pthread.h> #include <stdarg.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -44,7 +45,7 @@ vftracef( ) { assert(pthread_once(&ONCE, init) == 0); - const enum TraceLevel current_level = (enum TraceLevel)pthread_getspecific(LEVEL_KEY); + const enum TraceLevel current_level = (enum TraceLevel)(intptr_t)pthread_getspecific(LEVEL_KEY); if (level > current_level) { return; } @@ -104,5 +105,5 @@ int trace_set_level(const enum TraceLevel level) { assert(level >= TraceLevel_NONE); assert(level <= TraceLevel_DEBUG); - return pthread_setspecific(LEVEL_KEY, (void *)level); + return pthread_setspecific(LEVEL_KEY, (void *)(intptr_t)level); } |