mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Declare the pointers to literal strings as `const'.
This commit is contained in:
parent
261183c609
commit
489452a23a
@ -1,3 +1,24 @@
|
||||
2003-12-14 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* url.c (url_file_name): Ditto.
|
||||
(parse_errors): Ditto.
|
||||
|
||||
* retr.c (retr_rate): Ditto.
|
||||
|
||||
* progress.c (create_image): Ditto.
|
||||
|
||||
* netrc.c (parse_netrc): Ditto.
|
||||
|
||||
* main.c (struct cmdline_option): Ditto.
|
||||
(redirect_output_signal): Ditto.
|
||||
|
||||
* init.c (commands): Ditto.
|
||||
|
||||
* ftp-ls.c (ftp_index): Ditto.
|
||||
|
||||
* cookies.c (check_domain_match): Declare the pointer to a literal
|
||||
string as `const'.
|
||||
|
||||
2003-12-12 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* retr.c (fd_read_body): Pass total size to progress_create, not
|
||||
|
@ -783,7 +783,7 @@ check_domain_match (const char *cookie_domain, const char *host)
|
||||
{
|
||||
int i;
|
||||
int known_toplevel = 0;
|
||||
static char *known_toplevel_domains[] = {
|
||||
static const char *known_toplevel_domains[] = {
|
||||
".com", ".edu", ".net", ".org", ".gov", ".mil", ".int"
|
||||
};
|
||||
for (i = 0; i < countof (known_toplevel_domains); i++)
|
||||
|
@ -867,7 +867,7 @@ ftp_index (const char *file, struct url *u, struct fileinfo *f)
|
||||
{
|
||||
/* #### Should we translate the months? Or, even better, use
|
||||
ISO 8601 dates? */
|
||||
static char *months[] = {
|
||||
static const char *months[] = {
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
@ -104,7 +104,7 @@ CMD_DECLARE (cmd_spec_useragent);
|
||||
cleanup() function below. */
|
||||
|
||||
static struct {
|
||||
char *name;
|
||||
const char *name;
|
||||
void *closure;
|
||||
int (*action) PARAMS ((const char *, const char *, void *));
|
||||
} commands[] = {
|
||||
|
@ -145,7 +145,7 @@ struct cmdline_option {
|
||||
OPT__NO,
|
||||
OPT__PARENT,
|
||||
} type;
|
||||
void *data; /* for standard options */
|
||||
const void *data; /* for standard options */
|
||||
int argtype; /* for non-standard options */
|
||||
};
|
||||
|
||||
@ -992,9 +992,9 @@ Can't timestamp and not clobber old files at the same time.\n"));
|
||||
static RETSIGTYPE
|
||||
redirect_output_signal (int sig)
|
||||
{
|
||||
char *signal_name = (sig == SIGHUP ? "SIGHUP" :
|
||||
(sig == SIGUSR1 ? "SIGUSR1" :
|
||||
"WTF?!"));
|
||||
const char *signal_name = (sig == SIGHUP ? "SIGHUP" :
|
||||
(sig == SIGUSR1 ? "SIGUSR1" :
|
||||
"WTF?!"));
|
||||
log_request_redirect_output (signal_name);
|
||||
progress_schedule_redirect ();
|
||||
signal (sig, redirect_output_signal);
|
||||
|
@ -258,7 +258,8 @@ static acc_t *
|
||||
parse_netrc (const char *path)
|
||||
{
|
||||
FILE *fp;
|
||||
char *line, *p, *tok, *premature_token;
|
||||
char *line, *p, *tok;
|
||||
const char *premature_token;
|
||||
acc_t *current, *retval;
|
||||
int ln, quote;
|
||||
|
||||
|
@ -50,7 +50,7 @@ so, delete this exception statement from your version. */
|
||||
#include "retr.h"
|
||||
|
||||
struct progress_implementation {
|
||||
char *name;
|
||||
const char *name;
|
||||
int interactive;
|
||||
void *(*create) PARAMS ((long, long));
|
||||
void (*update) PARAMS ((void *, long, double));
|
||||
@ -834,7 +834,7 @@ create_image (struct bar_progress *bp, double dl_total_time)
|
||||
/* " 1012.45K/s" */
|
||||
if (hist->total_time && hist->total_bytes)
|
||||
{
|
||||
static char *short_units[] = { "B/s", "K/s", "M/s", "G/s" };
|
||||
static const char *short_units[] = { "B/s", "K/s", "M/s", "G/s" };
|
||||
int units = 0;
|
||||
/* Calculate the download speed using the history ring and
|
||||
recent data that hasn't made it to the ring yet. */
|
||||
|
@ -485,7 +485,7 @@ char *
|
||||
retr_rate (long bytes, double msecs, int pad)
|
||||
{
|
||||
static char res[20];
|
||||
static char *rate_names[] = {"B/s", "KB/s", "MB/s", "GB/s" };
|
||||
static const char *rate_names[] = {"B/s", "KB/s", "MB/s", "GB/s" };
|
||||
int units = 0;
|
||||
|
||||
double dlrate = calc_rate (bytes, msecs, &units);
|
||||
|
@ -636,7 +636,7 @@ lowercase_str (char *str)
|
||||
return change;
|
||||
}
|
||||
|
||||
static char *parse_errors[] = {
|
||||
static const char *parse_errors[] = {
|
||||
#define PE_NO_ERROR 0
|
||||
N_("No error"),
|
||||
#define PE_UNSUPPORTED_SCHEME 1
|
||||
@ -1563,7 +1563,7 @@ url_file_name (const struct url *u)
|
||||
{
|
||||
struct growable fnres;
|
||||
|
||||
char *u_file, *u_query;
|
||||
const char *u_file, *u_query;
|
||||
char *fname, *unique;
|
||||
|
||||
fnres.base = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user