Commit Graph

8 Commits

Author SHA1 Message Date
Robert Loehning
eeb0b8fd21 Revert "Revert "Utils: Remove old compiler support code""
Thomas provided a smaller fix.
This reverts commit 78fb7f44bf.

Change-Id: I1edff6477526fe4ce29df38852f47fe49117561e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-01-19 12:21:43 +00:00
Alessandro Portale
78fb7f44bf Revert "Utils: Remove old compiler support code"
This reverts commit 8a32bcc5e7.

Broke build with MSVC 2015, update 3

Change-Id: Icb59b70fb00ea2a2ecc8d26c8177d21d82aaccf2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-01-19 11:47:26 +00:00
Marco Bubke
8a32bcc5e7 Utils: Remove old compiler support code
We now support constexpr, noexcept and alignas on all compilers. Next will
be C++ 14 constexpr support.

Change-Id: I254049c60dcd82fc373ec907cbb5702a4b344978
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-19 10:59:40 +00:00
Marco Bubke
b8e391e5f0 Utils: Fix SmallString reserve for read only references
The capacity of a real only reference is zero but the size is larger than
zero. So if we reserve memory the new capacity has to be bigger than the
size and the capacity.

Change-Id: I8b423da7e7c1cf7cee081d1b3f3464b6fb3f67cf
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-12-05 13:59:56 +00:00
Marco Bubke
b888520598 Utils: Reserve in smallstring was flaky
We have to copy the content of SmallString before we instantiate a new
constructor in the same memory. So the content to which data() is pointing
can be already invalid.

Change-Id: I3a0ab4f9ac0c1219c2bd75fc4412eaf56209ca64
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-11-30 15:32:48 +00:00
Marco Bubke
600b85defa Utils: Add carriage return strip method to SmallString
Sometimes you want to compare unix and windows texts in tests. This is a
convenient function to remove the carriage returns.

Change-Id: I164298b70d3d775dd45903ea3753ac0e68ed2fdc
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-28 16:48:25 +00:00
Marco Bubke
19a00f418f Utils: Add const reverse iterators to SmallString
Change-Id: Iefd9d6abafbe38dcb7d3ed9ea200ac3244902433
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-11-17 15:06:46 +00:00
Marco Bubke
47c01daeb2 UnitTest: Cleanup
Improve naming and introduce googletest.h.

Change-Id: I445c13db4c23d6dd5682ce0db3b83055cc6b8a89
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-19 15:17:54 +00:00