]> sjero.net Git - wget/commitdiff
[svn] Don't cast return type of malloc/realloc. Assume ANSI C signal handlers.
authorhniksic <devnull@localhost>
Sun, 19 Jun 2005 23:03:27 +0000 (16:03 -0700)
committerhniksic <devnull@localhost>
Sun, 19 Jun 2005 23:03:27 +0000 (16:03 -0700)
18 files changed:
ChangeLog
configure.in
src/ChangeLog
src/convert.c
src/ftp-ls.c
src/hash.c
src/html-parse.c
src/http.c
src/log.c
src/main.c
src/mswindows.c
src/netrc.c
src/progress.c
src/progress.h
src/url.c
src/utils.c
src/wget.h
src/xmalloc.h

index fc2e0bc56f303e4eea2839a19584715acdb791e6..7986bc97c0e45392c4c5db367a4889d933340556 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-20  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * configure.in: Don't check for the return type of signal
+       handlers; C89 requires it to be void.
+
 2005-06-19  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * aclocal.m4: Remove support for K&R compilers.
 2005-06-19  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * aclocal.m4: Remove support for K&R compilers.
index ca56ace1fab5d21de79294f59777c4e134b13e5a..09e9bd5f761992c912d1b18ab4a2bf5d2b2a953c 100644 (file)
@@ -191,7 +191,6 @@ dnl
 AC_TYPE_SIZE_T
 AC_TYPE_PID_T
 AC_CHECK_TYPES(uint32_t)
 AC_TYPE_SIZE_T
 AC_TYPE_PID_T
 AC_CHECK_TYPES(uint32_t)
