Commit Graph

21683 Commits

Author SHA1 Message Date
Tobias Koenig
ddc884c841 Use O_CLOEXEC flag POSIX shared memory handle
Change-Id: Ie554c5963112b88c058082085dbc9eed42a41861
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-09 10:59:00 +01:00
Tobias Koenig
96995db4af Add POSIX IPC support to QSystemSemaphore and QSharedMemory
This patch is a forward-port from 4.8 branch
(d869e1ad4b0007757e97046609de2097cd9e9c5d).

Change-Id: I6ae36a5417d1176fbecf775668f6033b1cb22a94
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-09 10:58:52 +01:00
Tobias Koenig
c3e50db199 Add a configure-time check for an IPC support
Adds a configure check for System V and POSIX IPC.
System V takes precedence over POSIX IPC, and if both
are not supported, QT_NO_SHAREDMEMORY and
QT_NO_SYSTEMSEMAPHORE are defined.

This patch is a forward-port from 4.8 branch
(6ef4abaa9cd7d465cbae5cbf8cb4664bef387d10).

Change-Id: I3ec20342f0f0266843479634109b67c6989dd296
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-09 10:58:42 +01:00
Gabriel de Dietrich
3d17b73377 QFileSystemWatcher: Use FSEvents FSW on OS X
This removes one of the last references to 10.6.

Change-Id: Ie23d9aba698714460e7478a421e85d4ad50d4ec9
Task-number: QTBUG-43505
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2015-01-09 10:46:56 +01:00
Andy Maloney
163af2cf53 Add OptimizedWrite & ProgressiveScanWrite options to QImageIOHandler and use for JPEG writing
Exposes two options from libjpeg: the optimize option and progressive scan option.
These are both lossless operations, so they do not change the image's quality.
Using these switches can result in smaller jpeg files.

Task-number: QTBUG-20075
Change-Id: I8d0bd6a712b8a365265b7bd517e136b0755b90cb
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-01-09 10:36:08 +01:00
Gunnar Sletta
fc5e6b37a1 Support threaded OpenGL on XCB/EGL.
Broken since 8758f532ae.

Change-Id: I04cb9a36088ab6753c9519a911d065617f88fe08
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-01-09 10:36:06 +01:00
Laszlo Agocs
532be5959f Avoid exposing dependencies from libinput support
Do not include other headers from the main qlibinputhandler_p.h that
serves as the external interface to the generic plugin for example.
This way the clients do not need to care about xkbcommon headers and
such.

Task-number: QTBUG-43498
Change-Id: I56335cb19200fee830bdf4b1d203904f741f7489
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-01-09 10:14:07 +01:00
Friedemann Kleint
b495a27d4e Introduce Windows version 10.
Detect OS kernel version 10.0 as Windows 10.

Task-number: QTBUG-43413
Change-Id: I39307cf8cc2e7cc209d6a88b8576db87086fa20e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 06:28:04 +01:00
Marc Mutz
ba5b7449a4 Unexport QVersionNumber
And only export those functions which are actually out-of-line.

This prevents exporting all the inline methods of QVersionNumber,
so we can more freely tune the implementation after its release.

Change-Id: Ie0c5e3f95fea9ec9b3dd481058db6c9f5ef2653c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:45:51 +01:00
Marc Mutz
5b720fbf5d QSizePolicy: prepare for constexpr'ifcation
...by bringing expandingDirections() into a (C++11) constexpr'able form.

Change-Id: I1922329a6f579df2b3504c8ae048224f9b229d6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:44:24 +01:00
Marc Mutz
bac0796308 QTest: update docs for toString()
Following c61f8df404, we now prefer overloading
toString() in the type's namespace over specializing the primary template.

Let the docs reflect that and add an example. Also suggest to delegate the messy
raw char pointer handling to the existing toString(QString)/toString(QBA)
overloads.

Change-Id: Id76181faba86aea52588611ea64ea9b95371a733
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:44:16 +01:00
Marc Mutz
4b08561bb0 QPair: mark relational operators and qMakePair() conditionally noexcept
The member functions are a bit more complicated, since they require
<type_traits> support, so they're left for another commit.

Change-Id: Icb792468e35c63eb1ae97f62ed023266fb86b89b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:40:26 +01:00
Marc Mutz
daaf3b8578 QPair: add member-swap
std::pair has it, too.

