diff options
| author | Matthew Parlane <parlane@gmail.com> | 2014-03-11 00:30:55 +1300 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2014-03-11 00:35:07 +1300 |
| commit | 31cfc73a09a8685cbab20502b4bc132e98e2feb5 (patch) | |
| tree | c7eb3a0906bab0eb711bd7c79166c96fe97ec488 /Source/Core/InputCommon | |
| parent | 4591464486d696a300cc914f6c2a3cce8af2d666 (diff) | |
Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start.
Fixed misc vertical alignments and some { needed newlining.
Diffstat (limited to 'Source/Core/InputCommon')
4 files changed, 16 insertions, 17 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp index 75b21c0e8c..7f5a74041a 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp @@ -24,7 +24,7 @@ namespace DInput void GetXInputGUIDS( std::vector<DWORD>& guids ) { -#define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=nullptr; } } +#define SAFE_RELEASE(p) { if (p) { (p)->Release(); (p)=nullptr; } } IWbemLocator* pIWbemLocator = nullptr; IEnumWbemClassObject* pEnumDevices = nullptr; @@ -50,9 +50,9 @@ void GetXInputGUIDS( std::vector<DWORD>& guids ) if (FAILED(hr) || pIWbemLocator == nullptr) goto LCleanup; - bstrNamespace = SysAllocString(L"\\\\.\\root\\cimv2");if(bstrNamespace == nullptr) goto LCleanup; - bstrClassName = SysAllocString(L"Win32_PNPEntity"); if(bstrClassName == nullptr) goto LCleanup; - bstrDeviceID = SysAllocString(L"DeviceID"); if(bstrDeviceID == nullptr) goto LCleanup; + bstrNamespace = SysAllocString(L"\\\\.\\root\\cimv2"); if (bstrNamespace == nullptr) goto LCleanup; + bstrClassName = SysAllocString(L"Win32_PNPEntity"); if (bstrClassName == nullptr) goto LCleanup; + bstrDeviceID = SysAllocString(L"DeviceID"); if (bstrDeviceID == nullptr) goto LCleanup; // Connect to WMI hr = pIWbemLocator->ConnectServer(bstrNamespace, nullptr, nullptr, 0L, 0L, nullptr, nullptr, &pIWbemServices); @@ -105,11 +105,11 @@ void GetXInputGUIDS( std::vector<DWORD>& guids ) } LCleanup: - if(bstrNamespace) + if (bstrNamespace) SysFreeString(bstrNamespace); - if(bstrDeviceID) + if (bstrDeviceID) SysFreeString(bstrDeviceID); - if(bstrClassName) + if (bstrClassName) SysFreeString(bstrClassName); for (UINT iDevice = 0; iDevice < 20; iDevice++) SAFE_RELEASE(pDevices[iDevice]); diff --git a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h index c3b5cef2ef..986fe2ea3b 100644 --- a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h +++ b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/OSX/DirectInputAdapter.h @@ -164,7 +164,7 @@ public: FFDeviceObjectReference ref; HRESULT hr = FFCreateDevice(hidDevice, &ref); - if(SUCCEEDED(hr)) + if (SUCCEEDED(hr)) *pDeviceReference = new FFDeviceAdapter(ref); return hr; @@ -175,7 +175,7 @@ public: FFEffectObjectReference ref; HRESULT hr = FFDeviceCreateEffect(m_device, uuidRef, pEffectDefinition, &ref); - if(SUCCEEDED(hr)) + if (SUCCEEDED(hr)) *pEffectReference = new FFEffectAdapter(m_device, ref); return hr; diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index 64c012c1c1..56c526a079 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -36,7 +36,7 @@ void Init( std::vector<Core::Device*>& devices ) if (SDL_Init( SDL_INIT_FLAGS ) >= 0) { // joysticks - for(int i = 0; i < SDL_NumJoysticks(); ++i) + for (int i = 0; i < SDL_NumJoysticks(); ++i) { SDL_Joystick* dev = SDL_JoystickOpen(i); if (dev) @@ -67,12 +67,11 @@ Joystick::Joystick(SDL_Joystick* const joystick, const int sdl_index, const unsi std::string lcasename = GetName(); std::transform(lcasename.begin(), lcasename.end(), lcasename.begin(), tolower); - if ((std::string::npos != lcasename.find("xbox 360")) - && (10 == SDL_JoystickNumButtons(joystick)) - && (5 == SDL_JoystickNumAxes(joystick)) - && (1 == SDL_JoystickNumHats(joystick)) - && (0 == SDL_JoystickNumBalls(joystick)) - ) + if ((std::string::npos != lcasename.find("xbox 360")) && + (10 == SDL_JoystickNumButtons(joystick)) && + (5 == SDL_JoystickNumAxes(joystick)) && + (1 == SDL_JoystickNumHats(joystick)) && + (0 == SDL_JoystickNumBalls(joystick))) { // this device won't be used return; diff --git a/Source/Core/InputCommon/UDPWiimote.cpp b/Source/Core/InputCommon/UDPWiimote.cpp index 1dad7d52d2..1519de350a 100644 --- a/Source/Core/InputCommon/UDPWiimote.cpp +++ b/Source/Core/InputCommon/UDPWiimote.cpp @@ -115,7 +115,7 @@ UDPWiimote::UDPWiimote(const char *_port, const char * name, int _index) : } // loop through all the results and bind to everything we can - for(p = servinfo; p != nullptr; p = p->ai_next) + for (p = servinfo; p != nullptr; p = p->ai_next) { sock_t sock; if ((sock = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == BAD_SOCK) |
