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

Hao Wu posted 3 patches 7 years, 8 months ago
[edk2] [PATCH 3/3] BaseTools/VolInfo: 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 VolInfo source codes to
avoid VS2010/VS2012 build failure:

1. Refines coding style for function 'CombinePath' to declare local
variables at the beginning of the function block.

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/VolInfo/VolInfo.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolInfo/VolInfo.c
index 2647cbb73a..eff5f9ebfc 100644
--- a/BaseTools/Source/C/VolInfo/VolInfo.c
+++ b/BaseTools/Source/C/VolInfo/VolInfo.c
@@ -1590,9 +1590,11 @@ CombinePath (
 )
 {
   UINT32 DefaultPathLen;
+  UINT64 Index;
+
   DefaultPathLen = strlen(DefaultPath);
   strcpy(NewPath, DefaultPath);
-  UINT64 Index = 0;
+  Index = 0;
   for (; Index < DefaultPathLen; Index ++) {
     if (NewPath[Index] == '\\' || NewPath[Index] == '/') {
       if (NewPath[Index + 1] != '\0') {
-- 
2.12.0.windows.1

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