public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Hao Wu <hao.a.wu@intel.com>
To: edk2-devel@lists.01.org
Cc: Hao Wu <hao.a.wu@intel.com>,
	Yonghong Zhu <yonghong.zhu@intel.com>,
	Liming Gao <liming.gao@intel.com>
Subject: [PATCH 2/3] BaseTools/GenVtf: Fix VS2010/VS2012 build failure
Date: Mon,  6 Mar 2017 13:10:40 +0800	[thread overview]
Message-ID: <20170306051041.25480-3-hao.a.wu@intel.com> (raw)
In-Reply-To: <20170306051041.25480-1-hao.a.wu@intel.com>

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



  parent reply	other threads:[~2017-03-06  5:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-06  5:10 [PATCH 0/3] BaseTools/Source/C: Fix VS2010/2012 build failure Hao Wu
2017-03-06  5:10 ` [PATCH 1/3] BaseTools/GenFw: Fix VS2010/VS2012 " Hao Wu
2017-03-06  5:10 ` Hao Wu [this message]
2017-03-06  5:10 ` [PATCH 3/3] BaseTools/VolInfo: " Hao Wu
2017-03-06  5:18 ` [PATCH 0/3] BaseTools/Source/C: Fix VS2010/2012 " Zhu, Yonghong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170306051041.25480-3-hao.a.wu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox