From d802d392811be44d34ae9cd23f616db93e54c50f Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Sun, 9 Mar 2014 21:14:26 +0100 Subject: clang-modernize -use-nullptr and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine --- Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm | 12 ++++++------ .../Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm | 4 ++-- .../Core/InputCommon/ControllerInterface/OSX/OSXKeyboard.mm | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface/OSX') 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 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& 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& 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); } -- cgit v1.2.3