WiimoteDevice: Make Callback_WiimoteInterruptChannel() accept its data 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.
This commit is contained in:
Lioncash 2018-06-20 15:23:48 -04:00
parent 2b60fe684c
commit e4b6d7626b
2 changed files with 5 additions and 7 deletions

View File

@ -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);

View File

@ -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);
}
}