diff options
author | Liang Qi <liang.qi@qt.io> | 2017-02-08 15:48:29 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-02-08 15:49:18 +0100 |
commit | dd756011da13b95fdb630a1bbb90234f1e60f415 (patch) | |
tree | a6259b1e9b6463108796ce912e3d1752e301505f /src/corelib | |
parent | 0c50edbe84914469973a3b10e0170023ccdd66fe (diff) | |
parent | b6bf2a33f4c33a212da7b58a049b3b5b20b3f327 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
configure.json
mkspecs/win32-icc/qmake.conf
Change-Id: Ibf40546b024d644c7d9ed490bee15b82597f4d3f
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/Qt5CoreMacros.cmake | 2 | ||||
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 34 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 6 | ||||
-rw-r--r-- | src/corelib/global/qnumeric_p.h | 11 | ||||
-rw-r--r-- | src/corelib/io/qfiledevice.cpp | 3 | ||||
-rw-r--r-- | src/corelib/io/qsettings_mac.cpp | 4 | ||||
-rw-r--r-- | src/corelib/kernel/qcore_foundation.mm | 12 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication_win.cpp | 27 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 12 | ||||
-rw-r--r-- | src/corelib/thread/qmutex.cpp | 3 | ||||
-rw-r--r-- | src/corelib/tools/qalgorithms.h | 13 | ||||
-rw-r--r-- | src/corelib/tools/qcollator_icu.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qdatetimeparser.cpp | 4 | ||||
-rw-r--r-- | src/corelib/tools/qdatetimeparser_p.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qsimd_p.h | 51 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 10 | ||||
-rw-r--r-- | src/corelib/tools/qstringlist.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qstringmatcher.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qunicodetools.cpp | 2 |
20 files changed, 92 insertions, 118 deletions
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 23909c9f3f..489bc75511 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -91,7 +91,7 @@ macro(QT5_GET_MOC_FLAGS _moc_flags) set(${_moc_flags} ${${_moc_flags}} -DWIN32) endif() if (MSVC) - set(${_moc_flags} --compiler-flavor=msvc) + set(${_moc_flags} ${${_moc_flags}} --compiler-flavor=msvc) endif() endmacro() diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index a9922bb31d..8a8d781cf8 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -564,7 +564,7 @@ # endif #endif -#ifdef Q_CC_INTEL +#if defined(Q_CC_INTEL) && !defined(Q_CC_MSVC) # define Q_COMPILER_RESTRICTED_VLA # define Q_COMPILER_VARIADIC_MACROS // C++11 feature supported as an extension in other modes, too # define Q_COMPILER_THREADSAFE_STATICS @@ -653,7 +653,7 @@ # endif #endif -#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) +#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !defined(Q_CC_MSVC) /* General C++ features */ # define Q_COMPILER_RESTRICTED_VLA # define Q_COMPILER_THREADSAFE_STATICS @@ -899,7 +899,7 @@ # endif #endif -#if defined(Q_CC_MSVC) && !defined(Q_CC_INTEL) +#if defined(Q_CC_MSVC) # if defined(__cplusplus) # if _MSC_VER >= 1400 /* C++11 features supported in VC8 = VC2005: */ @@ -1045,34 +1045,6 @@ # define __USE_CONSTEXPR 1 # define __USE_NOEXCEPT 1 # endif -# if defined(Q_CC_MSVC) && defined(Q_CC_CLANG) -// Clang and the Intel compiler support more C++ features than the Microsoft compiler -// so make sure we don't enable them if the MS headers aren't properly adapted. -# ifndef _HAS_CONSTEXPR -# undef Q_COMPILER_CONSTEXPR -# endif -# ifndef _HAS_DECLTYPE -# undef Q_COMPILER_DECLTYPE -# endif -# ifndef _HAS_INITIALIZER_LISTS -# undef Q_COMPILER_INITIALIZER_LISTS -# endif -# ifndef _HAS_NULLPTR_T -# undef Q_COMPILER_NULLPTR -# endif -# ifndef _HAS_RVALUE_REFERENCES -# undef Q_COMPILER_RVALUE_REFS -# endif -# ifndef _HAS_SCOPED_ENUM -# undef Q_COMPILER_CLASS_ENUM -# endif -# ifndef _HAS_TEMPLATE_ALIAS -# undef Q_COMPILER_TEMPLATE_ALIAS -# endif -# ifndef _HAS_VARIADIC_TEMPLATES -# undef Q_COMPILER_VARIADIC_TEMPLATES -# endif -# endif # if defined(Q_COMPILER_THREADSAFE_STATICS) && defined(Q_OS_MAC) // Apple's low-level implementation of the C++ support library // (libc++abi.dylib, shared between libstdc++ and libc++) has deadlocks. The diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 010f2c18c4..153d7466ed 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -133,7 +133,7 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in /*! \fn QFlag::QFlag(uint value) - \since Qt 5.3 + \since 5.3 Constructs a QFlag object that stores the given \a value. */ @@ -147,7 +147,7 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in /*! \fn QFlag::QFlag(ushort value) - \since Qt 5.3 + \since 5.3 Constructs a QFlag object that stores the given \a value. */ @@ -160,7 +160,7 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in /*! \fn QFlag::operator uint() const - \since Qt 5.3 + \since 5.3 Returns the value stored by the QFlag object. */ diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h index 62add95533..2291675501 100644 --- a/src/corelib/global/qnumeric_p.h +++ b/src/corelib/global/qnumeric_p.h @@ -66,7 +66,7 @@ #include <float.h> #endif -#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || defined(Q_CC_INTEL) || !defined(__cplusplus)) +#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || defined(Q_CC_INTEL)) # include <math.h> # ifdef isnan # define QT_MATH_H_DEFINES_MACROS @@ -92,14 +92,7 @@ QT_END_NAMESPACE QT_BEGIN_NAMESPACE namespace qnumeric_std_wrapper { -#if defined(Q_CC_MSVC) && _MSC_VER < 1800 -static inline bool isnan(double d) { return !!_isnan(d); } -static inline bool isinf(double d) { return !_finite(d) && !_isnan(d); } -static inline bool isfinite(double d) { return !!_finite(d); } -static inline bool isnan(float f) { return !!_isnan(f); } -static inline bool isinf(float f) { return !_finite(f) && !_isnan(f); } -static inline bool isfinite(float f) { return !!_finite(f); } -#elif defined(QT_MATH_H_DEFINES_MACROS) +#if defined(QT_MATH_H_DEFINES_MACROS) # undef QT_MATH_H_DEFINES_MACROS static inline bool isnan(double d) { return math_h_isnan(d); } static inline bool isinf(double d) { return math_h_isinf(d); } diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp index 20cfa5bdaf..ce9c8275ce 100644 --- a/src/corelib/io/qfiledevice.cpp +++ b/src/corelib/io/qfiledevice.cpp @@ -328,6 +328,9 @@ void QFileDevice::close() d->lastWasWrite = false; d->writeBuffer.clear(); + // reset cached size + d->cachedSize = 0; + // keep earlier error from flush if (d->fileEngine->close() && flushed) unsetError(); diff --git a/src/corelib/io/qsettings_mac.cpp b/src/corelib/io/qsettings_mac.cpp index dcaefd1613..e4631bad12 100644 --- a/src/corelib/io/qsettings_mac.cpp +++ b/src/corelib/io/qsettings_mac.cpp @@ -269,8 +269,10 @@ static QVariant qtValue(CFPropertyListRef cfvalue) // Fast-path for QByteArray, so that we don't have to go // though the expensive and lossy conversion via UTF-8. - if (!byteArray.startsWith('@')) + if (!byteArray.startsWith('@')) { + byteArray.detach(); return byteArray; + } const QString str = QString::fromUtf8(byteArray.constData(), byteArray.size()); return QSettingsPrivate::stringToVariant(str); diff --git a/src/corelib/kernel/qcore_foundation.mm b/src/corelib/kernel/qcore_foundation.mm index 8b6be9b08e..0e69f69a85 100644 --- a/src/corelib/kernel/qcore_foundation.mm +++ b/src/corelib/kernel/qcore_foundation.mm @@ -495,7 +495,7 @@ NSTimeZone *QTimeZone::toNSTimeZone() const Creates a CGRect from a QRect. - \sa fromCGRect() + \sa QRectF::fromCGRect() */ CGRect QRect::toCGRect() const Q_DECL_NOTHROW { @@ -517,7 +517,7 @@ CGRect QRectF::toCGRect() const Q_DECL_NOTHROW /*! \since 5.8 - Creates a QRectF from a CGRect. + Creates a QRectF from CGRect \a rect. \sa toCGRect() */ @@ -533,7 +533,7 @@ QRectF QRectF::fromCGRect(CGRect rect) Q_DECL_NOTHROW Creates a CGPoint from a QPoint. - \sa fromCGPoint() + \sa QPointF::fromCGPoint() */ CGPoint QPoint::toCGPoint() const Q_DECL_NOTHROW { @@ -555,7 +555,7 @@ CGPoint QPointF::toCGPoint() const Q_DECL_NOTHROW /*! \since 5.8 - Creates a QRectF from a CGPoint. + Creates a QRectF from CGPoint \a point. \sa toCGPoint() */ @@ -571,7 +571,7 @@ QPointF QPointF::fromCGPoint(CGPoint point) Q_DECL_NOTHROW Creates a CGSize from a QSize. - \sa fromCGSize() + \sa QSizeF::fromCGSize() */ CGSize QSize::toCGSize() const Q_DECL_NOTHROW { @@ -593,7 +593,7 @@ CGSize QSizeF::toCGSize() const Q_DECL_NOTHROW /*! \since 5.8 - Creates a QRectF from a CGSize. + Creates a QRectF from \a size. \sa toCGSize() */ diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 152177a926..a936457bce 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -353,10 +353,6 @@ Q_CORE_EXPORT uint qGlobalPostedEventsCount() QAbstractEventDispatcher *QCoreApplicationPrivate::eventDispatcher = 0; -#ifdef Q_OS_UNIX -Qt::HANDLE qt_application_thread_id = 0; -#endif - #endif // QT_NO_QOBJECT QCoreApplication *QCoreApplication::self = 0; @@ -468,10 +464,6 @@ QCoreApplicationPrivate::QCoreApplicationPrivate(int &aargc, char **aargv, uint qFatal("FATAL: The application binary appears to be running setuid, this is a security hole."); # endif // Q_OS_UNIX -# if defined(Q_OS_UNIX) - qt_application_thread_id = QThread::currentThreadId(); -# endif - QThread *cur = QThread::currentThread(); // note: this may end up setting theMainThread! if (cur != theMainThread) qWarning("WARNING: QApplication was not created in the main() thread."); diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 856d2a2101..50888dd0aa 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -197,33 +197,6 @@ Q_CORE_EXPORT int qWinAppCmdShow() // get main window sho } #endif -/***************************************************************************** - qWinMain() - Initializes Windows. Called from WinMain() in qtmain_win.cpp - *****************************************************************************/ - -#if !defined(Q_OS_WINRT) - -// ### Qt6: FIXME: Consider removing this function. It is here for Active Qt -// servers and for binary for compatibility to applications built with Qt 5.3 -// using qtmain.lib which calls it In Qt 5.4, qtmain.lib was changed to use -// CommandLineToArgvW() without calling into Qt5Core. -Q_CORE_EXPORT -void qWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdParam, - int cmdShow, int &argc, QVector<char *> &argv) -{ - Q_UNUSED(instance) - Q_UNUSED(prevInstance) - Q_UNUSED(cmdShow) - - const QStringList wArgv = qWinCmdArgs(QString::fromLocal8Bit(cmdParam)); - argv.clear(); - argc = wArgv.size(); - for (const QString &wArg : wArgv) - argv.append(_strdup(wArg.toLocal8Bit().constData())); -} - -#endif // !Q_OS_WINRT - #ifndef QT_NO_QOBJECT #if defined(Q_OS_WIN) && !defined(QT_NO_DEBUG_STREAM) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 8a4ad8bbf3..c908e7cdbc 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -74,6 +74,7 @@ #include "qline.h" #endif +#include <cmath> #include <float.h> #include <cstring> @@ -3472,8 +3473,17 @@ static int numericCompare(const QVariant::Private *d1, const QVariant::Private * Q_ASSERT(ok); qreal r2 = qConvertToRealNumber(d2, &ok); Q_ASSERT(ok); - if (r1 == r2 || qFuzzyCompare(r1, r2)) + if (r1 == r2) return 0; + + // only do fuzzy comparisons for finite, non-zero numbers + int c1 = std::fpclassify(r1); + int c2 = std::fpclassify(r2); + if ((c1 == FP_NORMAL || c1 == FP_SUBNORMAL) && (c2 == FP_NORMAL || c2 == FP_SUBNORMAL)) { + if (qFuzzyCompare(r1, r2)) + return 0; + } + return r1 < r2 ? -1 : 1; } diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index 6887fa247b..7e3610f0b3 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -271,6 +271,9 @@ bool QMutex::tryLock(int timeout) QT_MUTEX_LOCK_NOEXCEPT This function is provided for compatibility with the Standard Library concept \c Lockable. It is equivalent to tryLock(). + + The function returns \c true if the lock was obtained; otherwise it + returns \c false */ /*! \fn bool QMutex::try_lock_for(std::chrono::duration<Rep, Period> duration) diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h index fb7031ce71..c0f7709fec 100644 --- a/src/corelib/tools/qalgorithms.h +++ b/src/corelib/tools/qalgorithms.h @@ -638,6 +638,17 @@ Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW { return qt_builtin_clz(v) - 16U; } + +// Neither MSVC nor the Intel compiler define a macro for the POPCNT processor +// feature, so we're using either the SSE4.2 or the AVX macro as a proxy (Clang +// does define the macro). It's incorrect for two reasons: +// 1. It's a separate bit in CPUID, so a processor could implement SSE4.2 and +// not POPCNT, but that's unlikely to happen. +// 2. There are processors that support POPCNT but not AVX (Intel Nehalem +// architecture), but unlike the other compilers, MSVC has no option +// to generate code for those processors. +// So it's an acceptable compromise. +#if defined(__AVX__) || defined(__SSE4_2__) || defined(__POPCNT__) #define QALGORITHMS_USE_BUILTIN_POPCOUNT Q_ALWAYS_INLINE uint qt_builtin_popcount(quint32 v) Q_DECL_NOTHROW { @@ -658,6 +669,8 @@ Q_ALWAYS_INLINE uint qt_builtin_popcountll(quint64 v) Q_DECL_NOTHROW return __popcnt64(v); } #endif // MSVC 64bit +#endif // __AVX__ || __SSE4_2__ || __POPCNT__ + #endif // MSVC #endif // QT_HAS_CONSTEXPR_BUILTINS diff --git a/src/corelib/tools/qcollator_icu.cpp b/src/corelib/tools/qcollator_icu.cpp index 98bed1fbca..26e2121092 100644 --- a/src/corelib/tools/qcollator_icu.cpp +++ b/src/corelib/tools/qcollator_icu.cpp @@ -111,7 +111,7 @@ int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) con if (d->collator) return ucol_strcoll(d->collator, (const UChar *)s1, len1, (const UChar *)s2, len2); - return QString::compare(QString(s1, len1), QString(s2, len2), d->caseSensitivity); + return QString::compare_helper(s1, len1, s2, len2, d->caseSensitivity); } int QCollator::compare(const QString &s1, const QString &s2) const diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 65016933a0..d66416207b 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -60,6 +60,10 @@ QT_BEGIN_NAMESPACE #ifndef QT_BOOTSTRAPPED +QDateTimeParser::~QDateTimeParser() +{ +} + /*! \internal Gets the digit from a datetime. E.g. diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h index bc088a5f4c..b50c88b4c1 100644 --- a/src/corelib/tools/qdatetimeparser_p.h +++ b/src/corelib/tools/qdatetimeparser_p.h @@ -103,7 +103,7 @@ public: none.count = -1; none.zeroesAdded = 0; } - virtual ~QDateTimeParser() {} + virtual ~QDateTimeParser(); enum Section { NoSection = 0x00000, diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index 3b6c85ca8a..be53c51c48 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -156,6 +156,15 @@ # if !defined(__ARM_FEATURE_NEON) && defined(__ARM_NEON__) # define __ARM_FEATURE_NEON // also support QT_COMPILER_SUPPORTS_HERE(NEON) # endif +#elif defined(Q_PROCESSOR_MIPS) +# define QT_COMPILER_SUPPORTS_HERE(x) (__ ## x ## __) +# define QT_FUNCTION_TARGET(x) +# if !defined(__MIPS_DSP__) && defined(__mips_dsp) && defined(Q_PROCESSOR_MIPS_32) +# define __MIPS_DSP__ +# endif +# if !defined(__MIPS_DSPR2__) && defined(__mips_dspr2) && defined(Q_PROCESSOR_MIPS_32) +# define __MIPS_DSPR2__ +# endif #elif (defined(Q_CC_INTEL) || defined(Q_CC_MSVC) \ || (defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && (__GNUC__-0) * 100 + (__GNUC_MINOR__-0) >= 409)) \ && !defined(QT_BOOTSTRAPPED) @@ -172,8 +181,21 @@ # define QT_FUNCTION_TARGET(x) #endif +#if defined(Q_CC_MSVC) && (defined(_M_AVX) || defined(__AVX__)) +// Visual Studio defines __AVX__ when /arch:AVX is passed, but not the earlier macros +// See: https://msdn.microsoft.com/en-us/library/b0084kay.aspx +// SSE2 is handled by _M_IX86_FP below +# define __SSE3__ 1 +# define __SSSE3__ 1 +// no Intel CPU supports SSE4a, so don't define it +# define __SSE4_1__ 1 +# define __SSE4_2__ 1 +# ifndef __AVX__ +# define __AVX__ 1 +# endif +#endif + // SSE intrinsics -#define QT_FUNCTION_TARGET_STRING_SSE2 "sse2" #if defined(__SSE2__) || (defined(QT_COMPILER_SUPPORTS_SSE2) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) #if defined(QT_LINUXBASE) /// this is an evil hack - the posix_memalign declaration in LSB @@ -191,51 +213,38 @@ #endif // SSE3 intrinsics -#define QT_FUNCTION_TARGET_STRING_SSE3 "sse3" #if defined(__SSE3__) || (defined(QT_COMPILER_SUPPORTS_SSE3) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) #include <pmmintrin.h> #endif // SSSE3 intrinsics -#define QT_FUNCTION_TARGET_STRING_SSSE3 "ssse3" #if defined(__SSSE3__) || (defined(QT_COMPILER_SUPPORTS_SSSE3) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) #include <tmmintrin.h> #endif // SSE4.1 intrinsics -#define QT_FUNCTION_TARGET_STRING_SSE4_1 "sse4.1" #if defined(__SSE4_1__) || (defined(QT_COMPILER_SUPPORTS_SSE4_1) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) #include <smmintrin.h> #endif // SSE4.2 intrinsics -#define QT_FUNCTION_TARGET_STRING_SSE4_2 "sse4.2" #if defined(__SSE4_2__) || (defined(QT_COMPILER_SUPPORTS_SSE4_2) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) #include <nmmintrin.h> #endif // AVX intrinsics -#define QT_FUNCTION_TARGET_STRING_AVX "avx" -#define QT_FUNCTION_TARGET_STRING_AVX2 "avx2" #if defined(__AVX__) || (defined(QT_COMPILER_SUPPORTS_AVX) && defined(QT_COMPILER_SUPPORTS_SIMD_ALWAYS)) // immintrin.h is the ultimate header, we don't need anything else after this #include <immintrin.h> - -# if defined(Q_CC_MSVC) && (defined(_M_AVX) || defined(__AVX__)) -// MS Visual Studio 2010 has no macro pre-defined to identify the use of /arch:AVX -// MS Visual Studio 2013 adds it: __AVX__ -// See: http://connect.microsoft.com/VisualStudio/feedback/details/605858/arch-avx-should-define-a-predefined-macro-in-x64-and-set-a-unique-value-for-m-ix86-fp-in-win32 -# define __SSE3__ 1 -# define __SSSE3__ 1 -// no Intel CPU supports SSE4a, so don't define it -# define __SSE4_1__ 1 -# define __SSE4_2__ 1 -# ifndef __AVX__ -# define __AVX__ 1 -# endif -# endif #endif +#define QT_FUNCTION_TARGET_STRING_SSE2 "sse2" +#define QT_FUNCTION_TARGET_STRING_SSE3 "sse3" +#define QT_FUNCTION_TARGET_STRING_SSSE3 "ssse3" +#define QT_FUNCTION_TARGET_STRING_SSE4_1 "sse4.1" +#define QT_FUNCTION_TARGET_STRING_SSE4_2 "sse4.2" +#define QT_FUNCTION_TARGET_STRING_AVX "avx" +#define QT_FUNCTION_TARGET_STRING_AVX2 "avx2" #define QT_FUNCTION_TARGET_STRING_AVX512F "avx512f" #define QT_FUNCTION_TARGET_STRING_AVX512CD "avx512cd" #define QT_FUNCTION_TARGET_STRING_AVX512ER "avx512er" diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 66ce29c859..606893996c 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1869,7 +1869,7 @@ QString &QString::operator=(const QString &other) Q_DECL_NOTHROW */ QString &QString::operator=(QLatin1String other) { - if (isDetached() && other.size() <= capacity()) { // assumes d->alloc == 0 → !isDetached() (sharedNull) + if (isDetached() && other.size() <= capacity()) { // assumes d->alloc == 0 -> !isDetached() (sharedNull) d->size = other.size(); d->data()[other.size()] = 0; qt_from_latin1(d->data(), other.latin1(), other.size()); @@ -1928,7 +1928,7 @@ QString &QString::operator=(QLatin1String other) */ QString &QString::operator=(QChar ch) { - if (isDetached() && capacity() >= 1) { // assumes d->alloc == 0 → !isDetached() (sharedNull) + if (isDetached() && capacity() >= 1) { // assumes d->alloc == 0 -> !isDetached() (sharedNull) // re-use existing capacity: ushort *dat = d->data(); dat[0] = ch.unicode(); @@ -8372,7 +8372,7 @@ QString &QString::setRawData(const QChar *unicode, int size) Returns the character at position \a pos in this object. \note This function performs no error checking. - The behavior is undefined when \a pos < 0 or \a pos ≥ size(). + The behavior is undefined when \a pos < 0 or \a pos >= size(). \sa operator[]() */ @@ -8383,7 +8383,7 @@ QString &QString::setRawData(const QChar *unicode, int size) Returns the character at position \a pos in this object. \note This function performs no error checking. - The behavior is undefined when \a pos < 0 or \a pos ≥ size(). + The behavior is undefined when \a pos < 0 or \a pos >= size(). \sa at() */ @@ -10174,7 +10174,7 @@ bool QStringRef::endsWith(const QStringRef &str, Qt::CaseSensitivity cs) const */ /*! \fn bool QStringRef::contains(QLatin1String str, Qt::CaseSensitivity cs) const - \since 4,8 + \since 4.8 \overload contains() Returns \c true if this string reference contains an occurrence of diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index 88ceae20b9..75ff934f15 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -716,7 +716,7 @@ int QtPrivate::QStringList_lastIndexOf(const QStringList *that, const QRegularEx /*! \fn int QStringList::removeDuplicates() - \since 4.5 + \since 4.5 This function removes duplicate entries from a list. The entries do not have to be sorted. They will retain their diff --git a/src/corelib/tools/qstringmatcher.cpp b/src/corelib/tools/qstringmatcher.cpp index 67e7ad3825..67d3f0ebc8 100644 --- a/src/corelib/tools/qstringmatcher.cpp +++ b/src/corelib/tools/qstringmatcher.cpp @@ -252,7 +252,7 @@ void QStringMatcher::setCaseSensitivity(Qt::CaseSensitivity cs) { if (cs == q_cs) return; - bm_init_skiptable((const ushort *)q_pattern.unicode(), q_pattern.size(), p.q_skiptable, cs); + bm_init_skiptable((const ushort *)p.uc, p.len, p.q_skiptable, cs); q_cs = cs; } diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp index be1d88e260..ac19d6b6d1 100644 --- a/src/corelib/tools/qunicodetools.cpp +++ b/src/corelib/tools/qunicodetools.cpp @@ -714,7 +714,7 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts) } // Never break between a combining mark (gc= Mc, Mn or Me) and its base character. - // Thus, a combining mark — whatever its script property value is — should inherit + // Thus, a combining mark - whatever its script property value is - should inherit // the script property value of its base character. static const int test = (FLAG(QChar::Mark_NonSpacing) | FLAG(QChar::Mark_SpacingCombining) | FLAG(QChar::Mark_Enclosing)); if (Q_UNLIKELY(FLAG(prop->category) & test)) |