stdio: remove iffy putchar etc macros
authorAlan Cox <alan@linux.intel.com>
Tue, 21 Jul 2015 20:31:14 +0000 (21:31 +0100)
committerAlan Cox <alan@linux.intel.com>
Tue, 21 Jul 2015 20:31:14 +0000 (21:31 +0100)
These don't cover all cases safely and for a tiny box aren't really worth
the hit anyway.

Library/include/stdio.h

index 226c17a..6ac7938 100644 (file)
@@ -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));