public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdePkg/BaseLib: Change a variable type in a bitwise operation
@ 2019-02-14  2:44 Shenglei Zhang
  2019-02-15 13:51 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Shenglei Zhang @ 2019-02-14  2:44 UTC (permalink / raw)
  To: edk2-devel; +Cc: Michael D Kinney, Liming Gao

Change the type of variable Chr from CHAR8 to UINT32 in a
bitwise operation, to make the two variables in the operation
have the same size.
https://bugzilla.tianocore.org/show_bug.cgi?id=1527

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 MdePkg/Library/BaseLib/String.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
index 53ff730e9e..a389115d71 100644
--- a/MdePkg/Library/BaseLib/String.c
+++ b/MdePkg/Library/BaseLib/String.c
@@ -2070,7 +2070,7 @@ Base64Decode (
       Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
       } while (Chr == BAD_V);
       Value <<= 6;
-      Value |= Chr;
+      Value |= (UINT32)Chr;
     }
 
     //
-- 
2.18.0.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MdePkg/BaseLib: Change a variable type in a bitwise operation
  2019-02-14  2:44 [PATCH] MdePkg/BaseLib: Change a variable type in a bitwise operation Shenglei Zhang
@ 2019-02-15 13:51 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2019-02-15 13:51 UTC (permalink / raw)
  To: Zhang, Shenglei, edk2-devel@lists.01.org; +Cc: Kinney, Michael D

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Thursday, February 14, 2019 10:45 AM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [PATCH] MdePkg/BaseLib: Change a variable type in a bitwise operation
> 
> Change the type of variable Chr from CHAR8 to UINT32 in a
> bitwise operation, to make the two variables in the operation
> have the same size.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1527
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  MdePkg/Library/BaseLib/String.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
> index 53ff730e9e..a389115d71 100644
> --- a/MdePkg/Library/BaseLib/String.c
> +++ b/MdePkg/Library/BaseLib/String.c
> @@ -2070,7 +2070,7 @@ Base64Decode (
>        Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
>        } while (Chr == BAD_V);
>        Value <<= 6;
> -      Value |= Chr;
> +      Value |= (UINT32)Chr;
>      }
> 
>      //
> --
> 2.18.0.windows.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-15 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-14  2:44 [PATCH] MdePkg/BaseLib: Change a variable type in a bitwise operation Shenglei Zhang
2019-02-15 13:51 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox