diff --git a/Source/Core/VideoCommon/DataReader.h b/Source/Core/VideoCommon/DataReader.h index 51430d508d..fef031206f 100644 --- a/Source/Core/VideoCommon/DataReader.h +++ b/Source/Core/VideoCommon/DataReader.h @@ -13,18 +13,19 @@ class DataReader { public: - __forceinline DataReader() : buffer(nullptr), end(nullptr) {} - __forceinline DataReader(u8* src, u8* _end) : buffer(src), end(_end) {} - __forceinline u8* GetPointer() { return buffer; } - __forceinline u8* operator=(u8* src) + DataReader() = default; + DataReader(u8* src, u8* end_) : buffer(src), end(end_) {} + u8* GetPointer() { return buffer; } + const u8* GetPointer() const { return buffer; } + DataReader& operator=(u8* src) { buffer = src; - return src; + return *this; } - __forceinline size_t size() { return end - buffer; } + size_t size() const { return end - buffer; } template - __forceinline T Peek(int offset = 0) + __forceinline T Peek(int offset = 0) const { T data; std::memcpy(&data, &buffer[offset], sizeof(T)); @@ -54,12 +55,12 @@ public: } template - __forceinline void Skip(size_t data = 1) + void Skip(size_t data = 1) { buffer += sizeof(T) * data; } private: - u8* __restrict buffer; - u8* end; + u8* __restrict buffer = nullptr; + u8* end = nullptr; };