diff options
author | Jim Meyering <meyering@redhat.com> | 2008-01-31 14:32:19 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-01-31 19:15:59 +0100 |
commit | 17bdb83ae669a9a01b6c33846a423e832e79557c (patch) | |
tree | 1dd4e330c6c59949318ecb78abeec83c75378ef8 | |
parent | 212d02e3f6ec01cca0f1d69e37994936ef9a46d3 (diff) | |
download | gnulib-17bdb83ae669a9a01b6c33846a423e832e79557c.tar.gz |
Use "sizeof VAR", rather than a literal "4".
* lib/md5.c (md5_read_ctx): Use sizeof ctx->A, not 4.
* lib/md4.c (md4_read_ctx): Likewise.
* lib/sha1.c (sha1_read_ctx): Likewise.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/md4.c | 8 | ||||
-rw-r--r-- | lib/md5.c | 8 | ||||
-rw-r--r-- | lib/sha1.c | 10 |
4 files changed, 20 insertions, 13 deletions
@@ -1,3 +1,10 @@ +2008-01-31 Jim Meyering <meyering@redhat.com> + + Use "sizeof VAR", rather than a literal "4". + * lib/md5.c (md5_read_ctx): Use sizeof ctx->A, not 4. + * lib/md4.c (md4_read_ctx): Likewise. + * lib/sha1.c (sha1_read_ctx): Likewise. + 2008-01-31 Simon Josefsson <simon@josefsson.org> * tests/test-sha1.c: New file, based on test-md5.c. @@ -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; } @@ -95,10 +95,10 @@ void * md5_read_ctx (const struct md5_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; } diff --git a/lib/sha1.c b/lib/sha1.c index 8869d43ffb..a955d85e3f 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -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; } |