summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/OSX
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2014-03-09 21:14:26 +0100
committerTillmann Karras <tilkax@gmail.com>2014-03-09 21:14:26 +0100
commitd802d392811be44d34ae9cd23f616db93e54c50f (patch)
treef9aa8831a0731ea246bd921d979f4bffa7f07bd0 /Source/Core/InputCommon/ControllerInterface/OSX
parentf28116b7da6aac6069084596dc4dbf866bdebfd8 (diff)
clang-modernize -use-nullptr
and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/OSX')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm12
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm4
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm6
3 files changed, 11 insertions, 11 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
index 50b568cb9a..ac98c4c13d 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
@@ -18,7 +18,7 @@ namespace OSX
{
-static IOHIDManagerRef HIDManager = NULL;
+static IOHIDManagerRef HIDManager = nullptr;
static CFStringRef OurRunLoop = CFSTR("DolphinOSXInput");
static std::map<std::string, int> kbd_name_counts, joy_name_counts;
@@ -90,7 +90,7 @@ void DeviceElementDebugPrint(const void *value, void *context)
type == "collection" ? c_type.c_str() : " ",
IOHIDElementGetUsagePage(e),
IOHIDElementGetUsage(e),
- IOHIDElementGetName(e), // usually just NULL
+ IOHIDElementGetName(e), // usually just nullptr
IOHIDElementGetLogicalMin(e),
IOHIDElementGetLogicalMax(e),
IOHIDElementGetPhysicalMin(e),
@@ -102,7 +102,7 @@ void DeviceElementDebugPrint(const void *value, void *context)
CFRange range = {0, CFArrayGetCount(elements)};
// this leaks...but it's just debug code, right? :D
CFArrayApplyFunction(elements, range,
- DeviceElementDebugPrint, NULL);
+ DeviceElementDebugPrint, nullptr);
}
}
@@ -146,7 +146,7 @@ static void DeviceMatching_callback(void* inContext,
{
NSString *pName = (NSString *)
IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductKey));
- std::string name = (pName != NULL) ? [pName UTF8String] : "Unknown device";
+ std::string name = (pName != nullptr) ? [pName UTF8String] : "Unknown device";
DeviceDebugPrint(inIOHIDDeviceRef);
@@ -178,7 +178,7 @@ void Init(std::vector<Core::Device*>& devices, void *window)
g_window = window;
- IOHIDManagerSetDeviceMatching(HIDManager, NULL);
+ IOHIDManagerSetDeviceMatching(HIDManager, nullptr);
// Callbacks for acquisition or loss of a matching device
IOHIDManagerRegisterDeviceMatchingCallback(HIDManager,
@@ -200,7 +200,7 @@ void Init(std::vector<Core::Device*>& devices, void *window)
// Things should be configured now
// Disable hotplugging and other scheduling
- IOHIDManagerRegisterDeviceMatchingCallback(HIDManager, NULL, NULL);
+ IOHIDManagerRegisterDeviceMatchingCallback(HIDManager, nullptr, nullptr);
IOHIDManagerUnscheduleFromRunLoop(HIDManager,
CFRunLoopGetCurrent(), OurRunLoop);
}
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
index 6e0623e716..f7f59e1c41 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
@@ -39,7 +39,7 @@ Joystick::Joystick(IOHIDDeviceRef device, std::string name, int index)
{
IOHIDElementRef e =
(IOHIDElementRef)CFArrayGetValueAtIndex(buttons, i);
- //DeviceElementDebugPrint(e, NULL);
+ //DeviceElementDebugPrint(e, nullptr);
AddInput(new Button(e, m_device));
}
@@ -62,7 +62,7 @@ Joystick::Joystick(IOHIDDeviceRef device, std::string name, int index)
{
IOHIDElementRef e =
(IOHIDElementRef)CFArrayGetValueAtIndex(axes, i);
- //DeviceElementDebugPrint(e, NULL);
+ //DeviceElementDebugPrint(e, nullptr);
if (IOHIDElementGetUsage(e) == kHIDUsage_GD_Hatswitch) {
AddInput(new Hat(e, m_device, Hat::up));
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm
index fc784b81c6..ecb841ae7b 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm
@@ -40,7 +40,7 @@ Keyboard::Keyboard(IOHIDDeviceRef device, std::string name, int index, void *win
{
IOHIDElementRef e =
(IOHIDElementRef)CFArrayGetValueAtIndex(elements, i);
- //DeviceElementDebugPrint(e, NULL);
+ //DeviceElementDebugPrint(e, nullptr);
AddInput(new Key(e, m_device));
}
@@ -61,7 +61,7 @@ bool Keyboard::UpdateInput()
{
CGRect bounds = CGRectZero;
uint32_t windowid[1] = { m_windowid };
- CFArrayRef windowArray = CFArrayCreate(NULL, (const void **) windowid, 1, NULL);
+ CFArrayRef windowArray = CFArrayCreate(nullptr, (const void **) windowid, 1, nullptr);
CFArrayRef windowDescriptions = CGWindowListCreateDescriptionFromArray(windowArray);
CFDictionaryRef windowDescription = (CFDictionaryRef) CFArrayGetValueAtIndex((CFArrayRef) windowDescriptions, 0);
@@ -69,7 +69,7 @@ bool Keyboard::UpdateInput()
{
CFDictionaryRef boundsDictionary = (CFDictionaryRef) CFDictionaryGetValue(windowDescription, kCGWindowBounds);
- if (boundsDictionary != NULL)
+ if (boundsDictionary != nullptr)
CGRectMakeWithDictionaryRepresentation(boundsDictionary, &bounds);
}