summaryrefslogtreecommitdiff
path: root/MdePkg/Library
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-03 21:51:12 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-03 21:51:12 +0000
commit1d580c14473896b5b593a7f60a21f532008265d0 (patch)
tree5c6a85fe35a2b63562c6c52d101cec5ede0fae0c /MdePkg/Library
parent3a0a3d38781cea5d2ee8f91f5fe927fff1faa5a3 (diff)
downloadedk2-platforms-1d580c14473896b5b593a7f60a21f532008265d0.tar.xz
1) Add support for %p to print pointers
2) Fix %d,%x,%X to pull values off the vararg stack using (int) and (unsigned int) types to resolve compatibility issues with X64 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@408 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/BasePrintLib/PrintLib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c
index f2c7ee5807..84dceb6e85 100644
--- a/MdePkg/Library/BasePrintLib/PrintLib.c
+++ b/MdePkg/Library/BasePrintLib/PrintLib.c
@@ -235,6 +235,10 @@ BasePrintLibVSPrint (
// Handle each argument type
//
switch (FormatCharacter) {
+ case 'p':
+ if (sizeof (VOID *) > 4) {
+ Flags |= LONG_TYPE;
+ }
case 'X':
Flags |= PREFIX_ZERO;
//
@@ -247,7 +251,7 @@ BasePrintLibVSPrint (
//
case 'd':
if ((Flags & LONG_TYPE) == 0) {
- Value = (VA_ARG (Marker, INTN));
+ Value = (VA_ARG (Marker, int));
} else {
Value = VA_ARG (Marker, INT64);
}
@@ -275,7 +279,7 @@ BasePrintLibVSPrint (
Radix = 16;
Comma = FALSE;
if ((Flags & LONG_TYPE) == 0 && Value < 0) {
- Value = (UINTN)Value;
+ Value = (unsigned int)Value;
}
}
//