From 1cf9cdcc9c0728131c778e05fbb720f7e4356111 Mon Sep 17 00:00:00 2001 From: klu2 Date: Mon, 19 Jun 2006 03:53:41 +0000 Subject: [PATCH] Fix a bug of PCD autogen for UINT64: when generate macro value for a UINT64 type PCD, "ULL" should be added to forbid compiler tread it as UINT32 value. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@555 6f19259b-4bc3-4df7-8a09-765794883524 --- .../tianocore/build/pcd/entity/UsageInstance.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java index 9005a9808d..1a843968df 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java +++ b/Tools/Source/GenBuild/org/tianocore/build/pcd/entity/UsageInstance.java @@ -204,6 +204,7 @@ public class UsageInstance { String guidStringArray[] = null; String guidString = null; boolean isByteArray = false; + String printDatum = null; hAutogenStr = ""; cAutogenStr = ""; @@ -224,6 +225,12 @@ public class UsageInstance { } } + if (parentToken.datumType == Token.DATUM_TYPE.UINT64) { + printDatum = this.datum + "ULL"; + } else { + printDatum = this.datum; + } + switch (modulePcdType) { case FEATURE_FLAG: if (isBuildUsedLibrary) { @@ -236,7 +243,7 @@ public class UsageInstance { } else { hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n", parentToken.cName, - datum.toString()); + printDatum); hAutogenStr += String.format("extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n", parentToken.cName); cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const BOOLEAN _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n", @@ -260,7 +267,7 @@ public class UsageInstance { } else { hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n", parentToken.cName, - datum.toString()); + printDatum); if (isByteArray) { cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_%s[] = _PCD_VALUE_%s;\r\n", parentToken.cName, @@ -298,7 +305,7 @@ public class UsageInstance { } else { hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n", parentToken.cName, - datum.toString()); + printDatum); if (isByteArray) { cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED UINT8 _gPcd_BinaryPatch_%s[] = _PCD_VALUE_%s;\r\n", parentToken.cName,