From 992c50a406c8184d3219e70f786ed74a812b001e Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 24 Oct 2009 12:38:01 +0100 Subject: [PATCH 2/2] Remove definitions of M_PI Remove the many and various definitions of M_PI, except the one in compiler.h I have assumed that the precision of the value of M_PI is not significant, which should be the case anyhow, as these values are only a fall-back Signed-off-by: Jon TURNEY --- progs/demos/dinoshade.c | 5 ----- progs/demos/engine.c | 4 ---- progs/demos/fbo_firecube.c | 4 ---- progs/demos/fire.c | 4 ---- progs/demos/gearbox.c | 4 ---- progs/demos/gears.c | 4 ---- progs/demos/geartrain.c | 3 --- progs/demos/ipers.c | 4 ---- progs/demos/pointblast.c | 5 ----- progs/demos/projtex.c | 5 ----- progs/demos/rain.cxx | 3 --- progs/demos/ray.c | 4 ---- progs/demos/spriteblast.c | 5 ----- progs/demos/stex3d.c | 4 ---- progs/demos/teapot.c | 4 ---- progs/demos/terrain.c | 4 ---- progs/demos/tunnel.c | 4 ---- progs/demos/tunnel2.c | 4 ---- progs/demos/winpos.c | 4 ---- progs/egl/opengl/peglgears.c | 5 ----- progs/egl/opengl/xeglgears.c | 5 ----- progs/egl/opengles1/gears.c | 4 ---- progs/glsl/skinning.c | 4 ---- progs/glsl/texaaline.c | 4 ---- progs/glsl/twoside.c | 4 ---- progs/objviewer/glm.c | 5 ----- progs/objviewer/glm.h | 5 ----- progs/redbook/torus.c | 5 ----- progs/tests/auxbuffer.c | 4 ---- progs/tests/jkrahntest.c | 4 ---- progs/xdemos/corender.c | 4 ---- progs/xdemos/glxcontexts.c | 5 ----- progs/xdemos/glxgears.c | 5 ----- progs/xdemos/glxgears_fbconfig.c | 5 ----- progs/xdemos/glxgears_pixmap.c | 5 ----- progs/xdemos/glxswapcontrol.c | 5 ----- progs/xdemos/multictx.c | 5 ----- src/gallium/drivers/i915/i915_fpc_translate.c | 5 ----- src/gallium/state_trackers/vega/arc.c | 4 ---- src/glut/beos/glut_shapes.c | 5 ----- src/glut/glx/glut_shapes.c | 5 ----- 41 files changed, 0 insertions(+), 180 deletions(-) diff --git a/progs/demos/dinoshade.c b/progs/demos/dinoshade.c index cbf8751..a477d6f 100644 --- a/progs/demos/dinoshade.c +++ b/progs/demos/dinoshade.c @@ -46,11 +46,6 @@ #include /* OpenGL Utility Toolkit header */ #include /* OpenGL Utility Toolkit header */ -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - /* Variable controlling various rendering modes. */ static int stencilReflection = 1, stencilShadow = 1, offsetShadow = 1; static int renderShadow = 1, renderDinosaur = 1, renderReflection = 1; diff --git a/progs/demos/engine.c b/progs/demos/engine.c index a414835..248f7e0 100644 --- a/progs/demos/engine.c +++ b/progs/demos/engine.c @@ -15,10 +15,6 @@ #include "trackball.h" -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - #define DEG_TO_RAD(DEG) ((DEG) * M_PI / 180.0) #define TEXTURE_FILE "../images/reflect.rgb" diff --git a/progs/demos/fbo_firecube.c b/progs/demos/fbo_firecube.c index 17767a1..d43b5d3 100644 --- a/progs/demos/fbo_firecube.c +++ b/progs/demos/fbo_firecube.c @@ -104,10 +104,6 @@ static const char *texNames[] = -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - #define vinit(a,i,j,k) { \ (a)[0]=i; \ (a)[1]=j; \ diff --git a/progs/demos/fire.c b/progs/demos/fire.c index bb912fb..d02d705 100644 --- a/progs/demos/fire.c +++ b/progs/demos/fire.c @@ -26,10 +26,6 @@ static int fullscreen = 1; #endif -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - #define vinit(a,i,j,k) {\ (a)[0]=i;\ (a)[1]=j;\ diff --git a/progs/demos/gearbox.c b/progs/demos/gearbox.c index 71d0281..7ff9616 100644 --- a/progs/demos/gearbox.c +++ b/progs/demos/gearbox.c @@ -11,10 +11,6 @@ #include #include -#ifndef M_PI -#define M_PI 3.14159265 -#endif - static GLint WinWidth = 800, WinHeight = 500; static GLint TexWidth, TexHeight; static GLuint TexObj = 1; diff --git a/progs/demos/gears.c b/progs/demos/gears.c index 31a5b79..1924770 100644 --- a/progs/demos/gears.c +++ b/progs/demos/gears.c @@ -19,10 +19,6 @@ #include #include -#ifndef M_PI -#define M_PI 3.14159265 -#endif - static GLint T0 = 0; static GLint Frames = 0; static GLint autoexit = 0; diff --git a/progs/demos/geartrain.c b/progs/demos/geartrain.c index 00b6e78..9316604 100644 --- a/progs/demos/geartrain.c +++ b/progs/demos/geartrain.c @@ -36,9 +36,6 @@ #define min(x, y) ( x < y ? x : y ) #endif -#ifndef M_PI -#define M_PI 3.14159265 -#endif /* */ typedef GLfloat TDA[4]; TDA background; diff --git a/progs/demos/ipers.c b/progs/demos/ipers.c index 265378b..9740ce2 100644 --- a/progs/demos/ipers.c +++ b/progs/demos/ipers.c @@ -36,10 +36,6 @@ static GLint Frames; #define TEX_SKY_WIDTH 256 #define TEX_SKY_HEIGHT TEX_SKY_WIDTH -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - #define FROM_NONE 0 #define FROM_DOWN 1 #define FROM_UP 2 diff --git a/progs/demos/pointblast.c b/progs/demos/pointblast.c index b4d0a67..638ca83 100644 --- a/progs/demos/pointblast.c +++ b/progs/demos/pointblast.c @@ -21,11 +21,6 @@ #include #include -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265 -#endif - #if 0 /* For debugging. */ #undef GL_EXT_point_parameters #endif diff --git a/progs/demos/projtex.c b/progs/demos/projtex.c index d162568..e5cd68c 100644 --- a/progs/demos/projtex.c +++ b/progs/demos/projtex.c @@ -23,11 +23,6 @@ #include "readtex.h" -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - #define MAX_TEX 4 int NumTextures = 1; diff --git a/progs/demos/rain.cxx b/progs/demos/rain.cxx index 60fc414..feda2db 100644 --- a/progs/demos/rain.cxx +++ b/progs/demos/rain.cxx @@ -12,9 +12,6 @@ #include #include #include -#ifndef M_PI -#define M_PI 3.14159265 -#endif #include "particles.h" extern "C" { diff --git a/progs/demos/ray.c b/progs/demos/ray.c index 9cc464d..1b52fd0 100644 --- a/progs/demos/ray.c +++ b/progs/demos/ray.c @@ -41,10 +41,6 @@ static GLint Frames = 0; #define TEX_REFLECT_SLOT_SIZE (TEX_REFLECT_HEIGHT/16) #define TEX_REFLECT_NUMSLOT (TEX_REFLECT_HEIGHT/TEX_REFLECT_SLOT_SIZE) -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - #define EPSILON 0.0001 #define clamp255(a) ( (a)<(0.0f) ? (0.0f) : ((a)>(255.0f) ? (255.0f) : (a)) ) diff --git a/progs/demos/spriteblast.c b/progs/demos/spriteblast.c index 36e226e..c9a9014 100644 --- a/progs/demos/spriteblast.c +++ b/progs/demos/spriteblast.c @@ -24,11 +24,6 @@ #include #include -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265 -#endif - #if 0 /* For debugging. */ #undef GL_EXT_point_parameters #endif diff --git a/progs/demos/stex3d.c b/progs/demos/stex3d.c index de18480..15478d2 100644 --- a/progs/demos/stex3d.c +++ b/progs/demos/stex3d.c @@ -22,10 +22,6 @@ #include -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - #define NOISE_TEXTURE 1 #define GRADIENT_TEXTURE 2 diff --git a/progs/demos/teapot.c b/progs/demos/teapot.c index 04a675f..d424112 100644 --- a/progs/demos/teapot.c +++ b/progs/demos/teapot.c @@ -35,10 +35,6 @@ static GLint Frames = 0; #define BASERES 12 #define TEAPOTRES 3 -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - extern void shadowmatrix(GLfloat [4][4], GLfloat [4], GLfloat [4]); extern void findplane(GLfloat [4], GLfloat [3], GLfloat [3], GLfloat [3]); diff --git a/progs/demos/terrain.c b/progs/demos/terrain.c index a72c8d3..1569e96 100644 --- a/progs/demos/terrain.c +++ b/progs/demos/terrain.c @@ -26,10 +26,6 @@ static int fullscreen = 1; #endif -#ifndef M_PI -#define M_PI 3.14159265 -#endif - #define heightMnt 450 #define lenghtXmnt 62 #define lenghtYmnt 62 diff --git a/progs/demos/tunnel.c b/progs/demos/tunnel.c index efc007c..c96191e 100644 --- a/progs/demos/tunnel.c +++ b/progs/demos/tunnel.c @@ -33,10 +33,6 @@ static GLint NiceFog = 1; #define NUMBLOC 5 -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - /* extern int striplength_skin_13[]; extern float stripdata_skin_13[]; diff --git a/progs/demos/tunnel2.c b/progs/demos/tunnel2.c index f15da95..3220c46 100644 --- a/progs/demos/tunnel2.c +++ b/progs/demos/tunnel2.c @@ -45,10 +45,6 @@ static GLint Frames = 0; #define NUMBLOC 5 -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - static float obs[3] = { 1000.0, 0.0, 2.0 }; static float dir[3]; static float v = 30.; diff --git a/progs/demos/winpos.c b/progs/demos/winpos.c index f935f9b..86ce999 100644 --- a/progs/demos/winpos.c +++ b/progs/demos/winpos.c @@ -19,10 +19,6 @@ #define IMAGE_FILE "../images/girl.rgb" -#ifndef M_PI -# define M_PI 3.14159265 -#endif - static GLubyte *Image; diff --git a/progs/egl/opengl/peglgears.c b/progs/egl/opengl/peglgears.c index 212d1ac..553c734 100644 --- a/progs/egl/opengl/peglgears.c +++ b/progs/egl/opengl/peglgears.c @@ -83,11 +83,6 @@ current_time(void) #endif /*BENCHMARK*/ -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLint gear1, gear2, gear3; static GLfloat angle = 0.0; diff --git a/progs/egl/opengl/xeglgears.c b/progs/egl/opengl/xeglgears.c index a6a977d..b125469 100644 --- a/progs/egl/opengl/xeglgears.c +++ b/progs/egl/opengl/xeglgears.c @@ -91,11 +91,6 @@ current_time(void) -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLint gear1, gear2, gear3; static GLfloat angle = 0.0; diff --git a/progs/egl/opengles1/gears.c b/progs/egl/opengles1/gears.c index 8462a48..965042e 100644 --- a/progs/egl/opengles1/gears.c +++ b/progs/egl/opengles1/gears.c @@ -30,10 +30,6 @@ #include #include "eglut.h" -#ifndef M_PI -#define M_PI 3.14159265 -#endif - struct gear { GLuint vbo; diff --git a/progs/glsl/skinning.c b/progs/glsl/skinning.c index 2b96f31..228b234 100644 --- a/progs/glsl/skinning.c +++ b/progs/glsl/skinning.c @@ -16,10 +16,6 @@ #include #include "shaderutil.h" -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - static char *FragProgFile = "skinning.frag"; static char *VertProgFile = "skinning.vert"; diff --git a/progs/glsl/texaaline.c b/progs/glsl/texaaline.c index 00edab7..6e18926 100644 --- a/progs/glsl/texaaline.c +++ b/progs/glsl/texaaline.c @@ -14,10 +14,6 @@ #include #include -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - static GLint WinWidth = 300, WinHeight = 300; static GLint win = 0; static GLfloat Width = 8.; diff --git a/progs/glsl/twoside.c b/progs/glsl/twoside.c index ce155d6..39e3f08 100644 --- a/progs/glsl/twoside.c +++ b/progs/glsl/twoside.c @@ -16,10 +16,6 @@ #include #include "shaderutil.h" -#ifndef M_PI -#define M_PI 3.1415926535 -#endif - static GLint WinWidth = 300, WinHeight = 300; static char *FragProgFile = NULL; static char *VertProgFile = NULL; diff --git a/progs/objviewer/glm.c b/progs/objviewer/glm.c index 77e62bf..ae2956f 100644 --- a/progs/objviewer/glm.c +++ b/progs/objviewer/glm.c @@ -21,11 +21,6 @@ typedef unsigned char boolean; #define FALSE 0 -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - /* defines */ #define T(x) model->triangles[(x)] diff --git a/progs/objviewer/glm.h b/progs/objviewer/glm.h index 1a5646f..3e8e5f9 100644 --- a/progs/objviewer/glm.h +++ b/progs/objviewer/glm.h @@ -13,11 +13,6 @@ typedef unsigned int uint; -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - /* defines */ #define GLM_NONE (0) /* render with only vertices */ #define GLM_FLAT (1 << 0) /* render with facet normals */ diff --git a/progs/redbook/torus.c b/progs/redbook/torus.c index a67d48e..3fb5984 100644 --- a/progs/redbook/torus.c +++ b/progs/redbook/torus.c @@ -45,11 +45,6 @@ #include #include -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - GLuint theTorus; /* Draw a torus */ diff --git a/progs/tests/auxbuffer.c b/progs/tests/auxbuffer.c index 70f0b73..22d644a 100644 --- a/progs/tests/auxbuffer.c +++ b/progs/tests/auxbuffer.c @@ -54,10 +54,6 @@ current_time(void) -#ifndef M_PI -#define M_PI 3.14159265 -#endif - static int WinWidth = 300, WinHeight = 300; static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLint gear1, gear2, gear3; diff --git a/progs/tests/jkrahntest.c b/progs/tests/jkrahntest.c index 3fef105..a767da6 100644 --- a/progs/tests/jkrahntest.c +++ b/progs/tests/jkrahntest.c @@ -25,10 +25,6 @@ #include #include -#ifndef M_PI -#define M_PI 3.14159 -#endif - #define DEGTOR (M_PI/180.0) static int AttributeList[] = { GLX_RGBA, GLX_DOUBLEBUFFER, None }; diff --git a/progs/xdemos/corender.c b/progs/xdemos/corender.c index e706f4b..ede042e 100644 --- a/progs/xdemos/corender.c +++ b/progs/xdemos/corender.c @@ -25,10 +25,6 @@ #include "ipc.h" -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - static int MyID = 0; /* 0 or 1 */ static int WindowID = 0; static GLXContext Context = 0; diff --git a/progs/xdemos/glxcontexts.c b/progs/xdemos/glxcontexts.c index 9f83679..93a421f 100644 --- a/progs/xdemos/glxcontexts.c +++ b/progs/xdemos/glxcontexts.c @@ -84,11 +84,6 @@ current_time(void) -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLint gear1, gear2, gear3; static GLfloat angle = 0.0; diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c index 92c75ca..29c22b6 100644 --- a/progs/xdemos/glxgears.c +++ b/progs/xdemos/glxgears.c @@ -86,11 +86,6 @@ current_time(void) -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - /** Event handler results: */ #define NOP 0 #define EXIT 1 diff --git a/progs/xdemos/glxgears_fbconfig.c b/progs/xdemos/glxgears_fbconfig.c index 36bf731..083e847 100644 --- a/progs/xdemos/glxgears_fbconfig.c +++ b/progs/xdemos/glxgears_fbconfig.c @@ -88,11 +88,6 @@ current_time(void) -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLint gear1, gear2, gear3; static GLfloat angle = 0.0; diff --git a/progs/xdemos/glxgears_pixmap.c b/progs/xdemos/glxgears_pixmap.c index 661d130..beb5cdb 100644 --- a/progs/xdemos/glxgears_pixmap.c +++ b/progs/xdemos/glxgears_pixmap.c @@ -84,11 +84,6 @@ current_time(void) -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLint gear1, gear2, gear3; static GLfloat angle = 0.0; diff --git a/progs/xdemos/glxswapcontrol.c b/progs/xdemos/glxswapcontrol.c index cd60d46..a749b9f 100644 --- a/progs/xdemos/glxswapcontrol.c +++ b/progs/xdemos/glxswapcontrol.c @@ -103,11 +103,6 @@ current_time(void) -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLint gear1, gear2, gear3; static GLfloat angle = 0.0; diff --git a/progs/xdemos/multictx.c b/progs/xdemos/multictx.c index 75255b2..888fd92 100644 --- a/progs/xdemos/multictx.c +++ b/progs/xdemos/multictx.c @@ -42,11 +42,6 @@ -#ifndef M_PI -#define M_PI 3.14159265 -#endif - - /** Event handler results: */ #define NOP 0 #define EXIT 1 diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c b/src/gallium/drivers/i915/i915_fpc_translate.c index 25c5321..79014c2 100644 --- a/src/gallium/drivers/i915/i915_fpc_translate.c +++ b/src/gallium/drivers/i915/i915_fpc_translate.c @@ -399,11 +399,6 @@ emit_simple_arith_swap2(struct i915_fp_compile *p, emit_simple_arith(p, &inst2, opcode, numArgs); } - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - /* * Translate TGSI instruction to i915 instruction. * diff --git a/src/gallium/state_trackers/vega/arc.c b/src/gallium/state_trackers/vega/arc.c index 2d12340..160f5ab 100644 --- a/src/gallium/state_trackers/vega/arc.c +++ b/src/gallium/state_trackers/vega/arc.c @@ -36,10 +36,6 @@ #include -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - #define DEBUG_ARCS 0 static const VGfloat two_pi = M_PI * 2; diff --git a/src/glut/beos/glut_shapes.c b/src/glut/beos/glut_shapes.c index ce5bebb..d281e66 100644 --- a/src/glut/beos/glut_shapes.c +++ b/src/glut/beos/glut_shapes.c @@ -47,11 +47,6 @@ OpenGL(TM) is a trademark of Silicon Graphics, Inc. #include #include "glutint.h" -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - static GLUquadricObj *quadObj; #define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } diff --git a/src/glut/glx/glut_shapes.c b/src/glut/glx/glut_shapes.c index 20e2102..b8947ed 100644 --- a/src/glut/glx/glut_shapes.c +++ b/src/glut/glx/glut_shapes.c @@ -47,11 +47,6 @@ OpenGL(TM) is a trademark of Silicon Graphics, Inc. #include #include "glutint.h" -/* Some files do not define M_PI... */ -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - static GLUquadricObj *quadObj; #define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); } -- 1.7.0.4