From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2597B81D7E for ; Thu, 3 Nov 2016 00:23:34 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 03 Nov 2016 00:23:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,585,1473145200"; d="scan'208";a="897185114" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.34]) by orsmga003.jf.intel.com with ESMTP; 03 Nov 2016 00:23:34 -0700 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Liming Gao , Yonghong Zhu Date: Thu, 3 Nov 2016 15:22:26 +0800 Message-Id: <1478157783-9368-17-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 In-Reply-To: <1478157783-9368-1-git-send-email-hao.a.wu@intel.com> References: <1478157783-9368-1-git-send-email-hao.a.wu@intel.com> Subject: [PATCH v2 16/53] BaseTools/C/Common: Fix parameter format mismatch in scanf functions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2016 07:23:34 -0000 According to MSDN https://msdn.microsoft.com/en-us/library/6ttkkkhh.aspx Format specification '%x' for scanf expects type 'int *', modify the type of the relating variable to 'int' to keep them matched. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- BaseTools/Source/C/Common/ParseInf.c | 10 +++++----- BaseTools/Source/C/Common/SimpleFileParsing.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/C/Common/ParseInf.c b/BaseTools/Source/C/Common/ParseInf.c index 0a204c8..d784536 100644 --- a/BaseTools/Source/C/Common/ParseInf.c +++ b/BaseTools/Source/C/Common/ParseInf.c @@ -1,7 +1,7 @@ /** @file This contains some useful functions for parsing INF files. -Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -391,10 +391,10 @@ Returns: --*/ { INT32 Index; - unsigned Data1; - unsigned Data2; - unsigned Data3; - unsigned Data4[8]; + int Data1; + int Data2; + int Data3; + int Data4[8]; if (AsciiGuidBuffer == NULL || GuidBuffer == NULL) { return EFI_INVALID_PARAMETER; diff --git a/BaseTools/Source/C/Common/SimpleFileParsing.c b/BaseTools/Source/C/Common/SimpleFileParsing.c index 877bb6f..868c6b7 100644 --- a/BaseTools/Source/C/Common/SimpleFileParsing.c +++ b/BaseTools/Source/C/Common/SimpleFileParsing.c @@ -1,7 +1,7 @@ /** @file Generic but simple file parsing routines. -Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -530,7 +530,7 @@ Returns: --*/ { - unsigned Val; + int Val; SkipWhiteSpace (&mGlobals.SourceFile); if (EndOfFile (&mGlobals.SourceFile)) { @@ -1276,7 +1276,7 @@ Returns: --*/ { - unsigned Value32; + INT32 Value32; UINT32 Index; FILE_POSITION FPos; CHAR8 TempString[20]; -- 1.9.5.msysgit.0