diff options
| author | Matthew Parlane <parlane@gmail.com> | 2014-03-10 09:24:09 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2014-03-10 09:24:09 +1300 |
| commit | 633dc75e857d649ffab7c4398e92536bccc9e1de (patch) | |
| tree | f9aa8831a0731ea246bd921d979f4bffa7f07bd0 /Source/Core/InputCommon/ControllerInterface/Xlib | |
| parent | f4012638672472afdbd9956229f273a18a77fd77 (diff) | |
| parent | d802d392811be44d34ae9cd23f616db93e54c50f (diff) | |
Merge pull request #142 from Tilka/clang-modernize
Run clang-modernize and manually fix the result
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/Xlib')
4 files changed, 32 insertions, 32 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp index 802346b81d..9fb9e96f6e 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp @@ -48,7 +48,7 @@ namespace XInput2 // This function will add zero or more KeyboardMouse objects to devices. void Init(std::vector<Core::Device*>& devices, void* const hwnd) { - Display* dpy = XOpenDisplay(NULL); + Display* dpy = XOpenDisplay(nullptr); // xi_opcode is important; it will be used to identify XInput events by // the polling loop in UpdateInput. @@ -129,7 +129,7 @@ KeyboardMouse::KeyboardMouse(Window window, int opcode, int pointer, int keyboar // which it can individually filter to get just the events it's interested // in. So be aware that each KeyboardMouse object actually has its own X11 // "context." - m_display = XOpenDisplay(NULL); + m_display = XOpenDisplay(nullptr); int min_keycode, max_keycode; XDisplayKeycodes(m_display, &min_keycode, &max_keycode); @@ -326,7 +326,7 @@ KeyboardMouse::Key::Key(Display* const display, KeyCode keycode, const char* key // 0x0110ffff is the top of the unicode character range according // to keysymdef.h although it is probably more than we need. if (keysym == NoSymbol || keysym > 0x0110ffff || - XKeysymToString(keysym) == NULL) + XKeysymToString(keysym) == nullptr) m_keyname = std::string(); else m_keyname = std::string(XKeysymToString(keysym)); diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h index 2714b70221..167f9af113 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h @@ -39,9 +39,9 @@ private: { friend class KeyboardMouse; public: - std::string GetName() const { return m_keyname; } + std::string GetName() const override { return m_keyname; } Key(Display* display, KeyCode keycode, const char* keyboard); - ControlState GetState() const; + ControlState GetState() const override; private: std::string m_keyname; @@ -53,9 +53,9 @@ private: class Button : public Input { public: - std::string GetName() const { return name; } + std::string GetName() const override { return name; } Button(unsigned int index, unsigned int& buttons); - ControlState GetState() const; + ControlState GetState() const override; private: const unsigned int& m_buttons; @@ -66,10 +66,10 @@ private: class Cursor : public Input { public: - std::string GetName() const { return name; } - bool IsDetectable() { return false; } + std::string GetName() const override { return name; } + bool IsDetectable() override { return false; } Cursor(u8 index, bool positive, const float& cursor); - ControlState GetState() const; + ControlState GetState() const override; private: const float& m_cursor; @@ -81,10 +81,10 @@ private: class Axis : public Input { public: - std::string GetName() const { return name; } - bool IsDetectable() { return false; } + std::string GetName() const override { return name; } + bool IsDetectable() override { return false; } Axis(u8 index, bool positive, const float& axis); - ControlState GetState() const; + ControlState GetState() const override; private: const float& m_axis; @@ -98,15 +98,15 @@ private: void UpdateCursor(); public: - bool UpdateInput(); - bool UpdateOutput(); + bool UpdateInput() override; + bool UpdateOutput() override; KeyboardMouse(Window window, int opcode, int pointer_deviceid, int keyboard_deviceid); ~KeyboardMouse(); - std::string GetName() const; - std::string GetSource() const; - int GetId() const; + std::string GetName() const override; + std::string GetSource() const override; + int GetId() const override; private: Window m_window; diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.cpp b/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.cpp index 0d2bdab8f8..18f1141c6d 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.cpp @@ -16,7 +16,7 @@ KeyboardMouse::KeyboardMouse(Window window) : m_window(window) { memset(&m_state, 0, sizeof(m_state)); - m_display = XOpenDisplay(NULL); + m_display = XOpenDisplay(nullptr); int min_keycode, max_keycode; XDisplayKeycodes(m_display, &min_keycode, &max_keycode); @@ -107,7 +107,7 @@ KeyboardMouse::Key::Key(Display* const display, KeyCode keycode, const char* key // 0x0110ffff is the top of the unicode character range according // to keysymdef.h although it is probably more than we need. if (keysym == NoSymbol || keysym > 0x0110ffff || - XKeysymToString(keysym) == NULL) + XKeysymToString(keysym) == nullptr) m_keyname = std::string(); else m_keyname = std::string(XKeysymToString(keysym)); diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h b/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h index 9c506f67fe..237b3a484e 100644 --- a/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h +++ b/Source/Core/InputCommon/ControllerInterface/Xlib/Xlib.h @@ -30,9 +30,9 @@ private: { friend class KeyboardMouse; public: - std::string GetName() const; + std::string GetName() const override; Key(Display* display, KeyCode keycode, const char* keyboard); - ControlState GetState() const; + ControlState GetState() const override; private: std::string m_keyname; @@ -44,10 +44,10 @@ private: class Button : public Input { public: - std::string GetName() const; + std::string GetName() const override; Button(unsigned int index, unsigned int& buttons) : m_buttons(buttons), m_index(index) {} - ControlState GetState() const; + ControlState GetState() const override; private: const unsigned int& m_buttons; @@ -57,11 +57,11 @@ private: class Cursor : public Input { public: - std::string GetName() const; - bool IsDetectable() { return false; } + std::string GetName() const override; + bool IsDetectable() override { return false; } Cursor(u8 index, bool positive, const float& cursor) : m_cursor(cursor), m_index(index), m_positive(positive) {} - ControlState GetState() const; + ControlState GetState() const override; private: const float& m_cursor; @@ -70,15 +70,15 @@ private: }; public: - bool UpdateInput(); - bool UpdateOutput(); + bool UpdateInput() override; + bool UpdateOutput() override; KeyboardMouse(Window window); ~KeyboardMouse(); - std::string GetName() const; - std::string GetSource() const; - int GetId() const; + std::string GetName() const override; + std::string GetSource() const override; + int GetId() const override; private: Window m_window; |
