summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* QVector: prevent resize() from shedding capacityMarc Mutz2015-11-282-3/+3
| | | | | | | | | | | | | | ...even if reserve() hasn't been called before. [ChangeLog][QtCore][QVector] resize() will no longer shrink the capacity. That means resize(0) now reliably preserves capacity(). Task-number: QTBUG-39293 Done-with: Robin Burchell <robin.burchell@viroteck.net> Change-Id: Ie7e4e597126832990b6cfb83bba875c3963b143e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Detect NEON on AArch64Allan Sandfeld Jensen2015-11-261-1/+5
| | | | | | | | | | | | The __ARM_NEON is the standard define for NEON instructions support __ARM_NEON__ is only legacy, and specifically not defined in AArch64 builds, which causes us not to detect NEON support there. The NEON assembler files doesn't build with AArch64, so the NEON drawhelper methods must be excluded for now. Change-Id: Ie32f855bde94ee7efd8a8ddb7766c931778e729b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Fix deadlock when setting environment variables."Oliver Wolff2015-11-241-15/+0
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 5b62a5e7aabcc818408f2fe28b9760082f474def. This commit is reverted due to two reasons: 1) It was written incorrectly and does not work as is. The ifdefs should be ifndefs. In its current state, it does the exact opposite of what it is supposed to be doing. 2) There is another environment access inside qsimd.cpp (which checks QT_NO_CPU_FEATURE). This access causes the app to hang. All in all that approach is not sustainable as we might get bitten by environment access again and again. Instead we should use another environment container or use a recursive mutex for WinRT and Windows CE. Task-number: QTBUG-49529 Change-Id: Iaca76404dc1023551a7c25489a609681135765fd Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
* Fix deadlock when setting environment variables.Samuel Nevala2015-11-231-0/+15
| | | | | | | | | | | | | | | | Qt uses QHash as the container for faking environment variables on Windows Runtime and CE. Environment variable manipulation functions are protected by mutex. Accessing the QT_HASH_SEED environment variable inside QHash can lead to situation where qputenv() call leads to qgetenv() call and that leads to a deadlock. Since the application environment is faked anyway, drop support for QT_HASH_SEED and ifdef that functionality out on those platforms. Documentation is updated to reflect changes. Task-number: QTBUG-49529 Change-Id: I1b1c28cb0b041fe2a63ca3dce57068fcb46505a7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Merge Languages and ManifestLanguages for QLocale::uiLanguagesOliver Wolff2015-11-191-7/+41
| | | | | | | Task-number: QTBUG-48140 Change-Id: I904ad48e7bc48867a362e3f6c5ca1516e55ed872 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* Fix build with OS X 10.8 SDKThiago Macieira2015-11-181-1/+1
| | | | | | | | | The ffsll function is missing with that SDK, but Clang and GCC support it as the builtin. Change-Id: I9f4d900898814b569c1affff140e15fb59fb45d8 Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch> Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* QString: Fix in-place toUpper/Lower when there's size expansionThiago Macieira2015-11-182-4/+44
| | | | | | | | | | When that happens, we need to detach (in-place conversion won't work), so we recurse back into the same function, but the template version that does detaching. Task-number: QTBUG-49181 Change-Id: Idba8c29717f34c70a58fffff1412fea3acc95f98 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* make a proper header-only module for QtZlibOswald Buddenhagen2015-11-171-4/+0
| | | | | | | | | | that way other modules can use the headers without hacks. this required making the base directory for paths in headers.pri configurable in syncqt. Change-Id: Id35cfe05bcf4c576d3f2d0d8d09590a5e23d21d3 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* QChar: Simplify case convertion code with template magicKonstantin Ritt2015-11-161-51/+21
| | | | | | | Same as in QString, though simpler a bit due to fixed-length sequence. Change-Id: Idd6670a7b6415f5d515987c30931d16b73dd280e Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Move CasexTraits from qstring.cpp to qunicodetables_p.hKonstantin Ritt2015-11-162-24/+32
| | | | | | | | and implement TitlecaseTraits as well, to be re-used in the following commit. Change-Id: I5c0bff42fe3b9bc9c2454cc16916cc2be87f604f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QUnicodeTables generator: Minor clean-up & stricter checksKonstantin Ritt2015-11-131-17/+15
| | | | | | | | | | Use static_cast instead of C-style cast; ushort -> unsigned short; Avoid a lvalue in qGetProp(); Minor styling fixes. Change-Id: Ic6412e28ac9316a587d32d0e674d21f672967fd6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Prefer "daylight-saving time" and "DST" over "daylight time".Edward Welbourne2015-11-125-86/+84
| | | | | | | | | | | The first two are the "proper" terms; the last is a colloquialism. Also amended "daylight savings" (which summons to mind a hybrid of "daylight robbery" and "bargain-basket savings"). Improved related wording in many of the places amended. Task-number: QTBUG-49308 Change-Id: I726f18a344b2fe37f765a14684d1447c8b7ab00c Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Eliminate duplicate "between"Edward Welbourne2015-11-121-2/+3
| | | | | Change-Id: I548e2df4cb94e41bb5247fc6977a3c3f67bf0bda Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fix false claim in comment.Edward Welbourne2015-11-061-1/+1
| | | | | | | | | | Given that % and / have a defined consistency relation, neither is any better defined for -ve operands than the other. The code is in fact avoiding using -ve operands, not preferring "well-defined" / over (allegedly less so) %, as it claimed. Change-Id: I666690872f078c0f21f9af7a227c2bbf291704e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark qt_from_latin1() as nothrowMarc Mutz2015-11-051-1/+1
| | | | | | | | | | | | | | It's used from a different TU, too, so we can't rely on the compiler to inspect it to draw this conclusion itself. This function has technically not a wide contract, because the output buffer needs to be large enough to hold the result. However, this precondition cannot be checked from within the function, therefore no assertion can ever be added and the nothrow marker becomes acceptable (even desireable). Change-Id: I2dc6c4f3d9d8147c6483865c5c4bbc8e9af291b7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Re-generate Unicode data tablesKonstantin Ritt2015-11-052-5115/+5891
| | | | | Change-Id: I53fb254709764e56e9889531655fe6046f15b251 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update Unicode data & algorithms up to v8.0Konstantin Ritt2015-11-053-26/+55
| | | | | | | | | | | | | | | | | | | * Georgian lari currency symbol * A large collection of CJK unified ideographs * Emoji symbols and symbol modifiers * Letters to support the Ik language in Uganda, Kulango in the Côte d’Ivoire, and other languages of Africa * A set of lowercase Cherokee syllables, forming case pairs with the existing Cherokee characters * The Ahom script for support of the Tai Ahom language in India * Arabic letters to support Arwi—the Tamil language written in the Arabic script For more details, see http://www.unicode.org/versions/Unicode8.0.0/ [ChangeLog][QtCore] Unicode data updated to v.8.0 Change-Id: If255f95c9c45655b721369a116299da3cabbba0a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* [docs] QVector: don't scare people away from reserve()Marc Mutz2015-11-041-9/+18
| | | | | | | | | | reserve() is a good thing, and key to getting top performance out of any data structure that provides them, yet the existing docs scared people away by claiming that "you will rarely ever need to call this function". Change-Id: I88e30d96960443c0ed759a79c6fa9ee6af0d1e07 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Doc: fixed broken linksNico Vertriest2015-11-041-2/+2
| | | | | | Task-number: QTBUG-43810 Change-Id: If6ac30a0407731b31e8aaad28d33e2bb49dee6f3 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Make variable const as it should beEdward Welbourne2015-11-041-1/+1
| | | | | Change-Id: If5782473eceaa38de75b25d1da247dea9fe135da Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Use memset to clear struct tm before filling fields.Edward Welbourne2015-11-041-2/+2
| | | | | | | | This ensures any non-standard fields (e.g. glibc's tm_gmtoff) are clear, as well as the other fields mktime overtly promises to ignore. Change-Id: I45d69eff7b5cb37ab910bf3d4d2d1481fd93aedb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Doc: Fix snippet tags for QString::[last]indexOf() overloadsTopi Reinio2015-11-021-2/+2
| | | | | | | | | Duplicate identifiers were introduced for QString code snippets, resulting in the wrong snippets to be quoted. Change-Id: I75e9c99cbc73bf39262079f7f53342a6ac90c2a7 Task-number: QTBUG-49111 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* QLocale: Actually get the language script for the system localeThiago Macieira2015-10-281-2/+3
| | | | | | | | | | | | | | | The Windows code was always returning AnyScript, which in turn made QLocale::textDirection() for the default and system locales always return LTR, even if the Windows UI was in RTL mode. [ChangeLog][QtCore][QLocale] Fixed a bug that caused QLocale::textDirection() to always return Qt::LeftToRight and QLocale::script() to return QLocale::AnyScript on for the Windows system locale. Task-number: QTBUG-49031 Change-Id: I7e6338336dd6468ead24ffff14112c8d348eedba Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QLocale: Add Q_ENUM for QLocale::ScriptThiago Macieira2015-10-281-0/+1
| | | | | Change-Id: I7e6338336dd6468ead24ffff141129d557330f00 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Compile the 64-bit version of some code on all 64-bit processorsThiago Macieira2015-10-231-1/+1
| | | | | | | This is true for ILP32 on x86-64, IA-64 and AArch64. Change-Id: I1d0f78915b5942aab07cffff140f9d4c277bb5d4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Several cases of s/decelerating from/decelerating to/.Edward Welbourne2015-10-211-4/+4
| | | | | | | | | The relevant easing curves all start out fast and end stationery; so it's at the *end* that they attain zero "velocity", so they're decelerating *to* zero, not from it. Change-Id: I69874c46c8d42f185ff815295c4470a195cc43ae Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* QLatin1String: add some nothrowMarc Mutz2015-10-201-24/+24
| | | | | Change-Id: I488fe7c4122febf46caa6487d92f61391edd41a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* [docs] QLatin1String: add some guidance as to when to use itMarc Mutz2015-10-201-0/+7
| | | | | | | Change-Id: I391be8bda3a5cb4873b89b437d2b76b1cd88261f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* QLatin1String: add default ctorMarc Mutz2015-10-202-0/+7
| | | | | | | | | | A pending change in uic depends on this. [ChangeLog][QtCore][QLatin1String] Added default constructor. Change-Id: Ie6f5dfc7b38683a488b0ff7f31404800ef5ee188 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLatin1String: add testMarc Mutz2015-10-191-5/+1
| | | | | | | | QLatin1String wasn't really tested except as a drive-by. Unearthed a discrepancy with docs. Fixed the docs. Change-Id: I1246bb33888132edbc4e22da792a480a156357bf Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* The C locale should omit group separators by defaultLars Knoll2015-10-191-2/+3
| | | | | | | | | | | | | Numbers formatted in the C locale should not use group separators by default. [ChangeLog][QtCore][QLocale] The C locale does not use group separators when formatting numbers any more. Task-number: QTBUG-4044 Task-number: QTBUG-3068 Change-Id: Ia647a72efc11fecd66d22f9253562b1d4ef58168 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix left-shift wider than an int's widthThiago Macieira2015-10-161-1/+1
| | | | | | | | The other left shifts in this file already have the Q_UINT64_C wrapper. This one was missed. Change-Id: I42e7ef1a481840699a8dffff140d758ac370c402 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QLinkedList/QSet: add {const_,}reverse_iterator, {c,}r{begin,end}()Marc Mutz2015-10-134-12/+192
| | | | | | | | | | | | | | | | | | | | | | Now all Qt sequential containers consistently provide reverse iterators. The associative ones, by way of not returning std::pair from op*, can't just use std::reverse_iterator. They would miss .key() and .value() methods. So that has to wait for 5.7. The reverse versions of the new key_iterators can also just use std::reverse_iterator, but I'm afraid that after bikeshedding over keyRBegin() vs. rKeyBegin() vs. reverseKeyBegin() vs. rkbegin() vs. krbegin() (<-- of course, what else?), it would anyway be too late for 5.6, so defer, too. [ChangeLog][QtCore][QLinkedList/QSet] Added rbegin(), crbegin(), rend(), crend(), and reverse_iterator and const_reverse_iterator typedefs. Task-number: QTBUG-25919 Change-Id: I58316fffade469e9a42c61d7aa1455ae3443fd94 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Libraries: Fix single-character string literals.Friedemann Kleint2015-10-131-5/+5
| | | | | | | Use character literals where applicable. Change-Id: I8e198774c2247c1cc1d852a41b59b301199b7878 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QtCore: Don't compare QChars to literal 0sMarc Mutz2015-10-111-1/+1
| | | | | | | | | | This is prone to ambiguities, even though we currently don't run into them. Use QChar::isNull() instead. Change-Id: I71843878b3f4f8a5deae2ef57a6f6628461be216 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix \sinceLars Knoll2015-10-081-2/+2
| | | | | | | This API only appeared in 5.6. Change-Id: I3ddda44f7c55c94c7f22f76f83a45094209d8c39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make container move semantics consistentMarc Mutz2015-10-078-20/+22
| | | | | | | | | | | | | | | Make all containers (excepting QVarLengthArray) - nothrow default-constructible - nothrow move-constructible - nothrow move-assignable - nothrow swappable [ChangeLog][QtCore] All containers (with the exception of QVarLengthArray, but including QSharedPointer) are now nothrow_default_constructible, nothrow_move_constructible, nothrow_move_assignable, and nothrow-swappable. Change-Id: I12138d262f9f7f600f0e1218137da208c12e7c0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMulti(Map|Hash): add move ctor from Q(Map|Hash)Marc Mutz2015-10-072-0/+6
| | | | | | | There was a copy ctor, a move ctor was missing. Change-Id: If09a4d4c74682169759eff43b298f6c77702c169 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* doc: fix a typo in QVersionNumber docsMarc Mutz2015-10-071-1/+1
| | | | | | Change-Id: I6ba901efe0822ed1d5ae8359f8b7aefe730f2d06 Reviewed-by: Keith Gardner <kreios4004@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-023-6/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * Fix comparisons between QByteArray and QString.Christian Kandeler2015-09-281-4/+4
| | | | | | | | | | | | | | | | QByteArray::operator< and friends had their logic reversed. Task-number: QTBUG-48350 Change-Id: I625209cc922b47e78dfb8de9fe100411f285a628 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QDateTime: Ensure a valid timezone when using the "offset constructor".Christian Kandeler2015-09-231-0/+1
| | | | | | | | | | | | | | | | The timeZone() function used to assert when called on such an object (or, for a release build, return an invalid time zone). Change-Id: I6ae8316b2ad76f1f868e2498f7ce8aa3fcabf4a6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QString perf improvement : removal of useless testJulien Blanc2015-08-261-2/+0
| | | | | | | | | | | | | | | | | | Removed a test in QStringAlgorithms trimmed_helper. That test is not needed because both null / empty QStrings are already handled by the previous test, other cases are handled just fine by the general case. Change-Id: I26db1142a656a7d06dfdd6b3b8f8a3ee6ca22302 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Revert "Add support for same-file intrinsics with Clang 3.7"Thiago Macieira2015-10-011-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 39c2b8c5c12dfb8560fa04ce346a129adb223e29. The feature is not working: $ clang -c -o /dev/null -msse2 -include tmmintrin.h -xc /dev/null In file included from <built-in>:316: In file included from <command line>:1: /home/thiago/clang3.7/bin/../lib/clang/3.7.0/include/tmmintrin.h:28:2: error: "SSSE3 instruction set not enabled" For reference: $ icpc -c -o /dev/null -msse2 -include tmmintrin.h -xc /dev/null; echo $? 0 $ gcc -c -o /dev/null -msse2 -include tmmintrin.h -xc /dev/null; echo $? 0 Change-Id: I42e7ef1a481840699a8dffff140844cb8872ed6e Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | QLocale: remove (harmless) dead codeThiago Macieira2015-10-011-6/+6
| | | | | | | | | | | | | | | | | | | | On line 92 and on line 146, len == 2 or len == 3, so uc1 and uc2 cannot be 0, ever. Found by Coverity, CID 11013 and CID 11012. Change-Id: I42e7ef1a481840699a8dffff1407edefd3e7aa4f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Purge extraneous execute permissions.Edward Welbourne2015-09-301-0/+0
| | | | | | | | | | | | | | | | | | Source files should not be executable. Change-Id: If9b9eaa6c8c7348ca6f48fa9253f3540e95aca37 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Fix sign-extensionThiago Macieira2015-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If data[0] were > 128 (that is, if the full size, encoded in big endian were > 2 GB), the result of the OR chain would be a negative int (due to C integer promotion rules). We're shifting into the sign bit, which is either implementation-defined behavior or, worse, undefined behavior. This negative number is then sign-extended to ulong (64-bit on 64-bit platforms), which then becomes a big number. This code was probably written with only 32-bit in mind, where there would be no size extension (sign or otherwise). This isn't too bad because there's a size check for the max size of QByteArray a few lines below, but we can fix it, so let's do it. Found by Coverity, CID 22530. Change-Id: I42e7ef1a481840699a8dffff1407ea6c22e1a0ec Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Fix ICC warning about use of "defined" in a macroThiago Macieira2015-09-251-1/+1
| | | | | | | | | | | | | | qhash.cpp(89): warning #3199: "defined" is always false in a macro expansion in Microsoft mode Change-Id: I7de033f80b0e4431b7f1ffff13fc960bcbb17352 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | tools: StringBuilder - silence clang warningTim Blechmann2015-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] a.resize(it - a.constData()); ~ ~~~^~~~~~~~~~~~~~~ Change-Id: I8c199d69f2e0d41d1c288d452b9d621b201fa98e Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Be more forgiving about arguments to QString::arg(double).Christian Kandeler2015-09-241-2/+2
| | | | | | | | | | | | | | | | | | The arguments for the width and precision parameters, that is. There's no reason to crash if a user sets e.g. a precision of -2. Task-number: QTBUG-46838 Change-Id: I4afc004a1b8aa1306fd996360b16117b2b643640 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>