From 008442898ccb9c12c617a153236990e4517f8353 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 27 Mar 2018 21:07:51 -0400 Subject: [PATCH] LinearDiskCache: Don't cast away const in Read() We really shouldn't make the out pointer in the read function const and then summarily cast it away. Also alters Write to be consistent with casting. --- Source/Core/Common/LinearDiskCache.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Common/LinearDiskCache.h b/Source/Core/Common/LinearDiskCache.h index e97f23a11f..4268d2b516 100644 --- a/Source/Core/Common/LinearDiskCache.h +++ b/Source/Core/Common/LinearDiskCache.h @@ -163,13 +163,13 @@ private: template bool Write(const D* data, u32 count = 1) { - return m_file.write((const char*)data, count * sizeof(D)).good(); + return m_file.write(reinterpret_cast(data), count * sizeof(D)).good(); } template - bool Read(const D* data, u32 count = 1) + bool Read(D* data, u32 count = 1) { - return m_file.read((char*)data, count * sizeof(D)).good(); + return m_file.read(reinterpret_cast(data), count * sizeof(D)).good(); } struct Header