From ef0b227967d5af588c6f27cdf1e5a88c583655c8 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 13 Mar 2023 03:58:53 +0300 Subject: [PATCH] ref: gl: alias: fix strict aliasing by converting it to use float_bits_t union --- ref/gl/gl_alias.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ref/gl/gl_alias.c b/ref/gl/gl_alias.c index 71069a50..c96aa14a 100644 --- a/ref/gl/gl_alias.c +++ b/ref/gl/gl_alias.c @@ -292,8 +292,8 @@ void BuildTris( void ) t = (t + 0.5f) / m_pAliasHeader->skinheight; // Carmack use floats and Valve use shorts here... - *(float *)&g_commands[g_numcommands++] = s; - *(float *)&g_commands[g_numcommands++] = t; + g_commands[g_numcommands++] = FloatAsInt( s ); + g_commands[g_numcommands++] = FloatAsInt( t ); } }