From patchwork Thu Dec 7 18:19:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 121069 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8703096qgn; Thu, 7 Dec 2017 10:29:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMaZcjPm3/LJ99fDqhiSNriUbD6cAuq5bPoUsqFY4WQ87WLgnTwC6EfV0UZmRzYkJl5IXFbx X-Received: by 10.84.197.3 with SMTP id m3mr27557493pld.264.1512671361250; Thu, 07 Dec 2017 10:29:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512671361; cv=none; d=google.com; s=arc-20160816; b=DJJfilzQpeH+VshwDVLbDJrLvZebRXXVsSCVGw10+lOo4OM6C1gQkA0YqvIseOw3f/ CpLgPiwQLy5AqUyt5pWk8TXPIMQqKMtAGIpEbC9gU6hutS/NXOwqZ87mBuoQiJL0Gl/2 Tic+X4CZtZAUHcGvDpvcQJLF1950L3RlgARVbYYPkag9xW8Qz25EkHmt96MSiMIZT2wF ebTjciTq77U28s+un8jg5sot7Hmg7XE7HHRF2Nhtf0IuRhsu77NKcgXoCPxSvsrBZEHy WhSa3hIMhzqt98OZwrhsbhhjnBf5l7sXFoFQzN47nMKWZrIKMYCFjh3v65ovwRaH892o y0YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=6A/VEwLaUWrlvd48V3cUyVSmq8NaKDl+fR2p6FcXXNA=; b=GKqW5hGyvujdQoTz8AoGO9Jc8rZvCd3BOCmNZ/I7+ENCJsZ/F21FSNd04894B+LRV7 bNZyyWXUJiFtWktbcs/ZsoLi2TKI+1kWdV4Hdkvo1HnIzO7u790TcOUf71FTHWlMlDTe tleJrboNjMFHF460WPhlCHCm1U1YVsrTTVQCMsM+bABZ9HgyU3FQ08EJtIBPv4QPiEo1 0CcS40HfQaX6KGIAAbx7Lag4ifpKxfiCaqmByL9mrBWB3lSJCUHF58drvlcnO5dMX7ys 4Dnqd56DnpzEy4+B3W4W87T8gSmqTRLEh63DvB8Q2uIOzr+WRBjCh+DdRblt0LJvlooQ XeYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=r491+1sd; spf=pass (google.com: domain of newlib-return-15502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15502-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id j4si4508067pfc.22.2017.12.07.10.29.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 10:29:21 -0800 (PST) Received-SPF: pass (google.com: domain of newlib-return-15502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=r491+1sd; spf=pass (google.com: domain of newlib-return-15502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15502-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=PuynvcRKIrzJsHBdCPEA/RfnXPzZJEQ vGDmp5wtnYHxdJLm9yFfHwDJCeIFtJXrWYLY8hspj6oTzctrDVw1hMhbxkpCfCXd lt8L2Wg1r4QDc4JVGBn22Tp1wERPuFPS2u0gI5qK6OGE7DpPd98zw1QqQL6M8X92 HooaVn/YkhPc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=B7EvUbuyC3T3D6aoeYN7AcIWYOI=; b=r491+ 1sdbdYMTORog1LFSzFhxq4Kq7CiJCFDhF/y3EttHyWlpG/mjZXv6miUjp7f86dUI t9lgiotCcIjUPGcxPnxXIQ81yy9HA1kGyGPCS70hcFo2Y1zgJzi9ZoBw7qk7yYgq QTfQmOQ9c1eCE/AYCFC+ce7ERcHugSLCeybDKQ= Received: (qmail 36210 invoked by alias); 7 Dec 2017 18:29:02 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 36153 invoked by uid 89); 7 Dec 2017 18:29:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Dec 2017 18:29:00 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3635C7CB91 for ; Thu, 7 Dec 2017 18:19:48 +0000 (UTC) Received: from localhost.localdomain (ovpn-120-70.rdu2.redhat.com [10.10.120.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A92F817CFA for ; Thu, 7 Dec 2017 18:19:47 +0000 (UTC) From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH v2 08/17] ansification: remove _CAST_VOID Date: Thu, 7 Dec 2017 12:19:00 -0600 Message-Id: <20171207181909.1112-9-yselkowi@redhat.com> In-Reply-To: <20171207181909.1112-1-yselkowi@redhat.com> References: <20171207181909.1112-1-yselkowi@redhat.com> Signed-off-by: Yaakov Selkowitz --- 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 diff --git a/newlib/libc/include/_ansi.h b/newlib/libc/include/_ansi.h index e955138fe..5e0cce4c8 100644 --- a/newlib/libc/include/_ansi.h +++ b/newlib/libc/include/_ansi.h @@ -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 diff --git a/newlib/libc/include/sys/lock.h b/newlib/libc/include/sys/lock.h index 42f9c4cd9..528904957 100644 --- a/newlib/libc/include/sys/lock.h +++ b/newlib/libc/include/sys/lock.h @@ -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 diff --git a/newlib/libc/include/sys/stdio.h b/newlib/libc/include/sys/stdio.h index 0918fe157..91a274596 100644 --- a/newlib/libc/include/sys/stdio.h +++ b/newlib/libc/include/sys/stdio.h @@ -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 diff --git a/newlib/libc/machine/powerpc/vfscanf.c b/newlib/libc/machine/powerpc/vfscanf.c index b27a0b81c..4a3e48c22 100644 --- a/newlib/libc/machine/powerpc/vfscanf.c +++ b/newlib/libc/machine/powerpc/vfscanf.c @@ -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) { diff --git a/newlib/libc/stdio/fgets.c b/newlib/libc/stdio/fgets.c index d4e0af35c..c6ef6d3d5 100644 --- a/newlib/libc/stdio/fgets.c +++ b/newlib/libc/stdio/fgets.c @@ -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); diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index 3d928c15d..a7ea76bb5 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -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 (); } diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c index 58aa2c68d..c9180b833 100644 --- a/newlib/libc/stdio/fread.c +++ b/newlib/libc/stdio/fread.c @@ -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; } diff --git a/newlib/libc/stdio/fvwrite.c b/newlib/libc/stdio/fvwrite.c index 95bd34c6d..d742784e5 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 ((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) \ diff --git a/newlib/libc/stdio/refill.c b/newlib/libc/stdio/refill.c index fc738d455..6158f3ec0 100644 --- a/newlib/libc/stdio/refill.c +++ b/newlib/libc/stdio/refill.c @@ -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. */ diff --git a/newlib/libc/stdio/rewind.c b/newlib/libc/stdio/rewind.c index 873083b85..a09186bb0 100644 --- a/newlib/libc/stdio/rewind.c +++ b/newlib/libc/stdio/rewind.c @@ -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); } diff --git a/newlib/libc/stdio/setbuf.c b/newlib/libc/stdio/setbuf.c index a7df3a1f4..7308ab8c2 100644 --- a/newlib/libc/stdio/setbuf.c +++ b/newlib/libc/stdio/setbuf.c @@ -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); } diff --git a/newlib/libc/stdio/setbuffer.c b/newlib/libc/stdio/setbuffer.c index cbcbde3db..6914ca7f2 100644 --- a/newlib/libc/stdio/setbuffer.c +++ b/newlib/libc/stdio/setbuffer.c @@ -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); } diff --git a/newlib/libc/stdio/tmpfile.c b/newlib/libc/stdio/tmpfile.c index 6145ad0bc..30e9040fd 100644 --- a/newlib/libc/stdio/tmpfile.c +++ b/newlib/libc/stdio/tmpfile.c @@ -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; } diff --git a/newlib/libc/stdio/ungetc.c b/newlib/libc/stdio/ungetc.c index f7e12880e..c673365b1 100644 --- a/newlib/libc/stdio/ungetc.c +++ b/newlib/libc/stdio/ungetc.c @@ -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; diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index 8009699e4..d76d94b8c 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -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; diff --git a/newlib/libc/stdio64/tmpfile64.c b/newlib/libc/stdio64/tmpfile64.c index d58aa1472..58b945d5b 100644 --- a/newlib/libc/stdio64/tmpfile64.c +++ b/newlib/libc/stdio64/tmpfile64.c @@ -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; } diff --git a/newlib/libc/string/u_strerr.c b/newlib/libc/string/u_strerr.c index d3204df72..174d9170f 100644 --- a/newlib/libc/string/u_strerr.c +++ b/newlib/libc/string/u_strerr.c @@ -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; }