]> sjero.net Git - wget/blobdiff - src/progress.c
[svn] Don't cast return type of malloc/realloc. Assume ANSI C signal handlers.
[wget] / src / progress.c
index 937856cd5e738857b4fbe48759caa01b1004f598..28ad27de3a010e27b020e46ab926b9cb3b5a5eff 100644 (file)
@@ -31,18 +31,12 @@ so, delete this exception statement from your version.  */
 
 #include <stdio.h>
 #include <stdlib.h>
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif /* HAVE_STRING_H */
+#include <string.h>
 #include <assert.h>
 #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"
@@ -52,23 +46,23 @@ so, delete this exception statement from your version.  */
 struct progress_implementation {
   const char *name;
   int interactive;
-  void *(*create) PARAMS ((wgint, wgint));
-  void (*update) PARAMS ((void *, wgint, double));
-  void (*finish) PARAMS ((void *, double));
-  void (*set_params) PARAMS ((const char *));
+  void *(*create) (wgint, wgint);
+  void (*update) (void *, wgint, double);
+  void (*finish) (void *, double);
+  void (*set_params) (const char *);
 };
 
 /* Necessary forward declarations. */
 
-static void *dot_create PARAMS ((wgint, wgint));
-static void dot_update PARAMS ((void *, wgint, double));
-static void dot_finish PARAMS ((void *, double));
-static void dot_set_params PARAMS ((const char *));
+static void *dot_create (wgint, wgint);
+static void dot_update (void *, wgint, double);
+static void dot_finish (void *, double);
+static void dot_set_params (const char *);
 
-static void *bar_create PARAMS ((wgint, wgint));
-static void bar_update PARAMS ((void *, wgint, double));
-static void bar_finish PARAMS ((void *, double));
-static void bar_set_params PARAMS ((const char *));
+static void *bar_create (wgint, wgint);
+static void bar_update (void *, wgint, double);
+static void bar_finish (void *, double);
+static void bar_set_params (const char *);
 
 static struct progress_implementation implementations[] = {
   { "dot", 0, dot_create, dot_update, dot_finish, dot_set_params },
@@ -96,7 +90,7 @@ static int current_impl_locked;
 int
 valid_progress_implementation_p (const char *name)
 {
-  int i = 0;
+  int i;
   struct progress_implementation *pi = implementations;
   char *colon = strchr (name, ':');
   int namelen = colon ? colon - name : strlen (name);
@@ -495,8 +489,8 @@ struct bar_progress {
   wgint last_eta_value;
 };
 
-static void create_image PARAMS ((struct bar_progress *, double));
-static void display_image PARAMS ((char *));
+static void create_image (struct bar_progress *, double);
+static void display_image (char *);
 
 static void *
 bar_create (wgint initial, wgint total)
@@ -536,7 +530,7 @@ bar_create (wgint initial, wgint total)
   return bp;
 }
 
-static void update_speed_ring PARAMS ((struct bar_progress *, wgint, double));
+static void update_speed_ring (struct bar_progress *, wgint, double);
 
 static void
 bar_update (void *progress, wgint howmuch, double dltime)
@@ -721,7 +715,7 @@ create_image (struct bar_progress *bp, double dl_total_time)
   char *p = bp->buffer;
   wgint size = bp->initial_length + bp->count;
 
-  char *size_legible = legible (size);
+  char *size_legible = with_thousand_seps (size);
   int size_legible_len = strlen (size_legible);
 
   struct bar_progress_hist *hist = &bp->hist;
@@ -828,7 +822,7 @@ create_image (struct bar_progress *bp, double dl_total_time)
     }
 
   /* " 234,567,890" */
-  sprintf (p, " %-11s", legible (size));
+  sprintf (p, " %-11s", with_thousand_seps (size));
   p += strlen (p);
 
   /* " 1012.45K/s" */
@@ -960,7 +954,7 @@ bar_set_params (const char *params)
 }
 
 #ifdef SIGWINCH
-RETSIGTYPE
+void
 progress_handle_sigwinch (int sig)
 {
   received_sigwinch = 1;