qt6-bb10/tests/auto/corelib/global/qnumeric
Giuseppe D'Angelo 4f234b02b7 QNumeric: add a private qUnsignedAbs
Checking qAbs preconditions reveals that several places into Qt are
calling it with minimal values, causing UB. Those places do not actually
need that the absolute value is of the same type as the parameter.
Therefore, introduce qUnsignedAbs, which is like qAbs() but whose return
type is always unsigned, and therefore can accept everything.

This function is private; I don't want to encourage users to rely on our
extension.

Aggressively cherry picking because this will be needed in subsequent
bugfixes.

Change-Id: I2047768a5fd35f12bf898ca8c2008813434edd8d
Pick-to: 6.5 6.2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 83c812e1322a2b004bc604be3e6f61fb83246eb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ad867197cf02043f9ec67363b020ac08405b0ab1)
2025-01-29 13:33:32 +00:00
..
.gitignore
CMakeLists.txt CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
tst_qnumeric.cpp QNumeric: add a private qUnsignedAbs 2025-01-29 13:33:32 +00:00