clang-modernize -use-nullptr

and s/\bNULL\b/nullptr/g for *.cpp/h/mm files not compiled on my machine
This commit is contained in:
Tillmann Karras
2014-03-09 21:14:26 +01:00
parent f28116b7da
commit d802d39281
292 changed files with 1526 additions and 1526 deletions

View File

@ -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);
}

View File

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

View File

@ -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);
}