From: Gary Lin <glin@suse.com>
To: edk2-devel@lists.01.org
Cc: Qin Long <qin.long@intel.com>, Ting Ye <ting.ye@intel.com>
Subject: [PATCH] CryptoPkg/IntrinsicLib: Fix the warning on memset
Date: Wed, 22 Nov 2017 12:43:56 +0800 [thread overview]
Message-ID: <20171122044356.10258-1-glin@suse.com> (raw)
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>
---
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
next reply other threads:[~2017-11-22 4:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 4:43 Gary Lin [this message]
2017-11-22 8:10 ` [PATCH] CryptoPkg/IntrinsicLib: Fix the warning on memset Long, Qin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171122044356.10258-1-glin@suse.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox