From 3d7c6cfbab977e5c6f3e8dbcd9c7c0b72f7add8d Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Mon, 28 May 2018 15:30:50 +0800 Subject: [PATCH] MdePkg UefiLib: Use comparison logic to check UINTN parameter Commit d2aafe1e410c80d1046f2d1e743055882ead8489 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 Cc: Michael Kinney Reviewed-by: Star Zeng --- MdePkg/Include/Library/UefiLib.h | 4 ++-- MdePkg/Library/UefiLib/UefiLib.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index bc2f712fdb..617420ee05 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -789,8 +789,8 @@ GetEfiGlobalVariable2 ( @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string that contains a set of language codes in the format specified by Iso639Language. - @param[in] Iso639Language If TRUE, then all language codes are assumed to be - in ISO 639-2 format. If FALSE, then all language + @param[in] Iso639Language If not zero, then all language codes are assumed to be + in ISO 639-2 format. If zero, then all language codes are assumed to be in RFC 4646 language format @param[in] ... A variable argument list that contains pointers to Null-terminated ASCII strings that contain one or more diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c index 9ade1b0ce1..2260183cba 100644 --- a/MdePkg/Library/UefiLib/UefiLib.c +++ b/MdePkg/Library/UefiLib/UefiLib.c @@ -1485,8 +1485,8 @@ GetEfiGlobalVariable2 ( @param[in] SupportedLanguages A pointer to a Null-terminated ASCII string that contains a set of language codes in the format specified by Iso639Language. - @param[in] Iso639Language If TRUE, then all language codes are assumed to be - in ISO 639-2 format. If FALSE, then all language + @param[in] Iso639Language If not zero, then all language codes are assumed to be + in ISO 639-2 format. If zero, then all language codes are assumed to be in RFC 4646 language format @param[in] ... A variable argument list that contains pointers to Null-terminated ASCII strings that contain one or more @@ -1538,7 +1538,7 @@ GetBestLanguage ( // // 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++); } @@ -1553,7 +1553,7 @@ GetBestLanguage ( // // In RFC 4646 mode, then Loop through all language codes in SupportedLanguages // - if (!Iso639Language) { + if (Iso639Language == 0) { // // Skip ';' characters in Supported // @@ -1585,7 +1585,7 @@ GetBestLanguage ( } } - if (Iso639Language) { + if (Iso639Language != 0) { // // If ISO 639 mode, then each language can only be tested once // -- 2.39.2