@@ -63,7 +63,6 @@
#endif
#define _DEFUN(name, arglist, args) name(args)
#define _DEFUN_VOID(name) name(void)
-#define _CAST_VOID (void)
#ifndef _LONG_DOUBLE
#define _LONG_DOUBLE long double
#endif
@@ -75,7 +74,6 @@
#define _EXFUN_NOTHROW(name, proto) name()
#define _DEFUN(name, arglist, args) name arglist args;
#define _DEFUN_VOID(name) name()
-#define _CAST_VOID
#define _LONG_DOUBLE double
#endif
@@ -13,16 +13,16 @@ typedef int _LOCK_RECURSIVE_T;
#define __LOCK_INIT(class,lock) static int lock = 0;
#define __LOCK_INIT_RECURSIVE(class,lock) static int lock = 0;
-#define __lock_init(lock) (_CAST_VOID 0)
-#define __lock_init_recursive(lock) (_CAST_VOID 0)
-#define __lock_close(lock) (_CAST_VOID 0)
-#define __lock_close_recursive(lock) (_CAST_VOID 0)
-#define __lock_acquire(lock) (_CAST_VOID 0)
-#define __lock_acquire_recursive(lock) (_CAST_VOID 0)
-#define __lock_try_acquire(lock) (_CAST_VOID 0)
-#define __lock_try_acquire_recursive(lock) (_CAST_VOID 0)
-#define __lock_release(lock) (_CAST_VOID 0)
-#define __lock_release_recursive(lock) (_CAST_VOID 0)
+#define __lock_init(lock) ((void) 0)
+#define __lock_init_recursive(lock) ((void) 0)
+#define __lock_close(lock) ((void) 0)
+#define __lock_close_recursive(lock) ((void) 0)
+#define __lock_acquire(lock) ((void) 0)
+#define __lock_acquire_recursive(lock) ((void) 0)
+#define __lock_try_acquire(lock) ((void) 0)
+#define __lock_try_acquire_recursive(lock) ((void) 0)
+#define __lock_release(lock) ((void) 0)
+#define __lock_release_recursive(lock) ((void) 0)
#else
@@ -12,7 +12,7 @@
#ifndef __SINGLE_THREAD__
# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock))
#else
-# define _flockfile(fp) (_CAST_VOID 0)
+# define _flockfile(fp) ((void) 0)
#endif
#endif
@@ -20,7 +20,7 @@
#ifndef __SINGLE_THREAD__
# define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock))
#else
-# define _funlockfile(fp) (_CAST_VOID 0)
+# define _funlockfile(fp) ((void) 0)
#endif
#endif
@@ -912,7 +912,7 @@ __svfscanf_r (rptr, fp, fmt0, ap)
if (flags & NDIGITS)
{
if (p > buf)
- _CAST_VOID ungetc (*(u_char *)-- p, fp);
+ (void) ungetc (*(u_char *)-- p, fp);
goto match_failure;
}
c = ((u_char *) p)[-1];
@@ -1112,11 +1112,11 @@ __svfscanf_r (rptr, fp, fmt0, ap)
--nread;
if (c != 'e' && c != 'E')
{
- _CAST_VOID ungetc (c, fp); /* sign */
+ (void) ungetc (c, fp); /* sign */
c = *(u_char *)-- p;
--nread;
}
- _CAST_VOID ungetc (c, fp);
+ (void) ungetc (c, fp);
}
if ((flags & SUPPRESS) == 0)
{
@@ -170,14 +170,14 @@ _DEFUN(_fgets_r, (ptr, buf, n, fp),
len = ++t - p;
fp->_r -= len;
fp->_p = t;
- _CAST_VOID memcpy ((void *) s, (void *) p, len);
+ (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 ((void *) s, (void *) p, len);
+ (void) memcpy ((void *) s, (void *) p, len);
s += len;
}
while ((n -= len) != 0);
@@ -230,7 +230,7 @@ _DEFUN(_cleanup_r, (ptr),
if (ptr->_stderr != &__sf[2])
(*cleanup_func) (ptr, ptr->_stderr);
#endif
- _CAST_VOID _fwalk_reent (ptr, cleanup_func);
+ (void) _fwalk_reent (ptr, cleanup_func);
}
#ifndef _REENT_ONLY
@@ -354,13 +354,13 @@ _DEFUN_VOID(__fp_lock_all)
{
__sfp_lock_acquire ();
- _CAST_VOID _fwalk (_REENT, __fp_lock);
+ (void) _fwalk (_REENT, __fp_lock);
}
_VOID
_DEFUN_VOID(__fp_unlock_all)
{
- _CAST_VOID _fwalk (_REENT, __fp_unlock);
+ (void) _fwalk (_REENT, __fp_unlock);
__sfp_lock_release ();
}
@@ -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 ((void *) p, (void *) fp->_p, (size_t) copy_size);
+ (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 ((void *) p, (void *) fp->_p, (size_t) r);
+ (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 ((void *) p, (void *) fp->_p, resid);
+ (void) memcpy ((void *) p, (void *) fp->_p, resid);
fp->_r -= resid;
fp->_p += resid;
}
@@ -26,7 +26,7 @@
#include "fvwrite.h"
#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define COPY(n) _CAST_VOID memmove ((void *) fp->_p, (void *) p, (size_t) (n))
+#define COPY(n) (void) memmove ((void *) fp->_p, (void *) p, (size_t) (n))
#define GETIOV(extra_work) \
while (len == 0) \
@@ -107,7 +107,7 @@ _DEFUN(__srefill_r, (ptr, fp),
/* Ignore this file in _fwalk to avoid potential deadlock. */
short orig_flags = fp->_flags;
fp->_flags = 1;
- _CAST_VOID _fwalk (_GLOBAL_REENT, lflush);
+ (void) _fwalk (_GLOBAL_REENT, lflush);
fp->_flags = orig_flags;
/* Now flush this file without locking it. */
@@ -56,7 +56,7 @@ _DEFUN(_rewind_r, (ptr, fp),
struct _reent * ptr,
register FILE * fp)
{
- _CAST_VOID _fseek_r (ptr, fp, 0L, SEEK_SET);
+ (void) _fseek_r (ptr, fp, 0L, SEEK_SET);
clearerr (fp);
}
@@ -69,5 +69,5 @@ _DEFUN(setbuf, (fp, buf),
FILE *__restrict fp,
char *__restrict buf)
{
- _CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
+ (void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
}
@@ -70,5 +70,5 @@ _DEFUN(setbuffer, (fp, buf, size),
char *buf,
int size)
{
- _CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, (size_t) size);
+ (void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, (size_t) size);
}
@@ -73,7 +73,7 @@ _DEFUN(_tmpfile_r, (ptr),
e = ptr->_errno;
if (!fp)
_close_r (ptr, fd);
- _CAST_VOID _remove_r (ptr, f);
+ (void) _remove_r (ptr, f);
ptr->_errno = e;
return fp;
}
@@ -103,7 +103,7 @@ _DEFUN(__submore, (rptr, fp),
p = (unsigned char *) _realloc_r (rptr, (void *) (fp->_ub._base), i << 1);
if (p == NULL)
return EOF;
- _CAST_VOID memcpy ((void *) (p + i), (void *) p, (size_t) i);
+ (void) memcpy ((void *) (p + i), (void *) p, (size_t) i);
fp->_p = p + i;
fp->_ub._base = p;
fp->_ub._size = i << 1;
@@ -367,7 +367,7 @@ _DEFUN(_sfread_r, (ptr, buf, size, count, fp),
while (resid > (r = fp->_r))
{
- _CAST_VOID memcpy ((void *) p, (void *) fp->_p, (size_t) r);
+ (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 ((void *) p, (void *) fp->_p, resid);
+ (void) memcpy ((void *) p, (void *) fp->_p, resid);
fp->_r -= resid;
fp->_p += resid;
return count;
@@ -76,7 +76,7 @@ _DEFUN (_tmpfile64_r, (ptr),
e = ptr->_errno;
if (!fp)
_close_r (ptr, fd);
- _CAST_VOID _remove_r (ptr, f);
+ (void) _remove_r (ptr, f);
ptr->_errno = e;
return fp;
}
@@ -7,9 +7,9 @@ _DEFUN(_user_strerror, (errnum, internal, errptr),
int *errptr)
{
/* prevent warning about unused parameters */
- _CAST_VOID errnum;
- _CAST_VOID internal;
- _CAST_VOID errptr;
+ (void) errnum;
+ (void) internal;
+ (void) errptr;
return 0;
}
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com> --- newlib/libc/include/_ansi.h | 2 -- newlib/libc/include/sys/lock.h | 20 ++++++++++---------- newlib/libc/include/sys/stdio.h | 4 ++-- newlib/libc/machine/powerpc/vfscanf.c | 6 +++--- newlib/libc/stdio/fgets.c | 4 ++-- newlib/libc/stdio/findfp.c | 6 +++--- newlib/libc/stdio/fread.c | 6 +++--- newlib/libc/stdio/fvwrite.c | 2 +- newlib/libc/stdio/refill.c | 2 +- newlib/libc/stdio/rewind.c | 2 +- newlib/libc/stdio/setbuf.c | 2 +- newlib/libc/stdio/setbuffer.c | 2 +- newlib/libc/stdio/tmpfile.c | 2 +- newlib/libc/stdio/ungetc.c | 2 +- newlib/libc/stdio/vfscanf.c | 4 ++-- newlib/libc/stdio64/tmpfile64.c | 2 +- newlib/libc/string/u_strerr.c | 6 +++--- 17 files changed, 36 insertions(+), 38 deletions(-) -- 2.15.1