Change-Id: I2526b09455db5502ad38a81f3d401098d54614a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:39:50 +01:00
Marc Mutz
597a71fa99 Make qSwap() noexcept, if possible
This greatly increases the value of qSwap(), since not only does it
automatically do the parallel std+ADL lookup of swap(), but also
now centralizes the rather messy code involved to create a correct
noexcept specification.

Other code now can simply use
    Q_DECL_NOEXCEPT_EXPT(noexcept(qSwap(lhs, rhs))).

Change-Id: Ia35df4876b143e86c4150ac452a48c3775c3702b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:39:33 +01:00
Marc Mutz
0dacb1e282 QMargins: plaster API with Q_DECL_NOTHROW
This is mostly straight-forward, but some things are worth noting:

1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
   not at the contents of the function to determine whether to return true.
   The more conditionally-noexcept functions are used, the more important it
   becomes that low-level classes are correctly marked noexcept. In that, it
   is like constexpr.
2. In accordance with the rules governing noexcept specifications for the
   standard library itself, the operator/-family of functions are not marked
   as noexcept, since they have preconditions and thus a narrow contract.
   Narrow-contract functions should not be noexcept. All other functions
   have wide contracts (ie. no preconditions).

Change-Id: I2cb1f951a92dcb25eac4d9afc5b7780311e39492
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:39:11 +01:00
Marc Mutz
a92dbddac7 QRect: plaster API with Q_DECL_NOTHROW
This is mostly straight-forward, but some things are worth noting:

1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
   not at the contents of the function to determine whether to return true.
   The more conditionally-noexcept functions are used, the more important it
   becomes that low-level classes are correctly marked noexcept. In that, it
   is like constexpr.
2. In accordance with the rules governing noexcept specifications for the
   standard library itself, the get*()-family of functions are not marked
   as noexcept, since they have preconditions and thus a narrow contract.
   Narrow-contract functions should not be noexcept. All other functions
   have wide contracts (ie. no preconditions).

Change-Id: I82e5d34a0293d73ddc98ee231e17e26463ab6686
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:38:55 +01:00
Thiago Macieira
63cd16d03c Add support for printing the real thread ID with QT_MESSAGE_PATTERN
%{threadid} should have been %{qthreadptr} but we forgot to make the
change for Qt 5.4. So do it now.

[ChangeLog][QtCore][Logging framework] %{threadid} now prints the real
thread ID. On Linux, OS X, iOS, FreeBSD and Windows, the value is unique
system-wide. On other systems, it will print something that may be
process-specific (the value of pthread_self(3)). To print the pointer
to QThread::current(), use %{qthreadptr}.

Change-Id: Ie383ff864a11966cf5d095b966a30ace65d34ee6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-08 00:23:03 +01:00
Marc Mutz
982de3eccc QtWidgets: convert remaining users of QSize::transpose() to transposed()
...because transposed() is inline (and transpose() is not).

This is such a simple transformation (basically, a register rename)
that it should be inlined, even a the expense of another assignment.
(the expense being in the source, not the executable code, of course).

Change-Id: I4e5a574e899a84444de8042d305f34f5a6045a3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:13:59 +01:00
Marc Mutz
3f893e6fd9 QtWidgets: convert some users of QSize::transpose() to transposed()
...because transposed() is inline (and transpose() is not),
and because it makes the code more readable and compact.

Change-Id: I5661ee6251be638fb40c5c748aa50a89de6f7735
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:12:41 +01:00
Marc Mutz
ceb753626f QSize: plaster API with Q_DECL_NOTHROW
This is mostly straight-forward, but some things are worth noting:

1. Yes, this is necessary. The noexcept operator looks for noexcept tagging,
   not at the contents of the function to determine whether to return true.
   The more conditionally-noexcept functions are used, the more important it
   becomes that low-level classes are correctly marked noexcept. In that, it
   is like constexpr.
2. In accordance with the rules governing noexcept specifications for the
   standard library itself, the operator/-family of functions are not marked
   as noexcept, since they have preconditions and thus a narrow contract.
   Narrow-contract functions should not be noexcept. All other functions
   have wide contracts (ie. no preconditions).

