mojoshader.c
changeset 1162 de0613aa8f07
parent 1161 6085abb2edaa
child 1163 c73c39a59dd4
--- a/mojoshader.c	Fri May 27 13:54:16 2016 -0400
+++ b/mojoshader.c	Fri May 27 14:02:59 2016 -0400
@@ -12050,7 +12050,7 @@
                                                       void *d)
 {
     // !!! FIXME: This is copypasta ripped from parse_preshader -flibit
-    int i;
+    unsigned int i;
 
     // All sections of a preshader are packed into separate comment tokens,
     //  inside the containing comment token block. Find them all before
@@ -12060,6 +12060,8 @@
     PreshaderBlockInfo fxlc = { 0, 0, 0 };
     PreshaderBlockInfo clit = { 0, 0, 0 };
 
+    CtabData ctabdata = { 0, 0, 0 };
+
     const uint32 *tokens = (const uint32 *) buf;
     uint32 tokcount = _len / 4;
 
@@ -12190,7 +12192,6 @@
     }
 
     // Now we'll figure out the CTAB...
-    CtabData ctabdata = { 0, 0, 0 };
     parse_constant_table(&fillerContext, ctab.tokens - 1, ctab.tokcount * 4,
                          version, 0, &ctabdata);
 
@@ -12297,7 +12298,7 @@
                 case 2:  // item from ctabdata.
                 {
                     MOJOSHADER_symbol *sym = ctabdata.symbols;
-                    for (i = 0; i < ctabdata.symbol_count; i++, sym++)
+                    for (i = 0; i < (unsigned int) ctabdata.symbol_count; i++, sym++)
                     {
                         const uint32 base = sym->register_index * 4;
                         const uint32 count = sym->register_count * 4;