* include/stdio.h (_filbuf): Add prototype.

(_flsbuf): Add prototype.
	(getc): Add inline version.
	(putc): Likewise.
	(getchar): Likewise.
	(putchar): Likewise.
This commit is contained in:
Danny Smith 2003-10-17 21:43:31 +00:00
parent ce17145aa8
commit f25e45973d
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,12 @@
2003-10-17 Danny Smith <dannysmith@users.sourceforge.net>
* include/stdio.h (getc): Cast result to unsigned char before
return.
(putc): Likewise
(getchar): Likewise.
(putchar): Likewise.
Thanks to M.Fujii <boochang@m4.kcn.ne.jp>
2003-10-10 Earnie Boyd <earnie@users.sf.net> 2003-10-10 Earnie Boyd <earnie@users.sf.net>
* include/_mingw.h: Increment version to 3.2. * include/_mingw.h: Increment version to 3.2.

View File

@ -265,28 +265,28 @@ _CRTIMP int __cdecl _flsbuf (int, FILE*);
__CRT_INLINE int __cdecl getc (FILE* __F) __CRT_INLINE int __cdecl getc (FILE* __F)
{ {
return (--__F->_cnt >= 0) return (--__F->_cnt >= 0)
? (int) *__F->_ptr++ ? (int) (unsigned char) *__F->_ptr++
: _filbuf (__F); : _filbuf (__F);
} }
__CRT_INLINE int __cdecl putc (int __c, FILE* __F) __CRT_INLINE int __cdecl putc (int __c, FILE* __F)
{ {
return (--__F->_cnt >= 0) return (--__F->_cnt >= 0)
? (int)(*__F->_ptr++ = (char)__c) ? (int) (unsigned char) (*__F->_ptr++ = (char)__c)
: _flsbuf (__c, __F); : _flsbuf (__c, __F);
} }
__CRT_INLINE int __cdecl getchar (void) __CRT_INLINE int __cdecl getchar (void)
{ {
return (--stdin->_cnt >= 0) return (--stdin->_cnt >= 0)
? (int) *stdin->_ptr++ ? (int) (unsigned char) *stdin->_ptr++
: _filbuf (stdin); : _filbuf (stdin);
} }
__CRT_INLINE int __cdecl putchar(int __c) __CRT_INLINE int __cdecl putchar(int __c)
{ {
return (--stdout->_cnt >= 0) return (--stdout->_cnt >= 0)
? (int)(*stdout->_ptr++ = (char)__c) ? (int) (unsigned char) (*stdout->_ptr++ = (char)__c)
: _flsbuf (__c, stdout);} : _flsbuf (__c, stdout);}
#else /* Use library functions. */ #else /* Use library functions. */