Skip to content

Commit

Permalink
Merge pull request #4635 from jrw972/fix-warnings-in-hash-cpp
Browse files Browse the repository at this point in the history
Fix warnings in Hash.cpp
  • Loading branch information
jrw972 committed May 16, 2024
2 parents f16692b + ba3c67e commit bfc7c03
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions dds/DCPS/Hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ typedef struct {
*/
#if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
#define SET(n) \
(*(MD5_u32plus *)&ptr[(n) * 4])
(*(const MD5_u32plus *)&ptr[(n) * 4])
#define GET(n) \
SET(n)
#else
Expand Down Expand Up @@ -284,33 +284,33 @@ void MD5_Final(unsigned char *result, MD5_CTX *ctx)
memset(&ctx->buffer[used], 0, free - 8);

ctx->lo <<= 3;
ctx->buffer[56] = ctx->lo;
ctx->buffer[57] = ctx->lo >> 8;
ctx->buffer[58] = ctx->lo >> 16;
ctx->buffer[59] = ctx->lo >> 24;
ctx->buffer[60] = ctx->hi;
ctx->buffer[61] = ctx->hi >> 8;
ctx->buffer[62] = ctx->hi >> 16;
ctx->buffer[63] = ctx->hi >> 24;
ctx->buffer[56] = ctx->lo & 0xFF;
ctx->buffer[57] = (ctx->lo >> 8) & 0xFF;
ctx->buffer[58] = (ctx->lo >> 16) & 0xFF;
ctx->buffer[59] = (ctx->lo >> 24) & 0xFF;
ctx->buffer[60] = ctx->hi & 0xFF;
ctx->buffer[61] = (ctx->hi >> 8) & 0xFF;
ctx->buffer[62] = (ctx->hi >> 16) & 0xFF;
ctx->buffer[63] = (ctx->hi >> 24) & 0xFF;

body(ctx, ctx->buffer, 64);

result[0] = ctx->a;
result[1] = ctx->a >> 8;
result[2] = ctx->a >> 16;
result[3] = ctx->a >> 24;
result[4] = ctx->b;
result[5] = ctx->b >> 8;
result[6] = ctx->b >> 16;
result[7] = ctx->b >> 24;
result[8] = ctx->c;
result[9] = ctx->c >> 8;
result[10] = ctx->c >> 16;
result[11] = ctx->c >> 24;
result[12] = ctx->d;
result[13] = ctx->d >> 8;
result[14] = ctx->d >> 16;
result[15] = ctx->d >> 24;
result[0] = ctx->a & 0xFF;
result[1] = (ctx->a >> 8) & 0xFF;
result[2] = (ctx->a >> 16) & 0xFF;
result[3] = (ctx->a >> 24) & 0xFF;
result[4] = ctx->b & 0xFF;
result[5] = (ctx->b >> 8) & 0xFF;
result[6] = (ctx->b >> 16) & 0xFF;
result[7] = (ctx->b >> 24) & 0xFF;
result[8] = ctx->c & 0xFF;
result[9] = (ctx->c >> 8) & 0xFF;
result[10] = (ctx->c >> 16) & 0xFF;
result[11] = (ctx->c >> 24) & 0xFF;
result[12] = ctx->d & 0xFF;
result[13] = (ctx->d >> 8) & 0xFF;
result[14] = (ctx->d >> 16) & 0xFF;
result[15] = (ctx->d >> 24) & 0xFF;

memset(ctx, 0, sizeof(*ctx));
}
Expand Down

0 comments on commit bfc7c03

Please sign in to comment.