mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
WiimoteDevice: Make channel reference const qualified
This is only used for reading data, not modifying it, so make the type system enforce that.
This commit is contained in:
@ -271,14 +271,14 @@ void WiimoteDevice::ExecuteL2capCmd(u8* _pData, u32 _Size)
|
|||||||
{
|
{
|
||||||
DEBUG_ASSERT_MSG(IOS_WIIMOTE, DoesChannelExist(pHeader->dcid),
|
DEBUG_ASSERT_MSG(IOS_WIIMOTE, DoesChannelExist(pHeader->dcid),
|
||||||
"L2CAP: SendACLPacket to unknown channel %i", 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;
|
const int number = m_ConnectionHandle & 0xFF;
|
||||||
|
|
||||||
if (itr != m_Channel.end())
|
if (itr != m_Channel.end())
|
||||||
{
|
{
|
||||||
SChannel& rChannel = itr->second;
|
const SChannel& channel = itr->second;
|
||||||
switch (rChannel.PSM)
|
switch (channel.PSM)
|
||||||
{
|
{
|
||||||
case L2CAP_PSM_SDP:
|
case L2CAP_PSM_SDP:
|
||||||
HandleSDP(pHeader->dcid, pData, DataSize);
|
HandleSDP(pHeader->dcid, pData, DataSize);
|
||||||
@ -304,7 +304,7 @@ void WiimoteDevice::ExecuteL2capCmd(u8* _pData, u32 _Size)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user