Commit Graph

26336 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
c5e972eb87 QFileDialog: Call reject() on Key_Escape even when itemview has focus
Replace hide() call (present in itemViewKeyboardEvent since Qt 4.5)
by reject(). Add signal spy to existing test function.

QDialog doc states that reject() will always be called on Key_Escape.
hide() is not enough: it makes exec() terminate and return the proper
value, but the signals finished(int) and rejected() will not be sent.

Task-number: QTBUG-7690
Change-Id: Ica4ae2843574478c5b9a7672f871f3ef3f16f3c9
Done-with: Jan Blumschein <jan@jan-blumschein.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-12-09 09:36:00 +00:00
Mike Krus
52e994c8a3 Favor OpenGLES 3 on iOS if available
First tries OpenGLES 3 context since it’s strictly compatible with
OpenGLES 2. If it fails, then try 2.

This is required to use QOpenGLFramebufferObject::blitFramebuffer
without having to look at using an Apple-specific extension.

Change-Id: I01f8f058fa82e7f2c90d1b894ad36f3d3939c994
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-12-09 09:35:56 +00:00
Friedemann Kleint
f044b3cc67 QWinRTFontDatabase: Add "Arial" as alias for "Helvetica".
Otherwise, the first font from the list is used ("Algerian" or similar),
making the widgets/richtext/textedit example look bad.

Change-Id: Ia5bb8879f167fef7ad7e81611760ee042abf8da3
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-12-09 09:35:53 +00:00
Mark Brand
02a730331e qsql_sqlite: fix segfault in dtor of orphan result
d79ae90466 accidentally removed the check
on the driver pointer before dereferencing it. This causes a segfault
when deleting a result object after its driver has already been deleted.
This situation can arise when a database is removed, explicitly or
probably also upon unloading the driver plugin, while related
results still exist. The problem affected
qttools/tests/auto/qhelpcontentmode.

Task-number: QTBUG-49836
Change-Id: I8ce8f8a5e27d787309ac2ff644b388e333d76435
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2015-12-09 08:41:54 +00:00
Mark Brand
371c2e4786 qsql_sqlite and qsql_sqlite2: don't hold driver data in result
Change-Id: Ia4f6adc6daaea97ac06246e9d01c6561de1227ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-12-09 07:32:32 +00:00
Mark Brand
a5cd081879 qsql: remove QSqlCachedResultPrivate::forwardOnly
The override creates unnecessary complexity.

Change-Id: I72e6cfd2515315ecb5e7a9744a275f06c90be8d9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-12-09 07:32:22 +00:00
Mark Brand
2b1534848b qsql_odbc: remove forwardOnly override
Change-Id: I243a374f8053639dcb3213478a1c65855d8613b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
2015-12-09 07:32:07 +00:00
Thiago Macieira
a48b8ecc9c configure: don't test AVX512 if AVX2 wasn't found
Change-Id: I14839ba5678944c2864bffff14176f0e9236ad8c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-09 00:07:52 +00:00
Anton Kudryavtsev
8dc43adcbb QtBase: use preincrement for iterator types
... because it's useful for non-primitive types.
Except for index-based loops, these were the only two
remaining instances in QtBase.

Change-Id: I0fafa502d78a70f98b4a90f4d3c7fdfbb401a90f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-12-09 00:07:32 +00:00
Marc Mutz
6de49f4ab6 QString: where possible, re-use existing capacity in op(QChar/QL1S)
If the LHS is detached and has existing capacity that is large
enough to hold the RHS, re-use the memory instead of allocating
a new buffer and throwing away the old.

Change-Id: I53d42825da92c264c7301e8e771cba9fb35c321b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-08 23:48:12 +00:00
Giuseppe D'Angelo
f37ea6c5c6 Remove dead code from QWidgetLineControl
The code for _q_clipboardChanged comes from some ancient time
(Qt 3's QLineEdit::clipboardChanged, subsequently refactored in Qt 4
and Qt 5). The best part: it has always been a slot doing absolutely
nothing. Get rid of it.

Change-Id: Icc2c71920377d069529bb7ed7c40c15f46fbb455
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-12-08 19:40:41 +00:00
Tobias Koenig
bee2ad068e Haiku: Fix compilation of network library
Like on some BSD systems, the member of the ifreq
structure is called ifr_index and not ifr_ifindex
on Haiku OS.

