From: jsg Date: Fri, 5 Mar 2021 09:21:08 +0000 (+0000) Subject: ansi X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=361206c243c03bb9b4b391f76b791250fa14ed98;p=openbsd ansi --- diff --git a/sys/net/bsd-comp.c b/sys/net/bsd-comp.c index 16aeae4409a..cd843c7415d 100644 --- a/sys/net/bsd-comp.c +++ b/sys/net/bsd-comp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bsd-comp.c,v 1.16 2018/11/09 14:14:31 claudio Exp $ */ +/* $OpenBSD: bsd-comp.c,v 1.17 2021/03/05 09:21:08 jsg Exp $ */ /* $NetBSD: bsd-comp.c,v 1.6 1996/10/13 02:10:58 christos Exp $ */ /* Because this code is derived from the 4.3BSD compress source: @@ -193,8 +193,7 @@ static int bsd_init(struct bsd_db *, u_char *, int, int, int, int, * clear the dictionary */ static void -bsd_clear(db) - struct bsd_db *db; +bsd_clear(struct bsd_db *db) { db->clear_count++; db->max_ent = FIRST-1; @@ -220,8 +219,7 @@ bsd_clear(db) * must compute the same ratio. */ static int /* 1=output CLEAR */ -bsd_check(db) - struct bsd_db *db; +bsd_check(struct bsd_db *db) { u_int new_ratio; @@ -261,9 +259,7 @@ bsd_check(db) * Return statistics. */ static void -bsd_comp_stats(state, stats) - void *state; - struct compstat *stats; +bsd_comp_stats(void *state, struct compstat *stats) { struct bsd_db *db = (struct bsd_db *) state; u_int out; @@ -288,8 +284,7 @@ bsd_comp_stats(state, stats) * Reset state, as on a CCP ResetReq. */ static void -bsd_reset(state) - void *state; +bsd_reset(void *state) { struct bsd_db *db = (struct bsd_db *) state; @@ -302,9 +297,7 @@ bsd_reset(state) * Allocate space for a (de) compressor. */ static void * -bsd_alloc(options, opt_len, decomp) - u_char *options; - int opt_len, decomp; +bsd_alloc(u_char *options, int opt_len, int decomp) { int bits; u_int newlen, hsize, hshift, maxmaxcode; @@ -370,8 +363,7 @@ bsd_alloc(options, opt_len, decomp) } static void -bsd_free(state) - void *state; +bsd_free(void *state) { struct bsd_db *db = (struct bsd_db *) state; @@ -381,17 +373,13 @@ bsd_free(state) } static void * -bsd_comp_alloc(options, opt_len) - u_char *options; - int opt_len; +bsd_comp_alloc(u_char *options, int opt_len) { return bsd_alloc(options, opt_len, 0); } static void * -bsd_decomp_alloc(options, opt_len) - u_char *options; - int opt_len; +bsd_decomp_alloc(u_char *options, int opt_len) { return bsd_alloc(options, opt_len, 1); } @@ -400,10 +388,8 @@ bsd_decomp_alloc(options, opt_len) * Initialize the database. */ static int -bsd_init(db, options, opt_len, unit, hdrlen, mru, debug, decomp) - struct bsd_db *db; - u_char *options; - int opt_len, unit, hdrlen, mru, debug, decomp; +bsd_init(struct bsd_db *db, u_char *options, int opt_len, int unit, int hdrlen, + int mru, int debug, int decomp) { int i; @@ -439,20 +425,16 @@ bsd_init(db, options, opt_len, unit, hdrlen, mru, debug, decomp) } static int -bsd_comp_init(state, options, opt_len, unit, hdrlen, debug) - void *state; - u_char *options; - int opt_len, unit, hdrlen, debug; +bsd_comp_init(void *state, u_char *options, int opt_len, int unit, int hdrlen, + int debug) { return bsd_init((struct bsd_db *) state, options, opt_len, unit, hdrlen, 0, debug, 0); } static int -bsd_decomp_init(state, options, opt_len, unit, hdrlen, mru, debug) - void *state; - u_char *options; - int opt_len, unit, hdrlen, mru, debug; +bsd_decomp_init(void *state, u_char *options, int opt_len, int unit, int hdrlen, + int mru, int debug) { return bsd_init((struct bsd_db *) state, options, opt_len, unit, hdrlen, mru, debug, 1); @@ -465,12 +447,11 @@ bsd_decomp_init(state, options, opt_len, unit, hdrlen, mru, debug) * code size expands, we do not output a bunch of padding. */ int /* new slen */ -bsd_compress(state, mret, mp, slen, maxolen) - void *state; - struct mbuf **mret; /* return compressed mbuf chain here */ - struct mbuf *mp; /* from here */ - int slen; /* uncompressed length */ - int maxolen; /* max compressed length */ +bsd_compress(void *state, + struct mbuf **mret, /* return compressed mbuf chain here */ + struct mbuf *mp, /* from here */ + int slen, /* uncompressed length */ + int maxolen) /* max compressed length */ { struct bsd_db *db = (struct bsd_db *) state; int hshift = db->hshift; @@ -680,9 +661,7 @@ bsd_compress(state, mret, mp, slen, maxolen) * incompressible data by pretending to compress the incoming data. */ static void -bsd_incomp(state, dmsg) - void *state; - struct mbuf *dmsg; +bsd_incomp(void *state, struct mbuf *dmsg) { struct bsd_db *db = (struct bsd_db *) state; u_int hshift = db->hshift; @@ -811,9 +790,7 @@ bsd_incomp(state, dmsg) * compression, even though they are detected by inspecting the input. */ int -bsd_decompress(state, cmp, dmpp) - void *state; - struct mbuf *cmp, **dmpp; +bsd_decompress(void *state, struct mbuf *cmp, struct mbuf **dmpp) { struct bsd_db *db = (struct bsd_db *) state; u_int max_ent = db->max_ent; diff --git a/sys/net/ppp-deflate.c b/sys/net/ppp-deflate.c index 05bdb5d2aa0..a5c9e58692b 100644 --- a/sys/net/ppp-deflate.c +++ b/sys/net/ppp-deflate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ppp-deflate.c,v 1.15 2018/11/09 14:14:31 claudio Exp $ */ +/* $OpenBSD: ppp-deflate.c,v 1.16 2021/03/05 09:21:08 jsg Exp $ */ /* $NetBSD: ppp-deflate.c,v 1.1 1996/03/15 02:28:09 paulus Exp $ */ /* @@ -124,9 +124,7 @@ struct compressor ppp_deflate_draft = { * Space allocation and freeing routines for use by zlib routines. */ void * -zcalloc(notused, items, size) - void *notused; - u_int items, size; +zcalloc(void *notused, u_int items, u_int size) { void *ptr; @@ -135,9 +133,7 @@ zcalloc(notused, items, size) } void -zcfree(notused, ptr) - void *notused; - void *ptr; +zcfree(void *notused, void *ptr) { free(ptr, M_DEVBUF, 0); } @@ -146,9 +142,7 @@ zcfree(notused, ptr) * Allocate space for a compressor. */ static void * -z_comp_alloc(options, opt_len) - u_char *options; - int opt_len; +z_comp_alloc(u_char *options, int opt_len) { struct deflate_state *state; int w_size; @@ -182,8 +176,7 @@ z_comp_alloc(options, opt_len) } static void -z_comp_free(arg) - void *arg; +z_comp_free(void *arg) { struct deflate_state *state = (struct deflate_state *) arg; @@ -192,10 +185,8 @@ z_comp_free(arg) } static int -z_comp_init(arg, options, opt_len, unit, hdrlen, debug) - void *arg; - u_char *options; - int opt_len, unit, hdrlen, debug; +z_comp_init(void *arg, u_char *options, int opt_len, int unit, int hdrlen, + int debug) { struct deflate_state *state = (struct deflate_state *) arg; @@ -218,8 +209,7 @@ z_comp_init(arg, options, opt_len, unit, hdrlen, debug) } static void -z_comp_reset(arg) - void *arg; +z_comp_reset(void *arg) { struct deflate_state *state = (struct deflate_state *) arg; @@ -228,11 +218,10 @@ z_comp_reset(arg) } int -z_compress(arg, mret, mp, orig_len, maxolen) - void *arg; - struct mbuf **mret; /* compressed packet (out) */ - struct mbuf *mp; /* uncompressed packet (in) */ - int orig_len, maxolen; +z_compress(void *arg, + struct mbuf **mret, /* compressed packet (out) */ + struct mbuf *mp, /* uncompressed packet (in) */ + int orig_len, int maxolen) { struct deflate_state *state = (struct deflate_state *) arg; u_char *rptr, *wptr; @@ -354,9 +343,7 @@ z_compress(arg, mret, mp, orig_len, maxolen) } static void -z_comp_stats(arg, stats) - void *arg; - struct compstat *stats; +z_comp_stats(void *arg, struct compstat *stats) { struct deflate_state *state = (struct deflate_state *) arg; u_int out; @@ -376,9 +363,7 @@ z_comp_stats(arg, stats) * Allocate space for a decompressor. */ static void * -z_decomp_alloc(options, opt_len) - u_char *options; - int opt_len; +z_decomp_alloc(u_char *options, int opt_len) { struct deflate_state *state; int w_size; @@ -411,8 +396,7 @@ z_decomp_alloc(options, opt_len) } static void -z_decomp_free(arg) - void *arg; +z_decomp_free(void *arg) { struct deflate_state *state = (struct deflate_state *) arg; @@ -421,10 +405,8 @@ z_decomp_free(arg) } static int -z_decomp_init(arg, options, opt_len, unit, hdrlen, mru, debug) - void *arg; - u_char *options; - int opt_len, unit, hdrlen, mru, debug; +z_decomp_init(void *arg, u_char *options, int opt_len, int unit, int hdrlen, + int mru, int debug) { struct deflate_state *state = (struct deflate_state *) arg; @@ -448,8 +430,7 @@ z_decomp_init(arg, options, opt_len, unit, hdrlen, mru, debug) } static void -z_decomp_reset(arg) - void *arg; +z_decomp_reset(void *arg) { struct deflate_state *state = (struct deflate_state *) arg; @@ -474,9 +455,7 @@ z_decomp_reset(arg) * compression, even though they are detected by inspecting the input. */ int -z_decompress(arg, mi, mop) - void *arg; - struct mbuf *mi, **mop; +z_decompress(void *arg, struct mbuf *mi, struct mbuf **mop) { struct deflate_state *state = (struct deflate_state *) arg; struct mbuf *mo, *mo_head; @@ -622,9 +601,7 @@ z_decompress(arg, mi, mop) * Incompressible data has arrived - add it to the history. */ static void -z_incomp(arg, mi) - void *arg; - struct mbuf *mi; +z_incomp(void *arg, struct mbuf *mi) { struct deflate_state *state = (struct deflate_state *) arg; u_char *rptr;