Replace some K&R function definitions with ANSI C.

Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D27062
This commit is contained in:
John Baldwin 2020-11-03 22:32:30 +00:00
parent d3d79e968b
commit 9038e6a1e4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=367310
3 changed files with 7 additions and 23 deletions

View file

@ -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;

View file

@ -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) */

View file

@ -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);
}