summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* fix build with mingwKonstantin Ritt2012-04-271-17/+17
| | | | | | | since MinGW is GCC, invert the order and place the GCC constructs first Change-Id: I98113aa77e51f9e01c3641987e915bf475053a60 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* get rid of Q_*_EXPORT_INLINE macrosKonstantin Ritt2012-04-261-8/+8
| | | | | | | | | | | | > Girish: > We should be able to remove the macro completely today, > just mark all those functions as plain inline. > With Qt5, we don't have to worry about bc yet. this fixes "import attribute ignored" warnings on mingw with -fno-keep-inline-dllexport Change-Id: I616e5de7c8d59953ce03a316b941a439fae56298 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix C++11 compilationOlivier Goffart2012-04-261-6/+6
| | | | | | | | Fix compilation with compilers that support user defined literal (such as GCC 4.7) Change-Id: I31cd3d2177688f963ab33cf68cd6060a5fb8640f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add detection code for AVX2, HLE, RTM and AES to qsimd.cppThiago Macieira2012-04-252-17/+39
| | | | | | | | | | | | | | | AES is currently not enabled, since we don't use it for anything. The code is here with the proper detection should we want to in the future. RTM and HLE (Transactional Memory Extensions) I'll use soon in the locking code. Also rename a few variables to make it easier to read later on. Change-Id: I800c66d7e1ba86ec037692928d94f53ea5d5868f Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Replace the x86 XGETBV instruction with its opcode bytesThiago Macieira2012-04-251-1/+1
| | | | | | | | | | | | | This is a new instruction, present on the SandyBridge architecture and later. Some older assemblers do not support it and produce: {standard input}:225:no such instruction: `xgetbv' The use of this instruction is protected by a CPUID check (function 1, ECX bit 27), so we only run it in processors that do support it. Change-Id: Ife7500c0deaab9539074835a4511e8c19602608e Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Update the x86 feature-detection code, unifying x86 and x86-64Thiago Macieira2012-04-251-125/+113
| | | | | | | | | | | | | | | Most of it is the same for both of them, so let's avoid doing everything twice. Or more, since we may support x32 soon. For Windows, use the intrinsics. For GCC, we'd like to use cpuid.h, but it only exists since GCC 4.3, so we can't. And properly detect AVX support: it's not enough to detect that the processor supports them, we also need to check that the OS enabled support for the 256-bit registers. Change-Id: Ibb4872cdb774de5701b18c40f4e612330a266214 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* optimize QChar::decomposition()Konstantin Ritt2012-04-251-27/+32
| | | | | | | | | | * by not using QString::fromUtf16() as we know for sure that the data is 'raw' UCS-2; * it's safe to avoid a check for > UNICODE_LAST_CODEPOINT as GET_DECOMPOSITION_INDEX macro already does a similar check Change-Id: Ifb660efc51c664d06733ac8ed46d54278520da06 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix locale issue on unix systemsStephen Röttger2012-04-241-0/+2
| | | | | | | | | | | | | QSystemLocale::query() was missing the LanguageId QueryType. Therefore QSystemLocale::fallbackLocale() was always used as default language, which reads environment variables in the order: LC_ALL -> LC_NUMERIC -> LANG. The correct behaviour is to read LC_ALL -> LC_MESSAGES -> LANG. This leads to problems for users that want to use english language, but non-english localization features (date, number formats etc.) Change-Id: I4310537dac8622a3dd79231fbad58e22f20ca262 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* qunicodetables generator: improve the output and the generated codeKonstantin Ritt2012-04-242-29/+33
| | | | | | | | | | | better memory usage report; an additional asserts with conditions the implementation is depends on; a namespace for the internal static data; styling fixes Change-Id: Id4048ff6104c56b5f590f9ac6fbf7c0bce79ec47 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* workaround issue where casing diff overflows signed shortKonstantin Ritt2012-04-243-11/+39
| | | | | | | | | | | | | | | | | | | there are two such codepoints were added in the Unicode 5.1: U+1D79 LATIN SMALL LETTER INSULAR G U+A77D LATIN CAPITAL LETTER INSULAR G two more of them were added in the Unicode 6.0: U+0265 LATIN SMALL LETTER TURNED H U+A78D LATIN CAPITAL LETTER TURNED H and two more were added in the Unicode 6.1: U+0266 LATIN SMALL LETTER H WITH HOOK U+A7AA LATIN CAPITAL LETTER H WITH HOOK we map them like special cases with length == 1 (note: all are in BMP which is checked explicitly in the generator) Change-Id: I8a34164eb3ee2e575b7799cc12d4b96ad5bcd9c6 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QChar: reduce code duplication by inlining some methodsKonstantin Ritt2012-04-242-96/+80
| | | | | | | | | using templates for toLower()/toUpper()/toTitleCase()/toCaseFolded() makes the upcoming patches smaller and thus easier to review Change-Id: Ideb23e8669dbc2fe9ea3f129bf0137e1805ece11 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QLocale: Clean up QLocalePrivate implementationJohn Layt2012-04-246-322/+332
| | | | | | | | | | | | | | In Qt4 QLocalePrivate is a struct returned by a d() method. This will be unsuitable for the planned change to use ICU and may cause BIC issues. This change makes QLocalePrivate a class and creates a new struct QLocaleData to hold the data index. Further clean-ups are possible but are left for later. Change-Id: Ie316a07790f74674a3b520b735dff72695cc4060 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use the Q_PROCESSOR_* macros in qsimd.cppThiago Macieira2012-04-231-3/+3
| | | | | Change-Id: I7be9b14a24329be32c43603ae87df17328696109 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix MSVC conversion warnings in new bytearray code.Friedemann Kleint2012-04-203-12/+13
| | | | | | Change-Id: Ifc81564daf3fef0d7f08ae8d250ba41d3b1d5b0f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* mingw: fix a lot of annoying warningsKonstantin Ritt2012-04-204-166/+166
| | | | | | | | | like "QRect::intersected() redeclared without dllimport attribute after being referenced with dll linkage" (-fno-keep-inline-dllexport) Change-Id: Id24e5ee857579ee9f97a60de0ab88ce3db8385cf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fixed QSimd WindowsCE buildBjoern Breitmeyer2012-04-191-1/+8
| | | | | | Change-Id: I94de251cf1f283d30f92d0fb9d37a1646765cbdd Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* optimize canonicalOrderHelper() for generic caseKonstantin Ritt2012-04-191-5/+21
| | | | | | | | | | | if there is no need to swap codepoints A and B, then we proceeding with advance to the next codepoint B that becomes A, and some next codepoint C becomes B; in such case we can easily skip the re-calculations for A by using previously calculated results for B Change-Id: I5c63589c274acaddf0f6a4cb1e0608d352a0c1b3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-1932-703/+677
| | | | | | | | | | | | This change fixes most qdoc errors in QtCore. There are about 900 left. The main thing this change does is moving documentation from qtcore from /doc/src to /src/corelib/doc. Other issues resolved are mis-use of qdoc commands. Change-Id: I002d01edfb13575e8bf27ce91596a577a92562d1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* fix QChar::decompositionTag() returns wrong result for Hangul syllablesKonstantin Ritt2012-04-171-0/+2
| | | | | Change-Id: I28e7b14b6a90aa539f8a50107737a66b3484fc00 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* fix QChar::isPrint() returns an incorrect result.Konstantin Ritt2012-04-171-4/+12
| | | | | | | | results are now equals to results of ICU's u_isprint() for the entire set of the Unicode code points Change-Id: I763f4b37cccd285eb01543d486f25bd7ea011241 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-04-1743-5591/+6320
|\ | | | | | | Change-Id: I964b0a6f5c38351fdfafb8a2a128a349ff8c89d1
| * Merge "Merge remote-tracking branch 'origin/master' into api_changes" into ↵Sergio Ahumada2012-04-177-823/+849
| |\ | | | | | | | | | refs/staging/api_changes
| | * Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-04-167-823/+849
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/corelib/io/qurl.cpp src/gui/kernel/qwindow.cpp src/tools/moc/generator.cpp src/widgets/kernel/qwidget_qpa.cpp src/widgets/styles/qstyle.h src/widgets/widgets/qtabbar.cpp tests/auto/corelib/codecs/utf8/tst_utf8.cpp Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
| * | | Make reallocData use QArrayData::AllocationOptionsJoão Abecasis2012-04-162-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Growth computations are deferred to QArrayData::allocate, except in the case of realloc as that functionality is currently lacking in QArrayData. Since that sits in library code, anyway, it can be changed later to use a future QArrayData::reallocate. As it is, reallocData is becoming a model for QArrayData::reallocate and what it can offer to containers of POD/movable types. Change-Id: I045483f729114be43e4818149d1be1b333bcbe13 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Drop unnecessary assignmentJoão Abecasis2012-04-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this branch, !IS_RAW_DATA has already established that offset is sizeof(QByteArrayData) and realloc maintains the assumption. Change-Id: Ic160e36d7781d4c4f64a3b2ebec98c9cb605b3eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
| * | | Migrate QByteArray over QArrayData.Jędrzej Nowacki2012-04-162-60/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the time being QByteArrayData keeps its independent existence, for the sake of other modules. Once they have been ported to use the new initializer macros it can be changed to: struct QByteArrayData { QArrayData array; }; Extra braces can then be added to the macros. With respect to source compatibility, the only concern is with other modules, as QByteArrayData has already changed in incompatible ways with Qt 4.x Done-with: João Abecasis Change-Id: I044e2a680317431777a098feec8839a90a3d3da3 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Remove explicit checks for shared_null/emptyJoão Abecasis2012-04-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This eases porting to QArrayData and retains semantics. In append() and prepend() a conditional was generalized so that no work is done if there is nothing to add. Done-with: Jędrzej Nowacki Change-Id: Ib9e7bb572801b2434fa040cde2bf66dacf595f22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
| * | | Make QByteArray and QString keep track of terminating nullJoão Abecasis2012-04-164-46/+49
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In conceptual terms, this change increments the Data::alloc member by one for all strings allocated and maintained by these classes. Instances initialized with fromRawData retain 0 as the member value, so they are treated as immutable. This brings QByteArray and QString closer to QVector, making it possible for them to reference and share the same data in memory, in the future. It also brings them closer to QArrayData. In practical terms all comparisons to the alloc member were changed to take into account that it also tracks the terminating null character. Aside from the increment in the alloc member, there should be no user visible changes. Change-Id: I618f49022a9b1845754500c8f8706c72a68b9c7d Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QHash security fix (2/2): enable QHash random seedGiuseppe D'Angelo2012-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Algorithmic complexity attacks against hash tables have been known since 2003 (cf. [1, 2]), and they have been left unpatched for years until the 2011 attacks [3] against many libraries / (reference) implementations of programming languages. This patch makes qHash use the QHash seed introduced in the previous commits, thus truly randomizing bucketing in QHash. [1] http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003.pdf [2] http://perldoc.perl.org/perlsec.html#Algorithmic-Complexity-Attacks [3] http://www.ocert.org/advisories/ocert-2011-003.html Task-number: QTBUG-23529 Change-Id: Ibee9cf6aa820af5d777fcde478647665c728052a Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
| * | QHash: remove optimization for QHash<int, T>Giuseppe D'Angelo2012-04-141-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHash employs an optimization for int/uints, squashing the hash value and the key value inside an union. This obviously works iff qHash(int k) = k. If the hash value gets salted, the hash table is corrupted. This patch removes that optimization by means of a #if 0, so if further research finds out that we want those 4 bytes back it's pretty simple to revert. Change-Id: If273f0bf2ff007f4f2f7c46d2aab364a3b455cf1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | qHash: qHash(T*) two arguments supportGiuseppe D'Angelo2012-04-141-2/+2
| | | | | | | | | | | | | | | Change-Id: I1b78914fe9c6ee9251d68af1f2e95f1e3e0f1db5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | qHash: two arguments support for simple integer types (and QChar)Giuseppe D'Angelo2012-04-141-16/+16
| | | | | | | | | | | | | | | | | | Change-Id: I24bed73422fb1d2e90cf3dd4e5375e249b3dcac4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| * | QSharedPointer: qHash two arguments supportGiuseppe D'Angelo2012-04-131-3/+3
| | | | | | | | | | | | | | | | | | Change-Id: I800de3fd9769e4829018360c25a8cf2ee2e2e08b Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | make QStringList::sort() to take a Qt::CaseSensitivity paramKonstantin Ritt2012-04-122-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-12892 Change-Id: I402e6fb12ff24ac26c5a8103bf81547946f9cc58 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * | unite QString::normalized() overloadsKonstantin Ritt2012-04-112-26/+12
| | | | | | | | | | | | | | | Change-Id: I27545e599a1831728e491a9fad1e52fa255535fc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
| * | Deprecate qMemCopy/qMemSet in favour of their stdlib equivilents.Robin Burchell2012-04-115-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just like qMalloc/qRealloc/qFree, there is absolutely no reason to wrap these functions just to avoid an include, except to pay for it with worse runtime performance. On OS X, on byte sizes from 50 up to 1000, calling memset directly is 28-15% faster(!) than adding an additional call to qMemSet. The advantage on sizes above that is unmeasurable. For qMemCopy, the benefits are a little more modest: 16-7%. Change-Id: I98aa92bb765aea0448e3f20af42a039b369af0b3 Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: John Brooks <john.brooks@dereferenced.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * | Make reallocData() take (unsigned) size, including nullJoão Abecasis2012-04-114-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parameter represents an allocation size and unsigned matches the Q*Data::alloc member it ultimately represents (even if they currently differ in accounting for the null). There's still work up for grabs to ensure we avoid integer overflows when growing. Change-Id: Ib092fec37ec2ceed37bebfdc52e2de27b336328f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Add early-clobbers to the output variables in CPUIDThiago Macieira2012-04-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without those early-clobbers, the compiler might decide to schedule a register that is also used as output. The existing early clobber in the tmp variable was there so the compiler wouldn't use a register scheduled as input (especially EAX). To be honest, I'm not convinced that the compiler should be allowed to do this. That means that two output variables are scheduled to the same register... still, this fixes a problem found with GCC 4.2 (at least the Mac one). Change-Id: I6cd4676284e9a83d6aac4b439c6e58e347c40106 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
| * | Merge remote-tracking branch 'origin/master' into api_changesOswald Buddenhagen2012-04-105-27/+16
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
| * | | New qHash algorithm for uchar/ushort arrays (QString, QByteArray, etc.)Giuseppe D'Angelo2012-04-091-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port of Robin's work from I0a53aa4581e25b351b9cb5033415b5163d05fe71 on top of the new qHash patches (the original commit just introduced lots of conflicts, so I redid it from scratch). This is based on the work done in the QHash benchmark over the past few months experimenting with the performance of the string hashing algorithm used by Java. The Java algorithm, in turn, appears to have been based off a variant of djb's work at http://cr.yp.to/cdb/cdb.txt. This commit provides a performance boost of ~12-33% on the QHash benchmark. Unfortunately, the rcc test depends on QHash ordering. Randomizing QHash or changing qHash will cause the test to fail (see QTBUG-25078), so for now the testdata is changed as well. Done-with: Robin Burchell Change-Id: Ie05d8e21588d1b2d4bd555ef254e1eb101864b75 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * | | Stop relying on qHash always giving the same resultsGiuseppe D'Angelo2012-04-082-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of the various qHash overloads offered by Qt can change at any time for any reason (speed, quality, security, ...). Therefore, relying on the fact that qHash will always give an identical result across Qt versions (... across different processes, etc.), given identical input, is wrong. Note that this also implies that one cannot rely on QHash having a stable ordering (even without the random qHash seed). For such use cases, one must use f.i. a private hash function that will never change outside his own control. This patch adds a private hash function for QStrings, which is identical to the Qt(4) qHash(QString) implementation. A couple of spots in Qt where the results of a qHash call were actually saved on disk are ported to use the new function, and a bit of documentation is added to QHash docs. Change-Id: Ia3731ea26ac68649b535b95e9f36fbec3df693c8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * | | More qHash(T, uint) overloads for Qt typesGiuseppe D'Angelo2012-04-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The more we get in 5.0, the better. Change-Id: If00084477709db4fc3f6b2e15024d046491be2ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Remove references to QT_NO_STL from QtCoreThiago Macieira2012-04-079-43/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QT_NO_STL is now no longer defined, so remove the conditionals and select the STL side. Change-Id: Ieedd248ae16e5a128b4ac287f850b3ebc8fb6181 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
| * | | qHash: always use the seed in the catch-all templateGiuseppe D'Angelo2012-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This pertubates the results of the calls to the one-argument version of qHash through the catch-all template. Change-Id: I7037b25d545e6f1360384a83ff895f4bb62ed195 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
| * | | Fix compilation with MinGW.Marcel Krems2012-04-052-2/+8
| | | | | | | | | | | | | | | | | | | | Change-Id: I494c84e8e6889a7d7bb3b29669337483732d02c2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | QLatin1String: add qHash overloadGiuseppe D'Angelo2012-04-052-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was never introduced in Qt 4, probably because of the implicit conversion to QString (that is, adding the qHash overload for QLatin1String in Qt 4 would have been a BIC). Change-Id: I2ebc8e73a85be497866820e0ca416dd11167bb53 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * | | Add zero-termination checks to QString and QByteArray testsJoão Abecasis2012-04-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses an alternative approach to the testing formerly introduced in 4ef5a626. Zero-termination tests are injected into all QCOMPARE/QTEST invocations. This makes such testing more thorough and widespread, and gets seamlessly extended by future tests. It also fixes an issue uncovered by the test where using a past-the-end position with QString::insert(pos, char), could move uninitialized data and clobber the null-terminator. Change-Id: I7392580245b419ee65c3ae6f261b6e851d66dd4f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
| * | | Make QLocale::toULongLong return the proper type: qulonglongThiago Macieira2012-04-052-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-25143 Change-Id: Ia8fd588c25d11fe31acd57fd34a90d51dace248c Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
| * | | Don't allocate space for null when using fromRawDataJoão Abecasis2012-04-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this case we only need to allocate space for the "header" data. Change-Id: I059627e47a5bae7a02c82d837c826a6ed0fd20fd Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Simplify conditionalsJoão Abecasis2012-04-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alloc >= size is an invariant of both QString and QByteArray, unless string data is immutable (e.g., when using fromRawData()), in which case alloc will be 0, regardless of size, That's what needs to be checked here. Change-Id: Ief9e6a52a1d5ea1941d23ed3c141edfd15d2a6a7 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>