Replace NULL and 0 with nullptr
This commit is contained in:
2
3rdparty/qtsingleapplication/qtlocalpeer.cpp
vendored
2
3rdparty/qtsingleapplication/qtlocalpeer.cpp
vendored
@@ -157,7 +157,7 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout)
|
|||||||
Sleep(DWORD(ms));
|
Sleep(DWORD(ms));
|
||||||
#else
|
#else
|
||||||
struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
|
struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
|
||||||
nanosleep(&ts, NULL);
|
nanosleep(&ts, nullptr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!connOk)
|
if (!connOk)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate)
|
|||||||
|
|
||||||
Qt::HANDLE mutex;
|
Qt::HANDLE mutex;
|
||||||
if (doCreate) {
|
if (doCreate) {
|
||||||
mutex = CreateMutexW(NULL, FALSE, (WCHAR*)mname.utf16());
|
mutex = CreateMutexW(nullptr, FALSE, (WCHAR*)mname.utf16());
|
||||||
if (!mutex) {
|
if (!mutex) {
|
||||||
qErrnoWarning("QtLockedFile::lock(): CreateMutex failed");
|
qErrnoWarning("QtLockedFile::lock(): CreateMutex failed");
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
6
3rdparty/qxt/qxtglobalshortcut.h
vendored
6
3rdparty/qxt/qxtglobalshortcut.h
vendored
@@ -47,9 +47,9 @@ class QXT_GUI_EXPORT QxtGlobalShortcut : public QObject
|
|||||||
Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut)
|
Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QxtGlobalShortcut(QObject* parent = 0);
|
explicit QxtGlobalShortcut(QObject* parent = nullptr);
|
||||||
explicit QxtGlobalShortcut(const QKeySequence& shortcut, QObject* parent = 0);
|
explicit QxtGlobalShortcut(const QKeySequence& shortcut, QObject* parent = nullptr);
|
||||||
virtual ~QxtGlobalShortcut();
|
~QxtGlobalShortcut();
|
||||||
|
|
||||||
QKeySequence shortcut() const;
|
QKeySequence shortcut() const;
|
||||||
bool setShortcut(const QKeySequence& shortcut);
|
bool setShortcut(const QKeySequence& shortcut);
|
||||||
|
|||||||
8
3rdparty/qxt/qxtglobalshortcut_mac.cpp
vendored
8
3rdparty/qxt/qxtglobalshortcut_mac.cpp
vendored
@@ -48,7 +48,7 @@ OSStatus qxt_mac_handle_hot_key(EventHandlerCallRef nextHandler, EventRef event,
|
|||||||
if (GetEventClass(event) == kEventClassKeyboard && GetEventKind(event) == kEventHotKeyPressed)
|
if (GetEventClass(event) == kEventClassKeyboard && GetEventKind(event) == kEventHotKeyPressed)
|
||||||
{
|
{
|
||||||
EventHotKeyID keyID;
|
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);
|
Identifier id = keyIDs.key(keyID.id);
|
||||||
QxtGlobalShortcutPrivate::activateShortcut(id.second, id.first);
|
QxtGlobalShortcutPrivate::activateShortcut(id.second, id.first);
|
||||||
}
|
}
|
||||||
@@ -174,12 +174,12 @@ quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key)
|
|||||||
CFDataRef currentLayoutData;
|
CFDataRef currentLayoutData;
|
||||||
TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource();
|
TISInputSourceRef currentKeyboard = TISCopyCurrentKeyboardInputSource();
|
||||||
|
|
||||||
if (currentKeyboard == NULL)
|
if (currentKeyboard == nullptr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
currentLayoutData = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData);
|
currentLayoutData = (CFDataRef)TISGetInputSourceProperty(currentKeyboard, kTISPropertyUnicodeKeyLayoutData);
|
||||||
CFRelease(currentKeyboard);
|
CFRelease(currentKeyboard);
|
||||||
if (currentLayoutData == NULL)
|
if (currentLayoutData == nullptr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
UCKeyboardLayout* header = (UCKeyboardLayout*)CFDataGetBytePtr(currentLayoutData);
|
UCKeyboardLayout* header = (UCKeyboardLayout*)CFDataGetBytePtr(currentLayoutData);
|
||||||
@@ -230,7 +230,7 @@ bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativ
|
|||||||
EventTypeSpec t;
|
EventTypeSpec t;
|
||||||
t.eventClass = kEventClassKeyboard;
|
t.eventClass = kEventClassKeyboard;
|
||||||
t.eventKind = kEventHotKeyPressed;
|
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;
|
EventHotKeyID keyID;
|
||||||
|
|||||||
6
3rdparty/qxt/qxtglobalshortcut_x11.cpp
vendored
6
3rdparty/qxt/qxtglobalshortcut_x11.cpp
vendored
@@ -113,7 +113,7 @@ public:
|
|||||||
|
|
||||||
bool isValid()
|
bool isValid()
|
||||||
{
|
{
|
||||||
return m_display != 0;
|
return m_display != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Display *display()
|
Display *display()
|
||||||
@@ -176,14 +176,14 @@ bool QxtGlobalShortcutPrivate::nativeEventFilter(const QByteArray & eventType,
|
|||||||
{
|
{
|
||||||
Q_UNUSED(result);
|
Q_UNUSED(result);
|
||||||
|
|
||||||
xcb_key_press_event_t *kev = 0;
|
xcb_key_press_event_t *kev = nullptr;
|
||||||
if (eventType == "xcb_generic_event_t") {
|
if (eventType == "xcb_generic_event_t") {
|
||||||
xcb_generic_event_t *ev = static_cast<xcb_generic_event_t *>(message);
|
xcb_generic_event_t *ev = static_cast<xcb_generic_event_t *>(message);
|
||||||
if ((ev->response_type & 127) == XCB_KEY_PRESS)
|
if ((ev->response_type & 127) == XCB_KEY_PRESS)
|
||||||
kev = static_cast<xcb_key_press_event_t *>(message);
|
kev = static_cast<xcb_key_press_event_t *>(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kev != 0) {
|
if (kev != nullptr) {
|
||||||
unsigned int keycode = kev->detail;
|
unsigned int keycode = kev->detail;
|
||||||
unsigned int keystate = 0;
|
unsigned int keystate = 0;
|
||||||
if(kev->state & XCB_MOD_MASK_1)
|
if(kev->state & XCB_MOD_MASK_1)
|
||||||
|
|||||||
Reference in New Issue
Block a user