From: Eric S. Raymond Date: Sun, 25 Aug 2013 01:53:12 +0000 (-0400) Subject: Varargs cleanup is almost finished. X-Git-Tag: 1.11~25 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=2e2e788390ece70034333a9c46c9b69805954c59;p=vms-empire.git Varargs cleanup is almost finished. --- diff --git a/extern.h b/extern.h index 78724ec..70044c1 100644 --- a/extern.h +++ b/extern.h @@ -206,7 +206,7 @@ void scan_sat (view_map_t *vmap, long loc); void set_prod (city_info_t *cityp); /* terminal routines */ -void pdebug (char *s, int a, int b, int c, int d, int e, int f, int g, int h); +void pdebug (char *s, ...); void topini (void); void clreol (int line, int colp); void topmsg (int line, char *fmt, ...); diff --git a/term.c b/term.c index 19e6dcb..42ced47 100644 --- a/term.c +++ b/term.c @@ -40,15 +40,6 @@ to read the lines. The new information is then displayed, and the static bool need_delay; static FILE *my_stream; -void -/* VARARGS1 */ -pdebug(char *s, - int a, int b, int c, int d, int e, int f, int g, int h) -{ - if (!print_debug) return; - comment (s, a, b, c, d, e, f, g, h); -} - /* Here are routines that handle printing to the top few lines of the screen. 'topini' should be called at initialization, and whenever @@ -230,6 +221,22 @@ comment1 (char *fmt, ...) } +void +pdebug(char *fmt, ...) +{ + va_list ap; + + if (!print_debug) return; + + va_start(ap, fmt); + if (need_delay) delay (); + topmsg (1, ""); + topmsg (2, ""); + vtopmsg (3, fmt, ap); + need_delay = (fmt != 0); + va_end(ap); +} + /* kermyt begin */ void