Re-implement QVector::count

There is no need for a custom algorithm as we can use
std::count

Change-Id: Id1ab514c7cd8f52efe49b27712121415d7ca4455
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reduce QtCoreLib size by not repeating "UTC" string too often.

It is a minor reduction, in release build it is ~200 bytes

Change-Id: I4f7972c95769f2e0ca1ddc935ff7a0a6b4379e2a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Fix QJsonObject const index operator

The operator should always return an undefined values for an empty
object

Change-Id: Ic38f7660d77c64b2d001967bc5109df4185db74a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reading QJsonObject property should not modify the object itself.

Before this change such code:

    QJsonObject o;
    o["blah"];

would create property "blah" and assign null value to it, while
this code:

    const QJsonObject o;
    o["blah"];

would not. The change unifies the confusing behavior. Now reading
a non-existing property, is not causing a property to be added
in any visible way.

Internally QJsonObject stores a special hash of undefined, but
referenced values. Such reference is supposed to not live long,
only to the first compacting or assignment.

Change-Id: Ib022acf74ff49bad88d45d65d7093c4281d468f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix QJsonValue comparison.

QJsonValue, while comparing two QJsonObjects, should consult also length
of the objects, because a different than null base pointer doesn't mean
that an object is not empty.

Change-Id: Ibee1849ef9fed15d32f2c8f2aad9b053846e46b7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix QJsonValue comparison.

QJsonValue, while comparing two QJsonArrays, should consult also length
of the arrays, because a different than null base pointer doesn't mean
that an array is not empty.

Change-Id: If76739355a4e74b842e836289565f98d95c006d5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
tst_qmdiarea: Fix widget leaks.

Change-Id: If2ecf2c080f9eb8416b9a3d4104584681862c266
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
tst_qgraphicsproxywidget: Fix widget leaks.

Change-Id: I953e308e2380c87a69ca1d22e6ac036c57deccda
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Remove redundant static_cast from QVariantAnimation

QVariant::convert accepts int as an argument, there was no need to cast.

Change-Id: I774c9567972860d887e17acb91ec332ffcebd9d5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix compilation on ARM without ARMv6T2

The "rbit" instruction requires ARMv6T2 or higher. This was found in the
CI when building the imx6 target:

Compiler: arm-poky-linux-gnueabi-g++
Flags: -mfloat-abi=hard -mfpu=neon
Errors from the assembler:
  {standard input}:3078: Error: selected processor does not support ARM mode `rbit r3,r3'
  {standard input}:7341: Error: selected processor does not support ARM mode `rbit ip,ip'

That compiler defaults to ARMv5T. That's obviously wrong for an i.MX 6,
which is a Cortex-A9 (ARMv7), but the correction applies for older
processors.

Change-Id: I56c276fa411977dd7cd867d62adf021e4909302c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Use simd.prf for building MIPS DSP code

No need to duplicate the extra compiler code.

Change-Id: Ic5656d2f4500c19e0428a7eec1cbcef6c353e99b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Restore Neon "detection" in Qt

We don't actually detect whether the compiler can create Neon code or
provides Neon intrinsics. Most of them do, so that test would be mostly
moot. We removed the detection previously because we couldn't
automatically enable Neon due to leakage of instructions outside the
areas protected at runtime.

Instead, we rely on the mkspec properly passing the necessary flags that
enable Neon support.

This commit does not change that. All it does is verify whether the arch
detection found "neon" as part of the target CPU features. In other
words, it moves the test that was in simd.prf to configure.

It does fix the Neon detection in configure.exe, which was always
failing for trying to run a test that didn't exist
(config.tests/unix/neon).

Change-Id: Id561dfb2db7d3dca7b8c29afef63181693bdc0aa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Rewrite simd.prf to share more code

This was a long-time coming.

One innovation from this commit is that it will add the source to
SOURCES if the compiler is already generating code for that specific
target. That is currently always the case for Neon, and the MIPS DSPs
since that is the only condition in which configure will enable those
targets. And because of qt_module.prf, it's also always the case for
SSE2 (but not for SSE3 or higher).

So simplify the .pri files by removing always-true conditions.

Change-Id: Ib24af74717b652c9a6be246e3c17a839470f37da
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Remove non-existing function.

Change-Id: I1c201453d069dbc3d981e1ff3789570af09b662c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Integrate tst_bench_qringbuffer into the build tree.

Change-Id: Id1d091889c3ba5e343d1237f016fdc22f7dfe413
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Use the 3-argument testAndSet in the fetchAndXxx operations

Saves us from an extra load in the loop when the result is already
there.

Change-Id: Ib65b5b13f27975b8fc88be9b888c19505bf5e07c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>