From 8fad3bbad6c7a093026ada592f1d8e95285d0a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=97=A3=F0=9F=97=A3=3A=20=22=C3=B9=E1=BB=93=E1=BA=A7?= =?UTF-8?q?=E1=BB=B3=20h=E1=BB=A3p=20l=C3=BD=20qu=C3=A3i=20ch=E1=BA=A5t=20?= =?UTF-8?q?th=E1=BA=BF=20nh=E1=BB=9D=22=F0=9F=A4=AB=F0=9F=97=BF?= =?UTF-8?q?=F0=9F=94=A5=F0=9F=94=A5?= <148612010+901D3@users.noreply.github.com> Date: Fri, 5 Jun 2026 22:07:14 +0700 Subject: [PATCH] public: wrap macro arguments in parentheses --- public/xash3d_mathlib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/xash3d_mathlib.h b/public/xash3d_mathlib.h index 63acf2ff..4f3b77fe 100644 --- a/public/xash3d_mathlib.h +++ b/public/xash3d_mathlib.h @@ -128,9 +128,9 @@ CONSTANTS AND HELPER MACROS #define VectorClear(x) ((x)[0]=(x)[1]=(x)[2]=0) #define Vector2Lerp( v1, lerp, v2, c ) ((c)[0] = (v1)[0] + (lerp) * ((v2)[0] - (v1)[0]), (c)[1] = (v1)[1] + (lerp) * ((v2)[1] - (v1)[1])) #define VectorLerp( v1, lerp, v2, c ) ((c)[0] = (v1)[0] + (lerp) * ((v2)[0] - (v1)[0]), (c)[1] = (v1)[1] + (lerp) * ((v2)[1] - (v1)[1]), (c)[2] = (v1)[2] + (lerp) * ((v2)[2] - (v1)[2])) -#define VectorNormalize( v ) { float ilength = (float)sqrt(DotProduct(v, v));if (ilength) ilength = 1.0f / ilength;v[0] *= ilength;v[1] *= ilength;v[2] *= ilength; } -#define VectorNormalize2( v, dest ) {float ilength = (float)sqrt(DotProduct(v,v));if (ilength) ilength = 1.0f / ilength;dest[0] = v[0] * ilength;dest[1] = v[1] * ilength;dest[2] = v[2] * ilength; } -#define VectorNormalizeFast( v ) {float ilength = (float)Q_rsqrt(DotProduct(v,v)); v[0] *= ilength; v[1] *= ilength; v[2] *= ilength; } +#define VectorNormalize( v ) { float ilength = (float)sqrt(DotProduct((v), (v)));if (ilength) ilength = 1.0f / ilength;(v)[0] *= ilength;(v)[1] *= ilength;(v)[2] *= ilength; } +#define VectorNormalize2( v, dest ) {float ilength = (float)sqrt(DotProduct((v),(v)));if (ilength) ilength = 1.0f / ilength;(dest)[0] = (v)[0] * ilength;(dest)[1] = (v)[1] * ilength;(dest)[2] = (v)[2] * ilength; } +#define VectorNormalizeFast( v ) {float ilength = (float)Q_rsqrt(DotProduct((v),(v))); (v)[0] *= ilength; (v)[1] *= ilength; (v)[2] *= ilength; } #define VectorNormalizeLength( v ) VectorNormalizeLength2((v), (v)) #define VectorNegate(x, y) ((y)[0] = -(x)[0], (y)[1] = -(x)[1], (y)[2] = -(x)[2]) #define VectorM(scale1, b1, c) ((c)[0] = (scale1) * (b1)[0],(c)[1] = (scale1) * (b1)[1],(c)[2] = (scale1) * (b1)[2])