mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Merge pull request #9194 from leoetlino/offsetof-warning
IOS/USB: Fix -Winvalid-offset warnings
This commit is contained in:
commit
fe727ed1d0
@ -24,8 +24,11 @@ namespace IOS::HLE::Device
|
|||||||
{
|
{
|
||||||
OH0::OH0(Kernel& ios, const std::string& device_name) : USBHost(ios, device_name)
|
OH0::OH0(Kernel& ios, const std::string& device_name) : USBHost(ios, device_name)
|
||||||
{
|
{
|
||||||
static_assert(offsetof(OH0, m_scan_thread) == sizeof(OH0) - sizeof(ScanThread),
|
}
|
||||||
"ScanThread must be the last data member");
|
|
||||||
|
OH0::~OH0()
|
||||||
|
{
|
||||||
|
m_scan_thread.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
IPCCommandResult OH0::Open(const OpenRequest& request)
|
IPCCommandResult OH0::Open(const OpenRequest& request)
|
||||||
|
@ -37,6 +37,7 @@ class OH0 final : public USBHost
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
OH0(Kernel& ios, const std::string& device_name);
|
OH0(Kernel& ios, const std::string& device_name);
|
||||||
|
~OH0() override;
|
||||||
|
|
||||||
IPCCommandResult Open(const OpenRequest& request) override;
|
IPCCommandResult Open(const OpenRequest& request) override;
|
||||||
IPCCommandResult IOCtl(const IOCtlRequest& request) override;
|
IPCCommandResult IOCtl(const IOCtlRequest& request) override;
|
||||||
|
@ -24,8 +24,11 @@ namespace IOS::HLE::Device
|
|||||||
{
|
{
|
||||||
USB_HIDv4::USB_HIDv4(Kernel& ios, const std::string& device_name) : USBHost(ios, device_name)
|
USB_HIDv4::USB_HIDv4(Kernel& ios, const std::string& device_name) : USBHost(ios, device_name)
|
||||||
{
|
{
|
||||||
static_assert(offsetof(USB_HIDv4, m_scan_thread) == sizeof(USB_HIDv4) - sizeof(ScanThread),
|
}
|
||||||
"ScanThread must be the last data member");
|
|
||||||
|
USB_HIDv4::~USB_HIDv4()
|
||||||
|
{
|
||||||
|
m_scan_thread.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
IPCCommandResult USB_HIDv4::IOCtl(const IOCtlRequest& request)
|
IPCCommandResult USB_HIDv4::IOCtl(const IOCtlRequest& request)
|
||||||
|
@ -22,6 +22,7 @@ class USB_HIDv4 final : public USBHost
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
USB_HIDv4(Kernel& ios, const std::string& device_name);
|
USB_HIDv4(Kernel& ios, const std::string& device_name);
|
||||||
|
~USB_HIDv4() override;
|
||||||
|
|
||||||
IPCCommandResult IOCtl(const IOCtlRequest& request) override;
|
IPCCommandResult IOCtl(const IOCtlRequest& request) override;
|
||||||
|
|
||||||
|
@ -18,13 +18,13 @@ namespace IOS::HLE::Device
|
|||||||
{
|
{
|
||||||
constexpr u32 USBV5_VERSION = 0x50001;
|
constexpr u32 USBV5_VERSION = 0x50001;
|
||||||
|
|
||||||
USB_HIDv5::~USB_HIDv5() = default;
|
USB_HIDv5::~USB_HIDv5()
|
||||||
|
{
|
||||||
|
m_scan_thread.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
IPCCommandResult USB_HIDv5::IOCtl(const IOCtlRequest& request)
|
IPCCommandResult USB_HIDv5::IOCtl(const IOCtlRequest& request)
|
||||||
{
|
{
|
||||||
static_assert(offsetof(USB_HIDv5, m_scan_thread) == sizeof(USB_HIDv5) - sizeof(ScanThread),
|
|
||||||
"ScanThread must be the last data member");
|
|
||||||
|
|
||||||
request.Log(GetDeviceName(), Common::Log::IOS_USB);
|
request.Log(GetDeviceName(), Common::Log::IOS_USB);
|
||||||
switch (request.request)
|
switch (request.request)
|
||||||
{
|
{
|
||||||
|
@ -18,13 +18,13 @@ namespace IOS::HLE::Device
|
|||||||
{
|
{
|
||||||
constexpr u32 USBV5_VERSION = 0x50001;
|
constexpr u32 USBV5_VERSION = 0x50001;
|
||||||
|
|
||||||
USB_VEN::~USB_VEN() = default;
|
USB_VEN::~USB_VEN()
|
||||||
|
{
|
||||||
|
m_scan_thread.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
IPCCommandResult USB_VEN::IOCtl(const IOCtlRequest& request)
|
IPCCommandResult USB_VEN::IOCtl(const IOCtlRequest& request)
|
||||||
{
|
{
|
||||||
static_assert(offsetof(USB_VEN, m_scan_thread) == sizeof(USB_VEN) - sizeof(ScanThread),
|
|
||||||
"ScanThread must be the last data member");
|
|
||||||
|
|
||||||
request.Log(GetDeviceName(), Common::Log::IOS_USB);
|
request.Log(GetDeviceName(), Common::Log::IOS_USB);
|
||||||
switch (request.request)
|
switch (request.request)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user