diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2017-12-04 05:53:22 +0300 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2018-01-17 20:47:16 +0300 |
commit | e6321aa6a668376c40bc2792a3bd392e94c29ad6 (patch) | |
tree | fe4028a6278a7d3f49ff79f0e5150b49f225685f /newlib/libc/stdio | |
parent | 0403b9c8c40a351ba72f587add10669df225680b (diff) |
ansification: remove _PTR
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r-- | newlib/libc/stdio/fdopen.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/fgets.c | 6 | ||||
-rw-r--r-- | newlib/libc/stdio/fopen.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/fread.c | 10 | ||||
-rw-r--r-- | newlib/libc/stdio/freopen.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/fseeko.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/fvwrite.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio/fvwrite.h | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/fwrite.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio/makebuf.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/nano-vfprintf.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio/nano-vfprintf_local.h | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/nano-vfscanf.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/setvbuf.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/stdio.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio/ungetc.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio/vfprintf.c | 12 | ||||
-rw-r--r-- | newlib/libc/stdio/vfscanf.c | 8 | ||||
-rw-r--r-- | newlib/libc/stdio/vfwprintf.c | 6 | ||||
-rw-r--r-- | newlib/libc/stdio/vfwscanf.c | 6 |
20 files changed, 42 insertions, 42 deletions
diff --git a/newlib/libc/stdio/fdopen.c b/newlib/libc/stdio/fdopen.c index 82b7a9bc2..876a94117 100644 --- a/newlib/libc/stdio/fdopen.c +++ b/newlib/libc/stdio/fdopen.c @@ -94,7 +94,7 @@ _DEFUN(_fdopen_r, (ptr, fd, mode), _fcntl_r (ptr, fd, F_SETFL, fdflags | O_APPEND); #endif fp->_file = fd; - fp->_cookie = (_PTR) fp; + fp->_cookie = (void *) fp; #undef _read #undef _write diff --git a/newlib/libc/stdio/fgets.c b/newlib/libc/stdio/fgets.c index 5edeef957..d4e0af35c 100644 --- a/newlib/libc/stdio/fgets.c +++ b/newlib/libc/stdio/fgets.c @@ -164,20 +164,20 @@ _DEFUN(_fgets_r, (ptr, buf, n, fp), */ if (len > n) len = n; - t = (unsigned char *) memchr ((_PTR) p, '\n', len); + t = (unsigned char *) memchr ((void *) p, '\n', len); if (t != 0) { len = ++t - p; fp->_r -= len; fp->_p = t; - _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len); + _CAST_VOID memcpy ((void *) s, (void *) p, len); s[len] = 0; _newlib_flockfile_exit (fp); return (buf); } fp->_r -= len; fp->_p += len; - _CAST_VOID memcpy ((_PTR) s, (_PTR) p, len); + _CAST_VOID memcpy ((void *) s, (void *) p, len); s += len; } while ((n -= len) != 0); diff --git a/newlib/libc/stdio/fopen.c b/newlib/libc/stdio/fopen.c index e6b044557..57268945f 100644 --- a/newlib/libc/stdio/fopen.c +++ b/newlib/libc/stdio/fopen.c @@ -142,7 +142,7 @@ _DEFUN(_fopen_r, (ptr, file, mode), fp->_file = f; fp->_flags = flags; - fp->_cookie = (_PTR) fp; + fp->_cookie = (void *) fp; fp->_read = __sread; fp->_write = __swrite; fp->_seek = __sseek; diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c index cff60efe1..58aa2c68d 100644 --- a/newlib/libc/stdio/fread.c +++ b/newlib/libc/stdio/fread.c @@ -144,7 +144,7 @@ _DEFUN(crlf_r, (ptr, fp, buf, count, eof), size_t _DEFUN(_fread_r, (ptr, buf, size, count, fp), struct _reent * ptr, - _PTR __restrict buf, + void *__restrict buf, size_t size, size_t count, FILE * __restrict fp) @@ -173,7 +173,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp), { /* First copy any available characters from ungetc buffer. */ int copy_size = resid > fp->_r ? fp->_r : resid; - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, (size_t) copy_size); + _CAST_VOID memcpy ((void *) p, (void *) fp->_p, (size_t) copy_size); fp->_p += copy_size; fp->_r -= copy_size; p += copy_size; @@ -222,7 +222,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp), { while (resid > (r = fp->_r)) { - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, (size_t) r); + _CAST_VOID memcpy ((void *) p, (void *) fp->_p, (size_t) r); fp->_p += r; /* fp->_r = 0 ... done in __srefill */ p += r; @@ -241,7 +241,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp), return (total - resid) / size; } } - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, resid); + _CAST_VOID memcpy ((void *) p, (void *) fp->_p, resid); fp->_r -= resid; fp->_p += resid; } @@ -261,7 +261,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp), #ifndef _REENT_ONLY size_t _DEFUN(fread, (buf, size, count, fp), - _PTR __restrict buf, + void *__restrict buf, size_t size, size_t count, FILE *__restrict fp) diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c index 7e70b9a98..46cbd81ce 100644 --- a/newlib/libc/stdio/freopen.c +++ b/newlib/libc/stdio/freopen.c @@ -221,7 +221,7 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), fp->_flags = flags; fp->_file = f; - fp->_cookie = (_PTR) fp; + fp->_cookie = (void *) fp; fp->_read = __sread; fp->_write = __swrite; fp->_seek = __sseek; diff --git a/newlib/libc/stdio/fseeko.c b/newlib/libc/stdio/fseeko.c index 58bb9511b..a2ed1b5b5 100644 --- a/newlib/libc/stdio/fseeko.c +++ b/newlib/libc/stdio/fseeko.c @@ -99,7 +99,7 @@ _DEFUN(_fseeko_r, (ptr, fp, offset, whence), _off_t offset, int whence) { - _fpos_t _EXFNPTR(seekfn, (struct _reent *, _PTR, _fpos_t, int)); + _fpos_t _EXFNPTR(seekfn, (struct _reent *, void *, _fpos_t, int)); _fpos_t target; _fpos_t curoff = 0; size_t n; diff --git a/newlib/libc/stdio/fvwrite.c b/newlib/libc/stdio/fvwrite.c index c93888dc4..95bd34c6d 100644 --- a/newlib/libc/stdio/fvwrite.c +++ b/newlib/libc/stdio/fvwrite.c @@ -26,7 +26,7 @@ #include "fvwrite.h" #define MIN(a, b) ((a) < (b) ? (a) : (b)) -#define COPY(n) _CAST_VOID memmove ((_PTR) fp->_p, (_PTR) p, (size_t) (n)) +#define COPY(n) _CAST_VOID memmove ((void *) fp->_p, (void *) p, (size_t) (n)) #define GETIOV(extra_work) \ while (len == 0) \ @@ -219,7 +219,7 @@ _DEFUN(__sfvwrite_r, (ptr, fp, uio), GETIOV (nlknown = 0); if (!nlknown) { - nl = memchr ((_PTR) p, '\n', len); + nl = memchr ((void *) p, '\n', len); nldist = nl ? nl + 1 - p : len + 1; nlknown = 1; } diff --git a/newlib/libc/stdio/fvwrite.h b/newlib/libc/stdio/fvwrite.h index 8b01a2a9d..91cabc890 100644 --- a/newlib/libc/stdio/fvwrite.h +++ b/newlib/libc/stdio/fvwrite.h @@ -22,7 +22,7 @@ * I/O descriptors for __sfvwrite_r(). */ struct __siov { - const _PTR iov_base; + const void *iov_base; size_t iov_len; }; struct __suio { diff --git a/newlib/libc/stdio/fwrite.c b/newlib/libc/stdio/fwrite.c index cfaa2499a..7dec80c1a 100644 --- a/newlib/libc/stdio/fwrite.c +++ b/newlib/libc/stdio/fwrite.c @@ -110,7 +110,7 @@ static char sccsid[] = "%W% (Berkeley) %G%"; size_t _DEFUN(_fwrite_r, (ptr, buf, size, count, fp), struct _reent * ptr, - const _PTR __restrict buf, + const void *__restrict buf, size_t size, size_t count, FILE * __restrict fp) @@ -171,7 +171,7 @@ ret: #ifndef _REENT_ONLY size_t _DEFUN(fwrite, (buf, size, count, fp), - const _PTR __restrict buf, + const void *__restrict buf, size_t size, size_t count, FILE * fp) diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c index ac1276b48..c76527da6 100644 --- a/newlib/libc/stdio/makebuf.c +++ b/newlib/libc/stdio/makebuf.c @@ -39,7 +39,7 @@ _DEFUN(__smakebuf_r, (ptr, fp), struct _reent *ptr, register FILE *fp) { - register _PTR p; + register void *p; int flags; size_t size; int couldbetty; diff --git a/newlib/libc/stdio/nano-vfprintf.c b/newlib/libc/stdio/nano-vfprintf.c index df20783c6..e87f374fc 100644 --- a/newlib/libc/stdio/nano-vfprintf.c +++ b/newlib/libc/stdio/nano-vfprintf.c @@ -239,7 +239,7 @@ _DEFUN(__ssputs_r, (ptr, fp, buf, len), if (len < w) w = len; - (void)memmove ((_PTR) fp->_p, (_PTR) buf, (size_t) (w)); + (void)memmove ((void *) fp->_p, (void *) buf, (size_t) (w)); fp->_w -= w; fp->_p += w; return 0; @@ -331,7 +331,7 @@ _DEFUN(__ssprint_r, (ptr, fp, uio), if (len < w) w = len; - (void)memmove ((_PTR) fp->_p, (_PTR) p, (size_t) (w)); + (void)memmove ((void *) fp->_p, (void *) p, (size_t) (w)); fp->_w -= w; fp->_p += w; /* Pretend we copied all. */ diff --git a/newlib/libc/stdio/nano-vfprintf_local.h b/newlib/libc/stdio/nano-vfprintf_local.h index f883741d2..15ddce08e 100644 --- a/newlib/libc/stdio/nano-vfprintf_local.h +++ b/newlib/libc/stdio/nano-vfprintf_local.h @@ -114,7 +114,7 @@ extern char *_dtoa_r (struct _reent *, double, int, #define u_quad_t unsigned long typedef quad_t * quad_ptr_t; -typedef _PTR void_ptr_t; +typedef void *void_ptr_t; typedef char * char_ptr_t; typedef long * long_ptr_t; typedef int * int_ptr_t; diff --git a/newlib/libc/stdio/nano-vfscanf.c b/newlib/libc/stdio/nano-vfscanf.c index f530480b6..15e0a5e8d 100644 --- a/newlib/libc/stdio/nano-vfscanf.c +++ b/newlib/libc/stdio/nano-vfscanf.c @@ -264,7 +264,7 @@ _DEFUN(__ssrefill_r, (ptr, fp), #else int _EXFUN (_sungetc_r, (struct _reent *, int, register FILE *)); int _EXFUN (__ssrefill_r, (struct _reent *, register FILE *)); -size_t _EXFUN (_sfread_r, (struct _reent *, _PTR buf, size_t, size_t, FILE *)); +size_t _EXFUN (_sfread_r, (struct _reent *, void *buf, size_t, size_t, FILE *)); #endif /* !STRING_ONLY. */ int diff --git a/newlib/libc/stdio/setvbuf.c b/newlib/libc/stdio/setvbuf.c index 684a8b582..6ce0ee1fe 100644 --- a/newlib/libc/stdio/setvbuf.c +++ b/newlib/libc/stdio/setvbuf.c @@ -123,7 +123,7 @@ _DEFUN(setvbuf, (fp, buf, mode, size), FREEUB(reent, fp); fp->_r = fp->_lbfsize = 0; if (fp->_flags & __SMBF) - _free_r (reent, (_PTR) fp->_bf._base); + _free_r (reent, (void *) fp->_bf._base); fp->_flags &= ~(__SLBF | __SNBF | __SMBF | __SOPT | __SNPT | __SEOF); if (mode == _IONBF) diff --git a/newlib/libc/stdio/stdio.c b/newlib/libc/stdio/stdio.c index e64c061dd..0e8016b12 100644 --- a/newlib/libc/stdio/stdio.c +++ b/newlib/libc/stdio/stdio.c @@ -65,7 +65,7 @@ _DEFUN(__sread, (ptr, cookie, buf, n), _READ_WRITE_RETURN_TYPE _DEFUN(__seofread, (ptr, cookie, buf, len), struct _reent *_ptr, - _PTR cookie, + void *cookie, char *buf, _READ_WRITE_BUFSIZE_TYPE len) { diff --git a/newlib/libc/stdio/ungetc.c b/newlib/libc/stdio/ungetc.c index 98590478b..f7e12880e 100644 --- a/newlib/libc/stdio/ungetc.c +++ b/newlib/libc/stdio/ungetc.c @@ -100,10 +100,10 @@ _DEFUN(__submore, (rptr, fp), return 0; } i = fp->_ub._size; - p = (unsigned char *) _realloc_r (rptr, (_PTR) (fp->_ub._base), i << 1); + p = (unsigned char *) _realloc_r (rptr, (void *) (fp->_ub._base), i << 1); if (p == NULL) return EOF; - _CAST_VOID memcpy ((_PTR) (p + i), (_PTR) p, (size_t) i); + _CAST_VOID memcpy ((void *) (p + i), (void *) p, (size_t) i); fp->_p = p + i; fp->_ub._base = p; fp->_ub._size = i << 1; diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 674322b31..4fbac0562 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -254,7 +254,7 @@ _DEFUN(__ssputs_r, (ptr, fp, buf, len), } if (len < w) w = len; - (void)memmove ((_PTR) fp->_p, (_PTR) buf, (size_t) (w)); + (void)memmove ((void *) fp->_p, (void *) buf, (size_t) (w)); fp->_w -= w; fp->_p += w; @@ -339,7 +339,7 @@ _DEFUN(__ssprint_r, (ptr, fp, uio), } if (len < w) w = len; - (void)memmove ((_PTR) fp->_p, (_PTR) p, (size_t) (w)); + (void)memmove ((void *) fp->_p, (void *) p, (size_t) (w)); fp->_w -= w; fp->_p += w; w = len; /* pretend we copied all */ @@ -571,7 +571,7 @@ static int exponent(char *, int, int); #endif typedef quad_t * quad_ptr_t; -typedef _PTR void_ptr_t; +typedef void *void_ptr_t; typedef char * char_ptr_t; typedef long * long_ptr_t; typedef int * int_ptr_t; @@ -1175,7 +1175,7 @@ reswitch: switch (ch) { if (ch == 'C' || (flags & LONGINT)) { mbstate_t ps; - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); if ((size = (int)_wcrtomb_r (data, cp, (wchar_t)GET_ARG (N, ap, wint_t), &ps)) == -1) { @@ -1463,7 +1463,7 @@ string: wcp = (const wchar_t *)cp; size = m = 0; - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); /* Count number of bytes needed for multibyte string that will be produced from widechar @@ -1509,7 +1509,7 @@ string: cp = buf; /* Convert widechar string to multibyte string. */ - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); if (_wcsrtombs_r (data, cp, &wcp, size, &ps) != size) { fp->_flags |= __SERR; diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index 38ef36ea5..8009699e4 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -349,7 +349,7 @@ _DEFUN(__ssrefill_r, (ptr, fp), size_t _DEFUN(_sfread_r, (ptr, buf, size, count, fp), struct _reent * ptr, - _PTR buf, + void *buf, size_t size, size_t count, FILE * fp) @@ -367,7 +367,7 @@ _DEFUN(_sfread_r, (ptr, buf, size, count, fp), while (resid > (r = fp->_r)) { - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, (size_t) r); + _CAST_VOID memcpy ((void *) p, (void *) fp->_p, (size_t) r); fp->_p += r; fp->_r = 0; p += r; @@ -378,7 +378,7 @@ _DEFUN(_sfread_r, (ptr, buf, size, count, fp), return (total - resid) / size; } } - _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, resid); + _CAST_VOID memcpy ((void *) p, (void *) fp->_p, resid); fp->_r -= resid; fp->_p += resid; return count; @@ -386,7 +386,7 @@ _DEFUN(_sfread_r, (ptr, buf, size, count, fp), #else /* !STRING_ONLY || !INTEGER_ONLY */ int _EXFUN (_sungetc_r, (struct _reent *, int, register FILE *)); int _EXFUN (__ssrefill_r, (struct _reent *, register FILE *)); -size_t _EXFUN (_sfread_r, (struct _reent *, _PTR buf, size_t, size_t, FILE *)); +size_t _EXFUN (_sfread_r, (struct _reent *, void *buf, size_t, size_t, FILE *)); #endif /* !STRING_ONLY || !INTEGER_ONLY */ static inline int diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c index 1054eb942..449b628db 100644 --- a/newlib/libc/stdio/vfwprintf.c +++ b/newlib/libc/stdio/vfwprintf.c @@ -289,7 +289,7 @@ static int wexponent(wchar_t *, int, int); #endif typedef quad_t * quad_ptr_t; -typedef _PTR void_ptr_t; +typedef void *void_ptr_t; typedef char * char_ptr_t; typedef wchar_t* wchar_ptr_t; typedef long * long_ptr_t; @@ -1199,7 +1199,7 @@ string: if (prec >= 0) { char *p = arg; - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); while (nchars < (size_t)prec) { nconv = mbrlen (p, MB_CUR_MAX, &ps); if (nconv == 0 || nconv == (size_t)-1 || @@ -1224,7 +1224,7 @@ string: cp = malloc_buf; } else cp = buf; - memset ((_PTR)&ps, '\0', sizeof (mbstate_t)); + memset ((void *)&ps, '\0', sizeof (mbstate_t)); p = cp; while (insize != 0) { nconv = _mbrtowc_r (data, p, arg, insize, &ps); diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c index 73d8f3209..3ac6ecc07 100644 --- a/newlib/libc/stdio/vfwscanf.c +++ b/newlib/libc/stdio/vfwscanf.c @@ -936,7 +936,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), else mbp = GET_ARG(N, ap, char *); n = 0; - memset ((_PTR)&mbs, '\0', sizeof (mbstate_t)); + memset ((void *)&mbs, '\0', sizeof (mbstate_t)); while (width != 0 && (wi = _fgetwc_r (rptr, fp)) != WEOF) { nconv = _wcrtomb_r (rptr, mbp, wi, &mbs); @@ -1028,7 +1028,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), else mbp = GET_ARG(N, ap, char *); n = 0; - memset ((_PTR) &mbs, '\0', sizeof (mbstate_t)); + memset ((void *) &mbs, '\0', sizeof (mbstate_t)); while ((wi = _fgetwc_r (rptr, fp)) != WEOF && width != 0 && INCCL (wi)) { @@ -1117,7 +1117,7 @@ _DEFUN(__SVFWSCANF_R, (rptr, fp, fmt0, ap), #endif else mbp = GET_ARG(N, ap, char *); - memset ((_PTR) &mbs, '\0', sizeof (mbstate_t)); + memset ((void *) &mbs, '\0', sizeof (mbstate_t)); while ((wi = _fgetwc_r (rptr, fp)) != WEOF && width != 0 && !iswspace (wi)) { |