]> sjero.net Git - wget/blobdiff - src/cookies.c
[svn] Minor -Wall-induced fixes. Also, skip_url is removed.
[wget] / src / cookies.c
index a7c1598c1871affc2ef66dbd1b7147b65ff2167d..f915d820fbc4c992c8b9877579aedc91f670fc89 100644 (file)
@@ -111,21 +111,15 @@ delete_cookie (struct cookie *cookie)
    case.  */
 
 static unsigned long
-unsigned_string_hash (const void *sv)
+unsigned_string_hash (const void *key)
 {
-  unsigned int h = 0;
-  unsigned const char *x = (unsigned const char *) sv;
-
-  while (*x)
-    {
-      unsigned int g;
-      unsigned char c = TOLOWER (*x);
-      h = (h << 4) + c;
-      if ((g = h & 0xf0000000) != 0)
-       h = (h ^ (g >> 24)) ^ g;
-      ++x;
-    }
-
+  const char *p = key;
+  unsigned int h = TOLOWER (*p);
+  
+  if (h)
+    for (p += 1; *p != '\0'; p++)
+      h = (h << 5) - h + TOLOWER (*p);
+  
   return h;
 }
 
@@ -709,7 +703,7 @@ numeric_address_p (const char *addr)
 static int
 check_domain_match (const char *cookie_domain, const char *host)
 {
-  int i, headlen;
+  int headlen;
   const char *tail;
 
   /* Numeric address requires exact match.  It also requires HOST to
@@ -1376,7 +1370,7 @@ save_cookies (const char *file)
     logprintf (LOG_NOTQUIET, _("Error closing `%s': %s\n"),
               file, strerror (errno));
 
-  DEBUGP (("Done saving cookies.\n", file));
+  DEBUGP (("Done saving cookies.\n"));
 }
 \f
 static int