1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

MD5: fix compiler warnings and code style nits

This commit is contained in:
Daniel Stenberg 2015-02-03 10:09:35 +01:00
parent 57d6d253a1
commit 0d41c3e46b

View File

@ -387,7 +387,7 @@ void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size)
saved_lo = ctx->lo; saved_lo = ctx->lo;
if((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) if((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo)
ctx->hi++; ctx->hi++;
ctx->hi += size >> 29; ctx->hi += (MD5_u32plus)size >> 29;
used = saved_lo & 0x3f; used = saved_lo & 0x3f;
@ -433,33 +433,33 @@ void MD5_Final(unsigned char *result, MD5_CTX *ctx)
memset(&ctx->buffer[used], 0, available - 8); memset(&ctx->buffer[used], 0, available - 8);
ctx->lo <<= 3; ctx->lo <<= 3;
ctx->buffer[56] = ctx->lo; ctx->buffer[56] = curlx_ultouc((ctx->lo)&0xff);
ctx->buffer[57] = ctx->lo >> 8; ctx->buffer[57] = curlx_ultouc((ctx->lo >> 8)&0xff);
ctx->buffer[58] = ctx->lo >> 16; ctx->buffer[58] = curlx_ultouc((ctx->lo >> 16)&0xff);
ctx->buffer[59] = ctx->lo >> 24; ctx->buffer[59] = curlx_ultouc(ctx->lo >> 24);
ctx->buffer[60] = ctx->hi; ctx->buffer[60] = curlx_ultouc((ctx->hi)&0xff);
ctx->buffer[61] = ctx->hi >> 8; ctx->buffer[61] = curlx_ultouc((ctx->hi >> 8)&0xff);
ctx->buffer[62] = ctx->hi >> 16; ctx->buffer[62] = curlx_ultouc((ctx->hi >> 16)&0xff);
ctx->buffer[63] = ctx->hi >> 24; ctx->buffer[63] = curlx_ultouc(ctx->hi >> 24);
body(ctx, ctx->buffer, 64); body(ctx, ctx->buffer, 64);
result[0] = ctx->a; result[0] = curlx_ultouc((ctx->a)&0xff);
result[1] = ctx->a >> 8; result[1] = curlx_ultouc((ctx->a >> 8)&0xff);
result[2] = ctx->a >> 16; result[2] = curlx_ultouc((ctx->a >> 16)&0xff);
result[3] = ctx->a >> 24; result[3] = curlx_ultouc(ctx->a >> 24);
result[4] = ctx->b; result[4] = curlx_ultouc((ctx->b)&0xff);
result[5] = ctx->b >> 8; result[5] = curlx_ultouc((ctx->b >> 8)&0xff);
result[6] = ctx->b >> 16; result[6] = curlx_ultouc((ctx->b >> 16)&0xff);
result[7] = ctx->b >> 24; result[7] = curlx_ultouc(ctx->b >> 24);
result[8] = ctx->c; result[8] = curlx_ultouc((ctx->c)&0xff);
result[9] = ctx->c >> 8; result[9] = curlx_ultouc((ctx->c >> 8)&0xff);
result[10] = ctx->c >> 16; result[10] = curlx_ultouc((ctx->c >> 16)&0xff);
result[11] = ctx->c >> 24; result[11] = curlx_ultouc(ctx->c >> 24);
result[12] = ctx->d; result[12] = curlx_ultouc((ctx->d)&0xff);
result[13] = ctx->d >> 8; result[13] = curlx_ultouc((ctx->d >> 8)&0xff);
result[14] = ctx->d >> 16; result[14] = curlx_ultouc((ctx->d >> 16)&0xff);
result[15] = ctx->d >> 24; result[15] = curlx_ultouc(ctx->d >> 24);
memset(ctx, 0, sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx));
} }