summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Add template text to \fn commands in qmap.cppMartin Smith2017-11-191-134/+146
| | | | | | | | | The \fn commands were not recognized by clang-qdoc because the template stuff was missing from the \fn commands. This update adds the correct template text and parameters. Change-Id: I7def18f35745b984cc1e2da7c351403d98d8668c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* doc: Fix some "Cannot tie this..." errorsMartin Smith2017-11-173-5/+4
| | | | | | | | | | | | | These are errors where clangqdoc finds a qdoc comment, but it can't find anything in the API to associate it with. There are different causes. In many cases, soneone has documented a function that isn't in the public API so it should not be documented in the first place. In other cases, a function is platform-specific and we need to add || defined(Q_CLANG_QDOC) somewhere to make it visible. Change-Id: I2b707548109f626e20d28f084072ef78f2ee6ac5 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* doc: Ensure GUID is declared for clangqdocMartin Smith2017-11-161-6/+6
| | | | | | | | | Clang needs to see a declaration for GUID, or it will ignore some function declarations that must be documented. Change-Id: Ic5d5a88b82c709be7f763a44994b1c077977731a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Avoid duplicate rules in QWinTimeZonePrivate::init()Edward Welbourne2017-11-151-2/+22
| | | | | | | | | | | | It was iterating the full range of years, adding a rule for each year. The rules have a startYear member and are used for later years until the next rule's startYear, so we don't need to duplicate them; and the system APIs we get them from do support recurrent rules (with wYear set to 0), that apply to ranges of years. So propagate that recurrence and reuse rules where we can. Change-Id: Ifdd292d3f3d3e07969d7a02bb01f2a0110d32950 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Restructure Dynamic TZ query to same form as Registry variantEdward Welbourne2017-11-151-17/+39
| | | | | | | | | | | | Break out the reading of an individual rule to a function and add a fall-back that tries to get a non-dynamic rule when there's no dynamic data for the zone. At the same time, change the first rule, in all cases to apply for all time (i.e. set its .startYear to MIN_YEAR, instead of 1970 or the advertised start range): we'll use it when extrapolating backwards into the past. Change-Id: Ife548c7c7deebef2427d2838f3e12ed7abb631c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Replace ruleForYear() method with a local index-based functionEdward Welbourne2017-11-152-16/+35
| | | | | | | | | | | Removed private method of QWinTimeZonePrivate in favor of a local static that returns a rule index rather than a rule; this prepares the way for smarter searching in transition-finding methods. In the process, re-work the function to use binary chop instead of a linear search through a potentially long sorted list. Change-Id: I2171e3f01afa3037b9718e1be7d0c9343aa74ff0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* DRY: eliminate code duplication in calculateTransitionsForYear()Edward Welbourne2017-11-151-49/+50
| | | | | | | | | | Replace with calculateTransitionForYear(), which just does one of the transitions, and wrap that with a pair-struct type to call it for DST and standard time, respectively. This also eliminate in/out arguments, which is said to be good for optimisers. Change-Id: I1e397404a0abceee7654524902af5be4eb88a625 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QFontMetrics(F)::horizontalAdvance() functionEskil Abrahamsen Blomfeldt2017-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | A source of constant confusion is the QFontMetrics::width() function, which does not return the bounding width of the text, but the advance width. We deprecate this and add horizontalAdvance() instead, to avoid the confusion in the future. Note that there was an internal width() overload which was only there for the purpose of supporting the Qt::TextBypassShaping flag. This flag has already been replaced by public API, so no such overload is added. Instead, we deprecate the TextBypassShaping flag as well, which makes sense, since a replacement has been made. Also note that there was a consistency problem with QFontMetrics and QFontMetricsF, which are supposed to be interchangeable. The QFontMetrics::width() functions for strings took an optional int length argument, while the floating point version did not. This error is corrected in the advance() functions. [ChangeLog][QtGui][Text] Added QFontMetrics::horizontalAdvance() and QFontMetricsF::horizontalAdvance() to replace the confusingly named width() function. The latter has now been deprecated. Change-Id: I0dfda43aa65c8235be32c62fade82cae05b29c79 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QDirIterator: Skip inconvertible file names on UnixAlexander Volkov2017-11-141-5/+12
| | | | | | | | | | | | | | | In the case when user's local encoding is UTF-8, QDirIterator may list entries which names can't be correctly converted from UTF-8 to UTF-16, e.g. for "\xC0\xB0" file name QDirIterator::fileName() returns "\uFFFD\uFFFD" (FFFD is a code of Replacement Character). The problem is that you can't do anything with such directory entries because there is no way to get the original entry names. List only those names that can be converted to QString and then back to the local encoding without corruption. Change-Id: Ib6a71dea8ce9601876040c07276c325fd997e767 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLockFile/Unix: save the boot and machine IDs in the lock file tooThiago Macieira2017-11-144-6/+47
| | | | | | | | | | | | | | | This allows us to make sure that the PID we read is from the same boot as we are right now running. The collision could happen on embedded systems where the boot sequence is fixed, so all the same processes would have the exact same PIDs after reboot as they did before. [ChangeLog][QtCore][QLockFile] QLockFile can now properly conclude that a lock file from a previous boot of the same device is stale and can be removed. This is implemented only for Linux and Apple operating systems. Task-number: QTBUG-63425 Change-Id: I0b48fc8e90304e0dacc3fffd14e8e3a197211788 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QSysInfo: Remove the caches in {boot,machine}UniqueId()Thiago Macieira2017-11-141-62/+54
| | | | | | | | | Looks like there are conditions in which they could be used during shut down and thus access an already-destroyed static. This was tested in test tst_lockfile.cpp:LockFileUsageInGlobalDtor. Change-Id: I57a1bd6e0c194530b732fffd14f4dae39ab1ae2c Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Make qsimd_p.h compile in C mode tooThiago Macieira2017-11-141-4/+7
| | | | | | | | | Since we very often need to write our intrinsic-using code in C to avoid "leakage" of not-inlined inline functions, this file is very handy. Change-Id: I57a1bd6e0c194530b732fffd14f45d27a32538f8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Remove some unnecessary namespace prefixingEdward Welbourne2017-11-061-1/+1
| | | | | | | | QWinTimeZonePrivate is based on QTimeZonePrivate, so can reference its members without prefix. Change-Id: I7b6bc33f70c4a497ec0caf897d48886a21f8fd65 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Liang Qi2017-11-0615-170/+236
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-0515-170/+236
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/minimum-linux.S src/network/access/qhttpthreaddelegate.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Id2e817e85f85c68f5482c9a12912d35590f9d5f8
| | * QFileSystemEngine: Fix renameat2() failures on non-local filesystemsThiago Macieira2017-10-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RENAME_NOREPLACE flag is supported for all Linux local filesystems, since that can be easily checked by the VFS layer (it knows which files exist and which ones don't). For non-local filesystems, the backend needs support and that might need server-side support too. So we may get EINVAL errors for those, in which case we fall back to link/unlink, which in turn can fall back to rename(). EINVAL can also happen if we attempt to make a directory a subdirectory of itself. In that case, we will attempt to link() it, which will result in EPERM as we can't hardlink directories. Then we try rename() again, which should result in the expected EINVAL. Task-number: QTBUG-64008 Change-Id: Icaa86fc7b54d4b368c0efffd14f09ca23602dd2e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * Fix GCC -Wfloat-conversion warnings (available since GCC 4.9)Thiago Macieira2017-10-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This warning used to be part of -Wconversion, but that generates too more noise than we're willing to fix now (like conversion from qint64 to int). The float conversion does trigger for conversion from double to float, as shown in all the QVectorND uses of float, but more importantly, it triggers on passing floats to ints. Change-Id: I69f37f9304f24709a823fffd14e69cfd33f75988 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Mark the previously public qstringalgorithms.h functions privateThiago Macieira2017-10-296-132/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discussed during Qt Contributor Summit 2017. We concluded that we don't want to make these functions public, as they do not follow Qt coding style API. Specifically, qStartsWith(a, b) is not easily understood which argument is the needle and which argument is the haystack (same problem memcpy() has). Compare that to a.startsWith(b) which can clearly be read in English as a subject-verb-object sentence. This commit removes the unit tests that called compare(). Discussed-on: http://lists.qt-project.org/pipermail/development/2017-October/031060.html Change-Id: Icaa86fc7b54d4b368c0efffd14ee6205eb9043fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * QRandomGenerator: add system() and global()Thiago Macieira2017-10-293-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now,this does really nothing. This commit is just to allow us to transition the other modules (besides qtbase) to use the syntax that will become the API. I've marked three places to use the system CSPRNG: 1) the QHash seed 2) QUuid 3) QAuthenticator I didn't think the HTTP multipart boundary needed to be cryptographically safe, so I changed that one to the global generator. Change-Id: Ib17dde1a1dbb49a7bba8fffd14ecf1938bd8ff61 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * Move the minimum Linux version declarations to a headerThiago Macieira2017-10-283-29/+103
| | | | | | | | | | | | | | | | | | | | | | | | I'll need it in the AF_NETLINK implementation of QNetworkInterface. Change-Id: Icaa86fc7b54d4b368c0efffd14ef5ce895d0ed5b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Add a comment about the weird refcount for adopted QThreadDataThiago Macieira2017-10-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's perfectly benign, but I spent a lot of time debugging this and trying to figure out how to solve something that didn't need solving. So document for posterity. For an adopted thread, the TLS destructors or the adopted thread watcher on Windows will call QThreadData::deref(): - QThreadData::deref(), count drops to zero -> delete this; - ~QThreadData() deletes the QAdoptedThread -> delete t; - ~QThreadPrivate() calls deref() again -> data->deref(); - QThreadData::deref(), count drops to -1, no action taken - ~QObjectPrivate() calls deref() yet again -> threadData->deref() - QThreadData::deref(), count drops to -2, no action taken Change-Id: Icaa86fc7b54d4b368c0efffd14ee448e0796e8d7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QSysInfo: add a function that returns the boot IDThiago Macieira2017-11-052-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QSysInfo] Added machineUniqueId() and bootUniqueId(). Task-number: QTBUG-63425 Change-Id: I0b48fc8e90304e0dacc3fffd14e91064020d165b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QSysInfo: add a function that returns a somewhat permanent unique IDThiago Macieira2017-11-052-2/+89
|/ / | | | | | | | | | | | | | | | | | | | | We can use the D-Bus / systemd machine-id file (which is a UUID without the dashes) on systems with D-Bus. On Windows, there's a value in the registry that is filled when Windows is installed, like on Linux. For BSD systems, the kernel has a UUID we can use too, so extract that. Task-number: QTBUG-63425 Change-Id: I27eaacb532114dd188c4ffff13d32f2e3c1d74bb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Remove references to obsolete platformsJake Petroules2017-11-057-108/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | QSemaphore: Fix futexMultiWaiterBit for 32bit systemsUlf Hermann2017-11-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | We don't actually need it in that case, but as the code that uses it is disabled by a constant expression we cannot disable the variable itself by a macro. The static_cast makes sure the compiler does not complain about implicitly casting a 64bit value to a 32bit one. thread/qsemaphore.cpp:156:59: error: large integer implicitly truncated to unsigned type [-Werror=overflow] Task-number: QTBUG-64261 Change-Id: I96f53e28b290e57033737b4f994f8af5b5666587 Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-10-2413-66/+210
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsmousehandler.cpp src/plugins/platforms/xcb/qxcbimage.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/manual/qtabletevent/regular_widgets/main.cpp Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Done-with: Mårten Nordheim<marten.nordheim@qt.io> Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
| * Fix build on Integrity: the compiler doesn't understand this constructThiago Macieira2017-10-231-1/+5
| | | | | | | | | | | | | | | | | | "global/qrandom.cpp", line 155: error #2000-D: attribute "destructor" is not implemented and will be ignored Task-number: QTBUG-63948 Change-Id: Icaa86fc7b54d4b368c0efffd14efa35381d4e797 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-233-0/+15
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/direct2d/direct2d.pro src/plugins/platforms/ios/qiosclipboard.mm src/plugins/platforms/windows/windows.pro Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
| | * winrt: Fully initialize CREATEFILE2_EXTENDED_PARAMETERS structOliver Wolff2017-10-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Not properly initializing all members of the extended parameter struct will cause an "invalid handle specified" exception on use. Task-number: QTBUG-63883 Change-Id: Ic3a58df864c9e29ccbadc04bd71c18c8ef34374c Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| | * Doc: State that qDebug and friends are thread-safeKai Koehne2017-10-172-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a common misconception that qDebug and friends are not thread-safe, so let's explicitly state this. Change-Id: I48d4ab8983017a9f2e7c9932a49ed573baa22929 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | QRandomGenerator: improve floating-point random generationThiago Macieira2017-10-201-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous version was good, just not optimal. Because the input was an unsigned 64-bit number, compilers needed to generate extra code to deal with HW instructions that only convert 64-bit signed input. And that was useless because a double uniformly distributed from 0 to 1 can only have 53 bits of randomness. The previous implementation did exactly what the Microsoft libstdc++ and libc++ implementations do. In my opinion, those implementations have an imperfect distribution, which is corrected in this commit. In those, all random input bigger than 0x20000000000000 has a different frequency compared to input below that mark. For example, both 0x20000000000000 and 0x20000000000001 produce the same result (4.8828125e-4). What's more, for the libc++ and MSVC implementations, input between 0xfffffffffffff001 and 0xffffffffffffffff results in 1.0 (probability 1 in 2⁵³), even though the Standard is very clear that the result should be strictly less than 1. GCC 7's libstdc++ doesn't have this issue, whereas the versions before would enter an infinite loop. Change-Id: Ib17dde1a1dbb49a7bba8fffd14eced3c375dd2ec Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | QRandomGenerator: fix the timing of the closing of the Unix random fdThiago Macieira2017-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's make it happen even later: at the time of QtCore's unloading from memory. This prevents issues with something using QRandomGenerator after the global static destructor would have run. Change-Id: Icaa86fc7b54d4b368c0efffd14eed56bbbb51cb6 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | QBasicMutex: mark the bootstrap constructor constexprThiago Macieira2017-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | QBasicMutex and QMutex are the same in bootstrap mode. Change-Id: Icaa86fc7b54d4b368c0efffd14eed63343ddb51b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | MinGW: Globally define WINVER and _WIN32_WINNT to enable Windows 7 APIOrgad Shaneh2017-10-192-4/+2
| | | | | | | | | | | | | | | Change-Id: I637b33ba6d05f40486d8da927ae5cc5148299348 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Liang Qi2017-10-175-57/+176
| |\ \ | | | | | | | | | | | | refs/staging/5.10
| | * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-165-57/+176
| | |\| | | | | | | | | | | | | Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
| | | * Revert "Do not include qfloat16 tables in arm64 builds"Allan Sandfeld Jensen2017-10-101-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are needed for older compilers that doesn't support the __fp16 extension. Reverts under the assumptions other compilers will optimize it away. This reverts commit 6dc7e468dfd052dc4cf6187843bcb1a5b82ec6ff. Task-number: QTBUG-63693 Change-Id: If780de001d8c12df0db12caaf62505f16e01b663 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Documentation: Add missing event type for non-client mouse eventsKrzysztof Kawa2017-10-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation is missing the specialized event type names in the non-client mouse event enum description. Task-number: QTBUG-55018 Change-Id: Ica35994e13fc9a637a52eeca361898f8669fdbd1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| | | * QUrl: re-fix the setPath("//path") case leading to scheme://pathThiago Macieira2017-10-061-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commits aba336c2b4ad8926dc8a000718bbb7f8a6d5a72d (in Qt 5.2) and aba336c2b4ad8926dc8a000718bbb7f8a6d5a72d (in 5.6) both tried to deal with this problem, with different levels of success. This is the third attempt (and hopefully the charm). Instead of modifying the path that the user provides, go straight ahead and declare it invalid. This is supported by RFC 3986, which declares this expansion impossible: relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-empty path-abempty = *( "/" segment ) path-absolute = "/" [ segment-nz *( "/" segment ) ] path-noscheme = segment-nz-nc *( "/" segment ) The "path-abempty" and "path-noscheme" cases are the two issues we already handle. This commit adds the third one: path-absolute, which requires that the first segment of the path be of non-zero length. That is, it is now possible again to have http://example.com//path constructed piece-wise, without it producing http://example.com/path. Additionally, it catches the case of http://example.com//path parsed from full URL then followed by setAuthority(""). Change-Id: I69f37f9304f24709a823fffd14e67a5e7212ddcd Reviewed-by: David Faure <david.faure@kdab.com>
| | | * Improve performance in QThreadPoolSvenn-Arne Dragly2017-10-042-31/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When many runnables are executed, this improves the performance by not resizing the queue for each runnable, which was the case in the previous version, because of many calls to QVector::takeFirst(). Also add a test that makes sure tryTake() is safe to call and does not leave the queue in a bad state that tries to use nullptr entries. Change-Id: I608134ecfa9cfc03db4878dcbd6f9c1107e13e90 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | QSemaphore: Improve waking up on 64-bit LinuxThiago Macieira2017-10-232-27/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By judiciously positioning of the bits, we can optimize for the case of threads trying to acquire a single token, which is what QSemaphore should be mostly used for, as it matches the POSIX Semaphore API (sem_wait, sem_timedwait and sem_trywait). If there are only waiters waiting for a single token, we know that adding n tokens means n threads can wake up. This optimizes for multi-token waiters too. For example, if we have 50 single-token waiters and 50 multi-token waiters, a sem.release(5) will wake up 55 threads instead of 100. Change-Id: I209fcd5dbc2b4e5381cffffd14de5550c75d2600 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-1738-452/+545
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/fortuneclient/client.cpp examples/network/fortuneserver/server.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore_p.h src/plugins/platforms/cocoa/qcocoabackingstore.h src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoascreen.h src/plugins/platforms/ios/qiosbackingstore.h src/plugins/sqldrivers/oci/qsql_oci.cpp src/widgets/kernel/qwidgetwindow.cpp Change-Id: Ia6dd2c52d4a691b671cf9a2ffca70deccece8f10
| * | | configure: make C++11 <random> a required functionalityThiago Macieira2017-10-162-21/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Error out if it's missing or broken (Mersenne Twister not present). This ensures that we never have a low-quality random generator in Qt. Change-Id: I0a103569c81b4711a649fffd14ec80649df7087e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Don't lose precision in QMacTimeZonePrivate::previousTransition()Edward Welbourne2017-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NSTimeInterval is a typedef for double, but the code stored its value in an int, and only then multiplied by 1000. Fix by only truncating NSTimeIntervals to int(64_t) *after* the multiplication by 1e3 to get milliseconds. While it's highly unlikely that a transition will have fractional seconds length, don't assume if you can just calculate the more exact result. Adapted-From: Marc Mutz <marc.mutz@kdab.com> Change-Id: I0911b9c945a94ca24c3dfb23ed6a849141076326 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * | Fix QWinEventNotifier for auto-reset eventsJoerg Bornemann2017-10-153-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Auto-reset events are automatically reset to non-signaled when we get notified about the signaled state. This implies that we cannot check the event state again in activateEventNotifiers. Instead, store the signaled state in a QAtomicInt and test and decrement that. This amends commit 85403d0a. Task-number: QTBUG-63555 Change-Id: I0adee3d2929783f98d91060f9106c8b5266d72fa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | Unify wording in documentation to use 'top-left' instead 'upper-left'Christian Ehrlicher2017-10-142-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt documentation is using 'upper-left' everywhere except at QRect(F) detailed description and Qt::CoordinateSystem enum description. Therefore fix it in those four places to be consistent. Task-number: QTBUG-59981 Change-Id: Ie652044d0207ea5a42888d9e1f1dc9a86b1e9410 Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io> Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * | Doc: fix QRandomGenerator missing updates after renameThiago Macieira2017-10-141-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 282065d443c2a2d6b9e32d786c2c1c7552ba3cb5 renamed the generator functions but we didn't update all the docs. Change-Id: I0a103569c81b4711a649fffd14ec877ffbfe710d Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | QRandomGenerator: improve internal noexceptnessThiago Macieira2017-10-141-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are a couple of Q_ASSERT wrapped by the new noexcepts, but most of those aren't validation of external parameters, only of internal construction. The two exceptions are the checks for pointer alignment. Change-Id: I0a103569c81b4711a649fffd14ec8523d741dfb6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Doc: move QKeyValueIterator documentation to the right fileSamuel Gaist2017-10-112-120/+120
| | | | | | | | | | | | | | | | | | | | | | | | The documentation of QKeyValueIterator was in the wrong place. This patch moves it with the other iterators documentation. Change-Id: I42ad529f72f9b19fdecfca7ddfeb6e6f4dcfebac Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
| * | Doc: fix indexOf QRegularExpression overload documentationSamuel Gaist2017-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | That overload documentation was missing the "exact" qualifier regarding the search result. Change-Id: I27a08b60f9b88ae497f8bd9d9ba6a99f4a9ab4d6 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>