Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix warnings #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions randnum.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

static int get_random_fd(void);

static int get_random_fd()
static int get_random_fd(void)
{
static int fd = -2;

Expand All @@ -36,8 +36,7 @@ static int get_random_fd()
* Generate a random number n, where 0 <= n < max_num, using
* /dev/urandom if possible.
*/
int pw_random_number(max_num)
int max_num;
int pw_random_number(int max_num)
{
unsigned int rand_num;
int i, fd = get_random_fd();
Expand Down
16 changes: 4 additions & 12 deletions sha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ void sha1_process(sha1_context *ctx, uint8 data[64]);
(b)[(i) + 3] = (uint8) ( (n) ); \
}

void sha1_starts(ctx)
sha1_context *ctx;
void sha1_starts(sha1_context *ctx)
{
ctx->total[0] = 0;
ctx->total[1] = 0;
Expand All @@ -55,9 +54,7 @@ void sha1_starts(ctx)
ctx->state[4] = 0xC3D2E1F0;
}

void sha1_process(ctx, data)
sha1_context *ctx;
uint8 data[64];
void sha1_process(sha1_context *ctx, uint8 data[64])
{
uint32 temp, W[16], A, B, C, D, E;

Expand Down Expand Up @@ -213,10 +210,7 @@ void sha1_process(ctx, data)
ctx->state[4] += E;
}

void sha1_update(ctx, input, length )
sha1_context *ctx;
uint8 *input;
uint32 length;
void sha1_update(sha1_context *ctx, uint8 *input, uint32 length)
{
uint32 left, fill;

Expand Down Expand Up @@ -263,9 +257,7 @@ static uint8 sha1_padding[64] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

void sha1_finish( ctx, digest )
sha1_context *ctx;
uint8 digest[20];
void sha1_finish(sha1_context *ctx, uint8 digest[20] )
{
uint32 last, padn;
uint32 high, low;
Expand Down