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>
This commit is contained in:
parent
c190063f96
commit
61e52c4d60
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue