Message ID | 20190430165234.32272-6-alex.bennee@linaro.org |
---|---|
State | New |
Headers | show |
Series | demacro softmmu (plus tests/coverage) | expand |
On 4/30/19 9:52 AM, Alex Bennée wrote: > @@ -119,6 +119,10 @@ void ml_printf(const char *fmt, ...) > str = va_arg(ap, char*); > print_str(str); > break; > + case 'c': > + c = (char) va_arg(ap, int); > + __sys_outc(c); > + break; The assignment and cast are both unnecessary. You could just as well write __sys_outc(va_arg(ap, int)) but it's not wrong so Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
diff --git a/tests/tcg/minilib/printf.c b/tests/tcg/minilib/printf.c index 121620cb16..d530b32be5 100644 --- a/tests/tcg/minilib/printf.c +++ b/tests/tcg/minilib/printf.c @@ -47,7 +47,7 @@ static void print_num(unsigned long long value, int base) void ml_printf(const char *fmt, ...) { va_list ap; - char *str; + char *str, c; int base; int has_long; int alt_form; @@ -119,6 +119,10 @@ void ml_printf(const char *fmt, ...) str = va_arg(ap, char*); print_str(str); break; + case 'c': + c = (char) va_arg(ap, int); + __sys_outc(c); + break; case '%': __sys_outc(*fmt); break;
Signed-off-by: Alex Bennée <alex.bennee@linaro.org> --- tests/tcg/minilib/printf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.20.1