Commit Graph

26136 Commits

Author SHA1 Message Date
Sérgio Martins
53697fe078 Don't allocate memory when creating an invalid QDateTime
Task-Id: QTBUG-47779
Change-Id: I5aad835c9fbf50962d64d14519ec31cf38cf9e3b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-12-10 19:17:18 +00:00
Erik Verbruggen
74c0416c99 Fix inconsistent override warnings.
For example:

../../include/QtGui/5.7.0/QtGui/private/../../../../../../../../qt5-dev/qtbase/src/gui/painting/qpaintengine_blitter_p.h:67:18: warning: 'end' overrides a
      member function but is not marked 'override' [-Winconsistent-missing-override]

Change-Id: I2845d8e4b5a7e11c57ac1933a6d152df1ef5d07f
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-12-10 18:28:26 +00:00
Joerg Bornemann
068baa9bb6 add a way to modify CreateProcess parameters
[ChangeLog][QtCore][QProcess] Added method
setCreateProcessArgumentsModifier to QProcess on Windows to enable
users to intercept and modify CreateProcess parameters.

With such a modifier, calling code can decide whether to inherit
handles, modify the STARTUPINFO struct, and pass its own
combination of process flags to CreateProcess.

Task-number: QTBUG-390
Task-number: QTBUG-6917
Task-number: QTBUG-9350
Task-number: QTBUG-24619
Change-Id: I14757dbbacfebb1c89f52402d36fba0ba9c45f3a
Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-12-10 16:29:33 +00:00
Anton Kudryavtsev
4ae0b655b2 QCosmeticStroker: fix misleading use of & on bool operands
Change-Id: I0e885391b220c30fc1482446d1dc9a2be035d45a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-12-10 15:44:10 +00:00
Jake Petroules
f157babbed Move a reusable image conversion function into QCocoaHelpers.
Change-Id: I5fc8f84bd504e405968e212b3125179a2273ae79
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2015-12-10 14:38:46 +00:00
Ulf Hermann
1f2734b82b Xcb: Fix debugging code
We need to pass the correct connection and we need a specialization for
reply pointers. Also, there is not much of a point in first creating
a QString from a QByteArray, only to retrieve a QByteArray again.

Change-Id: Ia1bb5655f6229638e3bd2339acadeffc80561b9e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2015-12-10 10:28:56 +00:00
Tor Arne Vestbø
4c29eba248 Don't write absolute TargetSpec/HostSpec paths to qt.conf
Change-Id: Ifc25a26c5e59a214bdd8dc9398b4d0047fbb5ca2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-12-10 07:23:00 +00:00
Friedemann Kleint
1289bc8172 Tests: Remove empty init/cleanup slots, constructors and destructors.
Move some code (like registrations of meta types) from init() to
initTestCase() in the process.

Change-Id: I57db5156647cfadab554fbed853b2e68b2815f3b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-12-10 05:26:05 +00:00
Giuseppe D'Angelo
872b9b231e QLineEdit: fix the shortcut override events on a readonly line edit
When a QLineEdit is readonly there's a discrepancy between key press
events and shortcut override events. For instance, presses Ctrl+C
copies the text unless there's also a shortcut for the same key sequence.
In this case, the shortcut override event is not handled, and no text
is copied. Fix it by splitting the handling of shortcut override
events between "read only" access (copy, select, etc.), which still
makes sense on a read only line edit, and write access (paste, ...)
which doesn't.

[ChangeLog][Important Behavior Changes][QLineEdit] QLineEdit will
now accept certain shortcut override events even if it is read only.

Change-Id: Ie5b048259b99a1eff0581129e3ad97f27a88fe86
Task-number: QTBUG-21217
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-12-09 19:04:59 +00:00
Thorbjørn Lund Martsum
410aa20f07 QAIV - allow users to control single step in ScrollPerPixel mode
The documentation says that we scroll one pixel, but changing the
behavior in 934f062203 to do that
was not well received.

People were relying on the undocumented behavior - and the new behavior
was considered to be a regression. (Nobody called setSingleStep since
Qt in many cases provide a reasonable singleStep - which implied that their
programs scrolled with 1 pixel which was quite slow). Furthermore getting
the old behavior (auto set of single step) was nearly impossible.

However the revert (done in 0e69230d02)
gets us back to QScrollbar::setSingleStep not working in pixel scroll mode
(even without it being documented - but we should also have a working API
rather than documenting that it is not working)

The previous approach was directly prevented Qt from changing
single step (on e.g resize) at all. This patch only prevents Qt from
changing when a user explicitly has called the function
QScrollBar::setSingleStep (in pixel scroll mode).

That is we expect that calls to setSingleStep means that the user actually
wants to set the singleStep and doesn't want Qt to control that value.

Furthermore it is possible to switch back to the automatically adjusted
singlestep with QScrollBar::setSingleStep(-1).

[ChangeLog][QtWidgets][QAbstractItemView] QTBUG-7232 - In ItemViews
when scrollMode is set to scrollPerPixel, it is now possible to
change the single step. Qt will automatically adjust the single step
until setSingleStep is called. When setSingleStep is called it will
however respect the set and stop doing automatic changes of the value.
Calling setSingleStep(-1) will switch mode back to automatic adjust.

Task-number: QTBUG-7232
Change-Id: Ibfe0caa9751d3bcc11bfc6e0654a3d1ac35ac8ae
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-12-09 17:53:59 +00:00
Tor Arne Vestbø
49568df954 iOS: Enable non-pixman NEON drawhelpers for both 32 and 64-bit
The pixman drawhelpers are implemented using GAS syntax, which the
Clang assembler doesn't handle, nor do they work on 64-bit ARM, so
we disable them selectively. They are only used for 16-bit surfaces
anyways, so it not a big deal on iOS.

Change-Id: I78417fabd7f671f9c5d94b6e5fa5ce10d3fc1d27
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2015-12-09 17:48:55 +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
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
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