From 6d9549793137f779bdb136897385cdc59b65e44e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 16 Aug 2016 09:48:53 +0200 Subject: [PATCH] QLinkedList: compile with -Wzero-as-null-pointer-constant The existing header check unfortunately doesn't detect uses of '0' as nullptr in template code. Task-number: QTBUG-45291 Change-Id: Ibe701402d95deca98c5286e2cee5f7118fd7f606 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/tools/qlinkedlist.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h index 710bf5a9f2..44d9ae9439 100644 --- a/src/corelib/tools/qlinkedlist.h +++ b/src/corelib/tools/qlinkedlist.h @@ -128,7 +128,7 @@ public: typedef T *pointer; typedef T &reference; Node *i; - inline iterator() : i(0) {} + inline iterator() : i(Q_NULLPTR) {} inline iterator(Node *n) : i(n) {} inline iterator(const iterator &o) : i(o.i) {} inline iterator &operator=(const iterator &o) { i = o.i; return *this; } @@ -161,7 +161,7 @@ public: typedef const T *pointer; typedef const T &reference; Node *i; - inline const_iterator() : i(0) {} + inline const_iterator() : i(Q_NULLPTR) {} inline const_iterator(Node *n) : i(n) {} inline const_iterator(const const_iterator &o) : i(o.i){} inline const_iterator(iterator ci) : i(ci.i){}