From 9038e6a1e439412a7e0c10efa09cf243a5969c45 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 3 Nov 2020 22:32:30 +0000 Subject: [PATCH] Replace some K&R function definitions with ANSI C. Reviewed by: markj Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D27062 --- sys/crypto/sha1.c | 14 ++++---------- sys/opencrypto/cryptodeflate.c | 6 +----- sys/opencrypto/xform_deflate.c | 10 ++-------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/sys/crypto/sha1.c b/sys/crypto/sha1.c index 477e5c57eadb..85226db08bc8 100644 --- a/sys/crypto/sha1.c +++ b/sys/crypto/sha1.c @@ -91,8 +91,7 @@ static uint32_t _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 }; static void sha1_step(struct sha1_ctxt *); static void -sha1_step(ctxt) - struct sha1_ctxt *ctxt; +sha1_step(struct sha1_ctxt *ctxt) { uint32_t a, b, c, d, e; size_t t, s; @@ -176,8 +175,7 @@ sha1_step(ctxt) /*------------------------------------------------------------*/ void -sha1_init(ctxt) - struct sha1_ctxt *ctxt; +sha1_init(struct sha1_ctxt *ctxt) { bzero(ctxt, sizeof(struct sha1_ctxt)); H(0) = 0x67452301; @@ -188,8 +186,7 @@ sha1_init(ctxt) } void -sha1_pad(ctxt) - struct sha1_ctxt *ctxt; +sha1_pad(struct sha1_ctxt *ctxt) { size_t padlen; /*pad length in bytes*/ size_t padstart; @@ -223,10 +220,7 @@ sha1_pad(ctxt) } void -sha1_loop(ctxt, input, len) - struct sha1_ctxt *ctxt; - const uint8_t *input; - size_t len; +sha1_loop(struct sha1_ctxt *ctxt, const uint8_t *input, size_t len) { size_t gaplen; size_t gapstart; diff --git a/sys/opencrypto/cryptodeflate.c b/sys/opencrypto/cryptodeflate.c index 5b2c354fbc63..b945733a9ce5 100644 --- a/sys/opencrypto/cryptodeflate.c +++ b/sys/opencrypto/cryptodeflate.c @@ -82,11 +82,7 @@ crypto_zfree(void *nil, void *ptr) */ uint32_t -deflate_global(data, size, decomp, out) - uint8_t *data; - uint32_t size; - int decomp; - uint8_t **out; +deflate_global(uint8_t *data, uint32_t size, int decomp, uint8_t **out) { /* decomp indicates whether we compress (0) or decompress (1) */ diff --git a/sys/opencrypto/xform_deflate.c b/sys/opencrypto/xform_deflate.c index 1ccf16b8e743..8d93f4843244 100644 --- a/sys/opencrypto/xform_deflate.c +++ b/sys/opencrypto/xform_deflate.c @@ -68,19 +68,13 @@ struct comp_algo comp_algo_deflate = { */ static uint32_t -deflate_compress(data, size, out) - uint8_t *data; - uint32_t size; - uint8_t **out; +deflate_compress(uint8_t *data, uint32_t size, uint8_t **out) { return deflate_global(data, size, 0, out); } static uint32_t -deflate_decompress(data, size, out) - uint8_t *data; - uint32_t size; - uint8_t **out; +deflate_decompress(uint8_t *data, uint32_t size, uint8_t **out) { return deflate_global(data, size, 1, out); }