From 642284fec41d199b5c87b622019b315045688085 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 15 Jul 2016 01:22:28 -0400 Subject: [PATCH 1/2] EXI_Channel: Use std::array --- Source/Core/Core/HW/EXI_Channel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/EXI_Channel.h b/Source/Core/Core/HW/EXI_Channel.h index 9ae2c409f0..4b95d50a70 100644 --- a/Source/Core/Core/HW/EXI_Channel.h +++ b/Source/Core/Core/HW/EXI_Channel.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include "Common/CommonTypes.h" @@ -79,7 +80,7 @@ private: NUM_DEVICES = 3 }; - std::unique_ptr m_pDevices[NUM_DEVICES]; + std::array, NUM_DEVICES> m_pDevices; // Since channels operate a bit differently from each other u32 m_ChannelId; From 5b2ddbc4b22938928ffc00f4d87b147f41cc7ea2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 15 Jul 2016 01:43:04 -0400 Subject: [PATCH 2/2] EXI_Channel: Change m_pDevices to m_devices Basic name change to get rid of (incorrect) Hungarian notation --- Source/Core/Core/HW/EXI_Channel.cpp | 18 +++++++++--------- Source/Core/Core/HW/EXI_Channel.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Core/Core/HW/EXI_Channel.cpp b/Source/Core/Core/HW/EXI_Channel.cpp index 799c07bd22..e9d5a28c9d 100644 --- a/Source/Core/Core/HW/EXI_Channel.cpp +++ b/Source/Core/Core/HW/EXI_Channel.cpp @@ -30,7 +30,7 @@ CEXIChannel::CEXIChannel(u32 ChannelId) if (m_ChannelId == 1) m_Status.CHIP_SELECT = 1; - for (auto& device : m_pDevices) + for (auto& device : m_devices) device = EXIDevice_Create(EXIDEVICE_NONE, m_ChannelId); } @@ -161,7 +161,7 @@ void CEXIChannel::SendTransferComplete() void CEXIChannel::RemoveDevices() { - for (auto& device : m_pDevices) + for (auto& device : m_devices) device.reset(nullptr); } @@ -176,7 +176,7 @@ void CEXIChannel::AddDevice(std::unique_ptr device, const int device _dbg_assert_(EXPANSIONINTERFACE, device_num < NUM_DEVICES); // Replace it with the new one - m_pDevices[device_num] = std::move(device); + m_devices[device_num] = std::move(device); if (notify_presence_changed) { @@ -214,11 +214,11 @@ IEXIDevice* CEXIChannel::GetDevice(const u8 chip_select) switch (chip_select) { case 1: - return m_pDevices[0].get(); + return m_devices[0].get(); case 2: - return m_pDevices[1].get(); + return m_devices[1].get(); case 4: - return m_pDevices[2].get(); + return m_devices[2].get(); } return nullptr; } @@ -233,7 +233,7 @@ void CEXIChannel::DoState(PointerWrap& p) for (int device_index = 0; device_index < NUM_DEVICES; ++device_index) { - std::unique_ptr& device = m_pDevices[device_index]; + std::unique_ptr& device = m_devices[device_index]; TEXIDevices type = device->m_deviceType; p.Do(type); @@ -252,13 +252,13 @@ void CEXIChannel::DoState(PointerWrap& p) void CEXIChannel::PauseAndLock(bool doLock, bool unpauseOnUnlock) { - for (auto& device : m_pDevices) + for (auto& device : m_devices) device->PauseAndLock(doLock, unpauseOnUnlock); } IEXIDevice* CEXIChannel::FindDevice(TEXIDevices device_type, int customIndex) { - for (auto& sup : m_pDevices) + for (auto& sup : m_devices) { IEXIDevice* device = sup->FindDevice(device_type, customIndex); if (device) diff --git a/Source/Core/Core/HW/EXI_Channel.h b/Source/Core/Core/HW/EXI_Channel.h index 4b95d50a70..47ef7feb49 100644 --- a/Source/Core/Core/HW/EXI_Channel.h +++ b/Source/Core/Core/HW/EXI_Channel.h @@ -80,7 +80,7 @@ private: NUM_DEVICES = 3 }; - std::array, NUM_DEVICES> m_pDevices; + std::array, NUM_DEVICES> m_devices; // Since channels operate a bit differently from each other u32 m_ChannelId;