aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2021-01-15 04:32:16 +0000
committerCy Schubert <cy@FreeBSD.org>2021-01-25 22:46:45 +0000
commit83edbc3cb54fba6b37a68270c232df7b785bd222 (patch)
tree244dfc59f7c5c5decc098d51947130a108457e21 /contrib
parente7cf562a40fc093df054bd7fa6f34746069a984a (diff)
downloadsrc-83edbc3cb54fba6b37a68270c232df7b785bd222.tar.gz
src-83edbc3cb54fba6b37a68270c232df7b785bd222.zip
ipfilter: Retire pre-standard C support.
All C compilers in 2021 support standard C and architectures that did not were retired long ago. Simplify by removing now redundant pre-standard C code. MFC after: 1 week
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ipfilter/bpf-ipf.h12
-rw-r--r--contrib/ipfilter/ipf.h8
-rw-r--r--contrib/ipfilter/iplang/iplang_l.l4
-rw-r--r--contrib/ipfilter/ipsend/ipsend.h4
-rw-r--r--contrib/ipfilter/ipsend/ipsopt.c4
-rw-r--r--contrib/ipfilter/kmem.h4
-rw-r--r--contrib/ipfilter/lib/debug.c23
-rw-r--r--contrib/ipfilter/lib/facpri.h4
-rw-r--r--contrib/ipfilter/lib/inet_addr.c4
-rw-r--r--contrib/ipfilter/lib/kmem.c4
-rw-r--r--contrib/ipfilter/lib/kmem.h4
-rw-r--r--contrib/ipfilter/lib/verbose.c16
-rw-r--r--contrib/ipfilter/md5.c4
-rw-r--r--contrib/ipfilter/md5.h8
-rw-r--r--contrib/ipfilter/opts.h4
15 files changed, 4 insertions, 103 deletions
diff --git a/contrib/ipfilter/bpf-ipf.h b/contrib/ipfilter/bpf-ipf.h
index dc2b660e2eee..a114949de6e0 100644
--- a/contrib/ipfilter/bpf-ipf.h
+++ b/contrib/ipfilter/bpf-ipf.h
@@ -420,25 +420,13 @@ struct bpf_insn {
* Systems based on non-BSD kernels don't have ifnet's (or they don't mean
* anything if it is in <net/if.h>) and won't work like this.
*/
-# if __STDC__
extern void bpf_tap(struct ifnet *, u_char *, u_int);
extern void bpf_mtap(struct ifnet *, struct mbuf *);
extern void bpfattach(struct ifnet *, u_int, u_int);
extern void bpfilterattach(int);
-# else
-extern void bpf_tap();
-extern void bpf_mtap();
-extern void bpfattach();
-extern void bpfilterattach();
-# endif /* __STDC__ */
#endif /* BSD && (_KERNEL || KERNEL) */
-#if __STDC__ || defined(__cplusplus)
extern int bpf_validate(struct bpf_insn *, int);
extern u_int bpf_filter(struct bpf_insn *, u_char *, u_int, u_int);
-#else
-extern int bpf_validate();
-extern u_int bpf_filter();
-#endif
/*
* Number of scratch memory words (for BPF_LD|BPF_MEM and BPF_ST).
diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h
index 05dcfa4afd64..834ba83f51f0 100644
--- a/contrib/ipfilter/ipf.h
+++ b/contrib/ipfilter/ipf.h
@@ -73,15 +73,7 @@
#include "opts.h"
#ifndef __P
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
-#endif
-#ifndef __STDC__
-# undef const
-# define const
#endif
#ifndef U_32_T
diff --git a/contrib/ipfilter/iplang/iplang_l.l b/contrib/ipfilter/iplang/iplang_l.l
index 0002db151c81..e66867e2a455 100644
--- a/contrib/ipfilter/iplang/iplang_l.l
+++ b/contrib/ipfilter/iplang/iplang_l.l
@@ -21,11 +21,7 @@
#include "ipf.h"
#ifndef __P
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
#endif
extern int opts;
diff --git a/contrib/ipfilter/ipsend/ipsend.h b/contrib/ipfilter/ipsend/ipsend.h
index f409e89c656e..22f85ff07f14 100644
--- a/contrib/ipfilter/ipsend/ipsend.h
+++ b/contrib/ipfilter/ipsend/ipsend.h
@@ -16,11 +16,7 @@
*
*/
#ifndef __P
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
#endif
#include <net/if.h>
diff --git a/contrib/ipfilter/ipsend/ipsopt.c b/contrib/ipfilter/ipsend/ipsopt.c
index 7f9ab5e32d79..ce6616525ca1 100644
--- a/contrib/ipfilter/ipsend/ipsopt.c
+++ b/contrib/ipfilter/ipsend/ipsopt.c
@@ -27,11 +27,7 @@ static const char rcsid[] = "@(#)$Id$";
#ifndef __P
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
#endif
diff --git a/contrib/ipfilter/kmem.h b/contrib/ipfilter/kmem.h
index ce6ad56f52d9..ea21c052599f 100644
--- a/contrib/ipfilter/kmem.h
+++ b/contrib/ipfilter/kmem.h
@@ -11,11 +11,7 @@
#define __KMEM_H__
#ifndef __P
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
#endif
extern int openkmem __P((char *, char *));
extern int kmemcpy __P((char *, long, int));
diff --git a/contrib/ipfilter/lib/debug.c b/contrib/ipfilter/lib/debug.c
index 02e5f5b48775..0e3276e21705 100644
--- a/contrib/ipfilter/lib/debug.c
+++ b/contrib/ipfilter/lib/debug.c
@@ -8,11 +8,7 @@
* $Id$
*/
-#if defined(__STDC__)
# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
#include <stdio.h>
#include "ipf.h"
@@ -21,14 +17,8 @@
int debuglevel = 0;
-#ifdef __STDC__
-void debug(int level, char *fmt, ...)
-#else
-void debug(level, fmt, va_alist)
- int level;
- char *fmt;
- va_dcl
-#endif
+void
+debug(int level, char *fmt, ...)
{
va_list pvar;
@@ -40,13 +30,8 @@ void debug(level, fmt, va_alist)
}
-#ifdef __STDC__
-void ipfkdebug(char *fmt, ...)
-#else
-void ipfkdebug(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
+void
+ipfkdebug(char *fmt, ...)
{
va_list pvar;
diff --git a/contrib/ipfilter/lib/facpri.h b/contrib/ipfilter/lib/facpri.h
index 54ecabd6ce49..d3634e99d795 100644
--- a/contrib/ipfilter/lib/facpri.h
+++ b/contrib/ipfilter/lib/facpri.h
@@ -13,11 +13,7 @@
#ifndef __P
# define P_DEF
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
#endif
extern char *fac_toname __P((int));
diff --git a/contrib/ipfilter/lib/inet_addr.c b/contrib/ipfilter/lib/inet_addr.c
index 8667c2b33038..fcaefe0fc23e 100644
--- a/contrib/ipfilter/lib/inet_addr.c
+++ b/contrib/ipfilter/lib/inet_addr.c
@@ -66,11 +66,7 @@ static const char rcsid[] = "@(#)$Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20
#include <ctype.h>
#ifndef __P
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
#endif
int inet_aton __P((const char *, struct in_addr *));
diff --git a/contrib/ipfilter/lib/kmem.c b/contrib/ipfilter/lib/kmem.c
index de97512cf5d3..26252a02f0bf 100644
--- a/contrib/ipfilter/lib/kmem.c
+++ b/contrib/ipfilter/lib/kmem.c
@@ -30,10 +30,6 @@
#include "kmem.h"
-#ifndef __STDC__
-# define const
-#endif
-
#if !defined(lint)
static const char sccsid[] = "@(#)kmem.c 1.4 1/12/96 (C) 1992 Darren Reed";
static const char rcsid[] = "@(#)$Id$";
diff --git a/contrib/ipfilter/lib/kmem.h b/contrib/ipfilter/lib/kmem.h
index 1abe31a3b7fb..31cd9725cc62 100644
--- a/contrib/ipfilter/lib/kmem.h
+++ b/contrib/ipfilter/lib/kmem.h
@@ -11,11 +11,7 @@
#define __KMEM_H__
#ifndef __P
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
#endif
extern int openkmem __P((char *, char *));
extern int kmemcpy __P((char *, long, int));
diff --git a/contrib/ipfilter/lib/verbose.c b/contrib/ipfilter/lib/verbose.c
index 710daab443e3..47988c084516 100644
--- a/contrib/ipfilter/lib/verbose.c
+++ b/contrib/ipfilter/lib/verbose.c
@@ -8,24 +8,14 @@
* $Id$
*/
-#if defined(__STDC__)
# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
#include <stdio.h>
#include "ipf.h"
#include "opts.h"
-#if defined(__STDC__)
void verbose(int level, char *fmt, ...)
-#else
-void verbose(level, fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
va_list pvar;
@@ -37,13 +27,7 @@ void verbose(level, fmt, va_alist)
}
-#if defined(__STDC__)
void ipfkverbose(char *fmt, ...)
-#else
-void ipfkverbose(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
va_list pvar;
diff --git a/contrib/ipfilter/md5.c b/contrib/ipfilter/md5.c
index 6ac639935902..d2ed954576d3 100644
--- a/contrib/ipfilter/md5.c
+++ b/contrib/ipfilter/md5.c
@@ -100,11 +100,7 @@ static unsigned char PADDING[64] = {
(a) += (b); \
}
-#ifdef __STDC__
#define UL(x) x##U
-#else
-#define UL(x) x
-#endif
/* The routine MD5Init initializes the message-digest context
mdContext. All fields are set to zero.
diff --git a/contrib/ipfilter/md5.h b/contrib/ipfilter/md5.h
index 914df74355a0..cc09b48e8547 100644
--- a/contrib/ipfilter/md5.h
+++ b/contrib/ipfilter/md5.h
@@ -42,15 +42,7 @@
#if !defined(__MD5_INCLUDE__) && !defined(_SYS_MD5_H)
#ifndef __P
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
-#endif
-#ifndef __STDC__
-# undef const
-# define const
#endif
/* typedef a 32-bit type */
diff --git a/contrib/ipfilter/opts.h b/contrib/ipfilter/opts.h
index 6e973186756e..17844e89ecfc 100644
--- a/contrib/ipfilter/opts.h
+++ b/contrib/ipfilter/opts.h
@@ -54,11 +54,7 @@
#ifndef __P
-# ifdef __STDC__
# define __P(x) x
-# else
-# define __P(x) ()
-# endif
#endif
#if defined(sun) && !SOLARIS