mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Remove all remaining volatile qualifiers
This commit is contained in:
@ -32,11 +32,6 @@
|
||||
#include "Common/Inline.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
||||
// XXX: Replace this with std::is_trivially_copyable<T> once we stop using volatile
|
||||
// on things that are put in savestates, as volatile types are not trivially copyable.
|
||||
template <typename T>
|
||||
constexpr bool IsTriviallyCopyable = std::is_trivially_copyable<std::remove_volatile_t<T>>::value;
|
||||
|
||||
// Wrapper class
|
||||
class PointerWrap
|
||||
{
|
||||
@ -181,13 +176,13 @@ public:
|
||||
DoArray(x.data(), static_cast<u32>(x.size()));
|
||||
}
|
||||
|
||||
template <typename T, typename std::enable_if_t<IsTriviallyCopyable<T>, int> = 0>
|
||||
template <typename T, typename std::enable_if_t<std::is_trivially_copyable_v<T>, int> = 0>
|
||||
void DoArray(T* x, u32 count)
|
||||
{
|
||||
DoVoid(x, count * sizeof(T));
|
||||
}
|
||||
|
||||
template <typename T, typename std::enable_if_t<!IsTriviallyCopyable<T>, int> = 0>
|
||||
template <typename T, typename std::enable_if_t<!std::is_trivially_copyable_v<T>, int> = 0>
|
||||
void DoArray(T* x, u32 count)
|
||||
{
|
||||
for (u32 i = 0; i < count; ++i)
|
||||
@ -230,7 +225,7 @@ public:
|
||||
template <typename T>
|
||||
void Do(T& x)
|
||||
{
|
||||
static_assert(IsTriviallyCopyable<T>, "Only sane for trivially copyable types");
|
||||
static_assert(std::is_trivially_copyable_v<T>, "Only sane for trivially copyable types");
|
||||
// Note:
|
||||
// Usually we can just use x = **ptr, etc. However, this doesn't work
|
||||
// for unions containing BitFields (long story, stupid language rules)
|
||||
|
Reference in New Issue
Block a user