mesa: fix double->float assignment warnings, int/uint comparison warnings
[mesa.git] / src / mesa / shader / prog_optimize.c
index 3d28d885a44f702cbbc8c08b9282e77ecc644c5f..e1ec52254c0882432de81c8ef5fa6b8a80a444c3 100644 (file)
@@ -111,7 +111,6 @@ remove_instructions(struct gl_program *prog, const GLboolean *removeFlags)
    if (removeCount > 0) {
       GLint removeStart = removeEnd - removeCount + 1;
       _mesa_delete_instructions(prog, removeStart, removeCount);
-      removeStart = removeCount = 0; /* reset removal info */
    }
    return totalRemoved;
 }
@@ -443,7 +442,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog)
     *    FOO tmpY, arg0, arg1;
     */
 
-   for (i = 0; i < prog->NumInstructions - 1; i++) {
+   for (i = 0; i + 1 < prog->NumInstructions; i++) {
       const struct prog_instruction *mov = prog->Instructions + i;
 
       if (mov->Opcode != OPCODE_MOV ||
@@ -460,7 +459,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog)
        */
       for (j = i + 1; j < prog->NumInstructions; j++) {
         struct prog_instruction *inst2 = prog->Instructions + j;
-        int arg;
+        GLuint arg;
 
         if (_mesa_is_flow_control_opcode(inst2->Opcode))
             break;
@@ -578,7 +577,7 @@ _mesa_remove_extra_moves(struct gl_program *prog)
 
             /* get pointer to previous instruction */
             prevI = i - 1;
-            while (removeInst[prevI] && prevI > 0)
+            while (prevI > 0 && removeInst[prevI])
                prevI--;
             prevInst = prog->Instructions + prevI;
 
@@ -868,7 +867,7 @@ find_live_intervals(struct gl_program *prog,
          _mesa_printf("Reg[%d] live [%d, %d]:",
                       inv->Reg, inv->Start, inv->End);
          if (1) {
-            int j;
+            GLuint j;
             for (j = 0; j < inv->Start; j++)
                _mesa_printf(" ");
             for (j = inv->Start; j <= inv->End; j++)
@@ -946,7 +945,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
           */
          {
             GLint j;
-            for (j = 0; j < activeIntervals.Num; j++) {
+            for (j = 0; j < (GLint) activeIntervals.Num; j++) {
                const struct interval *inv = activeIntervals.Intervals + j;
                if (inv->End >= live->Start) {
                   /* Stop now.  Since the activeInterval list is sorted
@@ -995,7 +994,7 @@ _mesa_reallocate_registers(struct gl_program *prog)
       }
    }
 
-   if (maxTemp + 1 < liveIntervals.Num) {
+   if (maxTemp + 1 < (GLint) liveIntervals.Num) {
       /* OK, we've reduced the number of registers needed.
        * Scan the program and replace all the old temporary register
        * indexes with the new indexes.