summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | QTimeZone: don't use QSet, use sorted QListMarc Mutz2015-02-177-95/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSet, as a node-based container, requires one memory allocation per element inserted. QList, as a contiguous-memory container (at least in the case of a QByteArray payload), requires one memory allocation per container. The higher lookup speed might still speak for using QSet, but there are only two uses of the sets: 1. Checking for existence (or lack thereof) of timezone names. For this, first generating a container full of data just to check for existence of one item of data is extremely wasteful. The QTZPrivate API should be extended to allow said lookup to be performed on the native data store instead. That leaves 2. Returning a sorted(!) list(!) from the public QTimeZone API. There is no reason why, during the construction of those sorted lists, the data should be held in a set. Instead, the well-known technique of first cramming everything into a result container, which is subsequently sorted and has its duplicates removed, can be used here. Saves more than 8K of text size on AMD64 stripped release builds. Change-Id: I71c2298e94e02d55b0c9fb6f7ebeaed79a1fe2db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Remove __cdecl from Windows desktop atomicsThiago Macieira2015-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | winbase.h defines them without __cdecl, so we shouldn't add them ourselves to our forward declaration. Doing so results in errors if the user changed the default calling convention when compiling Qt: qatomic_msvc.h(126): error C2373: '_InterlockedIncrement' : redefinition; different type modifiers C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\intrin.h(242) : see declaration of '_InterlockedIncrement' Task-number: QTBUG-44028 Change-Id: I1a800c709d3543699131ffff13c3d09fe53ba28b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Fix MSVC 2013/64bit warnings about conversion from 'size_t' to 'int'.Friedemann Kleint2015-02-182-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tools\qstring.cpp(243) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data io\qdebug.cpp(287) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data io\qdebug.cpp(292) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data io\qdebug.cpp(305) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data io\qdebug.cpp(312) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data Change-Id: I20b92b0783f4859e9da83364b4ec86dd8bbd1c4c Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | | | Merge remote-tracking branch 'origin/dev' into 5.5Frederik Gladhorn2015-02-1725-109/+131
|\| | | | | | | | | | | | | | | | | | | | | | | Needed due to license header patch. Change-Id: Id7e30490132a7c487687a0a376419e9f9b97ea41
| * | | Introduce QT_NO_MIMETYPESérgio Martins2015-02-1720-13/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mime type stuff generates one of the biggest translation units in QtCore due to the compressed 1.7MB freedesktop.org.xml resource. With QT_NO_MIMETYPE, libQt5Core.so is almost 400Kb smaller (4.8MB->4.4MB gcc 4.9 stripped release build) Change-Id: I5339090994034355724ff4deddb64720e81baeaf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | | Use C++ <cmath> instead of <math.h>Allan Sandfeld Jensen2015-02-164-95/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Including math.h can pollute the default namespace, and break some compilers if cmath versions of the method are declared as using. Switching to C++ math functions also greatly simplifies handling of float qreal as C++ automatically chooses the right method. [ChangeLog][QtCore][QtMath] qmath.h no longer includes math.h, so any sources depending on that indirect inclusion may fail to build. Change-Id: I4d0e331dafba354ec05dc5052e61ef4ff8d387fe Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
| * | | Android: Fix compile on arm64-v8aBogDan Vatra2015-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android arm64-v8a redefines _POSIX_C_SOURCE to 199506 if _XOPEN_SOURCE is defined. Change-Id: I04ff616eaac6e08094fc1f58f49bc5a2c31733f0 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | | | Fix QDebug cumulating operator<< with many Q_ENUMOlivier Goffart2015-02-174-24/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the operator<< was taking a non-const reference to the QDebug object. This causes a problem as all other operator<< return a temporary. Since every other roperator<< takes the QDebug by value, we should also take it by value in this case. Move the operator<< in qdebug.h because i don't want to #include qdebug.h from qobject.h And move the qt_QMetaEnum_debugOperator to be in the corresponding .cpp Task-number: QTBUG-44462 Change-Id: Ia01629224c58930c2997e767efc43de90d6309e2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | | Use Clang 3.6's __builtin_assume in Q_ASSUMEThiago Macieira2015-02-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's more efficient than the current implementation. Example: int f(int i) { Q_ASSUME(i < 8); return i < 8; } Before: cmpl $8, %edi setl %al movzbl %al, %eax retq After: movl $1, %eax retq Change-Id: I1a800c709d3543699131ffff13c1c50713a8da2c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Fix Intel compiler warning about change of signThiago Macieira2015-02-171-4/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The variable c is unsigned, so the second operand is unsigned, constraing the -1 to be unsigned too and causing a change of sign. Instead, cast the middle operations to int, as that's the return value anyway. error #68: integer conversion resulted in a change of sign Change-Id: I1a800c709d3543699131ffff13c2fd79f14f8b43 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QDateTime: micro-optimize QDebug op<<Marc Mutz2015-02-151-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of constructing a QString that describes the QDateTime instance, stream the constituents of the string into QDebug directly, using op<< for Q_ENUM, now that it's available. Adapt test to new format of enums. Effects on Linux GCC 4.9 stripped release builds: text -1068B data +-0B relocs +-0 Change-Id: I1a5ce28904edd7d0f6c8d982fd41c52e3536e036 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Remove support for some very old compilersAllan Sandfeld Jensen2015-02-151-11/+0
| | | | | | | | | | | | | | | | | | | | | Remove code supporting gcc 4.0 and earlier, and MSVC 2005 and earlier. Change-Id: I3304e11bb38c101f113c124e8e533c5578badf34 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | qstandardpaths_ios: add system path for PicturesLocationRichard Moe Gustavsen2015-02-151-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For PicturesLocation we add a second path pointing to system assets. This url is understood by both QFile (using a dedicated file engine), and QFileDialog, such that if you point the dialog to the url, it will show a native image picker dialog. Change-Id: Ic79393440ab399ed4802cc6d84ec7ad36cbb9369 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | | Add conversion between Q_ENUMs and strings in QVariantOlivier Goffart2015-02-151-3/+71
| | | | | | | | | | | | | | | Change-Id: I9264a68d162cf20db0167dd3f976a007477786d1 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | | Updated BSD licensed file headersJani Heikkinen2015-02-15143-424/+424
| | | | | | | | | | | | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Optimize the Latin1 conversion code in the JSON parser with SSE2Thiago Macieira2015-02-151-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | This also reduces the number of variables modified in each loop from two (l and i) to one (just i) and avoids calling str.length() all the time. Those should be no-op changes, but why not help the optimizer? Change-Id: I8895c35f84d545dba45bffff13bc4147ae53eaab Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Animation classes: micro-optimize loops.Friedemann Kleint2015-02-143-39/+40
| | | | | | | | | | | | | | | | | | | | | | | | Don't use index-based iteration, but use iterators assigning end() to a variable. Change-Id: Ia87532349855fa3baa748b62224fc8adf3395dc0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QDateTime: make qt_monthNumberFromShortName() staticMarc Mutz2015-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It wasn't Q_DECL_EXPORT'ed, and there is no other user in QtCore. Effects on Linux GCC 4.9 stripped release builds: text -344B data +-0B relocs +-0 Change-Id: Iea0577d58057a145f87a00ec33995d03bacd4f88 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QDateTime: use existing functions for short month name parsingMarc Mutz2015-02-141-35/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...instead of rolling a new one on each use. Effects on Linux GCC 4.9 stripped release builds: text -156B data +-0B relocs +-0 Change-Id: I49e20ea859928d010990fc7a22545dbc1ef106ec Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QDateTimePrivate: enable read caching on m_status in setDateTime()Marc Mutz2015-02-141-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Help the compiler by building the new status flags in a local instead of a member variable. Enables value tracking for that piece of data across several non-inline function calls, leading to less redundant reads through this->. Effects on Linux GCC 4.9 stripped release builds: text -248B data +-0B relocs +-0 Change-Id: I2db21439464ad0fff8163a908de3b15df7c4ab6d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | QDateTime: pass explicit length to QLatin1String ctorMarc Mutz2015-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, determining that constant at compile time is a bit too much work for GCC. Effects on Linux GCC 4.9 stripped release builds: text -276B data +-0B relocs +-0 Change-Id: I23144e64d57e3a2e1061e69b20f2b72575c273d8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QDateTime: avoid relocationsMarc Mutz2015-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The short month names all have length 3, so store them in a multi- dimensional const char array instead of as a pointer table. Effects on Linux GCC 4.9 stripped release builds: text -196B data -64B relocs -12 (est., somehow relinfo.pl reports nonsense on QtCore) Change-Id: If5f83e4f1eb5ba0b0f54b4144abec8b88fb8529f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Haiku: Implement QStorageInfo for HaikuTobias Koenig2015-02-141-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use Haiku's BVolumeRoster API to provide information about available mount points in QStorageInfo. Change-Id: I058bbb5f3f33372edc55d3e51079d3e16815f29f Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QMetaType: improve docs and commentsOlivier Goffart2015-02-142-3/+6
| | | | | | | | | | | | | | | Change-Id: I7bcc8cec95eb5abda75d936732b1113b943622dc Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Document Q_GADGETOlivier Goffart2015-02-131-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore] Classes with the Q_GADGET function can now have properties and invokable methods. QMetaMethod and QMetaProperty have new overloads that can be used with a pointer to a gadget. The QMetaType system also gained knowledge of types with the Q_GADGET macro Change-Id: I017475f3809181c64fdd66f899e461ad27f5ae47 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-1310-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | ...where passing them by value was not intentional. Change-Id: Ifd5036d57b41fddeeacfbd3f5890881605b80647 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QUrl effective TLDs: update tablePeter Hartmann2015-02-132-9565/+11345
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are more than 1000 new entries since the table has been generated the last time. Some auto tests needed to be adjusted, because some entries in the TLD table were removed while others were added. Change-Id: I4ceec392836d2031dfef49a0c5a857c31b36bb4c Reviewed-by: Richard J. Moore <rich@kde.org>
* | | Improve conversion of QVariants with QJsonValuesAllan Sandfeld Jensen2015-02-121-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | Adds conversion from QJsonArray and QJsonObject, and report missing conversion failures for other QJsonValues. Change-Id: Ic0c3a952657912401db877b068f7fcc3c08c94c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QTextCodec: micro-optimize loops.Friedemann Kleint2015-02-122-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | Don't use index-based iteration, but use iterators. Change-Id: If8dabd56ff880191bb53861e31bfa6a007802c9c Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDateTime: prepare for constexpr'ificationMarc Mutz2015-02-121-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure from{JulianDay,MSecsSinceStartOfDay}() are in a constexpr'able form by introducing new private ctors that allow formulating these functions as single expressions. Change-Id: Iee98edb74e63c32e98781b885bbb2c5ef5867fd9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QtCore: assorted migrations to QString::asprintfMarc Mutz2015-02-122-7/+3
| | | | | | | | | | | | | | | Change-Id: Ie99d3eeeced89dd8336717954fd5ca7117bb20b4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QCoreApplication (Windows): migrate to QString::(v)asprintfMarc Mutz2015-02-121-25/+24
| | | | | | | | | | | | | | | Change-Id: I9628a96eee9b6afd7532ac65d61054d1117335ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QLogging: use return-by-value in qt_messageMarc Mutz2015-02-121-40/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also enables NRVO in almost all callers (a macro prevents it in one case), saving one default construction and one (move) assignment per call. Effects on Linux GCC 4.9 stripped release builds: text -896B data +-0B relocs +-0 Change-Id: Id3cde01057baaa408c4cbf95d8d15eaeeeec1604 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QtMiscUtils: make toHex*() constexprMarc Mutz2015-02-121-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bring them into a constexpr'able form, by indexing into the string literal directly instead of into a static const char[], which is a declaration not allowed in a C++11 constexpr function, then mark the functions constexpr. Change-Id: I6b32a55bf24f85caeb980c0c855b8db0952f914c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Avoid hardcoding build date in qtcore and toolsSune Vuorela2015-02-122-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To ensure QtCore can be rebuilt and get the exact same results, it is undesirable to hardcode the build date into the library Also deprecate QLibrayInfo::buildDate since it is relies on the build date. QLibraryInfo::buildDate was originally meant for evaluation licenses and such, but isn't used for that any longer. Change-Id: I98e91ca3e55f877e6ac0e02de289dc29422fc9da Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | | Haiku: Enable usage of realpath implementationTobias Koenig2015-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Haiku supports the realpath implementation, but failed the original #if check because of the wrong _POSIX_VERSION. Change-Id: Ibad12de3bf7c1031b2dff3026b5c61e5afd3f3e6 Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Haiku: Use setenv and unsetenv POSIX functionsTobias Koenig2015-02-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The _POSIX_VERSION declared in Haiku is 199009L, so we have to enable support for setenv/unsetenv explicitly until Haiku POSIX version is updated. Change-Id: Ic22374253b0512a6a816257db83b0c649be0585d Reviewed-by: Augustin Cavalier <waddlesplash@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Expose TabFocusBehavior in QStyleHintsLiang Qi2015-02-122-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TabAllWidgets in QPlatformTheme is replaced by TabFocusBehavior. [ChangeLog][QtGui] Expose TabFocusBehavior in QStyleHints Change-Id: Iafaad7c6a5c6bc888d1e124e6ddcdbdc46f37b1c Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | | qtimezone.h: include correct headerMarc Mutz2015-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | QSharedDataPointer is declared in qshareddata.h, not qsharedpointer.h Change-Id: I4702f346ae01a8de07a6a9b50f951d2d4a89e1fb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QNX: fix compiler detection.Rafael Roquetto2015-02-121-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Short version: fix build on QNX 6.5.0. C++11 has been included on QNX 6.6.0's libcpp (Dinkum C++11 libs), while continuing to be unsupported by the older QNX 6.5.0 toolchain. This patch updates the mechanism for detecting the QNX's libcpp that is being used during compile time, and also updates the list of C++11 features to be disabled when QNX C++11 support is not present by adding Q_COMPILER_UNICODE_STRINGS and Q_COMPILER_NOEXCEPT to it. Change-Id: Iddb3626206a0d97d7103c1ff17ba0ae953e9a4b9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QProcess: remove a use of QString::sprintf()Marc Mutz2015-02-121-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | Instead of using QString::sprintf() (and converting the result back to QByteArray), simply do the conversion from uchar to octal digits ourselves, using QtMiscTools. Change-Id: I452c085b717c71609cd1a9465e31d90e6a0ba54b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QTzTimeZonePrivate: replace an inefficient QList with QVector (IV)Marc Mutz2015-02-121-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QTimeZonePrivate::Data type is larger than void*, so holding them in QLists is horribly inefficient. In addition, this type is held elsewhere in QVector, so do that here, too. As well as being faster, also saves 1.3K of text size on optimized AMD64 builds. Change-Id: I1ecf3ee0d955f6b19d2269204e2febc2ba2a9d9d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QTzTimeZonePrivate: replace an inefficient QList with QVector (III)Marc Mutz2015-02-121-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation-private QTzType type is larger than void*, so holding them in QLists is horribly inefficient. Fix by holding it in QVector instead (it was already marked as a primitive type before). Text size grows by ca. 0.5K, but of course we got rid of all those pesky heap allocations. Change-Id: I3b70ed36fa9947b695ffc87c6f6199daa13cb7cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QTzTimeZonePrivate: replace an inefficient QList with QVector (II)Marc Mutz2015-02-121-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation-private QTzTransition type is larger than void*, so holding them in QLists is horribly inefficient. Fix by declaring it as a primitive types (it just contains various integers) and holding it in QVector instead. Also optimize parseTzTransitions() by preallocating the expected number of transitions and streaming directly into the container, resizing to the number of successful read items on error. Saves roughly 0.5K in text size, too. Change-Id: Iadec7a7b0721893e477e1778c9fb54afd6e49544 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QTzTimeZonePrivate: replace some inefficient QLists with QVectors (I)Marc Mutz2015-02-121-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both QTzTransitionTime and QTzTransitionRule are larger than void*, so holding them in QLists is horribly inefficient. Fix by declaring them as primitive types (they just contains various integers) and holding them in QVector instead. While we're at it, make the equality operator for QTzTransitionRule a constexpr, noexcept non-member, and provide the inequality operator, too. As well as being faster, this also saves 1.5K of text size on optimized AMD64 builds. Change-Id: I37100522f19556101c334625818dcf8c9a712dd9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Add Q_DECL_CONST_FUNCTION and Q_DECL_NOTHROW to qPopulationCountMarc Mutz2015-02-121-5/+5
| | | | | | | | | | | | | | | Change-Id: I7602936b7064d6a87cd9fbfc4ab22a8fc881b9e9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QString: optimize number() and setNum()Marc Mutz2015-02-121-63/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, number() was implemented in terms of setNum(). That makes no sense whatsoever. It creates a temporary value which requires the function to have an exception table and an unwinding trampoline. It also introduces a default constructor (in number()) and a copy assignment (in setNum()), which breaks the chain of RVOs originating in the QLocaleData functions. Instead, implement setNum() in terms of number(). This makes setNum() such a premature pessimisation that it's probably best to deprecate it in the near future. There are not many users of it in qtbase left, and it just pollutes the QString interface. Effects on Linux GCC 4.9 stripped release builds: text -708B data +-0B relocs +-0 Change-Id: I015c9ddb1ba9c98c2c55e38e54ef7894954ac4ca Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | QLogging: prevent qt_message from being inlined into each of 14 callersMarc Mutz2015-02-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Effects on Linux GCC 4.9 stripped release builds: text -2024B data +-0B relocs +-0 Change-Id: I1a315eb0f94ade2b40be62770c6ddcfc56da9ec0 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QLogging: avoid a needless checkMarc Mutz2015-02-121-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QString::vasprintf() deals just fine with a nullptr format string, so don't check manually. The main advantage of dropping the check is that in two of three cases, we can replace assignment with initialization, thus saving one default ctor and one (move) assignment. Change-Id: I08dd24111cd0b92f21ef9f1c3e352ede0f66afe0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QLogging: migrate to QString::(v)asprintfMarc Mutz2015-02-121-5/+5
| | | | | | | | | | | | | | | Change-Id: I63141c258c9409b03ce23cd77b90c4e4bc3487ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>