diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-02-27 11:32:15 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-02-27 17:03:41 +0000 |
commit | c4bd9198b4a0fac809903dd2c09276c2c3c1b22e (patch) | |
tree | 83325fe11d258c922ede480e0ad3de3df45032fa /src/compositor/compositor_api | |
parent | 72999738489b5251d025c954a77c93e8e1fdfd9d (diff) |
Init variables where they are declared when possible (clang-tidy)
clang-tidy -p compile_commands.json $file \
-checks='-*,modernize-use-default-member-init,readability-redundant-member-init' \
-config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' \
-header-filter='qtwayland' \
-fix
Afterwards I ran search and replace on the diff to clean up some whitespace errors:
- Replaced '(\n\+[^:\n]*)(:\s+\+\s+)' with '$1: '
- Replaced '(\n\+[^,\n]*)(,\s+\+\s+)' with '$1, '
- Replaced '\n\+\s*\n' with '\n'
I also had to do some manual edits, because for some reason, this particular
clang-tidy check doesn't trigger for some files.
Change-Id: I3b3909bac4bf20108bbe8ad1e01bcc54236dae1b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/compositor/compositor_api')
23 files changed, 93 insertions, 201 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 289af2f38..ae5ed1ec1 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -148,15 +148,6 @@ public: } // namespace QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) - : display(nullptr) -#if QT_CONFIG(opengl) - , use_hw_integration_extension(true) - , client_buffer_integration(nullptr) - , server_buffer_integration(nullptr) -#endif - , retainSelection(false) - , preInitialized(false) - , initialized(false) { if (QGuiApplication::platformNativeInterface()) display = static_cast<wl_display*>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("server_wl_display")); diff --git a/src/compositor/compositor_api/qwaylandcompositor_p.h b/src/compositor/compositor_api/qwaylandcompositor_p.h index 18595a806..b1959e68f 100644 --- a/src/compositor/compositor_api/qwaylandcompositor_p.h +++ b/src/compositor/compositor_api/qwaylandcompositor_p.h @@ -128,7 +128,7 @@ protected: void loadServerBufferIntegration(); QByteArray socket_name; - struct wl_display *display; + struct wl_display *display = nullptr; QList<QWaylandSeat *> seats; QList<QWaylandOutput *> outputs; @@ -147,7 +147,7 @@ protected: QList<QWaylandClient *> clients; #if QT_CONFIG(opengl) - bool use_hw_integration_extension; + bool use_hw_integration_extension = true; QScopedPointer<QtWayland::HardwareIntegration> hw_integration; QScopedPointer<QtWayland::ClientBufferIntegration> client_buffer_integration; QScopedPointer<QtWayland::ServerBufferIntegration> server_buffer_integration; @@ -155,9 +155,9 @@ protected: QScopedPointer<QWindowSystemEventHandler> eventHandler; - bool retainSelection; - bool preInitialized; - bool initialized; + bool retainSelection = false; + bool preInitialized = false; + bool initialized = false; QList<QPointer<QObject> > polish_objects; Q_DECLARE_PUBLIC(QWaylandCompositor) diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp index 69e5971eb..a443502fa 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol.cpp @@ -150,11 +150,9 @@ void QWaylandInputMethodControl::defaultSeatChanged() } QWaylandInputMethodControlPrivate::QWaylandInputMethodControlPrivate(QWaylandSurface *surface) - : QObjectPrivate() - , compositor(surface->compositor()) + : compositor(surface->compositor()) , seat(compositor->defaultSeat()) , surface(surface) - , enabled(false) { } diff --git a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h index aedff6486..337cf0087 100644 --- a/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h +++ b/src/compositor/compositor_api/qwaylandinputmethodcontrol_p.h @@ -72,10 +72,10 @@ public: QWaylandTextInput *textInput() const; - QWaylandCompositor *compositor; - QWaylandSeat *seat; - QWaylandSurface *surface; - bool enabled; + QWaylandCompositor *compositor = nullptr; + QWaylandSeat *seat = nullptr; + QWaylandSurface *surface = nullptr; + bool enabled = false; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index e35c0f371..7ab8bff9e 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -59,22 +59,7 @@ QT_BEGIN_NAMESPACE QWaylandKeyboardPrivate::QWaylandKeyboardPrivate(QWaylandSeat *seat) - : QtWaylandServer::wl_keyboard() - , seat(seat) - , focus() - , focusResource() - , keys() - , modsDepressed() - , modsLatched() - , modsLocked() - , group() - , pendingKeymap(false) -#if QT_CONFIG(xkbcommon_evdev) - , keymap_fd(-1) - , xkb_state(nullptr) -#endif - , repeatRate(40) - , repeatDelay(400) + : seat(seat) { } diff --git a/src/compositor/compositor_api/qwaylandkeyboard_p.h b/src/compositor/compositor_api/qwaylandkeyboard_p.h index 0b47f8e8e..bcc4abb1a 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard_p.h +++ b/src/compositor/compositor_api/qwaylandkeyboard_p.h @@ -114,29 +114,29 @@ private: void sendRepeatInfo(); - QWaylandSeat *seat; + QWaylandSeat *seat = nullptr; - QWaylandSurface *focus; - Resource *focusResource; + QWaylandSurface *focus = nullptr; + Resource *focusResource = nullptr; QWaylandDestroyListener focusDestroyListener; QVector<uint32_t> keys; - uint32_t modsDepressed; - uint32_t modsLatched; - uint32_t modsLocked; - uint32_t group; + uint32_t modsDepressed = 0; + uint32_t modsLatched = 0; + uint32_t modsLocked = 0; + uint32_t group = 0; - bool pendingKeymap; + bool pendingKeymap = false; #if QT_CONFIG(xkbcommon_evdev) size_t keymap_size; - int keymap_fd; - char *keymap_area; - struct xkb_context *xkb_context; - struct xkb_state *xkb_state; + int keymap_fd = -1; + char *keymap_area = nullptr; + struct xkb_context *xkb_context = nullptr; + struct xkb_state *xkb_state = nullptr; #endif - quint32 repeatRate; - quint32 repeatDelay; + quint32 repeatRate = 40; + quint32 repeatDelay = 400; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandoutput.cpp b/src/compositor/compositor_api/qwaylandoutput.cpp index 7627195da..f7782da9c 100644 --- a/src/compositor/compositor_api/qwaylandoutput.cpp +++ b/src/compositor/compositor_api/qwaylandoutput.cpp @@ -104,16 +104,6 @@ static QtWaylandServer::wl_output::transform toWlTransform(const QWaylandOutput: } QWaylandOutputPrivate::QWaylandOutputPrivate() - : QtWaylandServer::wl_output() - , compositor(nullptr) - , window(nullptr) - , currentMode(-1) - , preferredMode(-1) - , subpixel(QWaylandOutput::SubpixelUnknown) - , transform(QWaylandOutput::TransformNormal) - , scaleFactor(1) - , sizeFollowsWindow(false) - , initialized(false) { } diff --git a/src/compositor/compositor_api/qwaylandoutput_p.h b/src/compositor/compositor_api/qwaylandoutput_p.h index 5a21c3de7..28a19ff89 100644 --- a/src/compositor/compositor_api/qwaylandoutput_p.h +++ b/src/compositor/compositor_api/qwaylandoutput_p.h @@ -70,15 +70,11 @@ QT_BEGIN_NAMESPACE struct QWaylandSurfaceViewMapper { QWaylandSurfaceViewMapper() - : surface(nullptr) - , views() - , has_entered(false) {} QWaylandSurfaceViewMapper(QWaylandSurface *s, QWaylandView *v) : surface(s) , views(1, v) - , has_entered(false) {} QWaylandView *maybePrimaryView() const @@ -90,9 +86,9 @@ struct QWaylandSurfaceViewMapper return nullptr; } - QWaylandSurface *surface; + QWaylandSurface *surface = nullptr; QVector<QWaylandView *> views; - bool has_entered; + bool has_entered = false; }; class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandOutputPrivate : public QObjectPrivate, public QtWaylandServer::wl_output @@ -116,22 +112,22 @@ protected: void output_bind_resource(Resource *resource) override; private: - QWaylandCompositor *compositor; - QWindow *window; + QWaylandCompositor *compositor = nullptr; + QWindow *window = nullptr; QString manufacturer; QString model; QPoint position; QVector<QWaylandOutputMode> modes; - int currentMode; - int preferredMode; + int currentMode = -1; + int preferredMode = -1; QRect availableGeometry; QVector<QWaylandSurfaceViewMapper> surfaceViews; QSize physicalSize; - QWaylandOutput::Subpixel subpixel; - QWaylandOutput::Transform transform; - int scaleFactor; - bool sizeFollowsWindow; - bool initialized; + QWaylandOutput::Subpixel subpixel = QWaylandOutput::SubpixelUnknown; + QWaylandOutput::Transform transform = QWaylandOutput::TransformNormal; + int scaleFactor = 1; + bool sizeFollowsWindow = false; + bool initialized = false; Q_DECLARE_PUBLIC(QWaylandOutput) Q_DISABLE_COPY(QWaylandOutputPrivate) diff --git a/src/compositor/compositor_api/qwaylandpointer.cpp b/src/compositor/compositor_api/qwaylandpointer.cpp index 4bdee9be2..77e736a58 100644 --- a/src/compositor/compositor_api/qwaylandpointer.cpp +++ b/src/compositor/compositor_api/qwaylandpointer.cpp @@ -47,12 +47,7 @@ QT_BEGIN_NAMESPACE QWaylandSurfaceRole QWaylandPointerPrivate::s_role("wl_pointer"); QWaylandPointerPrivate::QWaylandPointerPrivate(QWaylandPointer *pointer, QWaylandSeat *seat) - : QObjectPrivate() - , wl_pointer() - , seat(seat) - , output() - , enterSerial(0) - , buttonCount() + : seat(seat) { Q_UNUSED(pointer); } diff --git a/src/compositor/compositor_api/qwaylandpointer_p.h b/src/compositor/compositor_api/qwaylandpointer_p.h index 11076f34b..94f44f604 100644 --- a/src/compositor/compositor_api/qwaylandpointer_p.h +++ b/src/compositor/compositor_api/qwaylandpointer_p.h @@ -92,17 +92,17 @@ private: void sendLeave(); void ensureEntered(QWaylandSurface *surface); - QWaylandSeat *seat; - QWaylandOutput *output; + QWaylandSeat *seat = nullptr; + QWaylandOutput *output = nullptr; QPointer<QWaylandSurface> enteredSurface; QPointF localPosition; QPointF spacePosition; - bool hasSentEnter; - uint enterSerial; + bool hasSentEnter = false; + uint enterSerial = 0; - int buttonCount; + int buttonCount = 0; QWaylandDestroyListener enteredSurfaceDestroyListener; diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 91e85b884..23b52e0b4 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -140,8 +140,7 @@ static const struct { }; QWaylandBufferMaterialShader::QWaylandBufferMaterialShader(QWaylandBufferRef::BufferFormatEgl format) - : QSGMaterialShader() - , m_format(format) + : m_format(format) { setShaderSourceFile(QOpenGLShader::Vertex, QString::fromLatin1(bufferTypes[format].vertexShaderSourceFile)); setShaderSourceFile(QOpenGLShader::Fragment, QString::fromLatin1(bufferTypes[format].fragmentShaderSourceFile)); @@ -183,8 +182,7 @@ void QWaylandBufferMaterialShader::initialize() } QWaylandBufferMaterial::QWaylandBufferMaterial(QWaylandBufferRef::BufferFormatEgl format) - : QSGMaterial() - , m_format(format) + : m_format(format) { QOpenGLFunctions *gl = QOpenGLContext::currentContext()->functions(); @@ -267,8 +265,6 @@ class QWaylandSurfaceTextureProvider : public QSGTextureProvider { public: QWaylandSurfaceTextureProvider() - : m_smooth(false) - , m_sgTex(nullptr) { } @@ -313,8 +309,8 @@ public: void setSmooth(bool smooth) { m_smooth = smooth; } private: - bool m_smooth; - QSGTexture *m_sgTex; + bool m_smooth = false; + QSGTexture *m_sgTex = nullptr; QWaylandBufferRef m_ref; }; diff --git a/src/compositor/compositor_api/qwaylandquickitem_p.h b/src/compositor/compositor_api/qwaylandquickitem_p.h index 400cda742..de405a943 100644 --- a/src/compositor/compositor_api/qwaylandquickitem_p.h +++ b/src/compositor/compositor_api/qwaylandquickitem_p.h @@ -107,22 +107,7 @@ class QWaylandQuickItemPrivate : public QQuickItemPrivate { Q_DECLARE_PUBLIC(QWaylandQuickItem) public: - QWaylandQuickItemPrivate() - : QQuickItemPrivate() - , view(nullptr) - , oldSurface(nullptr) - , provider(nullptr) - , paintEnabled(true) - , touchEventsEnabled(true) - , inputEventsEnabled(true) - , isDragging(false) - , newTexture(false) - , focusOnClick(true) - , sizeFollowsSurface(true) - , connectedWindow(nullptr) - , origin(QWaylandSurface::OriginTopLeft) - { - } + QWaylandQuickItemPrivate() = default; void init() { @@ -169,20 +154,20 @@ public: static QMutex *mutex; QScopedPointer<QWaylandView> view; - QWaylandSurface *oldSurface; - mutable QWaylandSurfaceTextureProvider *provider; - bool paintEnabled; - bool touchEventsEnabled; - bool inputEventsEnabled; - bool isDragging; - bool newTexture; - bool focusOnClick; - bool sizeFollowsSurface; + QWaylandSurface *oldSurface = nullptr; + mutable QWaylandSurfaceTextureProvider *provider = nullptr; + bool paintEnabled = true; + bool touchEventsEnabled = true; + bool inputEventsEnabled = true; + bool isDragging = false; + bool newTexture = false; + bool focusOnClick = true; + bool sizeFollowsSurface = true; QPoint hoverPos; QMatrix4x4 lastMatrix; - QQuickWindow *connectedWindow; - QWaylandSurface::Origin origin; + QQuickWindow *connectedWindow = nullptr; + QWaylandSurface::Origin origin = QWaylandSurface::OriginTopLeft; QPointer<QObject> subsurfaceHandler; QVector<QWaylandSeat *> touchingSeats; }; diff --git a/src/compositor/compositor_api/qwaylandquickoutput.cpp b/src/compositor/compositor_api/qwaylandquickoutput.cpp index db7cc50bb..79e4fdec7 100644 --- a/src/compositor/compositor_api/qwaylandquickoutput.cpp +++ b/src/compositor/compositor_api/qwaylandquickoutput.cpp @@ -45,16 +45,11 @@ QT_BEGIN_NAMESPACE QWaylandQuickOutput::QWaylandQuickOutput() - : QWaylandOutput() - , m_updateScheduled(false) - , m_automaticFrameCallback(true) { } QWaylandQuickOutput::QWaylandQuickOutput(QWaylandCompositor *compositor, QWindow *window) : QWaylandOutput(compositor, window) - , m_updateScheduled(false) - , m_automaticFrameCallback(true) { } diff --git a/src/compositor/compositor_api/qwaylandquickoutput.h b/src/compositor/compositor_api/qwaylandquickoutput.h index f023872c0..cd79f14f5 100644 --- a/src/compositor/compositor_api/qwaylandquickoutput.h +++ b/src/compositor/compositor_api/qwaylandquickoutput.h @@ -79,8 +79,8 @@ protected: private: void doFrameCallbacks(); - bool m_updateScheduled; - bool m_automaticFrameCallback; + bool m_updateScheduled = false; + bool m_automaticFrameCallback = true; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandquicksurface.cpp b/src/compositor/compositor_api/qwaylandquicksurface.cpp index 1197e9e43..a1269b117 100644 --- a/src/compositor/compositor_api/qwaylandquicksurface.cpp +++ b/src/compositor/compositor_api/qwaylandquicksurface.cpp @@ -56,9 +56,6 @@ class QWaylandQuickSurfacePrivate : public QWaylandSurfacePrivate Q_DECLARE_PUBLIC(QWaylandQuickSurface) public: QWaylandQuickSurfacePrivate() - : QWaylandSurfacePrivate() - , useTextureAlpha(true) - , clientRenderingEnabled(true) { } @@ -66,8 +63,8 @@ public: { } - bool useTextureAlpha; - bool clientRenderingEnabled; + bool useTextureAlpha = true; + bool clientRenderingEnabled = true; }; QWaylandQuickSurface::QWaylandQuickSurface() diff --git a/src/compositor/compositor_api/qwaylandresource.cpp b/src/compositor/compositor_api/qwaylandresource.cpp index 7cfcce132..f3d010830 100644 --- a/src/compositor/compositor_api/qwaylandresource.cpp +++ b/src/compositor/compositor_api/qwaylandresource.cpp @@ -42,7 +42,6 @@ QT_BEGIN_NAMESPACE QWaylandResource::QWaylandResource() - : m_resource(nullptr) { } diff --git a/src/compositor/compositor_api/qwaylandresource.h b/src/compositor/compositor_api/qwaylandresource.h index f8c50c082..11ab64da9 100644 --- a/src/compositor/compositor_api/qwaylandresource.h +++ b/src/compositor/compositor_api/qwaylandresource.h @@ -57,7 +57,7 @@ public: wl_resource *resource() const { return m_resource; } private: - wl_resource *m_resource; + wl_resource *m_resource = nullptr; }; QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/qwaylandseat.cpp b/src/compositor/compositor_api/qwaylandseat.cpp index 2ee32bfb2..c67e6020d 100644 --- a/src/compositor/compositor_api/qwaylandseat.cpp +++ b/src/compositor/compositor_api/qwaylandseat.cpp @@ -60,21 +60,11 @@ QT_BEGIN_NAMESPACE -QWaylandSeatPrivate::QWaylandSeatPrivate(QWaylandSeat *seat) - : QObjectPrivate() - , QtWaylandServer::wl_seat() - , isInitialized(false) - , compositor(nullptr) - , mouseFocus(nullptr) - , keyboardFocus(nullptr) - , capabilities() +QWaylandSeatPrivate::QWaylandSeatPrivate(QWaylandSeat *seat) : #if QT_CONFIG(wayland_datadevice) - , data_device() + drag_handle(new QWaylandDrag(seat)), #endif -#if QT_CONFIG(draganddrop) - , drag_handle(new QWaylandDrag(seat)) -#endif - , keymap(new QWaylandKeymap()) + keymap(new QWaylandKeymap()) { } diff --git a/src/compositor/compositor_api/qwaylandseat_p.h b/src/compositor/compositor_api/qwaylandseat_p.h index 28a5fd4f0..1e182f41a 100644 --- a/src/compositor/compositor_api/qwaylandseat_p.h +++ b/src/compositor/compositor_api/qwaylandseat_p.h @@ -114,10 +114,10 @@ protected: void seat_destroy_resource(wl_seat::Resource *resource) override; private: - bool isInitialized; - QWaylandCompositor *compositor; - QWaylandView *mouseFocus; - QWaylandSurface *keyboardFocus; + bool isInitialized = false; + QWaylandCompositor *compositor = nullptr; + QWaylandView *mouseFocus = nullptr; + QWaylandSurface *keyboardFocus = nullptr; QWaylandSeat::CapabilityFlags capabilities; QScopedPointer<QWaylandPointer> pointer; diff --git a/src/compositor/compositor_api/qwaylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index a5316f535..ed9bef3cf 100644 --- a/src/compositor/compositor_api/qwaylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -75,7 +75,6 @@ public: FrameCallback(QWaylandSurface *surf, wl_resource *res) : surface(surf) , resource(res) - , canSend(false) { #if WAYLAND_VERSION_MAJOR < 1 || (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR <= 2) res->data = this; @@ -112,7 +111,7 @@ public: } QWaylandSurface *surface; wl_resource *resource; - bool canSend; + bool canSend = false; }; } static QRegion infiniteRegion() { @@ -125,22 +124,7 @@ QList<QWaylandSurfacePrivate *> QWaylandSurfacePrivate::uninitializedSurfaces; #endif QWaylandSurfacePrivate::QWaylandSurfacePrivate() - : QtWaylandServer::wl_surface() - , compositor(nullptr) - , refCount(1) - , client(nullptr) - , role(nullptr) - , inputRegion(infiniteRegion()) - , bufferScale(1) - , isCursorSurface(false) - , destroyed(false) - , hasContent(false) - , isInitialized(false) - , contentOrientation(Qt::PrimaryOrientation) -#if QT_CONFIG(im) - , inputMethodControl(nullptr) -#endif - , subsurface(nullptr) + : inputRegion(infiniteRegion()) { pending.buffer = QWaylandBufferRef(); pending.newlyAttached = false; diff --git a/src/compositor/compositor_api/qwaylandsurface_p.h b/src/compositor/compositor_api/qwaylandsurface_p.h index 3c43fc043..3dc9bf20e 100644 --- a/src/compositor/compositor_api/qwaylandsurface_p.h +++ b/src/compositor/compositor_api/qwaylandsurface_p.h @@ -140,13 +140,13 @@ protected: QtWayland::ClientBuffer *getBuffer(struct ::wl_resource *buffer); public: //member variables - QWaylandCompositor *compositor; - int refCount; - QWaylandClient *client; + QWaylandCompositor *compositor = nullptr; + int refCount = 1; + QWaylandClient *client = nullptr; QList<QWaylandView *> views; QRegion damage; QWaylandBufferRef bufferRef; - QWaylandSurfaceRole *role; + QWaylandSurfaceRole *role = nullptr; struct { QWaylandBufferRef buffer; @@ -167,15 +167,15 @@ public: //member variables QRegion opaqueRegion; QSize size; - int bufferScale; - bool isCursorSurface; - bool destroyed; - bool hasContent; - bool isInitialized; - Qt::ScreenOrientation contentOrientation; + int bufferScale = 1; + bool isCursorSurface = false; + bool destroyed = false; + bool hasContent = false; + bool isInitialized = false; + Qt::ScreenOrientation contentOrientation = Qt::PrimaryOrientation; QWindow::Visibility visibility; #if QT_CONFIG(im) - QWaylandInputMethodControl *inputMethodControl; + QWaylandInputMethodControl *inputMethodControl = nullptr; #endif class Subsurface : public QtWaylandServer::wl_subsurface @@ -198,7 +198,7 @@ public: //member variables QPoint position; }; - Subsurface *subsurface; + Subsurface *subsurface = nullptr; #ifndef QT_NO_DEBUG static QList<QWaylandSurfacePrivate *> uninitializedSurfaces; diff --git a/src/compositor/compositor_api/qwaylandtouch.cpp b/src/compositor/compositor_api/qwaylandtouch.cpp index 396a3b689..3e7298001 100644 --- a/src/compositor/compositor_api/qwaylandtouch.cpp +++ b/src/compositor/compositor_api/qwaylandtouch.cpp @@ -50,8 +50,7 @@ QT_BEGIN_NAMESPACE QWaylandTouchPrivate::QWaylandTouchPrivate(QWaylandTouch *touch, QWaylandSeat *seat) - : wl_touch() - , seat(seat) + : seat(seat) { Q_UNUSED(touch); } diff --git a/src/compositor/compositor_api/qwaylandview_p.h b/src/compositor/compositor_api/qwaylandview_p.h index 1cc55954c..b9cb0d07b 100644 --- a/src/compositor/compositor_api/qwaylandview_p.h +++ b/src/compositor/compositor_api/qwaylandview_p.h @@ -71,32 +71,24 @@ public: static QWaylandViewPrivate *get(QWaylandView *view) { return view->d_func(); } QWaylandViewPrivate() - : renderObject(nullptr) - , surface(nullptr) - , output(nullptr) - , nextBufferCommitted(false) - , bufferLocked(false) - , broadcastRequestedPositionChanged(false) - , forceAdvanceSucceed(false) - , allowDiscardFrontBuffer(false) { } void markSurfaceAsDestroyed(QWaylandSurface *surface); - QObject *renderObject; - QWaylandSurface *surface; - QWaylandOutput *output; + QObject *renderObject = nullptr; + QWaylandSurface *surface = nullptr; + QWaylandOutput *output = nullptr; QPointF requestedPos; QMutex bufferMutex; QWaylandBufferRef currentBuffer; QRegion currentDamage; QWaylandBufferRef nextBuffer; QRegion nextDamage; - bool nextBufferCommitted; - bool bufferLocked; - bool broadcastRequestedPositionChanged; - bool forceAdvanceSucceed; - bool allowDiscardFrontBuffer; + bool nextBufferCommitted = false; + bool bufferLocked = false; + bool broadcastRequestedPositionChanged = false; + bool forceAdvanceSucceed = false; + bool allowDiscardFrontBuffer = false; bool independentFrameCallback = false; //If frame callbacks are independent of the main quick scene graph }; |