From 8620de6b2030bef35360d029354f672cde8978f1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 15 Jan 2021 02:02:57 -0500 Subject: common/bit_util: Replace CLZ/CTZ operations with standardized ones Makes for less code that we need to maintain. --- src/core/hle/kernel/process_capability.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core/hle/kernel/process_capability.cpp') diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp index 0f128c586..0566311b6 100644 --- a/src/core/hle/kernel/process_capability.cpp +++ b/src/core/hle/kernel/process_capability.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include + #include "common/bit_util.h" #include "common/logging/log.h" #include "core/hle/kernel/errors.h" @@ -60,7 +62,7 @@ constexpr CapabilityType GetCapabilityType(u32 value) { u32 GetFlagBitOffset(CapabilityType type) { const auto value = static_cast(type); - return static_cast(Common::BitSize() - Common::CountLeadingZeroes32(value)); + return static_cast(Common::BitSize() - static_cast(std::countl_zero(value))); } } // Anonymous namespace -- cgit v1.2.3