summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbitarray.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add Intel copyright to files that Intel has had non-trivial contributionThiago Macieira2016-01-211-0/+1
| | | | | | | | | I wrote a script to help find the files, but I reviewed the contributions manually to be sure I wasn't claiming copyright for search & replace, adding Q_DECL_NOTHROW or adding "We mean it" headers. Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@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>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* QtCore: Use QDebugStateSaver in (almost) all QDebug operator<<Kai Koehne2015-02-091-5/+6
| | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.3' into 5.4Oswald Buddenhagen2014-10-061-3/+10
|\ | | | | | | Change-Id: I132bb6cce68e9f8413200f7ee75586bd1cada38c
| * Doc: Clarify QBitArray::fill() documentationTopi Reinio2014-10-031-3/+10
| | | | | | | | | | | | | | | | | | | | Fix a minor mistake in the the function parameter documentation, and add a code snippet. Task-number: QTBUG-39782 Change-Id: Ia5d88a983ad683ae5bde9f332d51adc4afda77a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
|/ | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-071-8/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| * Remove duplicate move assignment operator docMorten Johan Sørvig2014-01-301-8/+1
| | | | | | | | | | | | | | Keep the "since 5.2". Change-Id: I8cfaf81e0b10f67c084e923f846ce0c722eac7fe Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* | expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-2/+2
|/ | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-9/+9
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Add docs for rvalue references and move constructorsGeir Vattekar2013-09-271-0/+17
| | | | | | | | | These members were introduced in 4.8, but left undocumented. Because we consider undocumented API to be internal, the members are \since 5.2. Change-Id: I52e2840a8cfaa7f59f410b3e2a06c0942ea06539 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Do 64-bit loops in QBitArray::count(bool)Thiago Macieira2013-09-141-1/+6
| | | | | | | | | | | On 64-bit platforms, with unaligned loads, this is defintely an improvement since we can run fewer instructions. On 32-bit platforms with unaligned loads, we'll do the exact same number of loads. On platforms without unaligned loads, it's no worse. Change-Id: Idd5dd5213975d77bbc3adf486adbf6f8ef071341 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Let the compiler do the unaligned loads in QBitArray::count(bool)Thiago Macieira2013-09-141-2/+21
| | | | | | | | | | | For platforms where the CPU can do unaligned loads on its own, like x86, the compiler will generate actual loads. On other CPUs, it will do the byte-by-byte load like we were doing. The compiler cannot generate worse code than our hand-rolled load, so this change can only improve performance. Change-Id: I32a89e64aa64d8af504be6c5a10b04d7573cdb98 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Optimize QBitArray::count(bool)Thiago Macieira2013-09-131-17/+12
| | | | | | | | | | | | | | Ever since 76e0223619da02911d02813961ef631a5e02d826, qPopulationCount was extracted from QBitArray and moved elsewhere. That unfortunately meant that the 24-bit loads are completely useless, since qPopulationCount always operates on 32 bits. Instead, do a full loop on 32-bit and then do 16-bit and finally 8-bit (for which there are qPopulationCount overloads). Change-Id: If945609f075095257d12877c39434909ac190e54 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Improve QBitArray's construction performance a littleThiago Macieira2013-08-311-5/+4
| | | | | | | | Ask for an uninitialized byte array, since we're about to memset(3) it anyway. And don't overwrite the initial byte either. Change-Id: I2caa2ef395ad5684416e6cd336c0444de7787b5d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add a construction note on why QBitArray has a +1 everywhereThiago Macieira2013-08-311-0/+14
| | | | | | | | | It took me several minutes reading the code to figure out why it was there. It wasn't immediately obvious. Change-Id: Ic36b3fd24ce84a1b08c73986d3b7ab8a5bfff133 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix corner-case counting of bits in QBitArray::count(bool)Thiago Macieira2013-08-311-3/+3
| | | | | | | | | | | | | | | | | | | This actually looks very wrong. First, it would try to read bits for len == 0, which means it was actually reading the implicit NUL from QByteArray (so valgrind would never catch the error). Second, there was a corner case for testing the 8th bit (bit 7) in the last byte. For len == 8 or 16 at the beginning of the last loop, it would read bits[len / 8], which is again the implicit NUL from QByteArray. Compare to testBit (simplified): return d.constData()[1+(i>>3)] & (1 << (i & 7)) != 0; Task-number: QTBUG-11625 Change-Id: Idb361163de596b629cab42f2367ddd09456c2a98 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-121-1/+2
|\ | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoamenubar.mm Change-Id: I4a699fc8a7f30b2af9de8e496c3d5f027b7495bb
| * Prevent negative size in QBitArray, QVector and QVarLengthArray ctors.Mitch Curtis2013-06-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As shown in QTBUG-24345, QBitArray will exhibit invalid reads when initialised with a negative size and run under valgrind. QVector and QVarLengthArray both cause a crash if initialised with a negative size. This patch enforces sizes greater than or equal to 0 with asserts and existing if statements, and hence impose no performance penalty for release builds. Task-number: QTBUG-24345 Task-number: QTBUG-30037 Change-Id: I9a969f6016e0a59904a60bbfe9e5360e6f523b87 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add qPopulationCount() function, extracted from QBitArrayMarc Mutz2013-04-031-8/+3
|/ | | | | | | | | | | | | This functionality is used in multiple places in Qt itself, so it makes sense to have a global function for this. This also allows to map this onto specialized assembler instructions, should an architecture provide them, later on. Also added comprehensive tests, using a 4-bit lookup-table implementation as a reference. Change-Id: I8c4ea72cce54506ebb9fbe61141dbb5f1b7a660f Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Review of documentation.Michele Caini2012-10-121-1/+7
| | | | | | | | Documentation has been updated to reflect changes in Qt5. Change-Id: I3d54d1875962bd27c43bb360ae7b3fda0b7702ba Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+2
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QtCore: remove \link usagesGiuseppe D'Angelo2012-05-291-8/+7
| | | | | Change-Id: I0de764b51a972de0b6eb2bf3c04d2b190f581f52 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-191-17/+17
| | | | | | | | | | | | 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>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Implement QDebug stream operators for builtin classesJędrzej Nowacki2012-01-101-0/+18
| | | | | | | | | | | QDebug stream operator was added for: QPixmap, QImage, QUuid, QBitArray, QLocale, QRegExp, QCursor, QPalette, QTextFormat, QTextLength, QIcon and QSizePolicy Change-Id: Ibcf5c9b599ba322d53cb106d8e5e157427ebe757 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+738
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12