summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor
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 /tests/auto/compositor
parentc4bd9198b4a0fac809903dd2c09276c2c3c1b22e (diff)
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 'tests/auto/compositor')
-rw-r--r--tests/auto/compositor/compositor/mockclient.h6
-rw-r--r--tests/auto/compositor/compositor/mockseat.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/compositor/compositor/mockclient.h b/tests/auto/compositor/compositor/mockclient.h
index 8933f8327..820f2df39 100644
--- a/tests/auto/compositor/compositor/mockclient.h
+++ b/tests/auto/compositor/compositor/mockclient.h
@@ -45,7 +45,7 @@ public:
~ShmBuffer();
struct wl_buffer *handle = nullptr;
- struct wl_shm_pool *shm_pool;
+ struct wl_shm_pool *shm_pool = nullptr;
QImage image;
};
@@ -62,10 +62,10 @@ public:
xdg_surface *createXdgSurface(wl_surface *surface);
ivi_surface *createIviSurface(wl_surface *surface, uint iviId);
- wl_display *display;
+ wl_display *display = nullptr;
wl_compositor *compositor = nullptr;
QMap<uint, wl_output *> m_outputs;
- wl_shm *shm;
+ wl_shm *shm = nullptr;
wl_registry *registry = nullptr;
wl_shell *wlshell = nullptr;
xdg_shell *xdgShell = nullptr;
diff --git a/tests/auto/compositor/compositor/mockseat.h b/tests/auto/compositor/compositor/mockseat.h
index e6d5e0b1c..2cdd1df55 100644
--- a/tests/auto/compositor/compositor/mockseat.h
+++ b/tests/auto/compositor/compositor/mockseat.h
@@ -42,8 +42,8 @@ public:
~MockSeat();
MockPointer *pointer() const { return m_pointer.data(); }
- wl_seat *m_seat;
- wl_keyboard *m_keyboard;
+ wl_seat *m_seat = nullptr;
+ wl_keyboard *m_keyboard = nullptr;
private:
QScopedPointer<MockPointer> m_pointer;