diff --git a/commands/cat.c b/commands/cat.c index dd477c5..b126449 100644 --- a/commands/cat.c +++ b/commands/cat.c @@ -54,9 +54,9 @@ while((ret = read(fd, buf, 1024)) > 0) { for(i = 0; i < ret; i++) { if (isprint(buf[i]) || buf[i] == '\n' || buf[i] == '\t') - putc(buf[i]); + putchar(buf[i]); else - putc('.'); + putchar('.'); } if(ctrlc()) { err = 1; diff --git a/commands/mem.c b/commands/mem.c index 2acfbf5..74f205e 100644 --- a/commands/mem.c +++ b/commands/mem.c @@ -88,12 +88,12 @@ cp = (u_char *)linebuf; for (i=0; i 0x7e)) - putc ('.'); + putchar('.'); else printf("%c", *cp); cp++; } - putc ('\n'); + putchar('\n'); nbytes -= linebytes; if (ctrlc()) { return -EINTR; diff --git a/common/command.c b/common/command.c index 064ab71..45847eb 100644 --- a/common/command.c +++ b/common/command.c @@ -131,10 +131,10 @@ puts (cmdtp->help); } else { puts (cmdtp->name); - putc (' '); + putchar (' '); puts ("- No help available.\n"); } - putc ('\n'); + putchar ('\n'); #else /* no long help available */ if (cmdtp->usage) { puts (cmdtp->usage); @@ -473,7 +473,7 @@ if (i == 0) { if (argc > 1) /* allow tab for non command */ return 0; - putc('\a'); + putchar('\a'); return 1; } @@ -500,7 +500,7 @@ k = len + seplen; /* make sure it fits */ if (n + k >= CONFIG_CBSIZE - 2) { - putc('\a'); + putchar('\a'); return 1; } @@ -515,7 +515,7 @@ col += k; puts(t - k); if (sep == NULL) - putc('\a'); + putchar('\a'); *np = n; *colp = col; } else { diff --git a/common/console.c b/common/console.c index 47dcfe4..f359781 100644 --- a/common/console.c +++ b/common/console.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -211,7 +210,7 @@ } if (fd == 1) - putc(c); + putchar(c); else if (fd == 2) eputc(c); else @@ -259,7 +258,7 @@ fputs (file, printbuffer); } -void printf (const char *fmt, ...) +int printf (const char *fmt, ...) { va_list args; uint i; @@ -275,10 +274,12 @@ /* Print the string */ puts (printbuffer); + + return i; } -void vprintf (const char *fmt, va_list args) +int vprintf (const char *fmt, va_list args) { uint i; char printbuffer[CFG_PBSIZE]; @@ -290,6 +291,8 @@ /* Print the string */ puts (printbuffer); + + return i; } /* test if ctrl-c was pressed */ diff --git a/drivers/cfi_flash.c b/drivers/cfi_flash.c index 1bb6533..a2bcf80 100644 --- a/drivers/cfi_flash.c +++ b/drivers/cfi_flash.c @@ -385,7 +385,7 @@ (info, sect, info->erase_blk_tout, "erase")) { rcode = 1; } else - putc ('.'); + putchar('.'); return rcode; } @@ -407,7 +407,7 @@ goto out; } out: - putc('\n'); + putchar('\n'); return ret; } @@ -428,7 +428,7 @@ goto out; } out: - putc('\n'); + putchar('\n'); return ret; } @@ -529,7 +529,7 @@ info->protect[i] ? "RO" : " "); #endif } - putc ('\n'); + putchar('\n'); return; } diff --git a/include/stdio.h b/include/stdio.h index 05b4277..b2a843e 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -23,12 +23,12 @@ return console_puts(CONSOLE_STDOUT, s); } -static inline void putc(char c) { +static inline void putchar(char c) { console_putc(CONSOLE_STDOUT, c); } -void printf(const char *fmt, ...); -void vprintf(const char *fmt, va_list args); +int printf(const char *fmt, ...); +int vprintf(const char *fmt, va_list args); int sprintf(char * buf, const char *fmt, ...); int vsprintf(char *buf, const char *fmt, va_list args); diff --git a/lib/readline.c b/lib/readline.c index ab0a46a..c7aa287 100644 --- a/lib/readline.c +++ b/lib/readline.c @@ -21,7 +21,7 @@ #define DEL7 ((char)127) #define CREAD_HIST_CHAR ('!') -#define getcmd_putch(ch) putc(ch) +#define getcmd_putch(ch) putchar(ch) #define getcmd_getch() getc() #define getcmd_cbeep() getcmd_putch('\a') @@ -189,7 +189,7 @@ ichar = read_key(); if ((ichar == '\n') || (ichar == '\r')) { - putc('\n'); + putchar('\n'); break; } diff --git a/lib/vsprintf.c b/lib/vsprintf.c index c6fbfe3..aa6aa24 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -370,7 +370,7 @@ va_list args; va_start(args, fmt); vprintf(fmt, args); - putc('\n'); + putchar('\n'); va_end(args); #if defined (CONFIG_PANIC_HANG) hang(); diff --git a/net/bootp.c b/net/bootp.c index 84e6c91..419a40e 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -253,13 +253,13 @@ if (NetOurSubnetMask) { puts ("NetOurSubnetMask : "); print_IPaddr (NetOurSubnetMask); - putc ('\n'); + putchar('\n'); } if (NetOurGatewayIP) { puts ("NetOurGatewayIP : "); print_IPaddr (NetOurGatewayIP); - putc ('\n'); + putchar('\n'); } if (NetBootFileSize) { @@ -827,7 +827,7 @@ dhcp_state = BOUND; puts ("DHCP client bound to address "); print_IPaddr(NetOurIP); - putc ('\n'); + putchar('\n'); NetState = NETLOOP_SUCCESS; return; diff --git a/net/net.c b/net/net.c index 3e75e9d..331269d 100644 --- a/net/net.c +++ b/net/net.c @@ -1267,7 +1267,7 @@ return; puts (" ICMP Host Redirect to "); print_IPaddr(icmph->un.gateway); - putc(' '); + putchar(' '); return; #ifdef CONFIG_NET_PING case ICMP_ECHO_REPLY: diff --git a/net/tftp.c b/net/tftp.c index c761c21..e690c39 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -210,7 +210,7 @@ printf ("\n\t %lu MB received\n\t ", TftpBlockWrapOffset>>20); } else { if (((TftpBlock - 1) % 10) == 0) { - putc ('#'); + putchar('#'); } else if ((TftpBlock % (10 * HASHES_PER_LINE)) == 0) { puts ("\n\t "); } @@ -330,7 +330,7 @@ print_IPaddr (NetOurGatewayIP) ; } } - putc ('\n'); + putchar('\n'); printf ("Filename '%s'.", tftp_filename); @@ -339,7 +339,7 @@ print_size (NetBootFileSize<<9, ""); } - putc ('\n'); + putchar('\n'); puts ("Loading: *\b");