shithub: choc

Download patch

ref: 136009e7505acc321c2b7f710929cb7d9b88a5b2
parent: c1cc26b1addb275e1ca546fa4400d2be28673266
author: Simon Howard <[email protected]>
date: Fri Dec 8 11:37:41 EST 2006

Make trig tables const.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 770

--- a/src/r_main.c
+++ b/src/r_main.c
@@ -113,7 +113,7 @@
 // fixed_t		finetangent[FINEANGLES/2];
 
 // fixed_t		finesine[5*FINEANGLES/4];
-fixed_t*		finecosine = &finesine[FINEANGLES/4];
+const fixed_t*		finecosine = &finesine[FINEANGLES/4];
 
 
 lighttable_t*		scalelight[LIGHTLEVELS][MAXLIGHTSCALE];
--- a/src/tables.c
+++ b/src/tables.c
@@ -65,7 +65,7 @@
 
 
 
-int finetangent[4096] =
+const int finetangent[4096] =
 {
     -170910304,-56965752,-34178904,-24413316,-18988036,-15535599,-13145455,-11392683,
     -10052327,-8994149,-8137527,-7429880,-6835455,-6329090,-5892567,-5512368,
@@ -582,7 +582,7 @@
 };
 
 
-int finesine[10240] =
+const int finesine[10240] =
 {
     25,75,125,175,226,276,326,376,
     427,477,527,578,628,678,728,779,
@@ -1868,7 +1868,7 @@
 
 
 
-angle_t tantoangle[2049] =
+const angle_t tantoangle[2049] =
 {
     0,333772,667544,1001315,1335086,1668857,2002626,2336395,
     2670163,3003929,3337694,3671457,4005219,4338979,4672736,5006492,
--- a/src/tables.h
+++ b/src/tables.h
@@ -53,14 +53,14 @@
 #define ANGLETOFINESHIFT	19		
 
 // Effective size is 10240.
-extern  fixed_t		finesine[5*FINEANGLES/4];
+extern const fixed_t finesine[5*FINEANGLES/4];
 
 // Re-use data, is just PI/2 pahse shift.
-extern  fixed_t*	finecosine;
+extern const fixed_t *finecosine;
 
 
 // Effective size is 4096.
-extern fixed_t		finetangent[FINEANGLES/2];
+extern const fixed_t finetangent[FINEANGLES/2];
 
 // Binary Angle Measument, BAM.
 #define ANG45			0x20000000
@@ -79,7 +79,7 @@
 // Effective size is 2049;
 // The +1 size is to handle the case when x==y
 //  without additional checking.
-extern angle_t		tantoangle[SLOPERANGE+1];
+extern const angle_t tantoangle[SLOPERANGE+1];
 
 
 // Utility function,
@@ -91,3 +91,4 @@
 
 
 #endif
+