mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Fix some compiler warnings.
This commit is contained in:
parent
378c203079
commit
0aa3c5d33c
@ -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>
|
2012-03-30 Tim Ruehsen <tim.ruehsen@gmx.de>
|
||||||
|
|
||||||
* url.c: Use empty query in local filenames.
|
* url.c: Use empty query in local filenames.
|
||||||
|
@ -58,7 +58,7 @@ struct hash_table *downloaded_css_set;
|
|||||||
static void convert_links (const char *, struct urlpos *);
|
static void convert_links (const char *, struct urlpos *);
|
||||||
|
|
||||||
|
|
||||||
void
|
static void
|
||||||
convert_links_in_hashtable (struct hash_table *downloaded_set,
|
convert_links_in_hashtable (struct hash_table *downloaded_set,
|
||||||
int is_css,
|
int is_css,
|
||||||
int *file_count)
|
int *file_count)
|
||||||
|
@ -391,6 +391,9 @@ parse_set_cookie (const char *set_cookie, bool silent)
|
|||||||
goto error;
|
goto error;
|
||||||
BOUNDED_TO_ALLOCA (value.b, value.e, value_copy);
|
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);
|
expires = http_atotm (value_copy);
|
||||||
if (expires != (time_t) -1)
|
if (expires != (time_t) -1)
|
||||||
{
|
{
|
||||||
@ -402,10 +405,6 @@ parse_set_cookie (const char *set_cookie, bool silent)
|
|||||||
if (cookie->expiry_time < cookies_now)
|
if (cookie->expiry_time < cookies_now)
|
||||||
cookie->discard_requested = 1;
|
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"))
|
else if (TOKEN_IS (name, "max-age"))
|
||||||
{
|
{
|
||||||
@ -433,9 +432,7 @@ parse_set_cookie (const char *set_cookie, bool silent)
|
|||||||
/* ignore value completely */
|
/* ignore value completely */
|
||||||
cookie->secure = 1;
|
cookie->secure = 1;
|
||||||
}
|
}
|
||||||
else
|
/* else: Ignore unrecognized attribute. */
|
||||||
/* Ignore unrecognized attribute. */
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
if (*ptr)
|
if (*ptr)
|
||||||
/* extract_param has encountered a syntax error */
|
/* extract_param has encountered a syntax error */
|
||||||
|
@ -55,6 +55,7 @@ as that of the covered work. */
|
|||||||
#include "convert.h"
|
#include "convert.h"
|
||||||
#include "html-url.h"
|
#include "html-url.h"
|
||||||
#include "css-tokens.h"
|
#include "css-tokens.h"
|
||||||
|
#include "css-url.h"
|
||||||
|
|
||||||
/* from lex.yy.c */
|
/* from lex.yy.c */
|
||||||
extern char *yytext;
|
extern char *yytext;
|
||||||
@ -107,7 +108,7 @@ const char *token_names[] = {
|
|||||||
whitespace after the opening parenthesis and before the closing
|
whitespace after the opening parenthesis and before the closing
|
||||||
parenthesis.
|
parenthesis.
|
||||||
*/
|
*/
|
||||||
char *
|
static char *
|
||||||
get_uri_string (const char *at, int *pos, int *length)
|
get_uri_string (const char *at, int *pos, int *length)
|
||||||
{
|
{
|
||||||
char *uri;
|
char *uri;
|
||||||
|
@ -30,6 +30,7 @@ as that of the covered work. */
|
|||||||
#ifndef CSS_URL_H
|
#ifndef CSS_URL_H
|
||||||
#define 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);
|
void get_urls_css (struct map_context *, int, int);
|
||||||
struct urlpos *get_urls_css_file (const char *, const char *);
|
struct urlpos *get_urls_css_file (const char *, const char *);
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ key_type_to_gnutls_type (enum keyfile_type type)
|
|||||||
|
|
||||||
static gnutls_certificate_credentials credentials;
|
static gnutls_certificate_credentials credentials;
|
||||||
bool
|
bool
|
||||||
ssl_init ()
|
ssl_init (void)
|
||||||
{
|
{
|
||||||
/* Becomes true if GnuTLS is initialized. */
|
/* Becomes true if GnuTLS is initialized. */
|
||||||
static bool ssl_initialized = false;
|
static bool ssl_initialized = false;
|
||||||
|
@ -280,7 +280,7 @@ struct tagstack_item {
|
|||||||
struct tagstack_item *next;
|
struct tagstack_item *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct tagstack_item *
|
static struct tagstack_item *
|
||||||
tagstack_push (struct tagstack_item **head, struct tagstack_item **tail)
|
tagstack_push (struct tagstack_item **head, struct tagstack_item **tail)
|
||||||
{
|
{
|
||||||
struct tagstack_item *ts = xmalloc(sizeof(struct tagstack_item));
|
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 */
|
/* remove ts and everything after it from the stack */
|
||||||
void
|
static void
|
||||||
tagstack_pop (struct tagstack_item **head, struct tagstack_item **tail,
|
tagstack_pop (struct tagstack_item **head, struct tagstack_item **tail,
|
||||||
struct tagstack_item *ts)
|
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,
|
tagstack_find (struct tagstack_item *tail, const char *tagname_begin,
|
||||||
const char *tagname_end)
|
const char *tagname_end)
|
||||||
{
|
{
|
||||||
|
@ -830,7 +830,7 @@ get_urls_file (const char *file)
|
|||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
cleanup_html_url (void)
|
cleanup_html_url (void)
|
||||||
{
|
{
|
||||||
/* Destroy the hash tables. The hash table keys and values are not
|
/* Destroy the hash tables. The hash table keys and values are not
|
||||||
|
@ -766,7 +766,7 @@ update_speed_ring (struct bar_progress *bp, wgint howmuch, double dltime)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if USE_NLS_PROGRESS_BAR
|
#if USE_NLS_PROGRESS_BAR
|
||||||
int
|
static int
|
||||||
count_cols (const char *mbs)
|
count_cols (const char *mbs)
|
||||||
{
|
{
|
||||||
wchar_t wc;
|
wchar_t wc;
|
||||||
@ -795,7 +795,7 @@ count_cols (const char *mbs)
|
|||||||
# define count_cols(mbs) ((int)(strlen(mbs)))
|
# define count_cols(mbs) ((int)(strlen(mbs)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *
|
static const char *
|
||||||
get_eta (int *bcd)
|
get_eta (int *bcd)
|
||||||
{
|
{
|
||||||
/* TRANSLATORS: "ETA" is English-centric, but this must
|
/* TRANSLATORS: "ETA" is English-centric, but this must
|
||||||
|
@ -75,6 +75,4 @@ void set_local_file (const char **, const char *);
|
|||||||
|
|
||||||
bool input_file_url (const char *);
|
bool input_file_url (const char *);
|
||||||
|
|
||||||
wgint convert_to_bits (wgint num);
|
|
||||||
|
|
||||||
#endif /* RETR_H */
|
#endif /* RETR_H */
|
||||||
|
@ -45,7 +45,7 @@ static struct hash_table *nonexisting_urls_set;
|
|||||||
|
|
||||||
/* Cleanup the data structures associated with this file. */
|
/* Cleanup the data structures associated with this file. */
|
||||||
|
|
||||||
void
|
static void
|
||||||
spider_cleanup (void)
|
spider_cleanup (void)
|
||||||
{
|
{
|
||||||
if (nonexisting_urls_set)
|
if (nonexisting_urls_set)
|
||||||
|
@ -127,6 +127,7 @@ char *human_readable (HR_NUMTYPE);
|
|||||||
int numdigit (wgint);
|
int numdigit (wgint);
|
||||||
char *number_to_string (char *, wgint);
|
char *number_to_string (char *, wgint);
|
||||||
char *number_to_static_string (wgint);
|
char *number_to_static_string (wgint);
|
||||||
|
wgint convert_to_bits (wgint);
|
||||||
|
|
||||||
int determine_screen_width (void);
|
int determine_screen_width (void);
|
||||||
int random_number (int);
|
int random_number (int);
|
||||||
|
22
src/warc.c
22
src/warc.c
@ -180,7 +180,7 @@ warc_write_string (const char *str)
|
|||||||
Returns false and set warc_write_ok to false if there
|
Returns false and set warc_write_ok to false if there
|
||||||
is an error. */
|
is an error. */
|
||||||
static bool
|
static bool
|
||||||
warc_write_start_record ()
|
warc_write_start_record (void)
|
||||||
{
|
{
|
||||||
if (!warc_write_ok)
|
if (!warc_write_ok)
|
||||||
return false;
|
return false;
|
||||||
@ -279,7 +279,7 @@ warc_write_block_from_file (FILE *data_in)
|
|||||||
with the uncompressed and compressed length of the
|
with the uncompressed and compressed length of the
|
||||||
record. */
|
record. */
|
||||||
static bool
|
static bool
|
||||||
warc_write_end_record ()
|
warc_write_end_record (void)
|
||||||
{
|
{
|
||||||
warc_write_buffer ("\r\n\r\n", 4);
|
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.
|
/* Write a warcinfo record to the current file.
|
||||||
Updates warc_current_warcinfo_uuid_str. */
|
Updates warc_current_warcinfo_uuid_str. */
|
||||||
bool
|
static bool
|
||||||
warc_write_warcinfo_record (char *filename)
|
warc_write_warcinfo_record (char *filename)
|
||||||
{
|
{
|
||||||
/* Write warc-info record as the first record of the file. */
|
/* 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. */
|
/* Opens the CDX file for output. */
|
||||||
static bool
|
static bool
|
||||||
warc_start_cdx_file ()
|
warc_start_cdx_file (void)
|
||||||
{
|
{
|
||||||
int filename_length = strlen (opt.warc_filename);
|
int filename_length = strlen (opt.warc_filename);
|
||||||
char *cdx_filename = alloca (filename_length + 4 + 1);
|
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
|
/* Loads the CDX file from opt.warc_cdx_dedup_filename and fills
|
||||||
the warc_cdx_dedup_table. */
|
the warc_cdx_dedup_table. */
|
||||||
bool
|
static bool
|
||||||
warc_load_cdx_dedup_file ()
|
warc_load_cdx_dedup_file (void)
|
||||||
{
|
{
|
||||||
FILE *f = fopen (opt.warc_cdx_dedup_filename, "r");
|
FILE *f = fopen (opt.warc_cdx_dedup_filename, "r");
|
||||||
if (f == NULL)
|
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).
|
/* Initializes the WARC writer (if opt.warc_filename is set).
|
||||||
This should be called before any WARC record is written. */
|
This should be called before any WARC record is written. */
|
||||||
void
|
void
|
||||||
warc_init ()
|
warc_init (void)
|
||||||
{
|
{
|
||||||
warc_write_ok = true;
|
warc_write_ok = true;
|
||||||
|
|
||||||
@ -1039,8 +1039,8 @@ warc_init ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Writes metadata (manifest, configuration, log file) to the WARC file. */
|
/* Writes metadata (manifest, configuration, log file) to the WARC file. */
|
||||||
void
|
static void
|
||||||
warc_write_metadata ()
|
warc_write_metadata (void)
|
||||||
{
|
{
|
||||||
/* If there are multiple WARC files, the metadata should be written to a separate file. */
|
/* If there are multiple WARC files, the metadata should be written to a separate file. */
|
||||||
if (opt.warc_maxsize > 0)
|
if (opt.warc_maxsize > 0)
|
||||||
@ -1087,7 +1087,7 @@ warc_write_metadata ()
|
|||||||
/* Finishes the WARC writing.
|
/* Finishes the WARC writing.
|
||||||
This should be called at the end of the program. */
|
This should be called at the end of the program. */
|
||||||
void
|
void
|
||||||
warc_close ()
|
warc_close (void)
|
||||||
{
|
{
|
||||||
if (warc_current_file != NULL)
|
if (warc_current_file != NULL)
|
||||||
{
|
{
|
||||||
@ -1108,7 +1108,7 @@ warc_close ()
|
|||||||
The temporary file will be created in opt.warc_tempdir.
|
The temporary file will be created in opt.warc_tempdir.
|
||||||
Returns the pointer to the temporary file, or NULL. */
|
Returns the pointer to the temporary file, or NULL. */
|
||||||
FILE *
|
FILE *
|
||||||
warc_tempfile ()
|
warc_tempfile (void)
|
||||||
{
|
{
|
||||||
char filename[100];
|
char filename[100];
|
||||||
if (path_search (filename, 100, opt.warc_tempdir, "wget", true) == -1)
|
if (path_search (filename, 100, opt.warc_tempdir, "wget", true) == -1)
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
#include "host.h"
|
#include "host.h"
|
||||||
|
|
||||||
void warc_init ();
|
void warc_init (void);
|
||||||
void warc_close ();
|
void warc_close (void);
|
||||||
void warc_timestamp (char *timestamp);
|
void warc_timestamp (char *timestamp);
|
||||||
void warc_uuid_str (char *id_str);
|
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_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);
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user