]> sjero.net Git - wget/commitdiff
[svn] Declare the pointers to literal strings as `const'.
authorhniksic <devnull@localhost>
Sun, 14 Dec 2003 13:35:27 +0000 (05:35 -0800)
committerhniksic <devnull@localhost>
Sun, 14 Dec 2003 13:35:27 +0000 (05:35 -0800)
src/ChangeLog
src/cookies.c
src/ftp-ls.c
src/init.c
src/main.c
src/netrc.c
src/progress.c
src/retr.c
src/url.c

index 9a10ea467c39a472718cb62bb2e2dd3787ca0b6a..f5588fbc7e42f0731fd7cd3c67cf6f3d2fc11948 100644 (file)
@@ -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
index 72ef0a9de3ead3821ee680804fd2271bc1b0326c..98ab423c1f7782598988341349c27bdcbe8f1c37 100644 (file)
@@ -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++)
index 5c8532294ae348998ab975734391b0167e5b59cd..189bad9325699fa21c6d0ecac951a020d82c505d 100644 (file)
@@ -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"
          };
index 6ece81cd80f5e44a8c5118a2a720ba48ed529f04..baafc09c7c68ab3b9ca0b37af746f78edcf54e38 100644 (file)
@@ -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[] = {
index 6391ebf2cbd34ad3483d1c87d5b7ff774ac84f3c..951dc04b4ba8a6fd5593e7699c862f179e7d6996 100644 (file)
@@ -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);
index af2b2b492a839d50720534a3775a87e10f85a02b..5f9588edbabcd7b7c6826582d579693b2a18b747 100644 (file)
@@ -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;
 
index 33ccb7c9c465e358fc691ca50ee9f5c7753ae6de..9ff2f9836be49ba1c2c7f26cbf81455056a35436 100644 (file)
@@ -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.  */
index 3415ff02d5feb3c3accf2996fc64c25fd389cdef..1aae6e23702c77f0103e8d6a294f9078fe60f796 100644 (file)
@@ -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);
index 2bbf84be5b20f4c1f0a673d690deee10d8ffaeb9..8baa9869483ee344ecfc4fe9936f0644fb7157d3 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -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;