From efbd73fbc8cf578746051faf5c54e3622273cb8f Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Tue, 28 Feb 2017 16:11:42 +0100 Subject: [PATCH] move declarations at the block beginning (ANSI C) --- src/misc/adler32.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/misc/adler32.c b/src/misc/adler32.c index dd1010fa2..987931bf3 100644 --- a/src/misc/adler32.c +++ b/src/misc/adler32.c @@ -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 { @@ -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: