From 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 13:23:58 +0200 Subject: Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027. --- drivers/unix/rw_lock_posix.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'drivers/unix/rw_lock_posix.cpp') diff --git a/drivers/unix/rw_lock_posix.cpp b/drivers/unix/rw_lock_posix.cpp index f219a0905c..50b74e84f7 100644 --- a/drivers/unix/rw_lock_posix.cpp +++ b/drivers/unix/rw_lock_posix.cpp @@ -37,7 +37,6 @@ #include void RWLockPosix::read_lock() { - int err = pthread_rwlock_rdlock(&rwlock); if (err != 0) { perror("Acquiring lock failed"); @@ -46,12 +45,10 @@ void RWLockPosix::read_lock() { } void RWLockPosix::read_unlock() { - pthread_rwlock_unlock(&rwlock); } Error RWLockPosix::read_try_lock() { - if (pthread_rwlock_tryrdlock(&rwlock) != 0) { return ERR_BUSY; } else { @@ -60,13 +57,11 @@ Error RWLockPosix::read_try_lock() { } void RWLockPosix::write_lock() { - int err = pthread_rwlock_wrlock(&rwlock); ERR_FAIL_COND(err != 0); } void RWLockPosix::write_unlock() { - pthread_rwlock_unlock(&rwlock); } @@ -79,23 +74,19 @@ Error RWLockPosix::write_try_lock() { } RWLock *RWLockPosix::create_func_posix() { - return memnew(RWLockPosix); } void RWLockPosix::make_default() { - create_func = create_func_posix; } RWLockPosix::RWLockPosix() { - //rwlock=PTHREAD_RWLOCK_INITIALIZER; fails on OSX pthread_rwlock_init(&rwlock, nullptr); } RWLockPosix::~RWLockPosix() { - pthread_rwlock_destroy(&rwlock); } -- cgit v1.2.3