diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 4 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 9ffd164b61..05e3f6c45a 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1336,14 +1336,14 @@ do {\ Q_ASSERT_X(false, "Q_UNREACHABLE()", "Q_UNREACHABLE was reached");\ Q_UNREACHABLE_IMPL();\ - } while (0) + } while (false) #define Q_ASSUME(Expr) \ do {\ const bool valueOfExpression = Expr;\ Q_ASSERT_X(valueOfExpression, "Q_ASSUME()", "Assumption in Q_ASSUME(\"" #Expr "\") was not correct");\ Q_ASSUME_IMPL(valueOfExpression);\ - } while (0) + } while (false) #if defined(__cplusplus) #if QT_HAS_CPP_ATTRIBUTE(fallthrough) 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 <typename T> |