Change-Id: I9fc94218a2728c272483f9c2826c265f5b11c9b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-08 00:12:26 +01:00
Kai Koehne
d72544ea11 Remove qRegisterSequentialContainer, qRegisterAssociativeContainer traces
The methods where introduced with commit 01fb843af8, but removed before
the next release in a1898f4466.

Also add a comment that we should get rid of the special Q_CC_MSVC
handling in Qt 6.

Change-Id: I8bb992a59f31a0de7e3f14f34d1d4f604ebfe8f3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-07 12:21:52 +01:00
Thiago Macieira
90e7cc172a Move a few QStringList methods up to QList<QString>
This should be completely source-compatible, aside from the indirect
header order change.

Change-Id: I4cf8800ea1bfeb3023c7319991ab8ae281c925e8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-07 05:19:47 +01:00
Giuseppe D'Angelo
2d89aee982 tst_QWidget: include QTest, not QtTest
... which is the module-wide include, bringing in the entire QtCore.

Change-Id: I5cd872efa4562917fc4e3850809cb7595710c43a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-06 22:53:19 +01:00
Thiago Macieira
82c2262b80 Disable the warning about deprecation inside qalgorithms.h
Since some of the algorithms use other ones, we should not warn about
those. The warnings are supposed to happen only in user code.

Warnings obtained with GCC 5. The Clang change is just to be on the safe
side.

Change-Id: If295899f6ff6534de7b19741d33efc0b5c4c912c
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-01-06 19:42:47 +01:00
Thiago Macieira
5c4390cc4b Remove unused QDBusMessage::timeout member
It's been there forever, but never used. The timeout is set during the
actual call.

I moved QDBusMessage::type only for padding purposes.

Change-Id: I41dd638ac423078be642077dbf17439d15b5d405
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-01-06 19:41:47 +01:00
Thiago Macieira
171644cb47 Make QDBusMessage store its own message type
Instead of the libdbus-1 constants. Though they're exactly the same
because they are based on the protocol wire format, so this is
technically a no-op change.

Change-Id: Ia2c638c4b508497ca693afd9c76e60ba9245f5e7
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-01-06 19:41:43 +01:00
Thiago Macieira
2e2cf8a549 Remove the old QDBusConnection::sender functionality
This has been deprecated since QDBusContext was introduced (Qt 4.3). So
it's time to remove the functionality.

[ChangeLog][Important Behavior Change] QDBusConnection::sender()
(deprecated since Qt 4.3) has changed to always return an invalid
QDBusConnection. To know what connection the incoming call was received
from, use QDBusContext.

Change-Id: I355efb82c14e54ed718c8f892d8267e727b19118
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-01-06 19:41:36 +01:00
Thiago Macieira
32cbb363b9 Cosmetic debugging difference for QDBusConnection
This makes the output slightly easier to read.

Change-Id: I590b9abcb0263ae5f0580391b42e179c47569a8a
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-01-06 19:40:41 +01:00
Thiago Macieira
1991647af1 Add a simple way of tracing calls to libdbus-1
Very useful to track memory leaks and other silly stuff going wrong.

Requires C++11, but since it isn't enabled by default, it's not a
problem. ALso, only works with "runtime" dbus -- for linked, use
ltrace(1) instead.

Change-Id: Iccb18516cfb729b2b1bf9ee592df4a1adefeb3b7
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-01-06 19:39:45 +01:00
Thiago Macieira
dd8b75d8fb Remove workarounds for RVCT compiler bugs
This does not try to remove support for RVCT. There has been no report
of it working or failing to work, so the status continues to be unknown.
In particular, the inline assembly code in atomic_armv[56].h remains in
place.

This commit only removes workarounds for compiler bugs or bogus
warnings, assuming that anyone using this compiler has updated since Qt
last tried to use it for Symbian in 2011. Note also how anonymous unions
are now part of the language in C++11.

Change-Id: Idc4fab092beb31239eb08b7e139bce2602adae81
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-01-06 19:38:24 +01:00
Laszlo Agocs
ccef8261d4 eglfs: Make sure there is a platform window for the backing store
Some example code creates the backing store before the platform window.
Make this case working by calling create().

