From: Guy Harris Date: Tue, 20 Mar 2018 19:06:05 +0000 (-0700) Subject: Don't use old-style function definitions. X-Git-Tag: libpcap-1.9-bp~212 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/c910b2858b5963c7f8fc471411f2fa9bb3d93920 Don't use old-style function definitions. --- diff --git a/bpf_image.c b/bpf_image.c index caaa8ceb..91c1d393 100644 --- a/bpf_image.c +++ b/bpf_image.c @@ -35,9 +35,7 @@ #endif char * -bpf_image(p, n) - const struct bpf_insn *p; - int n; +bpf_image(const struct bpf_insn *p, int n) { int v; const char *fmt, *op; diff --git a/etherent.c b/etherent.c index 237a7fb2..f9bb99c2 100644 --- a/etherent.c +++ b/etherent.c @@ -44,8 +44,7 @@ static inline int skip_line(FILE *); /* Hex digit to integer. */ static inline int -xdtoi(c) - register int c; +xdtoi(int c) { if (isdigit(c)) return c - '0'; @@ -56,8 +55,7 @@ xdtoi(c) } static inline int -skip_space(f) - FILE *f; +skip_space(FILE *f) { int c; @@ -69,8 +67,7 @@ skip_space(f) } static inline int -skip_line(f) - FILE *f; +skip_line(FILE *f) { int c; diff --git a/gencode.c b/gencode.c index a39ce756..7ab707fd 100644 --- a/gencode.c +++ b/gencode.c @@ -817,8 +817,7 @@ pcap_freecode(struct bpf_program *program) * in each block is already resolved. */ static void -backpatch(list, target) - struct block *list, *target; +backpatch(struct block *list, struct block *target) { struct block *next; @@ -839,8 +838,7 @@ backpatch(list, target) * which of jt and jf is the link. */ static void -merge(b0, b1) - struct block *b0, *b1; +merge(struct block *b0, struct block *b1) { register struct block **p = &b0; @@ -902,8 +900,7 @@ finish_parse(compiler_state_t *cstate, struct block *p) } void -gen_and(b0, b1) - struct block *b0, *b1; +gen_and(struct block *b0, struct block *b1) { backpatch(b0, b1->head); b0->sense = !b0->sense; @@ -914,8 +911,7 @@ gen_and(b0, b1) } void -gen_or(b0, b1) - struct block *b0, *b1; +gen_or(struct block *b0, struct block *b1) { b0->sense = !b0->sense; backpatch(b0, b1->head); @@ -925,8 +921,7 @@ gen_or(b0, b1) } void -gen_not(b) - struct block *b; +gen_not(struct block *b) { b->sense = !b->sense; } @@ -2928,8 +2923,7 @@ gen_abs_offset_varpart(compiler_state_t *cstate, bpf_abs_offset *off) * Map an Ethernet type to the equivalent PPP type. */ static int -ethertype_to_ppptype(proto) - int proto; +ethertype_to_ppptype(int proto) { switch (proto) { @@ -5771,9 +5765,7 @@ lookup_proto(compiler_state_t *cstate, const char *name, int proto) #if 0 struct stmt * -gen_joinsp(s, n) - struct stmt **s; - int n; +gen_joinsp(struct stmt **s, int n) { return NULL; } @@ -6875,8 +6867,7 @@ gen_ecode(compiler_state_t *cstate, const u_char *eaddr, struct qual q) } void -sappend(s0, s1) - struct slist *s0, *s1; +sappend(struct slist *s0, struct slist *s1) { /* * This is definitely not the best way to do this, but the diff --git a/nametoaddr.c b/nametoaddr.c index e7b7134e..537d6a34 100644 --- a/nametoaddr.c +++ b/nametoaddr.c @@ -613,8 +613,7 @@ pcap_nametollc(const char *s) /* Hex digit to integer. */ static inline int -xdtoi(c) - register int c; +xdtoi(int c) { if (isdigit(c)) return c - '0';