]> sjero.net Git - wget/commitdiff
Henri's -Wall patch.
authorMicah Cowan <micah@cowan.name>
Sat, 31 May 2008 05:42:36 +0000 (22:42 -0700)
committerMicah Cowan <micah@cowan.name>
Sat, 31 May 2008 05:42:36 +0000 (22:42 -0700)
14 files changed:
src/cookies.c
src/ftp-basic.c
src/hash.c
src/html-url.c
src/http-ntlm.c
src/http.c
src/init.c
src/log.c
src/main.c
src/progress.c
src/ptimer.c
src/spider.c
src/url.c
src/utils.c

index 147695c29401a740f21ac971f1d0c47d5f2f21aa..854139046c65f009ed7d1928ac2291f110b59b8c 100644 (file)
@@ -587,7 +587,7 @@ check_domain_match (const char *cookie_domain, const char *host)
 
     if (dccount == 2)
       {
 
     if (dccount == 2)
       {
-        int i;
+        size_t i;
         int known_toplevel = false;
         static const char *known_toplevel_domains[] = {
           ".com", ".edu", ".net", ".org", ".gov", ".mil", ".int"
         int known_toplevel = false;
         static const char *known_toplevel_domains[] = {
           ".com", ".edu", ".net", ".org", ".gov", ".mil", ".int"
index 36b11bcacd1054db06eb65c982d6ee4f0f5a4c11..265a1e25b3ca178f0272edcf3cd806334e758bd2 100644 (file)
@@ -189,7 +189,7 @@ ftp_login (int csock, const char *acc, const char *pass)
       "331 s/key ",
       "331 opiekey "
     };
       "331 s/key ",
       "331 opiekey "
     };
-    int i;
+    size_t i;
     const char *seed = NULL;
 
     for (i = 0; i < countof (skey_head); i++)
     const char *seed = NULL;
 
     for (i = 0; i < countof (skey_head); i++)
@@ -964,7 +964,7 @@ ftp_list (int csock, const char *file)
   int nwritten;
   uerr_t err;
   bool ok = false;
   int nwritten;
   uerr_t err;
   bool ok = false;
-  int i = 0;
+  size_t i = 0;
   /* Try `LIST -a' first and revert to `LIST' in case of failure.  */
   const char *list_commands[] = { "LIST -a", 
                                   "LIST" };
   /* Try `LIST -a' first and revert to `LIST' in case of failure.  */
   const char *list_commands[] = { "LIST -a", 
                                   "LIST" };
index 4697b779bf65ef1ba4ec99de4d8ff0d122e342d3..1e19fd63dc234283ce105d0e3e68b891a4ea303b 100644 (file)
@@ -226,7 +226,7 @@ prime_size (int size, int *prime_offset)
     243370577, 316381771, 411296309, 534685237, 695090819, 903618083,
     1174703521, 1527114613, 1837299131, 2147483647
   };
     243370577, 316381771, 411296309, 534685237, 695090819, 903618083,
     1174703521, 1527114613, 1837299131, 2147483647
   };
-  int i;
+  size_t i;
 
   for (i = *prime_offset; i < countof (primes); i++)
     if (primes[i] >= size)
 
   for (i = *prime_offset; i < countof (primes); i++)
     if (primes[i] >= size)
index e9f2773ab409eeabb49966fcc9f7a8e6fede8a39..b5d3ecf0cbeabc486f4aecd59bfa87f6b5d7e760 100644 (file)
@@ -185,7 +185,7 @@ init_interesting (void)
      matches the user's preferences as specified through --ignore-tags
      and --follow-tags.  */
 
      matches the user's preferences as specified through --ignore-tags
      and --follow-tags.  */
 
-  int i;
+  size_t i;
   interesting_tags = make_nocase_string_hash_table (countof (known_tags));
 
   /* First, add all the tags we know hot to handle, mapped to their
   interesting_tags = make_nocase_string_hash_table (countof (known_tags));
 
   /* First, add all the tags we know hot to handle, mapped to their
@@ -358,7 +358,7 @@ tag_find_urls (int tagid, struct taginfo *tag, struct map_context *ctx)
   int i, attrind;
   int first = -1;
 
   int i, attrind;
   int first = -1;
 
-  for (i = 0; i < countof (tag_url_attributes); i++)
+  for (i = 0; i < (int) countof (tag_url_attributes); i++)
     if (tag_url_attributes[i].tagid == tagid)
       {
         /* We've found the index of tag_url_attributes where the
     if (tag_url_attributes[i].tagid == tagid)
       {
         /* We've found the index of tag_url_attributes where the
index def832be9bc6975b9e73f4bc85237c5924dce8fb..fbba2c61e5d6d3a93edf2eabc1466843fbad73cc 100644 (file)
@@ -526,7 +526,7 @@ ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd,
 
     /* Make sure that the user and domain strings fit in the target buffer
        before we copy them there. */
 
     /* Make sure that the user and domain strings fit in the target buffer
        before we copy them there. */