Change-Id: I273de0c703b1c89dbac537c68e52db219d2da50e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-08 19:18:51 +00:00
Tobias Koenig
df3a05b918 Haiku: Implement QLockFilePrivate::processNameByPid
Change-Id: Ie9b76d14f901f5aadf7409183165eaccc288effd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-08 19:18:20 +00:00
Alex Trotsenko
330f8f6d80 Allow Q_CHECK_PTR when asserts are forced
Since the commit 9f83e75d3fbfc01a5ca8d87b4c33ca1ad848387d we can build
the release packages with Q_ASSERTs still enabled. As this feature was
targeted to embedded platforms it would be nice to enable Q_CHECK_PTR
macro as well.

Change-Id: I2d549d92b7196935665d927e6aaed3e9f31593b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-08 19:10:15 +00:00
André Klitzing
63827c4d27 Add PointerToMemberFunction for ctor of QSignalTransition
[ChangeLog][QtCore][State Machine] Added constructor overload that
takes a pointer-to-member for the QSignalTransition.

Change-Id: I80ac6e16d0edf7d2ab09882b6f6db4cbd73364e1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-12-08 17:07:04 +00:00
Marc Mutz
d6ffbedc49 QString::vasprintf: Extract Method parse_length_modifier
... and simplify it:

De-duplicate ++c by moving it from every case into the
switch statement, undoing it only in the default case.

Introduce a small helper function can_consume() for dealing
with the two-letter length modifiers.

Also return the result from each case instead of storing
it in a temp variable.

Change-Id: I28a527920aabba067ebb2152a67995c8f2ec7ae7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-08 16:24:57 +00:00
Kai Koehne
2baeeb4026 Win: Use native separators in QLibrary errors
Fixes output like

  plugin cannot be loaded for module "QtWebEngine": Cannot load library D:/dev/qt/5.6/msvc-2015-32/qtbase/qml/QtWebEngine/qtwebengineplugind.dll: The specified procedure could not be found.

Change-Id: I159113a6a1f40b924905da15267a42e5b627d56e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-08 08:14:48 +00:00
Edward Welbourne
64ab4de4b0 Teach qmake's #include parser to recognize C++11 Raw strings.
Can't sensibly test unless the compiler does support raw strings,
since any test that would catch qmake's (prior) inability to parse raw
strings would necessarily confuse the C++ compiler in the same way.
This even applies (in test app code) to any #if-ery around the raw
string, since tokenization happens before preprocessor directives are
resolved.  So the #if-ery on Q_COMPILER_RAW_STRINGS has to be in
tst_qmake.cpp, not the test app it builds.

Change-Id: I4a461f515adff288b54fb273fd9996f9b906d11c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-08 08:13:32 +00:00
Joerg Bornemann
cbb2ce0f91 Remove Wow6432Node versions of Visual Studio registry keys
The Visual Studio registry keys are stored in the 32 bit view.
Extend qt_readRegistryKey with an option that enables the caller to
choose the 32 bit or 64 bit registry view.
We now read the Visual Studio registry keys from the 32 bit registry
view even in a 64 bit build.
Adding the next Visual Studio version will become a bit easier.

Change-Id: I7300b992be6058f30a422e3f1fe0bafade6eea54
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-08 06:37:57 +00:00
Thiago Macieira
3304ea8f0e syncqt.pl: say "ERROR" when it's an error
Change-Id: I0f2ce894387048f78465ffff141cdae9ea760175
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-08 06:32:24 +00:00
Thiago Macieira
bdd4ddd8fa QNetworkInterface: fix support for address labels on Linux interfaces
Commit 64a1448d87 (Qt 5.2) caused
QNetworkInterface to report address labels (a.k.a. interface aliases) as
separate interfaces. This is caused by the fact that glibc, uClibc and
MUSL copy the address label (netlink address attribute IFA_LABEL) to the
ifa_name field, which made QNetworkInterfaceManager think that it was an
interface it hadn't yet seen.

Address labels are the old way to add more than one IP address to an
interface on Linux, for example:
    ifconfig eth0:1 192.0.2.2

Those do not create a new interface, so the "eth0:1" label maps to the
same interface index as the parent interface. This has been deprecated
for 10 years, but there are still tools out there that add addresses in
this manner.

This commit restores behavior compatibility with Qt 4.2-5.1. The Qt
5.2-5.5 behavior is incorrect because it reports more than one interface
with the same index. On systems configured like the above, the
tst_QNetworkInterface::interfaceFromXXX test was failing.

