[edk2-devel] [PATCH 1/3] MdePkg/BaseLib: Adjust the coding style in Base64Decode
Laszlo Ersek
lersek at redhat.com
Mon Jul 1 09:24:38 UTC 2019
I have to revise my previous R-b for this patch. The patch is not wrong,
but it's not complete:
On 06/28/19 05:57, Gao, Zhichao wrote:
> Adjust the code style for better view.
>
> Cc: Michael D Kinney <michael.d.kinney at intel.com>
> Cc: Liming Gao <liming.gao at intel.com>
> Signed-off-by: Zhichao Gao <zhichao.gao at intel.com>
> ---
> MdePkg/Library/BaseLib/String.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
> index 32e189791c..b86e7e9436 100644
> --- a/MdePkg/Library/BaseLib/String.c
> +++ b/MdePkg/Library/BaseLib/String.c
> @@ -1993,8 +1993,7 @@ Base64Decode (
> if (BufferSize < -2) {
> return RETURN_INVALID_PARAMETER;
> }
> - }
> - else {
> + } else {
> Chr = Source[SourceIndex];
> if (BAD_V != DecodingTable[(UINT8) Chr]) {
>
> @@ -2006,8 +2005,7 @@ Base64Decode (
> return RETURN_INVALID_PARAMETER;
> }
> ActualSourceLength++;
The line above remains incorrectly indented.
Thanks
Laszlo
> - }
> - else {
> + } else {
>
> //
> // The reset of the decoder will ignore all invalid characters allowed here.
> @@ -2029,8 +2027,8 @@ Base64Decode (
> }
>
> BufferSize += ActualSourceLength / 4 * 3;
> - if (BufferSize < 0) {
> - return RETURN_INVALID_PARAMETER;
> + if (BufferSize < 0) {
> + return RETURN_INVALID_PARAMETER;
> }
>
> //
> @@ -2061,7 +2059,7 @@ Base64Decode (
> //
> for (Index = 0; Index < 4; Index++) {
> do {
> - Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
> + Chr = DecodingTable[(UINT8) Source[SourceIndex++]];
> } while (Chr == BAD_V);
> Value <<= 6;
> Value |= (UINT32)Chr;
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#43107): https://edk2.groups.io/g/devel/message/43107
Mute This Topic: https://groups.io/mt/32238988/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list