Skip to content

Commit

Permalink
WiimoteDevice: Make Callback_WiimoteInterruptChannel() accept its dat…
Browse files Browse the repository at this point in the history
…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 e4b6d76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/Core.h
Expand Up @@ -59,7 +59,7 @@ State GetState();
void SaveScreenShot(bool wait_for_completion = false); void SaveScreenShot(bool wait_for_completion = false);
void SaveScreenShot(const std::string& name, 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. // This displays messages in a user-visible way.
void DisplayMessage(const std::string& message, int time_in_ms); void DisplayMessage(const std::string& message, int time_in_ms);
Expand Down
10 changes: 4 additions & 6 deletions Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp
Expand Up @@ -914,12 +914,10 @@ void WiimoteDevice::ReceiveL2capData(u16 scid, const void* data, u32 size)


namespace Core namespace Core
{ {
/* This is called continuously from the Wiimote plugin as soon as it has received // 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. */ // 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) 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, "====================");
DEBUG_LOG(WIIMOTE, "Callback_WiimoteInterruptChannel: (Wiimote: #%i)", number); DEBUG_LOG(WIIMOTE, "Callback_WiimoteInterruptChannel: (Wiimote: #%i)", number);
DEBUG_LOG(WIIMOTE, " Data: %s", ArrayToString(data, size, 50).c_str()); DEBUG_LOG(WIIMOTE, " Data: %s", ArrayToString(data, size, 50).c_str());
Expand All @@ -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>( const auto bt = std::static_pointer_cast<IOS::HLE::Device::BluetoothEmu>(
IOS::HLE::GetIOS()->GetDeviceByName("/dev/usb/oh1/57e/305")); IOS::HLE::GetIOS()->GetDeviceByName("/dev/usb/oh1/57e/305"));
if (bt) 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.