From a741dbfc4674516bb505e63beb0d1a7fd7ce7e1b Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 21 Jul 2015 21:31:14 +0100 Subject: [PATCH] stdio: remove iffy putchar etc macros These don't cover all cases safely and for a tiny box aren't really worth the hit anyway. --- Library/include/stdio.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Library/include/stdio.h b/Library/include/stdio.h index 226c17a8..6ac79386 100644 --- a/Library/include/stdio.h +++ b/Library/include/stdio.h @@ -64,18 +64,11 @@ extern FILE stdin[1]; extern FILE stdout[1]; extern FILE stderr[1]; -/* FIXME: are these really worth the cost ?? */ -#define putc(c, stream) \ - (((stream)->bufpos >= (stream)->bufwrite) ? \ - fputc((c), (stream)) : \ - (uchar) (*(stream)->bufpos++ = (c))) -#define getc(stream) \ - (((stream)->bufpos >= (stream)->bufread) ? \ - fgetc(stream) : \ - (*(stream)->bufpos++)) - -#define putchar(c) putc((c), stdout) -#define getchar() getc(stdin) +#define putc(c, stream) fputc((c), stream) +#define getc(stream) fgetc(stream) + +#define putchar(c) fputc((c), stdout) +#define getchar() fgetc(stdin) extern char *gets __P((char *)); extern char *gets_s __P((char *, size_t)); -- 2.34.1