On Tue, Dec 20, 2022 at 05:48:41PM -0700, Todd C. Miller wrote:
> On Tue, 20 Dec 2022 23:44:08 +0100, Patrick Wildt wrote:
> 
> > clang complains when the function is declared with a fixed array size in
> > a parameter while the prototype is unbounded, like this:
> >
> > /usr/src/sys/net/pf.c:4353:54: error: argument 'sns' of type 'struct 
> > pf_src_n
> > ode *[4]' with mismatched bound [-Werror,-Warray-parameter]
> >     struct pf_rule_actions *act, struct pf_src_node *sns[PF_SN_MAX])
> >                                                      ^
> > /usr/src/sys/net/pf.c:203:28: note: previously declared as 'struct 
> > pf_src_nod
> > e *[]' here
> >                             struct pf_src_node *[]);
> >                                                 ^
> > 1 error generated.
> >
> > We have a few of that, and was wondering what the better solution is.
> > clang apparently accepts using * instead of [].  The alternative would
> > be to hardcode the size in the prototype as well.  Here's a diff for
> > a three files for the first version, as example.
> 
> Using * instead of [] is the saner approach.  Hard-coding the sizes
> into the prototype seems like a bad idea, even if clang is now smart
> enough to complain about a mismatch.
> 
>  - todd

So, here's the full diff that allows me to compile arm64 GENERIC.MP,
with radeondrm and amdgpu disabled.

Any concerns regarding the changes in libz?  It introduces diff to
upstream, but the recent commits seemed to indicate we have forked
anyway?

There's also an unrelated diff for iwx(4) in here, because of two
incidents of this:

In file included from /usr/src/sys/dev/pci/if_iwx.c:151:
/usr/src/sys/dev/pci/if_iwxreg.h:3626:2: error: field  within 'struct 
iwx_rx_mpdu_desc_v3' is less aligned than 'union 
iwx_rx_mpdu_desc_v3::(anonymous at /usr/src/sys/dev/pci/if_iwxreg.h:3626:2)' 
and is usually due to 'struct iwx_rx_mpdu_desc_v3' being packed, which can lead 
to unaligned accesses [-Werror,-Wunaligned-access]
        union {
        ^

Cheers,
Patrick

diff --git a/sys/crypto/sha2.c b/sys/crypto/sha2.c
index f789ef3f55b..b2b79f286f3 100644
--- a/sys/crypto/sha2.c
+++ b/sys/crypto/sha2.c
@@ -470,7 +470,7 @@ SHA256Update(SHA2_CTX *context, const void *dataptr, size_t 
len)
 }
 
 void
-SHA256Final(u_int8_t digest[], SHA2_CTX *context)
+SHA256Final(u_int8_t *digest, SHA2_CTX *context)
 {
        unsigned int    usedspace;
 
@@ -795,7 +795,7 @@ SHA512Last(SHA2_CTX *context)
 }
 
 void
-SHA512Final(u_int8_t digest[], SHA2_CTX *context)
+SHA512Final(u_int8_t *digest, SHA2_CTX *context)
 {
 
        SHA512Last(context);
@@ -834,7 +834,7 @@ SHA384Update(SHA2_CTX *context, const void *data, size_t 
len)
 }
 
 void
-SHA384Final(u_int8_t digest[], SHA2_CTX *context)
+SHA384Final(u_int8_t *digest, SHA2_CTX *context)
 {
 
        SHA512Last(context);
diff --git a/sys/dev/ic/ar5008.c b/sys/dev/ic/ar5008.c
index cad0f142210..4c0126fd6d6 100644
--- a/sys/dev/ic/ar5008.c
+++ b/sys/dev/ic/ar5008.c
@@ -111,7 +111,7 @@ void        ar5008_next_calib(struct athn_softc *);
 void   ar5008_calib_iq(struct athn_softc *);
 void   ar5008_calib_adc_gain(struct athn_softc *);
 void   ar5008_calib_adc_dc_off(struct athn_softc *);
-void   ar5008_write_txpower(struct athn_softc *, int16_t power[]);
+void   ar5008_write_txpower(struct athn_softc *, int16_t *);
 void   ar5008_set_viterbi_mask(struct athn_softc *, int);
 void   ar5008_hw_init(struct athn_softc *, struct ieee80211_channel *,
            struct ieee80211_channel *);
@@ -119,9 +119,9 @@ uint8_t     ar5008_get_vpd(uint8_t, const uint8_t *, const 
uint8_t *, int);
 void   ar5008_get_pdadcs(struct athn_softc *, uint8_t, struct athn_pier *,
            struct athn_pier *, int, int, uint8_t, uint8_t *, uint8_t *);
 void   ar5008_get_lg_tpow(struct athn_softc *, struct ieee80211_channel *,
-           uint8_t, const struct ar_cal_target_power_leg *, int, uint8_t[]);
+           uint8_t, const struct ar_cal_target_power_leg *, int, uint8_t *);
 void   ar5008_get_ht_tpow(struct athn_softc *, struct ieee80211_channel *,
-           uint8_t, const struct ar_cal_target_power_ht *, int, uint8_t[]);
+           uint8_t, const struct ar_cal_target_power_ht *, int, uint8_t *);
 void   ar5008_set_noise_immunity_level(struct athn_softc *, int);
 void   ar5008_enable_ofdm_weak_signal(struct athn_softc *);
 void   ar5008_disable_ofdm_weak_signal(struct athn_softc *);
diff --git a/sys/dev/ic/ar9003.c b/sys/dev/ic/ar9003.c
index 565ea27c701..7ec3131f86b 100644
--- a/sys/dev/ic/ar9003.c
+++ b/sys/dev/ic/ar9003.c
@@ -114,7 +114,7 @@ int ar9003_init_calib(struct athn_softc *);
 void   ar9003_do_calib(struct athn_softc *);
 void   ar9003_next_calib(struct athn_softc *);
 void   ar9003_calib_iq(struct athn_softc *);
-int    ar9003_get_iq_corr(struct athn_softc *, int32_t[], int32_t[]);
+int    ar9003_get_iq_corr(struct athn_softc *, int32_t *, int32_t *);
 int    ar9003_calib_tx_iq(struct athn_softc *);
 void   ar9003_paprd_calib(struct athn_softc *, struct ieee80211_channel *);
 int    ar9003_get_desired_txgain(struct athn_softc *, int, int);
@@ -126,17 +126,17 @@ int       ar9003_compute_predistortion(struct athn_softc 
*, const uint32_t *,
 void   ar9003_enable_predistorter(struct athn_softc *, int);
 void   ar9003_paprd_enable(struct athn_softc *);
 void   ar9003_paprd_tx_tone_done(struct athn_softc *);
-void   ar9003_write_txpower(struct athn_softc *, int16_t power[]);
+void   ar9003_write_txpower(struct athn_softc *, int16_t *);
 void   ar9003_reset_rx_gain(struct athn_softc *, struct ieee80211_channel *);
 void   ar9003_reset_tx_gain(struct athn_softc *, struct ieee80211_channel *);
 void   ar9003_hw_init(struct athn_softc *, struct ieee80211_channel *,
            struct ieee80211_channel *);
 void   ar9003_get_lg_tpow(struct athn_softc *, struct ieee80211_channel *,
            uint8_t, const uint8_t *, const struct ar_cal_target_power_leg *,
-           int, uint8_t[]);
+           int, uint8_t *);
 void   ar9003_get_ht_tpow(struct athn_softc *, struct ieee80211_channel *,
            uint8_t, const uint8_t *, const struct ar_cal_target_power_ht *,
-           int, uint8_t[]);
+           int, uint8_t *);
 void   ar9003_set_noise_immunity_level(struct athn_softc *, int);
 void   ar9003_enable_ofdm_weak_signal(struct athn_softc *);
 void   ar9003_disable_ofdm_weak_signal(struct athn_softc *);
diff --git a/sys/dev/ic/rtwn.c b/sys/dev/ic/rtwn.c
index 2d7551eaef3..d7f25d59919 100644
--- a/sys/dev/ic/rtwn.c
+++ b/sys/dev/ic/rtwn.c
@@ -151,19 +151,19 @@ void              rtwn_pa_bias_init(struct rtwn_softc *);
 void           rtwn_rxfilter_init(struct rtwn_softc *);
 void           rtwn_edca_init(struct rtwn_softc *);
 void           rtwn_rate_fallback_init(struct rtwn_softc *);
-void           rtwn_write_txpower(struct rtwn_softc *, int, uint16_t[]);
+void           rtwn_write_txpower(struct rtwn_softc *, int, uint16_t *);
 void           rtwn_get_txpower(struct rtwn_softc *sc, int,
                    struct ieee80211_channel *, struct ieee80211_channel *,
-                   uint16_t[]);
+                   uint16_t *);
 void           rtwn_r92c_get_txpower(struct rtwn_softc *, int,
                    struct ieee80211_channel *, struct ieee80211_channel *,
-                   uint16_t[]);
+                   uint16_t *);
 void           rtwn_r92e_get_txpower(struct rtwn_softc *, int,
                    struct ieee80211_channel *,
-                   struct ieee80211_channel *, uint16_t[]);
+                   struct ieee80211_channel *, uint16_t *);
 void           rtwn_r88e_get_txpower(struct rtwn_softc *, int,
                    struct ieee80211_channel *,
-                   struct ieee80211_channel *, uint16_t[]);
+                   struct ieee80211_channel *, uint16_t *);
 void           rtwn_set_txpower(struct rtwn_softc *,
                    struct ieee80211_channel *, struct ieee80211_channel *);
 void           rtwn_set_chan(struct rtwn_softc *,
diff --git a/sys/dev/pci/if_iwxreg.h b/sys/dev/pci/if_iwxreg.h
index 732c6f18f61..4161767815b 100644
--- a/sys/dev/pci/if_iwxreg.h
+++ b/sys/dev/pci/if_iwxreg.h
@@ -3636,7 +3636,7 @@ struct iwx_rx_mpdu_desc_v3 {
                        /* Only valid if IWX_RX_MPDU_PHY_TSF_OVERLOAD is set. */
                        uint32_t phy_data1;
                };
-       };
+       } __packed;
        uint32_t reserved[2];
 } __packed; /* RX_MPDU_RES_START_API_S_VER_3,
               RX_MPDU_RES_START_API_S_VER_5 */
@@ -3662,7 +3662,7 @@ struct iwx_rx_mpdu_desc_v1 {
                        uint32_t phy_data0;
                        uint32_t phy_data1;
                };
-       };
+       } __packed;
 } __packed;
 
 #define IWX_RX_REORDER_DATA_INVALID_BAID       0x7f
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index c8bba8d51a4..5da27021ecf 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -74,8 +74,8 @@ int kqpoll_debug = 0;
        printf(x);                                                      \
 }
 
-int pselregister(struct proc *, fd_set *[], fd_set *[], int, int *, int *);
-int pselcollect(struct proc *, struct kevent *, fd_set *[], int *);
+int pselregister(struct proc *, fd_set **, fd_set **, int, int *, int *);
+int pselcollect(struct proc *, struct kevent *, fd_set **, int *);
 void ppollregister(struct proc *, struct pollfd *, int, int *, int *);
 int ppollcollect(struct proc *, struct kevent *, struct pollfd *, u_int);
 
diff --git a/sys/lib/libz/adler32.c b/sys/lib/libz/adler32.c
index 8d520cd9e37..801a941d29a 100644
--- a/sys/lib/libz/adler32.c
+++ b/sys/lib/libz/adler32.c
@@ -58,10 +58,8 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, 
z_off64_t len2));
 #endif
 
 /* ========================================================================= */
-uLong ZEXPORT adler32_z(adler, buf, len)
-    uLong adler;
-    const Bytef *buf;
-    z_size_t len;
+uLong ZEXPORT
+adler32_z(uLong adler, const Bytef *buf, z_size_t len)
 {
     unsigned long sum2;
     unsigned n;
@@ -129,19 +127,15 @@ uLong ZEXPORT adler32_z(adler, buf, len)
 }
 
 /* ========================================================================= */
-uLong ZEXPORT adler32(adler, buf, len)
-    uLong adler;
-    const Bytef *buf;
-    uInt len;
+uLong ZEXPORT
+adler32(uLong adler, const Bytef *buf, uInt len)
 {
     return adler32_z(adler, buf, len);
 }
 
 /* ========================================================================= */
-local uLong adler32_combine_(adler1, adler2, len2)
-    uLong adler1;
-    uLong adler2;
-    z_off64_t len2;
+local uLong
+adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2)
 {
     unsigned long sum1;
     unsigned long sum2;
@@ -167,18 +161,14 @@ local uLong adler32_combine_(adler1, adler2, len2)
 }
 
 /* ========================================================================= */
-uLong ZEXPORT adler32_combine(adler1, adler2, len2)
-    uLong adler1;
-    uLong adler2;
-    z_off_t len2;
+uLong ZEXPORT
+adler32_combine(uLong adler1, uLong adler2, z_off_t len2)
 {
     return adler32_combine_(adler1, adler2, len2);
 }
 
-uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
-    uLong adler1;
-    uLong adler2;
-    z_off64_t len2;
+uLong ZEXPORT
+adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2)
 {
     return adler32_combine_(adler1, adler2, len2);
 }
diff --git a/sys/lib/libz/compress.c b/sys/lib/libz/compress.c
index aad3e346e76..1c4a2bfa9ac 100644
--- a/sys/lib/libz/compress.c
+++ b/sys/lib/libz/compress.c
@@ -17,12 +17,9 @@
    memory, Z_BUF_ERROR if there was not enough room in the output buffer,
    Z_STREAM_ERROR if the level parameter is invalid.
 */
