Fix qConstexprNextPowerOfTwo(qint64) to return quint64
It doesn't make sense to lose precision, and that's a fatal warning
when used on a 32-bit platform:
implicit conversion loses integer precision: 'quint64' (aka 'unsigned long long')
to 'quint32' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
Also fix coding style.
Amends 7ef3826497
Change-Id: I2c8f51883d74f0c6dc1b5faefe7b3ace1d9c15b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
bb10
parent
466a424514
commit
f38d5e563f
|
|
@ -265,14 +265,16 @@ constexpr inline quint64 qConstexprNextPowerOfTwo(quint64 v) {
|
|||
return v;
|
||||
}
|
||||
|
||||
constexpr inline quint32 qConstexprNextPowerOfTwo(qint32 v) {
|
||||
constexpr inline quint32 qConstexprNextPowerOfTwo(qint32 v)
|
||||
{
|
||||
return qConstexprNextPowerOfTwo(quint32(v));
|
||||
}
|
||||
|
||||
constexpr inline quint32 qConstexprNextPowerOfTwo(qint64 v) {
|
||||
constexpr inline quint64 qConstexprNextPowerOfTwo(qint64 v)
|
||||
{
|
||||
return qConstexprNextPowerOfTwo(quint64(v));
|
||||
}
|
||||
}
|
||||
} // namespace QtPrivate
|
||||
|
||||
constexpr inline quint32 qNextPowerOfTwo(quint32 v)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue