Description: fix building with GCC-15
Author: Ricardo Mones <mones@debian.org>
Bug-Debian: https://bugs.debian.org/1096511
Forwarded: no
Last-Update: 2025-09-11

Index: dclock/Dclock.c
===================================================================
--- dclock.orig/Dclock.c	2025-09-11 00:01:48.192550818 +0200
+++ dclock/Dclock.c	2025-09-11 00:04:35.473052862 +0200
@@ -18,18 +18,57 @@
 #include <X11/StringDefs.h>
 #include "DclockP.h"
 
-static void
-    Initialize(), Resize(), ResizeNow(), Realize(), Destroy(), Redisplay(),
-    GetGC(), invert_bitmap(), build_segments(), timeout(), toggle_bell(),
-    toggle_reverse_video(), toggle_scroll(), toggle_seconds(), show_bell(),
-    toggle_military_time(), toggle_date(), make_number(), make_number_one(),
-    set_alarm(),
-    show_date(), show_alarm(), scroll_time(), toggle_alarm(), outline_digit(),
-    toggle_fade(), toggle_tails(), increase_slope(), decrease_slope(),
-    widen_segment(), thin_segment(), increase_space(), decrease_space(),
-    toggle_blink(), print_help(), print_dump(), playbell(), toggle_dateup();
+#define MAX_PTS		6	/* max # of pts per segment polygon */
+#define NUM_SEGS	7	/* number of segments in a digit */
+
+typedef struct {
+   float x;
+   float y;
+} XfPoint;
+
+typedef XfPoint segment_pts[NUM_SEGS][MAX_PTS];
+
+static void Destroy (Widget);
+static void GetGC (DclockWidget);
+static void Initialize (Widget, Widget, ArgList, Cardinal *);
+static void Realize (Widget, XtValueMask *, XSetWindowAttributes *);
+static void Redisplay (Widget, XEvent *, Region);
+static void Resize (Widget);
+static void ResizeNow (void *, long unsigned int *);
+static void build_segments (DclockWidget, segment_pts, float, float);
+static void decrease_slope (Widget, XEvent *, char **, unsigned int *);
+static void decrease_space (Widget, XEvent *, char **, unsigned int *);
+static void increase_slope (Widget, XEvent *, char **, unsigned int *);
+static void increase_space (Widget, XEvent *, char **, unsigned int *);
+static void invert_bitmap(unsigned char *, int, int);
+static void make_number (DclockWidget, Pixmap, GC, int, segment_pts);
+static void make_number_one (DclockWidget, Pixmap, GC, int, segment_pts);
+static void outline_digit (DclockWidget, int, Boolean);
+static void playbell (DclockWidget, int);
+static void print_dump (Widget, XEvent *, char **, unsigned int *);
+static void print_help (Widget, XEvent *, char **, unsigned int *);
+static void scroll_time (DclockWidget, register char *);
+static void set_alarm (Widget, XEvent *, char **, unsigned int *);
+static void show_alarm (DclockWidget);
+static void show_bell (DclockWidget);
+static void show_date (DclockWidget, struct tm *);
+static void thin_segment (Widget, XEvent *, char **, unsigned int *);
+static void timeout (void *, long unsigned int *);
+static void toggle_alarm (Widget, XEvent *, char **, unsigned int *);
+static void toggle_bell (Widget, XEvent *, char **, unsigned int *);
+static void toggle_blink (Widget, XEvent *, char **, unsigned int *);
+static void toggle_date (Widget, XEvent *, char **, unsigned int *);
+static void toggle_dateup (Widget , XEvent *, char **, unsigned int *);
+static void toggle_fade (Widget, XEvent *, char **, unsigned int *);
+static void toggle_military_time (Widget, XEvent *, char **, unsigned int *);
+static void toggle_reverse_video (Widget, XEvent *, char **, unsigned int *);
+static void toggle_seconds (Widget, XEvent *, char **, unsigned int *);
+static void toggle_scroll (Widget, XEvent *, char **, unsigned int *);
+static void toggle_tails (Widget, XEvent *, char **, unsigned int *);
+static void widen_segment (Widget, XEvent *, char **, unsigned int *);
 