-    if(size + userlen + domlen >= sizeof(ntlmbuf))
+    if(((size_t) size + userlen + domlen) >= sizeof(ntlmbuf))
       return NULL;
     
     memcpy(&ntlmbuf[size], domain, domlen);
       return NULL;
     
     memcpy(&ntlmbuf[size], domain, domlen);
index 11dc9cc8f7d08c2678e09a486f135e21118e16de..58e9b14a94453ff5477b745a779be2d1411595d3 100644 (file)
@@ -2908,7 +2908,7 @@ http_atotm (const char *time_string)
                                    Netscape cookie specification.) */
   };
   const char *oldlocale;
                                    Netscape cookie specification.) */
   };
   const char *oldlocale;
-  int i;
+  size_t i;
   time_t ret = (time_t) -1;
 
   /* Solaris strptime fails to recognize English month names in
   time_t ret = (time_t) -1;
 
   /* Solaris strptime fails to recognize English month names in
@@ -3019,10 +3019,11 @@ digest_authentication_encode (const char *au, const char *user,
   au += 6;                      /* skip over `Digest' */
   while (extract_param (&au, &name, &value, ','))
     {
   au += 6;                      /* skip over `Digest' */
   while (extract_param (&au, &name, &value, ','))
     {
-      int i;
+      size_t i;
       for (i = 0; i < countof (options); i++)
       for (i = 0; i < countof (options); i++)
-        if (name.e - name.b == strlen (options[i].name)
-            && 0 == strncmp (name.b, options[i].name, name.e - name.b))
+        if ((size_t) (name.e - name.b) == strlen (options[i].name)
+            && 0 == strncmp (name.b, options[i].name,
+                             (size_t) (name.e - name.b)))
           {
             *options[i].variable = strdupdelim (value.b, value.e);
             break;
           {
             *options[i].variable = strdupdelim (value.b, value.e);
             break;
@@ -3102,7 +3103,7 @@ username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"",
    first argument and are followed by whitespace or terminating \0.
    The comparison is case-insensitive.  */
 #define STARTS(literal, b, e)                           \
    first argument and are followed by whitespace or terminating \0.
    The comparison is case-insensitive.  */
 #define STARTS(literal, b, e)                           \
-  ((e) - (b) >= STRSIZE (literal)                       \
+  (((size_t) ((e) - (b))) >= STRSIZE (literal) \
    && 0 == strncasecmp (b, literal, STRSIZE (literal))  \
    && ((e) - (b) == STRSIZE (literal)                   \
        || c_isspace (b[STRSIZE (literal)])))
    && 0 == strncasecmp (b, literal, STRSIZE (literal))  \
    && ((e) - (b) == STRSIZE (literal)                   \
        || c_isspace (b[STRSIZE (literal)])))
index 97976553164c2bb6827c79e430a3ec417f1b1973..5b0206e4498408faa1b6a6b1170d6224fb77b5ff 100644 (file)
@@ -631,7 +631,7 @@ parse_line (const char *line, char **com, char **val, int *comind)
 static bool
 setval_internal (int comind, const char *com, const char *val)
 {
 static bool
 setval_internal (int comind, const char *com, const char *val)
 {
-  assert (0 <= comind && comind < countof (commands));
+  assert (0 <= comind && ((size_t) comind) < countof (commands));
   DEBUGP (("Setting %s (%s) to %s\n", com, commands[comind].name, val));
   return commands[comind].action (com, val, commands[comind].place);
 }
   DEBUGP (("Setting %s (%s) to %s\n", com, commands[comind].name, val));
   return commands[comind].action (com, val, commands[comind].place);
 }
index f7b3dca86086d3e2e5b9e843c50e308cc9569f6d..e84e5c61c22f45ac4a07cc3d77e0a667e90a3c61 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -762,7 +762,7 @@ escnonprint_uri (const char *str)
 void
 log_cleanup (void)
 {
 void
 log_cleanup (void)
 {
-  int i;
+  size_t i;
   for (i = 0; i < countof (ring); i++)
     xfree_null (ring[i].buffer);
 }
   for (i = 0; i < countof (ring); i++)
     xfree_null (ring[i].buffer);
 }
index d68cdbd6b937db48b44ca3d20b926c88e27cee08..009aa5e622d5adc2b324846469f96f7c9d5967ae 100644 (file)
@@ -294,7 +294,7 @@ static void
 init_switches (void)
 {
   char *p = short_options;
 init_switches (void)
 {
   char *p = short_options;
-  int i, o = 0;
+  size_t i, o = 0;
   for (i = 0; i < countof (option_data); i++)
     {
       struct cmdline_option *opt = &option_data[i];
   for (i = 0; i < countof (option_data); i++)
     {
       struct cmdline_option *opt = &option_data[i];
@@ -640,7 +640,7 @@ Recursive accept/reject:\n"),
     N_("Mail bug reports and suggestions to <bug-wget@gnu.org>.\n")
   };
 
     N_("Mail bug reports and suggestions to <bug-wget@gnu.org>.\n")
   };
 
-  int i;
+  size_t i;
 
   printf (_("GNU Wget %s, a non-interactive network retriever.\n"),
           version_string);
 
   printf (_("GNU Wget %s, a non-interactive network retriever.\n"),
           version_string);
index de108e76be44bb72e29bcdeef9a2a8e800472f54..2f1c22259dd1800579a5e94edb704436ac570a6f 100644 (file)
@@ -93,10 +93,10 @@ static int current_impl_locked;
 bool
 valid_progress_implementation_p (const char *name)
 {
 bool
 valid_progress_implementation_p (const char *name)
 {
-  int i;
+  size_t i;
   struct progress_implementation *pi = implementations;
   char *colon = strchr (name, ':');
   struct progress_implementation *pi = implementations;
   char *colon = strchr (name, ':');
-  int namelen = colon ? colon - name : strlen (name);
+  size_t namelen = colon ? (size_t) (colon - name) : strlen (name);
 
   for (i = 0; i < countof (implementations); i++, pi++)
     if (!strncmp (pi->name, name, namelen))
 
   for (i = 0; i < countof (implementations); i++, pi++)
     if (!strncmp (pi->name, name, namelen))
@@ -109,7 +109,7 @@ valid_progress_implementation_p (const char *name)
 void
 set_progress_implementation (const char *name)
 {
 void
 set_progress_implementation (const char *name)
 {
-  int i, namelen;
+  size_t i, namelen;
   struct progress_implementation *pi = implementations;
   const char *colon;
 
   struct progress_implementation *pi = implementations;
   const char *colon;
 
@@ -117,7 +117,7 @@ set_progress_implementation (const char *name)
     name = DEFAULT_PROGRESS_IMPLEMENTATION;
 
   colon = strchr (name, ':');
     name = DEFAULT_PROGRESS_IMPLEMENTATION;
 
   colon = strchr (name, ':');
-  namelen = colon ? colon - name : strlen (name);
+  namelen = colon ? (size_t) (colon - name) : strlen (name);
 
   for (i = 0; i < countof (implementations); i++, pi++)
     if (!strncmp (pi->name, name, namelen))
 
   for (i = 0; i < countof (implementations); i++, pi++)
     if (!strncmp (pi->name, name, namelen))
index 1e8c43c04e9fed6e1f6bf5801aabc7681ff553fb..88ad049dbc204ccf777d9caaa4b59de1dd6a5a8e 100644 (file)
@@ -133,7 +133,7 @@ posix_init (void)
 #endif
     { CLOCK_REALTIME, NO_SYSCONF_CHECK },
   };
 #endif
     { CLOCK_REALTIME, NO_SYSCONF_CHECK },
   };
-  int i;
+  size_t i;
 
   /* Determine the clock we can use.  For a clock to be usable, it
      must be confirmed with sysconf (where applicable) and with
 
   /* Determine the clock we can use.  For a clock to be usable, it
      must be confirmed with sysconf (where applicable) and with
index 08fefc9f353cb698a3321871dfe10f3a28322f40..98a296d4a54b9a97c0522f3ff8cfd368ff1efdd1 100644 (file)
@@ -85,7 +85,7 @@ print_broken_links (void)
   for (hash_table_iterate (nonexisting_urls_set, &iter);
        hash_table_iter_next (&iter); )
     {
   for (hash_table_iterate (nonexisting_urls_set, &iter);
        hash_table_iter_next (&iter); )
     {
-      struct url_list *list;
+      /* Struct url_list *list; */
       const char *url = (const char *) iter.key;
           
       logprintf (LOG_NOTQUIET, _("%s\n"), url);
       const char *url = (const char *) iter.key;
           
       logprintf (LOG_NOTQUIET, _("%s\n"), url);
index 87ba3cc9dc3e848b6617bb2680f9f90d99d14a5a..f5d621f9064ca4f4d68b8f3117361db9936e1d08 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -889,7 +889,7 @@ url_parse (const char *url, int *error)
 const char *
 url_error (int error_code)
 {
 const char *
 url_error (int error_code)
 {
-  assert (error_code >= 0 && error_code < countof (parse_errors));
+  assert (error_code >= 0 && ((size_t) error_code) < countof (parse_errors));
   return _(parse_errors[error_code]);
 }
 
   return _(parse_errors[error_code]);
 }
 
index a6c84491605517a8f0af7637ff681c70e943340f..15e3f89ba392b726050e6ba7dccc4af502bca4a7 100644 (file)
@@ -267,7 +267,7 @@ concat_strings (const char *str0, ...)
 
   const char *next_str;
   int total_length = 0;
 
   const char *next_str;
   int total_length = 0;
-  int argcount;
+  size_t argcount;
 
   /* Calculate the length of and allocate the resulting string. */
 
 
   /* Calculate the length of and allocate the resulting string. */
 
@@ -1386,7 +1386,7 @@ human_readable (HR_NUMTYPE n)
       'E',                      /* exabyte,  2^60 bytes */
     };
   static char buf[8];
       'E',                      /* exabyte,  2^60 bytes */
     };
   static char buf[8];
-  int i;
+  size_t i;
 
   /* If the quantity is smaller than 1K, just print it. */
   if (n < 1024)
 
   /* If the quantity is smaller than 1K, just print it. */
   if (n < 1024)