summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs
Commit message (Collapse)AuthorAgeFilesLines
* QSimpleTextCodec: fix load memory order of atomic pointerMarc Mutz2019-06-211-3/+3
| | | | | | | | | | | | | | | The pointer value is not the only data we're interested in, but instead points to indirect data, so we need a release fence on store (present) and a corresponding acquire fence on load (was missing). Change-Id: I51f8251c0c7f4056192880430f2be5e0836dbed6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-3/+3
| | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Move away from using 0 as a pointer constantAllan Sandfeld Jensen2019-06-072-14/+14
| | | | | | | | | Cleans up most of corelib to use nullptr or default enums where appropriate. Change-Id: Ifcaac14ecdaaee730f87f10941db3ce407d71ef9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-131-1/+1
|\ | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
| * Doc: replace even more null/0/nullptr with \nullptr macroChristian Ehrlicher2019-05-081-1/+1
| | | | | | | | | | | | | | | | Try to replace all wordings like '.. to 0' with '.. to \nullptr'. Also checked for 'null pointer' and similar. Change-Id: I73341f59ba51e0798e816a8b1a532c7c7374b74a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-051-1/+1
|\| | | | | | | Change-Id: If4974bbf0a166de244dd57cb71b05fa28bcc34ce
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-041-1/+1
| |\ | | | | | | | | | Change-Id: Ia7328524f2cd9d5995ac8705f0fe0bf570b2e831
| | * Doc: Use the \nullptr macro instead of 0Venugopal Shivashankar2019-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This enables overriding the macro so that it translates to 'None' in the Qt for Python context. Change-Id: Ib3cecf57eeb0405a1929309b71e9f012a07f11cf Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | | Replace Q_DECL_NOEXCEPT with noexcept in corelibAllan Sandfeld Jensen2019-04-033-4/+4
| | | | | | | | | | | | | | | | | | | | | In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-03-151-2/+2
|\| | | | | | | | | | | refs/staging/dev
| * | Doc: replace 0 with \nullptr in documentationChristian Ehrlicher2019-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | | Replace some more 0 with \nullptr. Change-Id: I2af91bf3712eef5161b11da0c44614bc039ade03 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | More nullptr usage in headersKevin Funk2019-03-141-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add missing "override" specifiersAlessandro Portale2019-02-131-10/+10
| | | | | | | | | | | | | | | | Annotate this function with 'override' or (rarely) 'final' [modernize-use-override] Change-Id: If31ab03b46f885e4984ba3aaaf1ad8d46aae9d9c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-261-1/+5
|\| | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
| * Merge remote-tracking branch 'origin/5.12' into 5.12.1Liang Qi2019-01-083-7/+4
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qtooltip.cpp Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
| * | QWindowsLocalCodec::convertToUnicode(): Fix remaining char conversionDavid Schulz2018-12-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent passing a zero argument to the cbMultiByte parameter of MultiByteToWideChar. According to the documentation this will always fail. This is triggered when calling convertToUnicode with a state having remainingChars of one and a length of one. The remaining chars will be completed and the length will be reduced to zero before the actual convert. Adding an early return after the completion to prevent calling MultiByteToWideChar with the invalid zero argument. Fixes: QTCREATORBUG-21622 Change-Id: Ic6a433dd929e97b1681583cb1b9a347afaa9a09f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-042-6/+3
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also blacklist tst_QRawFont::unsupportedWritingSystem() and tst_QGlyphRun::mixedScripts() on windows for now. Conflicts: qmake/generators/makefile.cpp src/corelib/itemmodels/qstringlistmodel.cpp src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp tests/auto/gui/text/qglyphrun/BLACKLIST tests/auto/gui/text/qrawfont/BLACKLIST Task-number: QTBUG-72836 Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
| * | Doc: Update page Tamil Script Code for Information InterchangeNico Vertriest2019-01-021-4/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-56668 Change-Id: I173d73ef5e9b08e865cb75fa03849665fcda652e Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | configure: modernize iconv useOswald Buddenhagen2018-12-191-2/+1
| | | | | | | | | | | | | | | | | | | | | use library objects for all variants, and inline the tests. Change-Id: I029f9a6655a783dab4a22abf601aadbb484c03af Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-131-1/+1
|\| | | | | | | | | | | Change-Id: I0fe623517af28e408b642c879efd59f633ab63ac
| * | Fix tautological compare in error checkingThiago Macieira2018-12-121-1/+1
| |/ | | | | | | | | | | | | | | | | size is size_t, so it's never less than zero. Fixes: QTBUG-72286 Change-Id: Idd0c85a4e7b64f9c9c7dfffd156d404d0de5ed8d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | QTextCodec::codecForLocale(): clarify and update documentationEdward Welbourne2018-12-061-5/+3
| | | | | | | | | | Change-Id: If3eec8cfc90cadcbd418807891ccf19b796f4006 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Compile with QT_STRICT_ITERATORS definedLars Knoll2018-11-261-2/+2
|/ | | | | | | This will be the only options for Qt 6, so make sure the code compiles now. Change-Id: I23f791d1efcbd0bd33805bb4563d40460954db43 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-0914-84/+73
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf qmake/Makefile.unix src/gui/text/qtextdocument.cpp src/gui/text/qtextdocument.h Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
| * Modernize the "textcodec" featureLiang Qi2018-11-0714-84/+73
| | | | | | | | | | | | | | | | | | Also clean up QTextCodec usage in qmake build and some includes of qtextcodec.h. Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Optimize QTextCodec::codecForUtfText a littleThiago Macieira2018-11-081-14/+14
| | | | | | | | | | | | | | | | | | Instead of doing byte comparisons, let the compiler do 16- and 32-bit comparisons on its own. Change-Id: If7e743cf8476463880ccfffd155f8629991b0b87 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | QTextCodec: update the docs for codecForUtfTextThiago Macieira2018-11-081-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | It can detect the standard UTF codecs, but not non-standard like UTF-7[1], UTF-9 or UTF-18[2]. [1] https://tools.ietf.org/html/rfc2152 [2] https://tools.ietf.org/html/rfc4042 Fixes: QTBUG-67188 Change-Id: If7e743cf8476463880ccfffd155f853dc947421a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QUtf8Codec: Use one 32-byte load instead of two 16-byte ones on AVX2Thiago Macieira2018-11-081-1/+6
| | | | | | | | | | | | | | | | | | The number of instructions is the same. But if the CPU can issue 32-byte-wide loads, this will be faster. For CPUs that would do two 16-byte loads, this is no worse than current code. Change-Id: I8f261579aad648fdb4f0fffd1553d060b4fc852f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Update various qt_attribution.json filesEdward Welbourne2018-11-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Marking various as final because no upstream is known or available. Listing versions of others, where I was able to discover them. Updated a stale link (that helpfully redirected). Task-number: QTBUG-70008 Change-Id: Id00f34827133c560735c68793b4f1353f2b2ca85 Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-1721-91/+54
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
| * Modernize the "codecs" featureLiang Qi2018-10-127-23/+19
| | | | | | | | | | | | Change-Id: Idee19112581bff64a2e0b8e331dd3d779aca165b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * Modernize the "big_codecs" featureLiang Qi2018-10-1216-68/+35
| | | | | | | | | | | | Change-Id: Ic23f4a1f81a21711cd81aaa2942b493aca5b38b8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Add tests for decoding too-short UTF-8 sequencesThiago Macieira2018-09-253-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | We were handling this properly, but not testing them. I guess we weren't testing because the condition is a valid intermediate state, so hasFailure() is correct it returning false. Testing inspired by the bug reported in https://github.com/intel/tinycbor/issues/137 Change-Id: Ib47c56818178458a88b4fffd1554ecfdd0af637e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | WebAssembly for QtBaseMorten Johan Sørvig2018-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Add a few overrides in Qt CoreAlessandro Portale2018-08-058-74/+74
| | | | | | | | | | | | | | | | | | Clang-tidy says: warning: annotate this function with 'override' or (rarely) 'final' [modernize-use-override] Change-Id: Ic2304cf35f4132ba1f55714493db93836f8b413d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Improve the UTF-16 and UTF-32 codecs with <qendian.h>Thiago Macieira2018-07-041-28/+12
| | | | | | | | | | | | | | | | This is just the low-hanging fruit. Those algorithms could be much further improved, but they are so seldom-used that it's not worth it. Change-Id: I6a540578e810472bb455fffd15332b2a7a1ac901 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Deregister QTextCodec on destructionIgor Mironchik2018-05-261-0/+18
| | | | | | | | | | | | | | | | | | | | | | QTextCodec automatically deregisters on destruction now. [ChangeLog][QtCore][QTextCodec] QTextCodec automatically deregisters on destruction now. Task-number: QTBUG-56203 Change-Id: Ic9a66c512642c9913aa27ea5167b9f7341e7f0fe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QString: insert a number of 8-character SIMD loopsThiago Macieira2018-05-151-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | We don't have _mm_cvtsi64_si128() (the REX.W expansion of MOVD [0F 6E]), but we do have _mm_loadl_epi64(), the SSE2 expansion of the MMX MOVQ at opcode 0F 7E. Ditto for _mm_cvtsi128_si64() and _mm_storel_epi64(). And those work even in 32-bit mode. By doing this, we can reduce the tail unrolled loops by half, reducing code size. I'm not adding these new SIMD sections to -Os builds. Change-Id: Ib48364abee9f464c96c6fffd152e405310ef67be Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | QUtf8: add AVX2 code for isValidUtf8Thiago Macieira2018-05-151-0/+22
|/ | | | | Change-Id: I5d0ee9389a794d80983efffd152d2beca86c5779 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QUtf8: Add some UTF-8 text operation functionsThiago Macieira2018-02-032-1/+169
| | | | | | | | | | | The first, isValidUtf8(), as the name says, returns true if the string is valid UTF-8. As a bonus, it also returns whether it's valid US-ASCII. The other two are meant to compare an UTF-8 string to either a Latin1 one or an UTF-8 one, without memory allocation. Change-Id: Ic38ec929fc3f4bb795dafffd150ad0d63e28cd32 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove references to obsolete platformsJake Petroules2017-11-052-4/+4
| | | | | | | | | | | | | | ultrix and reliant have not seen a release since 1995. dgux not since 2001. bsdi not since 2003. irix not since 2006. osf not since 2010. dynix... unclear, but no later than 2002. symbian needs no mention. All considered obsolete, all gone. sco and unixware are effectively obsolete. Remove them until someone expresses a real need. Change-Id: Ia3d9d370016adce9213ae5ad0ef965ef8de2a3ff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-3/+3
| | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-195-49/+49
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-041-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/widgets/util/util.pri tests/auto/corelib/thread/qthread/qthread.pro tests/auto/corelib/thread/qthread/tst_qthread.cpp Change-Id: I5c45ab54d46d3c75a5c6c116777ebf5bc47a871b
| * QGbkCodec: Initialize buf arraysFriedemann Kleint2017-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | Fix developer build with GCC 7, which complains: codecs\qgb18030codec.cpp:387:37: error: 'buf[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized] codecs\qgb18030codec.cpp:8908:17: error: 'buf[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] codecs\qgb18030codec.cpp:536:37: error: 'buf[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized] codecs\qgb18030codec.cpp:535:37: error: 'buf[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] Change-Id: I7e98355c625276c74792707f22d4318c0cc9be6a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QtBase: use new QStaticByteArrayMatcher where applicableMarc Mutz2017-04-241-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even for compilers that don't yet support C++14 constexpr, this should improve performance of searches a lot, if, indeed, Boyer-Moore still is an optimization over linear searching at all in these days of hardware prefetchers and deep CPU pipelines, because the setup cost is only incurred once. As function-statics, we also don't care about startup ordering and cost. It's a pity that the platform that would benefit the most - Windows - doesn't have constexpr support, yet. Change-Id: I827df135854fd6fbd6546e248dc37ef0fbaf1792 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | QText{En,De}coder: mark ctors explicitMarc Mutz2017-04-061-2/+2
| | | | | | | | | | | | | | C++11 allows these to be called implicitly. Change-Id: Ife62ce4df4c294623e84fb0c0751ae9b4f6d1020 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QTextCodec: add QStringView overloadsMarc Mutz2017-04-062-0/+51
|/ | | | | | | | | | [ChangeLog][QtCore][QTextCodec] Added fromUnicode() and canEncode() overloads taking QStringView. [ChangeLog][QtCore][QTextEncoder] Added fromUnicode() overload taking QStringView. Change-Id: I2599f25570480d967921ccd4414e092bfc90d821 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use QT_CONFIG(library) instead of QT_NO_LIBRARYUlf Hermann2017-03-061-1/+0
| | | | | | | | | | | | | For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Properly use QT_CONFIG macro to check for ICULars Knoll2016-11-291-9/+9
| | | | | | | And remove the QT_USE_ICU define. Change-Id: I8134ee18af7c90ed7070926ca31b3a57b3ec37dd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>