diff options
author | markm <markm@FreeBSD.org> | 2003-06-05 13:17:32 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2003-06-05 13:17:32 +0000 |
commit | f4bde254d79eb5486daa1cd0f35679dbf4ea91d6 (patch) | |
tree | b0d487b81cf6fac2dc26eee634c3df998e51b6fd /lib/libmd/md4c.c | |
parent | e503a716d1fa6dda08fbf59b2555ce8a813dc034 (diff) | |
download | FreeBSD-src-f4bde254d79eb5486daa1cd0f35679dbf4ea91d6.zip FreeBSD-src-f4bde254d79eb5486daa1cd0f35679dbf4ea91d6.tar.gz |
Rename local variables to not mask global names of same name. This
fixes lots of lint(1) warnings.
Diffstat (limited to 'lib/libmd/md4c.c')
-rw-r--r-- | lib/libmd/md4c.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/libmd/md4c.c b/lib/libmd/md4c.c index 528c42b..d372512 100644 --- a/lib/libmd/md4c.c +++ b/lib/libmd/md4c.c @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "md4.h" typedef unsigned char *POINTER; +typedef const unsigned char *CONST_POINTER; typedef u_int16_t UINT2; typedef u_int32_t UINT4; @@ -111,35 +112,35 @@ MD4_CTX *context; /* context */ const unsigned char *input; /* input block */ unsigned int inputLen; /* length of input block */ { - unsigned int i, index, partLen; + unsigned int i, idx, partLen; /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); + idx = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) context->count[1]++; context->count[1] += ((UINT4)inputLen >> 29); - partLen = 64 - index; + partLen = 64 - idx; /* Transform as many times as possible. */ if (inputLen >= partLen) { memcpy - ((POINTER)&context->buffer[index], (POINTER)input, partLen); + ((POINTER)&context->buffer[idx], (CONST_POINTER)input, partLen); MD4Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD4Transform (context->state, &input[i]); - index = 0; + idx = 0; } else i = 0; /* Buffer remaining input */ memcpy - ((POINTER)&context->buffer[index], (POINTER)&input[i], + ((POINTER)&context->buffer[idx], (CONST_POINTER)&input[i], inputLen-i); } @@ -148,15 +149,15 @@ void MD4Pad (context) MD4_CTX *context; /* context */ { unsigned char bits[8]; - unsigned int index, padLen; + unsigned int idx, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); + idx = (unsigned int)((context->count[0] >> 3) & 0x3f); + padLen = (idx < 56) ? (56 - idx) : (120 - idx); MD4Update (context, PADDING, padLen); /* Append length (before padding) */ |