summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-02-27 16:21:17 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-02-28 10:51:35 +0000
commit1fab644753443a525475740fc23172dedaa70d0e (patch)
treebca0a88662679acd150172f5a73f64d1604960cf /examples
parentc4bd9198b4a0fac809903dd2c09276c2c3c1b22e (diff)
downloadqtwayland-1fab644753443a525475740fc23172dedaa70d0e.tar.gz
Use default member initialization for raw pointers
Initialize to nullptr to prevent undefined behavior. Change-Id: I7753c0be77a886d62ecb1cd7b86fc8c98340b0b8 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/custom-extension/cpp-client/main.cpp2
-rw-r--r--examples/wayland/minimal-cpp/compositor.h2
-rw-r--r--examples/wayland/qwindow-compositor/compositor.h6
-rw-r--r--examples/wayland/server-buffer/cpp-client/main.cpp2
-rw-r--r--examples/wayland/server-buffer/cpp-client/sharebufferextension.h2
5 files changed, 7 insertions, 7 deletions
diff --git a/examples/wayland/custom-extension/cpp-client/main.cpp b/examples/wayland/custom-extension/cpp-client/main.cpp
index da6230cc..78eac44b 100644
--- a/examples/wayland/custom-extension/cpp-client/main.cpp
+++ b/examples/wayland/custom-extension/cpp-client/main.cpp
@@ -148,7 +148,7 @@ protected:
}
private:
- CustomExtension *m_extension;
+ CustomExtension *m_extension = nullptr;
QRect rect1;
QRect rect2;
QRect rect3;
diff --git a/examples/wayland/minimal-cpp/compositor.h b/examples/wayland/minimal-cpp/compositor.h
index 9dd5cb2f..2a4ab7d8 100644
--- a/examples/wayland/minimal-cpp/compositor.h
+++ b/examples/wayland/minimal-cpp/compositor.h
@@ -92,7 +92,7 @@ private slots:
void viewSurfaceDestroyed();
private:
- Window *m_window;
+ Window *m_window = nullptr;
QList<View*> m_views;
};
diff --git a/examples/wayland/qwindow-compositor/compositor.h b/examples/wayland/qwindow-compositor/compositor.h
index d1b501ff..5cc3e28c 100644
--- a/examples/wayland/qwindow-compositor/compositor.h
+++ b/examples/wayland/qwindow-compositor/compositor.h
@@ -180,10 +180,10 @@ private slots:
void viewAnimationDone();
private:
View *findView(const QWaylandSurface *s) const;
- QWindow *m_window;
+ QWindow *m_window = nullptr;
QList<View*> m_views;
- QWaylandWlShell *m_wlShell;
- QWaylandXdgShellV5 *m_xdgShell;
+ QWaylandWlShell *m_wlShell = nullptr;
+ QWaylandXdgShellV5 *m_xdgShell = nullptr;
QWaylandView m_cursorView;
int m_cursorHotspotX;
int m_cursorHotspotY;
diff --git a/examples/wayland/server-buffer/cpp-client/main.cpp b/examples/wayland/server-buffer/cpp-client/main.cpp
index 7ff34072..70509d06 100644
--- a/examples/wayland/server-buffer/cpp-client/main.cpp
+++ b/examples/wayland/server-buffer/cpp-client/main.cpp
@@ -116,7 +116,7 @@ protected:
private:
- QOpenGLTextureBlitter *m_blitter;
+ QOpenGLTextureBlitter *m_blitter = nullptr;
ShareBufferExtension *m_extension = nullptr;
QList<QtWaylandClient::QWaylandServerBuffer*> m_buffers;
diff --git a/examples/wayland/server-buffer/cpp-client/sharebufferextension.h b/examples/wayland/server-buffer/cpp-client/sharebufferextension.h
index 6ea19c08..1440187d 100644
--- a/examples/wayland/server-buffer/cpp-client/sharebufferextension.h
+++ b/examples/wayland/server-buffer/cpp-client/sharebufferextension.h
@@ -75,7 +75,7 @@ signals:
private:
void share_buffer_cross_buffer(struct ::qt_server_buffer *buffer) override;
- QtWaylandClient::QWaylandServerBufferIntegration *m_server_buffer_integration;
+ QtWaylandClient::QWaylandServerBufferIntegration *m_server_buffer_integration = nullptr;
};
QT_END_NAMESPACE