From 97aaf3ef9b1a766bd8495187fabbdf649a74424a Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Wed, 24 Aug 2022 03:44:51 +0200 Subject: [PATCH] MemoryCard: Fix variable initializations. Codacy Warning: Variable 'variable' is assigned in constructor body. Consider performing initialization in initialization list. --- pcsx2/MemoryCardFile.cpp | 2 +- pcsx2/MemoryCardFolder.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pcsx2/MemoryCardFile.cpp b/pcsx2/MemoryCardFile.cpp index 90b5c637dd..56151ebab2 100644 --- a/pcsx2/MemoryCardFile.cpp +++ b/pcsx2/MemoryCardFile.cpp @@ -265,9 +265,9 @@ std::string FileMcd_GetDefaultName(uint slot) } FileMemoryCard::FileMemoryCard() + : m_chkaddr(0) { memset8<0xff>(m_effeffs); - m_chkaddr = 0; } void FileMemoryCard::Open() diff --git a/pcsx2/MemoryCardFolder.cpp b/pcsx2/MemoryCardFolder.cpp index 6220ad8350..f6c78f1d97 100644 --- a/pcsx2/MemoryCardFolder.cpp +++ b/pcsx2/MemoryCardFolder.cpp @@ -123,13 +123,13 @@ time_t MemoryCardFileEntryDateTime::ToTime() const } FolderMemoryCard::FolderMemoryCard() + : m_framesUntilFlush(0) + , m_timeLastWritten(0) + , m_slot(0) + , m_isEnabled(false) + , m_performFileWrites(false) + , m_filteringEnabled(false) { - m_slot = 0; - m_isEnabled = false; - m_performFileWrites = false; - m_framesUntilFlush = 0; - m_timeLastWritten = 0; - m_filteringEnabled = false; } void FolderMemoryCard::InitializeInternalData()