tgsi: change an if to an else-if, added const qual, added comments
authorBrian Paul <brianp@vmware.com>
Mon, 12 Jan 2009 19:01:09 +0000 (12:01 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 19 Jan 2009 15:51:58 +0000 (08:51 -0700)
src/gallium/auxiliary/tgsi/tgsi_scan.c

index 1239f6c07658df2cf530de558965f89fc7028688..d02205a63ef76b471a559d64062099f1af60f011 100644 (file)
@@ -43,6 +43,9 @@
 
 
 /**
+ * Scan the given TGSI shader to collect information such as number of
+ * registers used, special instructions used, etc.
+ * \return info  the result of the scan
  */
 void
 tgsi_scan_shader(const struct tgsi_token *tokens,
@@ -115,7 +118,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
          {
             const struct tgsi_full_declaration *fulldecl
                = &parse.FullToken.FullDeclaration;
-            uint file = fulldecl->Declaration.File;
+            const uint file = fulldecl->Declaration.File;
             uint reg;
             for (reg = fulldecl->DeclarationRange.First;
                  reg <= fulldecl->DeclarationRange.Last;
@@ -131,8 +134,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                   info->input_semantic_index[reg] = (ubyte)fulldecl->Semantic.SemanticIndex;
                   info->num_inputs++;
                }
-
-               if (file == TGSI_FILE_OUTPUT) {
+               else if (file == TGSI_FILE_OUTPUT) {
                   info->output_semantic_name[reg] = (ubyte)fulldecl->Semantic.SemanticName;
                   info->output_semantic_index[reg] = (ubyte)fulldecl->Semantic.SemanticIndex;
                   info->num_outputs++;