diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-03-28 01:22:33 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-03-28 01:22:33 +0200 |
commit | 08ed02b9705b7bce1b8d79da6455d59a31295212 (patch) | |
tree | ddfe8ff69ff49e1baa0052885dad5a2c6404fdcf | |
parent | fd8d37ff6b01db3985ac67a6c43bb81f5f7b2aca (diff) |
Fix coding style
-rw-r--r-- | sysdeps/mach/pt-stack-alloc.c | 9 | ||||
-rw-r--r-- | sysdeps/mach/pt-thread-alloc.c | 2 | ||||
-rw-r--r-- | sysdeps/mach/pt-thread-start.c | 15 | ||||
-rw-r--r-- | sysdeps/mach/pt-thread-terminate.c | 8 | ||||
-rw-r--r-- | sysdeps/mach/pt-timedblock.c | 8 | ||||
-rw-r--r-- | sysdeps/mach/pt-wakeup.c | 2 |
6 files changed, 21 insertions, 23 deletions
diff --git a/sysdeps/mach/pt-stack-alloc.c b/sysdeps/mach/pt-stack-alloc.c index 2167ca3..6c38c92 100644 --- a/sysdeps/mach/pt-stack-alloc.c +++ b/sysdeps/mach/pt-stack-alloc.c @@ -38,13 +38,12 @@ __pthread_stack_alloc (void **stackaddr, size_t stacksize) vm_offset_t base; int i = 0; - get_stack: - i ++; +get_stack: + i++; for (base = next_stack_base; base < VM_MAX_ADDRESS - && __vm_allocate (__mach_task_self (), &base, - stacksize, FALSE) != KERN_SUCCESS; - base += stacksize) + && __vm_allocate (__mach_task_self (), &base, + stacksize, FALSE) != KERN_SUCCESS; base += stacksize) ; if (base >= VM_MAX_ADDRESS) diff --git a/sysdeps/mach/pt-thread-alloc.c b/sysdeps/mach/pt-thread-alloc.c index 257d5d2..3c763ef 100644 --- a/sysdeps/mach/pt-thread-alloc.c +++ b/sysdeps/mach/pt-thread-alloc.c @@ -73,7 +73,7 @@ __pthread_thread_alloc (struct __pthread *thread) if (err) return err; - if (! do_create) + if (!do_create) { assert (__pthread_total == 0); thread->kernel_thread = __mach_thread_self (); diff --git a/sysdeps/mach/pt-thread-start.c b/sysdeps/mach/pt-thread-start.c index 07fbc30..571c1f2 100644 --- a/sysdeps/mach/pt-thread-start.c +++ b/sysdeps/mach/pt-thread-start.c @@ -29,15 +29,18 @@ __pthread_thread_start (struct __pthread *thread) static int do_start; error_t err; - if (! do_start) + if (!do_start) { /* The main thread is already running: do nothing. */ assert (__pthread_total == 1); - assert (({ mach_port_t ktid = __mach_thread_self (); - int ok = thread->kernel_thread == ktid; - __mach_port_deallocate (__mach_task_self (), - thread->kernel_thread); - ok; })); + assert (( + { + mach_port_t ktid = __mach_thread_self (); + int ok = thread->kernel_thread == ktid; + __mach_port_deallocate (__mach_task_self (), + thread->kernel_thread); + ok; + })); do_start = 1; } else diff --git a/sysdeps/mach/pt-thread-terminate.c b/sysdeps/mach/pt-thread-terminate.c index b9e094e..418fb40 100644 --- a/sysdeps/mach/pt-thread-terminate.c +++ b/sysdeps/mach/pt-thread-terminate.c @@ -41,9 +41,8 @@ __pthread_thread_terminate (struct __pthread *thread) if (thread->stack) { stackaddr = thread->stackaddr; - stacksize = ((thread->guardsize + __vm_page_size-1) - / __vm_page_size) * __vm_page_size - + thread->stacksize; + stacksize = ((thread->guardsize + __vm_page_size - 1) + / __vm_page_size) * __vm_page_size + thread->stacksize; } else { @@ -60,8 +59,7 @@ __pthread_thread_terminate (struct __pthread *thread) simple routine designed not to require a reply port. */ self_ktid = __mach_thread_self (); reply_port = (self_ktid == kernel_thread) - ? __mig_get_reply_port () - : MACH_PORT_NULL; + ? __mig_get_reply_port () : MACH_PORT_NULL; __mach_port_deallocate (__mach_task_self (), self_ktid); /* Finally done with the thread structure. */ diff --git a/sysdeps/mach/pt-timedblock.c b/sysdeps/mach/pt-timedblock.c index ad0ae0b..4255f77 100644 --- a/sysdeps/mach/pt-timedblock.c +++ b/sysdeps/mach/pt-timedblock.c @@ -29,8 +29,7 @@ /* Block THREAD. */ error_t __pthread_timedblock (struct __pthread *thread, - const struct timespec *abstime, - clockid_t clock_id) + const struct timespec *abstime, clockid_t clock_id) { error_t err; mach_msg_header_t msg; @@ -41,11 +40,10 @@ __pthread_timedblock (struct __pthread *thread, relative time. Arg. */ err = clock_gettime (clock_id, &now); - assert (! err); + assert (!err); if (now.tv_sec > abstime->tv_sec - || (now.tv_sec == abstime->tv_sec - && now.tv_nsec > abstime->tv_nsec)) + || (now.tv_sec == abstime->tv_sec && now.tv_nsec > abstime->tv_nsec)) return ETIMEDOUT; timeout = (abstime->tv_sec - now.tv_sec) * 1000; diff --git a/sysdeps/mach/pt-wakeup.c b/sysdeps/mach/pt-wakeup.c index 71f6efa..1e5488f 100644 --- a/sysdeps/mach/pt-wakeup.c +++ b/sysdeps/mach/pt-wakeup.c @@ -32,6 +32,6 @@ __pthread_wakeup (struct __pthread *thread) err = __mach_msg (&thread->wakeupmsg, MACH_SEND_MSG | MACH_SEND_TIMEOUT, sizeof (thread->wakeupmsg), 0, MACH_PORT_NULL, - 0 , MACH_PORT_NULL); + 0, MACH_PORT_NULL); assert_perror (err); } |