From a3064f0d353faa5be072147beee7f07d7d07c996 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 16 Jul 2010 16:46:43 +0100 Subject: [PATCH] Remove definitions of M_PI Remove the many and various definitions of M_PI 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 --- src/demos/dinoshade.c | 5 ----- src/demos/engine.c | 4 ---- src/demos/fbo_firecube.c | 4 ---- src/demos/fire.c | 4 ---- src/demos/gearbox.c | 4 ---- src/demos/gears.c | 4 ---- src/demos/geartrain.c | 3 --- src/demos/ipers.c | 4 ---- src/demos/pointblast.c | 5 ----- src/demos/projtex.c | 5 ----- src/demos/rain.cxx | 3 --- src/demos/ray.c | 4 ---- src/demos/spriteblast.c | 5 ----- src/demos/stex3d.c | 4 ---- src/demos/teapot.c | 4 ---- src/demos/terrain.c | 4 ---- src/demos/tunnel.c | 4 ---- src/demos/tunnel2.c | 4 ---- src/demos/winpos.c | 4 ---- src/egl/opengl/peglgears.c | 5 ----- src/egl/opengl/xeglgears.c | 5 ----- src/egl/opengles1/gears.c | 4 ---- src/glsl/skinning.c | 4 ---- src/glsl/texaaline.c | 4 ---- src/glsl/twoside.c | 4 ---- src/objviewer/glm.c | 5 ----- src/objviewer/glm.h | 5 ----- src/redbook/torus.c | 5 ----- src/tests/auxbuffer.c | 4 ---- src/tests/jkrahntest.c | 4 ---- src/xdemos/corender.c | 4 ---- src/xdemos/glxcontexts.c | 5 ----- src/xdemos/glxgears.c | 5 ----- src/xdemos/glxgears_fbconfig.c | 5 ----- src/xdemos/glxgears_pixmap.c | 5 ----- src/xdemos/glxswapcontrol.c | 5 ----- src/xdemos/multictx.c | 5 ----- 37 files changed, 0 insertions(+), 161 deletions(-) diff --git a/src/demos/dinoshade.c b/src/demos/dinoshade.c index cbf8751..a477d6f 100644 --- a/src/demos/dinoshade.c +++ b/src/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/src/demos/engine.c b/src/demos/engine.c index ee7d5c1..e116ef8 100644 --- a/src/demos/engine.c +++ b/src/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/src/demos/fbo_firecube.c b/src/demos/fbo_firecube.c index afda1d7..0b36ecb 100644 --- a/src/demos/fbo_firecube.c +++ b/src/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/src/demos/fire.c b/src/demos/fire.c index bb912fb..d02d705 100644 --- a/src/demos/fire.c +++ b/src/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/src/demos/gearbox.c b/src/demos/gearbox.c index 71d0281..7ff9616 100644 --- a/src/demos/gearbox.c +++ b/src/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/src/demos/gears.c b/src/demos/gears.c index 31a5b79..1924770 100644 --- a/src/demos/gears.c +++ b/src/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/src/demos/geartrain.c b/src/demos/geartrain.c index 49a9a70..4f4f34e 100644 --- a/src/demos/geartrain.c +++ b/src/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/src/demos/ipers.c b/src/demos/ipers.c index 265378b..9740ce2 100644 --- a/src/demos/ipers.c +++ b/src/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/src/demos/pointblast.c b/src/demos/pointblast.c index b4d0a67..638ca83 100644 --- a/src/demos/pointblast.c +++ b/src/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/src/demos/projtex.c b/src/demos/projtex.c index d162568..e5cd68c 100644 --- a/src/demos/projtex.c +++ b/src/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/src/demos/rain.cxx b/src/demos/rain.cxx index 60fc414..feda2db 100644 --- a/src/demos/rain.cxx +++ b/src/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/src/demos/ray.c b/src/demos/ray.c index 9cc464d..1b52fd0 100644 --- a/src/demos/ray.c +++ b/src/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/src/demos/spriteblast.c b/src/demos/spriteblast.c index 36e226e..c9a9014 100644 --- a/src/demos/spriteblast.c +++ b/src/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/src/demos/stex3d.c b/src/demos/stex3d.c index de18480..15478d2 100644 --- a/src/demos/stex3d.c +++ b/src/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/src/demos/teapot.c b/src/demos/teapot.c index 04a675f..d424112 100644 --- a/src/demos/teapot.c +++ b/src/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/src/demos/terrain.c b/src/demos/terrain.c index a72c8d3..1569e96 100644 --- a/src/demos/terrain.c +++ b/src/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/src/demos/tunnel.c b/src/demos/tunnel.c index efc007c..c96191e 100644 --- a/src/demos/tunnel.c +++ b/src/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/src/demos/tunnel2.c b/src/demos/tunnel2.c index f15da95..3220c46 100644 --- a/src/demos/tunnel2.c +++ b/src/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/src/demos/winpos.c b/src/demos/winpos.c index f935f9b..86ce999 100644 --- a/src/demos/winpos.c +++ b/src/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/src/egl/opengl/peglgears.c b/src/egl/opengl/peglgears.c index 212d1ac..553c734 100644 --- a/src/egl/opengl/peglgears.c +++ b/src/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/src/egl/opengl/xeglgears.c b/src/egl/opengl/xeglgears.c index a6a977d..b125469 100644 --- a/src/egl/opengl/xeglgears.c +++ b/src/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/src/egl/opengles1/gears.c b/src/egl/opengles1/gears.c index 8462a48..965042e 100644 --- a/src/egl/opengles1/gears.c +++ b/src/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/src/glsl/skinning.c b/src/glsl/skinning.c index 2b96f31..228b234 100644 --- a/src/glsl/skinning.c +++ b/src/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/src/glsl/texaaline.c b/src/glsl/texaaline.c index 00edab7..6e18926 100644 --- a/src/glsl/texaaline.c +++ b/src/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/src/glsl/twoside.c b/src/glsl/twoside.c index ce155d6..39e3f08 100644 --- a/src/glsl/twoside.c +++ b/src/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/src/objviewer/glm.c b/src/objviewer/glm.c index 77e62bf..ae2956f 100644 --- a/src/objviewer/glm.c +++ b/src/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/src/objviewer/glm.h b/src/objviewer/glm.h index 1a5646f..3e8e5f9 100644 --- a/src/objviewer/glm.h +++ b/src/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/src/redbook/torus.c b/src/redbook/torus.c index a67d48e..3fb5984 100644 --- a/src/redbook/torus.c +++ b/src/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/src/tests/auxbuffer.c b/src/tests/auxbuffer.c index 5fa399a..2604432 100644 --- a/src/tests/auxbuffer.c +++ b/src/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/src/tests/jkrahntest.c b/src/tests/jkrahntest.c index 3fef105..a767da6 100644 --- a/src/tests/jkrahntest.c +++ b/src/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/src/xdemos/corender.c b/src/xdemos/corender.c index e706f4b..ede042e 100644 --- a/src/xdemos/corender.c +++ b/src/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/src/xdemos/glxcontexts.c b/src/xdemos/glxcontexts.c index 9f83679..93a421f 100644 --- a/src/xdemos/glxcontexts.c +++ b/src/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/src/xdemos/glxgears.c b/src/xdemos/glxgears.c index 92c75ca..29c22b6 100644 --- a/src/xdemos/glxgears.c +++ b/src/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/src/xdemos/glxgears_fbconfig.c b/src/xdemos/glxgears_fbconfig.c index 36bf731..083e847 100644 --- a/src/xdemos/glxgears_fbconfig.c +++ b/src/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/src/xdemos/glxgears_pixmap.c b/src/xdemos/glxgears_pixmap.c index 661d130..beb5cdb 100644 --- a/src/xdemos/glxgears_pixmap.c +++ b/src/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/src/xdemos/glxswapcontrol.c b/src/xdemos/glxswapcontrol.c index cd60d46..a749b9f 100644 --- a/src/xdemos/glxswapcontrol.c +++ b/src/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/src/xdemos/multictx.c b/src/xdemos/multictx.c index 75255b2..888fd92 100644 --- a/src/xdemos/multictx.c +++ b/src/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 -- 1.7.1