summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-06-17 16:39:24 -0400
committerLioncash <mathew1800@gmail.com>2019-06-17 16:51:41 -0400
commitec60027f56bde17ef32a80b9f002225542c5859a (patch)
tree3ef54d831d8690467348db2ad69f50868ed0e3fe /Source/Core/InputCommon/ControllerInterface
parent8e030a4a456cc74289cbed89ee8bbca60c9acc34 (diff)
InputCommon: Use nested namespace specifiers where applicable
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Android/Android.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Android/Android.h8
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInput.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Device.cpp8
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp8
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h8
-rw-r--r--Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSX.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/RunLoopStopper.h8
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/SDL/SDL.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Win32/Win32.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/XInput/XInput.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp7
-rw-r--r--Source/Core/InputCommon/ControllerInterface/evdev/evdev.h7
34 files changed, 69 insertions, 174 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
index 9ab4cbf0f8..910b7553c9 100644
--- a/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/Android/Android.cpp
@@ -8,9 +8,7 @@
#include <thread>
#include "InputCommon/ControllerInterface/ControllerInterface.h"
-namespace ciface
-{
-namespace Android
+namespace ciface::Android
{
void PopulateDevices()
{
@@ -240,5 +238,4 @@ void Touchscreen::Motor::Rumble(int padID, double state)
JNIEnv* env = IDCache::GetEnvForThread();
env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetDoRumble(), padID, state);
}
-} // namespace Android
-} // namespace ciface
+} // namespace ciface::Android
diff --git a/Source/Core/InputCommon/ControllerInterface/Android/Android.h b/Source/Core/InputCommon/ControllerInterface/Android/Android.h
index b917222864..82a1a47954 100644
--- a/Source/Core/InputCommon/ControllerInterface/Android/Android.h
+++ b/Source/Core/InputCommon/ControllerInterface/Android/Android.h
@@ -7,11 +7,10 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "jni/ButtonManager.h"
-namespace ciface
-{
-namespace Android
+namespace ciface::Android
{
void PopulateDevices();
+
class Touchscreen : public Core::Device
{
private:
@@ -65,5 +64,4 @@ public:
private:
const int _padID;
};
-} // namespace Android
-} // namespace ciface
+} // namespace ciface::Android
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp
index 847f4f8103..6afa98ac2d 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp
@@ -14,9 +14,7 @@
#pragma comment(lib, "Dinput8.lib")
#pragma comment(lib, "dxguid.lib")
-namespace ciface
-{
-namespace DInput
+namespace ciface::DInput
{
BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef)
{
@@ -69,5 +67,4 @@ void PopulateDevices(HWND hwnd)
idi8->Release();
}
-} // namespace DInput
-} // namespace ciface
+} // namespace ciface::DInput
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.h b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.h
index 419a942cb4..ed159089e0 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.h
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.h
@@ -12,9 +12,7 @@
#include "InputCommon/ControllerInterface/DInput/DInput8.h"
-namespace ciface
-{
-namespace DInput
+namespace ciface::DInput
{
// BOOL CALLBACK DIEnumEffectsCallback(LPCDIEFFECTINFO pdei, LPVOID pvRef);
BOOL CALLBACK DIEnumDeviceObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef);
@@ -22,5 +20,4 @@ BOOL CALLBACK DIEnumDevicesCallback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef);
std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device);
void PopulateDevices(HWND hwnd);
-} // namespace DInput
-} // namespace ciface
+} // namespace ciface::DInput
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp
index e919952bec..bba6b87ae6 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp
@@ -14,9 +14,7 @@
#include "InputCommon/ControllerInterface/DInput/DInputJoystick.h"
#include "InputCommon/ControllerInterface/DInput/XInputFilter.h"
-namespace ciface
-{
-namespace DInput
+namespace ciface::DInput
{
constexpr DWORD DATA_BUFFER_SIZE = 32;
@@ -315,5 +313,4 @@ ControlState Joystick::Hat::GetState() const
return (abs((int)(m_hat / 4500 - m_direction * 2 + 8) % 8 - 4) > 2);
}
-} // namespace DInput
-} // namespace ciface
+} // namespace ciface::DInput
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.h b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.h
index 074b879051..70e8af8e6e 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.h
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.h
@@ -7,9 +7,7 @@
#include "InputCommon/ControllerInterface/Device.h"
#include "InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h"
-namespace ciface
-{
-namespace DInput
+namespace ciface::DInput
{
void InitJoystick(IDirectInput8* const idi8, HWND hwnd);
@@ -77,5 +75,4 @@ private:
bool m_buffered;
};
-} // namespace DInput
-} // namespace ciface
+} // namespace ciface::DInput
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
index b68c990490..24edc4386c 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.cpp
@@ -17,9 +17,7 @@
// otherwise it is just some crazy value
#define DROP_INPUT_TIME 250
-namespace ciface
-{
-namespace DInput
+namespace ciface::DInput
{
static const struct
{
@@ -227,5 +225,4 @@ ControlState KeyboardMouse::Cursor::GetState() const
{
return m_axis / (m_positive ? 1.0 : -1.0);
}
-} // namespace DInput
-} // namespace ciface
+} // namespace ciface::DInput
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
index 7d533314c3..e1d2500b15 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputKeyboardMouse.h
@@ -9,9 +9,7 @@
#include "InputCommon/ControllerInterface/DInput/DInput8.h"
#include "InputCommon/ControllerInterface/Device.h"
-namespace ciface
-{
-namespace DInput
+namespace ciface::DInput
{
void InitKeyboardMouse(IDirectInput8* const idi8, HWND hwnd);
@@ -103,5 +101,4 @@ private:
DWORD m_last_update;
State m_state_in;
};
-} // namespace DInput
-} // namespace ciface
+} // namespace ciface::DInput
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp
index 9e704e9420..94040994e7 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.cpp
@@ -9,9 +9,7 @@
#include <Windows.h>
#include <SetupAPI.h>
-namespace ciface
-{
-namespace DInput
+namespace ciface::DInput
{
// Code for enumerating hardware devices that use the XINPUT device driver.
// The MSDN recommended code suffers from massive performance problems when using language packs,
@@ -76,5 +74,4 @@ std::unordered_set<DWORD> GetXInputGUIDS()
SetupDiDestroyDeviceInfoList(setup_enum);
return guids;
}
-} // namespace DInput
-} // namespace ciface
+} // namespace ciface::DInput
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.h b/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.h
index f31e9fb5a2..46955a1eb1 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.h
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/XInputFilter.h
@@ -7,10 +7,7 @@
#include <Windows.h>
#include <unordered_set>
-namespace ciface
-{
-namespace DInput
+namespace ciface::DInput
{
std::unordered_set<DWORD> GetXInputGUIDS();
-}
-} // namespace ciface
+} // namespace ciface::DInput
diff --git a/Source/Core/InputCommon/ControllerInterface/Device.cpp b/Source/Core/InputCommon/ControllerInterface/Device.cpp
index 954d933ad8..5b0fa7ebd1 100644
--- a/Source/Core/InputCommon/ControllerInterface/Device.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/Device.cpp
@@ -14,9 +14,7 @@
#include "Common/StringUtil.h"
#include "Common/Thread.h"
-namespace ciface
-{
-namespace Core
+namespace ciface::Core
{
// Compared to an input's current state (ideally 1.0) minus abs(initial_state) (ideally 0.0).
constexpr ControlState INPUT_DETECT_THRESHOLD = 0.55;
@@ -326,6 +324,4 @@ DeviceContainer::DetectInput(u32 wait_ms, const std::vector<std::string>& device
// No input was detected. :'(
return {};
}
-
-} // namespace Core
-} // namespace ciface
+} // namespace ciface::Core
diff --git a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp
index baa3018616..44fc87b712 100644
--- a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp
@@ -9,9 +9,7 @@
#include "Common/Thread.h"
-namespace ciface
-{
-namespace ForceFeedback
+namespace ciface::ForceFeedback
{
// Template instantiation:
template class ForceFeedbackDevice::TypedForce<DICONSTANTFORCE>;
@@ -257,6 +255,4 @@ void ForceFeedbackDevice::Force::Release()
m_effect->Unload();
m_effect->Release();
}
-
-} // namespace ForceFeedback
-} // namespace ciface
+} // namespace ciface::ForceFeedback
diff --git a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h
index 8f5814106e..c689cef5a5 100644
--- a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h
+++ b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h
@@ -19,9 +19,7 @@
#include "InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h"
#endif
-namespace ciface
-{
-namespace ForceFeedback
+namespace ciface::ForceFeedback
{
class ForceFeedbackDevice : public Core::Device
{
@@ -83,6 +81,4 @@ private:
Common::Event m_update_event;
Common::Flag m_run_thread;
};
-
-} // namespace ForceFeedback
-} // namespace ciface
+} // namespace ciface::ForceFeedback
diff --git a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h
index 0e684251e7..0ebd74d485 100644
--- a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h
+++ b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h
@@ -20,9 +20,7 @@ typedef LONG* LPLONG; // Missing type for ForceFeedback.h
#include "Common/CommonTypes.h" // for LONG
#include "DirectInputConstants.h" // Not stricty necessary
-namespace ciface
-{
-namespace ForceFeedback
+namespace ciface::ForceFeedback
{
// Prototypes
class IUnknownImpl;
@@ -196,5 +194,4 @@ public:
return FFDeviceSetForceFeedbackProperty(m_device, property, &value);
}
};
-} // namespace ForceFeedback
-} // namespace ciface
+} // namespace ciface::ForceFeedback
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.h b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.h
index 64a715b246..955b426f5e 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.h
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.h
@@ -4,14 +4,11 @@
#pragma once
-namespace ciface
-{
-namespace OSX
+namespace ciface::OSX
{
void Init(void* window);
void PopulateDevices(void* window);
void DeInit();
void DeviceElementDebugPrint(const void*, void*);
-} // namespace OSX
-} // namespace ciface
+} // namespace ciface::OSX
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
index a923c1ea26..716a56b61e 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
@@ -17,9 +17,7 @@
#include "InputCommon/ControllerInterface/OSX/OSXJoystick.h"
#include "InputCommon/ControllerInterface/OSX/RunLoopStopper.h"
-namespace ciface
-{
-namespace OSX
+namespace ciface::OSX
{
constexpr CFTimeInterval FOREVER = 1e20;
static std::thread s_hotplug_thread;
@@ -227,5 +225,4 @@ void DeInit()
IOHIDManagerClose(HIDManager, kIOHIDOptionsTypeNone);
CFRelease(HIDManager);
}
-}
-}
+} // namespace ciface::OSX
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h
index d6579dc0c8..377f7d9b29 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.h
@@ -11,9 +11,7 @@
#include "InputCommon/ControllerInterface/Device.h"
#include "InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h"
-namespace ciface
-{
-namespace OSX
+namespace ciface::OSX
{
class Joystick : public ForceFeedback::ForceFeedbackDevice
{
@@ -90,5 +88,4 @@ private:
ForceFeedback::FFDeviceAdapterReference m_ff_device;
};
-} // namespace OSX
-} // namespace ciface
+} // namespace ciface::OSX
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
index e2c08707c5..9ab06c91db 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
@@ -13,9 +13,7 @@
#include "Common/Logging/Log.h"
#include "Common/StringUtil.h"
-namespace ciface
-{
-namespace OSX
+namespace ciface::OSX
{
void Joystick::AddElements(CFArrayRef elements, std::set<IOHIDElementCookie>& cookies)
{
@@ -341,5 +339,4 @@ bool Joystick::IsSameDevice(const IOHIDDeviceRef other_device) const
{
return m_device == other_device;
}
-}
-}
+} // namespace ciface::OSX
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/RunLoopStopper.h b/Source/Core/InputCommon/ControllerInterface/OSX/RunLoopStopper.h
index 0d37098a21..c43a0383dc 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/RunLoopStopper.h
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/RunLoopStopper.h
@@ -6,9 +6,7 @@
#include <Foundation/Foundation.h>
-namespace ciface
-{
-namespace OSX
+namespace ciface::OSX
{
class RunLoopStopper
{
@@ -40,6 +38,4 @@ public:
CFRunLoopRemoveSource(runloop, m_source, mode);
}
};
-
-} // namespace OSX
-} // namespace ciface
+} // namespace ciface::OSX
diff --git a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp
index a0e17da549..6b44466eb6 100644
--- a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.cpp
@@ -20,9 +20,7 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/Pipes/Pipes.h"
-namespace ciface
-{
-namespace Pipes
+namespace ciface::Pipes
{
static const std::array<std::string, 12> s_button_tokens{
{"A", "B", "X", "Y", "Z", "START", "L", "R", "D_UP", "D_DOWN", "D_LEFT", "D_RIGHT"}};
@@ -161,5 +159,4 @@ void PipeDevice::ParseCommand(const std::string& command)
}
}
}
-} // namespace Pipes
-} // namespace ciface
+} // namespace ciface::Pipes
diff --git a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h
index 86202a20f4..3d316f64e4 100644
--- a/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h
+++ b/Source/Core/InputCommon/ControllerInterface/Pipes/Pipes.h
@@ -8,9 +8,7 @@
#include <string>
#include <vector>
-namespace ciface
-{
-namespace Pipes
+namespace ciface::Pipes
{
// To create a piped controller input, create a named pipe in the
// Pipes directory and write commands out to it. Commands are separated
@@ -58,5 +56,4 @@ private:
std::map<std::string, PipeInput*> m_buttons;
std::map<std::string, PipeInput*> m_axes;
};
-} // namespace Pipes
-} // namespace ciface
+} // namespace ciface::Pipes
diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h b/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h
index ca1bbc7725..d36dcdf8bd 100644
--- a/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h
+++ b/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.h
@@ -4,11 +4,8 @@
#pragma once
-namespace ciface
-{
-namespace Quartz
+namespace ciface::Quartz
{
void PopulateDevices(void* window);
void DeInit();
-} // namespace Quartz
-} // namespace ciface
+} // namespace ciface::Quartz
diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm b/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm
index 30802182a8..1201232223 100644
--- a/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm
+++ b/Source/Core/InputCommon/ControllerInterface/Quartz/Quartz.mm
@@ -6,9 +6,7 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h"
-namespace ciface
-{
-namespace Quartz
+namespace ciface::Quartz
{
void PopulateDevices(void* window)
{
@@ -21,5 +19,4 @@ void PopulateDevices(void* window)
void DeInit()
{
}
-} // namespace Quartz
-} // namespace ciface
+} // namespace ciface::Quartz
diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h
index 8997fc0e53..902621cddc 100644
--- a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h
+++ b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.h
@@ -8,9 +8,7 @@
#include "InputCommon/ControllerInterface/Device.h"
-namespace ciface
-{
-namespace Quartz
+namespace ciface::Quartz
{
std::string KeycodeToName(const CGKeyCode keycode);
@@ -73,5 +71,4 @@ private:
uint32_t m_windowid;
};
-} // namespace Quartz
-} // namespace ciface
+} // namespace ciface::Quartz
diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
index a52f8df4b0..6cbc0a3f11 100644
--- a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
+++ b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
@@ -9,9 +9,7 @@
#include <Carbon/Carbon.h>
#include <Cocoa/Cocoa.h>
-namespace ciface
-{
-namespace Quartz
+namespace ciface::Quartz
{
std::string KeycodeToName(const CGKeyCode keycode)
{
@@ -223,5 +221,4 @@ std::string KeyboardAndMouse::Button::GetName() const
return "Right Click";
return std::string("Click ") + char('0' + m_button);
}
-} // namespace Quartz
-} // namespace ciface
+} // namespace ciface::Quartz
diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
index a26deee6e8..2d2d256c2a 100644
--- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
@@ -19,9 +19,7 @@
#pragma comment(lib, "SDL2.lib")
#endif
-namespace ciface
-{
-namespace SDL
+namespace ciface::SDL
{
static std::string GetJoystickName(int index)
{
@@ -491,5 +489,4 @@ ControlState Joystick::Hat::GetState() const
{
return (SDL_JoystickGetHat(m_js, m_index) & (1 << m_direction)) > 0;
}
-} // namespace SDL
-} // namespace ciface
+} // namespace ciface::SDL
diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h
index 890a064d8b..e9ac021bd9 100644
--- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h
+++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.h
@@ -16,9 +16,7 @@
#include "InputCommon/ControllerInterface/Device.h"
-namespace ciface
-{
-namespace SDL
+namespace ciface::SDL
{
void Init();
void DeInit();
@@ -158,5 +156,4 @@ private:
SDL_Haptic* m_haptic;
#endif
};
-} // namespace SDL
-} // namespace ciface
+} // namespace ciface::SDL
diff --git a/Source/Core/InputCommon/ControllerInterface/Win32/Win32.h b/Source/Core/InputCommon/ControllerInterface/Win32/Win32.h
index 5f4a65c509..acf72d76a0 100644
--- a/Source/Core/InputCommon/ControllerInterface/Win32/Win32.h
+++ b/Source/Core/InputCommon/ControllerInterface/Win32/Win32.h
@@ -4,12 +4,9 @@
#pragma once
-namespace ciface
-{
-namespace Win32
+namespace ciface::Win32
{
void Init(void* hwnd);
void PopulateDevices(void* hwnd);
void DeInit();
-} // namespace Win32
-} // namespace ciface
+} // namespace ciface::Win32
diff --git a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
index d6ecdb9d81..cda20a08db 100644
--- a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
@@ -8,9 +8,7 @@
#define XINPUT_GAMEPAD_GUIDE 0x0400
#endif
-namespace ciface
-{
-namespace XInput
+namespace ciface::XInput
{
static const struct
{
@@ -243,5 +241,4 @@ void Device::Motor::SetState(ControlState state)
m_motor = (WORD)(state * m_range);
m_parent->UpdateMotors();
}
-} // namespace XInput
-} // namespace ciface
+} // namespace ciface::XInput
diff --git a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h
index 0b299e6324..3c543fb18f 100644
--- a/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h
+++ b/Source/Core/InputCommon/ControllerInterface/XInput/XInput.h
@@ -18,9 +18,7 @@
#error You are building this module against the wrong version of DirectX. You probably need to remove DXSDK_DIR from your include path and/or _WIN32_WINNT is wrong.
#endif
-namespace ciface
-{
-namespace XInput
+namespace ciface::XInput
{
void Init();
void PopulateDevices();
@@ -105,5 +103,4 @@ private:
const BYTE m_subtype;
const u8 m_index;
};
-} // namespace XInput
-} // namespace ciface
+} // namespace ciface::XInput
diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp
index 77acf8d1d3..30f10c8537 100644
--- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.cpp
@@ -46,9 +46,7 @@
// more responsive. This might be useful as a user-customizable option.
#define MOUSE_AXIS_SMOOTHING 1.5f
-namespace ciface
-{
-namespace XInput2
+namespace ciface::XInput2
{
// This function will add zero or more KeyboardMouse objects to devices.
void PopulateDevices(void* const hwnd)
@@ -369,5 +367,4 @@ ControlState KeyboardMouse::Axis::GetState() const
{
return std::max(0.0f, *m_axis / (m_positive ? MOUSE_AXIS_SENSITIVITY : -MOUSE_AXIS_SENSITIVITY));
}
-} // namespace XInput2
-} // namespace ciface
+} // namespace ciface::XInput2
diff --git a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h
index 72ea347461..e657f8b8df 100644
--- a/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h
+++ b/Source/Core/InputCommon/ControllerInterface/Xlib/XInput2.h
@@ -14,9 +14,7 @@ extern "C" {
#include "InputCommon/ControllerInterface/ControllerInterface.h"
-namespace ciface
-{
-namespace XInput2
+namespace ciface::XInput2
{
void PopulateDevices(void* const hwnd);
@@ -113,5 +111,4 @@ private:
const int pointer_deviceid, keyboard_deviceid;
std::string name;
};
-} // namespace XInput2
-} // namespace ciface
+} // namespace ciface::XInput2
diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
index da1e5fc918..4443eaad3a 100644
--- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
@@ -23,9 +23,7 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/evdev/evdev.h"
-namespace ciface
-{
-namespace evdev
+namespace ciface::evdev
{
static std::thread s_hotplug_thread;
static Common::Flag s_hotplug_thread_running;
@@ -499,5 +497,4 @@ evdevDevice::Effect::~Effect()
m_effect.type = DISABLED_EFFECT_TYPE;
UpdateEffect();
}
-} // namespace evdev
-} // namespace ciface
+} // namespace ciface::evdev
diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.h b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.h
index 4b6d0bc0b2..9f2996b420 100644
--- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.h
+++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.h
@@ -10,9 +10,7 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h"
-namespace ciface
-{
-namespace evdev
+namespace ciface::evdev
{
void Init();
void PopulateDevices();
@@ -120,5 +118,4 @@ private:
std::string m_name;
bool m_interesting = false;
};
-} // namespace evdev
-} // namespace ciface
+} // namespace ciface::evdev