mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:47:45 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -176,7 +176,7 @@ int pthread_detach(pthread_t thread)
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_sigmask.html
|
||||
int pthread_sigmask(int how, const sigset_t* set, sigset_t* old_set)
|
||||
int pthread_sigmask(int how, sigset_t const* set, sigset_t* old_set)
|
||||
{
|
||||
if (sigprocmask(how, set, old_set))
|
||||
return errno;
|
||||
|
@ -184,7 +184,7 @@ int pthread_sigmask(int how, const sigset_t* set, sigset_t* old_set)
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_init.html
|
||||
int pthread_mutex_init(pthread_mutex_t* mutex, const pthread_mutexattr_t* attributes)
|
||||
int pthread_mutex_init(pthread_mutex_t* mutex, pthread_mutexattr_t const* attributes)
|
||||
{
|
||||
return __pthread_mutex_init(mutex, attributes);
|
||||
}
|
||||
|
@ -269,9 +269,9 @@ int pthread_attr_destroy(pthread_attr_t* attributes)
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getdetachstate.html
|
||||
int pthread_attr_getdetachstate(const pthread_attr_t* attributes, int* p_detach_state)
|
||||
int pthread_attr_getdetachstate(pthread_attr_t const* attributes, int* p_detach_state)
|
||||
{
|
||||
auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
|
||||
auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
|
||||
|
||||
if (!attributes_impl || !p_detach_state)
|
||||
return EINVAL;
|
||||
|
@ -305,9 +305,9 @@ int pthread_attr_setdetachstate(pthread_attr_t* attributes, int detach_state)
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getguardsize.html
|
||||
int pthread_attr_getguardsize(const pthread_attr_t* attributes, size_t* p_guard_size)
|
||||
int pthread_attr_getguardsize(pthread_attr_t const* attributes, size_t* p_guard_size)
|
||||
{
|
||||
auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
|
||||
auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
|
||||
|
||||
if (!attributes_impl || !p_guard_size)
|
||||
return EINVAL;
|
||||
|
@ -349,9 +349,9 @@ int pthread_attr_setguardsize(pthread_attr_t* attributes, size_t guard_size)
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getschedparam.html
|
||||
int pthread_attr_getschedparam(const pthread_attr_t* attributes, struct sched_param* p_sched_param)
|
||||
int pthread_attr_getschedparam(pthread_attr_t const* attributes, struct sched_param* p_sched_param)
|
||||
{
|
||||
auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
|
||||
auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
|
||||
|
||||
if (!attributes_impl || !p_sched_param)
|
||||
return EINVAL;
|
||||
|
@ -384,9 +384,9 @@ int pthread_attr_setschedparam(pthread_attr_t* attributes, const struct sched_pa
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getstack.html
|
||||
int pthread_attr_getstack(const pthread_attr_t* attributes, void** p_stack_ptr, size_t* p_stack_size)
|
||||
int pthread_attr_getstack(pthread_attr_t const* attributes, void** p_stack_ptr, size_t* p_stack_size)
|
||||
{
|
||||
auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
|
||||
auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
|
||||
|
||||
if (!attributes_impl || !p_stack_ptr || !p_stack_size)
|
||||
return EINVAL;
|
||||
|
@ -429,9 +429,9 @@ int pthread_attr_setstack(pthread_attr_t* attributes, void* p_stack, size_t stac
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getstacksize.html
|
||||
int pthread_attr_getstacksize(const pthread_attr_t* attributes, size_t* p_stack_size)
|
||||
int pthread_attr_getstacksize(pthread_attr_t const* attributes, size_t* p_stack_size)
|
||||
{
|
||||
auto* attributes_impl = *(reinterpret_cast<const PthreadAttrImpl* const*>(attributes));
|
||||
auto* attributes_impl = *(reinterpret_cast<PthreadAttrImpl const* const*>(attributes));
|
||||
|
||||
if (!attributes_impl || !p_stack_size)
|
||||
return EINVAL;
|
||||
|
@ -465,7 +465,7 @@ int pthread_attr_setstacksize(pthread_attr_t* attributes, size_t stack_size)
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_attr_getscope.html
|
||||
int pthread_attr_getscope([[maybe_unused]] const pthread_attr_t* attributes, [[maybe_unused]] int* contention_scope)
|
||||
int pthread_attr_getscope([[maybe_unused]] pthread_attr_t const* attributes, [[maybe_unused]] int* contention_scope)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -514,12 +514,12 @@ void* pthread_getspecific(pthread_key_t key)
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_setspecific.html
|
||||
int pthread_setspecific(pthread_key_t key, const void* value)
|
||||
int pthread_setspecific(pthread_key_t key, void const* value)
|
||||
{
|
||||
return __pthread_setspecific(key, value);
|
||||
}
|
||||
|
||||
int pthread_setname_np(pthread_t thread, const char* name)
|
||||
int pthread_setname_np(pthread_t thread, char const* name)
|
||||
{
|
||||
if (!name)
|
||||
return EFAULT;
|
||||
|
@ -577,7 +577,7 @@ int pthread_spin_init(pthread_spinlock_t* lock, [[maybe_unused]] int shared)
|
|||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_spin_lock.html
|
||||
int pthread_spin_lock(pthread_spinlock_t* lock)
|
||||
{
|
||||
const auto desired = gettid();
|
||||
auto const desired = gettid();
|
||||
while (true) {
|
||||
auto current = AK::atomic_load(&lock->m_lock);
|
||||
|
||||
|
@ -647,7 +647,7 @@ constexpr static u32 writer_wake_mask = 1 << 31;
|
|||
constexpr static u32 writer_locked_mask = 1 << 17;
|
||||
constexpr static u32 writer_intent_mask = 1 << 16;
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_rwlock_init.html
|
||||
int pthread_rwlock_init(pthread_rwlock_t* __restrict lockp, const pthread_rwlockattr_t* __restrict attr)
|
||||
int pthread_rwlock_init(pthread_rwlock_t* __restrict lockp, pthread_rwlockattr_t const* __restrict attr)
|
||||
{
|
||||
// Just ignore the attributes. use defaults for now.
|
||||
(void)attr;
|
||||
|
@ -868,7 +868,7 @@ int pthread_rwlockattr_destroy(pthread_rwlockattr_t*)
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_rwlockattr_getpshared.html
|
||||
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t* __restrict, int* __restrict)
|
||||
int pthread_rwlockattr_getpshared(pthread_rwlockattr_t const* __restrict, int* __restrict)
|
||||
{
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ int pthread_join(pthread_t, void**);
|
|||
int pthread_mutex_lock(pthread_mutex_t*);
|
||||
int pthread_mutex_trylock(pthread_mutex_t* mutex);
|
||||
int pthread_mutex_unlock(pthread_mutex_t*);
|
||||
int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*);
|
||||
int pthread_mutex_init(pthread_mutex_t*, pthread_mutexattr_t const*);
|
||||
int pthread_mutex_destroy(pthread_mutex_t*);
|
||||
|
||||
int pthread_attr_init(pthread_attr_t*);
|
||||
|
@ -35,31 +35,31 @@ int pthread_attr_destroy(pthread_attr_t*);
|
|||
|
||||
#define PTHREAD_CANCELED (-1)
|
||||
|
||||
int pthread_attr_getdetachstate(const pthread_attr_t*, int*);
|
||||
int pthread_attr_getdetachstate(pthread_attr_t const*, int*);
|
||||
int pthread_attr_setdetachstate(pthread_attr_t*, int);
|
||||
|
||||
int pthread_attr_getguardsize(const pthread_attr_t*, size_t*);
|
||||
int pthread_attr_getguardsize(pthread_attr_t const*, size_t*);
|
||||
int pthread_attr_setguardsize(pthread_attr_t*, size_t);
|
||||
|
||||
int pthread_attr_getschedparam(const pthread_attr_t*, struct sched_param*);
|
||||
int pthread_attr_getschedparam(pthread_attr_t const*, struct sched_param*);
|
||||
int pthread_attr_setschedparam(pthread_attr_t*, const struct sched_param*);
|
||||
|
||||
int pthread_attr_getstack(const pthread_attr_t*, void**, size_t*);
|
||||
int pthread_attr_getstack(pthread_attr_t const*, void**, size_t*);
|
||||
int pthread_attr_setstack(pthread_attr_t* attr, void*, size_t);
|
||||
|
||||
int pthread_attr_getstacksize(const pthread_attr_t*, size_t*);
|
||||
int pthread_attr_getstacksize(pthread_attr_t const*, size_t*);
|
||||
int pthread_attr_setstacksize(pthread_attr_t*, size_t);
|
||||
|
||||
#define PTHREAD_SCOPE_SYSTEM 0
|
||||
#define PTHREAD_SCOPE_PROCESS 1
|
||||
|
||||
int pthread_attr_getscope(const pthread_attr_t*, int*);
|
||||
int pthread_attr_getscope(pthread_attr_t const*, int*);
|
||||
int pthread_attr_setscope(pthread_attr_t*, int);
|
||||
|
||||
int pthread_once(pthread_once_t*, void (*)(void));
|
||||
#define PTHREAD_ONCE_INIT 0
|
||||
void* pthread_getspecific(pthread_key_t key);
|
||||
int pthread_setspecific(pthread_key_t key, const void* value);
|
||||
int pthread_setspecific(pthread_key_t key, void const* value);
|
||||
|
||||
int pthread_getschedparam(pthread_t thread, int* policy, struct sched_param* param);
|
||||
int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param* param);
|
||||
|
@ -88,7 +88,7 @@ int pthread_setschedparam(pthread_t thread, int policy, const struct sched_param
|
|||
int pthread_key_create(pthread_key_t* key, void (*destructor)(void*));
|
||||
int pthread_key_delete(pthread_key_t key);
|
||||
int pthread_cond_broadcast(pthread_cond_t*);
|
||||
int pthread_cond_init(pthread_cond_t*, const pthread_condattr_t*);
|
||||
int pthread_cond_init(pthread_cond_t*, pthread_condattr_t const*);
|
||||
int pthread_cond_signal(pthread_cond_t*);
|
||||
int pthread_cond_wait(pthread_cond_t*, pthread_mutex_t*);
|
||||
int pthread_condattr_init(pthread_condattr_t*);
|
||||
|
@ -122,13 +122,13 @@ int pthread_mutexattr_settype(pthread_mutexattr_t*, int);
|
|||
int pthread_mutexattr_gettype(pthread_mutexattr_t*, int*);
|
||||
int pthread_mutexattr_destroy(pthread_mutexattr_t*);
|
||||
|
||||
int pthread_setname_np(pthread_t, const char*);
|
||||
int pthread_setname_np(pthread_t, char const*);
|
||||
int pthread_getname_np(pthread_t, char*, size_t);
|
||||
|
||||
int pthread_equal(pthread_t t1, pthread_t t2);
|
||||
|
||||
int pthread_rwlock_destroy(pthread_rwlock_t*);
|
||||
int pthread_rwlock_init(pthread_rwlock_t* __restrict, const pthread_rwlockattr_t* __restrict);
|
||||
int pthread_rwlock_init(pthread_rwlock_t* __restrict, pthread_rwlockattr_t const* __restrict);
|
||||
int pthread_rwlock_rdlock(pthread_rwlock_t*);
|
||||
int pthread_rwlock_timedrdlock(pthread_rwlock_t* __restrict, const struct timespec* __restrict);
|
||||
int pthread_rwlock_timedwrlock(pthread_rwlock_t* __restrict, const struct timespec* __restrict);
|
||||
|
@ -137,7 +137,7 @@ int pthread_rwlock_trywrlock(pthread_rwlock_t*);
|
|||
int pthread_rwlock_unlock(pthread_rwlock_t*);
|
||||
int pthread_rwlock_wrlock(pthread_rwlock_t*);
|
||||
int pthread_rwlockattr_destroy(pthread_rwlockattr_t*);
|
||||
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t* __restrict, int* __restrict);
|
||||
int pthread_rwlockattr_getpshared(pthread_rwlockattr_t const* __restrict, int* __restrict);
|
||||
int pthread_rwlockattr_init(pthread_rwlockattr_t*);
|
||||
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int);
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ static constexpr u32 NEED_TO_WAKE_ALL = 2;
|
|||
static constexpr u32 INCREMENT = 4;
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_init.html
|
||||
int pthread_cond_init(pthread_cond_t* cond, const pthread_condattr_t* attr)
|
||||
int pthread_cond_init(pthread_cond_t* cond, pthread_condattr_t const* attr)
|
||||
{
|
||||
cond->mutex = nullptr;
|
||||
cond->value = 0;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
static constexpr u32 POST_WAKES = 1 << 31;
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_open.html
|
||||
sem_t* sem_open(const char*, int, ...)
|
||||
sem_t* sem_open(char const*, int, ...)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return nullptr;
|
||||
|
@ -31,7 +31,7 @@ int sem_close(sem_t*)
|
|||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_unlink.html
|
||||
int sem_unlink(const char*)
|
||||
int sem_unlink(char const*)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
|
|
|
@ -21,10 +21,10 @@ int sem_close(sem_t*);
|
|||
int sem_destroy(sem_t*);
|
||||
int sem_getvalue(sem_t*, int*);
|
||||
int sem_init(sem_t*, int, unsigned int);
|
||||
sem_t* sem_open(const char*, int, ...);
|
||||
sem_t* sem_open(char const*, int, ...);
|
||||
int sem_post(sem_t*);
|
||||
int sem_trywait(sem_t*);
|
||||
int sem_unlink(const char*);
|
||||
int sem_unlink(char const*);
|
||||
int sem_wait(sem_t*);
|
||||
int sem_timedwait(sem_t*, const struct timespec* abstime);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue