* libc/include/stdio.h (__SMOD): Remove definition of unused flag.
* libc/include/sys/reent.h (struct __sFILE): Add _flags2 member. * libc/stdio/findfp.c (std): Initialize _flags2. (__sfp): Ditto. * libc/stdio/refill.c (__srefill_r): Drop resetting __SMOD flag. * libc/stdio/vfscanf.c (__ssrefill_r): Ditto. * libc/stdio/fseek.c (_fseek_r): Drop checking __SMOD flag. * libc/stdio64/fseeko64.c (_fseeko64_r): Ditto.
This commit is contained in:
parent
d6f6f50285
commit
14773e10a0
@ -1,3 +1,14 @@
|
|||||||
|
2008-11-24 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* libc/include/stdio.h (__SMOD): Remove definition of unused flag.
|
||||||
|
* libc/include/sys/reent.h (struct __sFILE): Add _flags2 member.
|
||||||
|
* libc/stdio/findfp.c (std): Initialize _flags2.
|
||||||
|
(__sfp): Ditto.
|
||||||
|
* libc/stdio/refill.c (__srefill_r): Drop resetting __SMOD flag.
|
||||||
|
* libc/stdio/vfscanf.c (__ssrefill_r): Ditto.
|
||||||
|
* libc/stdio/fseek.c (_fseek_r): Drop checking __SMOD flag.
|
||||||
|
* libc/stdio64/fseeko64.c (_fseeko64_r): Ditto.
|
||||||
|
|
||||||
2008-11-20 Ken Werner <ken.werner@de.ibm.com>
|
2008-11-20 Ken Werner <ken.werner@de.ibm.com>
|
||||||
|
|
||||||
* libc/machine/spu/sys/linux_syscalls.h: Additional syscall defines to
|
* libc/machine/spu/sys/linux_syscalls.h: Additional syscall defines to
|
||||||
|
@ -78,7 +78,6 @@ typedef _fpos64_t fpos64_t;
|
|||||||
#define __SOPT 0x0400 /* do fseek() optimisation */
|
#define __SOPT 0x0400 /* do fseek() optimisation */
|
||||||
#define __SNPT 0x0800 /* do not do fseek() optimisation */
|
#define __SNPT 0x0800 /* do not do fseek() optimisation */
|
||||||
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
|
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
|
||||||
#define __SMOD 0x2000 /* true => fgetline modified _p text */
|
|
||||||
#if defined(__CYGWIN__)
|
#if defined(__CYGWIN__)
|
||||||
# define __SCLE 0x4000 /* convert line endings CR/LF <-> NL */
|
# define __SCLE 0x4000 /* convert line endings CR/LF <-> NL */
|
||||||
#endif
|
#endif
|
||||||
|
@ -212,6 +212,7 @@ struct __sFILE {
|
|||||||
#ifndef __SINGLE_THREAD__
|
#ifndef __SINGLE_THREAD__
|
||||||
_flock_t _lock; /* for thread-safety locking */
|
_flock_t _lock; /* for thread-safety locking */
|
||||||
#endif
|
#endif
|
||||||
|
int _flags2; /* for future use */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef __CUSTOM_FILE_IO__
|
#ifdef __CUSTOM_FILE_IO__
|
||||||
|
@ -46,6 +46,7 @@ _DEFUN(std, (ptr, flags, file, data),
|
|||||||
ptr->_r = 0;
|
ptr->_r = 0;
|
||||||
ptr->_w = 0;
|
ptr->_w = 0;
|
||||||
ptr->_flags = flags;
|
ptr->_flags = flags;
|
||||||
|
ptr->_flags2 = 0;
|
||||||
ptr->_file = file;
|
ptr->_file = file;
|
||||||
ptr->_bf._base = 0;
|
ptr->_bf._base = 0;
|
||||||
ptr->_bf._size = 0;
|
ptr->_bf._size = 0;
|
||||||
@ -126,6 +127,7 @@ _DEFUN(__sfp, (d),
|
|||||||
found:
|
found:
|
||||||
fp->_file = -1; /* no file */
|
fp->_file = -1; /* no file */
|
||||||
fp->_flags = 1; /* reserve this slot; caller sets real flags */
|
fp->_flags = 1; /* reserve this slot; caller sets real flags */
|
||||||
|
fp->_flags2 = 0;
|
||||||
#ifndef __SINGLE_THREAD__
|
#ifndef __SINGLE_THREAD__
|
||||||
__lock_init_recursive (fp->_lock);
|
__lock_init_recursive (fp->_lock);
|
||||||
#endif
|
#endif
|
||||||
|
@ -304,12 +304,10 @@ _DEFUN(_fseek_r, (ptr, fp, offset, whence),
|
|||||||
/*
|
/*
|
||||||
* If the target offset is within the current buffer,
|
* If the target offset is within the current buffer,
|
||||||
* simply adjust the pointers, clear EOF, undo ungetc(),
|
* simply adjust the pointers, clear EOF, undo ungetc(),
|
||||||
* and return. (If the buffer was modified, we have to
|
* and return.
|
||||||
* skip this; see fgetline.c.)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((fp->_flags & __SMOD) == 0 &&
|
if (target >= curoff && target < curoff + n)
|
||||||
target >= curoff && target < curoff + n)
|
|
||||||
{
|
{
|
||||||
register int o = target - curoff;
|
register int o = target - curoff;
|
||||||
|
|
||||||
|
@ -105,7 +105,6 @@ _DEFUN(__srefill_r, (ptr, fp),
|
|||||||
_CAST_VOID _fwalk (_GLOBAL_REENT, lflush);
|
_CAST_VOID _fwalk (_GLOBAL_REENT, lflush);
|
||||||
fp->_p = fp->_bf._base;
|
fp->_p = fp->_bf._base;
|
||||||
fp->_r = fp->_read (ptr, fp->_cookie, (char *) fp->_p, fp->_bf._size);
|
fp->_r = fp->_read (ptr, fp->_cookie, (char *) fp->_p, fp->_bf._size);
|
||||||
fp->_flags &= ~__SMOD; /* buffer contents are again pristine */
|
|
||||||
#ifndef __CYGWIN__
|
#ifndef __CYGWIN__
|
||||||
if (fp->_r <= 0)
|
if (fp->_r <= 0)
|
||||||
#else
|
#else
|
||||||
|
@ -379,7 +379,6 @@ _DEFUN(__ssrefill_r, (ptr, fp),
|
|||||||
/* Otherwise we are out of character input. */
|
/* Otherwise we are out of character input. */
|
||||||
fp->_p = fp->_bf._base;
|
fp->_p = fp->_bf._base;
|
||||||
fp->_r = 0;
|
fp->_r = 0;
|
||||||
fp->_flags &= ~__SMOD; /* buffer contents are again pristine */
|
|
||||||
fp->_flags |= __SEOF;
|
fp->_flags |= __SEOF;
|
||||||
return EOF;
|
return EOF;
|
||||||
}
|
}
|
||||||
|
@ -282,12 +282,10 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence),
|
|||||||
/*
|
/*
|
||||||
* If the target offset is within the current buffer,
|
* If the target offset is within the current buffer,
|
||||||
* simply adjust the pointers, clear EOF, undo ungetc(),
|
* simply adjust the pointers, clear EOF, undo ungetc(),
|
||||||
* and return. (If the buffer was modified, we have to
|
* and return.
|
||||||
* skip this; see fgetline.c.)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((fp->_flags & __SMOD) == 0 &&
|
if (target >= curoff && target < curoff + n)
|
||||||
target >= curoff && target < curoff + n)
|
|
||||||
{
|
{
|
||||||
register int o = target - curoff;
|
register int o = target - curoff;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user