BaseTools/GenVtf: Fix VS2010/VS2012 build failure
authorHao Wu <hao.a.wu@intel.com>
Mon, 6 Mar 2017 02:39:34 +0000 (10:39 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 7 Mar 2017 00:43:33 +0000 (08:43 +0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=417

The commit makes the following refinements in GenVtf source codes to
avoid VS2010/VS2012 build failure:

1. Refines coding style to declare local variables at the beginning of a
code block in function 'main'.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/C/GenVtf/GenVtf.c

index ff0e7cf..2ae9a7b 100644 (file)
@@ -2703,10 +2703,12 @@ Returns:
     }\r
     SymFileName = VTF_SYM_FILE;\r
   } else {\r
-    assert (OutFileName1);\r
-    INTN OutFileNameLen = strlen(OutFileName1);\r
+    INTN OutFileNameLen;\r
     INTN NewIndex;\r
 \r
+    assert (OutFileName1);\r
+    OutFileNameLen = strlen(OutFileName1);\r
+\r
     for (NewIndex = OutFileNameLen; NewIndex > 0; --NewIndex) {\r
       if (OutFileName1[NewIndex] == '/' || OutFileName1[NewIndex] == '\\') {\r
         break;\r