aboutsummaryrefslogtreecommitdiff
path: root/src/console/vtxprintf.c
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2014-01-18 16:56:36 +0100
committerPatrick Georgi <patrick@georgi-clan.de>2014-02-19 20:57:58 +0100
commitd01ed75066fffe3fb73c98ece628f34120e6e029 (patch)
tree5c5def3b42b4f626a3993138592bbd02e61711ef /src/console/vtxprintf.c
parent327a86603c861ece294f1c9db5875a178bcbcc76 (diff)
printk: support and use %hh prefix
clang complains otherwise. Change-Id: I2ac98d7147ecd3d7064f17f8c9d214d44baedf97 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/4717 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/console/vtxprintf.c')
-rw-r--r--src/console/vtxprintf.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c
index c57f38c033..502d53e818 100644
--- a/src/console/vtxprintf.c
+++ b/src/console/vtxprintf.c
@@ -129,7 +129,7 @@ int vtxprintf(void (*tx_byte)(unsigned char byte), const char *fmt, va_list args
int field_width; /* width of output field */
int precision; /* min. # of digits for integers; max
number of chars for from string */
- int qualifier; /* 'h', 'l', or 'L' for integer fields */
+ int qualifier; /* 'h', 'H', 'l', or 'L' for integer fields */
int count;
@@ -194,6 +194,10 @@ repeat:
qualifier = 'L';
++fmt;
}
+ if (*fmt == 'h') {
+ qualifier = 'H';
+ ++fmt;
+ }
}
/* default base */
@@ -287,6 +291,10 @@ repeat:
num = (unsigned short) va_arg(args, int);
if (flags & SIGN)
num = (short) num;
+ } else if (qualifier == 'H') {
+ num = (unsigned char) va_arg(args, int);
+ if (flags & SIGN)
+ num = (signed char) num;
} else if (flags & SIGN) {
num = va_arg(args, int);
} else {