From 139bc1f5aa347ba3968e276891497f25cb7aef36 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Thu, 29 Nov 2018 22:26:51 +0100 Subject: [PATCH] Convert NULL to nullptr (#6220) --- 3rdparty/qtsingleapplication/CMakeLists.txt | 1 + 3rdparty/qtsingleapplication/qtlocalpeer.cpp | 2 +- 3rdparty/qtsingleapplication/qtlockedfile_win.cpp | 13 ++++++++----- 3rdparty/qxt/CMakeLists.txt | 1 + 3rdparty/qxt/qxtglobalshortcut_mac.cpp | 6 ++++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/3rdparty/qtsingleapplication/CMakeLists.txt b/3rdparty/qtsingleapplication/CMakeLists.txt index 1d78baba4..239bbe05b 100644 --- a/3rdparty/qtsingleapplication/CMakeLists.txt +++ b/3rdparty/qtsingleapplication/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 2.6) +set(CMAKE_CXX_STANDARD 11) set(SINGLEAPP-SOURCES qtlocalpeer.cpp diff --git a/3rdparty/qtsingleapplication/qtlocalpeer.cpp b/3rdparty/qtsingleapplication/qtlocalpeer.cpp index c0b6b81b6..bb205eaf0 100644 --- a/3rdparty/qtsingleapplication/qtlocalpeer.cpp +++ b/3rdparty/qtsingleapplication/qtlocalpeer.cpp @@ -164,7 +164,7 @@ bool QtLocalPeer::sendMessage(const QByteArray &message, int timeout) Sleep(DWORD(ms)); #else struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 }; - nanosleep(&ts, NULL); + nanosleep(&ts, nullptr); #endif } if (!connOk) diff --git a/3rdparty/qtsingleapplication/qtlockedfile_win.cpp b/3rdparty/qtsingleapplication/qtlockedfile_win.cpp index f41bb67d8..eb7c72029 100644 --- a/3rdparty/qtsingleapplication/qtlockedfile_win.cpp +++ b/3rdparty/qtsingleapplication/qtlockedfile_win.cpp @@ -65,11 +65,14 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate) Qt::HANDLE mutex; if (doCreate) { - QT_WA( { mutex = CreateMutexW(NULL, FALSE, (WCHAR*)mname.utf16()); }, - { mutex = CreateMutexA(NULL, FALSE, mname.toLocal8Bit().constData()); } ); - if (!mutex) { - qErrnoWarning("QtLockedFile::lock(): CreateMutex failed"); - return 0; + QT_WA({ mutex = CreateMutexW(nullptr, FALSE, (WCHAR*)mname.utf16()); }, + { + mutex = + CreateMutexA(nullptr, FALSE, mname.toLocal8Bit().constData()); + }); + if (!mutex) { + qErrnoWarning("QtLockedFile::lock(): CreateMutex failed"); + return 0; } } else { diff --git a/3rdparty/qxt/CMakeLists.txt b/3rdparty/qxt/CMakeLists.txt index 73954ffc9..1db05ca69 100644 --- a/3rdparty/qxt/CMakeLists.txt +++ b/3rdparty/qxt/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 2.6) +set(CMAKE_CXX_STANDARD 11) set(QXT-SOURCES qxtglobal.cpp diff --git a/3rdparty/qxt/qxtglobalshortcut_mac.cpp b/3rdparty/qxt/qxtglobalshortcut_mac.cpp index 0bcea7f36..80fa01bc7 100644 --- a/3rdparty/qxt/qxtglobalshortcut_mac.cpp +++ b/3rdparty/qxt/qxtglobalshortcut_mac.cpp @@ -50,7 +50,8 @@ bool QxtGlobalShortcutPrivate::eventFilter(void* message) if (GetEventClass(event) == kEventClassKeyboard && GetEventKind(event) == kEventHotKeyPressed) { EventHotKeyID keyID; - GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID, NULL, sizeof(keyID), NULL, &keyID); + GetEventParameter(event, kEventParamDirectObject, typeEventHotKeyID, + nullptr, sizeof(keyID), nullptr, &keyID); Identifier id = keyIDs.key(keyID.id); activateShortcut(id.second, id.first); } @@ -178,7 +179,8 @@ bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativ EventTypeSpec t; t.eventClass = kEventClassKeyboard; t.eventKind = kEventHotKeyPressed; - InstallApplicationEventHandler(&qxt_mac_handle_hot_key, 1, &t, NULL, NULL); + InstallApplicationEventHandler(&qxt_mac_handle_hot_key, 1, &t, nullptr, + nullptr); } EventHotKeyID keyID;