]> sjero.net Git - wget/commitdiff
Fix some compiler warnings.
authorTim Ruehsen <tim.ruehsen@gmx.de>
Sat, 5 May 2012 13:24:35 +0000 (15:24 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 5 May 2012 13:24:35 +0000 (15:24 +0200)
14 files changed:
src/ChangeLog
src/convert.c
src/cookies.c
src/css-url.c
src/css-url.h
src/gnutls.c
src/html-parse.c
src/html-url.c
src/progress.c
src/retr.h
src/spider.c
src/utils.h
src/warc.c
src/warc.h

index c7675e8806aaf9c1a66c5abca200a11f1ab0eace..a1d2c2a5dce81819510f7157136574860f48c68d 100644 (file)
@@ -1,3 +1,35 @@
+2012-03-30  Tim Ruehsen  <tim.ruehsen@gmx.de>
+
+       * convert.c (convert_links_in_hashtable): Mmake it static.
+       * cookies.c (parse_set_cookie): Remove empty else branches.
+       * css-url.c: Include "css-url.h".
+       (get_uri_string): Make it static.
+       * css-url.h (get_urls_css): Add protoype.
+       * gnutls.c (ssl_init): Add prototype.
+       * html-parse.c (tagstack_push): Make it static.
+       * html-parse.c (tagstack_pop): Make it static.
+       * html-parse.c (tagstack_find): Make it static.
+       * html-url.c (cleanup_html_url): Make it static.
+       * progress.c (count_cols): Make it static.
+       * progress.c (get_eta): Make it static.
+       * retr.h (convert_to_bits): Remove prototype.
+       * util.h (convert_to_bits): Add prototype.
+       * spider.c (spider_cleanup): Make it static.
+       * warc.c (warc_write_start_record): Add prototype.
+       * warc.c (warc_write_end_record): Add prototype.
+       * warc.c (warc_start_cdx_file): Add prototype.
+       * warc.c (warc_init): Add prototype.
+       * warc.c (warc_load_cdx_dedup_file): Add prototype.
+       * warc.c (warc_write_metadata): Add prototype.
+       * warc.c (warc_close): Add prototype.
+       * warc.c (warc_tempfile): Add prototype.
+       * warc.c (warc_write_warcinfo_record): Make it static.
+       * warc.c (warc_load_cdx_dedup_file): Make it static.
+       * warc.c (warc_write_metadata): Make it static.
+       * warc.h (warc_init): Fix prototype.
+       * warc.h (warc_close): Fix prototype.
+       * warc.h (warc_tempfile): Fix prototype.
+
 2012-03-30  Tim Ruehsen  <tim.ruehsen@gmx.de>
 
        * url.c: Use empty query in local filenames.
index c6ccf53404cfdce0f579d3972365682df918dd11..6cf6f2724d7a1ed89345cf2ee17422d093cb0b22 100644 (file)
@@ -58,7 +58,7 @@ struct hash_table *downloaded_css_set;
 static void convert_links (const char *, struct urlpos *);
 
 
-void
+static void
 convert_links_in_hashtable (struct hash_table *downloaded_set,
                             int is_css,
                             int *file_count)
index 7c3fb1cbab9708b7a20e45b449edf7528fc28983..a10971ca86e35fc09ccfc2436e6227224610c64c 100644 (file)
@@ -391,6 +391,9 @@ parse_set_cookie (const char *set_cookie, bool silent)
             goto error;
           BOUNDED_TO_ALLOCA (value.b, value.e, value_copy);
 
+          /* Check if expiration spec is valid.
+             If not, assume default (cookie doesn't expire, but valid only for
+            this session.) */
           expires = http_atotm (value_copy);
           if (expires != (time_t) -1)
             {
@@ -402,10 +405,6 @@ parse_set_cookie (const char *set_cookie, bool silent)
               if (cookie->expiry_time < cookies_now)
                 cookie->discard_requested = 1;
             }
-          else
-            /* Error in expiration spec.  Assume default (cookie doesn't
-               expire, but valid only for this session.)  */
-            ;
         }
       else if (TOKEN_IS (name, "max-age"))
         {
@@ -433,9 +432,7 @@ parse_set_cookie (const char *set_cookie, bool silent)
           /* ignore value completely */
           cookie->secure = 1;
         }
-      else
-        /* Ignore unrecognized attribute. */
-        ;
+      /* else: Ignore unrecognized attribute. */
     }
   if (*ptr)
     /* extract_param has encountered a syntax error */