-static void XfFillArc(), XfFillPolygon();
+static void XfFillArc (Display *, Drawable, GC, float, float, float, int);
+static void XfFillPolygon (Display *, Drawable, GC, XfPoint *, int, int);
 
 /* some definitions */
 
@@ -50,11 +89,13 @@
 
 /* A few variables and initial values */
 
-static Boolean SetValues(), show_time();
+static Boolean SetValues (Widget, Widget, Widget, ArgList, Cardinal *);
+static Boolean show_time (DclockWidget);
+
 static Dimension winwidth = CLOCK_WIDTH;
 static Dimension winheight = CLOCK_HEIGHT;
-static Boolean false = False;
-static Boolean true = True;
+static Boolean _false = False;
+static Boolean _true = True;
 static int fade_rate = 50;
 static float y_ratio;
 static float sslope = 6.0;
@@ -132,35 +173,35 @@
     { XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
         XtOffset(DclockWidget,dclock.background), XtRString, "DarkSlateGray"},
     { XtNtails, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.tails), XtRBoolean, (caddr_t)&true},
+	XtOffset(DclockWidget,dclock.tails), XtRBoolean, (caddr_t)&_true},
     { XtNfade, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.fade), XtRBoolean, (caddr_t)&true},
+	XtOffset(DclockWidget,dclock.fade), XtRBoolean, (caddr_t)&_true},
     { XtNfadeRate, XtCTime, XtRInt, sizeof (int),
 	XtOffset(DclockWidget,dclock.fade_rate), XtRInt, (caddr_t)&fade_rate},
     { XtNscroll, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.scroll), XtRBoolean, (caddr_t)&false},
+	XtOffset(DclockWidget,dclock.scroll), XtRBoolean, (caddr_t)&_false},
     { XtNdisplayTime, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.display_time), XtRBoolean, (caddr_t)&true},
+	XtOffset(DclockWidget,dclock.display_time), XtRBoolean, (caddr_t)&_true},
     { XtNalarm, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.alarm), XtRBoolean, (caddr_t)&false},
+	XtOffset(DclockWidget,dclock.alarm), XtRBoolean, (caddr_t)&_false},
     { XtNalarmTime, XtCTime, XtRString, sizeof (char *),
 	XtOffset(DclockWidget,dclock.alarm_time), XtRString, "00:00" },
     { XtNalarmPersist, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.alarm_persist), XtRBoolean, (caddr_t)&false},
+	XtOffset(DclockWidget,dclock.alarm_persist), XtRBoolean, (caddr_t)&_false},
     { XtNbell, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.bell), XtRBoolean, (caddr_t)&false},
+	XtOffset(DclockWidget,dclock.bell), XtRBoolean, (caddr_t)&_false},
     { XtNseconds, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.seconds), XtRBoolean, (caddr_t)&false},
+	XtOffset(DclockWidget,dclock.seconds), XtRBoolean, (caddr_t)&_false},
     { XtNblink, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.blink), XtRBoolean, (caddr_t)&true},
+	XtOffset(DclockWidget,dclock.blink), XtRBoolean, (caddr_t)&_true},
     { XtNmilitaryTime, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.miltime), XtRBoolean, (caddr_t)&false},
+	XtOffset(DclockWidget,dclock.miltime), XtRBoolean, (caddr_t)&_false},
     { XtNutcTime, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.utc), XtRBoolean, (caddr_t)&false},
