summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-06-11 20:13:07 -0600
committerKeith Whitwell <[email protected]>2008-09-21 22:13:53 -0700
commitddd630ef907cd6bb91bad0c9f5db83f2fa67be47 (patch)
treebbe3a398966106e6d6f37e9f2a58c78e7646b125
parentae1fdc15238498bf025d0f0be7337e2f9dda455f (diff)
mesa: refactor: move various ENUM_TO_x macros into macros.h
-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 b36154afff1..ae6afef17da 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 1c0279c0262..decc9dd52a6 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 fbbcd4e269e..2630855a0ea 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 2b5b15524ec..e072cea136e 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 1018c3037bc..244c7aaafc4 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 82abdc1394f..dc27124b8e7 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 336c416bece..f0193770412 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