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/stdio/funopen.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'newlib/libc/stdio/funopen.c') diff --git a/newlib/libc/stdio/funopen.c b/newlib/libc/stdio/funopen.c index 065ed93d7..e71d23187 100644 --- a/newlib/libc/stdio/funopen.c +++ b/newlib/libc/stdio/funopen.c @@ -85,8 +85,9 @@ Supporting OS subroutines required: <>. #include #include "local.h" -typedef int (*funread)(void *_cookie, char *_buf, int _n); -typedef int (*funwrite)(void *_cookie, const char *_buf, int _n); +typedef int (*funread)(void *_cookie, char *_buf, _READ_WRITE_BUFSIZE_TYPE _n); +typedef int (*funwrite)(void *_cookie, const char *_buf, + _READ_WRITE_BUFSIZE_TYPE _n); #ifdef __LARGE64_FILES typedef _fpos64_t (*funseek)(void *_cookie, _fpos64_t _off, int _whence); #else @@ -107,7 +108,7 @@ _DEFUN(funreader, (ptr, cookie, buf, n), struct _reent *ptr _AND void *cookie _AND char *buf _AND - int n) + _READ_WRITE_BUFSIZE_TYPE n) { int result; funcookie *c = (funcookie *) cookie; @@ -122,7 +123,7 @@ _DEFUN(funwriter, (ptr, cookie, buf, n), struct _reent *ptr _AND void *cookie _AND const char *buf _AND - int n) + _READ_WRITE_BUFSIZE_TYPE n) { int result; funcookie *c = (funcookie *) cookie; -- cgit v1.2.3