Adjust the code style for better view.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@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++;
- }
- 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;
--
2.21.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#42969): https://edk2.groups.io/g/devel/message/42969
Mute This Topic: https://groups.io/mt/32238988/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
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@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Zhichao Gao <zhichao.gao@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/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
On 06/28/19 05:57, Gao, Zhichao wrote:
> Adjust the code style for better view.
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> ---
> MdePkg/Library/BaseLib/String.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
Sorry about sending individual emails about coding style problems. This code is quite rich in surprises. I'm not quoting any part of the patch because the line I'm about to highlight is not part of the context.
We have this line
if ((Chr != ' ') &&(Chr != '\t') &&(Chr != '\n') &&(Chr != '\r')) {
A space character is missing after each of the && operators.
Thanks
Laszlo
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#43109): https://edk2.groups.io/g/devel/message/43109
Mute This Topic: https://groups.io/mt/32238988/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
On 06/28/19 05:57, Gao, Zhichao wrote:
> Adjust the code style for better view.
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Zhichao Gao <zhichao.gao@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++;
> - }
> - 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;
>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#43023): https://edk2.groups.io/g/devel/message/43023
Mute This Topic: https://groups.io/mt/32238988/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.