summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>1999-12-28 18:13:04 +0000
committerdeischen <deischen@FreeBSD.org>1999-12-28 18:13:04 +0000
commit97c987240866817a96bf644288fc5f8aaeaf0f5a (patch)
tree9973ade3ef74b66254d4d072ab8fb57ee41212e4 /lib
parent9321f383a24bce8e6555df4e36441e9bfcff4a27 (diff)
downloadFreeBSD-src-97c987240866817a96bf644288fc5f8aaeaf0f5a.zip
FreeBSD-src-97c987240866817a96bf644288fc5f8aaeaf0f5a.tar.gz
-Wall and minor style(9) cleanups.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc_r/uthread/uthread_detach.c1
-rw-r--r--lib/libc_r/uthread/uthread_fork.c18
-rw-r--r--lib/libc_r/uthread/uthread_gc.c3
-rw-r--r--lib/libc_r/uthread/uthread_poll.c2
-rw-r--r--lib/libc_r/uthread/uthread_priority_queue.c2
-rw-r--r--lib/libc_r/uthread/uthread_setschedparam.c2
-rw-r--r--lib/libc_r/uthread/uthread_socketpair.c1
-rw-r--r--lib/libc_r/uthread/uthread_spec.c2
-rw-r--r--lib/libkse/thread/thr_detach.c1
-rw-r--r--lib/libkse/thread/thr_fork.c18
-rw-r--r--lib/libkse/thread/thr_poll.c2
-rw-r--r--lib/libkse/thread/thr_priority_queue.c2
-rw-r--r--lib/libkse/thread/thr_setschedparam.c2
-rw-r--r--lib/libkse/thread/thr_spec.c2
-rw-r--r--lib/libpthread/thread/thr_detach.c1
-rw-r--r--lib/libpthread/thread/thr_fork.c18
-rw-r--r--lib/libpthread/thread/thr_gc.c3
-rw-r--r--lib/libpthread/thread/thr_poll.c2
-rw-r--r--lib/libpthread/thread/thr_priority_queue.c2
-rw-r--r--lib/libpthread/thread/thr_setschedparam.c2
-rw-r--r--lib/libpthread/thread/thr_spec.c2
21 files changed, 42 insertions, 46 deletions
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 <errno.h>
#include <string.h>
+#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#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 <errno.h>
#include <time.h>
+#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/types.h>
@@ -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 <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <fcntl.h>
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 <errno.h>
#include <string.h>
+#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#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 <errno.h>
#include <string.h>
+#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#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 <errno.h>
#include <time.h>
+#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/types.h>
@@ -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 *);
OpenPOWER on IntegriCloud