]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CryptoPkg/IntrinsicLib: Fix the warning on memset
authorGary Lin <glin@suse.com>
Wed, 22 Nov 2017 04:43:56 +0000 (12:43 +0800)
committerLong Qin <qin.long@intel.com>
Fri, 24 Nov 2017 08:36:29 +0000 (16:36 +0800)
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 <qin.long@intel.com>
Cc: Ting Ye <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Qin Long <qin.long@intel.com>
CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c

index bf485d680def90ba7a6c6cd6a6a9d37fa960a3bc..e095f9aa0dd64c20a6b96a190f8ee14f9b492780 100644 (file)
@@ -24,7 +24,7 @@ typedef UINTN  size_t;
 int _fltused = 1;\r
 \r
 /* Sets buffers to a specified character */\r
-void * memset (void *dest, char ch, size_t count)\r
+void * memset (void *dest, int ch, size_t count)\r
 {\r
   //\r
   // NOTE: Here we use one base implementation for memset, instead of the direct\r
@@ -42,7 +42,7 @@ void * memset (void *dest, char ch, size_t count)
 \r
   Pointer = (UINT8 *)dest;\r
   while (count-- != 0) {\r
-    *(Pointer++) = ch;\r
+    *(Pointer++) = (UINT8)ch;\r
   }\r
   \r
   return dest;\r