diff options
author | LC <mathew1800@gmail.com> | 2020-10-21 01:19:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 01:19:12 +0200 |
commit | 88d5140cf2f80d51dc297af3a128a4212215149f (patch) | |
tree | cd524e8ab111fba79f75a48cc672cb875251a32f /src/common | |
parent | Merge pull request #4390 from ogniK5377/get-applet-inf-stub (diff) | |
parent | core: Fix clang build (diff) | |
download | yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.gz yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.bz2 yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.lz yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.xz yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.tar.zst yuzu-88d5140cf2f80d51dc297af3a128a4212215149f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/fiber.h | 4 | ||||
-rw-r--r-- | src/common/file_util.h | 3 | ||||
-rw-r--r-- | src/common/math_util.h | 4 | ||||
-rw-r--r-- | src/common/multi_level_queue.h | 2 | ||||
-rw-r--r-- | src/common/spin_lock.h | 8 | ||||
-rw-r--r-- | src/common/swap.h | 10 | ||||
-rw-r--r-- | src/common/thread_queue_list.h | 4 |
7 files changed, 22 insertions, 13 deletions
diff --git a/src/common/fiber.h b/src/common/fiber.h index 89dde5e36..bc1db1582 100644 --- a/src/common/fiber.h +++ b/src/common/fiber.h @@ -41,8 +41,8 @@ public: Fiber(const Fiber&) = delete; Fiber& operator=(const Fiber&) = delete; - Fiber(Fiber&&) = default; - Fiber& operator=(Fiber&&) = default; + Fiber(Fiber&&) = delete; + Fiber& operator=(Fiber&&) = delete; /// Yields control from Fiber 'from' to Fiber 'to' /// Fiber 'from' must be the currently running fiber. diff --git a/src/common/file_util.h b/src/common/file_util.h index 8b587320f..508b7a10a 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -189,7 +189,8 @@ template <typename T> return {}; } last = std::min<std::size_t>(last, vector.size()); - return std::vector<T>(vector.begin() + first, vector.begin() + first + last); + return std::vector<T>(vector.begin() + static_cast<std::ptrdiff_t>(first), + vector.begin() + static_cast<std::ptrdiff_t>(first + last)); } enum class DirectorySeparator { diff --git a/src/common/math_util.h b/src/common/math_util.h index 7cec80d57..4c38d8040 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h @@ -27,7 +27,7 @@ struct Rectangle { if constexpr (std::is_floating_point_v<T>) { return std::abs(right - left); } else { - return std::abs(static_cast<std::make_signed_t<T>>(right - left)); + return static_cast<T>(std::abs(static_cast<std::make_signed_t<T>>(right - left))); } } @@ -35,7 +35,7 @@ struct Rectangle { if constexpr (std::is_floating_point_v<T>) { return std::abs(bottom - top); } else { - return std::abs(static_cast<std::make_signed_t<T>>(bottom - top)); + return static_cast<T>(std::abs(static_cast<std::make_signed_t<T>>(bottom - top))); } } diff --git a/src/common/multi_level_queue.h b/src/common/multi_level_queue.h index 4b305bf40..71613f18b 100644 --- a/src/common/multi_level_queue.h +++ b/src/common/multi_level_queue.h @@ -320,7 +320,7 @@ private: } const auto begin_range = list.begin(); - const auto end_range = std::next(begin_range, shift); + const auto end_range = std::next(begin_range, static_cast<std::ptrdiff_t>(shift)); list.splice(list.end(), list, begin_range, end_range); } diff --git a/src/common/spin_lock.h b/src/common/spin_lock.h index 4f946a258..06ac2f5bb 100644 --- a/src/common/spin_lock.h +++ b/src/common/spin_lock.h @@ -15,6 +15,14 @@ namespace Common { */ class SpinLock { public: + SpinLock() = default; + + SpinLock(const SpinLock&) = delete; + SpinLock& operator=(const SpinLock&) = delete; + + SpinLock(SpinLock&&) = delete; + SpinLock& operator=(SpinLock&&) = delete; + void lock(); void unlock(); [[nodiscard]] bool try_lock(); diff --git a/src/common/swap.h b/src/common/swap.h index 7665942a2..8c68c1f26 100644 --- a/src/common/swap.h +++ b/src/common/swap.h @@ -504,35 +504,35 @@ bool operator==(const S& p, const swap_struct_t<T, F> v) { template <typename T> struct swap_64_t { static T swap(T x) { - return static_cast<T>(Common::swap64(x)); + return static_cast<T>(Common::swap64(static_cast<u64>(x))); } }; template <typename T> struct swap_32_t { static T swap(T x) { - return static_cast<T>(Common::swap32(x)); + return static_cast<T>(Common::swap32(static_cast<u32>(x))); } }; template <typename T> struct swap_16_t { static T swap(T x) { - return static_cast<T>(Common::swap16(x)); + return static_cast<T>(Common::swap16(static_cast<u16>(x))); } }; template <typename T> struct swap_float_t { static T swap(T x) { - return static_cast<T>(Common::swapf(x)); + return static_cast<T>(Common::swapf(static_cast<float>(x))); } }; template <typename T> struct swap_double_t { static T swap(T x) { - return static_cast<T>(Common::swapd(x)); + return static_cast<T>(Common::swapd(static_cast<double>(x))); } }; diff --git a/src/common/thread_queue_list.h b/src/common/thread_queue_list.h index def9e5d8d..69c9193da 100644 --- a/src/common/thread_queue_list.h +++ b/src/common/thread_queue_list.h @@ -33,7 +33,7 @@ struct ThreadQueueList { } } - return -1; + return static_cast<Priority>(-1); } [[nodiscard]] T get_first() const { @@ -156,7 +156,7 @@ private: void link(Priority priority) { Queue* cur = &queues[priority]; - for (int i = priority - 1; i >= 0; --i) { + for (auto i = static_cast<int>(priority - 1); i >= 0; --i) { if (queues[i].next_nonempty != UnlinkedTag()) { cur->next_nonempty = queues[i].next_nonempty; queues[i].next_nonempty = cur; |