From 96bd0213514e4a49f557a624807ed8bd9825b248 Mon Sep 17 00:00:00 2001 From: slipher Date: Sun, 26 Jan 2025 14:01:50 -0600 Subject: [PATCH] Make Square() a template function instead of macro Missed that one when converting the vector macros, as noticed by freem --- src/engine/qcommon/q_shared.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/qcommon/q_shared.h b/src/engine/qcommon/q_shared.h index e5e6a2b1f4..b16df4c7c4 100644 --- a/src/engine/qcommon/q_shared.h +++ b/src/engine/qcommon/q_shared.h @@ -458,6 +458,12 @@ inline void CrossProduct( const vec3_t v1, const vec3_t v2, vec3_t cross ) cross[ 2 ] = v1[ 0 ] * v2[ 1 ] - v1[ 1 ] * v2[ 0 ]; } +template +A Square( A a ) +{ + return a * a; +} + template void VectorSubtract( const A &a, const B &b, C &&c ) { @@ -2222,8 +2228,6 @@ struct fontInfo_t char name[ MAX_QPATH ]; }; -#define Square( x ) ( ( x ) * ( x ) ) - // real time //=============================================