From 590f74742c3404d7cf7de1d2dbba7ffe7e80a4e8 Mon Sep 17 00:00:00 2001 From: des Date: Wed, 29 Mar 2006 05:38:19 +0000 Subject: Bring libpthread up to WARNS level 2. Reviewed by: deischen --- lib/libpthread/Makefile | 2 +- lib/libpthread/thread/thr_getprio.c | 6 +++++- lib/libpthread/thread/thr_private.h | 16 ++++++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'lib/libpthread') diff --git a/lib/libpthread/Makefile b/lib/libpthread/Makefile index a30bccb..b2a0915 100644 --- a/lib/libpthread/Makefile +++ b/lib/libpthread/Makefile @@ -25,7 +25,7 @@ CFLAGS+=-fno-builtin # Uncomment this if you want libpthread to contain debug information for # thread locking. CFLAGS+=-D_LOCK_DEBUG -#CFLAGS+= -g +WARNS?=2 # Uncomment this if you want to build a 1:1 threading mode library # however it is no longer strictly conformed to POSIX diff --git a/lib/libpthread/thread/thr_getprio.c b/lib/libpthread/thread/thr_getprio.c index 07c1b0b..875c1b3 100644 --- a/lib/libpthread/thread/thr_getprio.c +++ b/lib/libpthread/thread/thr_getprio.c @@ -31,8 +31,12 @@ * * $FreeBSD$ */ + +#include "namespace.h" #include #include +#include "un-namespace.h" + #include "thr_private.h" LT10_COMPAT_PRIVATE(_pthread_getprio); @@ -46,7 +50,7 @@ _pthread_getprio(pthread_t pthread) int policy, ret; struct sched_param param; - if ((ret = pthread_getschedparam(pthread, &policy, ¶m)) == 0) + if ((ret = _pthread_getschedparam(pthread, &policy, ¶m)) == 0) ret = param.sched_priority; else { /* Invalid thread: */ diff --git a/lib/libpthread/thread/thr_private.h b/lib/libpthread/thread/thr_private.h index 9d58078..f839960 100644 --- a/lib/libpthread/thread/thr_private.h +++ b/lib/libpthread/thread/thr_private.h @@ -107,12 +107,16 @@ /* * Kernel fatal error handler macro. */ -#define PANIC(string) _thr_exit(__FILE__,__LINE__,string) +#define PANIC(string) _thr_exit(__FILE__, __LINE__, string) /* Output debug messages like this: */ -#define stdout_debug(args...) _thread_printf(STDOUT_FILENO, ##args) -#define stderr_debug(args...) _thread_printf(STDOUT_FILENO, ##args) +#ifdef STDOUT_FILENO +#define stdout_debug(...) _thread_printf(STDOUT_FILENO, __VA_ARGS__) +#endif +#ifdef STDERR_FILENO +#define stderr_debug(...) _thread_printf(STDERR_FILENO, __VA_ARGS__) +#endif #define DBG_MUTEX 0x0001 #define DBG_SIG 0x0002 @@ -449,7 +453,7 @@ struct pthread_spinlock { */ struct pthread_cleanup { struct pthread_cleanup *next; - void (*routine) (); + void (*routine) (void *); void *routine_arg; int onstack; }; @@ -486,7 +490,7 @@ struct pthread_attr { #define THR_SIGNAL_THREAD 0x200 /* This is a signal thread */ int flags; void *arg_attr; - void (*cleanup_attr) (); + void (*cleanup_attr) (void *); void *stackaddr_attr; size_t stacksize_attr; size_t guardsize_attr; @@ -1131,7 +1135,7 @@ kse_critical_t _kse_critical_enter(void); void _kse_critical_leave(kse_critical_t); int _kse_in_critical(void); void _kse_free(struct pthread *, struct kse *); -void _kse_init(); +void _kse_init(void); struct kse_group *_kseg_alloc(struct pthread *); void _kse_lock_wait(struct lock *, struct lockuser *lu); void _kse_lock_wakeup(struct lock *, struct lockuser *lu); -- cgit v1.1