Change-Id: I8de47ed6c7be4847b99bffff141c2d9de8cf7329
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-12-08 06:32:22 +00:00
Thiago Macieira
401507b348 Fix constructing a QSharedPointer<const> of a QEnableSharedFromThis type
It should compile, since the std::shared_ptr does.

[ChangeLog][QtCore][QSharedPointer] Fixed a problem that would cause a
compilation error when constructing a QSharedPointer of a const type
when the type derives from QEnableSharedFromThis.

Task-number: QTBUG-49748
Change-Id: I8de47ed6c7be4847b99bffff141c84f5e0b6bea8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-12-08 06:32:20 +00:00
Thiago Macieira
7499e642e0 QVariant: retain duplicate keys when converting
Task-number: QTBUG-49520
Change-Id: I3e15a26e0e424169ac2bffff1417e3f4398c2277
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-12-08 06:32:18 +00:00
Simon Hausmann
3ec31ef9c5 Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I2532c7f7db5e6cc3ef09753d886279816dd662b2
2015-12-08 07:09:47 +01:00
Friedemann Kleint
4ad8798de4 QPlatformWindow::initialGeometry(): Pass screen when scaling.
Otherwise, the window may up outside the display area when centering
on a secondary screen and the primary screen has a different scale factor.

Task-number: QTBUG-49803
Change-Id: I91ec7c5348722a90012f80a247e662e96bcbb391
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-12-07 19:38:15 +00:00
Venugopal Shivashankar
df57e3a33f Doc: Add the missing styles to get multi-column classes list
Add two- and three-column layouts for the 'All C++ Classes'
list. Also affects the layout of 'All QML Types' page.

Task-number: QTBUG-49376
Change-Id: I80953c0955dbc37db5aa4c60eb9ea8e3023a77f2
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
2015-12-07 19:38:04 +00:00
Friedemann Kleint
60536d7421 WinRT: Prepend '.' to default file suffix.
IFileSavePicker::put_DefaultFileExtension() fails when the '.'
is missing, causing the QtWidgets-based dialog to show up (Windows 10).

Change-Id: Ifcb870431b792ffa8e4a608dec999225e8383fa9
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-12-07 19:37:37 +00:00
Friedemann Kleint
df053dc642 WinRT: Add RETURN_[]_IF_FAILED_WITH_ARGS macros.
Make it possible to pass arguments to the messages by
introducing variadic macro versions of RETURN_[]_IF_FAILED.

Change-Id: Iec27adb33d9d3211fdc299f07777fcdf33f08a93
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-12-07 19:37:33 +00:00
Friedemann Kleint
9744ca1085 Add QStyleHints::showIsMaximized().
Expose QPlatformIntegration::ShowIsMaximized similarly to
QPlatformIntegration::ShowIsFullScreen.

This allows for applications to adapt their UI to mobile/desktop
accordingly.

Change-Id: Ic14d16fde11d7d2740b2f4092ae12e88a2f522fd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-12-07 18:07:41 +00:00
Martin Klapetek
891c98ebd6 Don't treat "/etc/localtime" in TZ env var as a valid timezone id
On some Debian distros, the TZ environment variable can be set to
":/etc/localtime", which libc defines as "default value". If this is
set, the current QTimeZone parsing code will return "/etc/localtime"
as the system timezone id, which is clearly wrong.

So in that case, just unset the ianaId variable and let the other
blocks look for the timezone.

Change-Id: I3f5795d0a05f4974a60556387a07a1e2e1e7aa30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-07 18:03:17 +00:00
Olivier Goffart
9dde61f4b3 Optimize qt_findAtNxFile by reducing the amount of allocations
Change-Id: I94a2b40933f9469f509a4cc54d68138696704ba2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-12-07 16:56:37 +00:00
Olivier Goffart
420b4dbece Android: Implement QInputMethod::keyboardRectangle
We can use getWindowVisibleDisplayFrame to know the height on the
keyboard, and we can use getLocationOnScreen to find out how much
the view is scrolled. Since onPreDraw is always called when the
view is scrolled or when the keyboard appears or disapear, we can
call the native functions from there.

This is not working for floating keyboards.

[ChangeLog][Android] Implemented QInputMethod::keyboardRectangle

Task-number: QTBUG-40731
Change-Id: I7848eb34fece410b29a06bf0bbb2313112fffa68
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2015-12-07 16:56:25 +00:00
Olivier Goffart
7908da98f0 Android: Fix QInputMethod's visible property
There are many cases in which finishComposingText is called and it
does not mean the keyboard will be hidden.
Add a check that there are space reserved for the keyboard before
closing it.

