From a9f37f6d749709a54e763b34aaa14975af65ebd6 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 13 Oct 2019 18:37:32 +0500 Subject: [PATCH] Include tgmath.h and cmath headers. --- cl_dll/GameStudioModelRenderer.cpp | 2 +- cl_dll/GameStudioModelRenderer_Sample.cpp | 2 +- cl_dll/StudioModelRenderer.cpp | 2 +- cl_dll/health.cpp | 6 +++--- cl_dll/hud_redraw.cpp | 3 ++- cl_dll/hud_update.cpp | 2 +- cl_dll/util.cpp | 6 +++--- cl_dll/util_vector.h | 6 +++--- common/mathlib.h | 7 +++++++ dlls/extdll.h | 8 ++++---- pm_shared/pm_debug.c | 6 +++++- pm_shared/pm_math.c | 6 ++++-- pm_shared/pm_shared.c | 14 +++++++++----- 13 files changed, 44 insertions(+), 26 deletions(-) diff --git a/cl_dll/GameStudioModelRenderer.cpp b/cl_dll/GameStudioModelRenderer.cpp index 570b3375..f32def43 100644 --- a/cl_dll/GameStudioModelRenderer.cpp +++ b/cl_dll/GameStudioModelRenderer.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/GameStudioModelRenderer_Sample.cpp b/cl_dll/GameStudioModelRenderer_Sample.cpp index ee8e8f9c..8910d809 100644 --- a/cl_dll/GameStudioModelRenderer_Sample.cpp +++ b/cl_dll/GameStudioModelRenderer_Sample.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/StudioModelRenderer.cpp b/cl_dll/StudioModelRenderer.cpp index 826ab9e7..5350ad10 100644 --- a/cl_dll/StudioModelRenderer.cpp +++ b/cl_dll/StudioModelRenderer.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "studio_util.h" #include "r_studioint.h" diff --git a/cl_dll/health.cpp b/cl_dll/health.cpp index 998b4829..6540671e 100644 --- a/cl_dll/health.cpp +++ b/cl_dll/health.cpp @@ -18,9 +18,9 @@ // implementation of CHudHealth class // -#include "stdio.h" -#include "stdlib.h" -#include "math.h" +#include +#include +#include #include "hud.h" #include "cl_util.h" diff --git a/cl_dll/hud_redraw.cpp b/cl_dll/hud_redraw.cpp index 17f2d7dd..579c0897 100644 --- a/cl_dll/hud_redraw.cpp +++ b/cl_dll/hud_redraw.cpp @@ -15,7 +15,8 @@ // // hud_redraw.cpp // -#include +#include + #include "hud.h" #include "cl_util.h" //#include "triangleapi.h" diff --git a/cl_dll/hud_update.cpp b/cl_dll/hud_update.cpp index cecbb625..f431bbaf 100644 --- a/cl_dll/hud_update.cpp +++ b/cl_dll/hud_update.cpp @@ -16,7 +16,7 @@ // hud_update.cpp // -#include +#include #include "hud.h" #include "cl_util.h" #include diff --git a/cl_dll/util.cpp b/cl_dll/util.cpp index fb03792c..8d05e914 100644 --- a/cl_dll/util.cpp +++ b/cl_dll/util.cpp @@ -18,9 +18,9 @@ // implementation of class-less helper functions // -#include "stdio.h" -#include "stdlib.h" -#include "math.h" +#include +#include +#include #include "hud.h" #include "cl_util.h" diff --git a/cl_dll/util_vector.h b/cl_dll/util_vector.h index 477d97be..93166a6b 100644 --- a/cl_dll/util_vector.h +++ b/cl_dll/util_vector.h @@ -20,9 +20,9 @@ #define UTIL_VECTOR_H // Misc C-runtime library headers -#include "stdio.h" -#include "stdlib.h" -#include "math.h" +#include +#include +#include // Header file containing definition of globalvars_t and entvars_t typedef unsigned int func_t; // diff --git a/common/mathlib.h b/common/mathlib.h index 999efc35..e5e413df 100644 --- a/common/mathlib.h +++ b/common/mathlib.h @@ -16,7 +16,14 @@ #pragma once #ifndef MATHLIB_H #define MATHLIB_H +#ifndef __cplusplus #include +#ifdef HAVE_TGMATH_H +#include +#endif // HAVE_TGMATH_H +#else // __cplusplus +#include +#endif // __cplusplus typedef float vec_t; typedef vec_t vec2_t[2]; diff --git a/dlls/extdll.h b/dlls/extdll.h index 793c4a52..22f5bfee 100644 --- a/dlls/extdll.h +++ b/dlls/extdll.h @@ -60,10 +60,10 @@ typedef int BOOL; #endif //_WIN32 // Misc C-runtime library headers -#include "stdio.h" -#include "stdlib.h" -#include "stddef.h" -#include "math.h" +#include +#include +#include +#include #ifndef M_PI_F #define M_PI_F (float)M_PI diff --git a/pm_shared/pm_debug.c b/pm_shared/pm_debug.c index a0c9b948..fbe1e288 100644 --- a/pm_shared/pm_debug.c +++ b/pm_shared/pm_debug.c @@ -12,8 +12,12 @@ * without written permission from Valve LLC. * ****/ - +#include #include "mathlib.h" +#ifdef HAVE_TGMATH_H +#include +#endif + #include "const.h" #include "usercmd.h" #include "pm_defs.h" diff --git a/pm_shared/pm_math.c b/pm_shared/pm_math.c index d5eefd37..634839c1 100644 --- a/pm_shared/pm_math.c +++ b/pm_shared/pm_math.c @@ -13,10 +13,12 @@ * ****/ // pm_math.c -- math primitives - +#include #include "mathlib.h" +#ifdef HAVE_TGMATH_H +#include +#endif #include "const.h" -#include // up / down #define PITCH 0 diff --git a/pm_shared/pm_shared.c b/pm_shared/pm_shared.c index 6c5aef43..01825777 100644 --- a/pm_shared/pm_shared.c +++ b/pm_shared/pm_shared.c @@ -14,18 +14,22 @@ ****/ #include +//#include // NULL +#include // sqrt +#include // strcpy +#include // atoi +#include // isspace #include "mathlib.h" +#ifdef HAVE_TGMATH_H +#include +#endif + #include "const.h" #include "usercmd.h" #include "pm_defs.h" #include "pm_shared.h" #include "pm_movevars.h" #include "pm_debug.h" -//#include // NULL -#include // sqrt -#include // strcpy -#include // atoi -#include // isspace int g_bhopcap = 1;