Permalink
Browse files

WiimoteDevice: Make Callback_WiimoteInterruptChannel() accept its dat…

…a as a u8* rather than void*

All current usages of the function pass in either u8 arrays or pointers,
so we can make this part of the function a concrete type.
  • Loading branch information...
lioncash committed Jun 20, 2018
1 parent 2b60fe6 commit e4b6d7626b296ca88900f28536f8a02878422741
Showing with 5 additions and 7 deletions.
  1. +1 −1 Source/Core/Core/Core.h
  2. +4 −6 Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp
@@ -59,7 +59,7 @@ State GetState();
void SaveScreenShot(bool wait_for_completion = false);
void SaveScreenShot(const std::string& name, bool wait_for_completion = false);
void Callback_WiimoteInterruptChannel(int _number, u16 _channelID, const void* _pData, u32 _Size);
void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const u8* data, u32 size);
// This displays messages in a user-visible way.
void DisplayMessage(const std::string& message, int time_in_ms);
@@ -914,12 +914,10 @@ void WiimoteDevice::ReceiveL2capData(u16 scid, const void* data, u32 size)
namespace Core
{
/* This is called continuously from the Wiimote plugin as soon as it has received
a reporting mode. size is the byte size of the report. */
void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const void* opaque_data, u32 size)
// This is called continuously from the Wiimote plugin as soon as it has received
// a reporting mode. size is the byte size of the report.
void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const u8* data, u32 size)
{
const u8* data = (const u8*)opaque_data;
DEBUG_LOG(WIIMOTE, "====================");
DEBUG_LOG(WIIMOTE, "Callback_WiimoteInterruptChannel: (Wiimote: #%i)", number);
DEBUG_LOG(WIIMOTE, " Data: %s", ArrayToString(data, size, 50).c_str());
@@ -928,6 +926,6 @@ void Callback_WiimoteInterruptChannel(int number, u16 channel_id, const void* op
const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
IOS::HLE::GetIOS()->GetDeviceByName("/dev/usb/oh1/57e/305"));
if (bt)
bt->AccessWiiMote(0x100 + number)->ReceiveL2capData(channel_id, opaque_data, size);
bt->AccessWiiMote(0x100 + number)->ReceiveL2capData(channel_id, data, size);
}
}

0 comments on commit e4b6d76

Please sign in to comment.