This is not helping with floating keyboards, but it's already better.

[ChangeLog] Made QInputMethod's visible more accurate

Task-number: QTBUG-42444
Change-Id: I4d706f1ea5ba2f0f6d3ec1921139317bc4f8dafb
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2015-12-07 16:56:14 +00:00
Marc Mutz
6f87f2d23f QtWidgets: mark some constructors explicit
Non-public API.

Change-Id: I68628c51df815f26e8de7522629a611f805673bb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-12-07 13:41:20 +00:00
Marc Mutz
bc6d677b7e QApplication: replace some sneaky code with a strategic goto
Instead of replacing the container iterated over, in the middle
of the loop body(!), place a label in front of the loop and
use goto to restart the entire loop.

This allows to mark the variable 'list' const, which is a
prerequesite for replacing the loop with a C++11 range-for
one.

But it also makes the code less cryptic. No-one expects the
container to be re-seated in the middle of the loop.

The compiler agrees: saves 144b of text size on optimized
AMD64 GCC 4.9 Linux builds.

Change-Id: I22d07672a1bbe9d7ffb083ae231eda760c29d350
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-12-07 13:41:17 +00:00
Marc Mutz
1264c22b86 QAbstractItemView: replace a QPair with a dedicated struct
In a QPair, the member names {first, second} have no semantic
value. A simple struct, while not as featureful as QPair, can
be given meaningful member names, {rect, index}, in this case.

Change-Id: If1e289ecee82a1cb020ac3a854efd2ec1096493b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-12-07 13:41:13 +00:00
Risto Avila
c7b26e632e Add missing include to qabstractitemmodel_p.h
qabstractitemmodel_p.h should include qabstractitemmodel.h since
it's using QModelIndex.

Change-Id: Ie2e3f9e1b324e080e1159e49fa89dd70f920dd1d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-12-07 13:24:49 +00:00
Friedemann Kleint
270aa5b58d WinRT: Set TemporaryError in QNativeSocketEngine::accept() when no connections are pending.
This suppresses the emission of QTcpServer::acceptError() from
QTcpServerPrivate::readNotification().

Task-number: QTBUG-49776
Change-Id: Icfb686d44c0a396ae2bf5867bd31a91232ef3e3c
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-12-07 11:47:26 +00:00
Marc Mutz
80ae3baed0 Q_UNIMPLEMENTED: remove explicit file, line and funcinfo information
This information is already registered by the QMessageLogger ctor.

Change-Id: Iac378777675f00ad5d07b938605484b1466aa5c5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-07 11:29:28 +00:00
Allan Sandfeld Jensen
a76f289714 Initialize function tables without QGuiApplication
QImage can be used without QGuiApplication, but wihout QGuiApplication
the accelerated methods would not be used.

This patch changes the initialization of the QtGui function tables to
happen in static object constructors on QtGui load, instead of in
the QGuiApplication init.

Change-Id: Ib58982fbc50fd79122352d021d93a3c99aca5043
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-12-07 10:57:57 +00:00
Rainer Keller
2766215c9e Remove additional copyright notice
Change-Id: I181579d755a79e2e0a26ff2de119d9642183a2ca
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2015-12-07 10:51:45 +00:00
Sérgio Martins
4b365cb446 Fix typo in QObject::disconnect() documentation
Change-Id: I65f95c7f22399b9fea65c44b971afc7efbb73d64
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-12-07 10:23:49 +00:00
Louai Al-Khanji
f0a6d45cc8 qt_poll: split out into separate file and sanitize build
The qt_poll function calls recv to query whether fds marked by select
as readable should be marked POLLIN or POLLHUP in the pollfd structure.
On many platforms such as QNX this requires extra link-time libraries
which were not previously required by QtCore.

While the qt_poll function is intended as a fallback mechanism only for
those platforms which do not implement poll natively, the function was
compiled unconditionally whenever QT_BUILD_INTERNAL was defined, e.g.
in developer builds.

Additionally the function was included on those systems that define poll
in system headers so that configure determines build-time availability,
but do not define _POSIX_POLL > 0 or indicate POSIX:2008 compliance via
either the _POSIX_VERSION or _XOPEN_VERSION macros. On those systems a
sysconf query for _SC_POLL was performed to determine at runtime whether
to call the system poll or qt_poll.

Both of these cases are in fact counterproductive. In the first case the
sole consumer of the function is a single manual unit test. In the
second, to my knowledge no platform requires the runtime fallback.
Despite that, we were forcing an extra dylib in both cases.

