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>
This commit is contained in:
Liming Gao 2018-01-02 20:41:43 +08:00
parent 0ba795d21a
commit beacbc7492
1 changed files with 1 additions and 5 deletions

View File

@ -266,11 +266,7 @@ Returns:
sprintf(PcdList[Index].Value, "0x%08x", (UINT32)(Value & 0xffffffff)); sprintf(PcdList[Index].Value, "0x%08x", (UINT32)(Value & 0xffffffff));
break; break;
case PcdDataTypeUint64: case PcdDataTypeUint64:
#ifdef __GNUC__ sprintf(PcdList[Index].Value, "0x%016llx", (unsigned long long)Value);
sprintf(PcdList[Index].Value, "0x%016lx", Value);
#else
sprintf(PcdList[Index].Value, "0x%016llx", Value);
#endif
break; break;
case PcdDataTypePointer: case PcdDataTypePointer:
fprintf (stderr, "PCD %s.%s.%s.%s is structure. Use PcdSetPtr()\n", SkuName, DefaultValueName, TokenSpaceGuidName, TokenName); fprintf (stderr, "PCD %s.%s.%s.%s is structure. Use PcdSetPtr()\n", SkuName, DefaultValueName, TokenSpaceGuidName, TokenName);