From 9db09b47000301bc3589278b076abdc111276304 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 4 Jul 2017 11:36:34 +0200 Subject: Fix modernize-use-bool-literals issues Reported by clang-tidy. Skipped fixes in implementation files, only changed headers. Change-Id: I5cfd266b3d4046f90baebc0c538b1b6ab03a02d2 Reviewed-by: Volker Krause Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/corelib/global/qglobal.h') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 0c74ed4a3e..6023cc8564 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -339,10 +339,10 @@ typedef double qreal; #define Q_INIT_RESOURCE(name) \ do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); \ - QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (0) + QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (false) #define Q_CLEANUP_RESOURCE(name) \ do { extern int QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); \ - QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); } while (0) + QT_MANGLE_NAMESPACE(qCleanupResources_ ## name) (); } while (false) /* * If we're compiling C++ code: @@ -646,7 +646,7 @@ inline void qt_noop(void) {} # define QT_CATCH(A) else # define QT_THROW(A) qt_noop() # define QT_RETHROW qt_noop() -# define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (0) +# define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false) #else # define QT_TRY try # define QT_CATCH(A) catch (A) @@ -654,9 +654,9 @@ inline void qt_noop(void) {} # define QT_RETHROW throw Q_NORETURN Q_CORE_EXPORT void qTerminate() Q_DECL_NOTHROW; # ifdef Q_COMPILER_NOEXCEPT -# define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (0) +# define QT_TERMINATE_ON_EXCEPTION(expr) do { expr; } while (false) # else -# define QT_TERMINATE_ON_EXCEPTION(expr) do { try { expr; } catch (...) { qTerminate(); } } while (0) +# define QT_TERMINATE_ON_EXCEPTION(expr) do { try { expr; } catch (...) { qTerminate(); } } while (false) # endif #endif @@ -760,10 +760,10 @@ Q_CORE_EXPORT void qBadAlloc(); # if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) # define Q_CHECK_PTR(p) qt_noop() # else -# define Q_CHECK_PTR(p) do {if(!(p))qt_check_pointer(__FILE__,__LINE__);} while (0) +# define Q_CHECK_PTR(p) do {if (!(p)) qt_check_pointer(__FILE__,__LINE__);} while (false) # endif #else -# define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (0) +# define Q_CHECK_PTR(p) do { if (!(p)) qBadAlloc(); } while (false) #endif template -- cgit v1.2.3