From 7c527d8886826e80b4cfc4d67809d60997e25cb7 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Thu, 26 Feb 2026 05:44:51 +0500 Subject: [PATCH] public: minor refactoring --- public/crtlib.c | 9 ++++----- public/matrixlib.c | 1 - public/xash3d_mathlib.c | 7 ++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/public/crtlib.c b/public/crtlib.c index 53b1937c..751d3924 100644 --- a/public/crtlib.c +++ b/public/crtlib.c @@ -13,15 +13,14 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -#include "port.h" -#include "xash3d_types.h" -#include "const.h" #include #include #include -#include "stdio.h" -#include "crtlib.h" +#include +#include "port.h" +#include "xash3d_types.h" #include "xash3d_mathlib.h" +#include "crtlib.h" void Q_strnlwr( const char *in, char *out, size_t size_out ) { diff --git a/public/matrixlib.c b/public/matrixlib.c index 8e09abc5..841e1fae 100644 --- a/public/matrixlib.c +++ b/public/matrixlib.c @@ -15,7 +15,6 @@ GNU General Public License for more details. #include "port.h" #include "xash3d_types.h" -#include "const.h" #include "com_model.h" #include "xash3d_mathlib.h" diff --git a/public/xash3d_mathlib.c b/public/xash3d_mathlib.c index e1610580..1f454984 100644 --- a/public/xash3d_mathlib.c +++ b/public/xash3d_mathlib.c @@ -14,16 +14,13 @@ GNU General Public License for more details. */ #include "port.h" #include "xash3d_types.h" -#include "const.h" #include "com_model.h" #include "xash3d_mathlib.h" -#include "eiface.h" #include "studio.h" -#define NUM_HULL_ROUNDS ARRAYSIZE( hull_table ) #define HULL_PRECISION 4 -static const word hull_table[] = { 2, 4, 6, 8, 12, 16, 18, 24, 28, 32, 36, 40, 48, 54, 56, 60, 64, 72, 80, 112, 120, 128, 140, 176 }; +static const uint8_t hull_table[] = { 2, 4, 6, 8, 12, 16, 18, 24, 28, 32, 36, 40, 48, 54, 56, 60, 64, 72, 80, 112, 120, 128, 140, 176 }; const int boxpnt[6][4] = { @@ -110,7 +107,7 @@ void RoundUpHullSize( vec3_t size ) result = Q_ceil( size[i] ); // lookup hull table to find nearest supposed value - for( j = 0; j < NUM_HULL_ROUNDS; j++ ) + for( j = 0; j < sizeof( hull_table ) / sizeof( hull_table[0] ); j++ ) { if( value > hull_table[j] ) continue; // ceil only