+	XtOffset(DclockWidget,dclock.utc), XtRBoolean, (caddr_t)&_false},
     { XtNdate, XtCString, XtRString, sizeof (String),
 	XtOffset(DclockWidget,dclock.date_fmt), XtRString, NULL},
     { XtNdateUp, XtCBoolean, XtRBoolean, sizeof (Boolean),
-	XtOffset(DclockWidget,dclock.dateup), XtRBoolean, (caddr_t)&false},
+	XtOffset(DclockWidget,dclock.dateup), XtRBoolean, (caddr_t)&_false},
     { XtNfont, XtCFont, XtRFontStruct, sizeof (XFontStruct *),
 	XtOffset(DclockWidget,dclock.font), XtRString, "fixed"},
 #ifdef XFT_SUPPORT
@@ -279,9 +320,6 @@
 int bsave = 0;
 Boolean use_stipple;
 
-#define MAX_PTS		6	/* max # of pts per segment polygon */
-#define NUM_SEGS	7	/* number of segments in a digit */
-
 /*
  * These constants give the bit positions for the segmask[]
  * digit masks.
@@ -334,13 +372,6 @@
 Region clip_norm, clip_small, clip_colon; 
 XPoint clip_pts[5];
 
-typedef struct {
-   float x;
-   float y;
-} XfPoint;
-
-typedef XfPoint segment_pts[NUM_SEGS][MAX_PTS];
-
 segment_pts tiny_segment_pts;
 segment_pts norm_segment_pts;
 
@@ -352,10 +383,10 @@
 
 /* ARGSUSED */
 static void
-Initialize (request, new)
-DclockWidget   request;
-DclockWidget   new;
+Initialize (Widget wr, Widget wrn, ArgList a, Cardinal *r)
 {
+    DclockWidget request = (DclockWidget)wr;
+    DclockWidget new = (DclockWidget)wrn;
     int i, n;
     Display *dpy = XtDisplay(new);
     Drawable root;
@@ -479,8 +510,7 @@
 }
 
 static void
-GetGC(w)
-DclockWidget w;
+GetGC(DclockWidget w)
 { XGCValues  	xgcv;
     XtGCMask	gc_mask =
 		    GCGraphicsExposures | GCFont | GCForeground | GCBackground;
@@ -500,9 +530,7 @@
 
 
 static void
-invert_bitmap(bm, h, w)
-unsigned char *bm;
-int h, w;
+invert_bitmap(unsigned char *bm, int h, int w)
 {
     int i, *wp;
 
@@ -510,11 +538,7 @@
 	*wp = ~(*wp);
 }
 
-static void
-Realize (w, valueMask, attrs)
-Widget w;
-XtValueMask *valueMask;
-XSetWindowAttributes *attrs;
+static void Realize (Widget w, XtValueMask *valueMask, XSetWindowAttributes *attrs)
 {
     Display *dp = XtDisplay(w); 
     DclockWidget dw = (DclockWidget)w;
@@ -550,13 +574,12 @@
 	dw->dclock.xftbg.pixel = color.pixel;
     }
 #endif
-    ResizeNow(w);
+    ResizeNow(dw, NULL);
 }
 
