Get rid of the following GCC complains:
generate_cookie.c: In function `generate_cookie': generate_cookie.c:58: warning: implicit declaration of function `strlen' generate_cookie.c: In function `MD5Update': generate_cookie.c:245: warning: declaration of `index' shadows global declaration generate_cookie.c:260: warning: implicit declaration of function `memcpy' generate_cookie.c: In function `MD5Final': generate_cookie.c:286: warning: declaration of `index' shadows global declaration generate_cookie.c:303: warning: implicit declaration of function `memset'
This commit is contained in:
parent
2976c607a6
commit
60a0658b81
@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "petidomo.h"
|
||||
#include <string.h>
|
||||
|
||||
typedef unsigned char * POINTER;
|
||||
|
||||
@ -242,10 +243,10 @@ MD5Update(context, input, inputLen)
|
||||
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))
|
||||
@ -253,23 +254,23 @@ MD5Update(context, input, inputLen)
|
||||
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],
|
||||
memcpy((POINTER)&context->buffer[idx],
|
||||
(POINTER)input, partLen);
|
||||
MD5Transform(context->state, context->buffer);
|
||||
|
||||
for (i = partLen; i + 63 < inputLen; i += 64)
|
||||
MD5Transform(context->state, &input[i]);
|
||||
|
||||
index = 0;
|
||||
idx = 0;
|
||||
} else
|
||||
i = 0;
|
||||
|
||||
/* Buffer remaining input */
|
||||
memcpy((POINTER)&context->buffer[index], (POINTER)&input[i],
|
||||
memcpy((POINTER)&context->buffer[idx], (POINTER)&input[i],
|
||||
inputLen - i);
|
||||
}
|
||||
|
||||
@ -283,14 +284,14 @@ MD5Final(digest, context)
|
||||
MD5_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);
|
||||
MD5Update (context, PADDING, padLen);
|
||||
|
||||
/* Append length (before padding) */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user