File: 08_fixes_for_gcc_15.diff

package info (click to toggle)
dclock 2.2.2-16
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772 kB
  • sloc: ansic: 2,071; makefile: 749
file content (800 lines) | stat: -rw-r--r-- 22,969 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
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], '/'))