diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2023-11-20 20:49:53 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2023-11-20 20:59:47 +0100 |
commit | 61e52c4d60c57f520cd19de310260395add5ce97 (patch) | |
tree | f143f59be8994f4911c1810d88b483936ecbe3d3 /newlib/libc | |
parent | c190063f9658153988d735a333a7a3c7aeadc001 (diff) | |
download | newlib-61e52c4d60c57f520cd19de310260395add5ce97.zip newlib-61e52c4d60c57f520cd19de310260395add5ce97.tar.gz newlib-61e52c4d60c57f520cd19de310260395add5ce97.tar.bz2 |
stdio: drop unnecessary calls to ORIENT
Now that the low-level functions set and test stream orientation,
a few calls in API functions are redundant.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/stdio/fputs.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/fputwc_u.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/fputws.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/fwrite.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/getc.c | 6 | ||||
-rw-r--r-- | newlib/libc/stdio/putc.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio/puts.c | 2 |
7 files changed, 0 insertions, 20 deletions
diff --git a/newlib/libc/stdio/fputs.c b/newlib/libc/stdio/fputs.c index a4f18df..7437949 100644 --- a/newlib/libc/stdio/fputs.c +++ b/newlib/libc/stdio/fputs.c @@ -115,8 +115,6 @@ _fputs_r (struct _reent * ptr, CHECK_INIT(ptr, fp); _newlib_flockfile_start (fp); - if (ORIENT (fp, -1) != -1) - goto error; /* Make sure we can write. */ if (cantwrite (ptr, fp)) goto error; diff --git a/newlib/libc/stdio/fputwc_u.c b/newlib/libc/stdio/fputwc_u.c index a5cc9a5..7e7403b 100644 --- a/newlib/libc/stdio/fputwc_u.c +++ b/newlib/libc/stdio/fputwc_u.c @@ -34,8 +34,6 @@ _fputwc_unlocked_r (struct _reent *ptr, wchar_t wc, FILE *fp) { - if (ORIENT(fp, 1) != 1) - return WEOF; return __fputwc(ptr, wc, fp); } diff --git a/newlib/libc/stdio/fputws.c b/newlib/libc/stdio/fputws.c index d696383..f9fe4a4 100644 --- a/newlib/libc/stdio/fputws.c +++ b/newlib/libc/stdio/fputws.c @@ -130,8 +130,6 @@ error: return (-1); #else _newlib_flockfile_start (fp); - if (ORIENT (fp, 1) != 1) - goto error; if (cantwrite (ptr, fp) != 0) goto error; diff --git a/newlib/libc/stdio/fwrite.c b/newlib/libc/stdio/fwrite.c index 2d97496..9241ea2 100644 --- a/newlib/libc/stdio/fwrite.c +++ b/newlib/libc/stdio/fwrite.c @@ -152,8 +152,6 @@ _fwrite_r (struct _reent * ptr, CHECK_INIT (ptr, fp); _newlib_flockfile_start (fp); - if (ORIENT (fp, -1) != -1) - goto ret; /* Make sure we can write. */ if (cantwrite (ptr, fp)) goto ret; diff --git a/newlib/libc/stdio/getc.c b/newlib/libc/stdio/getc.c index 12bffaf..c878132 100644 --- a/newlib/libc/stdio/getc.c +++ b/newlib/libc/stdio/getc.c @@ -81,9 +81,6 @@ _getc_r (struct _reent *ptr, { int result; CHECK_INIT (ptr, fp); - if (ORIENT (fp, -1) != -1) - return EOF; - _newlib_flockfile_start (fp); result = __sgetc_r (ptr, fp); _newlib_flockfile_end (fp); @@ -99,9 +96,6 @@ getc (register FILE *fp) struct _reent *reent = _REENT; CHECK_INIT (reent, fp); - if (ORIENT (fp, -1) != -1) - return EOF; - _newlib_flockfile_start (fp); result = __sgetc_r (reent, fp); _newlib_flockfile_end (fp); diff --git a/newlib/libc/stdio/putc.c b/newlib/libc/stdio/putc.c index 9253419..6a410e2 100644 --- a/newlib/libc/stdio/putc.c +++ b/newlib/libc/stdio/putc.c @@ -84,8 +84,6 @@ _putc_r (struct _reent *ptr, { int result; CHECK_INIT (ptr, fp); - if (ORIENT (fp, -1) != -1) - return EOF; _newlib_flockfile_start (fp); result = __sputc_r (ptr, c, fp); _newlib_flockfile_end (fp); @@ -102,8 +100,6 @@ putc (int c, struct _reent *reent = _REENT; CHECK_INIT (reent, fp); - if (ORIENT (fp, -1) != -1) - return EOF; _newlib_flockfile_start (fp); result = __sputc_r (reent, c, fp); _newlib_flockfile_end (fp); diff --git a/newlib/libc/stdio/puts.c b/newlib/libc/stdio/puts.c index 20d889b..d24022b 100644 --- a/newlib/libc/stdio/puts.c +++ b/newlib/libc/stdio/puts.c @@ -102,8 +102,6 @@ _puts_r (struct _reent *ptr, fp = _stdout_r (ptr); CHECK_INIT (ptr, fp); _newlib_flockfile_start (fp); - if (ORIENT (fp, -1) != -1) - goto err; /* Make sure we can write. */ if (cantwrite (ptr, fp)) goto err; |