-AC_TYPE_SIGNAL
 AC_CHECK_TYPES(sig_atomic_t, [], [], [
 #include <stdio.h>
 #include <sys/types.h>
 AC_CHECK_TYPES(sig_atomic_t, [], [], [
 #include <stdio.h>
 #include <sys/types.h>
index fc3a5bc163f5ac0e7cc798b6c46fb052a44f0ee6..a3b726c260073f7c5155f080819e63659209faa0 100644 (file)
@@ -1,3 +1,12 @@
+2005-06-20  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * all: Return type of signal handlers is `void'.  Include signal.h
+       unconditionally.
+
+       * all: Don't explicitly cast values returned by malloc.  We no
+       longer support ancient compilers that don't declare malloc, and we
+       never supported C++ builds.
+
 2005-06-19  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * all: Don't declare errno.  Include both time.h and sys/time.h,
 2005-06-19  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * all: Don't declare errno.  Include both time.h and sys/time.h,
index 04beea2455a67f2dd33ceaa46c0ef7e98a40b503..8c1d007c9b3ce46b21604812516b56d9f872dcad 100644 (file)
@@ -382,7 +382,7 @@ construct_relative (const char *basefile, const char *linkfile)
     }
 
   /* Construct LINK as explained above. */
     }
 
   /* Construct LINK as explained above. */
-  link = (char *)xmalloc (3 * basedirs + strlen (linkfile) + 1);
+  link = xmalloc (3 * basedirs + strlen (linkfile) + 1);
   for (i = 0; i < basedirs; i++)
     memcpy (link + 3 * i, "../", 3);
   strcpy (link + 3 * i, linkfile);
   for (i = 0; i < basedirs; i++)
     memcpy (link + 3 * i, "../", 3);
   strcpy (link + 3 * i, linkfile);
@@ -985,7 +985,7 @@ html_quote_string (const char *s)
       else if (*s == ' ')
        i += 4;                 /* #32; */
     }
       else if (*s == ' ')
        i += 4;                 /* #32; */
     }
-  res = (char *)xmalloc (i + 1);
+  res = xmalloc (i + 1);
   s = b;
   for (p = res; *s; s++)
     {
   s = b;
   for (p = res; *s; s++)
     {
index ca56a0948e887fdd26b672c902332b970cecb758..6fa16fa6de88c09c4d466b008fba1dba5e3965b0 100644 (file)
@@ -330,7 +330,7 @@ ftp_parse_unix_ls (const char *file, int ignore_perms)
                 default -F output.  I believe these cases are very
                 rare.  */
              fnlen = strlen (tok); /* re-calculate `fnlen' */
                 default -F output.  I believe these cases are very
                 rare.  */
              fnlen = strlen (tok); /* re-calculate `fnlen' */
-             cur.name = (char *)xmalloc (fnlen + 1);
+             cur.name = xmalloc (fnlen + 1);
              memcpy (cur.name, tok, fnlen + 1);
              if (fnlen)
                {
              memcpy (cur.name, tok, fnlen + 1);
              if (fnlen)
                {
@@ -775,14 +775,14 @@ ftp_parse_vms_ls (const char *file)
       /* And put everything into the linked list */
       if (!dir)
         {
       /* And put everything into the linked list */
       if (!dir)
         {
-          l = dir = (struct fileinfo *)xmalloc (sizeof (struct fileinfo));
+          l = dir = xnew (struct fileinfo);
           memcpy (l, &cur, sizeof (cur));
           l->prev = l->next = NULL;
         }
       else
         {
           cur.prev = l;
           memcpy (l, &cur, sizeof (cur));
           l->prev = l->next = NULL;
         }
       else
         {
           cur.prev = l;
-          l->next = (struct fileinfo *)xmalloc (sizeof (struct fileinfo));
+          l->next = xnew (struct fileinfo);
           l = l->next;
           memcpy (l, &cur, sizeof (cur));
           l->next = NULL;
           l = l->next;
           memcpy (l, &cur, sizeof (cur));
           l->next = NULL;
index e344092e5e5b61876b58c7e96185c8ea06364a21..ec9b7b5461d26e6b905b8851cf44d42355dae38f 100644 (file)
@@ -1,5 +1,5 @@
 /* Hash tables.
 /* Hash tables.
-   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
 
 This file is part of GNU Wget.
 
@@ -48,8 +48,7 @@ so, delete this exception statement from your version.  */
 /* Make do without them. */
 # define xnew(x) xmalloc (sizeof (x))
 # define xnew_array(type, x) xmalloc (sizeof (type) * (x))
 /* Make do without them. */
 # define xnew(x) xmalloc (sizeof (x))
 # define xnew_array(type, x) xmalloc (sizeof (type) * (x))
-# define xmalloc malloc                /* or something that exits
-                                  if not enough memory */
+# define xmalloc malloc
 # define xfree free
 # define countof(x) (sizeof (x) / sizeof ((x)[0]))
 # define TOLOWER(x) ('A' <= (x) && (x) <= 'Z' ? (x) - 32 : (x))
 # define xfree free
 # define countof(x) (sizeof (x) / sizeof ((x)[0]))
 # define TOLOWER(x) ('A' <= (x) && (x) <= 'Z' ? (x) - 32 : (x))
index 4a0a525771a97d173ee10bd713741e2c5f7a11f4..19fbd3cfec8464660cbd7ee57ce79dfbca8ccb35 100644 (file)
@@ -241,7 +241,7 @@ struct pool {
   if (ga_newsize != (sizevar))                                                 \
     {                                                                          \
       if (resized)                                                             \
   if (ga_newsize != (sizevar))                                                 \
     {                                                                          \
       if (resized)                                                             \
-       basevar = (type *)xrealloc (basevar, ga_newsize * sizeof (type));       \
+       basevar = xrealloc (basevar, ga_newsize * sizeof (type));               \
       else                                                                     \
        {                                                                       \
          void *ga_new = xmalloc (ga_newsize * sizeof (type));                  \
       else                                                                     \
        {                                                                       \
          void *ga_new = xmalloc (ga_newsize * sizeof (type));                  \
@@ -1051,7 +1051,7 @@ test_mapper (struct taginfo *taginfo, void *arg)
 int main ()
 {
   int size = 256;
 int main ()
 {
   int size = 256;
-  char *x = (char *)xmalloc (size);
+  char *x = xmalloc (size);
   int length = 0;
   int read_count;
   int tag_counter = 0;
   int length = 0;
   int read_count;
   int tag_counter = 0;
@@ -1060,7 +1060,7 @@ int main ()
     {
       length += read_count;
       size <<= 1;
     {
       length += read_count;
       size <<= 1;
-      x = (char *)xrealloc (x, size);
+      x = xrealloc (x, size);
     }
 
   map_html_tags (x, length, test_mapper, &tag_counter, 0, NULL, NULL);
     }
 
   map_html_tags (x, length, test_mapper, &tag_counter, 0, NULL, NULL);
index 7b3f379dec0d323162a296c26741488c1081ebda..06c3c5bdafcab564cde2d60d0b088b36e41b68f3 100644 (file)
@@ -2870,14 +2870,14 @@ digest_authentication_encode (const char *au, const char *user,
     gen_md5_finish (ctx, hash);
     dump_hash (response_digest, hash);
 
     gen_md5_finish (ctx, hash);
     dump_hash (response_digest, hash);
 
-    res = (char*) xmalloc (strlen (user)
-                          + strlen (user)
-                          + strlen (realm)
-                          + strlen (nonce)
-                          + strlen (path)
-                          + 2 * MD5_HASHLEN /*strlen (response_digest)*/
-                          + (opaque ? strlen (opaque) : 0)
-                          + 128);
+    res = xmalloc (strlen (user)
+                  + strlen (user)
+                  + strlen (realm)
+                  + strlen (nonce)
+                  + strlen (path)
+                  + 2 * MD5_HASHLEN /*strlen (response_digest)*/
+                  + (opaque ? strlen (opaque) : 0)
+                  + 128);
     sprintf (res, "Digest \
 username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"",
             user, realm, nonce, path, response_digest);
     sprintf (res, "Digest \
 username=\"%s\", realm=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\"",
             user, realm, nonce, path, response_digest);
index 8823f736ec167a30c2f9f5275287a7e6f6503eff..d0b5370a432e4f27cab1d6053fc6f9d4a745ce78 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -208,7 +208,7 @@ saved_append_1 (const char *start, const char *end)
            {
              /* Allocate memory and concatenate the old and the new
                  contents. */
            {
              /* Allocate memory and concatenate the old and the new
                  contents. */
-             ln->malloced_line = (char *)xmalloc (old_len + len + 1);
+             ln->malloced_line = xmalloc (old_len + len + 1);
              memcpy (ln->malloced_line, ln->static_line,
                      old_len);
              memcpy (ln->malloced_line + old_len, start, len);
              memcpy (ln->malloced_line, ln->static_line,
                      old_len);
              memcpy (ln->malloced_line + old_len, start, len);
index f9eabaf8bfc31e7aba6872147a93a5497199c17c..43496dcf00ee0c77d49b7a792af22dddf01e0f3d 100644 (file)
@@ -35,9 +35,7 @@ so, delete this exception statement from your version.  */
 # include <unistd.h>
 #endif /* HAVE_UNISTD_H */
 #include <string.h>
 # include <unistd.h>
 #endif /* HAVE_UNISTD_H */
 #include <string.h>
-#ifdef HAVE_SIGNAL_H
-# include <signal.h>
-#endif
+#include <signal.h>
 #ifdef HAVE_NLS
 #ifdef HAVE_LOCALE_H
 # include <locale.h>
 #ifdef HAVE_NLS
 #ifdef HAVE_LOCALE_H
 # include <locale.h>
@@ -70,7 +68,7 @@ extern char *version_string;
 
 extern struct cookie_jar *wget_cookie_jar;
 
 
 extern struct cookie_jar *wget_cookie_jar;
 
-static RETSIGTYPE redirect_output_signal (int);
+static void redirect_output_signal (int);
 
 const char *exec_name;
 \f
 
 const char *exec_name;
 \f
@@ -993,13 +991,9 @@ Can't timestamp and not clobber old files at the same time.\n"));
 #ifdef HAVE_SIGNAL
 /* Hangup signal handler.  When wget receives SIGHUP or SIGUSR1, it
    will proceed operation as usual, trying to write into a log file.
 #ifdef HAVE_SIGNAL
 /* Hangup signal handler.  When wget receives SIGHUP or SIGUSR1, it
    will proceed operation as usual, trying to write into a log file.
-   If that is impossible, the output will be turned off.
-
-   #### It is unsafe to do call libc functions from a signal handler.
-   What we should do is, set a global variable, and have the code in
-   log.c pick it up.  */
+   If that is impossible, the output will be turned off.  */
 
 
-static RETSIGTYPE
+static void
 redirect_output_signal (int sig)
 {
   const char *signal_name = (sig == SIGHUP ? "SIGHUP" :
 redirect_output_signal (int sig)
 {
   const char *signal_name = (sig == SIGHUP ? "SIGHUP" :
index 18a4e07fe06a7171e45b7dddabac90ad59bbe9e9..909c2abc07896575504e7c2c3e4665de936b0808 100644 (file)
@@ -499,7 +499,7 @@ ws_changetitle (const char *url)
 {
   xfree_null (title_buf);
   xfree_null (curr_url);
 {
   xfree_null (title_buf);
   xfree_null (curr_url);
-  title_buf = (char *)xmalloc (strlen (url) + 20);
+  title_buf = xmalloc (strlen (url) + 20);
   curr_url = xstrdup (url);
   old_percentage = -1;
   sprintf (title_buf, "Wget %s", curr_url);
   curr_url = xstrdup (url);
   old_percentage = -1;
   sprintf (title_buf, "Wget %s", curr_url);
index 15cf0a68845ddd90bea630fdfecaea216f11737f..158ef39f34ab9eb15c8a7669f801c8bd2d17f2e8 100644 (file)
@@ -164,7 +164,7 @@ read_whole_line (FILE *fp)
 {
   int length = 0;
   int bufsize = 81;
 {
   int length = 0;
   int bufsize = 81;
-  char *line = (char *)xmalloc (bufsize);
+  char *line = xmalloc (bufsize);
 
   while (fgets (line + length, bufsize - length, fp))
     {
 
   while (fgets (line + length, bufsize - length, fp))
     {
@@ -220,7 +220,7 @@ maybe_add_to_list (acc_t **newentry, acc_t **list)
        }
 
       /* Allocate a new acc_t structure.  */
        }
 
       /* Allocate a new acc_t structure.  */
-      a = (acc_t *)xmalloc (sizeof (acc_t));
+      a = xmalloc (sizeof (acc_t));
     }
 
   /* Zero the structure, so that it is ready to use.  */
     }
 
   /* Zero the structure, so that it is ready to use.  */
index 04c7fc5cad831cf59ea96bf44ce6ab21395cdd82..28ad27de3a010e27b020e46ab926b9cb3b5a5eff 100644 (file)
@@ -36,9 +36,7 @@ so, delete this exception statement from your version.  */
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-#ifdef HAVE_SIGNAL_H
-# include <signal.h>
-#endif
+#include <signal.h>
 
 #include "wget.h"
 #include "progress.h"
 
 #include "wget.h"
 #include "progress.h"
@@ -956,7 +954,7 @@ bar_set_params (const char *params)
 }
 
 #ifdef SIGWINCH
 }
 
 #ifdef SIGWINCH
-RETSIGTYPE
+void
 progress_handle_sigwinch (int sig)
 {
   received_sigwinch = 1;
 progress_handle_sigwinch (int sig)
 {
   received_sigwinch = 1;
index 77907a9946d3f11ff4c1a49a4c88846f6c1cfd3c..e8e78700be0042b35536511ffc9d0f085716e90d 100644 (file)
@@ -39,6 +39,6 @@ int progress_interactive_p (void *);
 void progress_update (void *, wgint, double);
 void progress_finish (void *, double);
 
 void progress_update (void *, wgint, double);
 void progress_finish (void *, double);
 
-RETSIGTYPE progress_handle_sigwinch (int);
+void progress_handle_sigwinch (int);
 
 #endif /* PROGRESS_H */
 
 #endif /* PROGRESS_H */
index 4aa51b5eb13fb5cfc58a9969880e41c3a69c4326..5f722c1a9dbb0b2b352e9070b1731fa3affcf9ff 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -205,7 +205,7 @@ url_escape_1 (const char *s, unsigned char mask, int allow_passthrough)
     return allow_passthrough ? (char *)s : xstrdup (s);
 
   newlen = (p1 - s) + addition;
     return allow_passthrough ? (char *)s : xstrdup (s);
 
   newlen = (p1 - s) + addition;
-  newstr = (char *)xmalloc (newlen + 1);
+  newstr = xmalloc (newlen + 1);
 
   p1 = s;
   p2 = newstr;
 
   p1 = s;
   p2 = newstr;
@@ -984,7 +984,7 @@ char *
 url_full_path (const struct url *url)
 {
   int length = full_path_length (url);
 url_full_path (const struct url *url)
 {
   int length = full_path_length (url);
-  char *full_path = (char *) xmalloc (length + 1);
+  char *full_path = xmalloc (length + 1);
 
   full_path_write (url, full_path);
   full_path[length] = '\0';
 
   full_path_write (url, full_path);
   full_path[length] = '\0';
@@ -1692,7 +1692,7 @@ uri_merge (const char *base, const char *link)
        start_insert = base;
 
       span = start_insert - base;
        start_insert = base;
 
       span = start_insert - base;
-      merge = (char *)xmalloc (span + linklength + 1);
+      merge = xmalloc (span + linklength + 1);
       if (span)
        memcpy (merge, base, span);
       memcpy (merge + span, link, linklength);
       if (span)
        memcpy (merge, base, span);
       memcpy (merge + span, link, linklength);
@@ -1747,7 +1747,7 @@ uri_merge (const char *base, const char *link)
        start_insert = slash;
 
       span = start_insert - base;
        start_insert = slash;
 
       span = start_insert - base;
-      merge = (char *)xmalloc (span + linklength + 1);
+      merge = xmalloc (span + linklength + 1);
       if (span)
        memcpy (merge, base, span);
       memcpy (merge + span, link, linklength);
       if (span)
        memcpy (merge, base, span);
       memcpy (merge + span, link, linklength);
@@ -1785,7 +1785,7 @@ uri_merge (const char *base, const char *link)
        }
 
       span = start_insert - base;
        }
 
       span = start_insert - base;
-      merge = (char *)xmalloc (span + linklength + 1);
+      merge = xmalloc (span + linklength + 1);
       if (span)
        memcpy (merge, base, span);
       if (need_explicit_slash)
       if (span)
        memcpy (merge, base, span);
       if (need_explicit_slash)
index 38cc6d06bca43f5f7efabd80f93dd21cae160604..caf8341240530645baf7e4a0735543d5732c5d42 100644 (file)
@@ -45,9 +45,6 @@ so, delete this exception statement from your version.  */
 #ifdef HAVE_PWD_H
 # include <pwd.h>
 #endif
 #ifdef HAVE_PWD_H
 # include <pwd.h>
 #endif
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
 #ifdef HAVE_UTIME_H
 # include <utime.h>
 #endif
 #ifdef HAVE_UTIME_H
 # include <utime.h>
 #endif
@@ -71,10 +68,7 @@ so, delete this exception statement from your version.  */
 #endif
 
 /* Needed for run_with_timeout. */
 #endif
 
 /* Needed for run_with_timeout. */
-#undef USE_SIGNAL_TIMEOUT
-#ifdef HAVE_SIGNAL_H
-# include <signal.h>
-#endif
+#include <signal.h>
 #ifdef HAVE_SETJMP_H
 # include <setjmp.h>
 #endif
 #ifdef HAVE_SETJMP_H
 # include <setjmp.h>
 #endif
@@ -86,11 +80,9 @@ so, delete this exception statement from your version.  */
 # endif
 #endif
 
 # endif
 #endif
 
+#undef USE_SIGNAL_TIMEOUT
 #ifdef HAVE_SIGNAL
 #ifdef HAVE_SIGNAL
-# ifdef HAVE_SIGSETJMP
-#  define USE_SIGNAL_TIMEOUT
-# endif
-# ifdef HAVE_SIGBLOCK
+# if defined(HAVE_SIGSETJMP) || defined(HAVE_SIGBLOCK)
 #  define USE_SIGNAL_TIMEOUT
 # endif
 #endif
 #  define USE_SIGNAL_TIMEOUT
 # endif
 #endif
@@ -117,7 +109,7 @@ xstrdup_lower (const char *s)
 char *
 strdupdelim (const char *beg, const char *end)
 {
 char *
 strdupdelim (const char *beg, const char *end)
 {
-  char *res = (char *)xmalloc (end - beg + 1);
+  char *res = xmalloc (end - beg + 1);
   memcpy (res, beg, end - beg);
   res[end - beg] = '\0';
   return res;
   memcpy (res, beg, end - beg);
   res[end - beg] = '\0';
   return res;
@@ -141,7 +133,7 @@ sepstring (const char *s)
     {
       if (*s == ',')
        {
     {
       if (*s == ',')
        {
-         res = (char **)xrealloc (res, (i + 2) * sizeof (char *));
+         res = xrealloc (res, (i + 2) * sizeof (char *));
          res[i] = strdupdelim (p, s);
          res[++i] = NULL;
          ++s;
          res[i] = strdupdelim (p, s);
          res[++i] = NULL;
          ++s;
@@ -153,7 +145,7 @@ sepstring (const char *s)
       else
        ++s;
     }
       else
        ++s;
     }
-  res = (char **)xrealloc (res, (i + 2) * sizeof (char *));
+  res = xrealloc (res, (i + 2) * sizeof (char *));
   res[i] = strdupdelim (p, s);
   res[i + 1] = NULL;
   return res;
   res[i] = strdupdelim (p, s);
   res[i + 1] = NULL;
   return res;
@@ -616,7 +608,7 @@ file_merge (const char *base, const char *file)
   if (!cut)
     return xstrdup (file);
 
   if (!cut)
     return xstrdup (file);
 
-  result = (char *)xmalloc (cut - base + 1 + strlen (file) + 1);
+  result = xmalloc (cut - base + 1 + strlen (file) + 1);
   memcpy (result, base, cut - base);
   result[cut - base] = '/';
   strcpy (result + (cut - base) + 1, file);
   memcpy (result, base, cut - base);
   result[cut - base] = '/';
   strcpy (result + (cut - base) + 1, file);
@@ -853,7 +845,7 @@ read_whole_line (FILE *fp)
 {
   int length = 0;
   int bufsize = 82;
 {
   int length = 0;
   int bufsize = 82;
-  char *line = (char *)xmalloc (bufsize);
+  char *line = xmalloc (bufsize);
 
   while (fgets (line + length, bufsize - length, fp))
     {
 
   while (fgets (line + length, bufsize - length, fp))
     {
@@ -1065,7 +1057,7 @@ merge_vecs (char **v1, char **v2)
   /* Count v2.  */
   for (j = 0; v2[j]; j++);
   /* Reallocate v1.  */
   /* Count v2.  */
   for (j = 0; v2[j]; j++);
   /* Reallocate v1.  */
-  v1 = (char **)xrealloc (v1, (i + j + 1) * sizeof (char **));
+  v1 = xrealloc (v1, (i + j + 1) * sizeof (char **));
   memcpy (v1 + i, v2, (j + 1) * sizeof (char *));
   xfree (v2);
   return v1;
   memcpy (v1 + i, v2, (j + 1) * sizeof (char *));
   xfree (v2);
   return v1;
@@ -1633,7 +1625,7 @@ random_float (void)
 
 static sigjmp_buf run_with_timeout_env;
 
 
 static sigjmp_buf run_with_timeout_env;
 
-static RETSIGTYPE
+static void
 abort_run_with_timeout (int sig)
 {
   assert (sig == SIGALRM);
 abort_run_with_timeout (int sig)
 {
   assert (sig == SIGALRM);
@@ -1644,7 +1636,7 @@ abort_run_with_timeout (int sig)
 
 static jmp_buf run_with_timeout_env;
 
 
 static jmp_buf run_with_timeout_env;
 
-static RETSIGTYPE
+static void
 abort_run_with_timeout (int sig)
 {
   assert (sig == SIGALRM);
 abort_run_with_timeout (int sig)
 {
   assert (sig == SIGALRM);
index 759825e7f46e362fff89c090512c75ea0875e097..d382d3da91f2225aa6db3c36b298e78c1a7f00f7 100644 (file)
@@ -213,7 +213,7 @@ typedef off_t wgint;
     (sizevar) = DR_newsize;                                            \
   }                                                                    \
   if (DR_newsize)                                                      \
     (sizevar) = DR_newsize;                                            \
   }                                                                    \
   if (DR_newsize)                                                      \
-    basevar = (type *)xrealloc (basevar, DR_newsize * sizeof (type));  \
+    basevar = xrealloc (basevar, DR_newsize * sizeof (type));          \
 } while (0)
 
 /* Used to print pointers (usually for debugging).  Print pointers
 } while (0)
 
 /* Used to print pointers (usually for debugging).  Print pointers
index c094e7c9bda68045ee5e04e1e0f6cc558b2dfb51..94f3aaaad0e842d148dacda434d4c038b1f7f556 100644 (file)
@@ -83,10 +83,10 @@ void debugging_free (void *, const char *, int);
    necessary in standard C, but Wget performs them anyway for the sake
    of pre-standard environments and possibly C++.  */
 
    necessary in standard C, but Wget performs them anyway for the sake
    of pre-standard environments and possibly C++.  */
 
-#define xnew(type) ((type *) xmalloc (sizeof (type)))
-#define xnew0(type) ((type *) xmalloc0 (sizeof (type)))
-#define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type)))
-#define xnew0_array(type, len) ((type *) xmalloc0 ((len) * sizeof (type)))
+#define xnew(type) (xmalloc (sizeof (type)))
+#define xnew0(type) (xmalloc0 (sizeof (type)))
+#define xnew_array(type, len) (xmalloc ((len) * sizeof (type)))
+#define xnew0_array(type, len) (xmalloc0 ((len) * sizeof (type)))
 
 #define alloca_array(type, size) ((type *) alloca ((size) * sizeof (type)))
 
 
 #define alloca_array(type, size) ((type *) alloca ((size) * sizeof (type)))