Task-number: QTBUG-43543
Change-Id: I29c260f38eddd15ea09931e814c5dbd031b65505
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-01-06 15:01:53 +01:00
Sérgio Martins
5b4f875e12 QColorDialog: Fix flickering when using "Pick screen color"
With non-monospaced fonts the dialog constantly resized itself when hovering
with the mouse.

This patch has the side effect of fixing another annoyance. Don't present duplicated
information to the user, the color name is already shown in the HTML line edit
and it's also updated dynamically.

Task-number: QTBUG-43448
Change-Id: Ieaeda2a5b876cf15391616aed7d30ed352b463df
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-01-06 14:52:48 +01:00
Sérgio Martins
ebd7df6e57 qdoc: Use qgetenv instead of getenv
Fixes warning with MSVC:
config.cpp(973) : warning C4996: 'getenv': This function or variable may be unsafe

Change-Id: I32d2a521ff82ee9779fbcba76e80ef36a8e02094
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-01-06 12:44:08 +01:00
Cory Bloor
f38b7e0343 Fix QFileSystemWatcher::directoryChanged docs/test
QFileSystemWatcher does not signal directoryChanged() when files are
modified in a watched directory. QTBUG-8945 was closed with the
decision that it should not signal. Updating the docs and tests to
reflect this fact.

The test code that is being changed is a partial revert of Qt4 commit
1428cc6d71a65c1ac7123c9c4cc3cfaf225cceed. It appears that Symbian
supported directoryChanged() on modification, hence why the check
was for 0 or 1.

Change-Id: I04320c68f227ca338ce65e525956ee201fd50699
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-01-05 23:52:58 +01:00
Marc Mutz
4c1f66a0b2 tst_QHash: Factor qHash()-related test cases into a separate test
This is in preparation of adding more qHash()-related tests.

Change-Id: Iae65bf8b123e1d6ac6d1eb34d74ba4eb9df8173c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 20:18:51 +01:00
Marc Mutz
832aea1e8e tst_QSet: add a non-trivial test for op==
Change-Id: Id42b2361e8741ee0d719fd52885a2d6dfdf6a634
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 20:18:41 +01:00
Laszlo Agocs
13ec068ce2 Compile in evdev code to linuxfb
Make it compatible with eglfs. The behavior is the same: By default
mouse, keyboard and touch will all be initialized and, when having
libudev support, discovered automatically. The environment variables
QT_QPA_FB_DISABLE_INPUT and QT_QPA_FB_TSLIB can be used to used to
disable the built-in input handlers and to force tslib instead of
evdev, respectively.

This allows embedded systems and applications to easily fall back
from eglfs to linuxfb on devices that are not rendering via OpenGL.

Dynamic hiding/showing of the mouse cursor is to be done separately,
here we provide the necessary device discovery hooks only.

[ChangeLog][QtGui] The linuxfb platform plugin's input device handling
is now compatible with eglfs. The evdev keyboard, mouse and touch code
is compiled in by default.

Change-Id: I44bc661c53ae78c39b0f30486a475b4e639ab2d6
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
2015-01-05 15:55:02 +01:00
Giuseppe D'Angelo
8a4099a0aa QIsciiCodec: add an assert to silence Coverity
Coverity (not rightfully) complains that the code is using "iscii",
a uchar obtained by looking up into a table, as an index into the
"uni_to_iscii_pairs" array. Since the array is only 18 elements
long, there's the theoretic risk of accessing it past its end.

However, the lookup of "iscii" never returns values that may
actually go out of bounds. Coverity may be smart enough
to see the values that "iscii" can get and not raise the warning,
but since it does, make the code more robust and add an assert.

Task-number: QTBUG-43642
Change-Id: Id75ca105758b343102ca94137d0379c10e55581a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 15:51:01 +01:00
Giuseppe D'Angelo
bc7243d583 QColorDialog: fix a crash on small displays
On a small display leftLay is left initialized to a null pointer,
therefore don't try to dereference it.

Task-number: QTBUG-43643
Change-Id: I9d22dac88a3a853ce154a6f64b35fc113abd9262
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-05 15:50:55 +01:00
Richard J. Moore
73fcae8716 Add missing qdatastream.h includes.
Change-Id: I726041ec5e92d371bc5afb9b7f8cb854bfd41451
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-05 13:13:09 +01:00
Marc Mutz
1049b36fc2 QFlags: plaster API with Q_DECL_NOTHROW
Yes, this is necessary. The noexcept operator looks for noexcept tagging,
not at the contents of the function to determine whether to return true.

