From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2638E1A1EF9 for ; Wed, 12 Oct 2016 05:21:26 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 12 Oct 2016 05:21:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,482,1473145200"; d="scan'208";a="1063788681" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.34]) by orsmga002.jf.intel.com with ESMTP; 12 Oct 2016 05:21:24 -0700 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Liming Gao , Yonghong Zhu Date: Wed, 12 Oct 2016 20:20:00 +0800 Message-Id: <1476274836-10544-17-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 In-Reply-To: <1476274836-10544-1-git-send-email-hao.a.wu@intel.com> References: <1476274836-10544-1-git-send-email-hao.a.wu@intel.com> Subject: [PATCH 16/52] 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: Wed, 12 Oct 2016 12:21:26 -0000 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- BaseTools/Source/C/Common/ParseInf.c | 24 ++++++++++++------------ BaseTools/Source/C/Common/SimpleFileParsing.c | 14 +++++++------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/BaseTools/Source/C/Common/ParseInf.c b/BaseTools/Source/C/Common/ParseInf.c index 9e85a88..28ed1ca 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 @@ -429,17 +429,17 @@ Returns: Index = sscanf ( AsciiGuidBuffer, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - &Data1, - &Data2, - &Data3, - &Data4[0], - &Data4[1], - &Data4[2], - &Data4[3], - &Data4[4], - &Data4[5], - &Data4[6], - &Data4[7] + (INT32 *) &Data1, + (INT32 *) &Data2, + (INT32 *) &Data3, + (INT32 *) &Data4[0], + (INT32 *) &Data4[1], + (INT32 *) &Data4[2], + (INT32 *) &Data4[3], + (INT32 *) &Data4[4], + (INT32 *) &Data4[5], + (INT32 *) &Data4[6], + (INT32 *) &Data4[7] ); // diff --git a/BaseTools/Source/C/Common/SimpleFileParsing.c b/BaseTools/Source/C/Common/SimpleFileParsing.c index 877bb6f..a99a0ea 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 @@ -547,7 +547,7 @@ Returns: } mGlobals.SourceFile.FileBufferPtr += 2; - sscanf (mGlobals.SourceFile.FileBufferPtr, "%x", &Val); + sscanf (mGlobals.SourceFile.FileBufferPtr, "%x", (INT32 *) &Val); *Value = (UINT32) Val; while (isxdigit ((int)mGlobals.SourceFile.FileBufferPtr[0])) { mGlobals.SourceFile.FileBufferPtr++; @@ -1305,7 +1305,7 @@ Returns: goto Done; } - sscanf (TempString, "%x", &Value32); + sscanf (TempString, "%x", (INT32 *) &Value32); Value->Data1 = Value32; // // Next two UINT16 fields @@ -1320,7 +1320,7 @@ Returns: goto Done; } - sscanf (TempString, "%x", &Value32); + sscanf (TempString, "%x", (INT32 *) &Value32); Value->Data2 = (UINT16) Value32; if (mGlobals.SourceFile.FileBufferPtr[0] != '-') { @@ -1333,7 +1333,7 @@ Returns: goto Done; } - sscanf (TempString, "%x", &Value32); + sscanf (TempString, "%x", (INT32 *) &Value32); Value->Data3 = (UINT16) Value32; // // Parse the "AAAA" as two bytes @@ -1348,7 +1348,7 @@ Returns: goto Done; } - sscanf (TempString, "%x", &Value32); + sscanf (TempString, "%x", (INT32 *) &Value32); Value->Data4[0] = (UINT8) (Value32 >> 8); Value->Data4[1] = (UINT8) Value32; if (mGlobals.SourceFile.FileBufferPtr[0] != '-') { @@ -1393,7 +1393,7 @@ Returns: // TempString2[0] = TempString[Index * 2]; TempString2[1] = TempString[Index * 2 + 1]; - sscanf (TempString2, "%x", &Value32); + sscanf (TempString2, "%x", (INT32 *) &Value32); Value->Data4[Index + 2] = (UINT8) Value32; } -- 1.9.5.msysgit.0