From 97c987240866817a96bf644288fc5f8aaeaf0f5a Mon Sep 17 00:00:00 2001 From: deischen Date: Tue, 28 Dec 1999 18:13:04 +0000 Subject: -Wall and minor style(9) cleanups. --- lib/libc_r/uthread/uthread_detach.c | 1 - lib/libc_r/uthread/uthread_fork.c | 18 +++++++++--------- lib/libc_r/uthread/uthread_gc.c | 3 +-- lib/libc_r/uthread/uthread_poll.c | 2 +- lib/libc_r/uthread/uthread_priority_queue.c | 2 +- lib/libc_r/uthread/uthread_setschedparam.c | 2 +- lib/libc_r/uthread/uthread_socketpair.c | 1 + lib/libc_r/uthread/uthread_spec.c | 2 +- lib/libkse/thread/thr_detach.c | 1 - lib/libkse/thread/thr_fork.c | 18 +++++++++--------- lib/libkse/thread/thr_poll.c | 2 +- lib/libkse/thread/thr_priority_queue.c | 2 +- lib/libkse/thread/thr_setschedparam.c | 2 +- lib/libkse/thread/thr_spec.c | 2 +- lib/libpthread/thread/thr_detach.c | 1 - lib/libpthread/thread/thr_fork.c | 18 +++++++++--------- lib/libpthread/thread/thr_gc.c | 3 +-- lib/libpthread/thread/thr_poll.c | 2 +- lib/libpthread/thread/thr_priority_queue.c | 2 +- lib/libpthread/thread/thr_setschedparam.c | 2 +- lib/libpthread/thread/thr_spec.c | 2 +- 21 files changed, 42 insertions(+), 46 deletions(-) (limited to 'lib') diff --git a/lib/libc_r/uthread/uthread_detach.c b/lib/libc_r/uthread/uthread_detach.c index 164c7df..89cc667 100644 --- a/lib/libc_r/uthread/uthread_detach.c +++ b/lib/libc_r/uthread/uthread_detach.c @@ -40,7 +40,6 @@ int pthread_detach(pthread_t pthread) { int rval = 0; - int status; pthread_t next_thread; /* Check for invalid calling parameters: */ diff --git a/lib/libc_r/uthread/uthread_fork.c b/lib/libc_r/uthread/uthread_fork.c index b8d72dc..08ea812 100644 --- a/lib/libc_r/uthread/uthread_fork.c +++ b/lib/libc_r/uthread/uthread_fork.c @@ -33,6 +33,7 @@ */ #include #include +#include #include #include #ifdef _THREAD_SAFE @@ -130,29 +131,28 @@ fork(void) pthread_save, tle); if (pthread_save->attr.stackaddr_attr == - NULL && pthread_save->stack != NULL) + NULL && pthread_save->stack != NULL) { if (pthread_save->attr.stacksize_attr == PTHREAD_STACK_DEFAULT) { /* - * Default-size stack. Cache - * it: + * Default-size stack. + * Cache it: */ struct stack *spare_stack; spare_stack = (pthread_save->stack - + PTHREAD_STACK_DEFAULT - - sizeof(struct stack)); - SLIST_INSERT_HEAD( - &_stackq, - spare_stack, - qe); + + PTHREAD_STACK_DEFAULT + - sizeof(struct stack)); + SLIST_INSERT_HEAD(&_stackq, + spare_stack, qe); } else /* * Free the stack of * the dead thread: */ free(pthread_save->stack); + } if (pthread_save->specific_data != NULL) free(pthread_save->specific_data); diff --git a/lib/libc_r/uthread/uthread_gc.c b/lib/libc_r/uthread/uthread_gc.c index d748049..a6ffd4b 100644 --- a/lib/libc_r/uthread/uthread_gc.c +++ b/lib/libc_r/uthread/uthread_gc.c @@ -36,6 +36,7 @@ */ #include #include +#include #include #include #include @@ -52,8 +53,6 @@ _thread_gc(pthread_addr_t arg) sigset_t mask; pthread_t pthread; pthread_t pthread_cln; - pthread_t pthread_nxt; - pthread_t pthread_prv; struct timespec abstime; void *p_stack; diff --git a/lib/libc_r/uthread/uthread_poll.c b/lib/libc_r/uthread/uthread_poll.c index 01916ad..10a9db7 100644 --- a/lib/libc_r/uthread/uthread_poll.c +++ b/lib/libc_r/uthread/uthread_poll.c @@ -48,7 +48,7 @@ poll(struct pollfd *fds, unsigned int nfds, int timeout) { struct timespec ts; int numfds = nfds; - int i, ret = 0, found = 0; + int i, ret = 0; struct pthread_poll_data data; if (numfds > _thread_dtablesize) { diff --git a/lib/libc_r/uthread/uthread_priority_queue.c b/lib/libc_r/uthread/uthread_priority_queue.c index 5bd8a8c..6fdf844 100644 --- a/lib/libc_r/uthread/uthread_priority_queue.c +++ b/lib/libc_r/uthread/uthread_priority_queue.c @@ -87,7 +87,7 @@ static int _pq_active = 0; int _pq_alloc(pq_queue_t *pq, int minprio, int maxprio) { - int i, ret = 0; + int ret = 0; int prioslots = maxprio - minprio + 1; if (pq == NULL) diff --git a/lib/libc_r/uthread/uthread_setschedparam.c b/lib/libc_r/uthread/uthread_setschedparam.c index 57e24e8..f080d5d 100644 --- a/lib/libc_r/uthread/uthread_setschedparam.c +++ b/lib/libc_r/uthread/uthread_setschedparam.c @@ -63,9 +63,9 @@ pthread_setschedparam(pthread_t pthread, int policy, * queue before any adjustments are made to its * active priority: */ + old_prio = pthread->active_priority; if ((pthread->flags & PTHREAD_FLAGS_IN_PRIOQ) != 0) { in_readyq = 1; - old_prio = pthread->active_priority; PTHREAD_PRIOQ_REMOVE(pthread); } diff --git a/lib/libc_r/uthread/uthread_socketpair.c b/lib/libc_r/uthread/uthread_socketpair.c index 8c21801..47386d3 100644 --- a/lib/libc_r/uthread/uthread_socketpair.c +++ b/lib/libc_r/uthread/uthread_socketpair.c @@ -32,6 +32,7 @@ * $FreeBSD$ * */ +#include #include #include #include diff --git a/lib/libc_r/uthread/uthread_spec.c b/lib/libc_r/uthread/uthread_spec.c index f1e9f5c..1485cbb 100644 --- a/lib/libc_r/uthread/uthread_spec.c +++ b/lib/libc_r/uthread/uthread_spec.c @@ -88,7 +88,7 @@ pthread_key_delete(pthread_key_t key) void _thread_cleanupspecific(void) { - void *data; + void *data = NULL; int key; int itr; void (*destructor)( void *); diff --git a/lib/libkse/thread/thr_detach.c b/lib/libkse/thread/thr_detach.c index 164c7df..89cc667 100644 --- a/lib/libkse/thread/thr_detach.c +++ b/lib/libkse/thread/thr_detach.c @@ -40,7 +40,6 @@ int pthread_detach(pthread_t pthread) { int rval = 0; - int status; pthread_t next_thread; /* Check for invalid calling parameters: */ diff --git a/lib/libkse/thread/thr_fork.c b/lib/libkse/thread/thr_fork.c index b8d72dc..08ea812 100644 --- a/lib/libkse/thread/thr_fork.c +++ b/lib/libkse/thread/thr_fork.c @@ -33,6 +33,7 @@ */ #include #include +#include #include #include #ifdef _THREAD_SAFE @@ -130,29 +131,28 @@ fork(void) pthread_save, tle); if (pthread_save->attr.stackaddr_attr == - NULL && pthread_save->stack != NULL) + NULL && pthread_save->stack != NULL) { if (pthread_save->attr.stacksize_attr == PTHREAD_STACK_DEFAULT) { /* - * Default-size stack. Cache - * it: + * Default-size stack. + * Cache it: */ struct stack *spare_stack; spare_stack = (pthread_save->stack - + PTHREAD_STACK_DEFAULT - - sizeof(struct stack)); - SLIST_INSERT_HEAD( - &_stackq, - spare_stack, - qe); + + PTHREAD_STACK_DEFAULT + - sizeof(struct stack)); + SLIST_INSERT_HEAD(&_stackq, + spare_stack, qe); } else /* * Free the stack of * the dead thread: */ free(pthread_save->stack); + } if (pthread_save->specific_data != NULL) free(pthread_save->specific_data); diff --git a/lib/libkse/thread/thr_poll.c b/lib/libkse/thread/thr_poll.c index 01916ad..10a9db7 100644 --- a/lib/libkse/thread/thr_poll.c +++ b/lib/libkse/thread/thr_poll.c @@ -48,7 +48,7 @@ poll(struct pollfd *fds, unsigned int nfds, int timeout) { struct timespec ts; int numfds = nfds; - int i, ret = 0, found = 0; + int i, ret = 0; struct pthread_poll_data data; if (numfds > _thread_dtablesize) { diff --git a/lib/libkse/thread/thr_priority_queue.c b/lib/libkse/thread/thr_priority_queue.c index 5bd8a8c..6fdf844 100644 --- a/lib/libkse/thread/thr_priority_queue.c +++ b/lib/libkse/thread/thr_priority_queue.c @@ -87,7 +87,7 @@ static int _pq_active = 0; int _pq_alloc(pq_queue_t *pq, int minprio, int maxprio) { - int i, ret = 0; + int ret = 0; int prioslots = maxprio - minprio + 1; if (pq == NULL) diff --git a/lib/libkse/thread/thr_setschedparam.c b/lib/libkse/thread/thr_setschedparam.c index 57e24e8..f080d5d 100644 --- a/lib/libkse/thread/thr_setschedparam.c +++ b/lib/libkse/thread/thr_setschedparam.c @@ -63,9 +63,9 @@ pthread_setschedparam(pthread_t pthread, int policy, * queue before any adjustments are made to its * active priority: */ + old_prio = pthread->active_priority; if ((pthread->flags & PTHREAD_FLAGS_IN_PRIOQ) != 0) { in_readyq = 1; - old_prio = pthread->active_priority; PTHREAD_PRIOQ_REMOVE(pthread); } diff --git a/lib/libkse/thread/thr_spec.c b/lib/libkse/thread/thr_spec.c index f1e9f5c..1485cbb 100644 --- a/lib/libkse/thread/thr_spec.c +++ b/lib/libkse/thread/thr_spec.c @@ -88,7 +88,7 @@ pthread_key_delete(pthread_key_t key) void _thread_cleanupspecific(void) { - void *data; + void *data = NULL; int key; int itr; void (*destructor)( void *); diff --git a/lib/libpthread/thread/thr_detach.c b/lib/libpthread/thread/thr_detach.c index 164c7df..89cc667 100644 --- a/lib/libpthread/thread/thr_detach.c +++ b/lib/libpthread/thread/thr_detach.c @@ -40,7 +40,6 @@ int pthread_detach(pthread_t pthread) { int rval = 0; - int status; pthread_t next_thread; /* Check for invalid calling parameters: */ diff --git a/lib/libpthread/thread/thr_fork.c b/lib/libpthread/thread/thr_fork.c index b8d72dc..08ea812 100644 --- a/lib/libpthread/thread/thr_fork.c +++ b/lib/libpthread/thread/thr_fork.c @@ -33,6 +33,7 @@ */ #include #include +#include #include #include #ifdef _THREAD_SAFE @@ -130,29 +131,28 @@ fork(void) pthread_save, tle); if (pthread_save->attr.stackaddr_attr == - NULL && pthread_save->stack != NULL) + NULL && pthread_save->stack != NULL) { if (pthread_save->attr.stacksize_attr == PTHREAD_STACK_DEFAULT) { /* - * Default-size stack. Cache - * it: + * Default-size stack. + * Cache it: */ struct stack *spare_stack; spare_stack = (pthread_save->stack - + PTHREAD_STACK_DEFAULT - - sizeof(struct stack)); - SLIST_INSERT_HEAD( - &_stackq, - spare_stack, - qe); + + PTHREAD_STACK_DEFAULT + - sizeof(struct stack)); + SLIST_INSERT_HEAD(&_stackq, + spare_stack, qe); } else /* * Free the stack of * the dead thread: */ free(pthread_save->stack); + } if (pthread_save->specific_data != NULL) free(pthread_save->specific_data); diff --git a/lib/libpthread/thread/thr_gc.c b/lib/libpthread/thread/thr_gc.c index d748049..a6ffd4b 100644 --- a/lib/libpthread/thread/thr_gc.c +++ b/lib/libpthread/thread/thr_gc.c @@ -36,6 +36,7 @@ */ #include #include +#include #include #include #include @@ -52,8 +53,6 @@ _thread_gc(pthread_addr_t arg) sigset_t mask; pthread_t pthread; pthread_t pthread_cln; - pthread_t pthread_nxt; - pthread_t pthread_prv; struct timespec abstime; void *p_stack; diff --git a/lib/libpthread/thread/thr_poll.c b/lib/libpthread/thread/thr_poll.c index 01916ad..10a9db7 100644 --- a/lib/libpthread/thread/thr_poll.c +++ b/lib/libpthread/thread/thr_poll.c @@ -48,7 +48,7 @@ poll(struct pollfd *fds, unsigned int nfds, int timeout) { struct timespec ts; int numfds = nfds; - int i, ret = 0, found = 0; + int i, ret = 0; struct pthread_poll_data data; if (numfds > _thread_dtablesize) { diff --git a/lib/libpthread/thread/thr_priority_queue.c b/lib/libpthread/thread/thr_priority_queue.c index 5bd8a8c..6fdf844 100644 --- a/lib/libpthread/thread/thr_priority_queue.c +++ b/lib/libpthread/thread/thr_priority_queue.c @@ -87,7 +87,7 @@ static int _pq_active = 0; int _pq_alloc(pq_queue_t *pq, int minprio, int maxprio) { - int i, ret = 0; + int ret = 0; int prioslots = maxprio - minprio + 1; if (pq == NULL) diff --git a/lib/libpthread/thread/thr_setschedparam.c b/lib/libpthread/thread/thr_setschedparam.c index 57e24e8..f080d5d 100644 --- a/lib/libpthread/thread/thr_setschedparam.c +++ b/lib/libpthread/thread/thr_setschedparam.c @@ -63,9 +63,9 @@ pthread_setschedparam(pthread_t pthread, int policy, * queue before any adjustments are made to its * active priority: */ + old_prio = pthread->active_priority; if ((pthread->flags & PTHREAD_FLAGS_IN_PRIOQ) != 0) { in_readyq = 1; - old_prio = pthread->active_priority; PTHREAD_PRIOQ_REMOVE(pthread); } diff --git a/lib/libpthread/thread/thr_spec.c b/lib/libpthread/thread/thr_spec.c index f1e9f5c..1485cbb 100644 --- a/lib/libpthread/thread/thr_spec.c +++ b/lib/libpthread/thread/thr_spec.c @@ -88,7 +88,7 @@ pthread_key_delete(pthread_key_t key) void _thread_cleanupspecific(void) { - void *data; + void *data = NULL; int key; int itr; void (*destructor)( void *); -- cgit v1.1