index de1caad932a3f3ce77afd619e2a62a090eae466f..f97690d6046c155c015b18254a2f690d4442a65e 100644 (file)
@@ -55,6 +55,7 @@ as that of the covered work.  */
 #include "convert.h"
 #include "html-url.h"
 #include "css-tokens.h"
+#include "css-url.h"
 
 /* from lex.yy.c */
 extern char *yytext;
@@ -107,7 +108,7 @@ const char *token_names[] = {
   whitespace after the opening parenthesis and before the closing
   parenthesis.
 */
-char *
+static char *
 get_uri_string (const char *at, int *pos, int *length)
 {
   char *uri;
index 8d32c34f50c147dd5dffd5dbfe728d453d8809ad..7f940e69fddca9f0a7ead16c8c3850b036e2e59f 100644 (file)
@@ -30,6 +30,7 @@ as that of the covered work.  */
 #ifndef CSS_URL_H
 #define CSS_URL_H
 
+void get_urls_css (struct map_context *, int, int);
 void get_urls_css (struct map_context *, int, int);
 struct urlpos *get_urls_css_file (const char *, const char *);
 
index cbd5e1da38f7b1dc43ab59c0c6d91c709aaa6db7..7cc2e7187f4e6d0b2827ebf3c87c89e82aaecb9b 100644 (file)
@@ -77,7 +77,7 @@ key_type_to_gnutls_type (enum keyfile_type type)
 
 static gnutls_certificate_credentials credentials;
 bool
-ssl_init ()
+ssl_init (void)
 {
   /* Becomes true if GnuTLS is initialized. */
   static bool ssl_initialized = false;
index 9fafd8f5a1177c02c455615ea7f3dfc5f37d493d..20791cd83450272210c17a129ecd6904aec86231 100644 (file)
@@ -280,7 +280,7 @@ struct tagstack_item {
   struct tagstack_item *next;
 };
 
-struct tagstack_item *
+static struct tagstack_item *
 tagstack_push (struct tagstack_item **head, struct tagstack_item **tail)
 {
   struct tagstack_item *ts = xmalloc(sizeof(struct tagstack_item));
@@ -301,7 +301,7 @@ tagstack_push (struct tagstack_item **head, struct tagstack_item **tail)
 }
 
 /* remove ts and everything after it from the stack */
-void
+static void
 tagstack_pop (struct tagstack_item **head, struct tagstack_item **tail,
               struct tagstack_item *ts)
 {
@@ -343,7 +343,7 @@ tagstack_pop (struct tagstack_item **head, struct tagstack_item **tail,
     }
 }
 
-struct tagstack_item *
+static struct tagstack_item *
 tagstack_find (struct tagstack_item *tail, const char *tagname_begin,
                const char *tagname_end)
 {
index 855393a726a03dedc6fcd71d74d51304ec1549d9..55563e2d3fc2aa9e5bd804999b3e33533f456f6d 100644 (file)
@@ -830,7 +830,7 @@ get_urls_file (const char *file)
   return head;
 }
 
-void
+static void
 cleanup_html_url (void)
 {
   /* Destroy the hash tables.  The hash table keys and values are not
index 799d6e37e53584bb58e894013e994a378e694ad7..f61c95e5bb981ace0b202223a1b5a14b4574cc82 100644 (file)
@@ -766,7 +766,7 @@ update_speed_ring (struct bar_progress *bp, wgint howmuch, double dltime)
 }
 
 #if USE_NLS_PROGRESS_BAR
-int
+static int
 count_cols (const char *mbs)
 {
   wchar_t wc;
@@ -795,7 +795,7 @@ count_cols (const char *mbs)
 # define count_cols(mbs) ((int)(strlen(mbs)))
 #endif
 
-const char *
+static const char *
 get_eta (int *bcd)
 {
   /* TRANSLATORS: "ETA" is English-centric, but this must
index 776238b1298395d7a156b830d7acba846c47e2c5..22ab9ecd8a5ec39919f67eefcb7415f64ec25253 100644 (file)
@@ -75,6 +75,4 @@ void set_local_file (const char **, const char *);
 
 bool input_file_url (const char *);
 
-wgint convert_to_bits (wgint num);
-
 #endif /* RETR_H */
index ae2f392c2252abf0fefe3e9f7b7134240b7b5d8d..dad9a23dcf764a10c8c3a547db68c44b047882b9 100644 (file)
@@ -45,7 +45,7 @@ static struct hash_table *nonexisting_urls_set;
 
 /* Cleanup the data structures associated with this file.  */
 
-void
+static void
 spider_cleanup (void)
 {
   if (nonexisting_urls_set)
index 8b1a8a11db0deccf794f09a6f11a12936b5e38ab..514c5f26514e8215007d8696016dcd609c0cb2f0 100644 (file)
@@ -127,6 +127,7 @@ char *human_readable (HR_NUMTYPE);
 int numdigit (wgint);
 char *number_to_string (char *, wgint);
 char *number_to_static_string (wgint);
+wgint convert_to_bits (wgint);
 
 int determine_screen_width (void);
 int random_number (int);
index 911cebd7ee1fbbc2cee11b8b256676717a098901..fa0830dce4f431c3b1dcf7f9ab3c59f5890931af 100644 (file)
@@ -180,7 +180,7 @@ warc_write_string (const char *str)
    Returns false and set warc_write_ok to false if there
    is an error.  */
 static bool
-warc_write_start_record ()
+warc_write_start_record (void)
 {
   if (!warc_write_ok)
     return false;
@@ -279,7 +279,7 @@ warc_write_block_from_file (FILE *data_in)
    with the uncompressed and compressed length of the
    record. */
 static bool
-warc_write_end_record ()
+warc_write_end_record (void)
 {
   warc_write_buffer ("\r\n\r\n", 4);
 
@@ -633,7 +633,7 @@ warc_uuid_str (char *urn_str)
 
 /* Write a warcinfo record to the current file.
    Updates warc_current_warcinfo_uuid_str. */
-bool
+static bool
 warc_write_warcinfo_record (char *filename)
 {
   /* Write warc-info record as the first record of the file. */
@@ -760,7 +760,7 @@ warc_start_new_file (bool meta)
 
 /* Opens the CDX file for output. */
 static bool
-warc_start_cdx_file ()
+warc_start_cdx_file (void)
 {
   int filename_length = strlen (opt.warc_filename);
   char *cdx_filename = alloca (filename_length + 4 + 1);
@@ -899,8 +899,8 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url, int field_num_
 
 /* Loads the CDX file from opt.warc_cdx_dedup_filename and fills
    the warc_cdx_dedup_table. */
-bool
-warc_load_cdx_dedup_file ()
+static bool
+warc_load_cdx_dedup_file (void)
 {
   FILE *f = fopen (opt.warc_cdx_dedup_filename, "r");
   if (f == NULL)
@@ -985,7 +985,7 @@ warc_find_duplicate_cdx_record (char *url, char *sha1_digest_payload)
 /* Initializes the WARC writer (if opt.warc_filename is set).
    This should be called before any WARC record is written. */
 void
-warc_init ()
+warc_init (void)
 {
   warc_write_ok = true;
 
@@ -1039,8 +1039,8 @@ warc_init ()
 }
 
 /* Writes metadata (manifest, configuration, log file) to the WARC file. */
-void
-warc_write_metadata ()
+static void
+warc_write_metadata (void)
 {
   /* If there are multiple WARC files, the metadata should be written to a separate file. */
   if (opt.warc_maxsize > 0)
@@ -1087,7 +1087,7 @@ warc_write_metadata ()
 /* Finishes the WARC writing.
    This should be called at the end of the program. */
 void
-warc_close ()
+warc_close (void)
 {
   if (warc_current_file != NULL)
     {
@@ -1108,7 +1108,7 @@ warc_close ()
    The temporary file will be created in opt.warc_tempdir.
    Returns the pointer to the temporary file, or NULL. */
 FILE *
-warc_tempfile ()
+warc_tempfile (void)
 {
   char filename[100];
   if (path_search (filename, 100, opt.warc_tempdir, "wget", true) == -1)
index 84daad4c7cb00cfb60487236e0ae4f563b6506b1..41829d1244ed560d700723c4e1637a303ae6e552 100644 (file)
@@ -4,12 +4,12 @@
 
 #include "host.h"
 
-void warc_init ();
-void warc_close ();
+void warc_init (void);
+void warc_close (void);
 void warc_timestamp (char *timestamp);
 void warc_uuid_str (char *id_str);
 
-FILE * warc_tempfile ();
+FILE * warc_tempfile (void);
 
 bool warc_write_request_record (char *url, char *timestamp_str, char *concurrent_to_uuid, ip_address *ip, FILE *body, off_t payload_offset);
 bool warc_write_response_record (char *url, char *timestamp_str, char *concurrent_to_uuid, ip_address *ip, FILE *body, off_t payload_offset, char *mime_type, int response_code, char *redirect_location);