From: Gary Lin Date: Wed, 22 Nov 2017 04:43:56 +0000 (+0800) Subject: CryptoPkg/IntrinsicLib: Fix the warning on memset X-Git-Tag: edk2-stable201903~3018 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=108ff4a04b051eea61fa5440bb1101b309ac8713 CryptoPkg/IntrinsicLib: Fix the warning on memset 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 Reviewed-by: Qin Long --- 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;