From a8718c1450be85caa410b3a4cb3d98706d04f20c Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 10 May 2015 07:07:12 +0200 Subject: [PATCH] Clean up some more signal handlers in various places. --- games/atc/extern.h | 6 +- games/atc/graphics.c | 3 +- games/atc/log.c | 8 ++- games/atc/main.c | 13 ++-- games/atc/update.c | 2 +- games/backgammon/backgammon/main.c | 9 ++- games/backgammon/backgammon/move.c | 2 +- games/backgammon/common_source/back.h | 3 +- games/backgammon/common_source/fancy.c | 2 +- games/backgammon/common_source/save.c | 5 +- games/backgammon/common_source/subs.c | 8 +-- games/backgammon/teachgammon/teach.c | 3 +- games/larn/signal.c | 91 +++++++++++++------------- games/phantasia/io.c | 7 +- games/robots/main.c | 9 ++- games/robots/move.c | 3 +- games/robots/move_robs.c | 5 +- games/robots/play_level.c | 2 +- games/robots/robots.h | 5 +- games/rogue/init.c | 7 +- games/rogue/machdep.c | 6 +- games/rogue/message.c | 3 +- games/rogue/rogue.h | 6 +- games/sail/externs.h | 2 +- games/sail/pl_7.c | 4 +- games/sail/pl_main.c | 2 +- 26 files changed, 103 insertions(+), 113 deletions(-) diff --git a/games/atc/extern.h b/games/atc/extern.h index 6305c93e1c..6f0909b1cb 100644 --- a/games/atc/extern.h +++ b/games/atc/extern.h @@ -30,7 +30,6 @@ * SUCH DAMAGE. * * @(#)extern.h 8.1 (Berkeley) 5/31/93 - * $DragonFly: src/games/atc/extern.h,v 1.2 2006/08/08 15:03:02 pavalos Exp $ */ /* @@ -72,7 +71,7 @@ extern void loser(const PLANE *, const char *); extern void planewin(void); extern void redraw(void); extern void setup_screen(const C_SCREEN *); -extern void quit(void); +extern void quit(int); /* input.c */ extern int dir_no(char); extern int getcommand(void); @@ -82,6 +81,7 @@ extern void delete(LIST *, PLANE *); extern PLANE *newplane(void); /* log.c */ extern int log_score(int); +extern void log_score_quit(int); extern void open_score_file(void); /* update.c */ extern int addplane(void); @@ -89,5 +89,5 @@ extern const char *command(const PLANE *); extern PLANE *findplane(int); extern char name(const PLANE *); extern char number(char); -extern void update(void); +extern void update(int); diff --git a/games/atc/graphics.c b/games/atc/graphics.c index 5441c3a854..03f7b0b41f 100644 --- a/games/atc/graphics.c +++ b/games/atc/graphics.c @@ -31,7 +31,6 @@ * * @(#)graphics.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/atc/graphics.c,v 1.7 1999/11/30 03:48:19 billf Exp $ - * $DragonFly: src/games/atc/graphics.c,v 1.3 2006/08/08 15:03:02 pavalos Exp $ */ /* @@ -278,7 +277,7 @@ ioerror(int pos, int len, const char *str) } void -quit(void) +quit(__unused int sig) { int c, y, x; struct itimerval itv; diff --git a/games/atc/log.c b/games/atc/log.c index aed6d7ee11..645d043cf0 100644 --- a/games/atc/log.c +++ b/games/atc/log.c @@ -31,7 +31,6 @@ * * @(#)log.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/atc/log.c,v 1.7 1999/11/30 03:48:20 billf Exp $ - * $DragonFly: src/games/atc/log.c,v 1.3 2006/08/08 15:03:02 pavalos Exp $ */ /* @@ -269,3 +268,10 @@ log_score(int list_em) putchar('\n'); return (0); } + +void +log_score_quit(__unused int sig) +{ + log_score(0); + exit(0); +} diff --git a/games/atc/main.c b/games/atc/main.c index 73f0590160..500bcf1504 100644 --- a/games/atc/main.c +++ b/games/atc/main.c @@ -32,7 +32,6 @@ * @(#) Copyright (c) 1990, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/atc/main.c,v 1.9 1999/11/30 03:48:21 billf Exp $ - * $DragonFly: src/games/atc/main.c,v 1.4 2006/10/08 17:11:30 pavalos Exp $ */ /* @@ -149,12 +148,12 @@ main(int argc __unused, char *argv[]) addplane(); - signal(SIGINT, (sig_t)quit); - signal(SIGQUIT, (sig_t)quit); + signal(SIGINT, quit); + signal(SIGQUIT, quit); signal(SIGTSTP, SIG_IGN); signal(SIGSTOP, SIG_IGN); - signal(SIGHUP, (sig_t)log_score); - signal(SIGTERM, (sig_t)log_score); + signal(SIGHUP, log_score_quit); + signal(SIGTERM, log_score_quit); tcgetattr(fileno(stdin), &tty_start); bcopy(&tty_start, &tty_new, sizeof(tty_new)); @@ -162,7 +161,7 @@ main(int argc __unused, char *argv[]) tty_new.c_cc[VMIN] = 1; tty_new.c_cc[VTIME] = 0; tcsetattr(fileno(stdin), TCSANOW, &tty_new); - signal(SIGALRM, (sig_t)update); + signal(SIGALRM, update); itv.it_value.tv_sec = 0; itv.it_value.tv_usec = 1; @@ -178,7 +177,7 @@ main(int argc __unused, char *argv[]) itv.it_value.tv_usec = 0; setitimer(ITIMER_REAL, &itv, NULL); - update(); + update(0); itv.it_value.tv_sec = sp->update_secs; itv.it_value.tv_usec = 0; diff --git a/games/atc/update.c b/games/atc/update.c index 6ecf5723e2..76d4d1177d 100644 --- a/games/atc/update.c +++ b/games/atc/update.c @@ -50,7 +50,7 @@ static int dir_deg(int); void -update(void) +update(__unused int sig) { int i, dir_diff, mask, unclean; PLANE *pp, *p1, *p2; diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c index c683a07af2..7510183f77 100644 --- a/games/backgammon/backgammon/main.c +++ b/games/backgammon/backgammon/main.c @@ -29,7 +29,6 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/backgammon/backgammon/main.c,v 1.13 1999/11/30 03:48:22 billf Exp $ - * $DragonFly: src/games/backgammon/backgammon/main.c,v 1.3 2006/08/08 16:36:11 pavalos Exp $ */ #include @@ -92,7 +91,7 @@ main(int argc, char **argv) /* initialization */ bflag = 2; /* default no board */ acnt = 1; /* Number of args */ - signal(SIGINT, (sig_t)getout); /* trap interrupts */ + signal(SIGINT, getout); /* trap interrupts */ if (tcgetattr(0, &tty) == -1) /* get old tty mode */ errexit("backgammon(tcgetattr)"); old = tty.c_lflag; @@ -182,7 +181,7 @@ main(int argc, char **argv) else writec('\n'); writel("Password:"); - signal(SIGALRM, (sig_t)getout); + signal(SIGALRM, getout); cflag = 1; alarm(10); for (i = 0; i < 10; i++) { @@ -198,7 +197,7 @@ main(int argc, char **argv) pbuf[i] = '\0'; for (i = 0; i < 9; i++) if (pbuf[i] != password[i]) - getout(); + getout(0); iroll = 1; if (tflag) curmove(curr, 0); @@ -512,7 +511,7 @@ main(int argc, char **argv) } /* leave peacefully */ - getout(); + getout(0); /* NOTREACHED */ return (0); } diff --git a/games/backgammon/backgammon/move.c b/games/backgammon/backgammon/move.c index a6a9997f72..cc859c0636 100644 --- a/games/backgammon/backgammon/move.c +++ b/games/backgammon/backgammon/move.c @@ -349,7 +349,7 @@ nextfree(void) new = calloc(1, sizeof(struct BOARD)); if (new == NULL) { writel("\nOut of memory\n"); - getout(); + getout(0); } new->b_next = NULL; } else { diff --git a/games/backgammon/common_source/back.h b/games/backgammon/common_source/back.h index 33a03c6315..123ca4af4a 100644 --- a/games/backgammon/common_source/back.h +++ b/games/backgammon/common_source/back.h @@ -27,7 +27,6 @@ * SUCH DAMAGE. * * @(#)back.h 8.1 (Berkeley) 5/31/93 - * $DragonFly: src/games/backgammon/common_source/back.h,v 1.2 2006/08/08 16:36:11 pavalos Exp $ */ #include @@ -143,7 +142,7 @@ int freemen(int); void getarg(int, char **); int getcaps(const char *); void getmove(void); -void getout(void); /* function to exit backgammon cleanly */ +void getout(int); /* function to exit backgammon cleanly */ void gwrite(void); void init(void); int makmove(int); diff --git a/games/backgammon/common_source/fancy.c b/games/backgammon/common_source/fancy.c index 61ef08e986..6a07a8cf57 100644 --- a/games/backgammon/common_source/fancy.c +++ b/games/backgammon/common_source/fancy.c @@ -488,7 +488,7 @@ newpos(void) switch (mode) { case -1: /* error! */ write(2, "\r\nInternal cursor error.\r\n", 26); - getout(); + getout(0); case 0: /* direct cursor motion */ tputs(m, abs(curr - r), addbuf); diff --git a/games/backgammon/common_source/save.c b/games/backgammon/common_source/save.c index 4e36a82c41..7c7cd8e024 100644 --- a/games/backgammon/common_source/save.c +++ b/games/backgammon/common_source/save.c @@ -28,7 +28,6 @@ * * @(#)save.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/backgammon/common_source/save.c,v 1.8 1999/11/30 03:48:27 billf Exp $ - * $DragonFly: src/games/backgammon/common_source/save.c,v 1.4 2006/08/08 16:36:11 pavalos Exp $ */ #include @@ -134,7 +133,7 @@ save(int n) writel(rec); if (tflag) clend(); - getout(); + getout(0); } void @@ -169,5 +168,5 @@ norec(const char *s) c = s; while (*c != '\0') writec(*c++); - getout(); + getout(0); } diff --git a/games/backgammon/common_source/subs.c b/games/backgammon/common_source/subs.c index cbbfdd6e78..cc7392babc 100644 --- a/games/backgammon/common_source/subs.c +++ b/games/backgammon/common_source/subs.c @@ -60,7 +60,7 @@ errexit(const char *s) { write(2, "\n", 1); perror(s); - getout(); + getout(0); } int @@ -101,7 +101,7 @@ readc(void) errexit("readc"); #ifdef WHY_IS_THIS_HARDWIRED_IN_HERE if (c == '\177') - getout(); + getout(0); #endif if (c == '\033' || c == '\015') return ('\n'); @@ -370,7 +370,7 @@ getarg(int argc, char **argv) case 'h': for (i = 0; descr[i] != NULL; i++) puts(descr[i]); - getout(); + getout(0); } } argc -= optind; @@ -423,7 +423,7 @@ fixtty(int mode) } void -getout(void) +getout(__unused int sig) { /* go to bottom of screen */ if (tflag) { diff --git a/games/backgammon/teachgammon/teach.c b/games/backgammon/teachgammon/teach.c index b6d60ca9ed..cc6299f1ee 100644 --- a/games/backgammon/teachgammon/teach.c +++ b/games/backgammon/teachgammon/teach.c @@ -29,7 +29,6 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)teach.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/backgammon/teachgammon/teach.c,v 1.12 1999/11/30 03:48:30 billf Exp $ - * $DragonFly: src/games/backgammon/teachgammon/teach.c,v 1.3 2006/08/08 16:36:11 pavalos Exp $ */ #include @@ -62,7 +61,7 @@ main(int argc, char **argv) setgid(getgid()); acnt = 1; - signal(SIGINT, (sig_t)getout); + signal(SIGINT, getout); if (tcgetattr(0, &tty) == -1) /* get old tty mode */ errexit("teachgammon(tcgetattr)"); old = tty.c_lflag; diff --git a/games/larn/signal.c b/games/larn/signal.c index 6da1a1c732..c4901a23b2 100644 --- a/games/larn/signal.c +++ b/games/larn/signal.c @@ -1,27 +1,24 @@ -/* - * $DragonFly: src/games/larn/signal.c,v 1.4 2006/08/26 17:05:05 pavalos Exp $ - */ /* "Larn is copyrighted 1986 by Noah Morgan.\n" */ #include #include "header.h" static void s2choose(void); -static void cntlc(void); -static void sgam(void); +static void cntlc(int); +static void sgam(int); #ifdef SIGTSTP -static void tstop(void); +static void tstop(int); #endif -static void sigill(void); -static void sigtrap(void); -static void sigiot(void); -static void sigemt(void); -static void sigfpe(void); -static void sigbus(void); -static void sigsegv(void); -static void sigsys(void); -static void sigpipe(void); -static void sigterm(void); +static void sigill(int); +static void sigtrap(int); +static void sigiot(int); +static void sigemt(int); +static void sigfpe(int); +static void sigbus(int); +static void sigsegv(int); +static void sigsys(int); +static void sigpipe(int); +static void sigterm(int); static void sigpanic(int); #define BIT(a) (1<<((a)-1)) @@ -39,7 +36,7 @@ s2choose(void) /* text to be displayed if ^C during intro screen */ } static void -cntlc(void) /* what to do for a ^C */ +cntlc(__unused int sig) /* what to do for a ^C */ { if (nosignal) /* don't do anything if inhibited */ return; @@ -51,15 +48,15 @@ cntlc(void) /* what to do for a ^C */ else showplayer(); lflush(); - signal(SIGQUIT, (sig_t)cntlc); - signal(SIGINT, (sig_t)cntlc); + signal(SIGQUIT, cntlc); + signal(SIGINT, cntlc); } /* * subroutine to save the game if a hangup signal */ static void -sgam(void) +sgam(__unused int sig) { savegame(savefilename); wizard = 1; @@ -68,7 +65,7 @@ sgam(void) #ifdef SIGTSTP static void -tstop(void) /* control Y */ +tstop(__unused int sig) /* control Y */ { if (nosignal) /* nothing if inhibited */ return; @@ -83,7 +80,7 @@ tstop(void) /* control Y */ kill(getpid(), SIGTSTP); setupvt100(); - signal(SIGTSTP, (sig_t)tstop); + signal(SIGTSTP, tstop); if (predostuff == 1) s2choose(); else @@ -97,61 +94,61 @@ tstop(void) /* control Y */ * subroutine to issue the needed signal traps called from main() */ static void -sigill(void) +sigill(__unused int sig) { sigpanic(SIGILL); } static void -sigtrap(void) +sigtrap(__unused int sig) { sigpanic(SIGTRAP); } static void -sigiot(void) +sigiot(__unused int sig) { sigpanic(SIGIOT); } static void -sigemt(void) +sigemt(__unused int sig) { sigpanic(SIGEMT); } static void -sigfpe(void) +sigfpe(__unused int sig) { sigpanic(SIGFPE); } static void -sigbus(void) +sigbus(__unused int sig) { sigpanic(SIGBUS); } static void -sigsegv(void) +sigsegv(__unused int sig) { sigpanic(SIGSEGV); } static void -sigsys(void) +sigsys(__unused int sig) { sigpanic(SIGSYS); } static void -sigpipe(void) +sigpipe(__unused int sig) { sigpanic(SIGPIPE); } static void -sigterm(void) +sigterm(__unused int sig) { sigpanic(SIGTERM); } @@ -159,23 +156,23 @@ sigterm(void) void sigsetup(void) { - signal(SIGQUIT, (sig_t)cntlc); - signal(SIGINT, (sig_t)cntlc); + signal(SIGQUIT, cntlc); + signal(SIGINT, cntlc); signal(SIGKILL, SIG_IGN); - signal(SIGHUP, (sig_t)sgam); - signal(SIGILL, (sig_t)sigill); - signal(SIGTRAP, (sig_t)sigtrap); - signal(SIGIOT, (sig_t)sigiot); - signal(SIGEMT, (sig_t)sigemt); - signal(SIGFPE, (sig_t)sigfpe); - signal(SIGBUS, (sig_t)sigbus); - signal(SIGSEGV, (sig_t)sigsegv); - signal(SIGSYS, (sig_t)sigsys); - signal(SIGPIPE, (sig_t)sigpipe); - signal(SIGTERM, (sig_t)sigterm); + signal(SIGHUP, sgam); + signal(SIGILL, sigill); + signal(SIGTRAP, sigtrap); + signal(SIGIOT, sigiot); + signal(SIGEMT, sigemt); + signal(SIGFPE, sigfpe); + signal(SIGBUS, sigbus); + signal(SIGSEGV, sigsegv); + signal(SIGSYS, sigsys); + signal(SIGPIPE, sigpipe); + signal(SIGTERM, sigterm); #ifdef SIGTSTP - signal(SIGTSTP, (sig_t)tstop); - signal(SIGSTOP, (sig_t)tstop); + signal(SIGTSTP, tstop); + signal(SIGSTOP, tstop); #endif /* SIGTSTP */ } diff --git a/games/phantasia/io.c b/games/phantasia/io.c index 42da0523ac..8dfd7d4725 100644 --- a/games/phantasia/io.c +++ b/games/phantasia/io.c @@ -2,7 +2,6 @@ * io.c - input/output routines for Phantasia * * $FreeBSD: src/games/phantasia/io.c,v 1.6 1999/11/16 02:57:33 billf Exp $ - * $DragonFly: src/games/phantasia/io.c,v 1.3 2005/05/31 00:06:26 swildner Exp $ */ #include @@ -15,7 +14,7 @@ extern void leavegame(void); /* phantglobs.c */ extern double drandom(void); -void catchalarm(void); +void catchalarm(int); int getanswer(const char *, bool); void getstring(char *, int); double infloat(void); @@ -282,7 +281,7 @@ getanswer(const char *choices, bool def) #ifdef BSD41 sigset(SIGALRM, catchalarm); #else - signal(SIGALRM, (sig_t)catchalarm); + signal(SIGALRM, catchalarm); #endif /* set timeout */ if (Timeout) @@ -342,7 +341,7 @@ YELL: mvprintw(oldy + 1, 0, */ void -catchalarm(void) +catchalarm(__unused int sig) { longjmp(Timeoenv, 1); } diff --git a/games/robots/main.c b/games/robots/main.c index 566a30d123..3e4141fe0e 100644 --- a/games/robots/main.c +++ b/games/robots/main.c @@ -29,7 +29,6 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)main.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/robots/main.c,v 1.7 1999/11/30 03:49:18 billf Exp $ - * $DragonFly: src/games/robots/main.c,v 1.3 2006/08/27 21:45:07 pavalos Exp $ */ #include "robots.h" @@ -102,7 +101,7 @@ main(int argc, char **argv) } initscr(); - signal(SIGINT, (sig_t)quit); + signal(SIGINT, quit); cbreak(); noecho(); nonl(); @@ -119,7 +118,7 @@ main(int argc, char **argv) srandomdev(); if (Real_time) - signal(SIGALRM, (sig_t)move_robots); + signal(SIGALRM, move_robots); do { init_field(); for (Level = Start_level; !Dead; Level++) { @@ -131,7 +130,7 @@ main(int argc, char **argv) refresh(); score(); } while (another()); - quit(); + quit(0); /* NOTREACHED */ return(0); } @@ -141,7 +140,7 @@ main(int argc, char **argv) * Leave the program elegantly. */ void -quit(void) +quit(__unused int sig) { endwin(); exit(0); diff --git a/games/robots/move.c b/games/robots/move.c index 4103f0fc82..9917a65750 100644 --- a/games/robots/move.c +++ b/games/robots/move.c @@ -28,7 +28,6 @@ * * @(#)move.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/robots/move.c,v 1.6 1999/11/30 03:49:18 billf Exp $ - * $DragonFly: src/games/robots/move.c,v 1.3 2006/08/27 21:45:07 pavalos Exp $ */ #include @@ -152,7 +151,7 @@ over: case 'q': case 'Q': if (query("Really quit?")) - quit(); + quit(0); refresh(); break; case 'w': diff --git a/games/robots/move_robs.c b/games/robots/move_robs.c index 9342aa7277..a86a144348 100644 --- a/games/robots/move_robs.c +++ b/games/robots/move_robs.c @@ -28,7 +28,6 @@ * * @(#)move_robs.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/robots/move_robs.c,v 1.4 1999/11/30 03:49:19 billf Exp $ - * $DragonFly: src/games/robots/move_robs.c,v 1.4 2006/08/27 21:45:07 pavalos Exp $ */ #include "robots.h" @@ -41,12 +40,12 @@ static int sign(int); * Move the robots around */ void -move_robots(bool was_sig) +move_robots(int was_sig) { COORD *rp; if (Real_time) - signal(SIGALRM, (sig_t)move_robots); + signal(SIGALRM, move_robots); #ifdef DEBUG move(Min.y, Min.x); addch(inch()); diff --git a/games/robots/play_level.c b/games/robots/play_level.c index 105a1954b0..4110552728 100644 --- a/games/robots/play_level.c +++ b/games/robots/play_level.c @@ -72,7 +72,7 @@ play_level(void) if (Field[My_pos.y][My_pos.x] != 0) Dead = true; if (!Dead) - move_robots(false); + move_robots(0); if (Was_bonus) { move(Y_PROMPT, X_PROMPT); clrtoeol(); diff --git a/games/robots/robots.h b/games/robots/robots.h index 679dc6a59f..1118513a92 100644 --- a/games/robots/robots.h +++ b/games/robots/robots.h @@ -27,7 +27,6 @@ * SUCH DAMAGE. * * @(#)robots.h 8.1 (Berkeley) 5/31/93 - * $DragonFly: src/games/robots/robots.h,v 1.2 2006/08/27 21:45:07 pavalos Exp $ */ #include @@ -102,10 +101,10 @@ void get_move(void); void init_field(void); bool jumping(void); void make_level(void); -void move_robots(bool); +void move_robots(int); void play_level(void); int query(const char *); -void quit(void); +void quit(int); void reset_count(void); COORD *rnd_pos(void); void score(void); diff --git a/games/rogue/init.c b/games/rogue/init.c index 5b7d19df09..d6cbfe3f5a 100644 --- a/games/rogue/init.c +++ b/games/rogue/init.c @@ -31,7 +31,6 @@ * * @(#)init.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/rogue/init.c,v 1.4 1999/11/30 03:49:22 billf Exp $ - * $DragonFly: src/games/rogue/init.c,v 1.3 2006/09/02 19:31:07 pavalos Exp $ */ /* @@ -206,7 +205,7 @@ stop_window(void) } void -byebye(void) +byebye(__unused int sig) { md_ignore_signals(); if (ask_quit) { @@ -218,7 +217,7 @@ byebye(void) } void -onintr(void) +onintr(__unused int sig) { md_ignore_signals(); if (cant_int) { @@ -231,7 +230,7 @@ onintr(void) } void -error_save(void) +error_save(__unused int sig) { save_is_interactive = 0; save_into_file(error_file); diff --git a/games/rogue/machdep.c b/games/rogue/machdep.c index 291f430525..2af9fc239b 100644 --- a/games/rogue/machdep.c +++ b/games/rogue/machdep.c @@ -217,9 +217,9 @@ md_control_keybord(boolean mode) void md_heed_signals(void) { - signal(SIGINT, (sig_t)onintr); - signal(SIGQUIT, (sig_t)byebye); - signal(SIGHUP, (sig_t)error_save); + signal(SIGINT, onintr); + signal(SIGQUIT, byebye); + signal(SIGHUP, error_save); } /* md_ignore_signals(): diff --git a/games/rogue/message.c b/games/rogue/message.c index b746dd671f..bd649a93e7 100644 --- a/games/rogue/message.c +++ b/games/rogue/message.c @@ -31,7 +31,6 @@ * * @(#)message.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/rogue/message.c,v 1.7.2.1 2000/07/20 10:35:07 kris Exp $ - * $DragonFly: src/games/rogue/message.c,v 1.4 2006/09/02 19:31:07 pavalos Exp $ */ /* @@ -97,7 +96,7 @@ message(const char *msg, boolean intrpt) if (did_int) { did_int = 0; - onintr(); + onintr(0); } } diff --git a/games/rogue/rogue.h b/games/rogue/rogue.h index e1be13c856..4fea6d18a3 100644 --- a/games/rogue/rogue.h +++ b/games/rogue/rogue.h @@ -462,9 +462,9 @@ boolean init(int, char**); void clean_up(const char *); void start_window(void); void stop_window(void); -void byebye(void); -void onintr(void); -void error_save(void); +void byebye(int); +void onintr(int); +void error_save(int); /* inventory.c */ void inventory(const object *, unsigned short); diff --git a/games/sail/externs.h b/games/sail/externs.h index 36dbed63a6..3341090180 100644 --- a/games/sail/externs.h +++ b/games/sail/externs.h @@ -383,7 +383,7 @@ void loadplayer(void); /* pl_7.c */ void initscreen(void); void cleanupscreen(void); -void newturn(void); +void newturn(int); void Signal(const char *, struct ship *, ...); int sgetch(const char *, struct ship *, char); void sgetstr(const char *, char *, int); diff --git a/games/sail/pl_7.c b/games/sail/pl_7.c index 80ea3e8c0b..542ede7486 100644 --- a/games/sail/pl_7.c +++ b/games/sail/pl_7.c @@ -80,7 +80,7 @@ cleanupscreen(void) } void -newturn(void) +newturn(__unused int sig) { repaired = loaded = fired = changed = 0; movebuf[0] = '\0'; @@ -129,7 +129,7 @@ newturn(void) adjustview(); draw_screen(); - signal(SIGALRM, (sig_t)newturn); + signal(SIGALRM, newturn); alarm(7); } diff --git a/games/sail/pl_main.c b/games/sail/pl_main.c index 55486b028d..c38eade022 100644 --- a/games/sail/pl_main.c +++ b/games/sail/pl_main.c @@ -239,5 +239,5 @@ reprint: snprintf(message, sizeof message, "Captain %s assuming command", captain); Writestr(W_SIGNAL, ms, message); - newturn(); + newturn(0); } -- 2.41.0