diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2003-10-18 01:43:31 +0400 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2003-10-18 01:43:31 +0400 |
commit | f25e45973d5fa161504185626517dfa8abc1a99b (patch) | |
tree | 77047d5d24dde8a9e4121786ca744410e12b91c0 /winsup/mingw | |
parent | ce17145aa85631fac876402b0b392c3326b93afb (diff) |
* include/stdio.h (_filbuf): Add prototype.
(_flsbuf): Add prototype.
(getc): Add inline version.
(putc): Likewise.
(getchar): Likewise.
(putchar): Likewise.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 9 | ||||
-rw-r--r-- | winsup/mingw/include/stdio.h | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index 2aa669d36..4d2317936 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -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> * include/_mingw.h: Increment version to 3.2. diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h index d923e24c9..8b7b0dd82 100644 --- a/winsup/mingw/include/stdio.h +++ b/winsup/mingw/include/stdio.h @@ -265,28 +265,28 @@ _CRTIMP int __cdecl _flsbuf (int, FILE*); __CRT_INLINE int __cdecl getc (FILE* __F) { return (--__F->_cnt >= 0) - ? (int) *__F->_ptr++ + ? (int) (unsigned char) *__F->_ptr++ : _filbuf (__F); } __CRT_INLINE int __cdecl putc (int __c, FILE* __F) { return (--__F->_cnt >= 0) - ? (int)(*__F->_ptr++ = (char)__c) + ? (int) (unsigned char) (*__F->_ptr++ = (char)__c) : _flsbuf (__c, __F); } __CRT_INLINE int __cdecl getchar (void) { return (--stdin->_cnt >= 0) - ? (int) *stdin->_ptr++ + ? (int) (unsigned char) *stdin->_ptr++ : _filbuf (stdin); } __CRT_INLINE int __cdecl putchar(int __c) { return (--stdout->_cnt >= 0) - ? (int)(*stdout->_ptr++ = (char)__c) + ? (int) (unsigned char) (*stdout->_ptr++ = (char)__c) : _flsbuf (__c, stdout);} #else /* Use library functions. */ |