OSSP CVS Repository

ossp - Check-in [311]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 311
Date: 2001-Jan-19 09:31:14 (local)
2001-Jan-19 08:31:14 (UTC)
User:rse
Branch:
Comment: 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'
Tickets:
Inspections:
Files:
ossp-pkg/petidomo/generate_cookie.c      1.2 -> 1.3     11 inserted, 10 deleted

ossp-pkg/petidomo/generate_cookie.c 1.2 -> 1.3

--- generate_cookie.c    2001/01/18 20:30:50     1.2
+++ generate_cookie.c    2001/01/19 08:31:14     1.3
@@ -1,6 +1,6 @@
 /*
    $Source: /v/ossp/cvs/ossp-pkg/petidomo/Attic/generate_cookie.c,v $
-   $Revision: 1.2 $
+   $Revision: 1.3 $
 
    Copyright (C) 2001 by Peter Simons <simons@computer.org>.
 
@@ -18,6 +18,7 @@
 */
 
 #include "petidomo.h"
+#include <string.h>
 
 typedef unsigned char *  POINTER;
 
@@ -242,10 +243,10 @@
         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 @@
                 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 @@
         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) */

CVSTrac 2.0.1