From 8df16311baa2cd3a82455b5665c805fe08a213fc Mon Sep 17 00:00:00 2001 From: tholo Date: Mon, 16 Sep 1996 02:33:04 +0000 Subject: [PATCH] Use __inline --- lib/libpcap/etherent.c | 14 +++++++------- lib/libpcap/gencode.c | 22 +++++++++++----------- lib/libpcap/nametoaddr.c | 9 ++++++--- lib/libpcap/optimize.c | 18 +++++++++--------- lib/libpcap/pcap-bpf.c | 4 ++-- 5 files changed, 35 insertions(+), 32 deletions(-) diff --git a/lib/libpcap/etherent.c b/lib/libpcap/etherent.c index 29af870e021..4e2f4fb8f56 100644 --- a/lib/libpcap/etherent.c +++ b/lib/libpcap/etherent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: etherent.c,v 1.4 1996/07/12 13:19:07 mickey Exp $ */ +/* $OpenBSD: etherent.c,v 1.5 1996/09/16 02:33:04 tholo Exp $ */ /* * Copyright (c) 1990, 1993, 1994, 1995 @@ -40,12 +40,12 @@ static char rcsid[] = #include "pcap-int.h" -static inline int xdtoi(int); -static inline int skip_space(FILE *); -static inline int skip_line(FILE *); +static __inline int xdtoi(int); +static __inline int skip_space(FILE *); +static __inline int skip_line(FILE *); /* Hex digit to integer. */ -static inline int +static __inline int xdtoi(c) register int c; { @@ -57,7 +57,7 @@ xdtoi(c) return c - 'A' + 10; } -static inline int +static __inline int skip_space(f) FILE *f; { @@ -70,7 +70,7 @@ skip_space(f) return c; } -static inline int +static __inline int skip_line(f) FILE *f; { diff --git a/lib/libpcap/gencode.c b/lib/libpcap/gencode.c index 9de3d47193c..2f3d1b225e6 100644 --- a/lib/libpcap/gencode.c +++ b/lib/libpcap/gencode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gencode.c,v 1.4 1996/07/12 13:19:08 mickey Exp $ */ +/* $OpenBSD: gencode.c,v 1.5 1996/09/16 02:33:05 tholo Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996 @@ -137,10 +137,10 @@ static int cur_chunk; static void *newchunk(u_int); static void freechunks(void); -static inline struct block *new_block(int); -static inline struct slist *new_stmt(int); +static __inline struct block *new_block(int); +static __inline struct slist *new_stmt(int); static struct block *gen_retblk(int); -static inline void syntax(void); +static __inline void syntax(void); static void backpatch(struct block *, struct block *); static void merge(struct block *, struct block *); @@ -148,8 +148,8 @@ static struct block *gen_cmp(u_int, u_int, bpf_int32); static struct block *gen_mcmp(u_int, u_int, bpf_int32, bpf_u_int32); static struct block *gen_bcmp(u_int, u_int, u_char *); static struct block *gen_uncond(int); -static inline struct block *gen_true(void); -static inline struct block *gen_false(void); +static __inline struct block *gen_true(void); +static __inline struct block *gen_false(void); static struct block *gen_linktype(int); static struct block *gen_hostop(bpf_u_int32, bpf_u_int32, int, int, u_int, u_int); static struct block *gen_ehostop(u_char *, int); @@ -220,7 +220,7 @@ sdup(s) return (cp); } -static inline struct block * +static __inline struct block * new_block(code) int code; { @@ -233,7 +233,7 @@ new_block(code) return p; } -static inline struct slist * +static __inline struct slist * new_stmt(code) int code; { @@ -255,7 +255,7 @@ gen_retblk(v) return b; } -static inline void +static __inline void syntax() { bpf_error("syntax error in filter expression"); @@ -547,13 +547,13 @@ gen_uncond(rsense) return b; } -static inline struct block * +static __inline struct block * gen_true() { return gen_uncond(1); } -static inline struct block * +static __inline struct block * gen_false() { return gen_uncond(0); diff --git a/lib/libpcap/nametoaddr.c b/lib/libpcap/nametoaddr.c index 5da21a46875..f16e39a5c8f 100644 --- a/lib/libpcap/nametoaddr.c +++ b/lib/libpcap/nametoaddr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nametoaddr.c,v 1.4 1996/07/12 13:19:09 mickey Exp $ */ +/* $OpenBSD: nametoaddr.c,v 1.5 1996/09/16 02:33:06 tholo Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996 @@ -63,7 +63,7 @@ struct rtentry; #define NTOHS(x) (x) = ntohs(x) #endif -static inline int xdtoi(int); +static __inline int xdtoi(int); /* * Convert host name to internet address. @@ -216,7 +216,7 @@ pcap_nametoeproto(const char *s) } /* Hex digit to integer. */ -static inline int +static __inline int xdtoi(c) register int c; { @@ -364,5 +364,8 @@ __pcap_nametodnaddr(const char *name) #else bpf_error("decnet name support not included, '%s' cannot be translated\n", name); +#ifdef lint + return 0; +#endif #endif } diff --git a/lib/libpcap/optimize.c b/lib/libpcap/optimize.c index 70d105b4b7c..d3c420b6e45 100644 --- a/lib/libpcap/optimize.c +++ b/lib/libpcap/optimize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: optimize.c,v 1.4 1996/07/12 13:19:10 mickey Exp $ */ +/* $OpenBSD: optimize.c,v 1.5 1996/09/16 02:33:07 tholo Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994, 1995, 1996 @@ -99,19 +99,19 @@ static void compute_local_ud(struct block *); static void find_ud(struct block *); static void init_val(void); static int F(int, int, int); -static inline void vstore(struct stmt *, int *, int, int); +static __inline void vstore(struct stmt *, int *, int, int); static void opt_blk(struct block *, int); static int use_conflict(struct block *, struct block *); static void opt_j(struct edge *); static void or_pullup(struct block *); static void and_pullup(struct block *); static void opt_blks(struct block *, int); -static inline void link_inedge(struct edge *, struct block *); +static __inline void link_inedge(struct edge *, struct block *); static void find_inedges(struct block *); static void opt_root(struct block **); static void opt_loop(struct block *, int); static void fold_op(struct stmt *, int, int); -static inline struct slist *this_op(struct slist *); +static __inline struct slist *this_op(struct slist *); static void opt_not(struct block *); static void opt_peep(struct block *); static void opt_stmt(struct stmt *, int[], int); @@ -121,7 +121,7 @@ static void opt_blk(struct block *, int); static int use_conflict(struct block *, struct block *); static void opt_j(struct edge *); static struct block *fold_edge(struct block *, struct edge *); -static inline int eq_blk(struct block *, struct block *); +static __inline int eq_blk(struct block *, struct block *); static int slength(struct slist *); static int count_blocks(struct block *); static void number_blks_r(struct block *); @@ -565,7 +565,7 @@ F(code, v0, v1) return val; } -static inline void +static __inline void vstore(s, valp, newval, alter) struct stmt *s; int *valp; @@ -635,7 +635,7 @@ fold_op(s, v0, v1) done = 0; } -static inline struct slist * +static __inline struct slist * this_op(s) struct slist *s; { @@ -1500,7 +1500,7 @@ opt_blks(root, do_stmts) } } -static inline void +static __inline void link_inedge(parent, child) struct edge *parent; struct block *child; @@ -1650,7 +1650,7 @@ eq_slist(x, y) } } -static inline int +static __inline int eq_blk(b0, b1) struct block *b0, *b1; { diff --git a/lib/libpcap/pcap-bpf.c b/lib/libpcap/pcap-bpf.c index 4251f8942f5..91234201596 100644 --- a/lib/libpcap/pcap-bpf.c +++ b/lib/libpcap/pcap-bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcap-bpf.c,v 1.6 1996/07/12 13:19:10 mickey Exp $ */ +/* $OpenBSD: pcap-bpf.c,v 1.7 1996/09/16 02:33:08 tholo Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 @@ -137,7 +137,7 @@ pcap_inject(pcap_t *p, const void *buf, size_t len) return (write(p->fd, buf, len)); } -static inline int +static __inline int bpf_open(pcap_t *p, char *errbuf) { int fd; -- 2.20.1