diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-07 10:55:16 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-12-07 10:55:19 +0100 |
commit | ab6dc1d2970b5835409091a60ddcf8e6cabefc25 (patch) | |
tree | e544efde564e41e29f8e64684f4c49bd6f78a737 /common | |
parent | c0213869a272fe8e001321940fbd317dce0e588c (diff) | |
download | barebox-ab6dc1d2970b5835409091a60ddcf8e6cabefc25.tar.gz barebox-ab6dc1d2970b5835409091a60ddcf8e6cabefc25.tar.xz |
console_simple: Fix compilation
Since fprintf and console_puts now return the number of
character written the prototypes have changes. We forgot
to fix console_simple which now fails to compile with:
common/console_simple.c:48:6: error: conflicting types for 'fprintf'
include/stdio.h:57:5: note: previous declaration of 'fprintf' was here
common/console_simple.c:67:6: error: conflicting types for 'console_puts'
include/stdio.h:20:5: note: previous declaration of 'console_puts' was here
Fix this by returning the proper numbers of characters written.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/console_simple.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/common/console_simple.c b/common/console_simple.c index 7304d8ee05..61a233d1b5 100644 --- a/common/console_simple.c +++ b/common/console_simple.c @@ -45,7 +45,7 @@ int vprintf (const char *fmt, va_list args) } EXPORT_SYMBOL(vprintf); -void fprintf (int file, const char *fmt, ...) +int fprintf(int file, const char *fmt, ...) { va_list args; uint i; @@ -61,18 +61,25 @@ void fprintf (int file, const char *fmt, ...) /* Print the string */ fputs(file, printbuffer); + + return i; } EXPORT_SYMBOL(fprintf); -void console_puts(unsigned int ch, const char *str) +int console_puts(unsigned int ch, const char *str) { const char *s = str; + int i = 0; + while (*s) { console_putc(ch, *s); if (*s == '\n') console_putc(ch, '\r'); s++; + i++; } + + return i; } EXPORT_SYMBOL(console_puts); |