[edk2] [PATCH 2/3] BaseTools/GenVtf: Fix VS2010/VS2012 build failure

Hao Wu posted 3 patches 7 years, 8 months ago
[edk2] [PATCH 2/3] BaseTools/GenVtf: Fix VS2010/VS2012 build failure
Posted by Hao Wu 7 years, 8 months ago
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'.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
---
 BaseTools/Source/C/GenVtf/GenVtf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/C/GenVtf/GenVtf.c b/BaseTools/Source/C/GenVtf/GenVtf.c
index ff0e7cfb2c..2ae9a7be2c 100644
--- a/BaseTools/Source/C/GenVtf/GenVtf.c
+++ b/BaseTools/Source/C/GenVtf/GenVtf.c
@@ -2703,10 +2703,12 @@ Returns:
     }
     SymFileName = VTF_SYM_FILE;
   } else {
-    assert (OutFileName1);
-    INTN OutFileNameLen = strlen(OutFileName1);
+    INTN OutFileNameLen;
     INTN NewIndex;
 
+    assert (OutFileName1);
+    OutFileNameLen = strlen(OutFileName1);
+
     for (NewIndex = OutFileNameLen; NewIndex > 0; --NewIndex) {
       if (OutFileName1[NewIndex] == '/' || OutFileName1[NewIndex] == '\\') {
         break;
-- 
2.12.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel