qfloat16: remove noexcept from qRound

These functions have narrow contracts since they return integer types.
Passing infinities or NaN is illegal, therefore they can't be noexcept.
The qRound overloads for float/double in fact aren't noexcept.

Change-Id: Id41c166bc296fd11fc10a31ceab640f55868570e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Giuseppe D'Angelo 2025-03-27 19:03:38 +01:00
parent 729a6f56d0
commit 771466b9e7

View File

@ -315,10 +315,10 @@ Q_CORE_EXPORT void qFloatFromFloat16(float *, const qfloat16 *, qsizetype length
}
// The remainder of these utility functions complement qglobal.h
[[nodiscard]] inline int qRound(qfloat16 d) noexcept
[[nodiscard]] inline int qRound(qfloat16 d)
{ return qRound(static_cast<float>(d)); }
[[nodiscard]] inline qint64 qRound64(qfloat16 d) noexcept
[[nodiscard]] inline qint64 qRound64(qfloat16 d)
{ return qRound64(static_cast<float>(d)); }
[[nodiscard]] inline bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept