summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* QDateTime: change an instance of out parameters to return-by-valueMarc Mutz2015-02-171-52/+48
| | | | | | | | | | | | Compilers don't like out parameters. Effects on Linux GCC 4.9 stripped release builds: text -528B data +-0B relocs +-0 Change-Id: I32ee1a6c4388900bacfc6eb20feb4b81d71cb1f2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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>
* Use C++ <cmath> instead of <math.h>Allan Sandfeld Jensen2015-02-161-7/+7
| | | | | | | | | | | | | | 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>
* 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>
* Updated BSD licensed file headersJani Heikkinen2015-02-151-1/+1
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.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>
* Pass params of shareable type by const-ref rather than by valueKonstantin Ritt2015-02-131-1/+1
| | | | | | | | ...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>
* 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>
* 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>
* 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>
* 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>
* Long live QString::asprintf()!Marc Mutz2015-02-123-17/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | asprintf() is a GNU extension that prints into a string it allocates internally. Arguably, that's a better name for QString::sprintf() since it also allocates memory internally. The main problem with QString::sprintf() isn't that it's dangerous to use (it is), but that it's not static. It also returns a reference instead of by-value, breaking RVO. There is a comment about removing this function completely in Qt 6.0, but it remains the only printf-style function in Qt that can allocate the target string, so it's vital for logging, e.g., and the recommended replacement code (http://linux.die.net/man/3/vsnprintf) is a nightmare. So this patch adds static (v)asprintf() methods to replace it. Further patches will fix up all in-tree callers and finally deprecate the old (v)sprintf(). Test coverage is provided through the existing tests of sprintf(), which is implemented in terms of asprintf(). Arguably, the in-tree callers show that QByteArray would benefit from having an asprintf(), too, as most of the in-tree code works around its lack with calls to to{Latin1,Local8Bit}() after using the QString version. [ChangeLog][QtCore][QString] Added asprintf(), vasprintf(). Change-Id: I8510f8d67c22230653ec0f1c252c01bc95f3c386 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtMiscUtils: add to/fromOctMarc Mutz2015-02-121-0/+10
| | | | | | | ...mirroring to/fromHex. Change-Id: Ie06bd3cc636b0afbc97606eadb8980079a7677a3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtMiscUtils: mark hex functions noexcept and fromHex constexprMarc Mutz2015-02-121-10/+7
| | | | | Change-Id: Ia5b63afa88a87ec995d76d48ac6c185168773369 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-11158-1240/+1152
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/devLaszlo Agocs2015-02-103-2/+6
|\
| * Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-103-2/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| | * Fix QLineF Detailed DescriptionSamuel Gaist2015-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently angle() is used in place of angleTo() to describe the difference with intersect. This patch fixes that. Task-number: QTBUG-44309 Change-Id: Idfc521932247f76fe15fd980ff8e87e52feec1f1 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
| | * QPair: work around std::move not being constexpr in C++11Marc Mutz2015-02-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a static_cast instead. This is not 100% equivalent, since it's missing remove_reference<>, which we don't want to depend on and whose emulation in qtypetraits.h is missing rvalue support. That will be fixed in dev. Change-Id: Ib03754c81c904932943d3a5415b54ff107f4719d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix QSharedPointer::create and QEnableSharedFromThisThiago Macieira2015-01-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | We forgot to initialize the tracker if create() was used. Task-number: QTBUG-43696 Change-Id: Ic5d393bfd36e48a193fcffff13b740931ff2204b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QtCore: Use QDebugStateSaver in (almost) all QDebug operator<<Kai Koehne2015-02-099-21/+36
|/ / | | | | | | | | | | | | | | | | Unify the behavior of the different operator<< by always using QDebugStateSaver (appending an optional space at exit), and making sure that the space(), nospace() setting isn't 'leaked'. Change-Id: I38e4f82fa6f7419d8b5edfc4dc37495af497e8ac Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Remove unnecessary math.h and limits.h includesAllan Sandfeld Jensen2015-02-041-2/+0
| | | | | | | | | | Change-Id: I28c898f869ed3f03b08ff55f2972a38667c755ad Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Use Q_ENUM and Q_FLAG for types in QtCoreOlivier Goffart2015-02-042-4/+5
| | | | | | | | | | | | Change-Id: I33590a9c4c6d87c5bbba1d201e32c6bf1bd3e00b Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix 1700 override warnings [-Winconsistent-missing-override]Sérgio Martins2015-02-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | Classes should either use or not use override, otherwise it hurts code readability. Some inline keywords were removed because of an error with MSVC2010: error C2216: 'override' cannot be used with 'inline' Change-Id: I7276d5525a92281bd0d743beb11d0dc73441443b Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Centralize use of __attribute__((noinline))Marc Mutz2015-01-292-11/+3
| | | | | | | | | | | | | | | | | | | | There are currently only two users, but I have patches in the pipeline which mark some other function noinline, so proavtively centralize the ifdef'ery involved. Change-Id: I1f02351fdc903d4e026089e12b8a976ed6a8d603 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QString: optimize multiArg()Marc Mutz2015-01-291-18/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function used a QMap<int,int> to map the %n's to the index in the args array. By way of construction, the key was sorted in ascending order while the values, initially all -1, were later reassigned to be 0...map.size()-1, ie. std::iota(). The only information this data structure stores is therefore the sorted %n's. For that, a sorted vector is a vastly superior data structure. Go one step further and use QVarLengthArray to avoid allocating any memory for the common case of just a few placeholders. As an artifact of the underlying refactoring, the management of that data structure has been moved to a separate class, ArgMapper. Runtime for the following test from tst_qstring: QString str("%1 %2 %3 %4 %5 %6 %7 %8 %9 foo %10 %11 bar"); // not timed str = str.arg("one", "2", "3", "4", "5", "6", "7", "8", "9"); str = str.arg("ahoy", "there"); went down from 2.2us to 1.5us. Change-Id: Ic552615fbac646b78ba05eb4e3215e63d202fd94 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QString: reduce template bloatMarc Mutz2015-01-291-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce the number of (non-regex) splitString instantiations from six to two by: - Passing separators by (const QChar*, int) and using qFindString() instead of indexOf() - Passing QString as QStringRef when the output is QVector<QStringRef>. Doing so also allows to drop the MidMethod template parameter since QString::midRef() is no longer being used. (Somewhat disappointing) effects on Linux GCC 4.9 stripped release builds: text -500B data +-0B relocs +-0 Change-Id: Id89e2814d5f7da5170181d863167517943c2e0cd Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove support for QT_QLOCALE_USES_FCVT.Erik Verbruggen2015-01-282-78/+0
| | | | | | | | | | | | | | We expect floating-point math to be IEEE754 compliant. Change-Id: I2b257177f2ef5fce38ac4d8fd76f746dc7b9fc15 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add conversion functions for C++11 u16string and u32stringAllan Sandfeld Jensen2015-01-242-4/+70
| | | | | | | | | | | | | | | | | | | | | | The patch adds convenience functions for working on C++11's new char width specific unicode strings u16string and u32string. [ChangeLog][QtCore][QString] Added methods for convenient conversion to and from std::u16string and std::u32string. Change-Id: I67c082e4755c592d61daaaaa70c8867ef0b23dcb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | src/corelib/tools/tools.pri: add missing qtools_p.hMarc Mutz2015-01-241-0/+1
| | | | | | | | | | Change-Id: If7af29fdaefddc1e3f08148610ba2720f5927b67 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QtCore: add some more Q_DECL_NOTHROWMarc Mutz2015-01-214-10/+10
| | | | | | | | | | | | | | | | | | | | | | QtCore now builds with no -Wnoexcept warnings (that doesn't mean there aren't tons of functions that should be marked noexcept, just that all conditionally noexcept functions aren't noexcept(false) just because of a forgotten noexcept elsewhere). Change-Id: I10dacb6b9c9d41d3595fe2f306356d62d3d91c76 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-01-217-25/+33
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/global.pri src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.h src/corelib/tools/qdatetime.cpp src/plugins/platforms/xcb/qxcbscreen.h src/plugins/platforms/xcb/qxcbwindow.h src/widgets/dialogs/qcolordialog.cpp src/widgets/dialogs/qcolordialog_p.h tools/configure/configureapp.cpp Change-Id: Ie9d6e9df13e570da0a90a67745a0d05f46c532af
| * Doc: Fix typosSze Howe Koh2015-01-192-2/+2
| | | | | | | | | | Change-Id: I29d5576902a5d1ea25558e980081952d9157f7f0 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| * QFreeList: fix undefined behaviorMarc Mutz2015-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed integer overflow is undefined behavior ([expr]/4), but unsigned arithmetic doesn't overflow, so isn't ([basic.fundamental]/4, footnote there). So, use unsigned arithmetic for the loop-around serial number generation in incrementserial(). While we're at it, also use it for the masking operation in the same function. Found by UBSan. Change-Id: I500fae9d80fd3f6e39d06e79a53d271b82ea8df8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QByteArrayMatcher: fix undefined shiftMarc Mutz2015-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The REHASH macro is used in qFindByteArray() with a char argument. Applying the shift operator promotes (a) to int. The check in REHASH, however, checks for the shift being permissible for _unsigned_ ints. Since hashHaystack is a uint, too, rectify by casting (a) to uint prior to shifting. Found by UBSan: src/corelib/tools/qbytearraymatcher.cpp:314:72: runtime error: left shift of 34 by 30 places cannot be represented in type 'int' Change-Id: Id09c037d570ca70b49f87ad22bed31bbb7dcc7fb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Doc: define target voor function qsnprintf()Nico Vertriest2015-01-161-0/+1
| | | | | | | | | | | | Task-number: QTBUG-43537 Change-Id: I76c511891a1a07eca77da399d23097e76047f824 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * Update doc saying QDateTime::setTime with invalid time sets to midnightThiago Macieira2015-01-151-3/+10
| | | | | | | | | | | | | | | | | | QDateTimePrivate::setDateTime has a comment saying this is intentional, so document it. Task-number: QTBUG-43704 Change-Id: Ic5d393bfd36e48a193fcffff13b965409eaf7be9 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * fix error when cross-compiling with --system-zlibAshish Kulkarni2015-01-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is broken since 1f461ac45bfa8887261510a95fb33a346d68eaba, where Z_PREFIX was defined to namespace the bundled zlib symbols. The bundled zlib is used by bootstrap.pro when cross-compiling which uses the namespaced symbols. This breaks linking of rcc when --system-zlib is used, as it will try to link to compress2 instead of z_compress2. To fix this, the aliases are pulled in via zconf.h and the bundled zlib is prepended to the INCLUDEPATH (i.e. before the system zlib). Change-Id: Iec76cbdead40f888e2ac6a887ec8f3b7bc7db501 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * Doc: Fixed date format doc bug in QDateTime/Qt namespaceOrgad Shaneh2015-01-061-12/+12
| | | | | | | | | | | | | | | | | | | | MM stands for month, SS is invalid mostly cherry picked from Qt4 commit 670f460fab6a386407c07281cf6417ccf6430970. Task-number: QTBUG-12236 Change-Id: I7af4be655d2d10f1befa1366abb48225c60d31dc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>