From 96c71c68c80ebc63aec3221edb1fbd67d3b5b2ac Mon Sep 17 00:00:00 2001
From: Alam Ed Arias <alam@srb2.org>
Date: Fri, 21 Aug 2015 21:27:20 -0400
Subject: [PATCH] remove NEED_FIXED_VECTOR and fix angelchk testcase

---
 src/doomdef.h    | 4 ----
 src/m_fixed.c    | 4 ----
 src/m_fixed.h    | 5 -----
 src/tables.c     | 5 -----
 src/tables.h     | 5 -----
 tools/anglechk.c | 7 +++++++
 6 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/src/doomdef.h b/src/doomdef.h
index bfa5ee0ce..92570f623 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -440,12 +440,8 @@ extern const char *compdate, *comptime, *comprevision;
 //#define SLOPENESS
 
 /// Kalaron/Eternity Engine slope code (SRB2CB ported)
-/// Depends on NEED_FIXED_VECTORS? for a few functions.
 #define ESLOPE
 
-/// Fixed and float point types
-//#define NEED_FIXED_VECTOR
-
 ///	Delete file while the game is running.
 ///	\note	EXTREMELY buggy, tends to crash game.
 //#define DELFILE
diff --git a/src/m_fixed.c b/src/m_fixed.c
index 739265aa2..53974936e 100644
--- a/src/m_fixed.c
+++ b/src/m_fixed.c
@@ -119,8 +119,6 @@ fixed_t FixedHypot(fixed_t x, fixed_t y)
 	return FixedMul(ax, yx1); // |x|*((1 + (x/y)^2)^1/2)
 }
 
-#if 1 //#ifdef NEED_FIXED_VECTOR
-
 vector2_t *FV2_Load(vector2_t *vec, fixed_t x, fixed_t y)
 {
 	vec->x = x;
@@ -863,8 +861,6 @@ void FM_Scale(matrix_t *dest, fixed_t x, fixed_t y, fixed_t z)
 #undef M
 }
 
-#endif
-
 #ifdef M_TESTCASE
 //#define MULDIV_TEST
 #define SQRT_TEST
diff --git a/src/m_fixed.h b/src/m_fixed.h
index 53962269b..cd22d483f 100644
--- a/src/m_fixed.h
+++ b/src/m_fixed.h
@@ -357,9 +357,6 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedRound(fixed_t x)
 	return INT32_MAX;
 }
 
-
-#if 1//#ifdef NEED_FIXED_VECTOR
-
 typedef struct
 {
 	fixed_t x;
@@ -438,6 +435,4 @@ void FM_MultMatrix(matrix_t *dest, const matrix_t *multme);
 void FM_Translate(matrix_t *dest, fixed_t x, fixed_t y, fixed_t z);
 void FM_Scale(matrix_t *dest, fixed_t x, fixed_t y, fixed_t z);
 
-#endif // defined NEED_FIXED_VECTOR
-
 #endif //m_fixed.h
diff --git a/src/tables.c b/src/tables.c
index 3ee2685c8..83e952832 100644
--- a/src/tables.c
+++ b/src/tables.c
@@ -2225,9 +2225,6 @@ angle_t tantoangle[2049] =
 	536870912
 };
 
-
-#if 1 //#ifdef NEED_FIXED_VECTOR
-
 static angle_t fineacon[65536*2] = {
 	  ANGLE_MAX, 2143707442, 2142143280, 2140943052, 2139931208, 2139039753, 2138233813, 2137492672, 2136802831, 2136154917, 2135542102, 2134959233, 2134402306, 2133868139, 2133354148, 2132858208,
 	 2132378539, 2131913638, 2131462220, 2131023174, 2130595537, 2130178462, 2129771202, 2129373097, 2128983555, 2128602046, 2128228092, 2127861261, 2127501162, 2127147436, 2126799757, 2126457825,
@@ -10706,5 +10703,3 @@ void FM_Rotate(matrix_t *dest, angle_t angle, fixed_t x, fixed_t y, fixed_t z)
 	M(3, 3) = FRACUNIT;
 #undef M
 }
-
-#endif
diff --git a/src/tables.h b/src/tables.h
index b1de1a428..d7ec589da 100644
--- a/src/tables.h
+++ b/src/tables.h
@@ -96,9 +96,6 @@ FUNCMATH angle_t FixedAngle(fixed_t fa);
 // and with a factor, with +factor for (fa/factor) and -factor for (fa*factor)
 FUNCMATH angle_t FixedAngleC(fixed_t fa, fixed_t factor);
 
-
-#if 1 //#ifdef NEED_FIXED_VECTOR
-
 /// The FixedAcos function
 FUNCMATH angle_t FixedAcos(fixed_t x);
 
@@ -112,8 +109,6 @@ void FV3_Rotate(vector3_t *rotVec, const vector3_t *axisVec, const angle_t angle
 /// Fixed Point Matrix functions
 void FM_Rotate(matrix_t *dest, angle_t angle, fixed_t x, fixed_t y, fixed_t z);
 
-#endif // defined NEED_FIXED_VECTOR
-
 // The table values in tables.c are calculated with this many fractional bits.
 #define FINE_FRACBITS 16
 
diff --git a/tools/anglechk.c b/tools/anglechk.c
index bb9c4d9ea..4a67069bf 100644
--- a/tools/anglechk.c
+++ b/tools/anglechk.c
@@ -351,6 +351,13 @@ int main(int argc, char** argv)
 	return 0;
 }
 
+static void *cpu_cpy(void *dest, const void *src, size_t n)
+{
+	return memcpy(dest, src, n);
+}
+
+void *(*M_Memcpy)(void* dest, const void* src, size_t n) = cpu_cpy;
+
 void I_Error(const char *error, ...)
 {
 	(void)error;
-- 
GitLab