From e9c9ee9fe694067ee96643d05d6ac378349386bb Mon Sep 17 00:00:00 2001 From: Siva Chandra Reddy Date: Tue, 15 Mar 2022 21:34:51 +0000 Subject: [PATCH] [libc][NFC] Fix typos and reduntent code triggering compiler warinings. --- libc/src/__support/threads/linux/mutex.h | 4 ---- libc/src/threads/mtx_init.cpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/libc/src/__support/threads/linux/mutex.h b/libc/src/__support/threads/linux/mutex.h index feb5c0f..9b2bfa2 100644 --- a/libc/src/__support/threads/linux/mutex.h +++ b/libc/src/__support/threads/linux/mutex.h @@ -96,10 +96,6 @@ public: continue; case LockState::Free: // If it was LockState::Free, we shouldn't be here at all. - [[clang::fallthrough]]; - default: - // Mutex status cannot be anything else. So control should not reach - // here at all. return MutexError::BAD_LOCK_STATE; } } diff --git a/libc/src/threads/mtx_init.cpp b/libc/src/threads/mtx_init.cpp index 367e91d..f3d1ee6 100644 --- a/libc/src/threads/mtx_init.cpp +++ b/libc/src/threads/mtx_init.cpp @@ -14,7 +14,7 @@ namespace __llvm_libc { LLVM_LIBC_FUNCTION(int, mtx_init, (mtx_t * m, int type)) { - auto err = Mutex::init(m, type | mtx_timed, type | mtx_recursive, 0); + auto err = Mutex::init(m, type & mtx_timed, type & mtx_recursive, 0); return err == MutexError::NONE ? thrd_success : thrd_error; } -- 2.7.4