From: Liming Gao <liming.gao@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>
Subject: [Patch 3/3] MdeModulePkg Variable: Use comparison logic to check UINTN parameter
Date: Mon, 28 May 2018 15:30:52 +0800 [thread overview]
Message-ID: <1527492652-17544-4-git-send-email-liming.gao@intel.com> (raw)
In-Reply-To: <1527492652-17544-1-git-send-email-liming.gao@intel.com>
Commit 180ac200da84785989443b06bcfa5db343c0bf7e changes the input parameter
from BOOLEAN to UINTN. Its comparison logic should be updated.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
---
MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c | 8 ++++----
MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
index 8ad2c71..e37d0cd 100644
--- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
+++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c
@@ -599,7 +599,7 @@ VariableGetBestLanguage (
//
// If in RFC 4646 mode, then determine the length of the first RFC 4646 language code in Language
//
- if (!Iso639Language) {
+ if (Iso639Language == 0) {
for (LanguageLength = 0; Language[LanguageLength] != 0 && Language[LanguageLength] != ';'; LanguageLength++);
}
@@ -614,7 +614,7 @@ VariableGetBestLanguage (
//
// In RFC 4646 mode, then Loop through all language codes in SupportedLanguages
//
- if (!Iso639Language) {
+ if (Iso639Language == 0) {
//
// Skip ';' characters in Supported
//
@@ -636,13 +636,13 @@ VariableGetBestLanguage (
if (AsciiStrnCmp (Supported, Language, LanguageLength) == 0) {
VA_END (Args);
- Buffer = Iso639Language ? mVariableModuleGlobal->Lang : mVariableModuleGlobal->PlatformLang;
+ Buffer = (Iso639Language != 0) ? mVariableModuleGlobal->Lang : mVariableModuleGlobal->PlatformLang;
Buffer[CompareLength] = '\0';
return CopyMem (Buffer, Supported, CompareLength);
}
}
- if (Iso639Language) {
+ if (Iso639Language != 0) {
//
// If ISO 639 mode, then each language can only be tested once
//
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 5eff808..6073315 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -1588,7 +1588,7 @@ VariableGetBestLanguage (
//
// If in RFC 4646 mode, then determine the length of the first RFC 4646 language code in Language
//
- if (!Iso639Language) {
+ if (Iso639Language == 0) {
for (LanguageLength = 0; Language[LanguageLength] != 0 && Language[LanguageLength] != ';'; LanguageLength++);
}
@@ -1603,7 +1603,7 @@ VariableGetBestLanguage (
//
// In RFC 4646 mode, then Loop through all language codes in SupportedLanguages
//
- if (!Iso639Language) {
+ if (Iso639Language == 0) {
//
// Skip ';' characters in Supported
//
@@ -1625,13 +1625,13 @@ VariableGetBestLanguage (
if (AsciiStrnCmp (Supported, Language, LanguageLength) == 0) {
VA_END (Args);
- Buffer = Iso639Language ? mVariableModuleGlobal->Lang : mVariableModuleGlobal->PlatformLang;
+ Buffer = (Iso639Language != 0) ? mVariableModuleGlobal->Lang : mVariableModuleGlobal->PlatformLang;
Buffer[CompareLength] = '\0';
return CopyMem (Buffer, Supported, CompareLength);
}
}
- if (Iso639Language) {
+ if (Iso639Language != 0) {
//
// If ISO 639 mode, then each language can only be tested once
//
--
2.8.0.windows.1
next prev parent reply other threads:[~2018-05-28 7:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-28 7:30 [Patch 0/3] Use comparison logic to check UINTN parameter in GetBestLanguage API Liming Gao
2018-05-28 7:30 ` [Patch 1/3] MdePkg UefiLib: Use comparison logic to check UINTN parameter Liming Gao
2018-05-28 7:30 ` [Patch 2/3] IntelFrameworkPkg " Liming Gao
2018-05-28 7:30 ` Liming Gao [this message]
2018-05-28 7:53 ` [Patch 0/3] Use comparison logic to check UINTN parameter in GetBestLanguage API Zeng, Star
2018-05-28 8:10 ` Marvin H?user
2018-05-29 3:36 ` Gao, Liming
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=1527492652-17544-4-git-send-email-liming.gao@intel.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