From 1ebb4e0d64bf27dfc6c38b9770ae744fad87fb82 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 20 Feb 2018 13:35:03 +0100 Subject: Use nullptr instead of 0 or NULL Applied automatic fixes using clang-tidy's modernize-use-nullptr, and some manual cleanup to prevent QFlag macros to be affected. Change-Id: I88f94390185bc6e6f23693b68723cd5710815ae6 Reviewed-by: Shawn Rutledge --- src/client/global/qwaylandclientextension.cpp | 2 +- .../qwaylandclientbufferintegrationfactory.cpp | 2 +- .../qwaylandclientbufferintegrationplugin_p.h | 2 +- .../qwaylandserverbufferintegration.cpp | 2 +- .../qwaylandserverbufferintegrationfactory.cpp | 2 +- .../qwaylandserverbufferintegrationplugin_p.h | 2 +- .../qwaylandinputdeviceintegrationplugin_p.h | 2 +- src/client/qwaylandabstractdecoration.cpp | 6 ++--- src/client/qwaylandbuffer.cpp | 2 +- src/client/qwaylandclipboard.cpp | 4 +-- src/client/qwaylandcursor.cpp | 12 ++++----- src/client/qwaylanddatadevice.cpp | 10 ++++---- src/client/qwaylanddecorationfactory.cpp | 2 +- src/client/qwaylanddecorationplugin_p.h | 2 +- src/client/qwaylanddisplay.cpp | 30 +++++++++++----------- src/client/qwaylandinputcontext.cpp | 2 +- src/client/qwaylandintegration.cpp | 4 +-- src/client/qwaylandscreen.cpp | 2 +- src/client/qwaylandshmbackingstore.cpp | 16 ++++++------ src/client/qwaylandtouch.cpp | 4 +-- src/client/qwaylandwindow.cpp | 22 ++++++++-------- src/client/qwaylandwlshellsurface.cpp | 4 +-- .../qwaylandshellintegrationplugin_p.h | 2 +- .../compositor_api/qwaylandbufferref.cpp | 2 +- src/compositor/compositor_api/qwaylandclient.cpp | 6 ++--- .../compositor_api/qwaylandcompositor.cpp | 8 +++--- src/compositor/compositor_api/qwaylanddrag.cpp | 4 +-- .../compositor_api/qwaylandinputmethodcontrol.cpp | 2 +- src/compositor/compositor_api/qwaylandkeyboard.cpp | 10 ++++---- src/compositor/compositor_api/qwaylandoutput_p.h | 2 +- .../compositor_api/qwaylandquickitem.cpp | 8 +++--- src/compositor/compositor_api/qwaylandresource.cpp | 2 +- src/compositor/compositor_api/qwaylandseat.cpp | 6 ++--- src/compositor/compositor_api/qwaylandsurface.cpp | 8 +++--- src/compositor/extensions/qwaylandtextinput.cpp | 6 ++--- src/compositor/extensions/qwaylandwlshell.cpp | 2 +- src/compositor/extensions/qwlqtkey.cpp | 2 +- src/compositor/extensions/qwlqttouch.cpp | 2 +- .../qwlclientbufferintegration.cpp | 2 +- .../qwlclientbufferintegrationfactory.cpp | 2 +- .../qwlclientbufferintegrationplugin_p.h | 2 +- .../qwlserverbufferintegrationfactory.cpp | 2 +- .../qwlserverbufferintegrationplugin_p.h | 2 +- .../wayland_wrapper/qwlbuffermanager.cpp | 2 +- src/compositor/wayland_wrapper/qwldatadevice.cpp | 26 +++++++++---------- .../wayland_wrapper/qwldatadevicemanager.cpp | 10 ++++---- src/compositor/wayland_wrapper/qwldatasource.cpp | 4 +-- .../drmeglserverbufferintegration.cpp | 2 +- .../waylandeglclientbufferintegration.cpp | 14 +++++----- .../xcomposite-egl/xcompositeeglintegration.cpp | 2 +- .../xcomposite-glx/xcompositeglxintegration.cpp | 6 ++--- src/imports/compositor/qwaylandmousetracker_p.h | 2 +- src/qtwaylandscanner/qtwaylandscanner.cpp | 2 +- 53 files changed, 144 insertions(+), 144 deletions(-) (limited to 'src') diff --git a/src/client/global/qwaylandclientextension.cpp b/src/client/global/qwaylandclientextension.cpp index ad266a683..60a8944f8 100644 --- a/src/client/global/qwaylandclientextension.cpp +++ b/src/client/global/qwaylandclientextension.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE QWaylandClientExtensionPrivate::QWaylandClientExtensionPrivate() : QObjectPrivate() - , waylandIntegration(NULL) + , waylandIntegration(nullptr) , version(-1) , active(false) { diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp index eebd69a87..02bed461a 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp @@ -90,7 +90,7 @@ QWaylandClientBufferIntegration *QWaylandClientBufferIntegrationFactory::create( if (QWaylandClientBufferIntegration *ret = qLoadPlugin(loader(), name, args)) return ret; #endif - return 0; + return nullptr; } } diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h index 6496b33ed..1711852c7 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationPlugin : public QOb { Q_OBJECT public: - explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = 0); + explicit QWaylandClientBufferIntegrationPlugin(QObject *parent = nullptr); ~QWaylandClientBufferIntegrationPlugin(); virtual QWaylandClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp index 1d64e0f51..013ddae9f 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandServerBuffer::QWaylandServerBuffer() - : m_user_data(0) + : m_user_data(nullptr) { } diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp index aa2f54cb7..39d65f88d 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp @@ -90,7 +90,7 @@ QWaylandServerBufferIntegration *QWaylandServerBufferIntegrationFactory::create( if (QWaylandServerBufferIntegration *ret = qLoadPlugin(loader(), name, args)) return ret; #endif - return 0; + return nullptr; } } diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h index b3ed3ccc5..bf6c04f82 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationPlugin : public QOb { Q_OBJECT public: - explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = 0); + explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = nullptr); ~QWaylandServerBufferIntegrationPlugin(); virtual QWaylandServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h index 2d9961dba..104d594ca 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationPlugin : public QObj { Q_OBJECT public: - explicit QWaylandInputDeviceIntegrationPlugin(QObject *parent = 0); + explicit QWaylandInputDeviceIntegrationPlugin(QObject *parent = nullptr); ~QWaylandInputDeviceIntegrationPlugin(); virtual QWaylandInputDeviceIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/client/qwaylandabstractdecoration.cpp b/src/client/qwaylandabstractdecoration.cpp index daaf4e6bc..6a7a2ef4c 100644 --- a/src/client/qwaylandabstractdecoration.cpp +++ b/src/client/qwaylandabstractdecoration.cpp @@ -70,10 +70,10 @@ public: }; QWaylandAbstractDecorationPrivate::QWaylandAbstractDecorationPrivate() - : m_window(0) - , m_wayland_window(0) + : m_window(nullptr) + , m_wayland_window(nullptr) , m_isDirty(true) - , m_decorationContentImage(0) + , m_decorationContentImage(nullptr) , m_mouseButtons(Qt::NoButton) { } diff --git a/src/client/qwaylandbuffer.cpp b/src/client/qwaylandbuffer.cpp index a0fcc532f..2dc99b3b7 100644 --- a/src/client/qwaylandbuffer.cpp +++ b/src/client/qwaylandbuffer.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandBuffer::QWaylandBuffer() - : mBuffer(0) + : mBuffer(nullptr) , mBusy(false) { } diff --git a/src/client/qwaylandclipboard.cpp b/src/client/qwaylandclipboard.cpp index 5da120268..60820da92 100644 --- a/src/client/qwaylandclipboard.cpp +++ b/src/client/qwaylandclipboard.cpp @@ -90,7 +90,7 @@ void QWaylandClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) static const QString utf8 = QStringLiteral("text/plain;charset=utf-8"); if (data && data->hasFormat(plain) && !data->hasFormat(utf8)) data->setData(utf8, data->data(plain)); - inputDevice->dataDevice()->setSelectionSource(data ? new QWaylandDataSource(mDisplay->dndSelectionHandler(), data) : 0); + inputDevice->dataDevice()->setSelectionSource(data ? new QWaylandDataSource(mDisplay->dndSelectionHandler(), data) : nullptr); emitChanged(mode); } @@ -109,7 +109,7 @@ bool QWaylandClipboard::ownsMode(QClipboard::Mode mode) const if (!inputDevice || !inputDevice->dataDevice()) return false; - return inputDevice->dataDevice()->selectionSource() != 0; + return inputDevice->dataDevice()->selectionSource() != nullptr; } } diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp index bd820e28e..21a6c0811 100644 --- a/src/client/qwaylandcursor.cpp +++ b/src/client/qwaylandcursor.cpp @@ -79,13 +79,13 @@ QWaylandCursor::~QWaylandCursor() struct wl_cursor_image *QWaylandCursor::cursorImage(Qt::CursorShape newShape) { - struct wl_cursor *waylandCursor = 0; + struct wl_cursor *waylandCursor = nullptr; /* Hide cursor */ if (newShape == Qt::BlankCursor) { - mDisplay->setCursor(NULL, NULL); - return NULL; + mDisplay->setCursor(nullptr, nullptr); + return nullptr; } if (newShape < Qt::BitmapCursor) { @@ -99,14 +99,14 @@ struct wl_cursor_image *QWaylandCursor::cursorImage(Qt::CursorShape newShape) if (!waylandCursor) { qDebug("Could not find cursor for shape %d", newShape); - return NULL; + return nullptr; } struct wl_cursor_image *image = waylandCursor->images[0]; struct wl_buffer *buffer = wl_cursor_image_get_buffer(image); if (!buffer) { qDebug("Could not find buffer for cursor"); - return NULL; + return nullptr; } return image; @@ -166,7 +166,7 @@ wl_cursor *QWaylandCursor::requestCursor(WaylandCursor shape) //If the cursor has not been loaded already, load it if (!cursor) { if (!mCursorTheme) - return NULL; + return nullptr; QList cursorNames = mCursorNamesMap.values(shape); foreach (const QByteArray &name, cursorNames) { diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp index 66f36f75b..83912035a 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -67,7 +67,7 @@ QWaylandDataDevice::QWaylandDataDevice(QWaylandDataDeviceManager *manager, QWayl , m_display(manager->display()) , m_inputDevice(inputDevice) , m_enterSerial(0) - , m_dragWindow(0) + , m_dragWindow(nullptr) , m_dragPoint() , m_dragOffer() , m_selectionOffer() @@ -135,7 +135,7 @@ void QWaylandDataDevice::data_device_drop() { QDrag *drag = static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag(); - QMimeData *dragData = 0; + QMimeData *dragData = nullptr; Qt::DropActions supportedActions; if (drag) { dragData = drag->mimeData(); @@ -182,14 +182,14 @@ void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface, if (response.isAccepted()) { wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); } else { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, 0); + wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, nullptr); } } void QWaylandDataDevice::data_device_leave() { if (m_dragWindow) - QWindowSystemInterface::handleDrag(m_dragWindow, 0, QPoint(), Qt::IgnoreAction); + QWindowSystemInterface::handleDrag(m_dragWindow, nullptr, QPoint(), Qt::IgnoreAction); QDrag *drag = static_cast(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag(); if (!drag) { @@ -227,7 +227,7 @@ void QWaylandDataDevice::data_device_motion(uint32_t time, wl_fixed_t x, wl_fixe if (response.isAccepted()) { wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, m_dragOffer->firstFormat().toUtf8().constData()); } else { - wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, 0); + wl_data_offer_accept(m_dragOffer->object(), m_enterSerial, nullptr); } } #endif // QT_CONFIG(draganddrop) diff --git a/src/client/qwaylanddecorationfactory.cpp b/src/client/qwaylanddecorationfactory.cpp index ccf2c806c..32db96e58 100644 --- a/src/client/qwaylanddecorationfactory.cpp +++ b/src/client/qwaylanddecorationfactory.cpp @@ -91,7 +91,7 @@ QWaylandAbstractDecoration *QWaylandDecorationFactory::create(const QString &nam return ret; #endif - return 0; + return nullptr; } } diff --git a/src/client/qwaylanddecorationplugin_p.h b/src/client/qwaylanddecorationplugin_p.h index c549b24be..4255de46f 100644 --- a/src/client/qwaylanddecorationplugin_p.h +++ b/src/client/qwaylanddecorationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationPlugin : public QObject { Q_OBJECT public: - explicit QWaylandDecorationPlugin(QObject *parent = 0); + explicit QWaylandDecorationPlugin(QObject *parent = nullptr); ~QWaylandDecorationPlugin(); virtual QWaylandAbstractDecoration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 02b1fd9a9..942494f93 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -89,7 +89,7 @@ struct wl_surface *QWaylandDisplay::createSurface(void *handle) QWaylandShellSurface *QWaylandDisplay::createShellSurface(QWaylandWindow *window) { if (!mWaylandIntegration->shellIntegration()) - return 0; + return nullptr; return mWaylandIntegration->shellIntegration()->createShellSurface(window); } @@ -106,7 +106,7 @@ struct ::wl_region *QWaylandDisplay::createRegion(const QRegion &qregion) ::wl_subsurface *QWaylandDisplay::createSubSurface(QWaylandWindow *window, QWaylandWindow *parent) { if (!mSubCompositor) { - return NULL; + return nullptr; } return mSubCompositor->get_subsurface(window->object(), parent->object()); @@ -125,24 +125,24 @@ QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() co QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) : mWaylandIntegration(waylandIntegration) #if QT_CONFIG(wayland_datadevice) - , mDndSelectionHandler(0) + , mDndSelectionHandler(nullptr) #endif - , mWindowExtension(0) - , mSubCompositor(0) - , mTouchExtension(0) - , mQtKeyExtension(0) - , mTextInputManager(0) - , mHardwareIntegration(0) + , mWindowExtension(nullptr) + , mSubCompositor(nullptr) + , mTouchExtension(nullptr) + , mQtKeyExtension(nullptr) + , mTextInputManager(nullptr) + , mHardwareIntegration(nullptr) , mLastInputSerial(0) - , mLastInputDevice(0) - , mLastInputWindow(0) + , mLastInputDevice(nullptr) + , mLastInputWindow(nullptr) , mLastKeyboardFocus(nullptr) , mSyncCallback(nullptr) { qRegisterMetaType("uint32_t"); - mDisplay = wl_display_connect(NULL); - if (mDisplay == NULL) { + mDisplay = wl_display_connect(nullptr); + if (mDisplay == nullptr) { qErrnoWarning(errno, "Failed to create display"); ::exit(1); } @@ -219,7 +219,7 @@ QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const if (screen->output() == output) return screen; } - return 0; + return nullptr; } void QWaylandDisplay::waitForScreens() @@ -333,7 +333,7 @@ uint32_t QWaylandDisplay::currentTimeMillisec() { //### we throw away the time information struct timeval tv; - int ret = gettimeofday(&tv, 0); + int ret = gettimeofday(&tv, nullptr); if (ret == 0) return tv.tv_sec*1000 + tv.tv_usec/1000; return 0; diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp index fac5fb840..16ee057c5 100644 --- a/src/client/qwaylandinputcontext.cpp +++ b/src/client/qwaylandinputcontext.cpp @@ -403,7 +403,7 @@ QWaylandInputContext::~QWaylandInputContext() bool QWaylandInputContext::isValid() const { - return mDisplay->textInputManager() != 0; + return mDisplay->textInputManager() != nullptr; } void QWaylandInputContext::reset() diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index f0182218f..698abd8fd 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -121,7 +121,7 @@ public: }; QWaylandIntegration::QWaylandIntegration() - : mClientBufferIntegration(0) + : mClientBufferIntegration(nullptr) , mInputDeviceIntegration(nullptr) , mFontDb(new QGenericUnixFontDatabase()) , mNativeInterface(new QWaylandNativeInterface(this)) @@ -198,7 +198,7 @@ QPlatformOpenGLContext *QWaylandIntegration::createPlatformOpenGLContext(QOpenGL { if (mDisplay->clientBufferIntegration()) return mDisplay->clientBufferIntegration()->createPlatformOpenGLContext(context->format(), context->shareHandle()); - return 0; + return nullptr; } #endif // opengl diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp index b6336f2e6..fba755577 100644 --- a/src/client/qwaylandscreen.cpp +++ b/src/client/qwaylandscreen.cpp @@ -65,7 +65,7 @@ QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, int version, uin , mOutputName(QStringLiteral("Screen%1").arg(id)) , m_orientation(Qt::PrimaryOrientation) #if QT_CONFIG(cursor) - , mWaylandCursor(0) + , mWaylandCursor(nullptr) #endif { } diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp index a13a5f764..24554ee44 100644 --- a/src/client/qwaylandshmbackingstore.cpp +++ b/src/client/qwaylandshmbackingstore.cpp @@ -73,8 +73,8 @@ Q_LOGGING_CATEGORY(logCategory, "qt.qpa.wayland.backingstore") QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display, const QSize &size, QImage::Format format, int scale) : QWaylandBuffer() - , mShmPool(0) - , mMarginsImage(0) + , mShmPool(nullptr) + , mMarginsImage(nullptr) { int stride = size.width() * 4; int alloc = stride * size.height(); @@ -105,7 +105,7 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display, // map ourselves: QFile::map() will unmap when the object is destroyed, // but we want this mapping to persist (unmapping in destructor) uchar *data = (uchar *) - mmap(NULL, alloc, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); + mmap(nullptr, alloc, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (data == (uchar *) MAP_FAILED) { qErrnoWarning("QWaylandShmBuffer: mmap failed"); return; @@ -147,7 +147,7 @@ QImage *QWaylandShmBuffer::imageInsideMargins(const QMargins &marginsIn) } if (margins.isNull()) { delete mMarginsImage; - mMarginsImage = 0; + mMarginsImage = nullptr; } mMargins = margins; @@ -161,8 +161,8 @@ QImage *QWaylandShmBuffer::imageInsideMargins(const QMargins &marginsIn) QWaylandShmBackingStore::QWaylandShmBackingStore(QWindow *window) : QPlatformBackingStore(window) , mDisplay(QWaylandScreen::waylandScreenFromWindow(window)->display()) - , mFrontBuffer(0) - , mBackBuffer(0) + , mFrontBuffer(nullptr) + , mBackBuffer(nullptr) , mPainting(false) { @@ -249,7 +249,7 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size) } else { mBuffers.removeOne(b); if (mBackBuffer == b) - mBackBuffer = 0; + mBackBuffer = nullptr; delete b; } } @@ -262,7 +262,7 @@ QWaylandShmBuffer *QWaylandShmBackingStore::getBuffer(const QSize &size) mBuffers.prepend(b); return b; } - return 0; + return nullptr; } void QWaylandShmBackingStore::resize(const QSize &size) diff --git a/src/client/qwaylandtouch.cpp b/src/client/qwaylandtouch.cpp index f5521a31c..48c869a60 100644 --- a/src/client/qwaylandtouch.cpp +++ b/src/client/qwaylandtouch.cpp @@ -48,11 +48,11 @@ namespace QtWaylandClient { QWaylandTouchExtension::QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id) : QtWayland::qt_touch_extension(display->wl_registry(), id, 1), mDisplay(display), - mTouchDevice(0), + mTouchDevice(nullptr), mPointsLeft(0), mFlags(0), mMouseSourceId(-1), - mInputDevice(0) + mInputDevice(nullptr) { } diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 2e709440f..75dfaa499 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -75,15 +75,15 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -QWaylandWindow *QWaylandWindow::mMouseGrab = 0; +QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr; QWaylandWindow::QWaylandWindow(QWindow *window) : QObject() , QPlatformWindow(window) , mDisplay(waylandScreen()->display()) - , mShellSurface(0) - , mSubSurfaceWindow(0) - , mWindowDecoration(0) + , mShellSurface(nullptr) + , mSubSurfaceWindow(nullptr) + , mWindowDecoration(nullptr) , mMouseEventsInContentArea(false) , mMousePressedInContentArea(Qt::NoButton) , mWaitingForFrameSync(false) @@ -124,7 +124,7 @@ QWaylandWindow::~QWaylandWindow() } if (mMouseGrab == this) { - mMouseGrab = 0; + mMouseGrab = nullptr; } } @@ -256,9 +256,9 @@ void QWaylandWindow::reset(bool sendDestroyEvent) QGuiApplication::sendEvent(window(), &e); } delete mShellSurface; - mShellSurface = 0; + mShellSurface = nullptr; delete mSubSurfaceWindow; - mSubSurfaceWindow = 0; + mSubSurfaceWindow = nullptr; if (isInitialized()) destroy(); @@ -285,7 +285,7 @@ void QWaylandWindow::setParent(const QPlatformWindow *parent) if (!window()->isVisible()) return; - QWaylandWindow *oldparent = mSubSurfaceWindow ? mSubSurfaceWindow->parent() : 0; + QWaylandWindow *oldparent = mSubSurfaceWindow ? mSubSurfaceWindow->parent() : nullptr; if (oldparent == parent) return; @@ -574,7 +574,7 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y) attach(buffer->buffer(), x, y); } else { - QtWayland::wl_surface::attach(0, 0, 0); + QtWayland::wl_surface::attach(nullptr, 0, 0); } } @@ -777,7 +777,7 @@ bool QWaylandWindow::createDecoration() } } else { delete mWindowDecoration; - mWindowDecoration = 0; + mWindowDecoration = nullptr; } if (hadDecoration != (bool)mWindowDecoration) { @@ -984,7 +984,7 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab) return false; } - mMouseGrab = grab ? this : 0; + mMouseGrab = grab ? this : nullptr; return true; } diff --git a/src/client/qwaylandwlshellsurface.cpp b/src/client/qwaylandwlshellsurface.cpp index 185cfc4a9..7c8d51721 100644 --- a/src/client/qwaylandwlshellsurface.cpp +++ b/src/client/qwaylandwlshellsurface.cpp @@ -127,14 +127,14 @@ void QWaylandWlShellSurface::setMaximized() { m_maximized = true; m_size = m_window->window()->geometry().size(); - set_maximized(0); + set_maximized(nullptr); } void QWaylandWlShellSurface::setFullscreen() { m_fullscreen = true; m_size = m_window->window()->geometry().size(); - set_fullscreen(WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, 0); + set_fullscreen(WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, nullptr); } void QWaylandWlShellSurface::setNormal() diff --git a/src/client/shellintegration/qwaylandshellintegrationplugin_p.h b/src/client/shellintegration/qwaylandshellintegrationplugin_p.h index 266e6980c..8ec9a5423 100644 --- a/src/client/shellintegration/qwaylandshellintegrationplugin_p.h +++ b/src/client/shellintegration/qwaylandshellintegrationplugin_p.h @@ -69,7 +69,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationPlugin : public QObject { Q_OBJECT public: - explicit QWaylandShellIntegrationPlugin(QObject *parent = 0); + explicit QWaylandShellIntegrationPlugin(QObject *parent = nullptr); ~QWaylandShellIntegrationPlugin(); virtual QWaylandShellIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/compositor/compositor_api/qwaylandbufferref.cpp b/src/compositor/compositor_api/qwaylandbufferref.cpp index 8ceeeea56..affd7af33 100644 --- a/src/compositor/compositor_api/qwaylandbufferref.cpp +++ b/src/compositor/compositor_api/qwaylandbufferref.cpp @@ -71,7 +71,7 @@ public: QWaylandBufferRef::QWaylandBufferRef() : d(new QWaylandBufferRefPrivate) { - d->buffer = 0; + d->buffer = nullptr; } /*! diff --git a/src/compositor/compositor_api/qwaylandclient.cpp b/src/compositor/compositor_api/qwaylandclient.cpp index 122fd41c3..471c1b5a1 100644 --- a/src/compositor/compositor_api/qwaylandclient.cpp +++ b/src/compositor/compositor_api/qwaylandclient.cpp @@ -69,7 +69,7 @@ public: Q_UNUSED(data); QWaylandClient *client = reinterpret_cast(listener)->parent; - Q_ASSERT(client != 0); + Q_ASSERT(client != nullptr); delete client; } @@ -144,7 +144,7 @@ QWaylandClient::~QWaylandClient() QWaylandClient *QWaylandClient::fromWlClient(QWaylandCompositor *compositor, wl_client *wlClient) { if (!wlClient) - return 0; + return nullptr; QWaylandClient *client = nullptr; @@ -152,7 +152,7 @@ QWaylandClient *QWaylandClient::fromWlClient(QWaylandCompositor *compositor, wl_ QWaylandClientPrivate::client_destroy_callback); if (l) client = reinterpret_cast( - wl_container_of(l, (QWaylandClientPrivate::Listener *)0, listener))->parent; + wl_container_of(l, (QWaylandClientPrivate::Listener *)nullptr, listener))->parent; if (!client) { // The original idea was to create QWaylandClient instances when diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 4c662a34a..289af2f38 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -148,11 +148,11 @@ public: } // namespace QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) - : display(0) + : display(nullptr) #if QT_CONFIG(opengl) , use_hw_integration_extension(true) - , client_buffer_integration(0) - , server_buffer_integration(0) + , client_buffer_integration(nullptr) + , server_buffer_integration(nullptr) #endif , retainSelection(false) , preInitialized(false) @@ -834,7 +834,7 @@ QWaylandSeat *QWaylandCompositor::defaultSeat() const QWaylandSeat *QWaylandCompositor::seatFor(QInputEvent *inputEvent) { Q_D(QWaylandCompositor); - QWaylandSeat *dev = NULL; + QWaylandSeat *dev = nullptr; for (int i = 0; i < d->seats.size(); i++) { QWaylandSeat *candidate = d->seats.at(i); if (candidate->isOwner(inputEvent)) { diff --git a/src/compositor/compositor_api/qwaylanddrag.cpp b/src/compositor/compositor_api/qwaylanddrag.cpp index c52e424d5..34f936a56 100644 --- a/src/compositor/compositor_api/qwaylanddrag.cpp +++ b/src/compositor/compositor_api/qwaylanddrag.cpp @@ -83,7 +83,7 @@ QWaylandSurface *QWaylandDrag::icon() const const QtWayland::DataDevice *dataDevice = d->dataDevice(); if (!dataDevice) - return 0; + return nullptr; return dataDevice->dragIcon(); } @@ -110,7 +110,7 @@ bool QWaylandDrag::visible() const if (!dataDevice) return false; - return dataDevice->dragIcon() != 0; + return dataDevice->dragIcon() != nullptr; } void QWaylandDrag::dragMove(QWaylandSurface *target, const QPointF &pos) diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp index 575a64df4..69e5971eb 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp @@ -138,7 +138,7 @@ void QWaylandInputMethodControl::defaultSeatChanged() { Q_D(QWaylandInputMethodControl); - disconnect(d->textInput(), 0, this, 0); + disconnect(d->textInput(), nullptr, this, nullptr); d->seat = d->compositor->defaultSeat(); QWaylandTextInput *textInput = d->textInput(); diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index 930eae1ae..e35c0f371 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -71,7 +71,7 @@ QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat) , pendingKeymap(false) #if QT_CONFIG(xkbcommon_evdev) , keymap_fd(-1) - , xkb_state(0) + , xkb_state(nullptr) #endif , repeatRate(40) , repeatDelay(400) @@ -168,7 +168,7 @@ void QWaylandKeyboardPrivate::keyboard_bind_resource(wl_keyboard::Resource *reso void QWaylandKeyboardPrivate::keyboard_destroy_resource(wl_keyboard::Resource *resource) { if (focusResource == resource) - focusResource = 0; + focusResource = nullptr; } void QWaylandKeyboardPrivate::keyboard_release(wl_keyboard::Resource *resource) @@ -333,7 +333,7 @@ void QWaylandKeyboardPrivate::createXKBState(xkb_keymap *keymap) return; } - keymap_area = static_cast(mmap(0, keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, keymap_fd, 0)); + keymap_area = static_cast(mmap(nullptr, keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, keymap_fd, 0)); if (keymap_area == MAP_FAILED) { close(keymap_fd); keymap_fd = -1; @@ -448,8 +448,8 @@ void QWaylandKeyboard::focusDestroyed(void *data) Q_D(QWaylandKeyboard); d->focusDestroyListener.reset(); - d->focus = 0; - d->focusResource = 0; + d->focus = nullptr; + d->focusResource = nullptr; } void QWaylandKeyboard::updateKeymap() diff --git a/src/compositor/compositor_api/qwaylandoutput_p.h b/src/compositor/compositor_api/qwaylandoutput_p.h index dab6daf73..5a21c3de7 100644 --- a/src/compositor/compositor_api/qwaylandoutput_p.h +++ b/src/compositor/compositor_api/qwaylandoutput_p.h @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE struct QWaylandSurfaceViewMapper { QWaylandSurfaceViewMapper() - : surface(0) + : surface(nullptr) , views() , has_entered(false) {} diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 74ce326e5..91e85b884 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -163,7 +163,7 @@ void QWaylandBufferMaterialShader::updateState(const QSGMaterialShader::RenderSt const char * const *QWaylandBufferMaterialShader::attributeNames() const { - static char const *const attr[] = { "qt_VertexPosition", "qt_VertexTexCoord", 0 }; + static char const *const attr[] = { "qt_VertexPosition", "qt_VertexTexCoord", nullptr }; return attr; } @@ -261,14 +261,14 @@ void QWaylandBufferMaterial::ensureTextures(int count) } } -QMutex *QWaylandQuickItemPrivate::mutex = 0; +QMutex *QWaylandQuickItemPrivate::mutex = nullptr; class QWaylandSurfaceTextureProvider : public QSGTextureProvider { public: QWaylandSurfaceTextureProvider() : m_smooth(false) - , m_sgTex(0) + , m_sgTex(nullptr) { } @@ -283,7 +283,7 @@ public: Q_ASSERT(QThread::currentThread() == thread()); m_ref = buffer; delete m_sgTex; - m_sgTex = 0; + m_sgTex = nullptr; if (m_ref.hasBuffer()) { if (buffer.isSharedMemory()) { m_sgTex = surfaceItem->window()->createTextureFromImage(buffer.image()); diff --git a/src/compositor/compositor_api/qwaylandresource.cpp b/src/compositor/compositor_api/qwaylandresource.cpp index 07e67a9b1..7cfcce132 100644 --- a/src/compositor/compositor_api/qwaylandresource.cpp +++ b/src/compositor/compositor_api/qwaylandresource.cpp @@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE QWaylandResource::QWaylandResource() - : m_resource(0) + : m_resource(nullptr) { } diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp index 4b506bcda..2ee32bfb2 100644 --- a/src/compositor/compositor_api/qwaylandseat.cpp +++ b/src/compositor/compositor_api/qwaylandseat.cpp @@ -89,15 +89,15 @@ void QWaylandSeatPrivate::setCapabilities(QWaylandSeat::CapabilityFlags caps) QWaylandSeat::CapabilityFlags changed = caps ^ capabilities; if (changed & QWaylandSeat::Pointer) { - pointer.reset(pointer.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreatePointerDevice(q) : 0); + pointer.reset(pointer.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreatePointerDevice(q) : nullptr); } if (changed & QWaylandSeat::Keyboard) { - keyboard.reset(keyboard.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateKeyboardDevice(q) : 0); + keyboard.reset(keyboard.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateKeyboardDevice(q) : nullptr); } if (changed & QWaylandSeat::Touch) { - touch.reset(touch.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateTouchDevice(q) : 0); + touch.reset(touch.isNull() ? QWaylandCompositorPrivate::get(compositor)->callCreateTouchDevice(q) : nullptr); } capabilities = caps; diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index 37b6876ac..a5316f535 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -81,7 +81,7 @@ public: res->data = this; res->destroy = destroyCallback; #else - wl_resource_set_implementation(res, 0, this, destroyCallback); + wl_resource_set_implementation(res, nullptr, this, destroyCallback); #endif } ~FrameCallback() @@ -129,7 +129,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate() , compositor(nullptr) , refCount(1) , client(nullptr) - , role(0) + , role(nullptr) , inputRegion(infiniteRegion()) , bufferScale(1) , isCursorSurface(false) @@ -140,7 +140,7 @@ QWaylandSurfacePrivate::QWaylandSurfacePrivate() #if QT_CONFIG(im) , inputMethodControl(nullptr) #endif - , subsurface(0) + , subsurface(nullptr) { pending.buffer = QWaylandBufferRef(); pending.newlyAttached = false; @@ -843,7 +843,7 @@ void QWaylandSurfacePrivate::derefView(QWaylandView *view) void QWaylandSurfacePrivate::initSubsurface(QWaylandSurface *parent, wl_client *client, int id, int version) { Q_Q(QWaylandSurface); - QWaylandSurface *oldParent = 0; // TODO: implement support for switching parents + QWaylandSurface *oldParent = nullptr; // TODO: implement support for switching parents subsurface = new Subsurface(this); subsurface->init(client, id, version); diff --git a/src/compositor/extensions/qwaylandtextinput.cpp b/src/compositor/extensions/qwaylandtextinput.cpp index 11454da06..552aa0667 100644 --- a/src/compositor/extensions/qwaylandtextinput.cpp +++ b/src/compositor/extensions/qwaylandtextinput.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QWaylandTextInputClientState::QWaylandTextInputClientState() - : hints(0) + : hints(Qt::ImhNone) , cursorRectangle() , surroundingText() , cursorPosition(0) @@ -339,7 +339,7 @@ void QWaylandTextInputPrivate::zwp_text_input_v2_bind_resource(Resource *resourc void QWaylandTextInputPrivate::zwp_text_input_v2_destroy_resource(Resource *resource) { if (focusResource == resource) - focusResource = 0; + focusResource = nullptr; } void QWaylandTextInputPrivate::zwp_text_input_v2_destroy(Resource *resource) @@ -426,7 +426,7 @@ void QWaylandTextInputPrivate::zwp_text_input_v2_set_content_type(Resource *reso if (resource != focusResource) return; - pendingState->hints = 0; + pendingState->hints = Qt::ImhNone; if ((hint & content_hint_auto_completion) == 0 && (hint & content_hint_auto_correction) == 0) diff --git a/src/compositor/extensions/qwaylandwlshell.cpp b/src/compositor/extensions/qwaylandwlshell.cpp index c588c1063..59b311919 100644 --- a/src/compositor/extensions/qwaylandwlshell.cpp +++ b/src/compositor/extensions/qwaylandwlshell.cpp @@ -704,7 +704,7 @@ QWaylandWlShellSurface *QWaylandWlShellSurface::fromResource(wl_resource *resour QWaylandWlShellSurfacePrivate::Resource *res = QWaylandWlShellSurfacePrivate::Resource::fromResource(resource); if (res) return static_cast(res->shell_surface_object)->q_func(); - return 0; + return nullptr; } QT_END_NAMESPACE diff --git a/src/compositor/extensions/qwlqtkey.cpp b/src/compositor/extensions/qwlqtkey.cpp index 99f71f140..73d06ae6b 100644 --- a/src/compositor/extensions/qwlqtkey.cpp +++ b/src/compositor/extensions/qwlqtkey.cpp @@ -61,7 +61,7 @@ bool QtKeyExtensionGlobal::postQtKeyEvent(QKeyEvent *event, QWaylandSurface *sur if (target) { send_qtkey(target->handle, - surface ? surface->resource() : 0, + surface ? surface->resource() : nullptr, time, event->type(), event->key(), event->modifiers(), event->nativeScanCode(), event->nativeVirtualKey(), diff --git a/src/compositor/extensions/qwlqttouch.cpp b/src/compositor/extensions/qwlqttouch.cpp index 3a0752b81..161ec6c18 100644 --- a/src/compositor/extensions/qwlqttouch.cpp +++ b/src/compositor/extensions/qwlqttouch.cpp @@ -52,7 +52,7 @@ TouchExtensionGlobal::TouchExtensionGlobal(QWaylandCompositor *compositor) : QWaylandCompositorExtensionTemplate(compositor) , QtWaylandServer::qt_touch_extension(compositor->display(), 1) , m_compositor(compositor) - , m_flags(0) + , m_flags(BehaviorFlag::None) , m_resources() , m_posData(maxRawPos * 2) { diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp index 67d4e5f54..3f4d4a412 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration.cpp +++ b/src/compositor/hardware_integration/qwlclientbufferintegration.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE namespace QtWayland { ClientBufferIntegration::ClientBufferIntegration() - : m_compositor(0) + : m_compositor(nullptr) { } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp index 57359190d..68c8ac4c6 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp @@ -90,7 +90,7 @@ ClientBufferIntegration *ClientBufferIntegrationFactory::create(const QString &n if (ClientBufferIntegration *ret = qLoadPlugin(loader(), name, args)) return ret; #endif - return 0; + return nullptr; } } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h index bc8f0a48a..edf4fea0a 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h @@ -68,7 +68,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT ClientBufferIntegrationPlugin : public QObject { Q_OBJECT public: - explicit ClientBufferIntegrationPlugin(QObject *parent = 0); + explicit ClientBufferIntegrationPlugin(QObject *parent = nullptr); ~ClientBufferIntegrationPlugin(); virtual ClientBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp index 6425f7c38..2b60de5eb 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp @@ -90,7 +90,7 @@ ServerBufferIntegration *ServerBufferIntegrationFactory::create(const QString &n if (ServerBufferIntegration *ret = qLoadPlugin(loader(), name, args)) return ret; #endif - return 0; + return nullptr; } } diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h index e1b123c6f..0cb5ed323 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h @@ -68,7 +68,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT ServerBufferIntegrationPlugin : public QObject { Q_OBJECT public: - explicit ServerBufferIntegrationPlugin(QObject *parent = 0); + explicit ServerBufferIntegrationPlugin(QObject *parent = nullptr); ~ServerBufferIntegrationPlugin(); virtual ServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0; diff --git a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp index a8314daea..86331a744 100644 --- a/src/compositor/wayland_wrapper/qwlbuffermanager.cpp +++ b/src/compositor/wayland_wrapper/qwlbuffermanager.cpp @@ -57,7 +57,7 @@ BufferManager::BufferManager(QWaylandCompositor *compositor) struct buffer_manager_destroy_listener : wl_listener { buffer_manager_destroy_listener() - : d(0) + : d(nullptr) { notify = BufferManager::destroy_listener_callback; wl_list_init(&this->link); diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 73d7bb1fa..3b557a109 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -64,13 +64,13 @@ DataDevice::DataDevice(QWaylandSeat *seat) : wl_data_device() , m_compositor(seat->compositor()) , m_seat(seat) - , m_selectionSource(0) + , m_selectionSource(nullptr) #if QT_CONFIG(draganddrop) - , m_dragClient(0) - , m_dragDataSource(0) - , m_dragFocus(0) - , m_dragFocusResource(0) - , m_dragIcon(0) + , m_dragClient(nullptr) + , m_dragDataSource(nullptr) + , m_dragFocus(nullptr) + , m_dragFocusResource(nullptr) + , m_dragIcon(nullptr) , m_dragOrigin(nullptr) #endif { @@ -95,7 +95,7 @@ void DataDevice::setFocus(QWaylandClient *focusClient) void DataDevice::sourceDestroyed(DataSource *source) { if (m_selectionSource == source) - m_selectionSource = 0; + m_selectionSource = nullptr; } #if QT_CONFIG(draganddrop) @@ -103,8 +103,8 @@ void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPositi { if (m_dragFocusResource) { send_leave(m_dragFocusResource->handle); - m_dragFocus = 0; - m_dragFocusResource = 0; + m_dragFocus = nullptr; + m_dragFocusResource = nullptr; } if (!focus) @@ -120,7 +120,7 @@ void DataDevice::setDragFocus(QWaylandSurface *focus, const QPointF &localPositi uint32_t serial = m_compositor->nextSerial(); - DataOffer *offer = m_dragDataSource ? new DataOffer(m_dragDataSource, resource) : 0; + DataOffer *offer = m_dragDataSource ? new DataOffer(m_dragDataSource, resource) : nullptr; if (m_dragDataSource && !offer) return; @@ -174,7 +174,7 @@ void DataDevice::cancelDrag() void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) { m_dragClient = resource->client(); - m_dragDataSource = source ? DataSource::fromResource(source) : 0; + m_dragDataSource = source ? DataSource::fromResource(source) : nullptr; m_dragOrigin = QWaylandSurface::fromResource(origin); QWaylandDrag *drag = m_seat->drag(); setDragIcon(icon ? QWaylandSurface::fromResource(icon) : nullptr); @@ -198,7 +198,7 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou { Q_UNUSED(serial); - DataSource *dataSource = source ? DataSource::fromResource(source) : 0; + DataSource *dataSource = source ? DataSource::fromResource(source) : nullptr; if (m_selectionSource) m_selectionSource->cancel(); @@ -215,7 +215,7 @@ void DataDevice::data_device_set_selection(Resource *, struct ::wl_resource *sou DataOffer *offer = new DataOffer(m_selectionSource, resource); send_selection(resource->handle, offer->resource()->handle); } else if (resource) { - send_selection(resource->handle, 0); + send_selection(resource->handle, nullptr); } } diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index a1937c923..0c0855d24 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -59,11 +59,11 @@ QT_BEGIN_NAMESPACE namespace QtWayland { DataDeviceManager::DataDeviceManager(QWaylandCompositor *compositor) - : QObject(0) + : QObject(nullptr) , wl_data_device_manager(compositor->display(), 1) , m_compositor(compositor) - , m_current_selection_source(0) - , m_retainedReadNotifier(0) + , m_current_selection_source(nullptr) + , m_retainedReadNotifier(nullptr) , m_compositorOwnsSelection(false) { } @@ -137,7 +137,7 @@ void DataDeviceManager::finishReadFromClient(bool exhausted) // or else clients may SIGPIPE. m_obsoleteRetainedReadNotifiers.append(m_retainedReadNotifier); } - m_retainedReadNotifier = 0; + m_retainedReadNotifier = nullptr; } } @@ -219,7 +219,7 @@ bool DataDeviceManager::offerFromCompositorToClient(wl_resource *clientDataDevic struct wl_resource *selectionOffer = wl_resource_create(client, &wl_data_offer_interface, -1, 0); - wl_resource_set_implementation(selectionOffer, &compositor_offer_interface, this, 0); + wl_resource_set_implementation(selectionOffer, &compositor_offer_interface, this, nullptr); wl_data_device_send_data_offer(clientDataDeviceResource, selectionOffer); foreach (const QString &format, m_retainedData.formats()) { QByteArray ba = format.toLatin1(); diff --git a/src/compositor/wayland_wrapper/qwldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp index 3a50cd0ff..2d523dad9 100644 --- a/src/compositor/wayland_wrapper/qwldatasource.cpp +++ b/src/compositor/wayland_wrapper/qwldatasource.cpp @@ -52,8 +52,8 @@ namespace QtWayland { DataSource::DataSource(struct wl_client *client, uint32_t id, uint32_t time) : QtWaylandServer::wl_data_source(client, id, 1) , m_time(time) - , m_device(0) - , m_manager(0) + , m_device(nullptr) + , m_manager(nullptr) { } diff --git a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp index 35fdc8277..c7dbe1bea 100644 --- a/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp +++ b/src/hardwareintegration/compositor/drm-egl-server/drmeglserverbufferintegration.cpp @@ -103,7 +103,7 @@ struct ::wl_resource *DrmEglServerBuffer::resourceForClient(struct ::wl_client * auto integrationResource = m_integration->resourceMap().value(client); if (!integrationResource) { qWarning("DrmEglServerBuffer::resourceForClient: Trying to get resource for ServerBuffer. But client is not bound to the drm_egl interface"); - return 0; + return nullptr; } struct ::wl_resource *drm_egl_integration_resource = integrationResource->handle; Resource *resource = add(client, 1); diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index fdaddb6ab..a088027a3 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -217,12 +217,12 @@ WaylandEglClientBufferIntegrationPrivate::WaylandEglClientBufferIntegrationPriva : egl_display(EGL_NO_DISPLAY) , valid(false) , display_bound(false) - , egl_bind_wayland_display(0) - , egl_unbind_wayland_display(0) - , egl_query_wayland_buffer(0) - , egl_create_image(0) - , egl_destroy_image(0) - , gl_egl_image_target_texture_2d(0) + , egl_bind_wayland_display(nullptr) + , egl_unbind_wayland_display(nullptr) + , egl_query_wayland_buffer(nullptr) + , egl_create_image(nullptr) + , egl_destroy_image(nullptr) + , gl_egl_image_target_texture_2d(nullptr) , funcs(nullptr) { } @@ -593,7 +593,7 @@ quintptr WaylandEglClientBuffer::lockNativeBuffer() EGLImageKHR image = p->egl_create_image(p->egl_display, EGL_NO_CONTEXT, EGL_WAYLAND_BUFFER_WL, - m_buffer, NULL); + m_buffer, nullptr); return reinterpret_cast(image); } diff --git a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp index 071b08827..049b8b3fe 100644 --- a/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-egl/xcompositeeglintegration.cpp @@ -69,7 +69,7 @@ QVector eglbuildSpec() XCompositeEglClientBufferIntegration::XCompositeEglClientBufferIntegration() : QtWayland::ClientBufferIntegration() - , mDisplay(0) + , mDisplay(nullptr) { } diff --git a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp index 296a205ce..b1c947b53 100644 --- a/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp +++ b/src/hardwareintegration/compositor/xcomposite-glx/xcompositeglxintegration.cpp @@ -72,8 +72,8 @@ QVector qglx_buildSpec() XCompositeGLXClientBufferIntegration::XCompositeGLXClientBufferIntegration() : QtWayland::ClientBufferIntegration() - , mDisplay(0) - , mHandler(0) + , mDisplay(nullptr) + , mHandler(nullptr) { qDebug() << "Loading GLX integration"; } @@ -162,7 +162,7 @@ QOpenGLTexture *XCompositeGLXClientBuffer::toOpenGlTexture(int plane) } tex->bind(); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - m_integration->m_glxBindTexImageEXT(m_integration->xDisplay(),m_glxPixmap,GLX_FRONT_EXT, 0); + m_integration->m_glxBindTexImageEXT(m_integration->xDisplay(),m_glxPixmap,GLX_FRONT_EXT, nullptr); // TODO: release in the destructor? // m_glxReleaseTexImageEXT(mDisplay,glxPixmap,GLX_FRONT_EXT); diff --git a/src/imports/compositor/qwaylandmousetracker_p.h b/src/imports/compositor/qwaylandmousetracker_p.h index a50abbbbb..fa9dedfd5 100644 --- a/src/imports/compositor/qwaylandmousetracker_p.h +++ b/src/imports/compositor/qwaylandmousetracker_p.h @@ -58,7 +58,7 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandMouseTracker : public QQuickItem Q_PROPERTY(bool windowSystemCursorEnabled READ windowSystemCursorEnabled WRITE setWindowSystemCursorEnabled NOTIFY windowSystemCursorEnabledChanged) public: - QWaylandMouseTracker(QQuickItem *parent = 0); + QWaylandMouseTracker(QQuickItem *parent = nullptr); qreal mouseX() const; qreal mouseY() const; diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp index d6a83dbbc..057002c9d 100644 --- a/src/qtwaylandscanner/qtwaylandscanner.cpp +++ b/src/qtwaylandscanner/qtwaylandscanner.cpp @@ -228,7 +228,7 @@ const WaylandArgument *newIdArgument(const QList &arguments) if (arguments.at(i).type == "new_id") return &arguments.at(i); } - return 0; + return nullptr; } void printEvent(const WaylandEvent &e, bool omitNames = false, bool withResource = false) -- cgit v1.2.3