]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Add missing spaces for PCD expression values in AutoGenC
authorKonstantin Aladyshev <aladyshev22@gmail.com>
Tue, 30 Aug 2022 10:20:27 +0000 (18:20 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 19 Oct 2022 06:32:07 +0000 (06:32 +0000)
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>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/Common/Expression.py

index 31bf0e4b6cf7c2a1c2e2a699e56ca207f2fa86d6..b62efe6f9be681427f33d95d6503ed3c592e62c0 100644 (file)
@@ -1026,7 +1026,7 @@ class ValueExpressionEx(ValueExpression):
                                     Size += ItemSize\r
 \r
                             if Size > 0:\r
-                                PcdValue = '{' + ','.join(AllPcdValueList) + '}'\r
+                                PcdValue = '{' + ', '.join(AllPcdValueList) + '}'\r
                         else:\r
                             raise  BadExpression("Type: %s, Value: %s, %s"%(self.PcdType, PcdValue, Value))\r
 \r