From: jsg Date: Mon, 8 Apr 2024 02:51:14 +0000 (+0000) Subject: more ansi function decls X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=146262ea791a2220a609c41b0b0e51b0a23d9c67;p=openbsd more ansi function decls ok deraadt@ --- diff --git a/lib/libpcap/gencode.c b/lib/libpcap/gencode.c index ed688a4ba04..0feb2bd807b 100644 --- a/lib/libpcap/gencode.c +++ b/lib/libpcap/gencode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gencode.c,v 1.65 2024/04/05 18:01:56 deraadt Exp $ */ +/* $OpenBSD: gencode.c,v 1.66 2024/04/08 02:51:14 jsg Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998 @@ -262,7 +262,7 @@ gen_retblk(int v) } static __inline void -syntax() +syntax(void) { bpf_error("syntax error in filter expression"); } @@ -795,13 +795,13 @@ gen_uncond(int rsense) } static __inline struct block * -gen_true() +gen_true(void) { return gen_uncond(1); } static __inline struct block * -gen_false() +gen_false(void) { return gen_uncond(0); } @@ -971,7 +971,7 @@ gen_hostop(bpf_u_int32 addr, bpf_u_int32 mask, int dir, int proto, #ifdef INET6 static struct block * gen_hostop6(struct in6_addr *addr, struct in6_addr *mask, int dir, int proto, - u_int src_off, u_int dst_off) + u_int src_off, u_int dst_off) { struct block *b0, *b1; u_int offset; @@ -1345,11 +1345,7 @@ gen_host6(struct in6_addr *addr, struct in6_addr *mask, int proto, int dir) #ifndef INET6 static struct block * -gen_gateway(eaddr, alist, proto, dir) - const u_char *eaddr; - bpf_u_int32 **alist; - int proto; - int dir; +gen_gateway(const u_char *eaddr, bpf_u_int32 **alist, int proto, int dir) { struct block *b0, *b1, *tmp; @@ -1523,7 +1519,7 @@ gen_proto_abbrev(int proto) } static struct block * -gen_ipfrag() +gen_ipfrag(void) { struct slist *s, *tmp; struct block *b; @@ -2779,7 +2775,7 @@ gen_relation(int code, struct arth *a0, struct arth *a1, int reversed) } struct arth * -gen_loadlen() +gen_loadlen(void) { int regno = alloc_reg(); struct arth *a = (struct arth *)newchunk(sizeof(*a)); @@ -2795,7 +2791,7 @@ gen_loadlen() } struct arth * -gen_loadrnd() +gen_loadrnd(void) { int regno = alloc_reg(); struct arth *a = (struct arth *)newchunk(sizeof(*a)); @@ -2882,7 +2878,7 @@ static int curreg; * Return the next free register. */ static int -alloc_reg() +alloc_reg(void) { int n = BPF_MEMWORDS; diff --git a/lib/libpcap/grammar.y b/lib/libpcap/grammar.y index 0c7db1641ef..40d7207cec5 100644 --- a/lib/libpcap/grammar.y +++ b/lib/libpcap/grammar.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: grammar.y,v 1.23 2021/12/01 18:28:45 deraadt Exp $ */ +/* $OpenBSD: grammar.y,v 1.24 2024/04/08 02:51:14 jsg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996 @@ -68,7 +68,7 @@ yyerror(char *msg) int yyparse(void); int -pcap_parse() +pcap_parse(void) { return (yyparse()); } diff --git a/lib/libpcap/optimize.c b/lib/libpcap/optimize.c index 873b41fcda8..c0d3a86304c 100644 --- a/lib/libpcap/optimize.c +++ b/lib/libpcap/optimize.c @@ -1,4 +1,4 @@ -/* $OpenBSD: optimize.c,v 1.22 2024/04/05 18:01:56 deraadt Exp $ */ +/* $OpenBSD: optimize.c,v 1.23 2024/04/08 02:51:14 jsg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994, 1995, 1996 @@ -510,7 +510,7 @@ struct valnode *vnode_base; struct valnode *next_vnode; static void -init_val() +init_val(void) { curval = 0; next_vnode = vnode_base; @@ -1664,7 +1664,7 @@ intern_blocks(struct block *root) } static void -opt_cleanup() +opt_cleanup(void) { free((void *)vnode_base); free((void *)vmap); @@ -2062,8 +2062,7 @@ icode_to_fcode(struct block *root, int *lenp) #ifdef BDEBUG static void -opt_dump(root) - struct block *root; +opt_dump(struct block *root) { struct bpf_program f; diff --git a/lib/libpcap/scanner.l b/lib/libpcap/scanner.l index c1e991c5a44..6ee53082379 100644 --- a/lib/libpcap/scanner.l +++ b/lib/libpcap/scanner.l @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: scanner.l,v 1.29 2024/04/05 18:01:56 deraadt Exp $ */ +/* $OpenBSD: scanner.l,v 1.30 2024/04/08 02:51:14 jsg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -328,7 +328,7 @@ lex_init(const char *buf) * define a macro to map this identifier to pcap_wrap. */ int -yywrap() +yywrap(void) { return 1; }