Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/setvbuf.c')
-rw-r--r--newlib/libc/stdio/setvbuf.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/newlib/libc/stdio/setvbuf.c b/newlib/libc/stdio/setvbuf.c
index f6871c59d..74a4ceaf2 100644
--- a/newlib/libc/stdio/setvbuf.c
+++ b/newlib/libc/stdio/setvbuf.c
@@ -96,17 +96,17 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
*/
int
-_DEFUN(setvbuf, (fp, buf, mode, size),
- register FILE * fp _AND
- char *buf _AND
- register int mode _AND
- register size_t size)
+_DEFUN (setvbuf, (fp, buf, mode, size),
+ register FILE * fp _AND
+ char *buf _AND
+ register int mode _AND
+ register size_t size)
{
int ret = 0;
- CHECK_INIT (_REENT);
+ _flockfile(fp);
- _flockfile (fp);
+ CHECK_INIT (fp);
/*
* Verify arguments. The `int' limit on `size' is due to this
@@ -115,7 +115,7 @@ _DEFUN(setvbuf, (fp, buf, mode, size),
if ((mode != _IOFBF && mode != _IOLBF && mode != _IONBF) || (int)(_POINTER_INT) size < 0)
{
- _funlockfile (fp);
+ _funlockfile(fp);
return (EOF);
}
@@ -126,11 +126,11 @@ _DEFUN(setvbuf, (fp, buf, mode, size),
* non buffer flags, and clear malloc flag.
*/
- _CAST_VOID fflush (fp);
+ (void) fflush (fp);
fp->_r = 0;
fp->_lbfsize = 0;
if (fp->_flags & __SMBF)
- _free_r (_REENT, (_PTR) fp->_bf._base);
+ _free_r (_REENT, (void *) fp->_bf._base);
fp->_flags &= ~(__SLBF | __SNBF | __SMBF);
if (mode == _IONBF)
@@ -158,7 +158,7 @@ nbf:
fp->_w = 0;
fp->_bf._base = fp->_p = fp->_nbuf;
fp->_bf._size = 1;
- _funlockfile (fp);
+ _funlockfile(fp);
return (ret);
}
fp->_flags |= __SMBF;
@@ -193,6 +193,6 @@ nbf:
if (fp->_flags & __SWR)
fp->_w = fp->_flags & (__SLBF | __SNBF) ? 0 : size;
- _funlockfile (fp);
+ _funlockfile(fp);
return 0;
}