summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-04-05 21:28:08 +0200
committerLioncash <mathew1800@gmail.com>2019-04-05 21:29:40 +0200
commit33db37e66923ef90a4071910eea06c79c077cc15 (patch)
tree14a21c505a63fa378be2cc2391c9250f395fdcdd /src/common
parentMerge pull request #2282 from bunnei/gpu-asynch-v2 (diff)
downloadyuzu-33db37e66923ef90a4071910eea06c79c077cc15.tar
yuzu-33db37e66923ef90a4071910eea06c79c077cc15.tar.gz
yuzu-33db37e66923ef90a4071910eea06c79c077cc15.tar.bz2
yuzu-33db37e66923ef90a4071910eea06c79c077cc15.tar.lz
yuzu-33db37e66923ef90a4071910eea06c79c077cc15.tar.xz
yuzu-33db37e66923ef90a4071910eea06c79c077cc15.tar.zst
yuzu-33db37e66923ef90a4071910eea06c79c077cc15.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/bit_util.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/bit_util.h b/src/common/bit_util.h
index a4f9ed4aa..d032df413 100644
--- a/src/common/bit_util.h
+++ b/src/common/bit_util.h
@@ -32,7 +32,7 @@ inline u32 CountLeadingZeroes32(u32 value) {
return 32;
}
-inline u64 CountLeadingZeroes64(u64 value) {
+inline u32 CountLeadingZeroes64(u64 value) {
unsigned long leading_zero = 0;
if (_BitScanReverse64(&leading_zero, value) != 0) {
@@ -47,15 +47,15 @@ inline u32 CountLeadingZeroes32(u32 value) {
return 32;
}
- return __builtin_clz(value);
+ return static_cast<u32>(__builtin_clz(value));
}
-inline u64 CountLeadingZeroes64(u64 value) {
+inline u32 CountLeadingZeroes64(u64 value) {
if (value == 0) {
return 64;
}
- return __builtin_clzll(value);
+ return static_cast<u32>(__builtin_clzll(value));
}
#endif
@@ -70,7 +70,7 @@ inline u32 CountTrailingZeroes32(u32 value) {
return 32;
}
-inline u64 CountTrailingZeroes64(u64 value) {
+inline u32 CountTrailingZeroes64(u64 value) {
unsigned long trailing_zero = 0;
if (_BitScanForward64(&trailing_zero, value) != 0) {
@@ -85,15 +85,15 @@ inline u32 CountTrailingZeroes32(u32 value) {
return 32;
}
- return __builtin_ctz(value);
+ return static_cast<u32>(__builtin_ctz(value));
}
-inline u64 CountTrailingZeroes64(u64 value) {
+inline u32 CountTrailingZeroes64(u64 value) {
if (value == 0) {
return 64;
}
- return __builtin_ctzll(value);
+ return static_cast<u32>(__builtin_ctzll(value));
}
#endif