From 67a75f37b9233b63210e8ab07d9f7c64e9a71c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Kardos?= Date: Mon, 11 Mar 2024 19:11:25 +0100 Subject: [PATCH] code quality --- include/asyncpp/semaphore.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/asyncpp/semaphore.hpp b/include/asyncpp/semaphore.hpp index 2134b7f..4c9f9f6 100644 --- a/include/asyncpp/semaphore.hpp +++ b/include/asyncpp/semaphore.hpp @@ -31,7 +31,7 @@ class counting_semaphore { }; public: - counting_semaphore(ptrdiff_t current_counter = 0, ptrdiff_t max_counter = std::numeric_limits::max()) noexcept; + explicit counting_semaphore(ptrdiff_t current_counter = 0, ptrdiff_t max_counter = std::numeric_limits::max()) noexcept; bool try_acquire() noexcept; awaitable operator co_await() noexcept; @@ -55,7 +55,7 @@ class counting_semaphore { class binary_semaphore : public counting_semaphore { public: - binary_semaphore(bool is_free = false) : counting_semaphore(ptrdiff_t(is_free), 1) {} + explicit binary_semaphore(bool is_free = false) : counting_semaphore(static_cast(is_free), 1) {} };