From 10d441f82544621efb16d93e26d068b6b2d15038 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 13 May 2026 10:30:35 +0500 Subject: [PATCH] public: fix warnings, add guards around some of the macros, remove unused variable --- public/tests/test_build.c | 2 -- public/xash3d_mathlib.h | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/public/tests/test_build.c b/public/tests/test_build.c index 2b24a29a..7fbb4d64 100644 --- a/public/tests/test_build.c +++ b/public/tests/test_build.c @@ -3,8 +3,6 @@ int main( void ) { - int res; - if( Q_buildnum_compat() != 4529 ) return 200; diff --git a/public/xash3d_mathlib.h b/public/xash3d_mathlib.h index 0156fce1..5dbaaa6d 100644 --- a/public/xash3d_mathlib.h +++ b/public/xash3d_mathlib.h @@ -46,8 +46,12 @@ CONSTANTS AND HELPER MACROS #define M_PI_F ((float)(M_PI)) #define M_PI2_F ((float)(M_PI2)) +#ifndef RAD2DEG #define RAD2DEG( x ) ((double)(x) * (double)(180.0 / M_PI)) +#endif +#ifndef DEG2RAD #define DEG2RAD( x ) ((double)(x) * (double)(M_PI / 180.0)) +#endif #define NUMVERTEXNORMALS 162 @@ -74,8 +78,12 @@ CONSTANTS AND HELPER MACROS #define INV255F ( 1.0f / 255.0f ) #define MAKE_SIGNED( x ) ((( x ) * INV127F ) - 1.0f ) +#ifndef Q_min #define Q_min( a, b ) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef Q_max #define Q_max( a, b ) (((a) > (b)) ? (a) : (b)) +#endif #define Q_equal_e( a, b, e ) (((a) >= ((b) - (e))) && ((a) <= ((b) + (e)))) #define Q_equal( a, b ) Q_equal_e( a, b, EQUAL_EPSILON ) #define Q_floor( a ) ((float)(int)(a))