From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=195.135.221.5; helo=smtp.nue.novell.com; envelope-from=glin@suse.com; receiver=edk2-devel@lists.01.org Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 140A521C913B2 for ; Tue, 21 Nov 2017 20:40:01 -0800 (PST) Received: from localhost.localdomain (unknown.telstraglobal.net [134.159.103.118]) by smtp.nue.novell.com with ESMTP (NOT encrypted); Wed, 22 Nov 2017 05:44:14 +0100 From: Gary Lin To: edk2-devel@lists.01.org Cc: Qin Long , Ting Ye Date: Wed, 22 Nov 2017 12:43:56 +0800 Message-Id: <20171122044356.10258-1-glin@suse.com> X-Mailer: git-send-email 2.15.0 Subject: [PATCH] CryptoPkg/IntrinsicLib: Fix the warning on memset X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 04:40:02 -0000 Gcc issued the warning when compiling CryptoPkg: CryptoPkg/Library/Include/CrtLibSupport.h:135:17: warning: type of 'memset' does not match original declaration [-Wlto-type-mismatch] void *memset (void *, int, size_t); ^ CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c:27:8: note: type mismatch in parameter 2 void * memset (void *dest, char ch, size_t count) ^ This commit changes the type of ch from char to int to match the declaration. Cc: Qin Long Cc: Ting Ye Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Gary Lin --- CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c index bf485d680d..e095f9aa0d 100644 --- a/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c +++ b/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c @@ -24,7 +24,7 @@ typedef UINTN size_t; int _fltused = 1; /* Sets buffers to a specified character */ -void * memset (void *dest, char ch, size_t count) +void * memset (void *dest, int ch, size_t count) { // // NOTE: Here we use one base implementation for memset, instead of the direct @@ -42,7 +42,7 @@ void * memset (void *dest, char ch, size_t count) Pointer = (UINT8 *)dest; while (count-- != 0) { - *(Pointer++) = ch; + *(Pointer++) = (UINT8)ch; } return dest; -- 2.15.0