diff options
author | phk <phk@FreeBSD.org> | 2000-10-27 11:45:49 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-10-27 11:45:49 +0000 |
commit | 54ca48450cf20c453a092aa95d086cd5c5751fcf (patch) | |
tree | 479cfa046c848adf9e8ada76b004eeda743154db /sys/netinet | |
parent | ea5581599fd86937f5f773c8e66aedd6a3524383 (diff) | |
download | FreeBSD-src-54ca48450cf20c453a092aa95d086cd5c5751fcf.zip FreeBSD-src-54ca48450cf20c453a092aa95d086cd5c5751fcf.tar.gz |
Convert all users of fldoff() to offsetof(). fldoff() is bad
because it only takes a struct tag which makes it impossible to
use unions, typedefs etc.
Define __offsetof() in <machine/ansi.h>
Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h>
Remove myriad of local offsetof() definitions.
Remove includes of <stddef.h> in kernel code.
NB: Kernelcode should *never* include from /usr/include !
Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API.
Deprecate <struct.h> with a warning. The warning turns into an error on
01-12-2000 and the file gets removed entirely on 01-01-2001.
Paritials reviews by: various.
Significant brucifications by: bde
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in_gif.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 2 | ||||
-rw-r--r-- | sys/netinet/tcp_output.c | 2 | ||||
-rw-r--r-- | sys/netinet/tcp_subr.c | 1 | ||||
-rw-r--r-- | sys/netinet/tcp_timewait.c | 1 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 1 |
6 files changed, 0 insertions, 11 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index bce267c..a27339b 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -81,10 +81,6 @@ int ip_gif_ttl = 0; SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW, &ip_gif_ttl, 0, ""); -#ifndef offsetof -#define offsetof(s, e) ((int)&((s *)0)->e) -#endif - int in_gif_output(ifp, family, m, rt) struct ifnet *ifp; diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index ed68439..0405b96 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -45,8 +45,6 @@ #include "opt_ipsec.h" #include "opt_pfil_hooks.h" -#include <stddef.h> - #include <sys/param.h> #include <sys/systm.h> #include <sys/mbuf.h> diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index ce5f13b..9ffbf58 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -38,8 +38,6 @@ #include "opt_ipsec.h" #include "opt_tcpdebug.h" -#include <stddef.h> - #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 25c9b66..c3616a5 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -39,7 +39,6 @@ #include "opt_ipsec.h" #include "opt_tcpdebug.h" -#include <stddef.h> #include <sys/param.h> #include <sys/systm.h> #include <sys/callout.h> diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 25c9b66..c3616a5 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -39,7 +39,6 @@ #include "opt_ipsec.h" #include "opt_tcpdebug.h" -#include <stddef.h> #include <sys/param.h> #include <sys/systm.h> #include <sys/callout.h> diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 07b1166..f357905 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -37,7 +37,6 @@ #include "opt_ipsec.h" #include "opt_inet6.h" -#include <stddef.h> #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> |