-static void
-Destroy (w)
-DclockWidget w;
+static void Destroy (Widget wi)
 {
+    DclockWidget w = (DclockWidget)wi;
     int n;
 
     /* Be nice and free up memory before exiting. */
@@ -589,9 +612,9 @@
 
 /* ARGSUSED */
 static void
-ResizeNow  (w)
-DclockWidget    w;
+ResizeNow (void *wi, long unsigned int *ui)
 {
+    DclockWidget w = (DclockWidget)wi;
     int i, j; 
     float digit_w, digit_h, seg_width;
     Pixmap pix;
@@ -819,14 +842,13 @@
 	winheight = w->core.height;
 
     w->dclock.punt_resize = (XtIntervalId)NULL;
-    Redisplay(w);
+    Redisplay((Widget)w, NULL, NULL);
 }
 
 /* ARGSUSED */
-static void
-Resize  (w)
-DclockWidget    w;
+static void Resize (Widget wi)
 {
+    DclockWidget w = (DclockWidget)wi;
     /* Punt for 1/10 second on the resize, so that multiple events	*/
     /* created by an opaque resize do not overload the processor.	*/
 
@@ -841,10 +863,7 @@
 
 
 static void
-build_segments(wi, seg_pts, w, h)
-DclockWidget wi;
-segment_pts seg_pts;
-float w, h;
+build_segments(DclockWidget wi, segment_pts seg_pts, float w, float h)
 {
     XfPoint *pts;
     float spacer, hskip, fslope, bslope, midpt, seg_width, segxw;
@@ -1067,12 +1086,7 @@
 /*------------------------------------------------------*/
 
 static void
-XfFillArc(dpy, pix, gc, center_x, center_y, radius, fgi)
-   Display *dpy;
-   Drawable pix;
-   GC gc;
-   float center_x, center_y, radius;
-   int fgi;
+XfFillArc(Display *dpy, Drawable pix, GC gc, float center_x, float center_y, float radius, int fgi)
 {
    int i, j, color;
    float minx, miny, maxx, maxy, dist, xdist, ydist, rsq;
@@ -1109,12 +1123,7 @@
 /*------------------------------------------------------*/
 
 static void
-XfFillPolygon(dpy, pix, gc, float_pts, num_pts, fgi)
-Display *dpy;
-Drawable pix;
-GC gc;
-XfPoint *float_pts;
-int num_pts, fgi;
+XfFillPolygon(Display *dpy, Drawable pix, GC gc, XfPoint *float_pts, int num_pts, int fgi)
 {
    int i, j, color;
    float minx, miny, maxx, maxy, dist;
@@ -1156,12 +1165,7 @@
 /*------------------------------------------------------*/
 
 static void
-make_number(dw, pix, gc, n, seg_pts)
-DclockWidget dw;
-Pixmap pix;
-GC gc;
-int n;
-segment_pts seg_pts;
+make_number(DclockWidget dw, Pixmap pix, GC gc, int n, segment_pts seg_pts)
 {
    Display *dpy = XtDisplay(dw);
    int i;
@@ -1181,12 +1185,7 @@
 /*----------------------------------------------------------------------*/
 
 static void
-make_number_one(dw, pix, gc, n, seg_pts)
-DclockWidget dw;
-Pixmap pix;
-GC gc;
-int n;
-segment_pts seg_pts;
+make_number_one(DclockWidget dw, Pixmap pix, GC gc, int n, segment_pts seg_pts)
 {
    Display *dpy = XtDisplay(dw);
    int color;
@@ -1358,9 +1357,9 @@
 
 /* ARGSUSED */
 static void
-Redisplay  (w)
-DclockWidget    w;
+Redisplay (Widget wi, XEvent *e, Region r)
 {
+    DclockWidget w = (DclockWidget)wi;   
     XtAppContext app;
     Boolean save_scroll = w->dclock.scroll;
     Boolean save_fade = w->dclock.fade;
@@ -1429,8 +1428,7 @@
 }
 
 static Boolean
-show_time(w)
-DclockWidget w;
+show_time(DclockWidget w)
 {
     char buf[23];
     Boolean alarm_went_off = False;
@@ -1493,7 +1491,7 @@
 	l_time->tm_sec < 5) {
 	bsave |= 0x4;		/* set alarm_active state */
 	playbell(w, 0);
-	toggle_reverse_video(w);
+	toggle_reverse_video((Widget)w, NULL, NULL, NULL);
 	alarm_went_off = True;
     } else {
 	/* if alarm didn't go off, check for hour/half-hour bell */
@@ -1511,7 +1509,7 @@
 	if (bsave & 0x4) {
 	    if (((bsave & 0x1) == ((bsave & 0x2) >> 1)) ^
 			((w->dclock.alarm_persist) ? 0 : 1))
-		toggle_reverse_video(w);
+		toggle_reverse_video((Widget)w, NULL, NULL, NULL);
 
 	    bsave &= 0x3;	/* clear alarm_active state */
 	}
@@ -1521,9 +1519,7 @@
 
 
 static void
-scroll_time(w, p)
-DclockWidget w;
-register char *p;
+scroll_time(DclockWidget w, register char *p)
 {
     int chgd[4], J = winheight - BORDER*2*y_ratio + 1;
     register int i, j, incr;
@@ -1673,9 +1669,7 @@
 }
 
 static void
-show_date(w, now)
-DclockWidget w;
-struct tm *now;
+show_date(DclockWidget w, struct tm *now)
 {
     Display *dpy = XtDisplay(w);
     Window win = XtWindow(w);
@@ -1740,8 +1734,7 @@
 }
 
 static void
-show_alarm(w)
-DclockWidget w;
+show_alarm(DclockWidget w)
 {
     Display *dpy = XtDisplay(w);
     Window win = XtWindow(w);
@@ -1767,8 +1760,7 @@
 }
 
 static void
-show_bell(w)
-DclockWidget w;
+show_bell(DclockWidget w)
 {
     Display *dpy = XtDisplay(w);
     Window win = XtWindow(w);
@@ -1804,10 +1796,10 @@
 
 
 static void
-timeout(w, id)
-DclockWidget w;
-XtIntervalId *id;
+timeout(void *wi, long unsigned int *idi)
 {
+    DclockWidget w = (DclockWidget)wi;
+    XtIntervalId *id = (XtIntervalId *)idi;
     struct timeval now;
     int next_intr;
     Boolean alarm_went_off = show_time(w);
@@ -1833,10 +1825,11 @@
 }
 
 /* ARGSUSED */
-static Boolean
-SetValues (current, request, new)
-DclockWidget current, request, new;
+static Boolean SetValues (Widget w, Widget r, Widget n, ArgList a, Cardinal *c)
 {
+    DclockWidget current = (DclockWidget)w;
+    DclockWidget request = (DclockWidget)r;
+    DclockWidget new = (DclockWidget)n;
     Boolean do_redraw = False;
 
     if (current->dclock.display_time != new->dclock.display_time) {
@@ -1866,7 +1859,7 @@
 	XtReleaseGC ((Widget)current, current->dclock.foreGC);
 	XtReleaseGC ((Widget)current, current->dclock.backGC);
 	GetGC(new);
-	ResizeNow(new); /* pixmaps need to be redrawn */
+	ResizeNow(new, NULL); /* pixmaps need to be redrawn */
 	do_redraw = True;
     }
     if (new->dclock.seconds != current->dclock.seconds) {
@@ -1874,7 +1867,7 @@
 	    XtRemoveTimeOut(current->dclock.interval_id);
 	    current->dclock.interval_id = (XtIntervalId)NULL;
 	}
-	ResizeNow(new);
+	ResizeNow(new, NULL);
 	do_redraw = True;
     }
     if (new->dclock.date_fmt != current->dclock.date_fmt) {
@@ -1890,68 +1883,73 @@
 /* The following routines are called by the various keypress events. */
 
 static void
-decrease_space(w)
-DclockWidget w;
+decrease_space (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
+
     w->dclock.space_factor *= 0.95;
     if (w->dclock.space_factor < 0.0) w->dclock.space_factor = 0;
-    ResizeNow(w);
-    Redisplay(w);
+    ResizeNow(w, NULL);
+    Redisplay(wr, NULL, NULL);
 }
 
 static void
-increase_space(w)
-DclockWidget w;
+increase_space (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
+
     w->dclock.space_factor *= 1.05;
     if (w->dclock.space_factor > 0.25) w->dclock.space_factor = 0.25;
-    ResizeNow(w);
-    Redisplay(w);
+    ResizeNow(w, NULL);
+    Redisplay(wr, NULL, NULL);
 }
 
 static void
-decrease_slope(w)
-DclockWidget w;
+decrease_slope (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
+
     w->dclock.angle *= 1.05;
     if (w->dclock.angle > 2 * winheight) w->dclock.angle = 2 * winheight;
-    ResizeNow(w);
-    Redisplay(w);
+    ResizeNow(w, NULL);
+    Redisplay(wr, NULL, NULL);
 }
 
 static void
-increase_slope(w)
-DclockWidget w;
+increase_slope (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
+
     w->dclock.angle *= 0.95;
     if (w->dclock.angle < 1.0) w->dclock.angle = 1.0;
-    ResizeNow(w);
-    Redisplay(w);
+    ResizeNow(w, NULL);
+    Redisplay(wr, NULL, NULL);
 }
 
 static void
-widen_segment(w)
-DclockWidget w;
+widen_segment (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
+
     w->dclock.width_factor *= 1.05;
     if (w->dclock.width_factor > 0.4) w->dclock.width_factor = 0.4;
-    ResizeNow(w);
-    Redisplay(w);
+    ResizeNow(w, NULL);
+    Redisplay(wr, NULL, NULL);
 }
 
 static void
-thin_segment(w)
-DclockWidget w;
+thin_segment (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
+
     w->dclock.width_factor *= 0.95;
     if (w->dclock.width_factor < 0.01) w->dclock.width_factor = 0.01;
-    ResizeNow(w);
-    Redisplay(w);    
+    ResizeNow(w, NULL);
+    Redisplay(wr, NULL, NULL);
 }
 
 static void
-print_help(w)
-DclockWidget w;
+print_help (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
 fprintf(stderr, "In-Window single-character commands:\n\n");
 fprintf(stderr, "   r	Toggles Reverse Video.\n");
@@ -1982,9 +1980,10 @@
 }
 
 static void
-print_dump(w)
-DclockWidget w;
+print_dump (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+DclockWidget w = (DclockWidget)wr;
+
 fprintf(stderr, "Window attributes:\n\n");
 fprintf(stderr, "   window width = %d\n", winwidth);
 fprintf(stderr, "   window height = %d\n", winheight);
@@ -2001,9 +2000,9 @@
 }
 
 static void
-toggle_date(w)
-DclockWidget w;
+toggle_date (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
     char *tmp;
 
     if (!w->dclock.display_time) {
@@ -2024,14 +2023,14 @@
 	TopOffset = 0;
 
     before.tm_wday = -1;
-    ResizeNow(w);
-    Redisplay(w);
+    ResizeNow(w, NULL);
+    Redisplay(wr, NULL, NULL);
 }
 
 static void
-toggle_dateup(w)
-DclockWidget w;
+toggle_dateup (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
     Arg arg;
     int tmp;
 
@@ -2052,32 +2051,34 @@
     } else
 	TopOffset = 0;
 
-    ResizeNow(w);
-    Redisplay(w);
+    ResizeNow(w, NULL);
+    Redisplay(wr, NULL, NULL);
 }
 
 static void
-toggle_bell(w)
-DclockWidget w;
+toggle_bell (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
+
     if (w->dclock.bell = !w->dclock.bell) {
 	playbell(w, 1);
     }
-    ResizeNow(w);
-    Redisplay(w);
+    ResizeNow(w, NULL);
+    Redisplay(wr, NULL, NULL);
 }
 
 static void
-toggle_scroll(w)
-DclockWidget w;
+toggle_scroll (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
+
     w->dclock.scroll = !w->dclock.scroll;
 }
 
 static void
-toggle_reverse_video(w)
-DclockWidget w;
+toggle_reverse_video (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+   DclockWidget w = (DclockWidget)wr;
    Display *dpy = XtDisplay(w);
    int i, itemp;
 
@@ -2098,14 +2099,14 @@
       fadevector[i] = fadevector[FADE_ITER - i - 1];
       fadevector[FADE_ITER - i - 1] = itemp;
    }
-   ResizeNow(w);
-   Redisplay(w);
+   ResizeNow(w, NULL);
+   Redisplay(wr, NULL, NULL);
 }
 
 static void
-toggle_military_time(w)
-DclockWidget w;
+toggle_military_time (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
     Arg arg;
 
     if (!w->dclock.display_time) {
@@ -2117,9 +2118,9 @@
 }
 
 static void
-toggle_blink(w)
-DclockWidget w;
+toggle_blink (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
     Arg arg;
 
     if (!w->dclock.display_time) {
@@ -2131,9 +2132,9 @@
 }
 
 static void
-toggle_seconds(w)
-DclockWidget w;
+toggle_seconds (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
     Arg arg;
 
     if (!w->dclock.display_time) {
@@ -2145,21 +2146,21 @@
 }
 
 static void
-toggle_fade(w)
-DclockWidget w;
+toggle_fade (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
     Arg arg;
 
     XtSetArg(arg, XtNfade, !w->dclock.fade);
     XtSetValues((Widget)w, &arg, 1);
     if (w->dclock.fade && w->dclock.scroll)
-	toggle_scroll(w);
+	toggle_scroll(wr, e, a, b);
 }
 
 static void
-toggle_tails(w)
-DclockWidget w;
+toggle_tails (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
     Arg arg;
 
     XtSetArg(arg, XtNtails, !w->dclock.tails);
@@ -2167,9 +2168,9 @@
 }
 
 static void
-toggle_alarm(w)
-DclockWidget w;
+toggle_alarm (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
     Arg arg;
 
     XtSetArg(arg, XtNalarm, !w->dclock.alarm);
@@ -2177,10 +2178,11 @@
 }
 
 static void
-set_alarm(w, event)
-DclockWidget w;
-XButtonEvent *event;
+set_alarm (Widget wr, XEvent *e, char **a, unsigned int *b)
 {
+    DclockWidget w = (DclockWidget)wr;
+    XButtonEvent *event = (XButtonEvent *)e;
+
     static int saved_secs, saved_miltime, saved_fade, saved_blink;
 
     if (event->button == 3) {
@@ -2197,8 +2199,8 @@
 	    w->dclock.fade = saved_fade;
 	    w->dclock.blink = saved_blink;
 	}
-	ResizeNow(w);
-	Redisplay(w);
+	ResizeNow(w, NULL);
+        Redisplay(wr, NULL, NULL);
     } else if (!w->dclock.display_time &&
 	    (event->button == 1 || event->button == 2)) {
 	/* get the digit under the position (1-4) the mouse is over
@@ -2221,7 +2223,7 @@
 			+ w->dclock.font->descent));
 	}
 	if (i >= 0)
-	    toggle_alarm(w);
+	    toggle_alarm((Widget )w, NULL, NULL, NULL);
 	else for (i = 0; i < 4; i++) {
 	    x = i * w->dclock.digit_w + (i>1) * (w->dclock.digit_w / 2) + 
 		(w->dclock.digit_h - event->y) / w->dclock.angle;
@@ -2268,10 +2270,7 @@
 /* Draw a box around the digit, for use with the alarm-time setting function.*/
 
 static void
-outline_digit(w, i, draw_it)
-DclockWidget w;
-int i;
-Boolean draw_it;
+outline_digit(DclockWidget w, int i, Boolean draw_it)
 {
     int xbase, y, xadd;
     XPoint rectpts[5];
Index: dclock/dclock.c
===================================================================
--- dclock.orig/dclock.c	2025-09-11 00:01:48.140550626 +0200
+++ dclock/dclock.c	2025-09-11 00:05:01.273117660 +0200
@@ -106,7 +106,7 @@
 }
 
 static void
-quit()
+quit(Widget w, XEvent *e, char **a, Cardinal *n)
 {
     exit(0);
 }
@@ -122,7 +122,7 @@
 {
     XtAppContext app;
     Widget toplevel, clock_w;
-    char *name, *rindex();
+    char *name;
     XWMHints     *wmhints;       /* for proper input focus */
 
     if (name = rindex(argv[0], '/'))
