From 0c3d8e5ab5f177ae080bf7afa2cbdc5ebcc9f401 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 23 Oct 2013 10:04:43 +0000 Subject: * libc/include/stdio.h (funopen): Change prototype of __readfn and __writefn parameter to match new definition of FILE's _read and _write methods. (_funopen_r): Ditto. (funopen): Ditto. (_funopen_r): Ditto. * libc/include/sys/config.h (_READ_WRITE_BUFSIZE_TYPE) Define as type int if not already defined. Add comment to explain. * libc/include/sys/reent.h: Include stddef.h. (struct __sFILE): Change type of last parameter in declaration of _read and _write methods to _READ_WRITE_BUFSIZE_TYPE. (struct __sFILE64): Ditto. * libc/stdio/local.h (__sread): Declare with last parameter set to _READ_WRITE_BUFSIZE_TYPE. (__seofread): Ditto. (__swrite): Ditto. (__swrite64): Ditto. * libc/stdio/fvwrite.c (__sfvwrite_r): Change type of local variables w and s to _READ_WRITE_RETURN_TYPE. * libc/stdio/fflush.c (__sflush_r): Change type of local variables n and t to _READ_WRITE_BUFSIZE_TYPE and _READ_WRITE_RETURN_TYPE. Add local variables flags to keep _flags value. * libc/stdio/fmemopen.c (fmemreader): Align to above change. (fmemwriter): Ditto. * libc/stdio/fopencookie.c (fcreader): Ditto. (fcwriter): Ditto. * libc/stdio/funopen.c (funread): Ditto. (funwrite): Ditto. (funreader): Ditto. (funwriter): Ditto. * libc/stdio/open_memstream.c (memwriter): Ditto. * libc/stdio/stdio.c (__sread): Ditto. (__seofread): Ditto. (__swrite): Ditto. * libc/stdio64/stdio64.c (__swrite64): Ditto. --- newlib/libc/include/stdio.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'newlib/libc/include/stdio.h') diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 504e671b0..20064d17e 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -516,24 +516,32 @@ int _EXFUN(__swbuf_r, (struct _reent *, int, FILE *)); #ifndef __STRICT_ANSI__ # ifdef __LARGE64_FILES FILE *_EXFUN(funopen,(const _PTR __cookie, - int (*__readfn)(_PTR __c, char *__buf, int __n), - int (*__writefn)(_PTR __c, const char *__buf, int __n), + int (*__readfn)(_PTR __c, char *__buf, + _READ_WRITE_BUFSIZE_TYPE __n), + int (*__writefn)(_PTR __c, const char *__buf, + _READ_WRITE_BUFSIZE_TYPE __n), _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), int (*__closefn)(_PTR __c))); FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, - int (*__readfn)(_PTR __c, char *__buf, int __n), - int (*__writefn)(_PTR __c, const char *__buf, int __n), + int (*__readfn)(_PTR __c, char *__buf, + _READ_WRITE_BUFSIZE_TYPE __n), + int (*__writefn)(_PTR __c, const char *__buf, + _READ_WRITE_BUFSIZE_TYPE __n), _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), int (*__closefn)(_PTR __c))); # else FILE *_EXFUN(funopen,(const _PTR __cookie, - int (*__readfn)(_PTR __cookie, char *__buf, int __n), - int (*__writefn)(_PTR __cookie, const char *__buf, int __n), + int (*__readfn)(_PTR __cookie, char *__buf, + _READ_WRITE_BUFSIZE_TYPE __n), + int (*__writefn)(_PTR __cookie, const char *__buf + _READ_WRITE_BUFSIZE_TYPE __n), fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), int (*__closefn)(_PTR __cookie))); FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, - int (*__readfn)(_PTR __cookie, char *__buf, int __n), - int (*__writefn)(_PTR __cookie, const char *__buf, int __n), + int (*__readfn)(_PTR __cookie, char *__buf, + _READ_WRITE_BUFSIZE_TYPE __n), + int (*__writefn)(_PTR __cookie, const char *__buf, + _READ_WRITE_BUFSIZE_TYPE __n), fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), int (*__closefn)(_PTR __cookie))); # endif /* !__LARGE64_FILES */ -- cgit v1.2.3