From b893e6c496141ad1b9c9ac7424743d98fc89da5e Mon Sep 17 00:00:00 2001 From: tjr Date: Fri, 19 Mar 2004 09:04:56 +0000 Subject: Do not redundantly set the stream orientation in getc(), putc(), and related functions - __sgetc() and __sputc() will set it when necessary. --- lib/libc/stdio/fgetc.c | 3 ++- lib/libc/stdio/fputc.c | 3 ++- lib/libc/stdio/getc.c | 3 ++- lib/libc/stdio/getchar.c | 3 ++- lib/libc/stdio/putc.c | 3 ++- lib/libc/stdio/putchar.c | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/stdio/fgetc.c b/lib/libc/stdio/fgetc.c index 3469fda..455c2ac 100644 --- a/lib/libc/stdio/fgetc.c +++ b/lib/libc/stdio/fgetc.c @@ -52,7 +52,8 @@ fgetc(fp) { int retval; FLOCKFILE(fp); - ORIENT(fp, -1); + /* Orientation set by __sgetc() when buffer is empty. */ + /* ORIENT(fp, -1); */ retval = __sgetc(fp); FUNLOCKFILE(fp); return (retval); diff --git a/lib/libc/stdio/fputc.c b/lib/libc/stdio/fputc.c index 1cb0b72..97de1c0 100644 --- a/lib/libc/stdio/fputc.c +++ b/lib/libc/stdio/fputc.c @@ -53,7 +53,8 @@ fputc(c, fp) { int retval; FLOCKFILE(fp); - ORIENT(fp, -1); + /* Orientation set by __sputc() when buffer is full. */ + /* ORIENT(fp, -1); */ retval = __sputc(c, fp); FUNLOCKFILE(fp); return (retval); diff --git a/lib/libc/stdio/getc.c b/lib/libc/stdio/getc.c index 5732568..61b2c54 100644 --- a/lib/libc/stdio/getc.c +++ b/lib/libc/stdio/getc.c @@ -53,7 +53,8 @@ getc(FILE *fp) { int retval; FLOCKFILE(fp); - ORIENT(fp, -1); + /* Orientation set by __sgetc() when buffer is empty. */ + /* ORIENT(fp, -1); */ retval = __sgetc(fp); FUNLOCKFILE(fp); return (retval); diff --git a/lib/libc/stdio/getchar.c b/lib/libc/stdio/getchar.c index 47f46a2..baf5876 100644 --- a/lib/libc/stdio/getchar.c +++ b/lib/libc/stdio/getchar.c @@ -56,7 +56,8 @@ getchar() { int retval; FLOCKFILE(stdin); - ORIENT(stdin, -1); + /* Orientation set by __sgetc() when buffer is empty. */ + /* ORIENT(stdin, -1); */ retval = __sgetc(stdin); FUNLOCKFILE(stdin); return (retval); diff --git a/lib/libc/stdio/putc.c b/lib/libc/stdio/putc.c index b42f878..864df9f 100644 --- a/lib/libc/stdio/putc.c +++ b/lib/libc/stdio/putc.c @@ -55,7 +55,8 @@ putc(c, fp) { int retval; FLOCKFILE(fp); - ORIENT(fp, -1); + /* Orientation set by __sputc() when buffer is full. */ + /* ORIENT(fp, -1); */ retval = __sputc(c, fp); FUNLOCKFILE(fp); return (retval); diff --git a/lib/libc/stdio/putchar.c b/lib/libc/stdio/putchar.c index fe97d01..ead5565 100644 --- a/lib/libc/stdio/putchar.c +++ b/lib/libc/stdio/putchar.c @@ -59,7 +59,8 @@ putchar(c) FILE *so = stdout; FLOCKFILE(so); - ORIENT(so, -1); + /* Orientation set by __sputc() when buffer is full. */ + /* ORIENT(so, -1); */ retval = __sputc(c, so); FUNLOCKFILE(so); return (retval); -- cgit v1.1