]> git.proxmox.com Git - mirror_edk2.git/commitdiff
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 ff0e7cfb2c44b9a4b2afc9fc5078c40710584d85..2ae9a7be2cbe088e8217c0cb820f6c3242e45f95 100644 (file)
@@ -2703,10 +2703,12 @@ Returns:
     }\r
     SymFileName = VTF_SYM_FILE;\r
   } else {\r
     }\r
     SymFileName = VTF_SYM_FILE;\r
   } else {\r
-    assert (OutFileName1);\r
-    INTN OutFileNameLen = strlen(OutFileName1);\r
+    INTN OutFileNameLen;\r
     INTN NewIndex;\r
 \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
     for (NewIndex = OutFileNameLen; NewIndex > 0; --NewIndex) {\r
       if (OutFileName1[NewIndex] == '/' || OutFileName1[NewIndex] == '\\') {\r
         break;\r