diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-03-28 01:19:22 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-03-28 01:19:22 +0200 |
commit | 4b90d3f6146154638ffbe227da48e9af0dd2a803 (patch) | |
tree | 7e034f416b4b7e95a76b99418df21e64e795e22a /sysdeps/generic | |
parent | b1f57fa0cf5515263bebcefe1044995ebaf9a1f3 (diff) |
Fix coding style
Diffstat (limited to 'sysdeps/generic')
68 files changed, 165 insertions, 205 deletions
diff --git a/sysdeps/generic/pt-atfork.c b/sysdeps/generic/pt-atfork.c index d1f3086..036427d 100644 --- a/sysdeps/generic/pt-atfork.c +++ b/sysdeps/generic/pt-atfork.c @@ -21,13 +21,13 @@ #include <fork.h> /* This is defined by newer gcc version unique for each module. */ -extern void *__dso_handle __attribute__ ((__weak__, - __visibility__ ("hidden"))); +extern void *__dso_handle __attribute__ ((__weak__, __visibility__ ("hidden"))); int pthread_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)) { - return __register_atfork (prepare, parent, child, &__dso_handle == NULL ? NULL : __dso_handle); + return __register_atfork (prepare, parent, child, + &__dso_handle == NULL ? NULL : __dso_handle); } diff --git a/sysdeps/generic/pt-attr-getdetachstate.c b/sysdeps/generic/pt-attr-getdetachstate.c index 91cd43e..5520305 100644 --- a/sysdeps/generic/pt-attr-getdetachstate.c +++ b/sysdeps/generic/pt-attr-getdetachstate.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -__pthread_attr_getdetachstate (const pthread_attr_t *attr, - int *detachstate) +__pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) { *detachstate = attr->__detachstate; return 0; diff --git a/sysdeps/generic/pt-attr-getguardsize.c b/sysdeps/generic/pt-attr-getguardsize.c index c6f8016..38c4f78 100644 --- a/sysdeps/generic/pt-attr-getguardsize.c +++ b/sysdeps/generic/pt-attr-getguardsize.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_attr_getguardsize (const pthread_attr_t *attr, - size_t *guardsize) +pthread_attr_getguardsize (const pthread_attr_t *attr, size_t * guardsize) { *guardsize = attr->__guardsize; return 0; diff --git a/sysdeps/generic/pt-attr-getinheritsched.c b/sysdeps/generic/pt-attr-getinheritsched.c index 2157cd7..1187dfa 100644 --- a/sysdeps/generic/pt-attr-getinheritsched.c +++ b/sysdeps/generic/pt-attr-getinheritsched.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -__pthread_attr_getinheritsched (const pthread_attr_t *attr, - int *inheritsched) +__pthread_attr_getinheritsched (const pthread_attr_t *attr, int *inheritsched) { *inheritsched = attr->__inheritsched; return 0; diff --git a/sysdeps/generic/pt-attr-getschedparam.c b/sysdeps/generic/pt-attr-getschedparam.c index b1b81d9..cd86d61 100644 --- a/sysdeps/generic/pt-attr-getschedparam.c +++ b/sysdeps/generic/pt-attr-getschedparam.c @@ -24,7 +24,7 @@ int __pthread_attr_getschedparam (const pthread_attr_t *attr, - struct sched_param *param) + struct sched_param *param) { memcpy (param, &attr->__schedparam, sizeof *param); return 0; diff --git a/sysdeps/generic/pt-attr-getschedpolicy.c b/sysdeps/generic/pt-attr-getschedpolicy.c index 88f448f..49e1fed 100644 --- a/sysdeps/generic/pt-attr-getschedpolicy.c +++ b/sysdeps/generic/pt-attr-getschedpolicy.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -__pthread_attr_getschedpolicy (const pthread_attr_t *attr, - int *policy) +__pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *policy) { *policy = attr->__schedpolicy; return 0; diff --git a/sysdeps/generic/pt-attr-getscope.c b/sysdeps/generic/pt-attr-getscope.c index 4b013d2..a48ec6d 100644 --- a/sysdeps/generic/pt-attr-getscope.c +++ b/sysdeps/generic/pt-attr-getscope.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -__pthread_attr_getscope (const pthread_attr_t *attr, - int *contentionscope) +__pthread_attr_getscope (const pthread_attr_t *attr, int *contentionscope) { *contentionscope = attr->__contentionscope; return 0; diff --git a/sysdeps/generic/pt-attr-getstack.c b/sysdeps/generic/pt-attr-getstack.c index eaa7b6a..4367c2f 100644 --- a/sysdeps/generic/pt-attr-getstack.c +++ b/sysdeps/generic/pt-attr-getstack.c @@ -21,8 +21,7 @@ int __pthread_attr_getstack (const pthread_attr_t *attr, - void **stackaddr, - size_t *stacksize) + void **stackaddr, size_t * stacksize) { pthread_attr_getstackaddr (attr, stackaddr); pthread_attr_getstacksize (attr, stacksize); diff --git a/sysdeps/generic/pt-attr-getstackaddr.c b/sysdeps/generic/pt-attr-getstackaddr.c index 6dc86c4..a043d78 100644 --- a/sysdeps/generic/pt-attr-getstackaddr.c +++ b/sysdeps/generic/pt-attr-getstackaddr.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_attr_getstackaddr (const pthread_attr_t *attr, - void **stackaddr) +pthread_attr_getstackaddr (const pthread_attr_t *attr, void **stackaddr) { *stackaddr = attr->__stackaddr; return 0; diff --git a/sysdeps/generic/pt-attr-getstacksize.c b/sysdeps/generic/pt-attr-getstacksize.c index 484076e..59c9c64 100644 --- a/sysdeps/generic/pt-attr-getstacksize.c +++ b/sysdeps/generic/pt-attr-getstacksize.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_attr_getstacksize (const pthread_attr_t *attr, - size_t *stacksize) +pthread_attr_getstacksize (const pthread_attr_t *attr, size_t * stacksize) { *stacksize = attr->__stacksize; return 0; diff --git a/sysdeps/generic/pt-attr-setdetachstate.c b/sysdeps/generic/pt-attr-setdetachstate.c index 5380d16..4907f4b 100644 --- a/sysdeps/generic/pt-attr-setdetachstate.c +++ b/sysdeps/generic/pt-attr-setdetachstate.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -__pthread_attr_setdetachstate (pthread_attr_t *attr, - int detachstate) +__pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) { switch (detachstate) { diff --git a/sysdeps/generic/pt-attr-setguardsize.c b/sysdeps/generic/pt-attr-setguardsize.c index 63513fa..97f9d3b 100644 --- a/sysdeps/generic/pt-attr-setguardsize.c +++ b/sysdeps/generic/pt-attr-setguardsize.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_attr_setguardsize (pthread_attr_t *attr, - size_t guardsize) +pthread_attr_setguardsize (pthread_attr_t *attr, size_t guardsize) { attr->__guardsize = guardsize; return 0; diff --git a/sysdeps/generic/pt-attr-setinheritsched.c b/sysdeps/generic/pt-attr-setinheritsched.c index b04cbf9..abbb9cb 100644 --- a/sysdeps/generic/pt-attr-setinheritsched.c +++ b/sysdeps/generic/pt-attr-setinheritsched.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -__pthread_attr_setinheritsched (pthread_attr_t *attr, - int inheritsched) +__pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched) { switch (inheritsched) { diff --git a/sysdeps/generic/pt-attr-setschedparam.c b/sysdeps/generic/pt-attr-setschedparam.c index 356f83b..c382f55 100644 --- a/sysdeps/generic/pt-attr-setschedparam.c +++ b/sysdeps/generic/pt-attr-setschedparam.c @@ -24,10 +24,9 @@ int __pthread_attr_setschedparam (pthread_attr_t *attr, - const struct sched_param *param) + const struct sched_param *param) { - if (memcmp (param, &__pthread_default_attr.__schedparam, - sizeof *param) == 0) + if (memcmp (param, &__pthread_default_attr.__schedparam, sizeof *param) == 0) { memcpy (&attr->__schedparam, param, sizeof *param); return 0; diff --git a/sysdeps/generic/pt-attr-setschedpolicy.c b/sysdeps/generic/pt-attr-setschedpolicy.c index e70e348..411fc0b 100644 --- a/sysdeps/generic/pt-attr-setschedpolicy.c +++ b/sysdeps/generic/pt-attr-setschedpolicy.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -__pthread_attr_setschedpolicy (pthread_attr_t *attr, - int policy) +__pthread_attr_setschedpolicy (pthread_attr_t *attr, int policy) { switch (policy) { diff --git a/sysdeps/generic/pt-attr-setscope.c b/sysdeps/generic/pt-attr-setscope.c index 34de408..4e20d24 100644 --- a/sysdeps/generic/pt-attr-setscope.c +++ b/sysdeps/generic/pt-attr-setscope.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -__pthread_attr_setscope (pthread_attr_t *attr, - int contentionscope) +__pthread_attr_setscope (pthread_attr_t *attr, int contentionscope) { if (contentionscope == __pthread_default_attr.__contentionscope) { diff --git a/sysdeps/generic/pt-attr-setstack.c b/sysdeps/generic/pt-attr-setstack.c index 61bc3c0..e538283 100644 --- a/sysdeps/generic/pt-attr-setstack.c +++ b/sysdeps/generic/pt-attr-setstack.c @@ -22,9 +22,7 @@ #include <pt-internal.h> int -pthread_attr_setstack (pthread_attr_t *attr, - void *stackaddr, - size_t stacksize) +pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, size_t stacksize) { int err; size_t s; diff --git a/sysdeps/generic/pt-attr-setstackaddr.c b/sysdeps/generic/pt-attr-setstackaddr.c index ac37d97..e3ca583 100644 --- a/sysdeps/generic/pt-attr-setstackaddr.c +++ b/sysdeps/generic/pt-attr-setstackaddr.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_attr_setstackaddr (pthread_attr_t *attr, - void *stackaddr) +pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr) { attr->__stackaddr = stackaddr; return 0; diff --git a/sysdeps/generic/pt-attr-setstacksize.c b/sysdeps/generic/pt-attr-setstacksize.c index ba6f2eb..547bf67 100644 --- a/sysdeps/generic/pt-attr-setstacksize.c +++ b/sysdeps/generic/pt-attr-setstacksize.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_attr_setstacksize (pthread_attr_t *attr, - size_t stacksize) +pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) { attr->__stacksize = stacksize; diff --git a/sysdeps/generic/pt-attr.c b/sysdeps/generic/pt-attr.c index 5a56f7f..f1877fd 100644 --- a/sysdeps/generic/pt-attr.c +++ b/sysdeps/generic/pt-attr.c @@ -23,8 +23,7 @@ #include <pt-internal.h> -const struct __pthread_attr __pthread_default_attr = -{ +const struct __pthread_attr __pthread_default_attr = { __schedparam: { sched_priority: 0 }, __stacksize: 0, __stackaddr: NULL, diff --git a/sysdeps/generic/pt-barrier-init.c b/sysdeps/generic/pt-barrier-init.c index 8940779..a3a2c68 100644 --- a/sysdeps/generic/pt-barrier-init.c +++ b/sysdeps/generic/pt-barrier-init.c @@ -24,8 +24,7 @@ int pthread_barrier_init (pthread_barrier_t *barrier, - const pthread_barrierattr_t *attr, - unsigned count) + const pthread_barrierattr_t *attr, unsigned count) { if (count == 0) return EINVAL; @@ -36,7 +35,7 @@ pthread_barrier_init (pthread_barrier_t *barrier, barrier->__pending = count; barrier->__count = count; - if (! attr + if (!attr || memcmp (attr, &__pthread_default_barrierattr, sizeof (*attr) == 0)) /* Use the default attributes. */ return 0; @@ -44,7 +43,7 @@ pthread_barrier_init (pthread_barrier_t *barrier, /* Non-default attributes. */ barrier->__attr = malloc (sizeof *attr); - if (! barrier->__attr) + if (!barrier->__attr) return ENOMEM; *barrier->__attr = *attr; diff --git a/sysdeps/generic/pt-barrier-wait.c b/sysdeps/generic/pt-barrier-wait.c index 5c01349..faac1f9 100644 --- a/sysdeps/generic/pt-barrier-wait.c +++ b/sysdeps/generic/pt-barrier-wait.c @@ -25,7 +25,7 @@ int pthread_barrier_wait (pthread_barrier_t *barrier) { __pthread_spin_lock (&barrier->__lock); - if (-- barrier->__pending == 0) + if (--barrier->__pending == 0) { barrier->__pending = barrier->__count; @@ -35,19 +35,19 @@ pthread_barrier_wait (pthread_barrier_t *barrier) unsigned n = 0; __pthread_queue_iterate (barrier->__queue, wakeup) - n ++; + n++; { struct __pthread *wakeups[n]; unsigned i = 0; __pthread_dequeuing_iterate (barrier->__queue, wakeup) - wakeups[i ++] = wakeup; + wakeups[i++] = wakeup; barrier->__queue = NULL; __pthread_spin_unlock (&barrier->__lock); - for (i = 0; i < n; i ++) + for (i = 0; i < n; i++) __pthread_wakeup (wakeups[i]); } } diff --git a/sysdeps/generic/pt-barrier.c b/sysdeps/generic/pt-barrier.c index 846887d..0990ce9 100644 --- a/sysdeps/generic/pt-barrier.c +++ b/sysdeps/generic/pt-barrier.c @@ -19,7 +19,6 @@ #include <pthread.h> #include <pt-internal.h> -const struct __pthread_barrierattr __pthread_default_barrierattr = -{ +const struct __pthread_barrierattr __pthread_default_barrierattr = { __pshared: PTHREAD_PROCESS_PRIVATE }; diff --git a/sysdeps/generic/pt-barrierattr-setpshared.c b/sysdeps/generic/pt-barrierattr-setpshared.c index dced161..52a5040 100644 --- a/sysdeps/generic/pt-barrierattr-setpshared.c +++ b/sysdeps/generic/pt-barrierattr-setpshared.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, - int pshared) +pthread_barrierattr_setpshared (pthread_barrierattr_t *attr, int pshared) { switch (pshared) { diff --git a/sysdeps/generic/pt-cond-brdcast.c b/sysdeps/generic/pt-cond-brdcast.c index 8cadc95..fc1d653 100644 --- a/sysdeps/generic/pt-cond-brdcast.c +++ b/sysdeps/generic/pt-cond-brdcast.c @@ -32,7 +32,7 @@ __pthread_cond_broadcast (pthread_cond_t *cond) __pthread_dequeue (wakeup); __pthread_spin_unlock (&cond->__lock); /* Wake it up without spin held, so it may have a chance to really - preempt us */ + preempt us */ __pthread_wakeup (wakeup); __pthread_spin_lock (&cond->__lock); } diff --git a/sysdeps/generic/pt-cond-init.c b/sysdeps/generic/pt-cond-init.c index e11fa85..e1ccf3b 100644 --- a/sysdeps/generic/pt-cond-init.c +++ b/sysdeps/generic/pt-cond-init.c @@ -23,20 +23,18 @@ #include <pt-internal.h> int -__pthread_cond_init (pthread_cond_t *cond, - const pthread_condattr_t *attr) +__pthread_cond_init (pthread_cond_t *cond, const pthread_condattr_t * attr) { *cond = (pthread_cond_t) __PTHREAD_COND_INITIALIZER; - if (! attr - || memcmp (attr, &__pthread_default_condattr, sizeof (*attr) == 0)) + if (!attr || memcmp (attr, &__pthread_default_condattr, sizeof (*attr) == 0)) /* Use the default attributes. */ return 0; /* Non-default attributes. */ cond->__attr = malloc (sizeof *attr); - if (! cond->__attr) + if (!cond->__attr) return ENOMEM; *cond->__attr = *attr; diff --git a/sysdeps/generic/pt-cond-timedwait.c b/sysdeps/generic/pt-cond-timedwait.c index a7d5ce0..dd37fe7 100644 --- a/sysdeps/generic/pt-cond-timedwait.c +++ b/sysdeps/generic/pt-cond-timedwait.c @@ -26,8 +26,8 @@ extern int __pthread_cond_timedwait_internal (pthread_cond_t *cond, int __pthread_cond_timedwait (pthread_cond_t *cond, - pthread_mutex_t *mutex, - const struct timespec *abstime) + pthread_mutex_t *mutex, + const struct timespec *abstime) { return __pthread_cond_timedwait_internal (cond, mutex, abstime); } @@ -35,10 +35,10 @@ __pthread_cond_timedwait (pthread_cond_t *cond, strong_alias (__pthread_cond_timedwait, pthread_cond_timedwait); struct cancel_ctx - { - struct __pthread *wakeup; - pthread_cond_t *cond; - }; +{ + struct __pthread *wakeup; + pthread_cond_t *cond; +}; static void cancel_hook (void *arg) @@ -78,7 +78,7 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond, struct __pthread *self = _pthread_self (); struct cancel_ctx ctx; - ctx.wakeup= self; + ctx.wakeup = self; ctx.cond = cond; /* Test for a pending cancellation request, switch to deferred mode for @@ -91,9 +91,9 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond, pthread_setcanceltype to reduce locking overhead. */ __pthread_mutex_lock (&self->cancel_lock); cancelled = (self->cancel_state == PTHREAD_CANCEL_ENABLE) - && self->cancel_pending; + && self->cancel_pending; - if (! cancelled) + if (!cancelled) { self->cancel_hook = cancel_hook; self->cancel_hook_arg = &ctx; @@ -103,9 +103,9 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond, self->cancel_type = PTHREAD_CANCEL_DEFERRED; /* Add ourselves to the list of waiters. This is done while setting - the cancellation hook to simplify the cancellation procedure, i.e. - if the thread is queued, it can be cancelled, otherwise it is - already unblocked, progressing on the return path. */ + the cancellation hook to simplify the cancellation procedure, i.e. + if the thread is queued, it can be cancelled, otherwise it is + already unblocked, progressing on the return path. */ __pthread_spin_lock (&cond->__lock); __pthread_enqueue (&cond->__queue, self); if (cond->__attr) @@ -130,13 +130,13 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond, } __pthread_spin_lock (&cond->__lock); - if (! self->prevp) + if (!self->prevp) { /* Another thread removed us from the list of waiters, which means a - wakeup message has been sent. It was either consumed while we were - blocking, or queued after we timed out and before we acquired the - condition lock, in which case the message queue must be drained. */ - if (! err) + wakeup message has been sent. It was either consumed while we were + blocking, or queued after we timed out and before we acquired the + condition lock, in which case the message queue must be drained. */ + if (!err) drain = 0; else { @@ -147,7 +147,7 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond, else { /* We're still in the list of waiters. Noone attempted to wake us up, - i.e. we timed out. */ + i.e. we timed out. */ assert (err == ETIMEDOUT); __pthread_dequeue (self); drain = 0; @@ -164,7 +164,7 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond, self->cancel_hook_arg = NULL; self->cancel_type = oldtype; cancelled = (self->cancel_state == PTHREAD_CANCEL_ENABLE) - && self->cancel_pending; + && self->cancel_pending; __pthread_mutex_unlock (&self->cancel_lock); /* Reacquire MUTEX before returning/cancelling. */ diff --git a/sysdeps/generic/pt-cond.c b/sysdeps/generic/pt-cond.c index ef04750..2dc6c51 100644 --- a/sysdeps/generic/pt-cond.c +++ b/sysdeps/generic/pt-cond.c @@ -21,8 +21,7 @@ #include <pt-internal.h> -const struct __pthread_condattr __pthread_default_condattr = -{ +const struct __pthread_condattr __pthread_default_condattr = { __pshared: PTHREAD_PROCESS_PRIVATE, __clock: CLOCK_REALTIME }; diff --git a/sysdeps/generic/pt-condattr-getclock.c b/sysdeps/generic/pt-condattr-getclock.c index 6b6d67d..6c603e1 100644 --- a/sysdeps/generic/pt-condattr-getclock.c +++ b/sysdeps/generic/pt-condattr-getclock.c @@ -22,8 +22,7 @@ #include <pt-internal.h> int -pthread_condattr_getclock (const pthread_condattr_t *attr, - clockid_t *clock) +pthread_condattr_getclock (const pthread_condattr_t *attr, clockid_t * clock) { *clock = attr->__clock; return 0; diff --git a/sysdeps/generic/pt-condattr-getpshared.c b/sysdeps/generic/pt-condattr-getpshared.c index 7fbb74e..4f51f7e 100644 --- a/sysdeps/generic/pt-condattr-getpshared.c +++ b/sysdeps/generic/pt-condattr-getpshared.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_condattr_getpshared (const pthread_condattr_t *attr, - int *pshared) +pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared) { *pshared = attr->__pshared; return 0; diff --git a/sysdeps/generic/pt-condattr-setpshared.c b/sysdeps/generic/pt-condattr-setpshared.c index 231461f..9283a68 100644 --- a/sysdeps/generic/pt-condattr-setpshared.c +++ b/sysdeps/generic/pt-condattr-setpshared.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_condattr_setpshared (pthread_condattr_t *attr, - int pshared) +pthread_condattr_setpshared (pthread_condattr_t *attr, int pshared) { switch (pshared) { diff --git a/sysdeps/generic/pt-destroy-specific.c b/sysdeps/generic/pt-destroy-specific.c index 60332b5..fd1b427 100644 --- a/sysdeps/generic/pt-destroy-specific.c +++ b/sysdeps/generic/pt-destroy-specific.c @@ -28,7 +28,7 @@ __pthread_destroy_specific (struct __pthread *thread) int seen_one; /* Check if there is any thread specific data. */ - if (! thread->thread_specifics) + if (!thread->thread_specifics) return; __pthread_key_lock_ready (); @@ -40,7 +40,8 @@ __pthread_destroy_specific (struct __pthread *thread) __pthread_mutex_lock (&__pthread_key_lock); - for (i = 0; i < __pthread_key_count && i < thread->thread_specifics_size; i ++) + for (i = 0; i < __pthread_key_count && i < thread->thread_specifics_size; + i++) { void *value; @@ -62,11 +63,11 @@ __pthread_destroy_specific (struct __pthread *thread) __pthread_mutex_unlock (&__pthread_key_lock); - if (! seen_one) + if (!seen_one) break; /* This may take a very long time. Let those blocking on - pthread_key_create or pthread_key_delete make progress. */ + pthread_key_create or pthread_key_delete make progress. */ sched_yield (); } diff --git a/sysdeps/generic/pt-getcpuclockid.c b/sysdeps/generic/pt-getcpuclockid.c index 769954c..e4c7e87 100644 --- a/sysdeps/generic/pt-getcpuclockid.c +++ b/sysdeps/generic/pt-getcpuclockid.c @@ -29,6 +29,7 @@ pthread_getcpuclockid (pthread_t thread, clockid_t *clock) return 0; #else return ENOSYS; -stub_warning (pthread_getcpuclockid) #endif } + +stub_warning (pthread_getcpuclockid) diff --git a/sysdeps/generic/pt-getschedparam.c b/sysdeps/generic/pt-getschedparam.c index 25022b3..2d83287 100644 --- a/sysdeps/generic/pt-getschedparam.c +++ b/sysdeps/generic/pt-getschedparam.c @@ -21,7 +21,7 @@ int __pthread_getschedparam (pthread_t thread, int *policy, - struct sched_param *param) + struct sched_param *param) { *policy = SCHED_OTHER; param->sched_priority = 0; diff --git a/sysdeps/generic/pt-key-create.c b/sysdeps/generic/pt-key-create.c index 3f57190..81f237e 100644 --- a/sysdeps/generic/pt-key-create.c +++ b/sysdeps/generic/pt-key-create.c @@ -39,11 +39,10 @@ __pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) __pthread_mutex_lock (&__pthread_key_lock); - do_search: +do_search: /* Use the search hint and try to find a free slot. */ for (; index < __pthread_key_count - && __pthread_key_destructors[index] != PTHREAD_KEY_INVALID; - index ++) + && __pthread_key_destructors[index] != PTHREAD_KEY_INVALID; index++) ; /* See if we actually found a free element. */ @@ -52,9 +51,9 @@ __pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) assert (__pthread_key_destructors[index] == PTHREAD_KEY_INVALID); assert (__pthread_key_invalid_count > 0); - __pthread_key_invalid_count --; + __pthread_key_invalid_count--; __pthread_key_destructors[index] = destructor; - *key = index ++; + *key = index++; __pthread_mutex_unlock (&__pthread_key_lock); return 0; @@ -86,7 +85,7 @@ __pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) t = realloc (__pthread_key_destructors, newsize * sizeof (*__pthread_key_destructors)); - if (! t) + if (!t) { __pthread_mutex_unlock (&__pthread_key_lock); return ENOMEM; @@ -100,8 +99,8 @@ __pthread_key_create (pthread_key_t *key, void (*destructor) (void *)) __pthread_key_destructors[index] = destructor; *key = index; - index ++; - __pthread_key_count ++; + index++; + __pthread_key_count++; __pthread_mutex_unlock (&__pthread_key_lock); return 0; diff --git a/sysdeps/generic/pt-key-delete.c b/sysdeps/generic/pt-key-delete.c index ca08444..e9b5665 100644 --- a/sysdeps/generic/pt-key-delete.c +++ b/sysdeps/generic/pt-key-delete.c @@ -37,7 +37,7 @@ pthread_key_delete (pthread_key_t key) int i; __pthread_key_destructors[key] = PTHREAD_KEY_INVALID; - __pthread_key_invalid_count ++; + __pthread_key_invalid_count++; __pthread_rwlock_rdlock (&__pthread_threads_lock); for (i = 0; i < __pthread_num_threads; ++i) diff --git a/sysdeps/generic/pt-key.h b/sysdeps/generic/pt-key.h index e16e343..d1d4b76 100644 --- a/sysdeps/generic/pt-key.h +++ b/sysdeps/generic/pt-key.h @@ -55,22 +55,22 @@ __pthread_key_lock_ready (void) static pthread_once_t o = PTHREAD_ONCE_INIT; void do_init (void) - { - int err; - pthread_mutexattr_t attr; + { + int err; + pthread_mutexattr_t attr; - err = __pthread_mutexattr_init (&attr); - assert_perror (err); + err = __pthread_mutexattr_init (&attr); + assert_perror (err); - err = __pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); - assert_perror (err); + err = __pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); + assert_perror (err); - err = _pthread_mutex_init (&__pthread_key_lock, &attr); - assert_perror (err); + err = _pthread_mutex_init (&__pthread_key_lock, &attr); + assert_perror (err); - err = __pthread_mutexattr_destroy (&attr); - assert_perror (err); - } + err = __pthread_mutexattr_destroy (&attr); + assert_perror (err); + } __pthread_once (&o, do_init); } diff --git a/sysdeps/generic/pt-mutex-destroy.c b/sysdeps/generic/pt-mutex-destroy.c index 177b8c7..17b3083 100644 --- a/sysdeps/generic/pt-mutex-destroy.c +++ b/sysdeps/generic/pt-mutex-destroy.c @@ -26,7 +26,7 @@ int _pthread_mutex_destroy (pthread_mutex_t *mutex) { if (mutex->__attr == __PTHREAD_ERRORCHECK_MUTEXATTR - || mutex->__attr == __PTHREAD_RECURSIVE_MUTEXATTR) + || mutex->__attr == __PTHREAD_RECURSIVE_MUTEXATTR) /* Static attributes. */ ; else diff --git a/sysdeps/generic/pt-mutex-getprioceiling.c b/sysdeps/generic/pt-mutex-getprioceiling.c index 03c9a65..66833b8 100644 --- a/sysdeps/generic/pt-mutex-getprioceiling.c +++ b/sysdeps/generic/pt-mutex-getprioceiling.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, - int *prioceiling) +pthread_mutex_getprioceiling (const pthread_mutex_t *mutex, int *prioceiling) { return ENOSYS; } diff --git a/sysdeps/generic/pt-mutex-init.c b/sysdeps/generic/pt-mutex-init.c index 8e563b4..91e3b70 100644 --- a/sysdeps/generic/pt-mutex-init.c +++ b/sysdeps/generic/pt-mutex-init.c @@ -24,22 +24,20 @@ #include <pt-internal.h> int -_pthread_mutex_init (pthread_mutex_t *mutex, - const pthread_mutexattr_t *attr) +_pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) { *mutex = (pthread_mutex_t) __PTHREAD_MUTEX_INITIALIZER; - if (! attr - || memcmp (attr, &__pthread_default_mutexattr, sizeof (*attr) == 0)) + if (!attr || memcmp (attr, &__pthread_default_mutexattr, sizeof (*attr) == 0)) /* The default attributes. */ return 0; - if (! mutex->__attr + if (!mutex->__attr || mutex->__attr == __PTHREAD_ERRORCHECK_MUTEXATTR || mutex->__attr == __PTHREAD_RECURSIVE_MUTEXATTR) mutex->__attr = malloc (sizeof *attr); - if (! mutex->__attr) + if (!mutex->__attr) return ENOMEM; *mutex->__attr = *attr; diff --git a/sysdeps/generic/pt-mutex-setprioceiling.c b/sysdeps/generic/pt-mutex-setprioceiling.c index 266d17f..ea02188 100644 --- a/sysdeps/generic/pt-mutex-setprioceiling.c +++ b/sysdeps/generic/pt-mutex-setprioceiling.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prio, - int *oldprio) +pthread_mutex_setprioceiling (pthread_mutex_t *mutex, int prio, int *oldprio) { return ENOSYS; } diff --git a/sysdeps/generic/pt-mutex-timedlock.c b/sysdeps/generic/pt-mutex-timedlock.c index dcff333..992d32e 100644 --- a/sysdeps/generic/pt-mutex-timedlock.c +++ b/sysdeps/generic/pt-mutex-timedlock.c @@ -51,7 +51,7 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, initialized, in particular, before the main thread has a TCB. */ { - assert (! mutex->__owner); + assert (!mutex->__owner); mutex->__owner = _pthread_self (); } #endif @@ -82,7 +82,7 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, self = _pthread_self (); assert (self); - if (! attr || attr->__mutex_type == PTHREAD_MUTEX_NORMAL) + if (!attr || attr->__mutex_type == PTHREAD_MUTEX_NORMAL) { #if defined(ALWAYS_TRACK_MUTEX_OWNER) assert (mutex->__owner != self); @@ -103,7 +103,7 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, case PTHREAD_MUTEX_RECURSIVE: if (mutex->__owner == self) { - mutex->__locks ++; + mutex->__locks++; __pthread_spin_unlock (&mutex->__lock); return 0; } @@ -136,7 +136,7 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, } __pthread_spin_lock (&mutex->__lock); - if (! self->prevp) + if (!self->prevp) /* Another thread removed us from the queue, which means a wakeup message has been sent. It was either consumed while we were blocking, or queued after we timed out and before we acquired the mutex lock, in @@ -145,7 +145,7 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, else { /* We're still in the queue. Noone attempted to wake us up, i.e. we - timed out. */ + timed out. */ __pthread_dequeue (self); drain = 0; } diff --git a/sysdeps/generic/pt-mutex-transfer-np.c b/sysdeps/generic/pt-mutex-transfer-np.c index 6770879..e57d144 100644 --- a/sysdeps/generic/pt-mutex-transfer-np.c +++ b/sysdeps/generic/pt-mutex-transfer-np.c @@ -31,7 +31,7 @@ __pthread_mutex_transfer_np (struct __pthread_mutex *mutex, pthread_t tid) struct __pthread *thread = __pthread_getid (tid); const struct __pthread_mutexattr *attr = mutex->__attr; - if (! thread) + if (!thread) return ESRCH; if (thread == _pthread_self ()) diff --git a/sysdeps/generic/pt-mutex-trylock.c b/sysdeps/generic/pt-mutex-trylock.c index 0c35a40..179222f 100644 --- a/sysdeps/generic/pt-mutex-trylock.c +++ b/sysdeps/generic/pt-mutex-trylock.c @@ -47,7 +47,7 @@ __pthread_mutex_trylock (struct __pthread_mutex *mutex) initialized, in particular, before the main thread has a TCB. */ { - assert (! mutex->__owner); + assert (!mutex->__owner); mutex->__owner = _pthread_self (); } #endif @@ -92,7 +92,7 @@ __pthread_mutex_trylock (struct __pthread_mutex *mutex) case PTHREAD_MUTEX_RECURSIVE: if (mutex->__owner == self) { - mutex->__locks ++; + mutex->__locks++; err = 0; } break; diff --git a/sysdeps/generic/pt-mutex-unlock.c b/sysdeps/generic/pt-mutex-unlock.c index 34bed33..08e74ca 100644 --- a/sysdeps/generic/pt-mutex-unlock.c +++ b/sysdeps/generic/pt-mutex-unlock.c @@ -36,7 +36,7 @@ __pthread_mutex_unlock (pthread_mutex_t *mutex) __pthread_spin_lock (&mutex->__lock); - if (! attr || attr->__mutex_type == PTHREAD_MUTEX_NORMAL) + if (!attr || attr->__mutex_type == PTHREAD_MUTEX_NORMAL) { #if defined(ALWAYS_TRACK_MUTEX_OWNER) # ifndef NDEBUG diff --git a/sysdeps/generic/pt-mutexattr-getprotocol.c b/sysdeps/generic/pt-mutexattr-getprotocol.c index 42ff8b1..cef51d2 100644 --- a/sysdeps/generic/pt-mutexattr-getprotocol.c +++ b/sysdeps/generic/pt-mutexattr-getprotocol.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, - int *protocol) +pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, int *protocol) { *protocol = attr->__protocol; return 0; diff --git a/sysdeps/generic/pt-mutexattr-getpshared.c b/sysdeps/generic/pt-mutexattr-getpshared.c index e6478b3..3afcb50 100644 --- a/sysdeps/generic/pt-mutexattr-getpshared.c +++ b/sysdeps/generic/pt-mutexattr-getpshared.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, - int *pshared) +pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr, int *pshared) { *pshared = attr->__pshared; return 0; diff --git a/sysdeps/generic/pt-mutexattr-setprioceiling.c b/sysdeps/generic/pt-mutexattr-setprioceiling.c index 81aef55..8a0f86f 100644 --- a/sysdeps/generic/pt-mutexattr-setprioceiling.c +++ b/sysdeps/generic/pt-mutexattr-setprioceiling.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, - int prioceiling) +pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, int prioceiling) { return ENOSYS; } diff --git a/sysdeps/generic/pt-mutexattr-setprotocol.c b/sysdeps/generic/pt-mutexattr-setprotocol.c index 9985def..ffd21c2 100644 --- a/sysdeps/generic/pt-mutexattr-setprotocol.c +++ b/sysdeps/generic/pt-mutexattr-setprotocol.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, - int protocol) +pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol) { if (protocol == __pthread_default_mutexattr.__protocol) { diff --git a/sysdeps/generic/pt-mutexattr-setpshared.c b/sysdeps/generic/pt-mutexattr-setpshared.c index 7fb7d6d..759def0 100644 --- a/sysdeps/generic/pt-mutexattr-setpshared.c +++ b/sysdeps/generic/pt-mutexattr-setpshared.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, - int pshared) +pthread_mutexattr_setpshared (pthread_mutexattr_t *attr, int pshared) { switch (pshared) { diff --git a/sysdeps/generic/pt-mutexattr.c b/sysdeps/generic/pt-mutexattr.c index e6d64e0..ba55ebd 100644 --- a/sysdeps/generic/pt-mutexattr.c +++ b/sysdeps/generic/pt-mutexattr.c @@ -19,24 +19,21 @@ #include <pthread.h> #include <pt-internal.h> -const struct __pthread_mutexattr __pthread_default_mutexattr = -{ +const struct __pthread_mutexattr __pthread_default_mutexattr = { __prioceiling: 0, __protocol: PTHREAD_PRIO_NONE, __pshared: PTHREAD_PROCESS_PRIVATE, __mutex_type: PTHREAD_MUTEX_DEFAULT }; -const struct __pthread_mutexattr __pthread_errorcheck_mutexattr = -{ +const struct __pthread_mutexattr __pthread_errorcheck_mutexattr = { __prioceiling: 0, __protocol: PTHREAD_PRIO_NONE, __pshared: PTHREAD_PROCESS_PRIVATE, __mutex_type: PTHREAD_MUTEX_ERRORCHECK }; -const struct __pthread_mutexattr __pthread_recursive_mutexattr = -{ +const struct __pthread_mutexattr __pthread_recursive_mutexattr = { __prioceiling: 0, __protocol: PTHREAD_PRIO_NONE, __pshared: PTHREAD_PROCESS_PRIVATE, diff --git a/sysdeps/generic/pt-rwlock-attr.c b/sysdeps/generic/pt-rwlock-attr.c index d9e90b7..a4814fc 100644 --- a/sysdeps/generic/pt-rwlock-attr.c +++ b/sysdeps/generic/pt-rwlock-attr.c @@ -19,7 +19,6 @@ #include <pthread.h> #include <pt-internal.h> -const struct __pthread_rwlockattr __pthread_default_rwlockattr = -{ +const struct __pthread_rwlockattr __pthread_default_rwlockattr = { __pshared: PTHREAD_PROCESS_PRIVATE }; diff --git a/sysdeps/generic/pt-rwlock-init.c b/sysdeps/generic/pt-rwlock-init.c index 9ffc2c6..0009801 100644 --- a/sysdeps/generic/pt-rwlock-init.c +++ b/sysdeps/generic/pt-rwlock-init.c @@ -26,7 +26,7 @@ _pthread_rwlock_init (pthread_rwlock_t *rwlock, { *rwlock = (pthread_rwlock_t) __PTHREAD_RWLOCK_INITIALIZER; - if (! attr + if (!attr || memcmp (attr, &__pthread_default_rwlockattr, sizeof (*attr) == 0)) /* Use the default attributes. */ return 0; @@ -34,7 +34,7 @@ _pthread_rwlock_init (pthread_rwlock_t *rwlock, /* Non-default attributes. */ rwlock->__attr = malloc (sizeof *attr); - if (! rwlock->__attr) + if (!rwlock->__attr) return ENOMEM; *rwlock->__attr = *attr; diff --git a/sysdeps/generic/pt-rwlock-rdlock.c b/sysdeps/generic/pt-rwlock-rdlock.c index 1033d20..4592e1a 100644 --- a/sysdeps/generic/pt-rwlock-rdlock.c +++ b/sysdeps/generic/pt-rwlock-rdlock.c @@ -20,8 +20,10 @@ #include <pt-internal.h> /* Implemented in pt-rwlock-timedrdlock.c. */ -extern int __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock, - const struct timespec *abstime); +extern int __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock + *rwlock, + const struct timespec + *abstime); /* Acquire RWLOCK for reading, block if we can't get it. */ int diff --git a/sysdeps/generic/pt-rwlock-timedrdlock.c b/sysdeps/generic/pt-rwlock-timedrdlock.c index db44000..fe0c224 100644 --- a/sysdeps/generic/pt-rwlock-timedrdlock.c +++ b/sysdeps/generic/pt-rwlock-timedrdlock.c @@ -46,14 +46,14 @@ __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock, } else /* Lock is held, but is held by a reader? */ - if (rwlock->__readers > 0) - /* Just add ourself to number of readers. */ - { - assert (rwlock->__readerqueue == 0); - rwlock->__readers ++; - __pthread_spin_unlock (&rwlock->__lock); - return 0; - } + if (rwlock->__readers > 0) + /* Just add ourself to number of readers. */ + { + assert (rwlock->__readerqueue == 0); + rwlock->__readers++; + __pthread_spin_unlock (&rwlock->__lock); + return 0; + } /* The lock is busy. */ @@ -79,7 +79,7 @@ __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock, } __pthread_spin_lock (&rwlock->__lock); - if (! self->prevp) + if (!self->prevp) /* Another thread removed us from the queue, which means a wakeup message has been sent. It was either consumed while we were blocking, or queued after we timed out and before we acquired the rwlock lock, in @@ -88,7 +88,7 @@ __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock, else { /* We're still in the queue. Noone attempted to wake us up, i.e. we - timed out. */ + timed out. */ __pthread_dequeue (self); drain = 0; } @@ -113,7 +113,7 @@ __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock, int __pthread_rwlock_timedrdlock (struct __pthread_rwlock *rwlock, - const struct timespec *abstime) + const struct timespec *abstime) { return __pthread_rwlock_timedrdlock_internal (rwlock, abstime); } diff --git a/sysdeps/generic/pt-rwlock-timedwrlock.c b/sysdeps/generic/pt-rwlock-timedwrlock.c index 3eddbe9..3a3faad 100644 --- a/sysdeps/generic/pt-rwlock-timedwrlock.c +++ b/sysdeps/generic/pt-rwlock-timedwrlock.c @@ -65,7 +65,7 @@ __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock, } __pthread_spin_lock (&rwlock->__lock); - if (! self->prevp) + if (!self->prevp) /* Another thread removed us from the queue, which means a wakeup message has been sent. It was either consumed while we were blocking, or queued after we timed out and before we acquired the rwlock lock, in @@ -74,7 +74,7 @@ __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock, else { /* We're still in the queue. Noone attempted to wake us up, i.e. we - timed out. */ + timed out. */ __pthread_dequeue (self); drain = 0; } @@ -96,7 +96,7 @@ __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock, int __pthread_rwlock_timedwrlock (struct __pthread_rwlock *rwlock, - const struct timespec *abstime) + const struct timespec *abstime) { return __pthread_rwlock_timedwrlock_internal (rwlock, abstime); } diff --git a/sysdeps/generic/pt-rwlock-tryrdlock.c b/sysdeps/generic/pt-rwlock-tryrdlock.c index 8745437..39a368c 100644 --- a/sysdeps/generic/pt-rwlock-tryrdlock.c +++ b/sysdeps/generic/pt-rwlock-tryrdlock.c @@ -39,13 +39,13 @@ pthread_rwlock_tryrdlock (struct __pthread_rwlock *rwlock) } else /* Lock is held, but is held by a reader? */ - if (rwlock->__readers > 0) - { - assert (rwlock->__readerqueue == 0); - rwlock->__readers ++; - __pthread_spin_unlock (&rwlock->__lock); - return 0; - } + if (rwlock->__readers > 0) + { + assert (rwlock->__readerqueue == 0); + rwlock->__readers++; + __pthread_spin_unlock (&rwlock->__lock); + return 0; + } /* The lock is busy. */ diff --git a/sysdeps/generic/pt-rwlock-unlock.c b/sysdeps/generic/pt-rwlock-unlock.c index 32446e8..9fd1aa8 100644 --- a/sysdeps/generic/pt-rwlock-unlock.c +++ b/sysdeps/generic/pt-rwlock-unlock.c @@ -35,7 +35,7 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock) if (rwlock->__readers > 1) /* There are other readers. */ { - rwlock->__readers --; + rwlock->__readers--; __pthread_spin_unlock (&rwlock->__lock); return 0; } @@ -54,7 +54,7 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock) __pthread_dequeue (wakeup); /* We do not unlock RWLOCK->held: we are transferring the ownership - to the thread that we are waking up. */ + to the thread that we are waking up. */ __pthread_spin_unlock (&rwlock->__lock); __pthread_wakeup (wakeup); @@ -67,21 +67,21 @@ __pthread_rwlock_unlock (pthread_rwlock_t *rwlock) unsigned n = 0; __pthread_queue_iterate (rwlock->__readerqueue, wakeup) - n ++; + n++; { struct __pthread *wakeups[n]; unsigned i = 0; __pthread_dequeuing_iterate (rwlock->__readerqueue, wakeup) - wakeups[i ++] = wakeup; + wakeups[i++] = wakeup; rwlock->__readers += n; rwlock->__readerqueue = 0; __pthread_spin_unlock (&rwlock->__lock); - for (i = 0; i < n; i ++) + for (i = 0; i < n; i++) __pthread_wakeup (wakeups[i]); } diff --git a/sysdeps/generic/pt-rwlock-wrlock.c b/sysdeps/generic/pt-rwlock-wrlock.c index d02036a..ed129a8 100644 --- a/sysdeps/generic/pt-rwlock-wrlock.c +++ b/sysdeps/generic/pt-rwlock-wrlock.c @@ -22,8 +22,10 @@ #include <pt-internal.h> /* Implemented in pt-rwlock-timedwrlock.c. */ -extern int __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock, - const struct timespec *abstime); +extern int __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock + *rwlock, + const struct timespec + *abstime); /* Acquire RWLOCK for writing. */ int diff --git a/sysdeps/generic/pt-rwlockattr-getpshared.c b/sysdeps/generic/pt-rwlockattr-getpshared.c index 04469f8..09f57c6 100644 --- a/sysdeps/generic/pt-rwlockattr-getpshared.c +++ b/sysdeps/generic/pt-rwlockattr-getpshared.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, - int *pshared) +pthread_rwlockattr_getpshared (const pthread_rwlockattr_t *attr, int *pshared) { *pshared = attr->__pshared; return 0; diff --git a/sysdeps/generic/pt-rwlockattr-setpshared.c b/sysdeps/generic/pt-rwlockattr-setpshared.c index b3997c0..acb5ea4 100644 --- a/sysdeps/generic/pt-rwlockattr-setpshared.c +++ b/sysdeps/generic/pt-rwlockattr-setpshared.c @@ -20,8 +20,7 @@ #include <pt-internal.h> int -pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, - int pshared) +pthread_rwlockattr_setpshared (pthread_rwlockattr_t *attr, int pshared) { switch (pshared) { diff --git a/sysdeps/generic/pt-setschedparam.c b/sysdeps/generic/pt-setschedparam.c index 42763de..f8bce35 100644 --- a/sysdeps/generic/pt-setschedparam.c +++ b/sysdeps/generic/pt-setschedparam.c @@ -21,7 +21,7 @@ int __pthread_setschedparam (pthread_t thread, int policy, - const struct sched_param *param) + const struct sched_param *param) { return ENOSYS; } diff --git a/sysdeps/generic/pt-setspecific.c b/sysdeps/generic/pt-setspecific.c index e875bd1..e82c7ae 100644 --- a/sysdeps/generic/pt-setspecific.c +++ b/sysdeps/generic/pt-setspecific.c @@ -35,7 +35,7 @@ __pthread_setspecific (pthread_key_t key, const void *value) int newsize = 2 * key + 1; void **new = realloc (self->thread_specifics, newsize * sizeof (new[0])); - if (! new ) + if (!new) return ENOMEM; memset (&new[self->thread_specifics_size], 0, @@ -44,7 +44,7 @@ __pthread_setspecific (pthread_key_t key, const void *value) self->thread_specifics_size = newsize; } - self->thread_specifics[key] = (void*) value; + self->thread_specifics[key] = (void *) value; return 0; } strong_alias (__pthread_setspecific, pthread_setspecific); diff --git a/sysdeps/generic/sem-post.c b/sysdeps/generic/sem-post.c index e74415a..f374a62 100644 --- a/sysdeps/generic/sem-post.c +++ b/sysdeps/generic/sem-post.c @@ -30,13 +30,13 @@ __sem_post (sem_t *sem) if (sem->__value > 0) /* Do a quick up. */ { - assert (! sem->__queue); - sem->__value ++; + assert (!sem->__queue); + sem->__value++; __pthread_spin_unlock (&sem->__lock); return 0; } - if (! sem->__queue) + if (!sem->__queue) /* No one waiting. */ { sem->__value = 1; diff --git a/sysdeps/generic/sem-timedwait.c b/sysdeps/generic/sem-timedwait.c index 9830d5e..a70ca89 100644 --- a/sysdeps/generic/sem-timedwait.c +++ b/sysdeps/generic/sem-timedwait.c @@ -34,7 +34,7 @@ __sem_timedwait_internal (sem_t *restrict sem, if (sem->__value > 0) /* Successful down. */ { - sem->__value --; + sem->__value--; __pthread_spin_unlock (&sem->__lock); return 0; } @@ -61,7 +61,7 @@ __sem_timedwait_internal (sem_t *restrict sem, } __pthread_spin_lock (&sem->__lock); - if (! self->prevp) + if (!self->prevp) /* Another thread removed us from the queue, which means a wakeup message has been sent. It was either consumed while we were blocking, or queued after we timed out and before we acquired the semaphore lock, in @@ -70,7 +70,7 @@ __sem_timedwait_internal (sem_t *restrict sem, else { /* We're still in the queue. Noone attempted to wake us up, i.e. we - timed out. */ + timed out. */ __pthread_dequeue (self); drain = 0; } @@ -90,8 +90,7 @@ __sem_timedwait_internal (sem_t *restrict sem, } int -__sem_timedwait (sem_t *restrict sem, - const struct timespec *restrict timeout) +__sem_timedwait (sem_t *restrict sem, const struct timespec *restrict timeout) { return __sem_timedwait_internal (sem, timeout); } diff --git a/sysdeps/generic/sem-trywait.c b/sysdeps/generic/sem-trywait.c index c771634..e84b08d 100644 --- a/sysdeps/generic/sem-trywait.c +++ b/sysdeps/generic/sem-trywait.c @@ -28,7 +28,7 @@ __sem_trywait (sem_t *sem) if (sem->__value > 0) /* Successful down. */ { - sem->__value --; + sem->__value--; __pthread_spin_unlock (&sem->__lock); return 0; } diff --git a/sysdeps/generic/shm-directory.h b/sysdeps/generic/shm-directory.h index 50b1721..cddd5e5 100644 --- a/sysdeps/generic/shm-directory.h +++ b/sysdeps/generic/shm-directory.h @@ -27,5 +27,4 @@ #if IS_IN (libpthread) hidden_proto (__shm_directory) #endif - -#endif /* shm-directory.h */ +#endif /* shm-directory.h */ diff --git a/sysdeps/generic/timer_routines.h b/sysdeps/generic/timer_routines.h index 21da7d9..c506ce9 100644 --- a/sysdeps/generic/timer_routines.h +++ b/sysdeps/generic/timer_routines.h @@ -28,13 +28,13 @@ performance reason. One could use the access functions to get the values of all the fields of the attribute structure. */ static inline int -thread_attr_compare (const pthread_attr_t *left, const pthread_attr_t *right) +thread_attr_compare (const pthread_attr_t * left, const pthread_attr_t * right) { struct __pthread_attr *ileft = (struct __pthread_attr *) left; struct __pthread_attr *iright = (struct __pthread_attr *) right; return (ileft->__schedparam.sched_priority - == iright->__schedparam.sched_priority + == iright->__schedparam.sched_priority && ileft->__stackaddr == iright->__stackaddr && ileft->__stacksize == iright->__stacksize && ileft->__guardsize == iright->__guardsize @@ -44,4 +44,4 @@ thread_attr_compare (const pthread_attr_t *left, const pthread_attr_t *right) && ileft->__schedpolicy == iright->__schedpolicy); } -#endif /* timer_routines.h */ +#endif /* timer_routines.h */ |