fix bug in popping texture color table state
[mesa.git] / src / mesa / main / macros.h
index 038518d90aa1f57a9fdb62ce8fa28193860679b7..4fc93936ac86a17ca5825f63015197f22c5bf9a8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: macros.h,v 1.28 2002/06/12 00:52:50 brianp Exp $ */
+/* $Id: macros.h,v 1.30 2002/10/18 17:02:00 kschultz Exp $ */
 
 /*
  * Mesa 3-D graphics library
 #endif
 
 
-
-/*
- * Bitmask helpers
- */
-#define SET_BITS(WORD, BITS)    (WORD) |= (BITS)
-#define CLEAR_BITS(WORD, BITS)  (WORD) &= ~(BITS)
-#define TEST_BITS(WORD, BITS)   ((WORD) & (BITS))
-
-
 /* Stepping a GLfloat pointer by a byte stride
  */
 #define STRIDE_F(p, i)  (p = (GLfloat *)((GLubyte *)p + i))
@@ -122,6 +113,27 @@ do {                                               \
    (DST)[3] = (SRC)[3];                                \
 } while (0)
 
+#define COPY_2V_CAST( DST, SRC, CAST )         \
+do {                                           \
+   (DST)[0] = (CAST)(SRC)[0];                  \
+   (DST)[1] = (CAST)(SRC)[1];                  \
+} while (0)
+
+#define COPY_3V_CAST( DST, SRC, CAST )         \
+do {                                           \
+   (DST)[0] = (CAST)(SRC)[0];                  \
+   (DST)[1] = (CAST)(SRC)[1];                  \
+   (DST)[2] = (CAST)(SRC)[2];                  \
+} while (0)
+
+#define COPY_4V_CAST( DST, SRC, CAST )         \
+do {                                           \
+   (DST)[0] = (CAST)(SRC)[0];                  \
+   (DST)[1] = (CAST)(SRC)[1];                  \
+   (DST)[2] = (CAST)(SRC)[2];                  \
+   (DST)[3] = (CAST)(SRC)[3];                  \
+} while (0)
+
 #if defined(__i386__)
 #define COPY_4UBV(DST, SRC)                    \
 do {                                           \