-int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
-    Bytef *dest;
-    uLongf *destLen;
-    const Bytef *source;
-    uLong sourceLen;
-    int level;
+int ZEXPORT
+compress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen,
+    int level)
 {
     z_stream stream;
     int err;
@@ -63,11 +60,8 @@ int ZEXPORT compress2(dest, destLen, source, sourceLen, 
level)
 
 /* ===========================================================================
  */
-int ZEXPORT compress(dest, destLen, source, sourceLen)
-    Bytef *dest;
-    uLongf *destLen;
-    const Bytef *source;
-    uLong sourceLen;
+int ZEXPORT
+compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
 {
     return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
 }
@@ -76,8 +70,8 @@ int ZEXPORT compress(dest, destLen, source, sourceLen)
      If the default memLevel or windowBits for deflateInit() is changed, then
    this function needs to be updated.
  */
-uLong ZEXPORT compressBound(sourceLen)
-    uLong sourceLen;
+uLong ZEXPORT
+compressBound(uLong sourceLen)
 {
     return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
            (sourceLen >> 25) + 13;
diff --git a/sys/lib/libz/crc32.c b/sys/lib/libz/crc32.c
index 0796b0f4c84..cb735c3c808 100644
--- a/sys/lib/libz/crc32.c
+++ b/sys/lib/libz/crc32.c
@@ -121,8 +121,8 @@ local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
   instruction, if one is available. This assumes that word_t is either 32 bits
   or 64 bits.
  */
-local z_word_t byte_swap(word)
-    z_word_t word;
+local z_word_t
+byte_swap(z_word_t word)
 {
 #  if W == 8
     return
@@ -546,9 +546,8 @@ local void braid(ltl, big, n, w)
   Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
   reflected. For speed, this requires that a not be zero.
  */
-local z_crc_t multmodp(a, b)
-    z_crc_t a;
-    z_crc_t b;
+local z_crc_t
+multmodp(z_crc_t a, z_crc_t b)
 {
     z_crc_t m, p;
 
@@ -570,9 +569,8 @@ local z_crc_t multmodp(a, b)
   Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been
   initialized.
  */
-local z_crc_t x2nmodp(n, k)
-    z_off64_t n;
-    unsigned k;
+local z_crc_t
+x2nmodp(z_off64_t n, unsigned k)
 {
     z_crc_t p;
 
@@ -617,10 +615,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table()
 #define Z_BATCH_ZEROS 0xa10d3d0c    /* computed from Z_BATCH = 3990 */
 #define Z_BATCH_MIN 800             /* fewest words in a final batch */
 
-unsigned long ZEXPORT crc32_z(crc, buf, len)
-    unsigned long crc;
-    const unsigned char FAR *buf;
-    z_size_t len;
+unsigned long ZEXPORT
+crc32_z(unsigned long crc, const unsigned char FAR *buf, z_size_t len)
 {
     z_crc_t val;
     z_word_t crc1, crc2;
@@ -721,8 +717,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
   least-significant byte of the word as the first byte of data, without any pre
   or post conditioning. This is used to combine the CRCs of each braid.
  */
-local z_crc_t crc_word(data)
-    z_word_t data;
+local z_crc_t
+crc_word(z_word_t data)
 {
     int k;
     for (k = 0; k < W; k++)
@@ -730,8 +726,8 @@ local z_crc_t crc_word(data)
     return (z_crc_t)data;
 }
 
-local z_word_t crc_word_big(data)
-    z_word_t data;
+local z_word_t
+crc_word_big(z_word_t data)
 {
     int k;
     for (k = 0; k < W; k++)
@@ -743,10 +739,8 @@ local z_word_t crc_word_big(data)
 #endif
 
 /* ========================================================================= */
-unsigned long ZEXPORT crc32_z(crc, buf, len)
-    unsigned long crc;
-    const unsigned char FAR *buf;
-    z_size_t len;
+unsigned long ZEXPORT
+crc32_z(unsigned long crc, const unsigned char FAR *buf, z_size_t len)
 {
     /* Return initial CRC, if requested. */
     if (buf == Z_NULL) return 0;
@@ -1067,19 +1061,15 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
 #endif
 
 /* ========================================================================= */
-unsigned long ZEXPORT crc32(crc, buf, len)
-    unsigned long crc;
-    const unsigned char FAR *buf;
-    uInt len;
+unsigned long ZEXPORT
+crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
 {
     return crc32_z(crc, buf, len);
 }
 
 /* ========================================================================= */
-uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
-    uLong crc1;
-    uLong crc2;
-    z_off64_t len2;
+uLong ZEXPORT
+crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2)
 {
 #ifdef DYNAMIC_CRC_TABLE
     once(&made, make_crc_table);
@@ -1088,17 +1078,15 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
 }
 
 /* ========================================================================= */
-uLong ZEXPORT crc32_combine(crc1, crc2, len2)
-    uLong crc1;
-    uLong crc2;
-    z_off_t len2;
+uLong ZEXPORT
+crc32_combine(uLong crc1, uLong crc2, z_off_t len2)
 {
     return crc32_combine64(crc1, crc2, (z_off64_t)len2);
 }
 
 /* ========================================================================= */
-uLong ZEXPORT crc32_combine_gen64(len2)
-    z_off64_t len2;
+uLong ZEXPORT
+crc32_combine_gen64(z_off64_t len2)
 {
 #ifdef DYNAMIC_CRC_TABLE
     once(&made, make_crc_table);
@@ -1107,17 +1095,15 @@ uLong ZEXPORT crc32_combine_gen64(len2)
 }
 
 /* ========================================================================= */
-uLong ZEXPORT crc32_combine_gen(len2)
-    z_off_t len2;
+uLong ZEXPORT
+crc32_combine_gen(z_off_t len2)
 {
     return crc32_combine_gen64((z_off64_t)len2);
 }
 
 /* ========================================================================= */
-uLong ZEXPORT crc32_combine_op(crc1, crc2, op)
-    uLong crc1;
-    uLong crc2;
-    uLong op;
+uLong ZEXPORT
+crc32_combine_op(uLong crc1, uLong crc2, uLong op)
 {
     return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
 }
diff --git a/sys/lib/libz/deflate.c b/sys/lib/libz/deflate.c
index 6c7bf3de995..d2604fe8d59 100644
--- a/sys/lib/libz/deflate.c
+++ b/sys/lib/libz/deflate.c
@@ -191,8 +191,7 @@ local const config configuration_table[10] = {
  * bit values at the expense of memory usage). We slide even when level == 0 to
  * keep the hash table consistent if we switch back to level > 0 later.
  */
-local void slide_hash(s)
-    deflate_state *s;
+local void slide_hash(deflate_state *s)
 {
     unsigned n, m;
     Posf *p;
@@ -218,11 +217,8 @@ local void slide_hash(s)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateInit_(strm, level, version, stream_size)
-    z_streamp strm;
-    int level;
-    const char *version;
-    int stream_size;
+int ZEXPORT
+deflateInit_(z_streamp strm, int level, const char *version, int stream_size)
 {
     return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
                          Z_DEFAULT_STRATEGY, version, stream_size);
@@ -230,16 +226,9 @@ int ZEXPORT deflateInit_(strm, level, version, stream_size)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
-                  version, stream_size)
-    z_streamp strm;
-    int  level;
-    int  method;
-    int  windowBits;
-    int  memLevel;
-    int  strategy;
-    const char *version;
-    int stream_size;
+int ZEXPORT
+deflateInit2_(z_streamp strm, int level, int method, int windowBits,
+    int memLevel, int strategy, const char *version, int stream_size)
 {
     deflate_state *s;
     int wrap = 1;
@@ -382,8 +371,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, 
memLevel, strategy,
 /* =========================================================================
  * Check for a valid deflate stream state. Return 0 if ok, 1 if not.
  */
-local int deflateStateCheck(strm)
-    z_streamp strm;
+local int deflateStateCheck(z_streamp strm)
 {
     deflate_state *s;
     if (strm == Z_NULL ||
@@ -405,10 +393,8 @@ local int deflateStateCheck(strm)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateSetDictionary(strm, dictionary, dictLength)
-    z_streamp strm;
-    const Bytef *dictionary;
-    uInt  dictLength;
+int ZEXPORT
+deflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength)
 {
     deflate_state *s;
     uInt str, n;
@@ -474,10 +460,8 @@ int ZEXPORT deflateSetDictionary(strm, dictionary, 
dictLength)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateGetDictionary(strm, dictionary, dictLength)
-    z_streamp strm;
-    Bytef *dictionary;
-    uInt  *dictLength;
+int ZEXPORT
+deflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength)
 {
     deflate_state *s;
     uInt len;
@@ -496,8 +480,8 @@ int ZEXPORT deflateGetDictionary(strm, dictionary, 
dictLength)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateResetKeep(strm)
-    z_streamp strm;
+int ZEXPORT
+deflateResetKeep(z_streamp strm)
 {
     deflate_state *s;
 
@@ -534,8 +518,8 @@ int ZEXPORT deflateResetKeep(strm)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateReset(strm)
-    z_streamp strm;
+int ZEXPORT
+deflateReset(z_streamp strm)
 {
     int ret;
 
@@ -546,9 +530,8 @@ int ZEXPORT deflateReset(strm)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateSetHeader(strm, head)
-    z_streamp strm;
-    gz_headerp head;
+int ZEXPORT
+deflateSetHeader(z_streamp strm, gz_headerp head)
 {
     if (deflateStateCheck(strm) || strm->state->wrap != 2)
         return Z_STREAM_ERROR;
@@ -557,10 +540,8 @@ int ZEXPORT deflateSetHeader(strm, head)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflatePending(strm, pending, bits)
-    unsigned *pending;
-    int *bits;
-    z_streamp strm;
+int ZEXPORT
+deflatePending(z_streamp strm, unsigned *pending, int *bits)
 {
     if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
     if (pending != Z_NULL)
@@ -571,10 +552,8 @@ int ZEXPORT deflatePending(strm, pending, bits)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflatePrime(strm, bits, value)
-    z_streamp strm;
-    int bits;
-    int value;
+int ZEXPORT
+deflatePrime(z_streamp strm, int bits, int value)
 {
     deflate_state *s;
     int put;
@@ -598,10 +577,8 @@ int ZEXPORT deflatePrime(strm, bits, value)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateParams(strm, level, strategy)
-    z_streamp strm;
-    int level;
-    int strategy;
+int ZEXPORT
+deflateParams(z_streamp strm, int level, int strategy)
 {
     deflate_state *s;
     compress_func func;
@@ -647,12 +624,9 @@ int ZEXPORT deflateParams(strm, level, strategy)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
-    z_streamp strm;
-    int good_length;
-    int max_lazy;
-    int nice_length;
-    int max_chain;
+int ZEXPORT
+deflateTune(z_streamp strm, int good_length, int max_lazy, int nice_length,
+    int max_chain)
 {
     deflate_state *s;
 
@@ -689,9 +663,8 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, 
nice_length, max_chain)
  *
  * Shifts are used to approximate divisions, for speed.
  */
-uLong ZEXPORT deflateBound(strm, sourceLen)
-    z_streamp strm;
-    uLong sourceLen;
+uLong ZEXPORT
+deflateBound(z_streamp strm, uLong sourceLen)
 {
     deflate_state *s;
     uLong fixedlen, storelen, wraplen;
@@ -761,9 +734,8 @@ uLong ZEXPORT deflateBound(strm, sourceLen)
  * IN assertion: the stream state is correct and there is enough room in
  * pending_buf.
  */
-local void putShortMSB(s, b)
-    deflate_state *s;
-    uInt b;
+local void
+putShortMSB(deflate_state *s, uInt b)
 {
     put_byte(s, (Byte)(b >> 8));
     put_byte(s, (Byte)(b & 0xff));
@@ -775,8 +747,8 @@ local void putShortMSB(s, b)
  * applications may wish to modify it to avoid allocating a large
  * strm->next_out buffer and copying into it. (See also read_buf()).
  */
-local void flush_pending(strm)
-    z_streamp strm;
+local void
+flush_pending(z_streamp strm)
 {
     unsigned len;
     deflate_state *s = strm->state;
@@ -808,9 +780,8 @@ local void flush_pending(strm)
     } while (0)
 
 /* ========================================================================= */
-int ZEXPORT deflate(strm, flush)
-    z_streamp strm;
-    int flush;
+int ZEXPORT
+deflate(z_streamp strm, int flush)
 {
     int old_flush; /* value of flush param for previous deflate call */
     deflate_state *s;
@@ -1123,8 +1094,8 @@ int ZEXPORT deflate(strm, flush)
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateEnd(strm)
-    z_streamp strm;
+int ZEXPORT
+deflateEnd(z_streamp strm)
 {
     int status;
 
@@ -1149,9 +1120,8 @@ int ZEXPORT deflateEnd(strm)
  * To simplify the source, this is not supported for 16-bit MSDOS (which
  * doesn't have enough memory anyway to duplicate compression states).
  */
-int ZEXPORT deflateCopy(dest, source)
-    z_streamp dest;
-    z_streamp source;
+int ZEXPORT
+deflateCopy(z_streamp dest, z_streamp source)
 {
 #ifdef MAXSEG_64K
     return Z_STREAM_ERROR;
@@ -1208,10 +1178,8 @@ int ZEXPORT deflateCopy(dest, source)
  * allocating a large strm->next_in buffer and copying from it.
  * (See also flush_pending()).
  */
-local unsigned read_buf(strm, buf, size)
-    z_streamp strm;
-    Bytef *buf;
-    unsigned size;
+local unsigned
+read_buf(z_streamp strm, Bytef *buf, unsigned size)
 {
     unsigned len = strm->avail_in;
 
@@ -1238,8 +1206,8 @@ local unsigned read_buf(strm, buf, size)
 /* ===========================================================================
  * Initialize the "longest match" routines for a new zlib stream
  */
-local void lm_init(s)
-    deflate_state *s;
+local void
+lm_init(deflate_state *s)
 {
     s->window_size = (ulg)2L*s->w_size;
 
@@ -1271,9 +1239,8 @@ local void lm_init(s)
  *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
  * OUT assertion: the match length is not greater than s->lookahead.
  */
-local uInt longest_match(s, cur_match)
-    deflate_state *s;
-    IPos cur_match;                             /* current match */
+local uInt
+longest_match(deflate_state *s, IPos cur_match)
 {
     unsigned chain_length = s->max_chain_length;/* max hash chain length */
     register Bytef *scan = s->window + s->strstart; /* current string */
@@ -1520,8 +1487,8 @@ local void check_match(s, start, match, length)
  *    performed for at least two bytes (required for the zip translate_eol
  *    option -- not supported here).
  */
-local void fill_window(s)
-    deflate_state *s;
+local void
+fill_window(deflate_state *s)
 {
     unsigned n;
     unsigned more;    /* Amount of free space at the end of the window. */
@@ -1685,9 +1652,8 @@ local void fill_window(s)
  * copied. It is most efficient with large input and output buffers, which
  * maximizes the opportunities to have a single copy from next_in to next_out.
  */
-local block_state deflate_stored(s, flush)
-    deflate_state *s;
-    int flush;
+local block_state
+deflate_stored(deflate_state *s, int flush)
 {
     /* Smallest worthy block size when not flushing or finishing. By default
      * this is 32K. This can be as small as 507 bytes for memLevel == 1. For
@@ -1872,9 +1838,8 @@ local block_state deflate_stored(s, flush)
  * new strings in the dictionary only for unmatched strings or for short
  * matches. It is used only for the fast compression options.
  */
-local block_state deflate_fast(s, flush)
-    deflate_state *s;
-    int flush;
+local block_state
+deflate_fast(deflate_state *s, int flush)
 {
     IPos hash_head;       /* head of the hash chain */
     int bflush;           /* set if current block must be flushed */
@@ -1974,9 +1939,8 @@ local block_state deflate_fast(s, flush)
  * evaluation for matches: a match is finally adopted only if there is
  * no better match at the next window position.
  */
-local block_state deflate_slow(s, flush)
-    deflate_state *s;
-    int flush;
+local block_state
+deflate_slow(deflate_state *s, int flush)
 {
     IPos hash_head;          /* head of hash chain */
     int bflush;              /* set if current block must be flushed */
@@ -2105,9 +2069,8 @@ local block_state deflate_slow(s, flush)
  * one.  Do not maintain a hash table.  (It will be regenerated if this run of
  * deflate switches away from Z_RLE.)
  */
-local block_state deflate_rle(s, flush)
-    deflate_state *s;
-    int flush;
+local block_state
+deflate_rle(deflate_state *s, int flush)
 {
     int bflush;             /* set if current block must be flushed */
     uInt prev;              /* byte at distance one to match */
@@ -2179,9 +2142,8 @@ local block_state deflate_rle(s, flush)
  * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
  * (It will be regenerated if this run of deflate switches away from Huffman.)
  */
-local block_state deflate_huff(s, flush)
-    deflate_state *s;
-    int flush;
+local block_state
+deflate_huff(deflate_state *s, int flush)
 {
     int bflush;             /* set if current block must be flushed */
 
diff --git a/sys/lib/libz/infback.c b/sys/lib/libz/infback.c
index df356dbbe49..f60b53d0346 100644
--- a/sys/lib/libz/infback.c
+++ b/sys/lib/libz/infback.c
@@ -25,12 +25,9 @@ local void fixedtables OF((struct inflate_state FAR *state));
    windowBits is in the range 8..15, and window is a user-supplied
    window and output buffer that is 2**windowBits bytes.
  */
-int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
-z_streamp strm;
-int windowBits;
-unsigned char FAR *window;
-const char *version;
-int stream_size;
+int ZEXPORT
+inflateBackInit_(z_streamp strm, int windowBits, unsigned char FAR *window,
+    const char *version, int stream_size)
 {
     struct inflate_state FAR *state;
 
@@ -80,8 +77,8 @@ int stream_size;
    used for threaded applications, since the rewriting of the tables and virgin
    may not be thread-safe.
  */
-local void fixedtables(state)
-struct inflate_state FAR *state;
+local void
+fixedtables(struct inflate_state FAR *state)
 {
 #ifdef BUILDFIXED
     static int virgin = 1;
@@ -248,12 +245,9 @@ struct inflate_state FAR *state;
    inflateBack() can also return Z_STREAM_ERROR if the input parameters
    are not correct, i.e. strm is Z_NULL or the state was not initialized.
  */
-int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
-z_streamp strm;
-in_func in;
-void FAR *in_desc;
-out_func out;
-void FAR *out_desc;
+int ZEXPORT
+inflateBack(z_streamp strm, in_func in, void FAR *in_desc, out_func out,
+    void FAR *out_desc)
 {
     struct inflate_state FAR *state;
     z_const unsigned char FAR *next;    /* next input */
@@ -682,8 +676,8 @@ void FAR *out_desc;
     return ret;
 }
 
-int ZEXPORT inflateBackEnd(strm)
-z_streamp strm;
+int ZEXPORT
+inflateBackEnd(z_streamp strm)
 {
     if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
         return Z_STREAM_ERROR;
diff --git a/sys/lib/libz/inffast.c b/sys/lib/libz/inffast.c
index db0424db48a..8de36388ddb 100644
--- a/sys/lib/libz/inffast.c
+++ b/sys/lib/libz/inffast.c
@@ -47,9 +47,8 @@
       requires strm->avail_out >= 258 for each loop to avoid checking for
       output space.
  */
-void ZLIB_INTERNAL inflate_fast(strm, start)
-z_streamp strm;
-unsigned start;         /* inflate()'s starting value for strm->avail_out */
+void ZLIB_INTERNAL
+inflate_fast(z_streamp strm, unsigned start)
 {
     struct inflate_state FAR *state;
     z_const unsigned char FAR *in;      /* local strm->next_in */
diff --git a/sys/lib/libz/inflate.c b/sys/lib/libz/inflate.c
index db0d935e234..353ad352cff 100644
--- a/sys/lib/libz/inflate.c
+++ b/sys/lib/libz/inflate.c
@@ -102,8 +102,8 @@ local int updatewindow OF((z_streamp strm, const unsigned 
char FAR *end,
 local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
                               unsigned len));
 
-local int inflateStateCheck(strm)
-z_streamp strm;
+local int
+inflateStateCheck(z_streamp strm)
 {
     struct inflate_state FAR *state;
     if (strm == Z_NULL ||
@@ -116,8 +116,8 @@ z_streamp strm;
     return 0;
 }
 
-int ZEXPORT inflateResetKeep(strm)
-z_streamp strm;
+int ZEXPORT
+inflateResetKeep(z_streamp strm)
 {
     struct inflate_state FAR *state;
 
@@ -142,8 +142,8 @@ z_streamp strm;
     return Z_OK;
 }
 
-int ZEXPORT inflateReset(strm)
-z_streamp strm;
+int ZEXPORT
+inflateReset(z_streamp strm)
 {
     struct inflate_state FAR *state;
 
@@ -155,9 +155,8 @@ z_streamp strm;
     return inflateResetKeep(strm);
 }
 
-int ZEXPORT inflateReset2(strm, windowBits)
-z_streamp strm;
-int windowBits;
+int ZEXPORT
+inflateReset2(z_streamp strm, int windowBits)
 {
     int wrap;
     struct inflate_state FAR *state;
@@ -195,11 +194,9 @@ int windowBits;
     return inflateReset(strm);
 }
 
-int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
-z_streamp strm;
-int windowBits;
-const char *version;
-int stream_size;
+int ZEXPORT
+inflateInit2_(z_streamp strm, int windowBits, const char *version,
+    int stream_size)
 {
     int ret;
     struct inflate_state FAR *state;
@@ -239,18 +236,14 @@ int stream_size;
     return ret;
 }
 
-int ZEXPORT inflateInit_(strm, version, stream_size)
-z_streamp strm;
-const char *version;
-int stream_size;
+int ZEXPORT
+inflateInit_(z_streamp strm, const char *version, int stream_size)
 {
     return inflateInit2_(strm, DEF_WBITS, version, stream_size);
 }
 
-int ZEXPORT inflatePrime(strm, bits, value)
-z_streamp strm;
-int bits;
-int value;
+int ZEXPORT
+inflatePrime(z_streamp strm, int bits, int value)
 {
     struct inflate_state FAR *state;
 
@@ -278,8 +271,8 @@ int value;
    used for threaded applications, since the rewriting of the tables and virgin
    may not be thread-safe.
  */
-local void fixedtables(state)
-struct inflate_state FAR *state;
+local void
+fixedtables(struct inflate_state FAR *state)
 {
 #ifdef BUILDFIXED
     static int virgin = 1;
@@ -396,10 +389,8 @@ void makefixed()
    output will fall in the output data, making match copies simpler and faster.
    The advantage may be dependent on the size of the processor's data caches.
  */
-local int updatewindow(strm, end, copy)
-z_streamp strm;
-const Bytef *end;
-unsigned copy;
+local int
+updatewindow(z_streamp strm, const Bytef *end, unsigned copy)
 {
     struct inflate_state FAR *state;
     unsigned dist;
@@ -622,9 +613,8 @@ unsigned copy;
    will return Z_BUF_ERROR if it has not reached the end of the stream.
  */
 
-int ZEXPORT inflate(strm, flush)
-z_streamp strm;
-int flush;
+int ZEXPORT
+inflate(z_streamp strm, int flush)
 {
     struct inflate_state FAR *state;
     z_const unsigned char FAR *next;    /* next input */
@@ -1387,8 +1377,8 @@ int flush;
     return ret;
 }
 
-int ZEXPORT inflateEnd(strm)
-z_streamp strm;
+int ZEXPORT
+inflateEnd(z_streamp strm)
 {
     struct inflate_state FAR *state;
     if (inflateStateCheck(strm))
@@ -1401,10 +1391,8 @@ z_streamp strm;
     return Z_OK;
 }
 
-int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
-z_streamp strm;
-Bytef *dictionary;
-uInt *dictLength;
+int ZEXPORT
+inflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength)
 {
     struct inflate_state FAR *state;
 
@@ -1424,10 +1412,8 @@ uInt *dictLength;
     return Z_OK;
 }
 
-int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
-z_streamp strm;
-const Bytef *dictionary;
-uInt dictLength;
+int ZEXPORT
+inflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength)
 {
     struct inflate_state FAR *state;
     unsigned long dictid;
@@ -1459,9 +1445,8 @@ uInt dictLength;
     return Z_OK;
 }
 
-int ZEXPORT inflateGetHeader(strm, head)
-z_streamp strm;
-gz_headerp head;
+int ZEXPORT
+inflateGetHeader(z_streamp strm, gz_headerp head)
 {
     struct inflate_state FAR *state;
 
@@ -1487,10 +1472,8 @@ gz_headerp head;
    called again with more data and the *have state.  *have is initialized to
    zero for the first call.
  */
-local unsigned syncsearch(have, buf, len)
-unsigned FAR *have;
-const unsigned char FAR *buf;
-unsigned len;
+local unsigned
+syncsearch(unsigned FAR *have, const unsigned char FAR *buf, unsigned len)
 {
     unsigned got;
     unsigned next;
@@ -1510,8 +1493,8 @@ unsigned len;
     return next;
 }
 
-int ZEXPORT inflateSync(strm)
-z_streamp strm;
+int ZEXPORT
+inflateSync(z_streamp strm)
 {
     unsigned len;               /* number of bytes to look at or looked at */
     int flags;                  /* temporary to save header status */
@@ -1568,8 +1551,8 @@ z_streamp strm;
    block. When decompressing, PPP checks that at the end of input packet,
    inflate is waiting for these length bytes.
  */
-int ZEXPORT inflateSyncPoint(strm)
-z_streamp strm;
+int ZEXPORT
+inflateSyncPoint(z_streamp strm)
 {
     struct inflate_state FAR *state;
 
@@ -1578,9 +1561,8 @@ z_streamp strm;
     return state->mode == STORED && state->bits == 0;
 }
 
-int ZEXPORT inflateCopy(dest, source)
-z_streamp dest;
-z_streamp source;
+int ZEXPORT
+inflateCopy(z_streamp dest, z_streamp source)
 {
     struct inflate_state FAR *state;
     struct inflate_state FAR *copy;
@@ -1625,9 +1607,8 @@ z_streamp source;
     return Z_OK;
 }
 
-int ZEXPORT inflateUndermine(strm, subvert)
-z_streamp strm;
-int subvert;
+int ZEXPORT
+inflateUndermine(z_streamp strm, int subvert)
 {
     struct inflate_state FAR *state;
 
@@ -1643,9 +1624,8 @@ int subvert;
 #endif
 }
 
-int ZEXPORT inflateValidate(strm, check)
-z_streamp strm;
-int check;
+int ZEXPORT
+inflateValidate(z_streamp strm, int check)
 {
     struct inflate_state FAR *state;
 
@@ -1658,8 +1638,8 @@ int check;
     return Z_OK;
 }
 
-long ZEXPORT inflateMark(strm)
-z_streamp strm;
+long ZEXPORT
+inflateMark(z_streamp strm)
 {
     struct inflate_state FAR *state;
 
@@ -1671,8 +1651,8 @@ z_streamp strm;
             (state->mode == MATCH ? state->was - state->length : 0));
 }
 
-unsigned long ZEXPORT inflateCodesUsed(strm)
-z_streamp strm;
+unsigned long ZEXPORT
+inflateCodesUsed(z_streamp strm)
 {
     struct inflate_state FAR *state;
     if (inflateStateCheck(strm)) return (unsigned long)-1;
diff --git a/sys/lib/libz/inftrees.c b/sys/lib/libz/inftrees.c
index 3881743c0a5..eaca57c2073 100644
--- a/sys/lib/libz/inftrees.c
+++ b/sys/lib/libz/inftrees.c
@@ -27,13 +27,9 @@
    table index bits.  It will differ if the request is greater than the
    longest code or if it is less than the shortest code.
  */
-int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
-codetype type;
-unsigned short FAR *lens;
-unsigned codes;
-code FAR * FAR *table;
-unsigned FAR *bits;
-unsigned short FAR *work;
+int ZLIB_INTERNAL
+inflate_table(codetype type, unsigned short FAR *lens, unsigned codes,
+    code FAR * FAR *table, unsigned FAR *bits, unsigned short FAR *work)
 {
     unsigned len;               /* a code's length in bits */
     unsigned sym;               /* index of code symbols */
diff --git a/sys/lib/libz/trees.c b/sys/lib/libz/trees.c
index 7d13e842c50..91073e9e261 100644
--- a/sys/lib/libz/trees.c
+++ b/sys/lib/libz/trees.c
@@ -374,8 +374,8 @@ void gen_trees_header()
 /* ===========================================================================
  * Initialize the tree data structures for a new zlib stream.
  */
-void ZLIB_INTERNAL _tr_init(s)
-    deflate_state *s;
+void ZLIB_INTERNAL
+_tr_init(deflate_state *s)
 {
     tr_static_init();
 
@@ -402,8 +402,8 @@ void ZLIB_INTERNAL _tr_init(s)
 /* ===========================================================================
  * Initialize a new block.
  */
-local void init_block(s)
-    deflate_state *s;
+local void
+init_block(deflate_state *s)
 {
     int n; /* iterates over tree elements */
 
@@ -446,10 +446,8 @@ local void init_block(s)
  * when the heap property is re-established (each father smaller than its
  * two sons).
  */
-local void pqdownheap(s, tree, k)
-    deflate_state *s;
-    ct_data *tree;  /* the tree to restore */
-    int k;               /* node to move down */
+local void
+pqdownheap(deflate_state *s, ct_data *tree, int k)
 {
     int v = s->heap[k];
     int j = k << 1;  /* left son of k */
@@ -481,9 +479,8 @@ local void pqdownheap(s, tree, k)
  *     The length opt_len is updated; static_len is also updated if stree is
  *     not null.
  */
-local void gen_bitlen(s, desc)
-    deflate_state *s;
-    tree_desc *desc;    /* the tree descriptor */
+local void
+gen_bitlen(deflate_state *s, tree_desc *desc)
 {
     ct_data *tree        = desc->dyn_tree;
     int max_code         = desc->max_code;
@@ -567,10 +564,8 @@ local void gen_bitlen(s, desc)
  * OUT assertion: the field code is set for all tree elements of non
  *     zero code length.
  */
-local void gen_codes(tree, max_code, bl_count)
-    ct_data *tree;             /* the tree to decorate */
-    int max_code;              /* largest code with non zero frequency */
-    ushf *bl_count;            /* number of codes at each bit length */
+local void
+gen_codes(ct_data *tree, int max_code, ushf *bl_count)
 {
     ush next_code[MAX_BITS+1]; /* next code value for each bit length */
     unsigned code = 0;         /* running code value */
@@ -610,9 +605,8 @@ local void gen_codes(tree, max_code, bl_count)
  *     and corresponding code. The length opt_len is updated; static_len is
  *     also updated if stree is not null. The field max_code is set.
  */
-local void build_tree(s, desc)
-    deflate_state *s;
-    tree_desc *desc; /* the tree descriptor */
+local void
+build_tree(deflate_state *s, tree_desc *desc)
 {
     ct_data *tree         = desc->dyn_tree;
     const ct_data *stree  = desc->stat_desc->static_tree;
@@ -698,10 +692,8 @@ local void build_tree(s, desc)
  * Scan a literal or distance tree to determine the frequencies of the codes
  * in the bit length tree.
  */
-local void scan_tree(s, tree, max_code)
-    deflate_state *s;
-    ct_data *tree;   /* the tree to be scanned */
-    int max_code;    /* and its largest code of non zero frequency */
+local void
+scan_tree(deflate_state *s, ct_data *tree, int max_code)
 {
     int n;                     /* iterates over all tree elements */
     int prevlen = -1;          /* last emitted length */
@@ -743,10 +735,8 @@ local void scan_tree(s, tree, max_code)
  * Send a literal or distance tree in compressed form, using the codes in
  * bl_tree.
  */
-local void send_tree(s, tree, max_code)
-    deflate_state *s;
-    ct_data *tree; /* the tree to be scanned */
-    int max_code;       /* and its largest code of non zero frequency */
+local void
+send_tree(deflate_state *s, ct_data *tree, int max_code)
 {
     int n;                     /* iterates over all tree elements */
     int prevlen = -1;          /* last emitted length */
@@ -794,8 +784,8 @@ local void send_tree(s, tree, max_code)
  * Construct the Huffman tree for the bit lengths and return the index in
  * bl_order of the last bit length code to send.
  */
-local int build_bl_tree(s)
-    deflate_state *s;
+local int
+build_bl_tree(deflate_state *s)
 {
     int max_blindex;  /* index of last bit length code of non zero freq */
 
@@ -829,9 +819,8 @@ local int build_bl_tree(s)
  * lengths of the bit length codes, the literal tree and the distance tree.
  * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
  */
-local void send_all_trees(s, lcodes, dcodes, blcodes)
-    deflate_state *s;
-    int lcodes, dcodes, blcodes; /* number of codes for each tree */
+local void
+send_all_trees(deflate_state *s, int lcodes, int dcodes, int blcodes)
 {
     int rank;                    /* index in bl_order */
 
@@ -858,11 +847,8 @@ local void send_all_trees(s, lcodes, dcodes, blcodes)
 /* ===========================================================================
  * Send a stored block
  */
-void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
-    deflate_state *s;
-    charf *buf;       /* input block */
-    ulg stored_len;   /* length of input block */
-    int last;         /* one if this is the last block for a file */
+void ZLIB_INTERNAL
+_tr_stored_block(deflate_state *s, charf *buf, ulg stored_len, int last)
 {
     send_bits(s, (STORED_BLOCK<<1) + last, 3);  /* send block type */
     bi_windup(s);        /* align on byte boundary */
@@ -882,8 +868,8 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, 
last)
 /* ===========================================================================
  * Flush the bits in the bit buffer to pending output (leaves at most 7 bits)
  */
-void ZLIB_INTERNAL _tr_flush_bits(s)
-    deflate_state *s;
+void ZLIB_INTERNAL
+_tr_flush_bits(deflate_state *s)
 {
     bi_flush(s);
 }
@@ -892,8 +878,8 @@ void ZLIB_INTERNAL _tr_flush_bits(s)
  * Send one empty static block to give enough lookahead for inflate.
  * This takes 10 bits, of which 7 may remain in the bit buffer.
  */
-void ZLIB_INTERNAL _tr_align(s)
-    deflate_state *s;
+void ZLIB_INTERNAL
+_tr_align(deflate_state *s)
 {
     send_bits(s, STATIC_TREES<<1, 3);
     send_code(s, END_BLOCK, static_ltree);
@@ -907,11 +893,8 @@ void ZLIB_INTERNAL _tr_align(s)
  * Determine the best encoding for the current block: dynamic trees, static
  * trees or store, and write out the encoded block.
  */
-void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
-    deflate_state *s;
-    charf *buf;       /* input block, or NULL if too old */
-    ulg stored_len;   /* length of input block */
-    int last;         /* one if this is the last block for a file */
+void ZLIB_INTERNAL
+_tr_flush_block(deflate_state *s, charf *buf, ulg stored_len, int last)
 {
     ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
     int max_blindex = 0;  /* index of last bit length code of non zero freq */
@@ -1009,10 +992,8 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, 
last)
  * Save the match info and tally the frequency counts. Return true if
  * the current block must be flushed.
  */
-int ZLIB_INTERNAL _tr_tally(s, dist, lc)
-    deflate_state *s;
-    unsigned dist;  /* distance of matched string */
-    unsigned lc;    /* match length - MIN_MATCH or unmatched char (dist==0) */
+int ZLIB_INTERNAL
+_tr_tally(deflate_state *s, unsigned dist, unsigned lc)
 {
     s->sym_buf[s->sym_next++] = (uch)dist;
     s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
@@ -1037,10 +1018,8 @@ int ZLIB_INTERNAL _tr_tally(s, dist, lc)
 /* ===========================================================================
  * Send the block data compressed using the given Huffman trees
  */
-local void compress_block(s, ltree, dtree)
-    deflate_state *s;
-    const ct_data *ltree; /* literal tree */
-    const ct_data *dtree; /* distance tree */
+local void
+compress_block(deflate_state *s, const ct_data *ltree, const ct_data *dtree)
 {
     unsigned dist;      /* distance of matched string */
     int lc;             /* match length or unmatched char (if dist == 0) */
@@ -1097,8 +1076,7 @@ local void compress_block(s, ltree, dtree)
  *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
  * IN assertion: the fields Freq of dyn_ltree are set.
  */
-local int detect_data_type(s)
-    deflate_state *s;
+local int detect_data_type(deflate_state *s)
 {
     /* block_mask is the bit mask of block-listed bytes
      * set bits 0..6, 14..25, and 28..31
@@ -1131,9 +1109,8 @@ local int detect_data_type(s)
  * method would use a table)
  * IN assertion: 1 <= len <= 15
  */
-local unsigned bi_reverse(code, len)
-    unsigned code; /* the value to invert */
-    int len;       /* its bit length */
+local unsigned
+bi_reverse(unsigned code, int len)
 {
     register unsigned res = 0;
     do {
@@ -1146,8 +1123,8 @@ local unsigned bi_reverse(code, len)
 /* ===========================================================================
  * Flush the bit buffer, keeping at most 7 bits in it.
  */
-local void bi_flush(s)
-    deflate_state *s;
+local void
+bi_flush(deflate_state *s)
 {
     if (s->bi_valid == 16) {
         put_short(s, s->bi_buf);
@@ -1163,8 +1140,8 @@ local void bi_flush(s)
 /* ===========================================================================
  * Flush the bit buffer and align the output on a byte boundary
  */
-local void bi_windup(s)
-    deflate_state *s;
+local void
+bi_windup(deflate_state *s)
 {
     if (s->bi_valid > 8) {
         put_short(s, s->bi_buf);
diff --git a/sys/lib/libz/zutil.c b/sys/lib/libz/zutil.c
index 5d8bc65ac37..63acca40ae9 100644
--- a/sys/lib/libz/zutil.c
+++ b/sys/lib/libz/zutil.c
@@ -133,8 +133,8 @@ void ZLIB_INTERNAL z_error(m)
 /* exported to allow conversion of error code to string for compress() and
  * uncompress()
  */
-const char * ZEXPORT zError(err)
-    int err;
+const char * ZEXPORT
+zError(int err)
 {
     return ERR_MSG(err);
 }
@@ -149,10 +149,8 @@ const char * ZEXPORT zError(err)
 
 #ifndef HAVE_MEMCPY
 
-void ZLIB_INTERNAL zmemcpy(dest, source, len)
-    Bytef* dest;
-    const Bytef* source;
-    uInt  len;
+void ZLIB_INTERNAL
+zmemcpy(Bytef* dest, const Bytef* source, uInt len)
 {
     if (len == 0) return;
     do {
@@ -160,10 +158,8 @@ void ZLIB_INTERNAL zmemcpy(dest, source, len)
     } while (--len != 0);
 }
 
-int ZLIB_INTERNAL zmemcmp(s1, s2, len)
-    const Bytef* s1;
-    const Bytef* s2;
-    uInt  len;
+int ZLIB_INTERNAL
+zmemcmp(const Bytef* s1, const Bytef* s2, uInt len)
 {
     uInt j;
 
@@ -173,9 +169,8 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len)
     return 0;
 }
 
-void ZLIB_INTERNAL zmemzero(dest, len)
-    Bytef* dest;
-    uInt  len;
+void ZLIB_INTERNAL
+zmemzero(Bytef* dest, uInt len)
 {
     if (len == 0) return;
     do {
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 7203589d4bd..c859499fe62 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -200,7 +200,7 @@ static __inline int  pf_create_state(struct pf_pdesc *, 
struct pf_rule *,
                            struct pf_state_key **, struct pf_state_key **,
                            int *, struct pf_state **, int,
                            struct pf_rule_slist *, struct pf_rule_actions *,
-                           struct pf_src_node *[]);
+                           struct pf_src_node **);
 static __inline int     pf_state_key_addr_setup(struct pf_pdesc *, void *,
                            int, struct pf_addr *, int, struct pf_addr *,
                            int, int);
diff --git a/sys/net/toeplitz.h b/sys/net/toeplitz.h
index 3f30fd4b739..de92cf8fa06 100644
--- a/sys/net/toeplitz.h
+++ b/sys/net/toeplitz.h
@@ -54,7 +54,7 @@ uint16_t      stoeplitz_hash_ip6port(const struct 
stoeplitz_cache *,
 #endif
 
 uint16_t       stoeplitz_hash_eaddr(const struct stoeplitz_cache *,
-                   const uint8_t []);
+                   const uint8_t *);
 
 /* hash a uint16_t in network byte order */
 static __unused inline uint16_t
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 212209fb7e3..55b05b1362b 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -87,8 +87,8 @@ int   ieee80211_parse_edca_params_body(struct ieee80211com *,
            const u_int8_t *);
 int    ieee80211_parse_edca_params(struct ieee80211com *, const u_int8_t *);
 int    ieee80211_parse_wmm_params(struct ieee80211com *, const u_int8_t *);
-enum   ieee80211_cipher ieee80211_parse_rsn_cipher(const u_int8_t[]);
-enum   ieee80211_akm ieee80211_parse_rsn_akm(const u_int8_t[]);
+enum   ieee80211_cipher ieee80211_parse_rsn_cipher(const u_int8_t *);
+enum   ieee80211_akm ieee80211_parse_rsn_akm(const u_int8_t *);
 int    ieee80211_parse_rsn_body(struct ieee80211com *, const u_int8_t *,
            u_int, struct ieee80211_rsnparams *);
 int    ieee80211_save_ie(const u_int8_t *, u_int8_t **);
diff --git a/sys/netinet/if_ether.h b/sys/netinet/if_ether.h
index 3f32a4729d6..6f70643e4ce 100644
--- a/sys/netinet/if_ether.h
+++ b/sys/netinet/if_ether.h
@@ -271,7 +271,7 @@ void        arp_rtrequest(struct ifnet *, int, struct 
rtentry *);
 void   ether_fakeaddr(struct ifnet *);
 int    ether_addmulti(struct ifreq *, struct arpcom *);
 int    ether_delmulti(struct ifreq *, struct arpcom *);
-int    ether_multiaddr(struct sockaddr *, u_int8_t[], u_int8_t[]);
+int    ether_multiaddr(struct sockaddr *, u_int8_t *, u_int8_t *);
 void   ether_ifattach(struct ifnet *);
 void   ether_ifdetach(struct ifnet *);
 int    ether_ioctl(struct ifnet *, struct arpcom *, u_long, caddr_t);

Reply via email to