From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: openKylinBot <openKylinBot@openkylin.top>
Date: Sep, 14 2026 13:42:23 +0000
Subject: [PATCH] Fix empty parameter list declarations to build with GCC 15 (C23)

Description: Convert the K&R-era empty parameter lists in xdu.c and xwin.c
 into complete prototypes matching the function definitions, and add
 forward declarations for the c_resize/c_repaint callbacks. GCC 15
 defaults to -std=gnu23, in which an empty parameter list means (void),
 so every call with arguments failed to compile (xdu.c: too many
 arguments / number of arguments doesn't match prototype).
Author: openKylinBot <openKylinBot@openkylin.top>
Origin: vendor
Forwarded: not-needed

--- xdu-3.0.orig/xdu.c
+++ xdu-3.0/xdu.c
@@ -33,24 +33,32 @@
 #define	NCOLS		5	/* default number of columns in display */
 
 /* What we IMPORT from xwin.c */
-extern int xsetup(), xmainloop(), xdrawrect();
-extern void xrepaint();
+extern int xsetup(int *argcp, char **argv);
+extern int xmainloop(void);
+extern int xdrawrect(char *name, long long size, int x, int y, int width, int height);
+extern void xrepaint(void);
 
 /* What we EXPORT to xwin.c */
-extern int press(), reset(), repaint(), setorder(), reorder();
-extern void nodeinfo(), helpinfo();
+extern int press(int x, int y);
+extern int reset(void);
+extern int repaint(int width, int height);
+extern int setorder(char *op);
+extern int reorder(char *op);
+extern void nodeinfo(void);
+extern void helpinfo(void);
 int ncols = NCOLS;
 
 /* internal routines */
 #ifdef NEED_STRDUP
 char *strdup();
 #endif
-void addtree();
-void parse_file();
-void parse_entry();
-void dumptree();
-void clearrects();
-void sorttree();
+struct node;
+void addtree(struct node *top, char *path[], long long size);
+void parse_file(char *filename);
+void parse_entry(char *name, long long size);
+void dumptree(struct node *np, int level);
+void clearrects(struct node *nodep);
+void sorttree(struct node *np, int order);
 
 /* order to sort paths by */
 #define	ORD_FIRST	1
@@ -502,7 +510,7 @@ int order;
 }
 
 /* Forward declaration */
-void drawchildren();
+void drawchildren(struct node *nodep, struct rect rect);
 
 /*
  * Draws a node in the given rectangle, and all of its children
--- xdu-3.0.orig/xwin.c
+++ xdu-3.0/xwin.c
@@ -35,26 +35,30 @@
 #endif
 
 /* IMPORTS: routines that this module vectors out to */
-extern int press();
-extern int reset();
-extern int repaint();
-extern int reorder();
-extern int setorder();
-extern int nodeinfo();
-extern int helpinfo();
+extern int press(int x, int y);
+extern int reset(void);
+extern int repaint(int width, int height);
+extern int reorder(char *op);
+extern int setorder(char *op);
+extern void nodeinfo(void);
+extern void helpinfo(void);
 extern int ncols;
 
 /* EXPORTS: routines that this module exports outside */
-extern int xsetup();
-extern int xmainloop();
-extern void xclear();
-extern void xrepaint();
-extern void xrepaint_noclear();
-extern void xdrawrect();
+extern int xsetup(int *argcp, char **argv);
+extern int xmainloop(void);
+extern void xclear(void);
+extern void xrepaint(void);
+extern void xrepaint_noclear(void);
+extern void xdrawrect(char *name, long long size, int x, int y, int width, int height);
 
 /* internal routines */
-static void help_popup();
-static void help_popdown();
+static void help_popup(void);
+static void help_popdown(void);
+static void c_resize(Widget w, XtPointer data, XEvent *event,
+	Boolean *continue_to_dispatch);
+static void c_repaint(Widget w, XtPointer data, XEvent *event,
+	Boolean *continue_to_dispatch);
 
 static String fallback_resources[] = {
 "*window.width:		600",
@@ -103,15 +107,15 @@ static XrmOptionDescRec options[] = {
 };
 
 /* action routines */
-static void a_goto();
-static void a_reset();
-static void a_quit();
-static void a_reorder();
-static void a_size();
-static void a_ncol();
-static void a_info();
-static void a_help();
-static void a_removehelp();
+static void a_goto(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void a_reset(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void a_quit(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void a_reorder(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void a_size(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void a_ncol(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void a_info(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void a_help(Widget w, XEvent *event, String *params, Cardinal *num_params);
+static void a_removehelp(Widget w, XEvent *event, String *params, Cardinal *num_params);
 
 static XtActionsRec actionsTable[] = {
 	{ "reset",	a_reset },

