From dda42962e23746a9e5f9327a58ef8186a9da3df0 Mon Sep 17 00:00:00 2001 From: ndeadly <24677491+ndeadly@users.noreply.github.com> Date: Wed, 1 Jul 2020 15:29:09 +0200 Subject: [PATCH] btdrv-mitm: make use of auto --- btdrv-mitm/source/bluetooth/bluetooth_core.cpp | 2 +- btdrv-mitm/source/bluetooth/bluetooth_hid.cpp | 3 ++- btdrv-mitm/source/bluetooth/bluetooth_hid_report.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/btdrv-mitm/source/bluetooth/bluetooth_core.cpp b/btdrv-mitm/source/bluetooth/bluetooth_core.cpp index 4a0185c..ac379b6 100644 --- a/btdrv-mitm/source/bluetooth/bluetooth_core.cpp +++ b/btdrv-mitm/source/bluetooth/bluetooth_core.cpp @@ -125,7 +125,7 @@ namespace ams::bluetooth::core { *type = g_currentEventType; std::memcpy(buffer, g_eventDataBuffer, size); - BluetoothEventData *eventData = reinterpret_cast(buffer); + auto eventData = reinterpret_cast(buffer); if (program_id == ncm::SystemProgramId::Btm) { diff --git a/btdrv-mitm/source/bluetooth/bluetooth_hid.cpp b/btdrv-mitm/source/bluetooth/bluetooth_hid.cpp index c063be0..390349b 100644 --- a/btdrv-mitm/source/bluetooth/bluetooth_hid.cpp +++ b/btdrv-mitm/source/bluetooth/bluetooth_hid.cpp @@ -106,7 +106,8 @@ namespace ams::bluetooth::hid { //os::TimedWaitEvent(&g_dataReadEvent, TimeSpan::FromMilliSeconds(500)); } - HidEventData *eventData = reinterpret_cast(g_eventDataBuffer); + auto eventData = reinterpret_cast(g_eventDataBuffer); + switch (g_currentEventType) { case HidEvent_ConnectionState: diff --git a/btdrv-mitm/source/bluetooth/bluetooth_hid_report.cpp b/btdrv-mitm/source/bluetooth/bluetooth_hid_report.cpp index 0eafebe..4d69939 100644 --- a/btdrv-mitm/source/bluetooth/bluetooth_hid_report.cpp +++ b/btdrv-mitm/source/bluetooth/bluetooth_hid_report.cpp @@ -155,7 +155,7 @@ namespace ams::bluetooth::hid::report { *type = g_currentEventType; if (g_currentEventType == HidEvent_GetReport) { - HidEventData *eventData = reinterpret_cast(g_eventDataBuffer); + auto eventData = reinterpret_cast(g_eventDataBuffer); auto controller = ams::mitm::btdrv::locateController(&eventData->getReport.address); if (controller && !controller->isSwitchController()) {