The more conditionally-noexcept functions are used, the more important it
becomes that low-level classes are correctly marked noexcept. In that, it
is like constexpr.

Change-Id: Ia1aebf9b8d73fd8164c10dfca27a710934ba79a8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 13:05:00 +01:00
Marc Mutz
6ac7e2f710 QCursor: add move ctor
QCursor already dealt with d == nullptr, so this is trivial.

Change-Id: Ib2c6a3f0dc8b93035ffe3059cdce925463706e10
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 13:03:20 +01:00
Milian Wolff
cd82be5c17 Use QStringLiteral to prevent runtime string conversions.
Change-Id: I0b2f06f9f09868051e84af80b2c61b5ada99af69
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2015-01-05 13:02:58 +01:00
David Edmundson
54079de9f9 Add annotation to rename methods created by qdbusxml2cpp
Under DBus it is possible to have methods and signals with the same name
or have methods which are reserved c++ keywords.

For example the logind session interface has a signal and method both
called Lock.

This patch allows generated methods to use a different method name
specified in the annotation that the original DBus name in the DBus
interface in a similar manner to how one can rename accessors.

[ChangeLog][QtDBus] Add annotation org.qtproject.QtDBus.MethodName to allow
autogenerating C++ methods with different names to the original DBus method

Change-Id: I08bbe77554fbdd348e93f82d45bab0d75d360c27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-05 12:29:14 +01:00
Giuseppe D'Angelo
aeceb5e383 QColorDialog: merge two consecutive ifs with the same test
Change-Id: I931bf8f61f95c879522daabf4fc9d6f5801a307b
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-01-05 11:02:08 +01:00
Andy Shaw
f444b25ac1 Add a platform function to enable setting the touch flags on Windows
This makes it possible for the flags that RegisterTouchWindow takes to be
specified after the window has been created.

Task-number: QTBUG-41433
Change-Id: I166143875ef54ab6a249cffb31d017845a694a01
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
2015-01-05 07:49:15 +01:00
Giuseppe D'Angelo
84a3dacf46 QItemDelegate: let QTextEdit and QPlainTextEdit receive tab keypresses
We already let enter/return key presses to reach text edits instead
of closing the editor. Do the same for tab/backtabs.

[ChangeLog][QtWidgets][Important behavior changes] QItemDelegate will
now not close a QTextEdit/QPlainTextEdit editor when the tab key
is pressed; instead, the key will reach the editor.

Task-number: QTBUG-3305
Change-Id: Ife9e6fdc5678535c596d1068770b0963134d8d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2015-01-04 18:33:49 +01:00
Marc Mutz
c61f8df404 QtTest: call toString() as a normal function
toString() is both a function template and a set of overloaded
functions (for const char* and const void*). So don't explicitly
specify the function template arguments (they're deduced from the
arguments anyway). This enables overloading toString() as well as
specializing the template.

[ChangeLog][QtTest][Important Behavior Changes] toString() can now be
overloaded (instead of just specialized) for custom types, and is now
reliably found through argument-dependent lookup (ADL).

Change-Id: Ic4a622d236ad7f0e4142835353f1b98bf2dc6d4c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-04 09:43:04 +01:00
ala
876c2164f4 Document -plugins argument in qmltest usage help
Change-Id: Ia624fcefe77a456424bcaa00b106ef7f69abb6b9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2015-01-03 22:24:32 +01:00
Thiago Macieira
cd407e1bc6 Fix undefined behavior found by GCC 5
GCC said:
qtldurl.cpp:51:50: error: loop exit may only be reached after undefined behavior [-Werror=aggressive-loop-optimizations]
qtldurl.cpp:51:48: note: possible undefined statement is here
     while (tldIndices[index] >= tldChunks[chunk] && chunk < tldChunkCount) {
                                                ^

That's because we check whether chunk is still valid (less than
tldChunkCount) after we've dereferenced tldChunks[chunk]. That is, we've
already read tldChunk[2].

Change-Id: I79b6a1ea9a2454813d6cce7596fc2bb6d972d097
Reviewed-by: David Faure <david.faure@kdab.com>
2015-01-02 14:58:10 +01:00