Skip to content

Commit

Permalink
Merge pull request #151 from libtom/pr/adler32-declaration-block-begi…
Browse files Browse the repository at this point in the history
…nning

move declarations at the block beginning (ANSI C)
  • Loading branch information
karel-m authored Feb 28, 2017
2 parents 6596746 + efbd73f commit b44aa8f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/misc/adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ void adler32_init(adler32_state *ctx)

void adler32_update(adler32_state *ctx, const unsigned char *input, unsigned long length)
{
unsigned long s1, s2;

LTC_ARGCHKVD(ctx != NULL);
LTC_ARGCHKVD(input != NULL);
unsigned long s1 = ctx->s[0];
unsigned long s2 = ctx->s[1];
s1 = ctx->s[0];
s2 = ctx->s[1];

if (length % 8 != 0) {
do {
Expand Down Expand Up @@ -81,10 +83,12 @@ void adler32_update(adler32_state *ctx, const unsigned char *input, unsigned lon

void adler32_finish(adler32_state *ctx, void *hash, unsigned long size)
{
unsigned char* h;

LTC_ARGCHKVD(ctx != NULL);
LTC_ARGCHKVD(hash != NULL);

unsigned char* h = hash;
h = hash;

switch (size) {
default:
Expand Down

0 comments on commit b44aa8f

Please sign in to comment.