diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/pt-cond-signal.c | 4 | ||||
-rw-r--r-- | sysdeps/generic/pt-cond-timedwait.c | 4 | ||||
-rw-r--r-- | sysdeps/generic/pt-destroy-specific.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/pt-mutex-timedlock.c | 14 | ||||
-rw-r--r-- | sysdeps/generic/pt-mutex-transfer-np.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/pt-mutex-trylock.c | 10 | ||||
-rw-r--r-- | sysdeps/generic/pt-rwlock-timedrdlock.c | 4 | ||||
-rw-r--r-- | sysdeps/generic/pt-rwlock-timedwrlock.c | 4 | ||||
-rw-r--r-- | sysdeps/generic/raise.c | 2 | ||||
-rw-r--r-- | sysdeps/generic/sem-timedwait.c | 4 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/pt-setup.c | 2 | ||||
-rw-r--r-- | sysdeps/mach/hurd/pt-hurd-cond-timedwait.c | 6 | ||||
-rw-r--r-- | sysdeps/mach/hurd/pt-sigstate.c | 4 | ||||
-rw-r--r-- | sysdeps/mach/hurd/pt-sysdep.c | 4 |
14 files changed, 33 insertions, 33 deletions
diff --git a/sysdeps/generic/pt-cond-signal.c b/sysdeps/generic/pt-cond-signal.c index 68bd6d9..a1c0c2a 100644 --- a/sysdeps/generic/pt-cond-signal.c +++ b/sysdeps/generic/pt-cond-signal.c @@ -29,11 +29,11 @@ __pthread_cond_signal (pthread_cond_t *cond) __pthread_spin_lock (&cond->__lock); wakeup = cond->__queue; - if (wakeup) + if (wakeup != NULL) __pthread_dequeue (wakeup); __pthread_spin_unlock (&cond->__lock); - if (wakeup) + if (wakeup != NULL) __pthread_wakeup (wakeup); return 0; diff --git a/sysdeps/generic/pt-cond-timedwait.c b/sysdeps/generic/pt-cond-timedwait.c index e40958a..525e63d 100644 --- a/sysdeps/generic/pt-cond-timedwait.c +++ b/sysdeps/generic/pt-cond-timedwait.c @@ -108,7 +108,7 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond, already unblocked, progressing on the return path. */ __pthread_spin_lock (&cond->__lock); __pthread_enqueue (&cond->__queue, self); - if (cond->__attr) + if (cond->__attr != NULL) clock_id = cond->__attr->__clock; __pthread_spin_unlock (&cond->__lock); } @@ -121,7 +121,7 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond, __pthread_mutex_unlock (mutex); /* Block the thread. */ - if (abstime) + if (abstime != NULL) err = __pthread_timedblock (self, abstime, clock_id); else { diff --git a/sysdeps/generic/pt-destroy-specific.c b/sysdeps/generic/pt-destroy-specific.c index cb6affe..523a620 100644 --- a/sysdeps/generic/pt-destroy-specific.c +++ b/sysdeps/generic/pt-destroy-specific.c @@ -49,7 +49,7 @@ __pthread_destroy_specific (struct __pthread *thread) continue; value = thread->thread_specifics[i]; - if (value) + if (value != NULL) { thread->thread_specifics[i] = 0; diff --git a/sysdeps/generic/pt-mutex-timedlock.c b/sysdeps/generic/pt-mutex-timedlock.c index b23680a..2a64c53 100644 --- a/sysdeps/generic/pt-mutex-timedlock.c +++ b/sysdeps/generic/pt-mutex-timedlock.c @@ -46,7 +46,7 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, #ifdef ALWAYS_TRACK_MUTEX_OWNER # ifndef NDEBUG self = _pthread_self (); - if (self) + if (self != NULL) /* The main thread may take a lock before the library is fully initialized, in particular, before the main thread has a TCB. */ @@ -57,7 +57,7 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, # endif #endif - if (attr) + if (attr != NULL) switch (attr->__mutex_type) { case PTHREAD_MUTEX_NORMAL: @@ -115,11 +115,11 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, } #if !defined(ALWAYS_TRACK_MUTEX_OWNER) - if (attr && attr->__mutex_type != PTHREAD_MUTEX_NORMAL) + if (attr != NULL && attr->__mutex_type != PTHREAD_MUTEX_NORMAL) #endif assert (mutex->__owner); - if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) + if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) return EINVAL; /* Add ourselves to the queue. */ @@ -127,7 +127,7 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, __pthread_spin_unlock (&mutex->__lock); /* Block the thread. */ - if (abstime) + if (abstime != NULL) err = __pthread_timedblock (self, abstime, CLOCK_REALTIME); else { @@ -161,13 +161,13 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex, } #if !defined(ALWAYS_TRACK_MUTEX_OWNER) - if (attr && attr->__mutex_type != PTHREAD_MUTEX_NORMAL) + if (attr != NULL && attr->__mutex_type != PTHREAD_MUTEX_NORMAL) #endif { assert (mutex->__owner == self); } - if (attr) + if (attr != NULL) switch (attr->__mutex_type) { case PTHREAD_MUTEX_NORMAL: diff --git a/sysdeps/generic/pt-mutex-transfer-np.c b/sysdeps/generic/pt-mutex-transfer-np.c index 926e09e..e208ac1 100644 --- a/sysdeps/generic/pt-mutex-transfer-np.c +++ b/sysdeps/generic/pt-mutex-transfer-np.c @@ -42,7 +42,7 @@ __pthread_mutex_transfer_np (struct __pthread_mutex *mutex, pthread_t tid) if (attr == __PTHREAD_RECURSIVE_MUTEXATTR) attr = &__pthread_recursive_mutexattr; - if (attr && attr->__mutex_type == PTHREAD_MUTEX_ERRORCHECK) + if (attr != NULL && attr->__mutex_type == PTHREAD_MUTEX_ERRORCHECK) { if (mutex->__owner != _pthread_self ()) diff --git a/sysdeps/generic/pt-mutex-trylock.c b/sysdeps/generic/pt-mutex-trylock.c index 3a0fcfe..b19611b 100644 --- a/sysdeps/generic/pt-mutex-trylock.c +++ b/sysdeps/generic/pt-mutex-trylock.c @@ -40,9 +40,9 @@ __pthread_mutex_trylock (struct __pthread_mutex *mutex) /* Acquired the lock. */ { #if defined(ALWAYS_TRACK_MUTEX_OWNER) -#ifndef NDEBUG +# ifndef NDEBUG self = _pthread_self (); - if (self) + if (self != NULL) /* The main thread may take a lock before the library is fully initialized, in particular, before the main thread has a TCB. */ @@ -50,10 +50,10 @@ __pthread_mutex_trylock (struct __pthread_mutex *mutex) assert (mutex->__owner == NULL); mutex->__owner = _pthread_self (); } -#endif +# endif #endif - if (attr) + if (attr != NULL) switch (attr->__mutex_type) { case PTHREAD_MUTEX_NORMAL: @@ -75,7 +75,7 @@ __pthread_mutex_trylock (struct __pthread_mutex *mutex) err = EBUSY; - if (attr) + if (attr != NULL) { self = _pthread_self (); switch (attr->__mutex_type) diff --git a/sysdeps/generic/pt-rwlock-timedrdlock.c b/sysdeps/generic/pt-rwlock-timedrdlock.c index 4d46f7a..60dd97f 100644 --- a/sysdeps/generic/pt-rwlock-timedrdlock.c +++ b/sysdeps/generic/pt-rwlock-timedrdlock.c @@ -60,7 +60,7 @@ __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock, /* Better be blocked by a writer. */ assert (rwlock->__readers == 0); - if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) + if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) return EINVAL; self = _pthread_self (); @@ -70,7 +70,7 @@ __pthread_rwlock_timedrdlock_internal (struct __pthread_rwlock *rwlock, __pthread_spin_unlock (&rwlock->__lock); /* Block the thread. */ - if (abstime) + if (abstime != NULL) err = __pthread_timedblock (self, abstime, CLOCK_REALTIME); else { diff --git a/sysdeps/generic/pt-rwlock-timedwrlock.c b/sysdeps/generic/pt-rwlock-timedwrlock.c index 8a2a469..b30c250 100644 --- a/sysdeps/generic/pt-rwlock-timedwrlock.c +++ b/sysdeps/generic/pt-rwlock-timedwrlock.c @@ -46,7 +46,7 @@ __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock, /* The lock is busy. */ - if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) + if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) return EINVAL; self = _pthread_self (); @@ -56,7 +56,7 @@ __pthread_rwlock_timedwrlock_internal (struct __pthread_rwlock *rwlock, __pthread_spin_unlock (&rwlock->__lock); /* Block the thread. */ - if (abstime) + if (abstime != NULL) err = __pthread_timedblock (self, abstime, CLOCK_REALTIME); else { diff --git a/sysdeps/generic/raise.c b/sysdeps/generic/raise.c index 4571ef0..d2f21c8 100644 --- a/sysdeps/generic/raise.c +++ b/sysdeps/generic/raise.c @@ -32,7 +32,7 @@ raise (int signo) "the effect of the raise() function shall be equivalent to calling: pthread_kill(pthread_self(), sig);" */ - if (__pthread_kill && __pthread_threads) + if (__pthread_kill != NULL && __pthread_threads != NULL) { int err; err = __pthread_kill (__pthread_self (), signo); diff --git a/sysdeps/generic/sem-timedwait.c b/sysdeps/generic/sem-timedwait.c index f3dda4d..54a4ea4 100644 --- a/sysdeps/generic/sem-timedwait.c +++ b/sysdeps/generic/sem-timedwait.c @@ -39,7 +39,7 @@ __sem_timedwait_internal (sem_t *restrict sem, return 0; } - if (timeout && (timeout->tv_nsec < 0 || timeout->tv_nsec >= 1000000000)) + if (timeout != NULL && (timeout->tv_nsec < 0 || timeout->tv_nsec >= 1000000000)) { errno = EINVAL; return -1; @@ -52,7 +52,7 @@ __sem_timedwait_internal (sem_t *restrict sem, __pthread_spin_unlock (&sem->__lock); /* Block the thread. */ - if (timeout) + if (timeout != NULL) err = __pthread_timedblock (self, timeout, CLOCK_REALTIME); else { diff --git a/sysdeps/mach/hurd/i386/pt-setup.c b/sysdeps/mach/hurd/i386/pt-setup.c index b498e50..a59f71b 100644 --- a/sysdeps/mach/hurd/i386/pt-setup.c +++ b/sysdeps/mach/hurd/i386/pt-setup.c @@ -49,7 +49,7 @@ stack_setup (struct __pthread *thread, + ((thread->guardsize + __vm_page_size - 1) / __vm_page_size) * __vm_page_size); - if (start_routine) + if (start_routine != NULL) { /* And then the call frame. */ top -= 3; diff --git a/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c b/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c index 182a7e2..41792e3 100644 --- a/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c +++ b/sysdeps/mach/hurd/pt-hurd-cond-timedwait.c @@ -69,7 +69,7 @@ __pthread_hurd_cond_timedwait_internal (pthread_cond_t *cond, assert (ss->intr_port == MACH_PORT_NULL); /* Sanity check for signal bugs. */ - if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) + if (abstime != NULL && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) return EINVAL; /* Atomically enqueue our thread on the condition variable's queue of @@ -111,7 +111,7 @@ __pthread_hurd_cond_timedwait_internal (pthread_cond_t *cond, __pthread_mutex_unlock (mutex); /* Block the thread. */ - if (abstime) + if (abstime != NULL) err = __pthread_timedblock (self, abstime, clock_id); else { @@ -153,7 +153,7 @@ __pthread_hurd_cond_timedwait_internal (pthread_cond_t *cond, ss->cancel = 0; __spin_unlock (&ss->lock); - if (mutex) + if (mutex != NULL) /* Reacquire the mutex and return. */ __pthread_mutex_lock (mutex); diff --git a/sysdeps/mach/hurd/pt-sigstate.c b/sysdeps/mach/hurd/pt-sigstate.c index bdc71c9..890fd57 100644 --- a/sysdeps/mach/hurd/pt-sigstate.c +++ b/sysdeps/mach/hurd/pt-sigstate.c @@ -37,10 +37,10 @@ __pthread_sigstate (struct __pthread *thread, int how, _hurd_sigstate_lock (ss); - if (oset) + if (oset != NULL) *oset = ss->blocked; - if (set) + if (set != NULL) { switch (how) { diff --git a/sysdeps/mach/hurd/pt-sysdep.c b/sysdeps/mach/hurd/pt-sysdep.c index 118b264..40ebc8e 100644 --- a/sysdeps/mach/hurd/pt-sysdep.c +++ b/sysdeps/mach/hurd/pt-sysdep.c @@ -44,14 +44,14 @@ _init_routine (void *stack) int err; pthread_attr_t attr, *attrp = 0; - if (__pthread_threads) + if (__pthread_threads != NULL) /* Already initialized */ return 0; /* Initialize the library. */ ___pthread_init (); - if (stack) + if (stack != NULL) { /* We are getting initialized due to dlopening a library using libpthread while the main program was not linked against libpthread. */ |