Both cases are fixed by 1) moving the implementation into its own file
for the unit test to include and 2) dropping the dynamic fallback if
configure determines availability of poll at compile-time.

This also reverts commit 1377709711, which
added -lsocket for QtCore on QNX.

Change-Id: I2dd10695c5d4cac81b68d2c2558797f3cdabc153
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-05 00:47:36 +00:00
Mark Brand
c456fb366a qsql: remove empty Result destructors
Change-Id: If7594421fe5a584912e092feb18002f56d6d30f3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-12-05 00:19:39 +00:00
Mark Brand
d79ae90466 qsql: apply Qt's PIMPL idiom to Q*ResultPrivate
QResult and QResultPrivate are not derived from QObject and
QObjectPrivate respectively, but can still benefit from Qt's
PIMPL idiom. There are several interrelated aspects to this:

  - Base all driver ResultPrivate classes on QResultPrivate.
    Previously, each level in the Result hierarchy tended to keep
    its own private data class.

  - The ResultPrivate class initializes its own Result (q_ptr)
    and Driver members. This ensures that these pointers are
    correctly set in time for the ResultPrivate constructors
    and Result constructors. This is more efficient and makes
    it a lot easier to follow what's being allocated, initialized,
    and cleaned-up.

  - Use macros Q_DECLARE_PRIVATE, Q_DECLARE_PUBLIC, Q_D, and
    Q_Q for access to and from ResultPrivate objects.

  - ResultPrivate classes refer frequently to their counterpart
    DriverPrivate. Various patterns were used to do this. Now
    Q_DECLARE_SQLDRIVER_PRIVATE arranges this uniformly while
    hiding ugly casting. It creates a public method in the
    ResultPrivate returning the correctly typed pointer to the
    corresponding DriverPrivate object. Since the method is public,
    the Result class and helper classes and functions can also use it.

  - The explicit const is removed from QResultPrivate::sqldriver,
    even though it is treated (mostly) like a const within the
    context of Result and ResultPrivate. This is the same pattern
    seen in Qt's PIMPL idiom. The macro created getter methods
    take care of const.

  - qsql_mysql was using a signal/slot connection to zero its own
    copy of the driver pointer when the driver was destroyed. This is
    no longer necessary.

Change-Id: Ida4933bc92fb3e9a05ea4b53b48085894734e36e
Reviewed-by: Israel Lins Albuquerque <israelins85@yahoo.com.br>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2015-12-05 00:19:27 +00:00
Thiago Macieira
f5f47987ce qCount{Leading,Trailing}ZeroBits: Use __builtin_clzs for 16-bit
If possible.

The BSF/BSR/TZCNT/LZCNT Intel instruction does not exist for 8-bit. And
it's a good idea to use the 32-bit instruction instead of the 16-bit one
for that case, to avoid the Length Changing Prefix (LCP).

GCC doesn't allow us to use __builtin_cl[tz]s unless BMI is active,
while ICC generates the same code either way (Clang understands
__has_builtin).

Change-Id: I8de47ed6c7be4847b99bffff141c91603c7024dc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-12-05 00:11:28 +00:00
Thiago Macieira
2fb42eb4af Properly set (sa|sin|sin6)_len on Unix systems that need it
Change-Id: I7de033f80b0e4431b7f1ffff13f90288a50606e7
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-12-05 00:10:37 +00:00
Thiago Macieira
4242fe0a03 Silence cl.exe warning about -arch:SSE2 being unknown in 64-bit builds
That implies we need to differentiate between a variable set but empty
and an empty variable. GCC, Clang and the Intel compiler accept -msse2
on 64-bit builds without warning (they also accept -mno-sse2), but the
Microsoft compiler does not have that option.

Change-Id: I54233388ba10994996ae3e749fd829085e8fd7b7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-05 00:10:35 +00:00
Thiago Macieira
d386ec1fd8 Add some interesting warning options to the compilation
This should help improve the cleanliness of our source code, including
compliance with the C++ standards. They apply to all of our code except
examples (they don't load qt_common.prf).

Change-Id: Ia0aac2f09e9245339951ffff13c94663c1901766
Reviewed-by: David Faure <david.faure@kdab.com>
2015-12-05 00:10:33 +00:00
Thiago Macieira
dae77465d1 syncqt: print errors and warnings to stderr
Change-Id: Ib056b47dde3341ef9a52ffff13ef5f6b8d21aeab
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-05 00:05:24 +00:00