From 997cfa49fcee245d55c87aa8a61d70ceccab6b52 Mon Sep 17 00:00:00 2001 From: Jun Su Date: Mon, 23 Mar 2020 14:26:36 +0800 Subject: [PATCH] InputCommon: cleanup warnings of -Wclass-memaccess Initialize m_state with the default constructor. --- Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp | 2 -- Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp index 540a2ec9a826..d049f22c8c5b 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp @@ -131,8 +131,6 @@ void KeyboardMouse::SelectEventsForDevice(Window window, XIEventMask* mask, int KeyboardMouse::KeyboardMouse(Window window, int opcode, int pointer, int keyboard) : m_window(window), xi_opcode(opcode), pointer_deviceid(pointer), keyboard_deviceid(keyboard) { - memset(&m_state, 0, sizeof(m_state)); - // The cool thing about each KeyboardMouse object having its own Display // is that each one gets its own separate copy of the X11 event stream, // which it can individually filter to get just the events it's interested diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h index f8e1e734c9e7..af452725fcef 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h @@ -105,7 +105,7 @@ class KeyboardMouse : public Core::Device private: Window m_window; Display* m_display; - State m_state; + State m_state{}; int xi_opcode; const int pointer_deviceid, keyboard_deviceid; std::string name;