ansification: remove _CAST_VOID

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
This commit is contained in:
Yaakov Selkowitz 2017-12-03 20:56:37 -06:00
parent e6321aa6a6
commit 670b01da7f
17 changed files with 36 additions and 38 deletions

View File

@ -63,7 +63,6 @@
#endif #endif
#define _DEFUN(name, arglist, args) name(args) #define _DEFUN(name, arglist, args) name(args)
#define _DEFUN_VOID(name) name(void) #define _DEFUN_VOID(name) name(void)
#define _CAST_VOID (void)
#ifndef _LONG_DOUBLE #ifndef _LONG_DOUBLE
#define _LONG_DOUBLE long double #define _LONG_DOUBLE long double
#endif #endif
@ -75,7 +74,6 @@
#define _EXFUN_NOTHROW(name, proto) name() #define _EXFUN_NOTHROW(name, proto) name()
#define _DEFUN(name, arglist, args) name arglist args; #define _DEFUN(name, arglist, args) name arglist args;
#define _DEFUN_VOID(name) name() #define _DEFUN_VOID(name) name()
#define _CAST_VOID
#define _LONG_DOUBLE double #define _LONG_DOUBLE double
#endif #endif

View File

@ -13,16 +13,16 @@ typedef int _LOCK_RECURSIVE_T;
#define __LOCK_INIT(class,lock) static int lock = 0; #define __LOCK_INIT(class,lock) static int lock = 0;
#define __LOCK_INIT_RECURSIVE(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(lock) ((void) 0)
#define __lock_init_recursive(lock) (_CAST_VOID 0) #define __lock_init_recursive(lock) ((void) 0)
#define __lock_close(lock) (_CAST_VOID 0) #define __lock_close(lock) ((void) 0)
#define __lock_close_recursive(lock) (_CAST_VOID 0) #define __lock_close_recursive(lock) ((void) 0)
#define __lock_acquire(lock) (_CAST_VOID 0) #define __lock_acquire(lock) ((void) 0)
#define __lock_acquire_recursive(lock) (_CAST_VOID 0) #define __lock_acquire_recursive(lock) ((void) 0)
#define __lock_try_acquire(lock) (_CAST_VOID 0) #define __lock_try_acquire(lock) ((void) 0)
#define __lock_try_acquire_recursive(lock) (_CAST_VOID 0) #define __lock_try_acquire_recursive(lock) ((void) 0)
#define __lock_release(lock) (_CAST_VOID 0) #define __lock_release(lock) ((void) 0)
#define __lock_release_recursive(lock) (_CAST_VOID 0) #define __lock_release_recursive(lock) ((void) 0)
#else #else

View File

@ -12,7 +12,7 @@
#ifndef __SINGLE_THREAD__ #ifndef __SINGLE_THREAD__
# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock)) # define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock))
#else #else
# define _flockfile(fp) (_CAST_VOID 0) # define _flockfile(fp) ((void) 0)
#endif #endif
#endif #endif
@ -20,7 +20,7 @@
#ifndef __SINGLE_THREAD__ #ifndef __SINGLE_THREAD__
# define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock)) # define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock))
#else #else
# define _funlockfile(fp) (_CAST_VOID 0) # define _funlockfile(fp) ((void) 0)
#endif #endif
#endif #endif

View File

@ -912,7 +912,7 @@ __svfscanf_r (rptr, fp, fmt0, ap)
if (flags & NDIGITS) if (flags & NDIGITS)
{ {
if (p > buf) if (p > buf)
_CAST_VOID ungetc (*(u_char *)-- p, fp); (void) ungetc (*(u_char *)-- p, fp);
goto match_failure; goto match_failure;
} }
c = ((u_char *) p)[-1]; c = ((u_char *) p)[-1];
@ -1112,11 +1112,11 @@ __svfscanf_r (rptr, fp, fmt0, ap)
--nread; --nread;
if (c != 'e' && c != 'E') if (c != 'e' && c != 'E')
{ {
_CAST_VOID ungetc (c, fp); /* sign */ (void) ungetc (c, fp); /* sign */
c = *(u_char *)-- p; c = *(u_char *)-- p;
--nread; --nread;
} }
_CAST_VOID ungetc (c, fp); (void) ungetc (c, fp);
} }
if ((flags & SUPPRESS) == 0) if ((flags & SUPPRESS) == 0)
{ {

View File

@ -170,14 +170,14 @@ _DEFUN(_fgets_r, (ptr, buf, n, fp),
len = ++t - p; len = ++t - p;
fp->_r -= len; fp->_r -= len;
fp->_p = t; fp->_p = t;
_CAST_VOID memcpy ((void *) s, (void *) p, len); (void) memcpy ((void *) s, (void *) p, len);
s[len] = 0; s[len] = 0;
_newlib_flockfile_exit (fp); _newlib_flockfile_exit (fp);
return (buf); return (buf);
} }
fp->_r -= len; fp->_r -= len;
fp->_p += len; fp->_p += len;
_CAST_VOID memcpy ((void *) s, (void *) p, len); (void) memcpy ((void *) s, (void *) p, len);
s += len; s += len;
} }
while ((n -= len) != 0); while ((n -= len) != 0);

View File

