Use Q_NULLPTR for the null pointers used in macros

User code should build with -Werror=zero-as-null-pointer-constant

Task-number: QTBUG-45291
Change-Id: Iee8cbc07c4434ce9b560ffff13d0031979b4c2fe
Reviewed-by: Matthew Woehlke <mw_triad@users.sourceforge.net>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
bb10
Thiago Macieira 2015-03-29 08:54:49 -07:00
parent 0b440e1498
commit ffc74e6d70
2 changed files with 4 additions and 4 deletions

View File

@ -143,9 +143,9 @@ private:
#define QT_MESSAGELOG_LINE __LINE__
#define QT_MESSAGELOG_FUNC Q_FUNC_INFO
#else
#define QT_MESSAGELOG_FILE 0
#define QT_MESSAGELOG_FILE Q_NULLPTR
#define QT_MESSAGELOG_LINE 0
#define QT_MESSAGELOG_FUNC 0
#define QT_MESSAGELOG_FUNC Q_NULLPTR
#endif
#define qDebug QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).debug

View File

@ -97,9 +97,9 @@ class QString;
#ifndef QT_NO_TRANSLATION
// full set of tr functions
# define QT_TR_FUNCTIONS \
static inline QString tr(const char *s, const char *c = 0, int n = -1) \
static inline QString tr(const char *s, const char *c = Q_NULLPTR, int n = -1) \
{ return staticMetaObject.tr(s, c, n); } \
QT_DEPRECATED static inline QString trUtf8(const char *s, const char *c = 0, int n = -1) \
QT_DEPRECATED static inline QString trUtf8(const char *s, const char *c = Q_NULLPTR, int n = -1) \
{ return staticMetaObject.tr(s, c, n); }
#else
// inherit the ones from QObject