diff options
author | bunnei <bunneidev@gmail.com> | 2019-04-06 05:47:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-06 05:47:27 +0200 |
commit | fddafa14c89a8153f944c6c7307cc55d088f0488 (patch) | |
tree | 4a991a1a7fc3b2e55f1f0e789559582fbc3719f9 | |
parent | Merge pull request #2240 from FearlessTobi/port-4651 (diff) | |
parent | common/multi_level_queue: Silence truncation warning in iterator operator++ (diff) | |
download | yuzu-fddafa14c89a8153f944c6c7307cc55d088f0488.tar yuzu-fddafa14c89a8153f944c6c7307cc55d088f0488.tar.gz yuzu-fddafa14c89a8153f944c6c7307cc55d088f0488.tar.bz2 yuzu-fddafa14c89a8153f944c6c7307cc55d088f0488.tar.lz yuzu-fddafa14c89a8153f944c6c7307cc55d088f0488.tar.xz yuzu-fddafa14c89a8153f944c6c7307cc55d088f0488.tar.zst yuzu-fddafa14c89a8153f944c6c7307cc55d088f0488.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/bit_util.h | 16 | ||||
-rw-r--r-- | src/common/multi_level_queue.h | 2 |
2 files changed, 9 insertions, 9 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 diff --git a/src/common/multi_level_queue.h b/src/common/multi_level_queue.h index 2b61b91e0..9cb448f56 100644 --- a/src/common/multi_level_queue.h +++ b/src/common/multi_level_queue.h @@ -72,7 +72,7 @@ public: u64 prios = mlq.used_priorities; prios &= ~((1ULL << (current_priority + 1)) - 1); if (prios == 0) { - current_priority = mlq.depth(); + current_priority = static_cast<u32>(mlq.depth()); } else { current_priority = CountTrailingZeroes64(prios); it = GetBeginItForPrio(); |