From e1109df7a92812233935489bc9fbae524536130a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 7 Jun 2013 13:22:51 +0200 Subject: Remove the use of CMAKE_FIND_ROOT_PATH. This is actually a list in CMake, not a value to be prepended to paths. Specify the QT_SYSROOT instead to root the location of include directories. CMake will soon get a CMAKE_SYSROOT variable which will replace this. Change-Id: I239f69f127f3676a3835aa4f29638f44ef209819 Reviewed-by: Volker Krause Reviewed-by: Stephen Kelly Reviewed-by: Oswald Buddenhagen --- src/corelib/Qt5CTestMacros.cmake | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake index 51537a3904..126a348b47 100644 --- a/src/corelib/Qt5CTestMacros.cmake +++ b/src/corelib/Qt5CTestMacros.cmake @@ -38,10 +38,6 @@ foreach(module ${CMAKE_MODULES_UNDER_TEST}) ) endforeach() -if(CMAKE_CROSSCOMPILING AND CMAKE_FIND_ROOT_PATH) - list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_CXX_LINK_FLAGS=--sysroot=\"${CMAKE_FIND_ROOT_PATH}\"") -endif() - macro(expect_pass _dir) string(REPLACE "(" "_" testname "${_dir}") string(REPLACE ")" "_" testname "${testname}") -- cgit v1.2.3 From 80d24a737ac4f93eaabaab79e0c60c9da97d6eed Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Mon, 10 Jun 2013 16:56:42 -0400 Subject: Update support status for older Mac OS X platforms. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifdf487fbae8acbffb32b6db5f8dd93e9eb213d77 Reviewed-by: Gabriel de Dietrich Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qglobal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 4598f60d5e..6f63a0d9d3 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1050,9 +1050,9 @@ bool qSharedBuild() Q_DECL_NOTHROW \value MV_10_0 Mac OS X 10.0 (unsupported) \value MV_10_1 Mac OS X 10.1 (unsupported) \value MV_10_2 Mac OS X 10.2 (unsupported) - \value MV_10_3 Mac OS X 10.3 - \value MV_10_4 Mac OS X 10.4 - \value MV_10_5 Mac OS X 10.5 + \value MV_10_3 Mac OS X 10.3 (unsupported) + \value MV_10_4 Mac OS X 10.4 (unsupported) + \value MV_10_5 Mac OS X 10.5 (unsupported) \value MV_10_6 Mac OS X 10.6 \value MV_10_7 Mac OS X 10.7 \value MV_10_8 Mac OS X 10.8 -- cgit v1.2.3 From 46667d604fb2ae11a87c0c075a3d2468d02f7bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 11 Jun 2013 15:05:13 +0200 Subject: Fix crash when re-creating QThreadData after initially destroying it We destroy the thread data for the main thread when the QCoreApplication is destructed, and then delete the pthread key for the thread data in the global static destructor function 'destroy_current_thread_data_key'. The user may have its own Q_DESTRUCTOR_FUNCTION though, which may or may not run after we've destroyed the key. If it runs after we've destroyed the key, we'll end up trying to re-create the tread-data, as expected, but set_thread_data() will fail to persist it, as pthread_setspecific is called with an invalid key. The result is an infinite recursion: ... 6 in QThreadData::current () at qthread_unix.cpp:216 7 in QObject::QObject (this=0x48e1b30, dd=@0x48e1b40, parent=0x0) at qobject.cpp:703 8 in QThread::QThread (this=0x48e1b30, dd=@0x48e1b40, parent=0x0) at qthread.cpp:396 9 in QAdoptedThread::QAdoptedThread (this=0x48e1b30, data=0x48e1af0) at qthread.cpp:120 10 in QAdoptedThread::QAdoptedThread (this=0x48e1b30, data=0x48e1af0) at qthread.cpp:130 11 in QThreadData::current () at qthread_unix.cpp:219 12 in QObject::QObject (this=0x48e1a20, dd=@0x48e1a30, parent=0x0) at qobject.cpp:703 ... To solve this, we reset current_thread_data_once when destroying the key, so that subsequent calls to pthread_once to potentially create the key will call create_current_thread_data_key once more. This means we'll leak the key for this particular use-case, since we don't end up calling pthread_key_delete a second time, but this leak is small and happens typically only for a short duration during application shutdown. Change-Id: I580484a3239849e891172e24e7f77b75afd2c51b Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira --- src/corelib/thread/qthread_unix.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index f123e1813b..be9b946990 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -172,6 +172,12 @@ static void destroy_current_thread_data_key() { pthread_once(¤t_thread_data_once, create_current_thread_data_key); pthread_key_delete(current_thread_data_key); + + // Reset current_thread_data_once in case we end up recreating + // the thread-data in the rare case of QObject construction + // after destroying the QThreadData. + pthread_once_t pthread_once_init = PTHREAD_ONCE_INIT; + current_thread_data_once = pthread_once_init; } Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key) -- cgit v1.2.3 From 686c94c892006a3e72291ca8971aabf18ea1ec85 Mon Sep 17 00:00:00 2001 From: El Mehdi Fekari Date: Wed, 12 Jun 2013 16:54:07 +0200 Subject: QSystemLocale: Fix the time format on BlackBerry 10 The time format should depend on the device settings (24 hour format) Change-Id: I452d9b7158d39c4a657adfd9e64c99549eeda4ff Reviewed-by: Oswald Buddenhagen Reviewed-by: Rafael Roquetto --- src/corelib/tools/qlocale_blackberry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qlocale_blackberry.cpp b/src/corelib/tools/qlocale_blackberry.cpp index 6d60a97062..e2dfa6c801 100644 --- a/src/corelib/tools/qlocale_blackberry.cpp +++ b/src/corelib/tools/qlocale_blackberry.cpp @@ -289,9 +289,9 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const case DateToStringShort: return lc_region.toString(in.toDate(), QLocale::ShortFormat); case TimeToStringLong: - return lc_region.toString(in.toTime(), QLocale::LongFormat); + return lc_region.toString(in.toTime(), d->timeFormat(QLocale::LongFormat).toString()); case TimeToStringShort: - return lc_region.toString(in.toTime(), QLocale::ShortFormat); + return lc_region.toString(in.toTime(), d->timeFormat(QLocale::ShortFormat).toString()); case DateTimeToStringShort: return lc_region.toString(in.toDateTime(), d->dateTimeFormat(QLocale::ShortFormat).toString()); case DateTimeToStringLong: -- cgit v1.2.3 From d57d184b6d18deab172ac400b9db973e6aacab21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 6 May 2013 10:26:38 +0200 Subject: Add basic conversion functions from QVariant(QJsonValue). There is a mismatch how QML and C++ converts QJsonValue. This patch unifies conversions by adding QJsonValue support in QVariant::convert(). Change-Id: I8a1db3d77c517945ef48064b4b66ba03aa4f2fd0 Reviewed-by: Frederik Gladhorn --- src/corelib/kernel/qvariant.cpp | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index bae4a837a0..276257ddcf 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -162,6 +162,10 @@ static qlonglong qMetaTypeNumber(const QVariant::Private *d) return qRound64(d->data.f); case QVariant::Double: return qRound64(d->data.d); +#ifndef QT_BOOTSTRAPPED + case QMetaType::QJsonValue: + return v_cast(d)->toDouble(); +#endif } Q_ASSERT(false); return 0; @@ -206,12 +210,14 @@ static qlonglong qConvertToNumber(const QVariant::Private *d, bool *ok) case QMetaType::Long: case QMetaType::Float: case QMetaType::LongLong: + case QMetaType::QJsonValue: return qMetaTypeNumber(d); case QVariant::ULongLong: case QVariant::UInt: case QMetaType::UChar: case QMetaType::UShort: case QMetaType::ULong: + return qlonglong(qMetaTypeUNumber(d)); } @@ -240,6 +246,7 @@ static qulonglong qConvertToUnsignedNumber(const QVariant::Private *d, bool *ok) case QMetaType::Long: case QMetaType::Float: case QMetaType::LongLong: + case QMetaType::QJsonValue: return qulonglong(qMetaTypeNumber(d)); case QVariant::ULongLong: case QVariant::UInt: @@ -340,6 +347,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) case QVariant::Url: *str = v_cast(d)->toString(); break; + case QMetaType::QJsonValue: + *str = v_cast(d)->toString(); + break; #endif case QVariant::Uuid: *str = v_cast(d)->toString(); @@ -580,6 +590,11 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) case QMetaType::ULong: *b = qMetaTypeUNumber(d) != Q_UINT64_C(0); break; +#ifndef QT_BOOTSTRAPPED + case QMetaType::QJsonValue: + *b = v_cast(d)->toBool(); + break; +#endif default: *b = false; return false; @@ -616,6 +631,11 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) case QMetaType::ULong: *f = double(qMetaTypeUNumber(d)); break; +#ifndef QT_BOOTSTRAPPED + case QMetaType::QJsonValue: + *f = v_cast(d)->toDouble(); + break; +#endif default: *f = 0.0; return false; @@ -652,6 +672,11 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) case QMetaType::ULong: *f = float(qMetaTypeUNumber(d)); break; +#ifndef QT_BOOTSTRAPPED + case QMetaType::QJsonValue: + *f = v_cast(d)->toDouble(); + break; +#endif default: *f = 0.0f; return false; @@ -2731,6 +2756,29 @@ bool QVariant::canConvert(int targetTypeId) const if (targetTypeId >= QMetaType::User) return canConvertMetaObject(currentType, targetTypeId, d.data.o); + if (currentType == QMetaType::QJsonValue) { + switch (targetTypeId) { + case QMetaType::QString: + case QMetaType::Bool: + case QMetaType::Int: + case QMetaType::UInt: + case QMetaType::Double: + case QMetaType::Float: + case QMetaType::ULong: + case QMetaType::Long: + case QMetaType::LongLong: + case QMetaType::ULongLong: + case QMetaType::UShort: + case QMetaType::UChar: + case QMetaType::Char: + case QMetaType::SChar: + case QMetaType::Short: + return true; + default: + return false; + } + } + // FIXME It should be LastCoreType intead of Uuid if (currentType > int(QMetaType::QUuid) || targetTypeId > int(QMetaType::QUuid)) { switch (uint(targetTypeId)) { -- cgit v1.2.3 From c492b2bffa70ce12af71ac585c2ec58bcface8f7 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Sun, 14 Apr 2013 00:05:34 +0900 Subject: Make qtbase compile with QT_NO_XMLSTREAMREADER D-Bus depends on QXmlStreamReader instead of QDom Change-Id: Ic435970af21ac6e45c4100359ff54bd5793ccce2 Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qfeatures.h | 10 +++++----- src/corelib/global/qfeatures.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 4534e9bf13..2cadea59c1 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -391,11 +391,6 @@ #define QT_NO_CONTEXTMENU #endif -// Qt D-Bus module -#if !defined(QT_NO_DBUS) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_DOM)) -#define QT_NO_DBUS -#endif - // QPrinter #if !defined(QT_NO_PRINTER) && (defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) #define QT_NO_PRINTER @@ -451,6 +446,11 @@ #define QT_NO_BEARERMANAGEMENT #endif +// Qt D-Bus module +#if !defined(QT_NO_DBUS) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_XMLSTREAMREADER)) +#define QT_NO_DBUS +#endif + // QGraphicsView #if !defined(QT_NO_GRAPHICSVIEW) && (defined(QT_NO_SCROLLAREA)) #define QT_NO_GRAPHICSVIEW diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 61a3df39f3..814e95c256 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -1102,7 +1102,7 @@ SeeAlso: ??? Feature: DBUS Description: Provides classes for D-Bus. Section: D-Bus -Requires: PROPERTIES DOM +Requires: PROPERTIES XMLSTREAMREADER Name: Qt D-Bus module SeeAlso: ??? -- cgit v1.2.3 From d9fb6e6dbb2b322556d581265da2442e3b91a6a3 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 15 Jun 2013 11:49:45 +0200 Subject: Remove use of 'register' from Qt. It is deprecated and clang is starting to warn about it. Patch mostly generated by clang itself, with some careful grep and sed for the platform-specific parts. Change-Id: I8058e6db0f1b41b33a9e8f17a712739159982450 Reviewed-by: Thiago Macieira --- src/corelib/arch/qatomic_alpha.h | 40 ++++----- src/corelib/arch/qatomic_armv5.h | 16 ++-- src/corelib/arch/qatomic_armv6.h | 112 +++++++++++++------------- src/corelib/arch/qatomic_ia64.h | 30 +++---- src/corelib/arch/qatomic_mips.h | 40 ++++----- src/corelib/arch/qatomic_power.h | 56 ++++++------- src/corelib/arch/qatomic_sh4a.h | 36 ++++----- src/corelib/codecs/qtextcodec.cpp | 4 +- src/corelib/global/qlogging.cpp | 2 +- src/corelib/io/qfilesystemwatcher_inotify.cpp | 2 +- src/corelib/io/qurl.cpp | 8 +- src/corelib/io/qurlidna.cpp | 8 +- src/corelib/io/qurlrecode.cpp | 4 +- src/corelib/kernel/qcore_unix.cpp | 2 +- src/corelib/kernel/qcore_unix_p.h | 18 ++--- src/corelib/kernel/qcoreapplication.cpp | 4 +- src/corelib/kernel/qmetatype.h | 2 +- src/corelib/kernel/qsystemsemaphore_unix.cpp | 2 +- src/corelib/kernel/qtimerinfo_unix.cpp | 20 ++--- src/corelib/thread/qgenericatomic.h | 4 +- src/corelib/thread/qmutex.cpp | 2 +- src/corelib/tools/qbytearray.cpp | 20 ++--- src/corelib/tools/qbytearraymatcher.cpp | 2 +- src/corelib/tools/qlocale_tools.cpp | 24 +++--- src/corelib/tools/qlocale_tools_p.h | 4 +- src/corelib/tools/qsharedpointer_impl.h | 10 +-- src/corelib/tools/qstring.cpp | 10 +-- src/corelib/tools/qstringmatcher.cpp | 2 +- 28 files changed, 242 insertions(+), 242 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/arch/qatomic_alpha.h b/src/corelib/arch/qatomic_alpha.h index 71cb112d47..5008a1acda 100644 --- a/src/corelib/arch/qatomic_alpha.h +++ b/src/corelib/arch/qatomic_alpha.h @@ -114,7 +114,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() inline bool QBasicAtomicInt::ref() { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "addl %0,1,%1\n" /* tmp=old+1; */ @@ -131,7 +131,7 @@ inline bool QBasicAtomicInt::ref() inline bool QBasicAtomicInt::deref() { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "subl %0,1,%1\n" /* tmp=old-1; */ @@ -148,7 +148,7 @@ inline bool QBasicAtomicInt::deref() inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) { - register int ret; + int ret; asm volatile("1:\n" "ldl_l %0,%1\n" /* ret=*ptr; */ "cmpeq %0,%2,%0\n"/* if (ret==expected) ret=0; else ret=1; */ @@ -167,7 +167,7 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) { - register int ret; + int ret; asm volatile("1:\n" "ldl_l %0,%1\n" /* ret=*ptr; */ "cmpeq %0,%2,%0\n"/* if (ret==expected) ret=0; else ret=1; */ @@ -187,7 +187,7 @@ inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) { - register int ret; + int ret; asm volatile("mb\n" "1:\n" "ldl_l %0,%1\n" /* ret=*ptr; */ @@ -207,7 +207,7 @@ inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -224,7 +224,7 @@ inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -242,7 +242,7 @@ inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) { - register int old, tmp; + int old, tmp; asm volatile("mb\n" "1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ @@ -260,7 +260,7 @@ inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "addl %0,%3,%1\n"/* tmp=old+value; */ @@ -277,7 +277,7 @@ inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) { - register int old, tmp; + int old, tmp; asm volatile("1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ "addl %0,%3,%1\n"/* tmp=old+value; */ @@ -295,7 +295,7 @@ inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) { - register int old, tmp; + int old, tmp; asm volatile("mb\n" "1:\n" "ldl_l %0,%2\n" /* old=*ptr; */ @@ -314,7 +314,7 @@ inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) { - register void *ret; + void *ret; asm volatile("1:\n" "ldq_l %0,%1\n" /* ret=*ptr; */ "cmpeq %0,%2,%0\n"/* if (ret==expected) tmp=0; else tmp=1; */ @@ -334,7 +334,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) { - register void *ret; + void *ret; asm volatile("1:\n" "ldq_l %0,%1\n" /* ret=*ptr; */ "cmpeq %0,%2,%0\n"/* if (ret==expected) tmp=0; else tmp=1; */ @@ -355,7 +355,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) { - register void *ret; + void *ret; asm volatile("mb\n" "1:\n" "ldq_l %0,%1\n" /* ret=*ptr; */ @@ -376,7 +376,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValu template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) { - register T *old, *tmp; + T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -394,7 +394,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) { - register T *old, *tmp; + T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "mov %3,%1\n" /* tmp=newval; */ @@ -413,7 +413,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) { - register T *old, *tmp; + T *old, *tmp; asm volatile("mb\n" "1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ @@ -432,7 +432,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) { - register T *old, *tmp; + T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "addq %0,%3,%1\n"/* tmp=old+value; */ @@ -450,7 +450,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) { - register T *old, *tmp; + T *old, *tmp; asm volatile("1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ "addq %0,%3,%1\n"/* tmp=old+value; */ @@ -469,7 +469,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) { - register T *old, *tmp; + T *old, *tmp; asm volatile("mb\n" "1:\n" "ldq_l %0,%2\n" /* old=*ptr; */ diff --git a/src/corelib/arch/qatomic_armv5.h b/src/corelib/arch/qatomic_armv5.h index e0a50b3c24..b583ec662c 100644 --- a/src/corelib/arch/qatomic_armv5.h +++ b/src/corelib/arch/qatomic_armv5.h @@ -114,8 +114,8 @@ template struct QAtomicOps : QBasicAtomicOps template<> template inline bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; do { originalValue = _q_value; newValue = originalValue + 1; @@ -126,8 +126,8 @@ bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; do { originalValue = _q_value; newValue = originalValue - 1; @@ -138,7 +138,7 @@ bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T originalValue; + T originalValue; do { originalValue = _q_value; if (originalValue != expectedValue) @@ -165,7 +165,7 @@ template<> template inline T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { #if defined(__thumb__) - register T originalValue; + T originalValue; do { originalValue = _q_value; } while (_q_cmpxchg(originalValue, newValue, &_q_value) != 0); @@ -184,8 +184,8 @@ T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; do { originalValue = _q_value; newValue = originalValue + valueToAdd; diff --git a/src/corelib/arch/qatomic_armv6.h b/src/corelib/arch/qatomic_armv6.h index 7f5939e391..08b2b02133 100644 --- a/src/corelib/arch/qatomic_armv6.h +++ b/src/corelib/arch/qatomic_armv6.h @@ -117,8 +117,8 @@ template struct QAtomicOps : QBasicAtomicOps template<> template inline bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrex %[newValue], [%[_q_value]]\n" "add %[newValue], %[newValue], #1\n" @@ -136,8 +136,8 @@ bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrex %[newValue], [%[_q_value]]\n" "sub %[newValue], %[newValue], #1\n" @@ -155,7 +155,7 @@ bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register int result; + int result; asm volatile("0:\n" "ldrex %[result], [%[_q_value]]\n" "eors %[result], %[result], %[expectedValue]\n" @@ -175,8 +175,8 @@ bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register int result; + T originalValue; + int result; asm volatile("0:\n" "ldrex %[originalValue], [%[_q_value]]\n" "strex %[result], %[newValue], [%[_q_value]]\n" @@ -194,9 +194,9 @@ T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; - register int result; + T originalValue; + T newValue; + int result; asm volatile("0:\n" "ldrex %[originalValue], [%[_q_value]]\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" @@ -256,8 +256,8 @@ template<> struct QAtomicIntegerTraits { enum { IsInteger = 1 }; }; template<> template inline bool QBasicAtomicOps<1>::ref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexb %[newValue], [%[_q_value]]\n" "add %[newValue], %[newValue], #1\n" @@ -275,8 +275,8 @@ bool QBasicAtomicOps<1>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<1>::deref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexb %[newValue], [%[_q_value]]\n" "sub %[newValue], %[newValue], #1\n" @@ -294,7 +294,7 @@ bool QBasicAtomicOps<1>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<1>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; + T result; asm volatile("0:\n" "ldrexb %[result], [%[_q_value]]\n" "eors %[result], %[result], %[expectedValue]\n" @@ -314,8 +314,8 @@ bool QBasicAtomicOps<1>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<1>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register int result; + T originalValue; + int result; asm volatile("0:\n" "ldrexb %[originalValue], [%[_q_value]]\n" "strexb %[result], %[newValue], [%[_q_value]]\n" @@ -333,9 +333,9 @@ T QBasicAtomicOps<1>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<1>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; - register int result; + T originalValue; + T newValue; + int result; asm volatile("0:\n" "ldrexb %[originalValue], [%[_q_value]]\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" @@ -355,8 +355,8 @@ T QBasicAtomicOps<1>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveTy template<> template inline bool QBasicAtomicOps<2>::ref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexh %[newValue], [%[_q_value]]\n" "add %[newValue], %[newValue], #1\n" @@ -374,8 +374,8 @@ bool QBasicAtomicOps<2>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<2>::deref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexh %[newValue], [%[_q_value]]\n" "sub %[newValue], %[newValue], #1\n" @@ -393,7 +393,7 @@ bool QBasicAtomicOps<2>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; + T result; asm volatile("0:\n" "ldrexh %[result], [%[_q_value]]\n" "eors %[result], %[result], %[expectedValue]\n" @@ -413,8 +413,8 @@ bool QBasicAtomicOps<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<2>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register int result; + T originalValue; + int result; asm volatile("0:\n" "ldrexh %[originalValue], [%[_q_value]]\n" "strexh %[result], %[newValue], [%[_q_value]]\n" @@ -432,9 +432,9 @@ T QBasicAtomicOps<2>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; - register int result; + T originalValue; + T newValue; + int result; asm volatile("0:\n" "ldrexh %[originalValue], [%[_q_value]]\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" @@ -462,8 +462,8 @@ T QBasicAtomicOps<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveTy template<> template inline bool QBasicAtomicOps<8>::ref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexd %[newValue], %H[newValue], [%[_q_value]]\n" "adds %Q[newValue], %Q[newValue], #1\n" @@ -482,8 +482,8 @@ bool QBasicAtomicOps<8>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<8>::deref(T &_q_value) Q_DECL_NOTHROW { - register T newValue; - register int result; + T newValue; + int result; asm volatile("0:\n" "ldrexd %[newValue], %H[newValue], [%[_q_value]]\n" "subs %Q[newValue], %Q[newValue], #1\n" @@ -502,7 +502,7 @@ bool QBasicAtomicOps<8>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; + T result; asm volatile("0:\n" "ldrexd %[result], %H[result], [%[_q_value]]\n" "eor %[result], %[result], %[expectedValue]\n" @@ -524,8 +524,8 @@ bool QBasicAtomicOps<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register int result; + T originalValue; + int result; asm volatile("0:\n" "ldrexd %[originalValue], %H[originalValue], [%[_q_value]]\n" "strexd %[result], %[newValue], %H[newValue], [%[_q_value]]\n" @@ -543,9 +543,9 @@ T QBasicAtomicOps<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; - register int result; + T originalValue; + T newValue; + int result; asm volatile("0:\n" "ldrexd %[originalValue], %H[originalValue], [%[_q_value]]\n" "adds %Q[newValue], %Q[originalValue], %Q[valueToAdd]\n" @@ -588,8 +588,8 @@ T QBasicAtomicOps<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveTy inline bool QBasicAtomicInt::ref() Q_DECL_NOTHROW { - register int newValue; - register int result; + int newValue; + int result; retry: __asm { ldrex newValue, [&_q_value] @@ -603,8 +603,8 @@ inline bool QBasicAtomicInt::ref() Q_DECL_NOTHROW inline bool QBasicAtomicInt::deref() Q_DECL_NOTHROW { - register int newValue; - register int result; + int newValue; + int result; retry: __asm { ldrex newValue, [&_q_value] @@ -618,7 +618,7 @@ inline bool QBasicAtomicInt::deref() Q_DECL_NOTHROW inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) Q_DECL_NOTHROW { - register int result; + int result; retry: __asm { ldrex result, [&_q_value] @@ -632,8 +632,8 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) Q_DECL_NOTHROW { - register int originalValue; - register int result; + int originalValue; + int result; retry: __asm { ldrex originalValue, [&_q_value] @@ -646,9 +646,9 @@ inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) Q_DECL_NOTHROW inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) Q_DECL_NOTHROW { - register int originalValue; - register int newValue; - register int result; + int originalValue; + int newValue; + int result; retry: __asm { ldrex originalValue, [&_q_value] @@ -663,7 +663,7 @@ inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) Q_DECL_NOTHROW template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) Q_DECL_NOTHROW { - register T *result; + T *result; retry: __asm { ldrex result, [&_q_value] @@ -678,8 +678,8 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValu template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) Q_DECL_NOTHROW { - register T *originalValue; - register int result; + T *originalValue; + int result; retry: __asm { ldrex originalValue, [&_q_value] @@ -693,9 +693,9 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) Q template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) Q_DECL_NOTHROW { - register T *originalValue; - register T *newValue; - register int result; + T *originalValue; + T *newValue; + int result; retry: __asm { ldrex originalValue, [&_q_value] diff --git a/src/corelib/arch/qatomic_ia64.h b/src/corelib/arch/qatomic_ia64.h index ed72036076..98937c7551 100644 --- a/src/corelib/arch/qatomic_ia64.h +++ b/src/corelib/arch/qatomic_ia64.h @@ -192,7 +192,7 @@ template struct QAtomicOps : QBasicAtomicOps typedef T Type; }; -inline bool _q_ia64_fetchadd_immediate(register int value) +inline bool _q_ia64_fetchadd_immediate(int value) { return value == 1 || value == -1 || value == 4 || value == -4 @@ -218,7 +218,7 @@ inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) { - register int expectedValueCopy = expectedValue; + int expectedValueCopy = expectedValue; return (static_cast(_InterlockedCompareExchange(&_q_value, newValue, expectedValueCopy)) @@ -227,7 +227,7 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) { - register int expectedValueCopy = expectedValue; + int expectedValueCopy = expectedValue; return (static_cast(_InterlockedCompareExchange_acq(reinterpret_cast(&_q_value), newValue, expectedValueCopy)) @@ -236,7 +236,7 @@ inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) { - register int expectedValueCopy = expectedValue; + int expectedValueCopy = expectedValue; return (static_cast(_InterlockedCompareExchange_rel(reinterpret_cast(&_q_value), newValue, expectedValueCopy)) @@ -285,7 +285,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) { - register T *expectedValueCopy = expectedValue; + T *expectedValueCopy = expectedValue; return (_InterlockedCompareExchangePointer(reinterpret_cast(&_q_value), newValue, expectedValueCopy) @@ -300,7 +300,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValu volatile unsigned long *p; }; x = &_q_value; - register T *expectedValueCopy = expectedValue; + T *expectedValueCopy = expectedValue; return (_InterlockedCompareExchange64_acq(p, quintptr(newValue), quintptr(expectedValueCopy)) == quintptr(expectedValue)); } @@ -313,7 +313,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValu volatile unsigned long *p; }; x = &_q_value; - register T *expectedValueCopy = expectedValue; + T *expectedValueCopy = expectedValue; return (_InterlockedCompareExchange64_rel(p, quintptr(newValue), quintptr(expectedValueCopy)) == quintptr(expectedValue)); } @@ -912,7 +912,7 @@ T QBasicAtomicOps<1>::fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveTy { valueToAdd *= QAtomicAdditiveType::AddScale; // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint8)old, FENCE); @@ -926,7 +926,7 @@ template<> template inline T QBasicAtomicOps<1>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint8)old, FENCE); @@ -941,7 +941,7 @@ T QBasicAtomicOps<2>::fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveTy { valueToAdd *= QAtomicAdditiveType::AddScale; // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint16)old, FENCE); @@ -955,7 +955,7 @@ template<> template inline T QBasicAtomicOps<2>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint16)old, FENCE); @@ -970,7 +970,7 @@ T QBasicAtomicOps<4>::fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveTy { valueToAdd *= QAtomicAdditiveType::AddScale; // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (unsigned)old, FENCE); @@ -984,7 +984,7 @@ template<> template inline T QBasicAtomicOps<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (unsigned)old, FENCE); @@ -999,7 +999,7 @@ T QBasicAtomicOps<8>::fetchAndAddAcquire(T &_q_value, typename QAtomicAdditiveTy { valueToAdd *= QAtomicAdditiveType::AddScale; // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint64)old, FENCE); @@ -1013,7 +1013,7 @@ template<> template inline T QBasicAtomicOps<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { // implement the test-and-set loop - register T old, ret; + T old, ret; do { old = _q_value; _Asm_mov_to_ar((_Asm_app_reg)_AREG_CCV, (quint64)old, FENCE); diff --git a/src/corelib/arch/qatomic_mips.h b/src/corelib/arch/qatomic_mips.h index 7716750332..6eb9613e31 100644 --- a/src/corelib/arch/qatomic_mips.h +++ b/src/corelib/arch/qatomic_mips.h @@ -137,8 +137,8 @@ void QBasicAtomicOps::orderedMemoryFence(const T &) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "ll %[originalValue], %[_q_value]\n" "addiu %[newValue], %[originalValue], %[one]\n" @@ -156,8 +156,8 @@ bool QBasicAtomicOps<4>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "ll %[originalValue], %[_q_value]\n" "addiu %[newValue], %[originalValue], %[minusOne]\n" @@ -175,8 +175,8 @@ bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; - register T tempValue; + T result; + T tempValue; asm volatile("0:\n" "ll %[result], %[_q_value]\n" "xor %[result], %[result], %[expectedValue]\n" @@ -199,8 +199,8 @@ bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register T tempValue; + T originalValue; + T tempValue; asm volatile("0:\n" "ll %[originalValue], %[_q_value]\n" "move %[tempValue], %[newValue]\n" @@ -218,8 +218,8 @@ T QBasicAtomicOps<4>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<4>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "ll %[originalValue], %[_q_value]\n" "addu %[newValue], %[originalValue], %[valueToAdd]\n" @@ -254,8 +254,8 @@ template<> struct QAtomicIntegerTraits { enum { IsInteger = 1 }; }; template<> template inline bool QBasicAtomicOps<8>::ref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "lld %[originalValue], %[_q_value]\n" "addiu %[newValue], %[originalValue], %[one]\n" @@ -273,8 +273,8 @@ bool QBasicAtomicOps<8>::ref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<8>::deref(T &_q_value) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "lld %[originalValue], %[_q_value]\n" "addiu %[newValue], %[originalValue], %[minusOne]\n" @@ -292,8 +292,8 @@ bool QBasicAtomicOps<8>::deref(T &_q_value) Q_DECL_NOTHROW template<> template inline bool QBasicAtomicOps<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW { - register T result; - register T tempValue; + T result; + T tempValue; asm volatile("0:\n" "lld %[result], %[_q_value]\n" "xor %[result], %[result], %[expectedValue]\n" @@ -316,8 +316,8 @@ bool QBasicAtomicOps<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa template<> template inline T QBasicAtomicOps<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW { - register T originalValue; - register T tempValue; + T originalValue; + T tempValue; asm volatile("0:\n" "lld %[originalValue], %[_q_value]\n" "move %[tempValue], %[newValue]\n" @@ -335,8 +335,8 @@ T QBasicAtomicOps<8>::fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHR template<> template inline T QBasicAtomicOps<8>::fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType::AdditiveT valueToAdd) Q_DECL_NOTHROW { - register T originalValue; - register T newValue; + T originalValue; + T newValue; asm volatile("0:\n" "lld %[originalValue], %[_q_value]\n" "addu %[newValue], %[originalValue], %[valueToAdd]\n" diff --git a/src/corelib/arch/qatomic_power.h b/src/corelib/arch/qatomic_power.h index ad1c619d56..3ddd303795 100644 --- a/src/corelib/arch/qatomic_power.h +++ b/src/corelib/arch/qatomic_power.h @@ -124,8 +124,8 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::isFetchAndAddWaitFree() inline bool QBasicAtomicInt::ref() { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "addi %[newValue], %[originalValue], %[one]\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -141,8 +141,8 @@ inline bool QBasicAtomicInt::ref() inline bool QBasicAtomicInt::deref() { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "addi %[newValue], %[originalValue], %[minusOne]\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -158,7 +158,7 @@ inline bool QBasicAtomicInt::deref() inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) { - register int result; + int result; asm volatile("lwarx %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" "bne $+12\n" @@ -175,7 +175,7 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) { - register int result; + int result; asm volatile("lwarx %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" "bne $+16\n" @@ -193,7 +193,7 @@ inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) { - register int result; + int result; asm volatile("eieio\n" "lwarx %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" @@ -211,7 +211,7 @@ inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) { - register int originalValue; + int originalValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "stwcx. %[newValue]," _Q_VALUE "\n" "bne- $-8\n" @@ -225,7 +225,7 @@ inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) { - register int originalValue; + int originalValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "stwcx. %[newValue]," _Q_VALUE "\n" "bne- $-8\n" @@ -240,7 +240,7 @@ inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) { - register int originalValue; + int originalValue; asm volatile("eieio\n" "lwarx %[originalValue]," _Q_VALUE "\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -255,8 +255,8 @@ inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -272,8 +272,8 @@ inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("lwarx %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" "stwcx. %[newValue]," _Q_VALUE "\n" @@ -290,8 +290,8 @@ inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) { - register int originalValue; - register int newValue; + int originalValue; + int newValue; asm volatile("eieio\n" "lwarx %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" @@ -317,7 +317,7 @@ inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) { - register void *result; + void *result; asm volatile(LPARX" %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" "bne $+12\n" @@ -335,7 +335,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) { - register void *result; + void *result; asm volatile(LPARX" %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" "bne $+16\n" @@ -354,7 +354,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) { - register void *result; + void *result; asm volatile("eieio\n" LPARX" %[result]," _Q_VALUE "\n" "xor. %[result], %[result], %[expectedValue]\n" @@ -373,7 +373,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValu template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" STPCX" %[newValue]," _Q_VALUE "\n" "bne- $-8\n" @@ -388,7 +388,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" STPCX" %[newValue]," _Q_VALUE "\n" "bne- $-8\n" @@ -404,7 +404,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile("eieio\n" LPARX" %[originalValue]," _Q_VALUE "\n" STPCX" %[newValue]," _Q_VALUE "\n" @@ -420,8 +420,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) { - register T *originalValue; - register T *newValue; + T *originalValue; + T *newValue; asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" STPCX" %[newValue]," _Q_VALUE "\n" @@ -438,8 +438,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) { - register T *originalValue; - register T *newValue; + T *originalValue; + T *newValue; asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" STPCX" %[newValue]," _Q_VALUE "\n" @@ -457,8 +457,8 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) { - register T *originalValue; - register T *newValue; + T *originalValue; + T *newValue; asm volatile("eieio\n" LPARX" %[originalValue]," _Q_VALUE "\n" "add %[newValue], %[originalValue], %[valueToAdd]\n" diff --git a/src/corelib/arch/qatomic_sh4a.h b/src/corelib/arch/qatomic_sh4a.h index 08f75e44f2..6e59279f3e 100644 --- a/src/corelib/arch/qatomic_sh4a.h +++ b/src/corelib/arch/qatomic_sh4a.h @@ -147,7 +147,7 @@ inline bool QBasicAtomicInt::deref() inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) { - register int result; + int result; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "xor %[expectedValue], r0\n" @@ -169,7 +169,7 @@ inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) { - register int result; + int result; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "xor %[expectedValue], r0\n" @@ -192,7 +192,7 @@ inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue) inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue) { - register int result; + int result; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -220,7 +220,7 @@ inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue) inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) { - register int originalValue; + int originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -237,7 +237,7 @@ inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue) inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) { - register int originalValue; + int originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -255,7 +255,7 @@ inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue) inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue) { - register int originalValue; + int originalValue; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -278,7 +278,7 @@ inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue) inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) { - register int originalValue; + int originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -295,7 +295,7 @@ inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) { - register int originalValue; + int originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -313,7 +313,7 @@ inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd) inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd) { - register int originalValue; + int originalValue; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -337,7 +337,7 @@ inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd) template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValue, T *newValue) { - register T *result; + T *result; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "xor %[expectedValue], r0\n" @@ -360,7 +360,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelaxed(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValue, T *newValue) { - register T *result; + T *result; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "xor %[expectedValue], r0\n" @@ -384,7 +384,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetAcquire(T *expectedValu template Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetRelease(T *expectedValue, T *newValue) { - register T *result; + T *result; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -414,7 +414,7 @@ Q_INLINE_TEMPLATE bool QBasicAtomicPointer::testAndSetOrdered(T *expectedValu template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -432,7 +432,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelaxed(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -451,7 +451,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreAcquire(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreRelease(T *newValue) { - register T *originalValue; + T *originalValue; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" @@ -476,7 +476,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndStoreOrdered(T *newValue) template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueToAdd) { - register T *originalValue; + T *originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -494,7 +494,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelaxed(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueToAdd) { - register T *originalValue; + T *originalValue; asm volatile("0:\n" "movli.l @%[_q_value], r0\n" "mov r0, %[originalValue]\n" @@ -513,7 +513,7 @@ Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddAcquire(qptrdiff valueTo template Q_INLINE_TEMPLATE T *QBasicAtomicPointer::fetchAndAddRelease(qptrdiff valueToAdd) { - register T *originalValue; + T *originalValue; asm volatile("synco\n" "0:\n" "movli.l @%[_q_value], r0\n" diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 1cedd3a28d..4ed7b00e53 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -99,9 +99,9 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, textCodecsMutex, (QMutex::Recursive)); QMutex *qTextCodecsMutex() { return textCodecsMutex(); } #if !defined(QT_USE_ICU) -static char qtolower(register char c) +static char qtolower(char c) { if (c >= 'A' && c <= 'Z') return c + 0x20; return c; } -static bool qisalnum(register char c) +static bool qisalnum(char c) { return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z'); } bool qTextCodecNameMatch(const char *n, const char *h) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index c8293beb4e..85ff89ebdd 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -501,7 +501,7 @@ Q_AUTOTEST_EXPORT QByteArray qCleanupFuncinfo(QByteArray info) templatecount = 1; --pos; while (pos && templatecount) { - register char c = info.at(pos); + char c = info.at(pos); if (c == '>') ++templatecount; else if (c == '<') diff --git a/src/corelib/io/qfilesystemwatcher_inotify.cpp b/src/corelib/io/qfilesystemwatcher_inotify.cpp index 18f3404c5d..024af79c33 100644 --- a/src/corelib/io/qfilesystemwatcher_inotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_inotify.cpp @@ -220,7 +220,7 @@ QT_BEGIN_NAMESPACE QInotifyFileSystemWatcherEngine *QInotifyFileSystemWatcherEngine::create(QObject *parent) { - register int fd = -1; + int fd = -1; #ifdef IN_CLOEXEC fd = inotify_init1(IN_CLOEXEC); #endif diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 02e7b967ea..f2e1f9bbc7 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -882,7 +882,7 @@ inline bool QUrlPrivate::setScheme(const QString &value, int len, bool doSetErro // schemes are ASCII only, so we don't need the full Unicode toLower QChar *schemeData = scheme.data(); // force detaching here for (int i = needsLowercasing; i >= 0; --i) { - register ushort c = schemeData[i].unicode(); + ushort c = schemeData[i].unicode(); if (c >= 'A' && c <= 'Z') schemeData[i] = c + 0x20; } @@ -1244,7 +1244,7 @@ inline void QUrlPrivate::parse(const QString &url, QUrl::ParsingMode parsingMode const ushort *const data = reinterpret_cast(begin); for (int i = 0; i < len; ++i) { - register uint uc = data[i]; + uint uc = data[i]; if (uc == '#' && hash == -1) { hash = i; @@ -1472,7 +1472,7 @@ inline QUrlPrivate::ErrorCode QUrlPrivate::validityError(QString *source, int *p // check for a path of "text:text/" for (int i = 0; i < path.length(); ++i) { - register ushort c = path.at(i).unicode(); + ushort c = path.at(i).unicode(); if (c == '/') { // found the slash before the colon return NoError; @@ -1512,7 +1512,7 @@ bool QUrlPrivate::validateComponent(QUrlPrivate::Section section, const QString const ushort *const data = reinterpret_cast(input.constData()); for (uint i = uint(begin); i < uint(end); ++i) { - register uint uc = data[i]; + uint uc = data[i]; if (uc >= 0x80) continue; diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index 5fa4b5f7a1..70db9e09eb 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -2028,7 +2028,7 @@ Q_AUTOTEST_EXPORT void qt_nameprep(QString *source, int from) const QChar *e = src + source->size(); for ( ; out < e; ++out) { - register ushort uc = out->unicode(); + ushort uc = out->unicode(); if (uc >= 0x80) { break; } else if (uc >= 'A' && uc <= 'Z') { @@ -2121,7 +2121,7 @@ Q_AUTOTEST_EXPORT bool qt_check_std3rules(const QChar *uc, int len) return false; for (int i = 0; i < len; ++i) { - register ushort c = uc[i].unicode(); + ushort c = uc[i].unicode(); if (c == '-' && (i == 0 || i == len - 1)) return false; @@ -2504,7 +2504,7 @@ QString qt_ACE_do(const QString &domain, AceOperation op) const QChar *in = domain.constData() + lastIdx; const QChar *e = in + labelLength; for (; in < e; ++in, ++out) { - register ushort uc = in->unicode(); + ushort uc = in->unicode(); if (uc > 0x7f) simple = false; if (uc >= 'A' && uc <= 'Z') @@ -2533,7 +2533,7 @@ QString qt_ACE_do(const QString &domain, AceOperation op) // That means we need one or two temporaries qt_nameprep(&result, prevLen); labelLength = result.length() - prevLen; - register int toReserve = labelLength + 4 + 6; // "xn--" plus some extra bytes + int toReserve = labelLength + 4 + 6; // "xn--" plus some extra bytes aceForm.resize(0); if (toReserve > aceForm.capacity()) aceForm.reserve(toReserve); diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp index 6e01272831..5ff0c40a4f 100644 --- a/src/corelib/io/qurlrecode.cpp +++ b/src/corelib/io/qurlrecode.cpp @@ -464,7 +464,7 @@ static int recode(QString &result, const ushort *begin, const ushort *end, QUrl: ushort *output = 0; for ( ; input != end; ++input) { - register ushort c; + ushort c; EncodingAction action; // try a run where no change is necessary @@ -483,7 +483,7 @@ static int recode(QString &result, const ushort *begin, const ushort *end, QUrl: break; non_trivial: - register uint decoded; + uint decoded; if (c == '%' && retryBadEncoding) { // always write "%25" ensureDetached(result, output, begin, input, end); diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp index 241658acb1..98e697eb57 100644 --- a/src/corelib/kernel/qcore_unix.cpp +++ b/src/corelib/kernel/qcore_unix.cpp @@ -79,7 +79,7 @@ int qt_safe_select(int nfds, fd_set *fdread, fd_set *fdwrite, fd_set *fdexcept, { if (!orig_timeout) { // no timeout -> block forever - register int ret; + int ret; EINTR_LOOP(ret, select(nfds, fdread, fdwrite, fdexcept, 0)); return ret; } diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index b68146cd6c..8c0589fdc6 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -168,7 +168,7 @@ static inline int qt_safe_open(const char *pathname, int flags, mode_t mode = 07 #ifdef O_CLOEXEC flags |= O_CLOEXEC; #endif - register int fd; + int fd; EINTR_LOOP(fd, QT_OPEN(pathname, flags, mode)); // unknown flags are ignored, so we have no way of verifying if @@ -191,7 +191,7 @@ static inline int qt_safe_pipe(int pipefd[2], int flags = 0) Q_ASSERT((flags & ~O_NONBLOCK) == 0); #endif - register int ret; + int ret; #if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC) // use pipe2 flags |= O_CLOEXEC; @@ -223,7 +223,7 @@ static inline int qt_safe_dup(int oldfd, int atleast = 0, int flags = FD_CLOEXEC { Q_ASSERT(flags == FD_CLOEXEC || flags == 0); - register int ret; + int ret; #ifdef F_DUPFD_CLOEXEC // use this fcntl if (flags & FD_CLOEXEC) { @@ -247,7 +247,7 @@ static inline int qt_safe_dup2(int oldfd, int newfd, int flags = FD_CLOEXEC) { Q_ASSERT(flags == FD_CLOEXEC || flags == 0); - register int ret; + int ret; #if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC) // use dup3 if (flags & FD_CLOEXEC) { @@ -291,7 +291,7 @@ static inline qint64 qt_safe_write_nosignal(int fd, const void *data, qint64 len static inline int qt_safe_close(int fd) { - register int ret; + int ret; EINTR_LOOP(ret, QT_CLOSE(fd)); return ret; } @@ -303,28 +303,28 @@ static inline int qt_safe_close(int fd) static inline int qt_safe_execve(const char *filename, char *const argv[], char *const envp[]) { - register int ret; + int ret; EINTR_LOOP(ret, ::execve(filename, argv, envp)); return ret; } static inline int qt_safe_execv(const char *path, char *const argv[]) { - register int ret; + int ret; EINTR_LOOP(ret, ::execv(path, argv)); return ret; } static inline int qt_safe_execvp(const char *file, char *const argv[]) { - register int ret; + int ret; EINTR_LOOP(ret, ::execvp(file, argv)); return ret; } static inline pid_t qt_safe_waitpid(pid_t pid, int *status, int options) { - register int ret; + int ret; EINTR_LOOP(ret, ::waitpid(pid, status, options)); return ret; } diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 100e014e99..e49d5f961c 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -938,7 +938,7 @@ bool QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject *receiv if (receiver->d_func()->threadData == this->threadData && extraData) { // application event filters are only called for objects in the GUI thread for (int i = 0; i < extraData->eventFilters.size(); ++i) { - register QObject *obj = extraData->eventFilters.at(i); + QObject *obj = extraData->eventFilters.at(i); if (!obj) continue; if (obj->d_func()->threadData != threadData) { @@ -957,7 +957,7 @@ bool QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject *receiver, Q Q_Q(QCoreApplication); if (receiver != q && receiver->d_func()->extraData) { for (int i = 0; i < receiver->d_func()->extraData->eventFilters.size(); ++i) { - register QObject *obj = receiver->d_func()->extraData->eventFilters.at(i); + QObject *obj = receiver->d_func()->extraData->eventFilters.at(i); if (!obj) continue; if (obj->d_func()->threadData != receiver->d_func()->threadData) { diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 7413ef4d89..d9b286e691 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -686,7 +686,7 @@ struct QMetaTypeIdQObject template inline int qRegisterMetaTypeStreamOperators() { - register int id = qMetaTypeId(); + int id = qMetaTypeId(); QMetaType::registerStreamOperators(id, QtMetaTypePrivate::QMetaTypeFunctionHelper::Save, QtMetaTypePrivate::QMetaTypeFunctionHelper::Load); return id; diff --git a/src/corelib/kernel/qsystemsemaphore_unix.cpp b/src/corelib/kernel/qsystemsemaphore_unix.cpp index 6e2838a8a5..073bd020ba 100644 --- a/src/corelib/kernel/qsystemsemaphore_unix.cpp +++ b/src/corelib/kernel/qsystemsemaphore_unix.cpp @@ -212,7 +212,7 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count) operation.sem_op = count; operation.sem_flg = SEM_UNDO; - register int res; + int res; EINTR_LOOP(res, semop(semaphore, &operation, 1)); if (-1 == res) { // If the semaphore was removed be nice and create it and then modifySemaphore again diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp index 0e33fa697a..f1bbbe5338 100644 --- a/src/corelib/kernel/qtimerinfo_unix.cpp +++ b/src/corelib/kernel/qtimerinfo_unix.cpp @@ -153,7 +153,7 @@ void QTimerInfoList::timerRepair(const timespec &diff) { // repair all timers for (int i = 0; i < size(); ++i) { - register QTimerInfo *t = at(i); + QTimerInfo *t = at(i); t->timeout = t->timeout + diff; } } @@ -182,7 +182,7 @@ void QTimerInfoList::timerInsert(QTimerInfo *ti) { int index = size(); while (index--) { - register const QTimerInfo * const t = at(index); + const QTimerInfo * const t = at(index); if (!(ti->timeout < t->timeout)) break; } @@ -244,8 +244,8 @@ static void calculateCoarseTimerTimeout(QTimerInfo *t, timespec currentTime) // // The objective is to make most timers wake up at the same time, thereby reducing CPU wakeups. - register uint interval = uint(t->interval); - register uint msec = uint(t->timeout.tv_nsec) / 1000 / 1000; + uint interval = uint(t->interval); + uint msec = uint(t->timeout.tv_nsec) / 1000 / 1000; Q_ASSERT(interval >= 20); // Calculate how much we can round and still keep within 5% error @@ -256,14 +256,14 @@ static void calculateCoarseTimerTimeout(QTimerInfo *t, timespec currentTime) if (interval < 50) { // round to even // round towards multiples of 50 ms - register bool roundUp = (msec % 50) >= 25; + bool roundUp = (msec % 50) >= 25; msec >>= 1; msec |= uint(roundUp); msec <<= 1; } else { // round to multiple of 4 // round towards multiples of 100 ms - register bool roundUp = (msec % 100) >= 50; + bool roundUp = (msec % 100) >= 50; msec >>= 2; msec |= uint(roundUp); msec <<= 2; @@ -423,7 +423,7 @@ int QTimerInfoList::timerRemainingTime(int timerId) timespec tm = {0, 0}; for (int i = 0; i < count(); ++i) { - register QTimerInfo *t = at(i); + QTimerInfo *t = at(i); if (t->id == timerId) { if (currentTime < t->timeout) { // time to wait @@ -509,7 +509,7 @@ bool QTimerInfoList::unregisterTimer(int timerId) { // set timer inactive for (int i = 0; i < count(); ++i) { - register QTimerInfo *t = at(i); + QTimerInfo *t = at(i); if (t->id == timerId) { // found it removeAt(i); @@ -530,7 +530,7 @@ bool QTimerInfoList::unregisterTimers(QObject *object) if (isEmpty()) return false; for (int i = 0; i < count(); ++i) { - register QTimerInfo *t = at(i); + QTimerInfo *t = at(i); if (t->obj == object) { // object found removeAt(i); @@ -550,7 +550,7 @@ QList QTimerInfoList::registeredTimers(QObj { QList list; for (int i = 0; i < count(); ++i) { - register const QTimerInfo * const t = at(i); + const QTimerInfo * const t = at(i); if (t->obj == object) { list << QAbstractEventDispatcher::TimerInfo(t->id, (t->timerType == Qt::VeryCoarseTimer diff --git a/src/corelib/thread/qgenericatomic.h b/src/corelib/thread/qgenericatomic.h index a0a851eabb..3a213f6a25 100644 --- a/src/corelib/thread/qgenericatomic.h +++ b/src/corelib/thread/qgenericatomic.h @@ -172,7 +172,7 @@ template struct QGenericAtomicOps { // implement fetchAndStore on top of testAndSet Q_FOREVER { - register T tmp = load(_q_value); + T tmp = load(_q_value); if (BaseClass::testAndSetRelaxed(_q_value, tmp, newValue)) return tmp; } @@ -207,7 +207,7 @@ template struct QGenericAtomicOps { // implement fetchAndAdd on top of testAndSet Q_FOREVER { - register T tmp = BaseClass::load(_q_value); + T tmp = BaseClass::load(_q_value); if (BaseClass::testAndSetRelaxed(_q_value, tmp, T(tmp + valueToAdd))) return tmp; } diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index 1ed4a77950..378813c889 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE static inline bool isRecursive(QMutexData *d) { - register quintptr u = quintptr(d); + quintptr u = quintptr(d); if (Q_LIKELY(u <= 0x3)) return false; #ifdef QT_LINUX_FUTEX diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index dc3f5f3be9..75900e9775 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -261,8 +261,8 @@ int qstrcmp(const char *str1, const char *str2) int qstricmp(const char *str1, const char *str2) { - register const uchar *s1 = reinterpret_cast(str1); - register const uchar *s2 = reinterpret_cast(str2); + const uchar *s1 = reinterpret_cast(str1); + const uchar *s2 = reinterpret_cast(str2); int res; uchar c; if (!s1 || !s2) @@ -295,8 +295,8 @@ int qstricmp(const char *str1, const char *str2) int qstrnicmp(const char *str1, const char *str2, uint len) { - register const uchar *s1 = reinterpret_cast(str1); - register const uchar *s2 = reinterpret_cast(str2); + const uchar *s1 = reinterpret_cast(str1); + const uchar *s2 = reinterpret_cast(str2); int res; uchar c; if (!s1 || !s2) @@ -321,7 +321,7 @@ int qstrcmp(const QByteArray &str1, const char *str2) const char *str1data = str1.constData(); const char *str1end = str1data + str1.length(); for ( ; str1data < str1end && *str2; ++str1data, ++str2) { - register int diff = int(uchar(*str1data)) - uchar(*str2); + int diff = int(uchar(*str1data)) - uchar(*str2); if (diff) // found a difference return diff; @@ -357,8 +357,8 @@ int qstrcmp(const QByteArray &str1, const QByteArray &str2) #if 0 static void createCRC16Table() // build CRC16 lookup table { - register unsigned int i; - register unsigned int j; + unsigned int i; + unsigned int j; unsigned short crc_tbl[16]; unsigned int v0, v1, v2, v3; for (i = 0; i < 16; i++) { @@ -410,7 +410,7 @@ static const quint16 crc_tbl[16] = { quint16 qChecksum(const char *data, uint len) { - register quint16 crc = 0xffff; + quint16 crc = 0xffff; uchar c; const uchar *p = reinterpret_cast(data); while (len--) { @@ -2671,7 +2671,7 @@ QByteArray QByteArray::mid(int pos, int len) const QByteArray QByteArray::toLower() const { QByteArray s(*this); - register uchar *p = reinterpret_cast(s.data()); + uchar *p = reinterpret_cast(s.data()); if (p) { while (*p) { *p = QChar::toLower((ushort)*p); @@ -2694,7 +2694,7 @@ QByteArray QByteArray::toLower() const QByteArray QByteArray::toUpper() const { QByteArray s(*this); - register uchar *p = reinterpret_cast(s.data()); + uchar *p = reinterpret_cast(s.data()); if (p) { while (*p) { *p = QChar::toUpper((ushort)*p); diff --git a/src/corelib/tools/qbytearraymatcher.cpp b/src/corelib/tools/qbytearraymatcher.cpp index bcd6a56aad..d030192117 100644 --- a/src/corelib/tools/qbytearraymatcher.cpp +++ b/src/corelib/tools/qbytearraymatcher.cpp @@ -61,7 +61,7 @@ static inline int bm_find(const uchar *cc, int l, int index, const uchar *puc, u return index > l ? -1 : index; const uint pl_minus_one = pl - 1; - register const uchar *current = cc + index + pl_minus_one; + const uchar *current = cc + index + pl_minus_one; const uchar *end = cc + l; while (current < end) { uint skip = skiptable[*current]; diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp index 24ca628b5a..6b716b356f 100644 --- a/src/corelib/tools/qlocale_tools.cpp +++ b/src/corelib/tools/qlocale_tools.cpp @@ -300,13 +300,13 @@ bool removeGroupSeparators(QLocalePrivate::CharBuff *num) * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. */ -qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, bool *ok) +qulonglong qstrtoull(const char *nptr, const char **endptr, int base, bool *ok) { - register const char *s = nptr; - register qulonglong acc; - register unsigned char c; - register qulonglong qbase, cutoff; - register int any, cutlim; + const char *s = nptr; + qulonglong acc; + unsigned char c; + qulonglong qbase, cutoff; + int any, cutlim; if (ok != 0) *ok = true; @@ -381,13 +381,13 @@ qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, b * Ignores `locale' stuff. Assumes that the upper and lower case * alphabets and digits are each contiguous. */ -qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok) +qlonglong qstrtoll(const char *nptr, const char **endptr, int base, bool *ok) { - register const char *s; - register qulonglong acc; - register unsigned char c; - register qulonglong qbase, cutoff; - register int neg, any, cutlim; + const char *s; + qulonglong acc; + unsigned char c; + qulonglong qbase, cutoff; + int neg, any, cutlim; /* * Skip white space and pick up leading +/- sign if any. diff --git a/src/corelib/tools/qlocale_tools_p.h b/src/corelib/tools/qlocale_tools_p.h index 3c4e9b5bd5..cb47bfcb5e 100644 --- a/src/corelib/tools/qlocale_tools_p.h +++ b/src/corelib/tools/qlocale_tools_p.h @@ -110,8 +110,8 @@ bool removeGroupSeparators(QLocalePrivate::CharBuff *num); Q_CORE_EXPORT char *qdtoa(double d, int mode, int ndigits, int *decpt, int *sign, char **rve, char **digits_str); Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok); -qlonglong qstrtoll(const char *nptr, const char **endptr, register int base, bool *ok); -qulonglong qstrtoull(const char *nptr, const char **endptr, register int base, bool *ok); +qlonglong qstrtoll(const char *nptr, const char **endptr, int base, bool *ok); +qulonglong qstrtoull(const char *nptr, const char **endptr, int base, bool *ok); QT_END_NAMESPACE diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 5e30cf3ecb..1423449a69 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -506,7 +506,7 @@ public: if (o) { // increase the strongref, but never up from zero // or less (-1 is used by QWeakPointer on untracked QObject) - register int tmp = o->strongref.load(); + int tmp = o->strongref.load(); while (tmp > 0) { // try to increment from "tmp" to "tmp + 1" if (o->strongref.testAndSetRelaxed(tmp, tmp + 1)) @@ -801,7 +801,7 @@ namespace QtSharedPointer { template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerCast(const QSharedPointer &src) { - register X *ptr = static_cast(src.data()); // if you get an error in this line, the cast is invalid + X *ptr = static_cast(src.data()); // if you get an error in this line, the cast is invalid return QtSharedPointer::copyAndSetPointer(ptr, src); } template @@ -813,7 +813,7 @@ Q_INLINE_TEMPLATE QSharedPointer qSharedPointerCast(const QWeakPointer &sr template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerDynamicCast(const QSharedPointer &src) { - register X *ptr = dynamic_cast(src.data()); // if you get an error in this line, the cast is invalid + X *ptr = dynamic_cast(src.data()); // if you get an error in this line, the cast is invalid if (!ptr) return QSharedPointer(); return QtSharedPointer::copyAndSetPointer(ptr, src); @@ -827,7 +827,7 @@ Q_INLINE_TEMPLATE QSharedPointer qSharedPointerDynamicCast(const QWeakPointer template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerConstCast(const QSharedPointer &src) { - register X *ptr = const_cast(src.data()); // if you get an error in this line, the cast is invalid + X *ptr = const_cast(src.data()); // if you get an error in this line, the cast is invalid return QtSharedPointer::copyAndSetPointer(ptr, src); } template @@ -847,7 +847,7 @@ QWeakPointer qWeakPointerCast(const QSharedPointer &src) template Q_INLINE_TEMPLATE QSharedPointer qSharedPointerObjectCast(const QSharedPointer &src) { - register X *ptr = qobject_cast(src.data()); + X *ptr = qobject_cast(src.data()); return QtSharedPointer::copyAndSetPointer(ptr, src); } template diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 54b1a084b2..de09e5bbe0 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -266,7 +266,7 @@ static bool qMemEquals(const quint16 *a, const quint16 *b, int length) if (a == b || !length) return true; - register union { + union { const quint16 *w; const quint32 *d; quintptr value; @@ -291,7 +291,7 @@ static bool qMemEquals(const quint16 *a, const quint16 *b, int length) // both addresses are 4-bytes aligned // do a fast 32-bit comparison - register const quint32 *e = sa.d + (length >> 1); + const quint32 *e = sa.d + (length >> 1); for ( ; sa.d != e; ++sa.d, ++sb.d) { if (*sa.d != *sb.d) return false; @@ -301,7 +301,7 @@ static bool qMemEquals(const quint16 *a, const quint16 *b, int length) return (length & 1) ? *sa.w == *sb.w : true; } else { // one of the addresses isn't 4-byte aligned but the other is - register const quint16 *e = sa.w + length; + const quint16 *e = sa.w + length; for ( ; sa.w != e; ++sa.w, ++sb.w) { if (*sa.w != *sb.w) return false; @@ -4908,8 +4908,8 @@ int QString::compare_helper(const QChar *data1, int length1, const QChar *data2, { if (cs == Qt::CaseSensitive) return ucstrcmp(data1, length1, data2, length2); - register const ushort *s1 = reinterpret_cast(data1); - register const ushort *s2 = reinterpret_cast(data2); + const ushort *s1 = reinterpret_cast(data1); + const ushort *s2 = reinterpret_cast(data2); return ucstricmp(s1, s1 + length1, s2, s2 + length2); } diff --git a/src/corelib/tools/qstringmatcher.cpp b/src/corelib/tools/qstringmatcher.cpp index d54e9c7ba7..1b8a40ef2f 100644 --- a/src/corelib/tools/qstringmatcher.cpp +++ b/src/corelib/tools/qstringmatcher.cpp @@ -69,7 +69,7 @@ static inline int bm_find(const ushort *uc, uint l, int index, const ushort *puc return index > (int)l ? -1 : index; const uint pl_minus_one = pl - 1; - register const ushort *current = uc + index + pl_minus_one; + const ushort *current = uc + index + pl_minus_one; const ushort *end = uc + l; if (cs == Qt::CaseSensitive) { while (current < end) { -- cgit v1.2.3 From 41dbfd8888e14440041907ac646c2e63284d50c7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 16 Jun 2013 19:08:09 -0700 Subject: Doc: there is no Q_OS_X11 (and has never been) Change the example to Q_OS_UNIX. Change-Id: I8aed12237408a0e526839a96867aceae33b993b9 Reviewed-by: Shawn Rutledge Reviewed-by: Jerome Pasion --- src/corelib/global/qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 6f63a0d9d3..e6da7bb32d 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -511,7 +511,7 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n); the application is compiled using Forte Developer, or Sun Studio C++. The header file also declares a range of macros (Q_OS_*) that are defined for the specified platforms. For example, - Q_OS_X11 which is defined for the X Window System. + Q_OS_UNIX which is defined for the Unix-based systems. The purpose of these macros is to enable programmers to add compiler or platform specific code to their application. -- cgit v1.2.3 From e3dadce470bcc020dc11331be1877a10e70786a6 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sun, 16 Jun 2013 11:32:09 +0300 Subject: Ensure we don't repeat QTBUG-30931 in Qt5 The issue is already fixed in 5.0 but let's be nice and ensure the issue won't be reintroduced later. Task-number: QTBUG-30931 Change-Id: Ia6944acaf6e7217f8d0f1fa75d0e9977db11d892 Reviewed-by: Lars Knoll --- src/corelib/tools/qchar.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index 8545276dac..9ab7155c2d 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -1739,10 +1739,10 @@ static void composeHelper(QString *str, QChar::UnicodeVersion version, int from) if (from < 0 || s.length() - from < 2) return; - int starter = 0; // starter position uint stcode = 0; // starter code point - int next = -1; - int lastCombining = 0; + int starter = -1; // starter position + int next = -1; // to prevent i == next + int lastCombining = 255; // to prevent combining > lastCombining int pos = from; while (pos < s.length()) { @@ -1766,8 +1766,7 @@ static void composeHelper(QString *str, QChar::UnicodeVersion version, int from) } int combining = p->combiningClass; - if (i == next || combining > lastCombining) { - Q_ASSERT(starter >= from); + if ((i == next || combining > lastCombining) && starter >= from) { // allowed to form ligature with S uint ligature = ligatureHelper(stcode, uc); if (ligature) { -- cgit v1.2.3 From a4d41f6803beca7e0911610cc4ed8027ab196eb7 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 14 Jun 2013 15:51:48 +0200 Subject: Doc: QTranslator::translate() isn't an overload anymore Change-Id: Ib50044da48be3fb4f43300aa285e15403bd8d65e Reviewed-by: Jerome Pasion Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qtranslator.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 9243d093df..903ab2e2cd 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -1084,8 +1084,6 @@ void QTranslatorPrivate::clear() } /*! - \overload translate() - Returns the translation for the key (\a context, \a sourceText, \a disambiguation). If none is found, also tries (\a context, \a sourceText, ""). If that still fails, returns a null string. -- cgit v1.2.3 From 25739bebba0343a8b35775a073c49f0fba080762 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Wed, 19 Jun 2013 14:40:17 +0800 Subject: Doc: Fix spelling error Change-Id: I9225ffeddfe17bc4f56ecd9a9c4656403840f828 Reviewed-by: Friedemann Kleint --- src/corelib/global/qtypeinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 8e34c9792d..58736ac2b8 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -110,7 +110,7 @@ public: To create a proper QTypeInfo specialization for A struct, we have to check all sub-components; B, C and D, then take the lowest common denominator and call - Q_DECLATE_TYPEINFO with the resulting flags. An easier and less fragile approach is to + Q_DECLARE_TYPEINFO with the resulting flags. An easier and less fragile approach is to use QTypeInfoMerger, which does that automatically. So struct A would have the following QTypeInfo definition: -- cgit v1.2.3