@ -230,7 +230,7 @@ _DEFUN(_cleanup_r, (ptr),
if (ptr->_stderr != &__sf[2]) if (ptr->_stderr != &__sf[2])
(*cleanup_func) (ptr, ptr->_stderr); (*cleanup_func) (ptr, ptr->_stderr);
#endif #endif
_CAST_VOID _fwalk_reent (ptr, cleanup_func); (void) _fwalk_reent (ptr, cleanup_func);
} }
#ifndef _REENT_ONLY #ifndef _REENT_ONLY
@ -354,13 +354,13 @@ _DEFUN_VOID(__fp_lock_all)
{ {
__sfp_lock_acquire (); __sfp_lock_acquire ();
_CAST_VOID _fwalk (_REENT, __fp_lock); (void) _fwalk (_REENT, __fp_lock);
} }
_VOID _VOID
_DEFUN_VOID(__fp_unlock_all) _DEFUN_VOID(__fp_unlock_all)
{ {
_CAST_VOID _fwalk (_REENT, __fp_unlock); (void) _fwalk (_REENT, __fp_unlock);
__sfp_lock_release (); __sfp_lock_release ();
} }

View File

@ -173,7 +173,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp),
{ {
/* First copy any available characters from ungetc buffer. */ /* First copy any available characters from ungetc buffer. */
int copy_size = resid > fp->_r ? fp->_r : resid; 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->_p += copy_size;
fp->_r -= copy_size; fp->_r -= copy_size;
p += copy_size; p += copy_size;
@ -222,7 +222,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp),
{ {
while (resid > (r = fp->_r)) 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->_p += r;
/* fp->_r = 0 ... done in __srefill */ /* fp->_r = 0 ... done in __srefill */
p += r; p += r;
@ -241,7 +241,7 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp),
return (total - resid) / size; 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->_r -= resid;
fp->_p += resid; fp->_p += resid;
} }

View File

@ -26,7 +26,7 @@
#include "fvwrite.h" #include "fvwrite.h"
#define MIN(a, b) ((a) < (b) ? (a) : (b)) #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) \ #define GETIOV(extra_work) \
while (len == 0) \ while (len == 0) \

View File

@ -107,7 +107,7 @@ _DEFUN(__srefill_r, (ptr, fp),
/* Ignore this file in _fwalk to avoid potential deadlock. */ /* Ignore this file in _fwalk to avoid potential deadlock. */
short orig_flags = fp->_flags; short orig_flags = fp->_flags;
fp->_flags = 1; fp->_flags = 1;
_CAST_VOID _fwalk (_GLOBAL_REENT, lflush); (void) _fwalk (_GLOBAL_REENT, lflush);
fp->_flags = orig_flags; fp->_flags = orig_flags;
/* Now flush this file without locking it. */ /* Now flush this file without locking it. */

View File

@ -56,7 +56,7 @@ _DEFUN(_rewind_r, (ptr, fp),
struct _reent * ptr, struct _reent * ptr,
register FILE * fp) register FILE * fp)
{ {
_CAST_VOID _fseek_r (ptr, fp, 0L, SEEK_SET); (void) _fseek_r (ptr, fp, 0L, SEEK_SET);
clearerr (fp); clearerr (fp);
} }

View File

@ -69,5 +69,5 @@ _DEFUN(setbuf, (fp, buf),
FILE *__restrict fp, FILE *__restrict fp,
char *__restrict buf) char *__restrict buf)
{ {
_CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ); (void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
} }

View File

@ -70,5 +70,5 @@ _DEFUN(setbuffer, (fp, buf, size),
char *buf, char *buf,
int size) int size)
{ {
_CAST_VOID setvbuf (fp, buf, buf ? _IOFBF : _IONBF, (size_t) size); (void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, (size_t) size);
} }

View File

@ -73,7 +73,7 @@ _DEFUN(_tmpfile_r, (ptr),
e = ptr->_errno; e = ptr->_errno;
if (!fp) if (!fp)
_close_r (ptr, fd); _close_r (ptr, fd);
_CAST_VOID _remove_r (ptr, f); (void) _remove_r (ptr, f);
ptr->_errno = e; ptr->_errno = e;
return fp; return fp;
} }

View File

@ -103,7 +103,7 @@ _DEFUN(__submore, (rptr, fp),
p = (unsigned char *) _realloc_r (rptr, (void *) (fp->_ub._base), i << 1); p = (unsigned char *) _realloc_r (rptr, (void *) (fp->_ub._base), i << 1);
if (p == NULL) if (p == NULL)
return EOF; 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->_p = p + i;
fp->_ub._base = p; fp->_ub._base = p;
fp->_ub._size = i << 1; fp->_ub._size = i << 1;

View File

@ -367,7 +367,7 @@ _DEFUN(_sfread_r, (ptr, buf, size, count, fp),
while (resid > (r = fp->_r)) 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->_p += r;
fp->_r = 0; fp->_r = 0;
p += r; p += r;
@ -378,7 +378,7 @@ _DEFUN(_sfread_r, (ptr, buf, size, count, fp),
return (total - resid) / size; 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->_r -= resid;
fp->_p += resid; fp->_p += resid;
return count; return count;

View File

@ -76,7 +76,7 @@ _DEFUN (_tmpfile64_r, (ptr),
e = ptr->_errno; e = ptr->_errno;
if (!fp) if (!fp)
_close_r (ptr, fd); _close_r (ptr, fd);
_CAST_VOID _remove_r (ptr, f); (void) _remove_r (ptr, f);
ptr->_errno = e; ptr->_errno = e;
return fp; return fp;
} }

View File

@ -7,9 +7,9 @@ _DEFUN(_user_strerror, (errnum, internal, errptr),
int *errptr) int *errptr)
{ {
/* prevent warning about unused parameters */ /* prevent warning about unused parameters */
_CAST_VOID errnum; (void) errnum;
_CAST_VOID internal; (void) internal;
_CAST_VOID errptr; (void) errptr;
return 0; return 0;
} }