From 1243a76f2c6e8ad37874a516af073ba7f1feffb1 Mon Sep 17 00:00:00 2001 From: Jeroen Ruigrok/asmodai Date: Wed, 7 Jul 2004 08:20:19 +0000 Subject: [PATCH] Synchronise with NetBSD: get rid of __STDC__ selective compilation. We assume we build using an ANSI C conforming compiler. --- usr.bin/xlint/lint1/emit.c | 10 +------ usr.bin/xlint/lint1/err.c | 56 +------------------------------------ usr.bin/xlint/lint1/param.h | 11 ++------ usr.bin/xlint/lint1/scan.l | 10 +------ usr.bin/xlint/lint2/msg.c | 19 +------------ usr.bin/xlint/lint2/read.c | 10 +------ 6 files changed, 7 insertions(+), 109 deletions(-) diff --git a/usr.bin/xlint/lint1/emit.c b/usr.bin/xlint/lint1/emit.c index 1e36ca7532..7765624298 100644 --- a/usr.bin/xlint/lint1/emit.c +++ b/usr.bin/xlint/lint1/emit.c @@ -31,7 +31,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/usr.bin/xlint/lint1/emit.c,v 1.1.1.1.8.1 2001/03/04 09:27:26 kris Exp $ - * $DragonFly: src/usr.bin/xlint/lint1/emit.c,v 1.3 2003/11/03 19:31:34 eirikn Exp $ + * $DragonFly: src/usr.bin/xlint/lint1/emit.c,v 1.4 2004/07/07 08:20:18 asmodai Exp $ * * $NetBSD: emit.c,v 1.2 1995/07/03 21:24:00 cgd Exp $ */ @@ -164,18 +164,10 @@ outqchar(c) case '\r': outchar('r'); break; -#ifdef __STDC__ case '\v': -#else - case '\013': -#endif outchar('v'); break; -#ifdef __STDC__ case '\a': -#else - case '\007': -#endif outchar('a'); break; default: diff --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c index f1ed0d8fe4..db297a661c 100644 --- a/usr.bin/xlint/lint1/err.c +++ b/usr.bin/xlint/lint1/err.c @@ -31,7 +31,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: err.c,v 1.8 1995/10/02 17:37:00 jpo Exp $ - * $DragonFly: src/usr.bin/xlint/lint1/err.c,v 1.4 2003/11/03 19:31:34 eirikn Exp $ + * $DragonFly: src/usr.bin/xlint/lint1/err.c,v 1.5 2004/07/07 08:20:18 asmodai Exp $ */ /* number of errors found */ @@ -41,11 +41,7 @@ int nerr; int sytxerr; #include -#ifdef __STDC__ #include -#else -#include -#endif #include "lint1.h" @@ -422,42 +418,22 @@ vwarning(n, ap) } void -#ifdef __STDC__ error(int n, ...) -#else -error(n, va_alist) - int n; - va_dcl -#endif { va_list ap; -#ifdef __STDC__ va_start(ap, n); -#else - va_start(ap); -#endif verror(n, ap); va_end(ap); } void -#ifdef __STDC__ lerror(const char *msg, ...) -#else -lerror(msg, va_alist) - const char *msg; - va_dcl -#endif { va_list ap; const char *fn; -#ifdef __STDC__ va_start(ap, msg); -#else - va_start(ap); -#endif fn = basename(curr_pos.p_file); (void)fprintf(stderr, "%s:%d: lint error: ", fn, curr_pos.p_line); (void)vfprintf(stderr, msg, ap); @@ -467,42 +443,22 @@ lerror(msg, va_alist) } void -#ifdef __STDC__ warning(int n, ...) -#else -warning(n, va_alist) - int n; - va_dcl -#endif { va_list ap; -#ifdef __STDC__ va_start(ap, n); -#else - va_start(ap); -#endif vwarning(n, ap); va_end(ap); } void -#ifdef __STDC__ message(int n, ...) -#else -message(n, va_alist) - int n; - va_dcl -#endif { va_list ap; const char *fn; -#ifdef __STDC__ va_start(ap, n); -#else - va_start(ap); -#endif fn = basename(curr_pos.p_file); (void)printf("%s:%d: ", fn, curr_pos.p_line); (void)vprintf(msgs[n], ap); @@ -511,22 +467,12 @@ message(n, va_alist) } int -#ifdef __STDC__ gnuism(int n, ...) -#else -gnuism(n, va_alist) - int n; - va_dcl -#endif { va_list ap; int msg; -#ifdef __STDC__ va_start(ap, n); -#else - va_start(ap); -#endif if (sflag && !gflag) { verror(n, ap); msg = 1; diff --git a/usr.bin/xlint/lint1/param.h b/usr.bin/xlint/lint1/param.h index 17e266ebe2..26990555fd 100644 --- a/usr.bin/xlint/lint1/param.h +++ b/usr.bin/xlint/lint1/param.h @@ -29,6 +29,8 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $DragonFly: src/usr.bin/xlint/lint1/param.h,v 1.2 2004/07/07 08:20:18 asmodai Exp $ */ /* @@ -103,18 +105,9 @@ typedef u_long u_quad_t; /* * long double only in ANSI C. */ -#ifdef __STDC__ typedef long double ldbl_t; -#else -typedef double ldbl_t; -#endif /* * Some traditional compilers are not able to assign structures. */ -#ifdef __STDC__ #define STRUCT_ASSIGN(dest, src) (dest) = (src) -#else -#define STRUCT_ASSIGN(dest, src) (void)memcpy(&(dest), &(src), \ - sizeof (dest)); -#endif diff --git a/usr.bin/xlint/lint1/scan.l b/usr.bin/xlint/lint1/scan.l index a942e87a13..a881796388 100644 --- a/usr.bin/xlint/lint1/scan.l +++ b/usr.bin/xlint/lint1/scan.l @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: scan.l,v 1.8 1995/10/23 13:38:51 jpo Exp $ - * $DragonFly: src/usr.bin/xlint/lint1/scan.l,v 1.5 2004/06/19 18:55:48 joerg Exp $ + * $DragonFly: src/usr.bin/xlint/lint1/scan.l,v 1.6 2004/07/07 08:20:18 asmodai Exp $ */ #include @@ -831,11 +831,7 @@ getescc(d) if (tflag) /* \a undefined in traditional C */ warning(81); -#ifdef __STDC__ return ('\a'); -#else - return ('\007'); -#endif case 'b': return ('\b'); case 'f': @@ -850,11 +846,7 @@ getescc(d) if (tflag) /* \v undefined in traditional C */ warning(264); -#ifdef __STDC__ return ('\v'); -#else - return ('\013'); -#endif case '8': case '9': /* bad octal digit %c */ warning(77, c); diff --git a/usr.bin/xlint/lint2/msg.c b/usr.bin/xlint/lint2/msg.c index 9323a0ad6c..d2857d3f95 100644 --- a/usr.bin/xlint/lint2/msg.c +++ b/usr.bin/xlint/lint2/msg.c @@ -31,17 +31,13 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: msg.c,v 1.2 1995/07/03 21:24:56 cgd Exp $ - * $DragonFly: src/usr.bin/xlint/lint2/msg.c,v 1.4 2003/11/03 19:31:34 eirikn Exp $ + * $DragonFly: src/usr.bin/xlint/lint2/msg.c,v 1.5 2004/07/07 08:20:19 asmodai Exp $ */ #include #include -#ifdef __STDC__ #include -#else -#include -#endif #include "lint2.h" @@ -69,25 +65,12 @@ static const char *msgs[] = { static const char *basename(const char *); -#ifdef __STDC__ void msg(int n, ...) { -#else -void -msg(va_alist) - va_dcl - int n; -{ -#endif va_list ap; -#ifdef __STDC__ va_start(ap, n); -#else - va_start(ap); - n = va_arg(ap, int); -#endif (void)vprintf(msgs[n], ap); (void)printf("\n"); diff --git a/usr.bin/xlint/lint2/read.c b/usr.bin/xlint/lint2/read.c index 632c3d6b18..6e7d4534d5 100644 --- a/usr.bin/xlint/lint2/read.c +++ b/usr.bin/xlint/lint2/read.c @@ -31,7 +31,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $NetBSD: read.c,v 1.2 1995/07/03 21:24:59 cgd Exp $ - * $DragonFly: src/usr.bin/xlint/lint2/read.c,v 1.5 2004/06/19 18:55:48 joerg Exp $ + * $DragonFly: src/usr.bin/xlint/lint2/read.c,v 1.6 2004/07/07 08:20:19 asmodai Exp $ */ #include @@ -902,11 +902,7 @@ inpqstrg(src, epp) c = '\t'; break; case 'v': -#ifdef __STDC__ c = '\v'; -#else - c = '\013'; -#endif break; case 'b': c = '\b'; @@ -918,11 +914,7 @@ inpqstrg(src, epp) c = '\f'; break; case 'a': -#ifdef __STDC__ c = '\a'; -#else - c = '\007'; -#endif break; case '\\': c = '\\'; -- 2.41.0