QT_C_STYLE_CAST: move the parentheses to the macro, in C mode

Amends 104a0a9ecdb18d65e4d9075d87e8860c6c9d8335.

Right now it's no problem for the only two places we use it, but it
could be a problem if someone accidentally forgot when using the macro.

Pick-to: 6.6
Change-Id: I5dd50a1a7ca5424d9e7afffd17ae0a09dc7dd8c1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit c1266c36353629e2253aa897dfc96d4fbbc8c5a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2024-01-26 15:39:06 -08:00 committed by Qt Cherry-pick Bot
parent f477c78577
commit 34d1d7a858

View File

@ -77,12 +77,12 @@ __extension__ typedef __uint128_t quint128;
# ifdef __cplusplus /* need to avoid c-style-casts in C++ mode */
# define QT_C_STYLE_CAST(type, x) static_cast<type>(x)
# else /* but C doesn't have constructor-style casts */
# define QT_C_STYLE_CAST(type, x) ((type)x)
# define QT_C_STYLE_CAST(type, x) ((type)(x))
# endif
# ifndef Q_UINT128_MAX /* allow qcompilerdetection.h/user override */
# define Q_UINT128_MAX QT_C_STYLE_CAST(quint128, -1)
# endif
# define Q_INT128_MAX QT_C_STYLE_CAST(qint128, (Q_UINT128_MAX / 2))
# define Q_INT128_MAX QT_C_STYLE_CAST(qint128, Q_UINT128_MAX / 2)
# define Q_INT128_MIN (-Q_INT128_MAX - 1)
# ifdef __cplusplus