X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fmd4.c;h=e3484171de767e7c92bba109ebd27beb16798593;hb=217969cf220de4c0515eccd614de1640c3f46bcf;hp=dd1e2df40c7e92af3183c164b12d708f15dcf540;hpb=1ad225807ea68a44e04f0b081328caedda54f6c1;p=gnulib.git diff --git a/lib/md4.c b/lib/md4.c index dd1e2df40..e3484171d 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -67,7 +67,7 @@ md4_init_ctx (struct md4_ctx *ctx) /* Copy the 4 byte value from v into the memory location pointed to by *cp, If your architecture allows unaligned access this is equivalent to * (uint32_t *) cp = v */ -static void +static inline void set_uint32 (char *cp, uint32_t v) { memcpy (cp, &v, sizeof v); @@ -79,10 +79,10 @@ void * md4_read_ctx (const struct md4_ctx *ctx, void *resbuf) { char *r = resbuf; - set_uint32 (r + 0*4, SWAP (ctx->A)); - set_uint32 (r + 1*4, SWAP (ctx->B)); - set_uint32 (r + 2*4, SWAP (ctx->C)); - set_uint32 (r + 3*4, SWAP (ctx->D)); + set_uint32 (r + 0 * sizeof ctx->A, SWAP (ctx->A)); + set_uint32 (r + 1 * sizeof ctx->B, SWAP (ctx->B)); + set_uint32 (r + 2 * sizeof ctx->C, SWAP (ctx->C)); + set_uint32 (r + 3 * sizeof ctx->D, SWAP (ctx->D)); return resbuf; }