-Wall and minor style(9) cleanups.
This commit is contained in:
parent
69186ed701
commit
1752e66d49
@ -40,7 +40,6 @@ int
|
||||
pthread_detach(pthread_t pthread)
|
||||
{
|
||||
int rval = 0;
|
||||
int status;
|
||||
pthread_t next_thread;
|
||||
|
||||
/* Check for invalid calling parameters: */
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -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 *);
|
||||
|
@ -40,7 +40,6 @@ int
|
||||
pthread_detach(pthread_t pthread)
|
||||
{
|
||||
int rval = 0;
|
||||
int status;
|
||||
pthread_t next_thread;
|
||||
|
||||
/* Check for invalid calling parameters: */
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 *);
|
||||
|
@ -40,7 +40,6 @@ int
|
||||
pthread_detach(pthread_t pthread)
|
||||
{
|
||||
int rval = 0;
|
||||
int status;
|
||||
pthread_t next_thread;
|
||||
|
||||
/* Check for invalid calling parameters: */
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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 *);
|
||||
|
Loading…
Reference in New Issue
Block a user