r300: Silence 'mixed declarations and code' warning.
[mesa.git] / src / mesa / drivers / dri / r300 / compiler / radeon_code.c
index c7923004df9f1e67f233bddc52830b698a0b182c..853b2becd1b6b63d070e109e21b4423fdb3f1592 100644 (file)
  *
  */
 
-#include "main/mtypes.h"
-#include "shader/prog_instruction.h"
-
 #include "radeon_code.h"
 
+#include <stdlib.h>
+#include <string.h>
+
+#include "radeon_program.h"
+
 void rc_constants_init(struct rc_constant_list * c)
 {
        memset(c, 0, sizeof(*c));
@@ -141,9 +143,10 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da
 
        for(index = 0; index < c->Count; ++index) {
                if (c->Constants[index].Type == RC_CONSTANT_IMMEDIATE) {
-                       for(unsigned comp = 0; comp < c->Constants[index].Size; ++comp) {
+                       unsigned comp;
+                       for(comp = 0; comp < c->Constants[index].Size; ++comp) {
                                if (c->Constants[index].u.Immediate[comp] == data) {
-                                       *swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp);
+                                       *swizzle = RC_MAKE_SWIZZLE(comp, comp, comp, comp);
                                        return index;
                                }
                        }
@@ -156,7 +159,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da
        if (free_index >= 0) {
                unsigned comp = c->Constants[free_index].Size++;
                c->Constants[free_index].u.Immediate[comp] = data;
-               *swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp);
+               *swizzle = RC_MAKE_SWIZZLE(comp, comp, comp, comp);
                return free_index;
        }
 
@@ -164,7 +167,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da
        constant.Type = RC_CONSTANT_IMMEDIATE;
        constant.Size = 1;
        constant.u.Immediate[0] = data;
-       *swizzle = SWIZZLE_XXXX;
+       *swizzle = RC_SWIZZLE_XXXX;
 
        return rc_constants_add(c, &constant);
 }