diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-01-17 22:06:55 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-01-17 22:06:55 +0000 |
commit | 52744f8f65a278a59a8903d5c594e057d63c7006 (patch) | |
tree | 9cd0ff1f2b49146b3d42c70c272ff88d215436b8 /lib/md5.c | |
parent | 13857c648210a16448619c65e33f9918bfe27cbe (diff) |
Fixing some Solaris compiler warnings (u_int->uint, adding some typecasts
for pid_t variables).
Diffstat (limited to 'lib/md5.c')
-rw-r--r-- | lib/md5.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -25,7 +25,7 @@ #include <string.h> /* for memcpy() */ #include "md5.h" -static void md5_transform(u_int32_t buf[4], u_int32_t const in[16]); +static void md5_transform(uint32_t buf[4], uint32_t const in[16]); /* * Wrapper function for all-in-one MD5 @@ -52,12 +52,12 @@ void md5_init(struct MD5Context *ctx) void md5_append(struct MD5Context *ctx, const md5_byte_t *buf, unsigned int len) { - u_int32_t t; + uint32_t t; /* Update bitcount */ t = ctx->bits[0]; - if ((ctx->bits[0] = t + ((u_int32_t) len << 3)) < t) + if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1] += len >> 29; @@ -74,7 +74,7 @@ void md5_append(struct MD5Context *ctx, const md5_byte_t *buf, return; } memcpy(p, buf, t); - md5_transform(ctx->buf, (u_int32_t *) ctx->in); + md5_transform(ctx->buf, (uint32_t *) ctx->in); buf += t; len -= t; } @@ -82,7 +82,7 @@ void md5_append(struct MD5Context *ctx, const md5_byte_t *buf, while (len >= 64) { memcpy(ctx->in, buf, 64); - md5_transform(ctx->buf, (u_int32_t *) ctx->in); + md5_transform(ctx->buf, (uint32_t *) ctx->in); buf += 64; len -= 64; } @@ -116,7 +116,7 @@ void md5_finish(struct MD5Context *ctx, md5_byte_t digest[16]) if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ memset(p, 0, count); - md5_transform(ctx->buf, (u_int32_t *) ctx->in); + md5_transform(ctx->buf, (uint32_t *) ctx->in); /* Now fill the next block with 56 bytes */ memset(ctx->in, 0, 56); @@ -126,10 +126,10 @@ void md5_finish(struct MD5Context *ctx, md5_byte_t digest[16]) } /* Append length in bits and transform */ - ((u_int32_t *) ctx->in)[14] = ctx->bits[0]; - ((u_int32_t *) ctx->in)[15] = ctx->bits[1]; + ((uint32_t *) ctx->in)[14] = ctx->bits[0]; + ((uint32_t *) ctx->in)[15] = ctx->bits[1]; - md5_transform(ctx->buf, (u_int32_t *) ctx->in); + md5_transform(ctx->buf, (uint32_t *) ctx->in); memcpy(digest, ctx->buf, 16); memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ } @@ -151,9 +151,9 @@ void md5_finish(struct MD5Context *ctx, md5_byte_t digest[16]) * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ -static void md5_transform(u_int32_t buf[4], u_int32_t const in[16]) +static void md5_transform(uint32_t buf[4], uint32_t const in[16]) { - register u_int32_t a, b, c, d; + register uint32_t a, b, c, d; a = buf[0]; b = buf[1]; |