From 0d0f58005bdb9f9ce3525f2d24f2b8d84d3996b9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 10 Jun 2018 09:08:31 -0400 Subject: [PATCH] WiimoteDevice: Make channel reference const qualified This is only used for reading data, not modifying it, so make the type system enforce that. --- Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp index 9651221e4b..1aef6a7d85 100644 --- a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp +++ b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp @@ -271,14 +271,14 @@ void WiimoteDevice::ExecuteL2capCmd(u8* _pData, u32 _Size) { DEBUG_ASSERT_MSG(IOS_WIIMOTE, DoesChannelExist(pHeader->dcid), "L2CAP: SendACLPacket to unknown channel %i", pHeader->dcid); - CChannelMap::iterator itr = m_Channel.find(pHeader->dcid); + const auto itr = m_Channel.find(pHeader->dcid); const int number = m_ConnectionHandle & 0xFF; if (itr != m_Channel.end()) { - SChannel& rChannel = itr->second; - switch (rChannel.PSM) + const SChannel& channel = itr->second; + switch (channel.PSM) { case L2CAP_PSM_SDP: HandleSDP(pHeader->dcid, pData, DataSize); @@ -304,7 +304,7 @@ void WiimoteDevice::ExecuteL2capCmd(u8* _pData, u32 _Size) break; default: - ERROR_LOG(IOS_WIIMOTE, "Channel 0x04%x has unknown PSM %x", pHeader->dcid, rChannel.PSM); + ERROR_LOG(IOS_WIIMOTE, "Channel 0x04%x has unknown PSM %x", pHeader->dcid, channel.PSM); break; } }