diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-10-30 22:44:13 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2014-12-03 18:09:17 +0100 |
commit | 1eb7005850b9f54c30b34bd1268d2314767131fe (patch) | |
tree | 45d888a71db60c01d3b6724eb3a8eadebc88cdf0 /src/corelib | |
parent | 63a512023e861380f4489b103212769b741a93dc (diff) |
Use the new warning enabling/disabling macros in qtbase
Change-Id: I91ff06644e8047c2ca483f9768b46c1372eb6171
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qglobal.h | 24 | ||||
-rw-r--r-- | src/corelib/kernel/qfunctions_wince.h | 2 | ||||
-rw-r--r-- | src/corelib/thread/qatomic.h | 11 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 11 |
4 files changed, 19 insertions, 29 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 4e8721f7d7..19e368defc 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -834,22 +834,22 @@ Q_CORE_EXPORT void qFreeAligned(void *ptr); #endif #if defined(QT_NO_WARNINGS) # if defined(Q_CC_MSVC) -# pragma warning(disable: 4251) /* class 'type' needs to have dll-interface to be used by clients of class 'type2' */ -# pragma warning(disable: 4244) /* conversion from 'type1' to 'type2', possible loss of data */ -# pragma warning(disable: 4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */ -# pragma warning(disable: 4514) /* unreferenced inline function has been removed */ -# pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */ -# pragma warning(disable: 4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */ -# pragma warning(disable: 4706) /* assignment within conditional expression */ +QT_WARNING_DISABLE_MSVC(4251) /* class 'type' needs to have dll-interface to be used by clients of class 'type2' */ +QT_WARNING_DISABLE_MSVC(4244) /* conversion from 'type1' to 'type2', possible loss of data */ +QT_WARNING_DISABLE_MSVC(4275) /* non - DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' */ +QT_WARNING_DISABLE_MSVC(4514) /* unreferenced inline function has been removed */ +QT_WARNING_DISABLE_MSVC(4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */ +QT_WARNING_DISABLE_MSVC(4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */ +QT_WARNING_DISABLE_MSVC(4706) /* assignment within conditional expression */ # if _MSC_VER <= 1310 // MSVC 2003 -# pragma warning(disable: 4786) /* 'identifier' : identifier was truncated to 'number' characters in the debug information */ +QT_WARNING_DISABLE_MSVC(4786) /* 'identifier' : identifier was truncated to 'number' characters in the debug information */ # endif -# pragma warning(disable: 4355) /* 'this' : used in base member initializer list */ +QT_WARNING_DISABLE_MSVC(4355) /* 'this' : used in base member initializer list */ # if _MSC_VER < 1800 // MSVC 2013 -# pragma warning(disable: 4231) /* nonstandard extension used : 'identifier' before template explicit instantiation */ +QT_WARNING_DISABLE_MSVC(4231) /* nonstandard extension used : 'identifier' before template explicit instantiation */ # endif -# pragma warning(disable: 4710) /* function not inlined */ -# pragma warning(disable: 4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc */ +QT_WARNING_DISABLE_MSVC(4710) /* function not inlined */ +QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc */ # elif defined(Q_CC_BOR) # pragma option -w-inl # pragma option -w-aus diff --git a/src/corelib/kernel/qfunctions_wince.h b/src/corelib/kernel/qfunctions_wince.h index cc5e0ca83f..8cbde6c465 100644 --- a/src/corelib/kernel/qfunctions_wince.h +++ b/src/corelib/kernel/qfunctions_wince.h @@ -208,7 +208,7 @@ int qt_wince_SetErrorMode(int); bool qt_wince__chmod(const char *file, int mode); bool qt_wince__wchmod(const wchar_t *file, int mode); -#pragma warning(disable: 4273) +QT_WARNING_DISABLE_MSVC(4273) HANDLE qt_wince_CreateFileA(LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE); // Printer ---------------------------------------------------------- diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index 7526cfe0e6..a665746db4 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -40,11 +40,8 @@ QT_BEGIN_NAMESPACE - -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wextra" -#endif +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wextra") // High-level atomic integer operations template <typename T> @@ -214,9 +211,7 @@ public: #endif }; -#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL) -# pragma GCC diagnostic pop -#endif +QT_WARNING_POP #ifdef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS # undef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 718f10860a..4d51521b12 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -924,11 +924,8 @@ inline QString QString::arg(const QString &a1, const QString &a2, const QString inline QString QString::section(QChar asep, int astart, int aend, SectionFlags aflags) const { return section(QString(asep), astart, aend, aflags); } -#ifdef Q_CC_MSVC -// "conditional expression is constant" -#pragma warning(push) -#pragma warning(disable : 4127) -#endif +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4127) // "conditional expression is constant" inline int QString::toWCharArray(wchar_t *array) const { @@ -939,9 +936,7 @@ inline int QString::toWCharArray(wchar_t *array) const return toUcs4_helper(d->data(), size(), reinterpret_cast<uint *>(array)); } -#ifdef Q_CC_MSVC -#pragma warning(pop) -#endif +QT_WARNING_POP inline QString QString::fromWCharArray(const wchar_t *string, int size) { |