X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsha1.c;h=9c6c7ae3933d7b45a945a2404414b01bd2e4e95d;hb=56093e4d947bcc87bbc05ac3e8645509274f57b4;hp=8869d43ffb1a0147f044afed664a45928e2cc619;hpb=1ad225807ea68a44e04f0b081328caedda54f6c1;p=gnulib.git diff --git a/lib/sha1.c b/lib/sha1.c index 8869d43ff..9c6c7ae39 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -70,7 +70,7 @@ sha1_init_ctx (struct sha1_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); @@ -82,11 +82,11 @@ void * sha1_read_ctx (const struct sha1_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 + 4*4, SWAP (ctx->E)); + 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)); + set_uint32 (r + 4 * sizeof ctx->E, SWAP (ctx->E)); return resbuf; }