public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2] BaseTools: Add missing spaces for PCD expression values in AutoGenC
@ 2022-08-30 10:20 Konstantin Aladyshev
  2022-09-21  1:01 ` 回复: [edk2-devel] " gaoliming
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Aladyshev @ 2022-08-30 10:20 UTC (permalink / raw)
  To: devel; +Cc: bob.c.feng, gaoliming, yuwei.chen, Konstantin Aladyshev

Currently the PCD values calculated from the expressions have different
formating from the simple byte arrays in AutoGenC.

Example:
The following definition in DEC:
gTokenSpaceGuid.PcdArray|{0x44, 0x33, 0x22, 0x11}|VOID*|0x55555555
gTokenSpaceGuid.PcdArrayByExpression|{UINT32(0x11223344)}|VOID*|0x66666666

Produces these strings in AutoGenC:
<...> _gPcd_<...>_PcdArray[4] = {0x44, 0x33, 0x22, 0x11};
<...> _gPcd_<...>_PcdArrayByExpression[4] = {0x44,0x33,0x22,0x11};

Add missing space character between the array elements to unify PCD value
formatting.

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
---
 BaseTools/Source/Python/Common/Expression.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Common/Expression.py b/BaseTools/Source/Python/Common/Expression.py
index 31bf0e4b6c..b62efe6f9b 100644
--- a/BaseTools/Source/Python/Common/Expression.py
+++ b/BaseTools/Source/Python/Common/Expression.py
@@ -1026,7 +1026,7 @@ class ValueExpressionEx(ValueExpression):
                                     Size += ItemSize
 
                             if Size > 0:
-                                PcdValue = '{' + ','.join(AllPcdValueList) + '}'
+                                PcdValue = '{' + ', '.join(AllPcdValueList) + '}'
                         else:
                             raise  BadExpression("Type: %s, Value: %s, %s"%(self.PcdType, PcdValue, Value))
 
-- 
2.25.1


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

* 回复: [edk2-devel] [PATCH v2] BaseTools: Add missing spaces for PCD expression values in AutoGenC
  2022-08-30 10:20 [PATCH v2] BaseTools: Add missing spaces for PCD expression values in AutoGenC Konstantin Aladyshev
@ 2022-09-21  1:01 ` gaoliming
  2022-10-01 14:38   ` Bob Feng
  0 siblings, 1 reply; 3+ messages in thread
From: gaoliming @ 2022-09-21  1:01 UTC (permalink / raw)
  To: devel, aladyshev22; +Cc: bob.c.feng, yuwei.chen

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Konstantin
> Aladyshev
> 发送时间: 2022年8月30日 18:20
> 收件人: devel@edk2.groups.io
> 抄送: bob.c.feng@intel.com; gaoliming@byosoft.com.cn;
> yuwei.chen@intel.com; Konstantin Aladyshev <aladyshev22@gmail.com>
> 主题: [edk2-devel] [PATCH v2] BaseTools: Add missing spaces for PCD
> expression values in AutoGenC
> 
> Currently the PCD values calculated from the expressions have different
> formating from the simple byte arrays in AutoGenC.
> 
> Example:
> The following definition in DEC:
> gTokenSpaceGuid.PcdArray|{0x44, 0x33, 0x22, 0x11}|VOID*|0x55555555
> gTokenSpaceGuid.PcdArrayByExpression|{UINT32(0x11223344)}|VOID*|0x6
> 6666666
> 
> Produces these strings in AutoGenC:
> <...> _gPcd_<...>_PcdArray[4] = {0x44, 0x33, 0x22, 0x11};
> <...> _gPcd_<...>_PcdArrayByExpression[4] = {0x44,0x33,0x22,0x11};
> 
> Add missing space character between the array elements to unify PCD value
> formatting.
> 
> Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
> ---
>  BaseTools/Source/Python/Common/Expression.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Expression.py
> b/BaseTools/Source/Python/Common/Expression.py
> index 31bf0e4b6c..b62efe6f9b 100644
> --- a/BaseTools/Source/Python/Common/Expression.py
> +++ b/BaseTools/Source/Python/Common/Expression.py
> @@ -1026,7 +1026,7 @@ class ValueExpressionEx(ValueExpression):
>                                      Size += ItemSize
> 
> 
> 
>                              if Size > 0:
> 
> -                                PcdValue = '{' +
> ','.join(AllPcdValueList) + '}'
> 
> +                                PcdValue = '{' + ',
> '.join(AllPcdValueList) + '}'
> 
>                          else:
> 
>                              raise  BadExpression("Type: %s,
> Value: %s, %s"%(self.PcdType, PcdValue, Value))
> 
> 
> 
> --
> 2.25.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#92977): https://edk2.groups.io/g/devel/message/92977
> Mute This Topic: https://groups.io/mt/93345721/4905953
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaoliming@byosoft.com.cn]
> -=-=-=-=-=-=
> 




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

* Re: [edk2-devel] [PATCH v2] BaseTools: Add missing spaces for PCD expression values in AutoGenC
  2022-09-21  1:01 ` 回复: [edk2-devel] " gaoliming
