From 832292c9a8c344f516c3687897c7972e8abf7d56 Mon Sep 17 00:00:00 2001 From: texasich <101962694+texasich@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:47:11 -0500 Subject: [PATCH 1/4] gpm.h: fix Gpm_Wgetch prototype for C23/GCC 15 compatibility GCC 15 defaults to -std=gnu23, where empty () means (void). Gpm_Wgetch was declared without parameters but defined with WINDOW*. Forward-declare struct _win_st to add a proper prototype without pulling in curses.h. Part of fix for #48. --- src/headers/gpm.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/headers/gpm.h b/src/headers/gpm.h index fe52e53..fa4b2a9 100644 --- a/src/headers/gpm.h +++ b/src/headers/gpm.h @@ -268,7 +268,10 @@ Gpm_Roi * Gpm_LowerRoi(Gpm_Roi *which, Gpm_Roi *after); /* libcurses.c */ /* #include Hmm... seems risky */ -extern int Gpm_Wgetch(); +/* Forward-declare ncurses WINDOW type for C23 compatibility. + * In C23, empty () means (void), so we need a proper prototype. */ +struct _win_st; +extern int Gpm_Wgetch(struct _win_st *); #define Gpm_Getch() (Gpm_Wgetch(NULL)) /* libxtra.c */ From 666405d2739eea5cc3bdcc898e383fa724c112c5 Mon Sep 17 00:00:00 2001 From: texasich <101962694+texasich@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:49:15 -0500 Subject: [PATCH 2/4] Fix function declaration for old_main to use void --- src/headers/daemon.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/daemon.h b/src/headers/daemon.h index 24a1a97..3ee77c4 100644 --- a/src/headers/daemon.h +++ b/src/headers/daemon.h @@ -204,7 +204,7 @@ void gpm_exited(void); void gpm_killed(int signo); int open_console(const int mode); -int old_main(); +int old_main(void); int processConn(int fd); int processMouse(int fd, Gpm_Event *event, Gpm_Type *type, int kd_mode); @@ -234,7 +234,7 @@ void check_uniqueness(void); void check_kill(void); /* gpm.c */ -int old_main(); +int old_main(void); #endif From 41f7520083f749c584b2b6647b86d679b71f170d Mon Sep 17 00:00:00 2001 From: texasich <101962694+texasich@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:50:37 -0500 Subject: [PATCH 3/4] Change old_main function signature to include void --- src/daemon/old_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemon/old_main.c b/src/daemon/old_main.c index ab7a87f..e094107 100644 --- a/src/daemon/old_main.c +++ b/src/daemon/old_main.c @@ -39,7 +39,7 @@ #endif -int old_main() +int old_main(void) { int ctlfd, newfd; struct sockaddr_un ctladdr; From adf5a2d7625425ea32a3a77ad361e38dcdd1129c Mon Sep 17 00:00:00 2001 From: texasich <101962694+texasich@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:52:06 -0500 Subject: [PATCH 4/4] Change gpm_convert_event parameter type to unsigned char --- src/lib/libcurses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/libcurses.c b/src/lib/libcurses.c index e7ebf84..33cca70 100644 --- a/src/lib/libcurses.c +++ b/src/lib/libcurses.c @@ -95,7 +95,7 @@ static Gpm_Event ev; /* JD patch 11/08/1998 */ #define MAXNBPREVCHAR 4 /* I don't think more is usefull, JD */ static int nbprevchar=0, prevchar[MAXNBPREVCHAR]; - extern int gpm_convert_event(char *data, Gpm_Event *event); + extern int gpm_convert_event(unsigned char *data, Gpm_Event *event); int c; unsigned char mdata[4]; /* JD patch 11/08/1998 */