InputCommon: Use nested namespace specifiers where applicable

This commit is contained in:
Lioncash 2019-06-17 16:39:24 -04:00
parent 8e030a4a45
commit ec60027f56
38 changed files with 78 additions and 195 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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