@ 2022-10-01 14:38   ` Bob Feng
  0 siblings, 0 replies; 3+ messages in thread
From: Bob Feng @ 2022-10-01 14:38 UTC (permalink / raw)
  To: devel@edk2.groups.io, Gao, Liming, aladyshev22@gmail.com; +Cc: Chen, Christine

Reviewed-by: Bob Feng <bob.c.feng@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of gaoliming via groups.io
Sent: Wednesday, September 21, 2022 9:02 AM
To: devel@edk2.groups.io; aladyshev22@gmail.com
Cc: Feng, Bob C <bob.c.feng@intel.com>; Chen, Christine <yuwei.chen@intel.com>
Subject: 回复: [edk2-devel] [PATCH v2] BaseTools: Add missing spaces for PCD expression values in AutoGenC

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Konstantin 
> Aladyshev
> 发送时间: 2022年8月30日 18:20
> 收件人: devel@edk2.groups.io
> 抄送: bob.c.feng@intel.com; gaoliming@byosoft.com.cn; 
> yuwei.chen@intel.com; Konstantin Aladyshev <aladyshev22@gmail.com>
> 主题: [edk2-devel] [PATCH v2] BaseTools: Add missing spaces for PCD 
> expression values in AutoGenC
> 
> Currently the PCD values calculated from the expressions have 
> different formating from the simple byte arrays in AutoGenC.
> 
> Example:
> The following definition in DEC:
> gTokenSpaceGuid.PcdArray|{0x44, 0x33, 0x22, 0x11}|VOID*|0x55555555
> gTokenSpaceGuid.PcdArrayByExpression|{UINT32(0x11223344)}|VOID*|0x6
> 6666666
> 
> Produces these strings in AutoGenC:
> <...> _gPcd_<...>_PcdArray[4] = {0x44, 0x33, 0x22, 0x11}; <...> 
> _gPcd_<...>_PcdArrayByExpression[4] = {0x44,0x33,0x22,0x11};
> 
> Add missing space character between the array elements to unify PCD 
> value formatting.
> 
> Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
> ---
>  BaseTools/Source/Python/Common/Expression.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/BaseTools/Source/Python/Common/Expression.py
> b/BaseTools/Source/Python/Common/Expression.py
> index 31bf0e4b6c..b62efe6f9b 100644
> --- a/BaseTools/Source/Python/Common/Expression.py
> +++ b/BaseTools/Source/Python/Common/Expression.py
> @@ -1026,7 +1026,7 @@ class ValueExpressionEx(ValueExpression):
>                                      Size += ItemSize
> 
> 
> 
>                              if Size > 0:
> 
> -                                PcdValue = '{' +
> ','.join(AllPcdValueList) + '}'
> 
> +                                PcdValue = '{' + ',
> '.join(AllPcdValueList) + '}'
> 
>                          else:
> 
>                              raise  BadExpression("Type: %s,
> Value: %s, %s"%(self.PcdType, PcdValue, Value))
> 
> 
> 
> --
> 2.25.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#92977): 
> https://edk2.groups.io/g/devel/message/92977
> Mute This Topic: https://groups.io/mt/93345721/4905953
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [gaoliming@byosoft.com.cn]
> -=-=-=-=-=-=
> 









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

end of thread, other threads:[~2022-10-01 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-30 10:20 [PATCH v2] BaseTools: Add missing spaces for PCD expression values in AutoGenC Konstantin Aladyshev
2022-09-21  1:01 ` 回复: [edk2-devel] " gaoliming
2022-10-01 14:38   ` Bob Feng

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