summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-06-11 20:13:07 -0600
committerKeith Whitwell <keith@tungstengraphics.com>2008-09-21 22:13:53 -0700
commitddd630ef907cd6bb91bad0c9f5db83f2fa67be47 (patch)
treebbe3a398966106e6d6f37e9f2a58c78e7646b125 /src
parentae1fdc15238498bf025d0f0be7337e2f9dda455f (diff)
mesa: refactor: move various ENUM_TO_x macros into macros.h
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/get.c4
-rw-r--r--src/mesa/main/get_gen.py4
-rw-r--r--src/mesa/main/macros.h7
-rw-r--r--src/mesa/main/texenv.c2
-rw-r--r--src/mesa/main/texgen.c4
-rw-r--r--src/mesa/main/texparam.c3
-rw-r--r--src/mesa/main/texstate.c3
7 files changed, 7 insertions, 20 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index b36154afff..ae6afef17d 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -19,10 +19,6 @@
#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
-#define ENUM_TO_BOOLEAN(E) ( (E) ? GL_TRUE : GL_FALSE )
-#define ENUM_TO_INT(E) ( (GLint) (E) )
-#define ENUM_TO_FLOAT(E) ( (GLfloat) (E) )
-
#define BOOLEAN_TO_INT(B) ( (GLint) (B) )
#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py
index 1c0279c026..decc9dd52a 100644
--- a/src/mesa/main/get_gen.py
+++ b/src/mesa/main/get_gen.py
@@ -1129,10 +1129,6 @@ def EmitHeader():
#define INT_TO_BOOLEAN(I) ( (I) ? GL_TRUE : GL_FALSE )
-#define ENUM_TO_BOOLEAN(E) ( (E) ? GL_TRUE : GL_FALSE )
-#define ENUM_TO_INT(E) ( (GLint) (E) )
-#define ENUM_TO_FLOAT(E) ( (GLfloat) (E) )
-
#define BOOLEAN_TO_INT(B) ( (GLint) (B) )
#define BOOLEAN_TO_FLOAT(B) ( (B) ? 1.0F : 0.0F )
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index fbbcd4e269..2630855a0e 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -657,4 +657,11 @@ do { \
#define LEN_SQUARED_2FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1])
+/** casts to silence warnings with some compilers */
+#define ENUM_TO_INT(E) ((GLint)(E))
+#define ENUM_TO_FLOAT(E) ((GLfloat)(GLint)(E))
+#define ENUM_TO_DOUBLE(E) ((GLdouble)(GLint)(E))
+#define ENUM_TO_BOOLEAN(E) ((E) ? GL_TRUE : GL_FALSE)
+
+
#endif
diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
index 2b5b15524e..e072cea136 100644
--- a/src/mesa/main/texenv.c
+++ b/src/mesa/main/texenv.c
@@ -37,8 +37,6 @@
#include "math/m_xform.h"
-#define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X))
-
void GLAPIENTRY
_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c
index 1018c3037b..244c7aaafc 100644
--- a/src/mesa/main/texgen.c
+++ b/src/mesa/main/texgen.c
@@ -37,10 +37,6 @@
#include "math/m_xform.h"
-#define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X))
-#define ENUM_TO_DOUBLE(X) ((GLdouble)(GLint)(X))
-
-
void GLAPIENTRY
_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 82abdc1394..dc27124b8e 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -39,9 +39,6 @@
#include "main/teximage.h"
-#define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X))
-
-
/**
* Check if a coordinate wrap mode is supported for the texture target.
* \return GL_TRUE if legal, GL_FALSE otherwise
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 336c416bec..f019377041 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -45,9 +45,6 @@
#include "math/m_xform.h"
-#define ENUM_TO_FLOAT(X) ((GLfloat)(GLint)(X))
-#define ENUM_TO_DOUBLE(X) ((GLdouble)(GLint)(X))
-
/**
* Default texture combine environment state. This is used to initialize