diff options
author | Liming Gao <liming.gao@intel.com> | 2018-01-02 20:41:43 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-01-03 14:19:45 +0800 |
commit | beacbc7492393992a8d10cd0a450c308a482f315 (patch) | |
tree | e49d77fd8feff63a793c327e4a6f89a098c5de03 /BaseTools/Source/C | |
parent | 0ba795d21ad0df72ee3a12667d30ed7c64125b9c (diff) | |
download | edk2-beacbc7492393992a8d10cd0a450c308a482f315.tar.gz edk2-beacbc7492393992a8d10cd0a450c308a482f315.tar.bz2 edk2-beacbc7492393992a8d10cd0a450c308a482f315.zip |
BaseTools CommonLib: Fix printf %llx issue on UINT64
UINT64 is defined as the different type for the different ARCHs. To
let it work for all archs and compilers, add (unsigned long long) for
the input value together with %llx.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/C')
-rw-r--r-- | BaseTools/Source/C/Common/PcdValueCommon.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/BaseTools/Source/C/Common/PcdValueCommon.c b/BaseTools/Source/C/Common/PcdValueCommon.c index 6ca0994744..42f76ddbbc 100644 --- a/BaseTools/Source/C/Common/PcdValueCommon.c +++ b/BaseTools/Source/C/Common/PcdValueCommon.c @@ -266,11 +266,7 @@ Returns: sprintf(PcdList[Index].Value, "0x%08x", (UINT32)(Value & 0xffffffff));
break;
case PcdDataTypeUint64:
-#ifdef __GNUC__
- sprintf(PcdList[Index].Value, "0x%016lx", Value);
-#else
- sprintf(PcdList[Index].Value, "0x%016llx", Value);
-#endif
+ sprintf(PcdList[Index].Value, "0x%016llx", (unsigned long long)Value);
break;
case PcdDataTypePointer:
fprintf (stderr, "PCD %s.%s.%s.%s is structure. Use PcdSetPtr()\n", SkuName, DefaultValueName, TokenSpaceGuidName, TokenName);
|