games: Remove (void) casts.
authorzrj <rimvydas.jasinskas@gmail.com>
Thu, 16 Nov 2017 13:27:21 +0000 (15:27 +0200)
committerzrj <zrj@dragonflybsd.org>
Thu, 16 Nov 2017 14:59:07 +0000 (16:59 +0200)
No functional change.

32 files changed:
games/arithmetic/arithmetic.c
games/atc/input.c
games/atc/log.c
games/atc/update.c
games/hack/hack.end.c
games/hack/hack.main.c
games/hack/hack.objnam.c
games/hack/hack.u_init.c
games/hack/hack.unix.c
games/hangman/main.c
games/hunt/hunt/connect.c
games/hunt/hunt/display.c
games/hunt/hunt/hunt.c
games/hunt/hunt/list.c
games/hunt/hunt/otto.c
games/hunt/hunt/playit.c
games/hunt/huntd/answer.c
games/hunt/huntd/conf.c
games/hunt/huntd/driver.c
games/hunt/huntd/execute.c
games/hunt/huntd/terminal.c
games/morse/morse.c
games/number/number.c
games/pig/pig.c
games/pom/pom.c
games/quiz/quiz.c
games/quiz/rxp.c
games/rain/rain.c
games/random/random.c
games/random/randomize_fd.c
games/worms/worms.c
games/wump/wump.c

index c42f41b..7acad57 100644 (file)
@@ -32,7 +32,6 @@
  * @(#) Copyright (c) 1989, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)arithmetic.c    8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/games/arithmetic/arithmetic.c,v 1.10 1999/12/12 06:40:28 billf Exp $
- * $DragonFly: src/games/arithmetic/arithmetic.c,v 1.4 2005/04/24 15:31:30 liamfoy Exp $
  */
 
 /*
@@ -111,7 +110,7 @@ main(int argc, char *argv[])
 
                        for (p = keys = optarg; *p; ++p)
                                if (!index(keylist, *p)) {
-                                       (void)fprintf(stderr,
+                                       fprintf(stderr,
                                            "arithmetic: unknown key.\n");
                                        exit(1);
                                }
@@ -120,7 +119,7 @@ main(int argc, char *argv[])
                }
                case 'r':
                        if ((rangemax = atoi(optarg)) <= 0) {
-                               (void)fprintf(stderr,
+                               fprintf(stderr,
                                    "arithmetic: invalid range.\n");
                                exit(1);
                        }
@@ -135,7 +134,7 @@ main(int argc, char *argv[])
        /* Seed the random-number generator. */
        srandomdev();
 
-       (void)signal(SIGINT, intr);
+       signal(SIGINT, intr);
 
        /* Now ask the questions. */
        for (;;) {
@@ -160,13 +159,13 @@ void
 showstats(void)
 {
        if (nright + nwrong > 0) {
-               (void)printf("\n\nRights %d; Wrongs %d; Score %d%%",
+               printf("\n\nRights %d; Wrongs %d; Score %d%%",
                    nright, nwrong, (int)(100L * nright / (nright + nwrong)));
                if (nright > 0)
-       (void)printf("\nTotal time %ld seconds; %.1f seconds per problem\n\n",
+       printf("\nTotal time %ld seconds; %.1f seconds per problem\n\n",
                            (long)qtime, (float)qtime / nright);
        }
-       (void)printf("\n");
+       printf("\n");
 }
 
 /*
@@ -220,9 +219,9 @@ retry:
        if (result < 0 || left < 0)
                goto retry;
 
-       (void)printf("%d %c %d =   ", left, op, right);
-       (void)fflush(stdout);
-       (void)time(&start);
+       printf("%d %c %d =   ", left, op, right);
+       fflush(stdout);
+       time(&start);
 
        /*
         * Keep looping until the correct answer is given, or until EOF or
@@ -230,21 +229,21 @@ retry:
         */
        for (;;) {
                if (!fgets(line, sizeof(line), stdin)) {
-                       (void)printf("\n");
+                       printf("\n");
                        return(EOF);
                }
                for (p = line; *p && isspace(*p); ++p);
                if (!isdigit(*p)) {
-                       (void)printf("Please type a number.\n");
+                       printf("Please type a number.\n");
                        continue;
                }
                if (atoi(p) == result) {
-                       (void)printf("Right!\n");
+                       printf("Right!\n");
                        ++nright;
                        break;
                }
                /* Wrong answer; penalise and ask again. */
-               (void)printf("What?\n");
+               printf("What?\n");
                ++nwrong;
                penalise(right, op, 1);
                if (op == 'x' || op == '+')
@@ -260,7 +259,7 @@ retry:
         * the time you are not charged for a partially elapsed second at the
         * end.
         */
-       (void)time(&finish);
+       time(&finish);
        qtime += finish - start;
        return(0);
 }
@@ -339,7 +338,7 @@ getrandom(int maxval, int op, int operand)
                        penalty[op][operand]--;
                        if (--(p->penalty) <= 0) {
                                p = p->next;
-                               (void)free((char *)*pp);
+                               free((char *)*pp);
                                *pp = p;
                        }
                        return(value);
@@ -351,7 +350,7 @@ getrandom(int maxval, int op, int operand)
         * correspond to the actual sum of penalties in the list.  Provide an
         * obscure message.
         */
-       (void)fprintf(stderr, "arithmetic: bug: inconsistent penalties\n");
+       fprintf(stderr, "arithmetic: bug: inconsistent penalties\n");
        exit(1);
        /* NOTREACHED */
 }
@@ -363,7 +362,7 @@ opnum(int op)
        char *p;
 
        if (op == 0 || (p = index(keylist, op)) == NULL) {
-               (void)fprintf(stderr,
+               fprintf(stderr,
                    "arithmetic: bug: op %c not in keylist %s\n", op, keylist);
                exit(1);
        }
@@ -374,6 +373,6 @@ opnum(int op)
 static void
 usage(void)
 {
-       (void)fprintf(stderr, "usage: arithmetic [-o +-x/] [-r range]\n");
+       fprintf(stderr, "usage: arithmetic [-o +-x/] [-r range]\n");
        exit(1);
 }
index bf72f71..771aa1b 100644 (file)
@@ -31,7 +31,6 @@
  *
  * @(#)input.c 8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/games/atc/input.c,v 1.7 2000/02/27 23:02:47 mph Exp $
- * $DragonFly: src/games/atc/input.c,v 1.4 2006/09/09 02:21:49 pavalos Exp $
  */
 
 /*
@@ -230,7 +229,7 @@ push(int ruleno, int ch)
 {
        int     newstate, newpos;
 
-       (void)sprintf(T_STR, st[T_STATE].rule[ruleno].str, tval);
+       sprintf(T_STR, st[T_STATE].rule[ruleno].str, tval);
        T_RULE = ruleno;
        T_CH = ch;
        newstate = st[T_STATE].rule[ruleno].to_state;
index 645d043..c9df5c0 100644 (file)
@@ -85,13 +85,13 @@ timestr(int t)
        static char     s[80];
 
        if (DAY(t) > 0)
-               (void)sprintf(s, "%dd+%02dhrs", DAY(t), HOUR(t));
+               sprintf(s, "%dd+%02dhrs", DAY(t), HOUR(t));
        else if (HOUR(t) > 0)
-               (void)sprintf(s, "%d:%02d:%02d", HOUR(t), MIN(t), SEC(t));
+               sprintf(s, "%d:%02d:%02d", HOUR(t), MIN(t), SEC(t));
        else if (MIN(t) > 0)
-               (void)sprintf(s, "%d:%02d", MIN(t), SEC(t));
+               sprintf(s, "%d:%02d", MIN(t), SEC(t));
        else if (SEC(t) > 0)
-               (void)sprintf(s, ":%02d", SEC(t));
+               sprintf(s, ":%02d", SEC(t));
        else
                *s = '\0';
 
index 76d4d11..e3e1dd6 100644 (file)
@@ -194,7 +194,7 @@ update(__unused int sig)
                        if (too_close(p1, p2, 1)) {
                                static char     buf[80];
 
-                               (void)sprintf(buf, "collided with plane '%c'.",
+                               sprintf(buf, "collided with plane '%c'.",
                                        name(p2));
                                loser(p1, buf);
                        }
@@ -216,21 +216,21 @@ command(const PLANE *pp)
 
        buf[0] = '\0';
        bp = buf;
-       (void)sprintf(bp, "%c%d%c%c%d: ", name(pp), pp->altitude,
+       sprintf(bp, "%c%d%c%c%d: ", name(pp), pp->altitude,
                (pp->fuel < LOWFUEL) ? '*' : ' ',
                (pp->dest_type == T_AIRPORT) ? 'A' : 'E', pp->dest_no);
 
        comm_start = bp = index(buf, '\0');
        if (pp->altitude == 0)
-               (void)sprintf(bp, "Holding @ A%d", pp->orig_no);
+               sprintf(bp, "Holding @ A%d", pp->orig_no);
        else if (pp->new_dir >= MAXDIR || pp->new_dir < 0)
                strcpy(bp, "Circle");
        else if (pp->new_dir != pp->dir)
-               (void)sprintf(bp, "%d", dir_deg(pp->new_dir));
+               sprintf(bp, "%d", dir_deg(pp->new_dir));
 
        bp = index(buf, '\0');
        if (pp->delayd)
-               (void)sprintf(bp, " @ B%d", pp->delayd_no);
+               sprintf(bp, " @ B%d", pp->delayd_no);
 
        bp = index(buf, '\0');
        if (*comm_start == '\0' &&
index 25e5382..4973ed2 100644 (file)
@@ -3,7 +3,7 @@
 /* $FreeBSD: src/games/hack/hack.end.c,v 1.4 1999/11/16 10:26:36 marcel Exp $ */
 
 #include "hack.h"
-#define        Sprintf (void) sprintf
+#define        Sprintf sprintf
 
 #define        newttentry()    alloc(sizeof(struct toptenentry))
 #define        NAMSZ   8
index d17bdd9..4af3c64 100644 (file)
@@ -407,7 +407,7 @@ glo(int foo)
        tf = lock;
        while (*tf && *tf != '.')
                tf++;
-       (void)sprintf(tf, ".%d", foo);
+       sprintf(tf, ".%d", foo);
 }
 
 /*
index 2dc2397..8a4abac 100644 (file)
@@ -3,9 +3,9 @@
 /* $FreeBSD: src/games/hack/hack.objnam.c,v 1.3 1999/11/16 02:57:08 billf Exp $ */
 
 #include "hack.h"
-#define        Sprintf (void) sprintf
-#define        Strcat  (void) strcat
-#define        Strcpy  (void) strcpy
+#define        Sprintf sprintf
+#define        Strcat  strcat
+#define        Strcpy  strcpy
 #define        PREFIX  15
 extern int bases[];
 
index 4bb25cd..b42dc95 100644 (file)
@@ -1,11 +1,10 @@
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* hack.u_init.c - version 1.0.3 */
 /* $FreeBSD: src/games/hack/hack.u_init.c,v 1.4 1999/11/16 02:57:13 billf Exp $ */
-/* $DragonFly: src/games/hack/hack.u_init.c,v 1.5 2006/08/21 19:45:32 pavalos Exp $ */
 
 #include "hack.h"
-#define        Strcpy  (void) strcpy
-#define        Strcat  (void) strcat
+#define        Strcpy  strcpy
+#define        Strcat  strcat
 #define        UNDEF_TYP       0
 #define        UNDEF_SPE       '\177'
 
index b72df2c..b73d356 100644 (file)
@@ -110,10 +110,9 @@ gethdate(const char *name)
                if ((p = strsep(&np, ":")) == NULL)
                        break;
                if (*p == '\0')                 /* :: */
-                       (void) strlcpy(filename, name, sizeof filename);
+                       strlcpy(filename, name, sizeof filename);
                else
-                       (void) snprintf(filename, sizeof filename,
-                           "%s/%s", p, name);
+                       snprintf(filename, sizeof filename, "%s/%s", p, name);
 
                if (stat(filename, &hbuf) == 0) {
                        free(path);
index 8c7b866..7ffe649 100644 (file)
@@ -96,6 +96,6 @@ die(int sig __unused)
 __dead2 void
 usage(void)
 {
-       (void)fprintf(stderr, "usage: hangman [-k] [-d wordlist]\n");
+       fprintf(stderr, "usage: hangman [-k] [-d wordlist]\n");
        exit(1);
 }
index a137f69..d241142 100644 (file)
@@ -30,7 +30,6 @@
  *
  * $OpenBSD: connect.c,v 1.6 2003/06/11 08:45:24 pjanzen Exp $
  * $NetBSD: connect.c,v 1.3 1997/10/11 08:13:40 lukem Exp $
- * $DragonFly: src/games/hunt/hunt/connect.c,v 1.2 2008/09/04 16:12:51 swildner Exp $
  */
 
 #include <sys/types.h>
@@ -61,16 +60,16 @@ do_connect(char *name, u_int8_t team, u_int32_t enter_status)
        if (Ttyname == NULL)
                Ttyname = "not a tty";
        memset(buf, '\0', sizeof buf);
-       (void) strlcpy(buf, Ttyname, sizeof buf);
+       strlcpy(buf, Ttyname, sizeof buf);
 
        uid = htonl(getuid());
        enter_status = htonl(enter_status);
        mode = htonl(mode);
 
-       (void) write(Socket, &uid, sizeof uid);
-       (void) write(Socket, name, NAMELEN);
-       (void) write(Socket, &team, sizeof team);
-       (void) write(Socket, &enter_status, sizeof enter_status);
-       (void) write(Socket, buf, NAMELEN);
-       (void) write(Socket, &mode, sizeof mode);
+       write(Socket, &uid, sizeof uid);
+       write(Socket, name, NAMELEN);
+       write(Socket, &team, sizeof team);
+       write(Socket, &enter_status, sizeof enter_status);
+       write(Socket, buf, NAMELEN);
+       write(Socket, &mode, sizeof mode);
 }
index db58c4c..7353849 100644 (file)
@@ -34,27 +34,27 @@ int cur_row, cur_col;
 static void
 tstp(int dummy)
 {
-        int     y, x;
-
-        y = cur_row;
-        x = cur_col;
-        mvcur(cur_row, cur_col, HEIGHT, 0);
-        cur_row = HEIGHT;
-        cur_col = 0;
-        _puts(VE);
-        _puts(TE);
-        (void) fflush(stdout);
-        tcsetattr(0, TCSADRAIN, &__orig_termios);
-        (void) kill(getpid(), SIGSTOP);
-        (void) signal(SIGTSTP, tstp);
-        tcsetattr(0, TCSADRAIN, &saved_tty);
-        _puts(TI);
-        _puts(VS);
-        cur_row = y;
-        cur_col = x;
-        _puts(tgoto(CM, cur_row, cur_col));
-        display_redraw_screen();
-        (void) fflush(stdout);
+       int     y, x;
+
+       y = cur_row;
+       x = cur_col;
+       mvcur(cur_row, cur_col, HEIGHT, 0);
+       cur_row = HEIGHT;
+       cur_col = 0;
+       _puts(VE);
+       _puts(TE);
+       fflush(stdout);
+       tcsetattr(0, TCSADRAIN, &__orig_termios);
+       kill(getpid(), SIGSTOP);
+       signal(SIGTSTP, tstp);
+       tcsetattr(0, TCSADRAIN, &saved_tty);
+       _puts(TI);
+       _puts(VS);
+       cur_row = y;
+       cur_col = x;
+       _puts(tgoto(CM, cur_row, cur_col));
+       display_redraw_screen();
+       fflush(stdout);
 }
 
 /*
@@ -69,15 +69,15 @@ display_open(void)
        if (!isatty(0) || (term = getenv("TERM")) == NULL)
                errx(1, "no terminal type");
 
-        gettmode();
-        (void) setterm(term);
-        (void) noecho();
-        (void) cbreak();
-        tcgetattr(0, &saved_tty);
-        _puts(TI);
-        _puts(VS);
+       gettmode();
+       setterm(term);
+       noecho();
+       cbreak();
+       tcgetattr(0, &saved_tty);
+       _puts(TI);
+       _puts(VS);
 #ifdef SIGTSTP
-        (void) signal(SIGTSTP, tstp);
+       signal(SIGTSTP, tstp);
 #endif
 }
 
@@ -88,7 +88,7 @@ display_open(void)
 void
 display_beep(void)
 {
-       (void) putchar('\a');
+       putchar('\a');
 }
 
 /*
@@ -98,7 +98,7 @@ display_beep(void)
 void
 display_refresh(void)
 {
-       (void) fflush(stdout);
+       fflush(stdout);
 }
 
 /*
@@ -259,8 +259,8 @@ void
 display_open(void)
 {
         initscr();
-        (void) noecho();
-        (void) cbreak();
+        noecho();
+        cbreak();
 }
 
 void
index 6f1858e..bb41211 100644 (file)
@@ -105,7 +105,7 @@ main(int ac, char **av)
                switch (c) {
                case 'l':       /* rsh compatibility */
                case 'n':
-                       (void) strlcpy(name, optarg, sizeof name);
+                       strlcpy(name, optarg, sizeof name);
                        break;
                case 't':
                        team = *optarg;
@@ -191,12 +191,12 @@ main(int ac, char **av)
        if (Otto_mode) {
                if (Am_monitor)
                        errx(1, "otto mode incompatible with monitor mode");
-               (void) strlcpy(name, "otto", sizeof name);
+               strlcpy(name, "otto", sizeof name);
                team = ' ';
        } else
                fill_in_blanks();
 
-       (void) fflush(stdout);
+       fflush(stdout);
        display_open();
        in_visual = TRUE;
        if (LINES < SCREEN_HEIGHT || COLS < SCREEN_WIDTH) {
@@ -204,9 +204,9 @@ main(int ac, char **av)
                leave(1, "Need a larger window");
        }
        display_clear_the_screen();
-       (void) signal(SIGINT, intr);
-       (void) signal(SIGTERM, sigterm);
-       /* (void) signal(SIGPIPE, SIG_IGN); */
+       signal(SIGINT, intr);
+       signal(SIGTERM, sigterm);
+       /* signal(SIGPIPE, SIG_IGN); */
 
        Daemon.sa_len = 0;
     ask_driver:
@@ -398,7 +398,7 @@ dump_scores(void)
                }
                if (cnt < 0)
                        warn("read");
-               (void)close(s);
+               close(s);
                if (Sock_host)
                        break;
        }
@@ -463,7 +463,7 @@ intr(int dummy __unused)
        int     explained;
        int     y, x;
 
-       (void) signal(SIGINT, SIG_IGN);
+       signal(SIGINT, SIG_IGN);
        display_getyx(&y, &x);
        display_move(HEIGHT, 0);
        display_put_str("Really quit? ");
@@ -476,13 +476,13 @@ intr(int dummy __unused)
                        ch = tolower(ch);
                if (ch == 'y') {
                        if (Socket != 0) {
-                               (void) write(Socket, "q", 1);
-                               (void) close(Socket);
+                               write(Socket, "q", 1);
+                               close(Socket);
                        }
                        leave(0, NULL);
                }
                else if (ch == 'n') {
-                       (void) signal(SIGINT, intr);
+                       signal(SIGINT, intr);
                        display_move(y, x);
                        display_refresh();
                        return;
index d1e8b75..801085c 100644 (file)
@@ -306,7 +306,7 @@ probe_drivers(u_int16_t req, char *preferred)
                        continue;
 
                start_probe((struct sockaddr *)target, req);
-        }
-        free(inbuf);
-        (void) close(fd);
+       }
+       free(inbuf);
+       close(fd);
 }
index 0dc1f6b..df73daf 100644 (file)
@@ -30,7 +30,6 @@
  *
  * $OpenBSD: otto.c,v 1.9 2006/03/27 00:10:15 tedu Exp $
  * $NetBSD: otto.c,v 1.2 1997/10/10 16:32:39 lukem Exp $
- * $DragonFly: src/games/hunt/hunt/otto.c,v 1.2 2008/09/04 16:12:51 swildner Exp $
  */
 
 /*
@@ -427,7 +426,7 @@ attack(int rel_dir, struct item *itemp)
                        rel_dir = LEFT;
                else
                        rel_dir = RIGHT;
-               (void) face_and_move_direction(rel_dir, 0);
+               face_and_move_direction(rel_dir, 0);
                command[comlen++] = 'f';
                command[comlen++] = 'f';
                duck(FRONT);
index 5e5de04..c5a673e 100644 (file)
@@ -30,7 +30,6 @@
  *
  * $OpenBSD: playit.c,v 1.8 2003/06/11 08:45:25 pjanzen Exp $
  * $NetBSD: playit.c,v 1.4 1997/10/20 00:37:15 lukem Exp $
- * $DragonFly: src/games/hunt/hunt/playit.c,v 1.2 2008/09/04 16:12:51 swildner Exp $
  */
 
 #include <sys/types.h>
@@ -176,7 +175,7 @@ playit(void)
                }
        }
 out:
-       (void) close(Socket);
+       close(Socket);
 }
 
 /*
@@ -260,7 +259,7 @@ send_stuff(void)
                nchar_send -= count;
                if (nchar_send < 0)
                        count += nchar_send;
-               (void) write(Socket, inp, count);
+               write(Socket, inp, count);
                if (Otto_mode) {
                        /*
                         * The user can insert commands over otto.
@@ -413,5 +412,5 @@ do_message(void)
                bad_con();
                /* NOTREACHED */
        }
-       (void) close(Socket);
+       close(Socket);
 }
index c860311..436a760 100644 (file)
@@ -30,7 +30,6 @@
  *
  * $OpenBSD: answer.c,v 1.11 2007/11/06 10:22:29 chl Exp $
  * $NetBSD: answer.c,v 1.3 1997/10/10 16:32:50 lukem Exp $
- * $DragonFly: src/games/hunt/huntd/answer.c,v 1.2 2008/09/04 16:12:51 swildner Exp $
  */
 
 #include <sys/socket.h>
@@ -115,7 +114,7 @@ answer_first(void)
         */
        flags = fcntl(newsock, F_GETFL, 0);
        flags |= O_NDELAY;
-       (void) fcntl(newsock, F_SETFL, flags);
+       fcntl(newsock, F_SETFL, flags);
 
        /* Start listening to the spawning connection */
        sp->fd = newsock;
@@ -212,7 +211,7 @@ answer_next(struct spawn *sp)
 
        /* Tell the other end this server's hunt driver version: */
        version = htonl((u_int32_t) HUNT_VERSION);
-       (void) write(sp->fd, &version, sizeof version);
+       write(sp->fd, &version, sizeof version);
 
        if (sp->mode == C_MESSAGE) {
                /* The clients only wants to send a message: */
@@ -397,7 +396,7 @@ stplayer(PLAYER *newpp, int enter_status)
                check(pp, y, x);
 
        /* Create a score line for the new player: */
-       (void) snprintf(Buf, sizeof Buf, "%5.2f%c%-10.10s %c",
+       snprintf(Buf, sizeof Buf, "%5.2f%c%-10.10s %c",
                newpp->p_ident->i_score, stat_char(newpp),
                newpp->p_ident->i_name, newpp->p_ident->i_team);
        len = strlen(Buf);
index 19ec1a4..9b238bd 100644 (file)
@@ -2,7 +2,6 @@
  * David Leonard <d@openbsd.org>, 1999. Public domain.
  *
  * $OpenBSD: conf.c,v 1.7 2007/03/20 03:43:50 tedu Exp $
- * $DragonFly: src/games/hunt/huntd/conf.c,v 1.3 2008/11/10 15:28:13 swildner Exp $
  */
 #include <sys/param.h>
 #include <sys/types.h>
@@ -266,7 +265,7 @@ load_config(FILE *f, char *fnm)
                        logx(LOG_ERR, "%s:%d: line too long", fnm, line);
                        continue;
                }
-               (void)memcpy(buf, p, len);
+               memcpy(buf, p, len);
                buf[len] = '\0';
                parse_line(buf, fnm, &line);
        }
index 5fef5fe..f3826f6 100644 (file)
@@ -328,7 +328,7 @@ init(void)
        struct sigaction        sact;
        struct servent *se;
 
-       (void) setsid();
+       setsid();
        if (setpgid(getpid(), getpid()) == -1)
                err(1, "setpgid");
 
@@ -358,7 +358,7 @@ init(void)
 
        if (chdir("/") == -1)
                warn("chdir");
-       (void) umask(0777);
+       umask(0777);
 
        /* Initialize statistics socket: */
        addr.sin_family = AF_INET;
@@ -599,7 +599,7 @@ checkdam(PLAYER *victim, PLAYER *attacker, IDENT *credit, int damage,
                }
 
                /* Set the death message: */
-               (void) snprintf(victim->p_death, sizeof victim->p_death,
+               snprintf(victim->p_death, sizeof victim->p_death,
                        "| %s by %s |", cp, blame);
 
                /* No further score crediting needed. */
@@ -607,7 +607,7 @@ checkdam(PLAYER *victim, PLAYER *attacker, IDENT *credit, int damage,
        }
 
        /* Set the death message: */
-       (void) snprintf(victim->p_death, sizeof victim->p_death,
+       snprintf(victim->p_death, sizeof victim->p_death,
                "| %s by %s |", cp, credit->i_name);
 
        if (victim == attacker) {
@@ -756,7 +756,7 @@ zap(PLAYER *pp, FLAG was_player)
                        char buf[BUFSIZ];
 
                        /* Detonate: */
-                       (void) add_shot(expl_type, pp->p_y, pp->p_x,
+                       add_shot(expl_type, pp->p_y, pp->p_x,
                            pp->p_face, expl_charge, NULL,
                            TRUE, SPACE);
 
@@ -811,7 +811,7 @@ zap(PLAYER *pp, FLAG was_player)
                        } while (Maze[y][x] != SPACE);
 
                        /* Convert volcano charge into lava: */
-                       (void) add_shot(LAVA, y, x, LEFTS, volcano,
+                       add_shot(LAVA, y, x, LEFTS, volcano,
                                NULL, TRUE, SPACE);
                        volcano = 0;
 
@@ -836,7 +836,7 @@ zap(PLAYER *pp, FLAG was_player)
 
                /* Tell the zapped player's client to shut down. */
                sendcom(pp, ENDWIN, ' ');
-               (void) fclose(pp->p_output);
+               fclose(pp->p_output);
 
                /* Close up the gap in the Player array: */
                End_player--;
@@ -860,7 +860,7 @@ zap(PLAYER *pp, FLAG was_player)
 
                /* Close the session: */
                sendcom(pp, ENDWIN, LAST_PLAYER);
-               (void) fclose(pp->p_output);
+               fclose(pp->p_output);
 
                /* shuffle the monitor table */
                End_monitor--;
@@ -972,12 +972,12 @@ cleanup(int eval)
 
        /* And close their connections: */
        for (pp = Player; pp < End_player; pp++)
-               (void) fclose(pp->p_output);
+               fclose(pp->p_output);
        for (pp = Monitor; pp < End_monitor; pp++)
-               (void) fclose(pp->p_output);
+               fclose(pp->p_output);
 
        /* Close the server socket: */
-       (void) close(Socket);
+       close(Socket);
 
        /* The end: */
        logx(LOG_INFO, "game over");
@@ -1021,18 +1021,18 @@ send_stats(void)
        /* Don't allow the writes to block: */
        flags = fcntl(s, F_GETFL, 0);
        flags |= O_NDELAY;
-       (void) fcntl(s, F_SETFL, flags);
+       fcntl(s, F_SETFL, flags);
 
        fp = fdopen(s, "w");
        if (fp == NULL) {
                logit(LOG_ERR, "fdopen");
-               (void) close(s);
+               close(s);
                return;
        }
 
        print_stats(fp);
 
-       (void) fclose(fp);
+       fclose(fp);
 }
 
 /*
index 57f5a1f..7c05702 100644 (file)
@@ -30,7 +30,6 @@
  *
  * $OpenBSD: execute.c,v 1.8 2004/01/16 00:13:19 espie Exp $
  * $NetBSD: execute.c,v 1.2 1997/10/10 16:33:13 lukem Exp $
- * $DragonFly: src/games/hunt/huntd/execute.c,v 1.2 2008/09/04 16:12:51 swildner Exp $
  */
 
 #include <stdlib.h>
@@ -67,7 +66,7 @@ mon_execute(PLAYER *pp)
                break;
          case 'q':
                /* Quit client */
-               (void) strlcpy(pp->p_death, "| Quit |", sizeof pp->p_death);
+               strlcpy(pp->p_death, "| Quit |", sizeof pp->p_death);
                break;
          default:
                /* Ignore everything else */
@@ -93,7 +92,7 @@ execute(PLAYER *pp)
                        sendcom(pp, REDRAW);
                        break;
                  case 'q':
-                       (void) strlcpy(pp->p_death, "| Quit |",
+                       strlcpy(pp->p_death, "| Quit |",
                            sizeof pp->p_death);
                        break;
                }
@@ -185,7 +184,7 @@ execute(PLAYER *pp)
                cloak(pp);
                break;
          case 'q':                     /* quit */
-               (void) strlcpy(pp->p_death, "| Quit |", sizeof pp->p_death);
+               strlcpy(pp->p_death, "| Quit |", sizeof pp->p_death);
                break;
        }
 }
index 2b45ee5..9ec0112 100644 (file)
@@ -30,7 +30,6 @@
  *
  * $OpenBSD: terminal.c,v 1.10 2008/06/20 13:08:44 ragge Exp $
  * $NetBSD: terminal.c,v 1.2 1997/10/10 16:34:05 lukem Exp $
- * $DragonFly: src/games/hunt/huntd/terminal.c,v 1.2 2008/09/04 16:12:51 swildner Exp $
  */
 
 #include <stdarg.h>
@@ -89,7 +88,7 @@ outch(PLAYER *pp, char ch)
                pp->p_curx = 0;
                pp->p_cury++;
        }
-       (void) putc(ch, pp->p_output);
+       putc(ch, pp->p_output);
 }
 
 /*
@@ -111,7 +110,7 @@ outstr(PLAYER *pp, const char *str, int     len)
        pp->p_cury += (pp->p_curx / TERM_WIDTH);
        pp->p_curx %= TERM_WIDTH;
        while (len--)
-               (void) putc(*str++, pp->p_output);
+               putc(*str++, pp->p_output);
 }
 
 /*
index 331d465..1a8c5a2 100644 (file)
@@ -346,10 +346,10 @@ main(int argc, char **argv)
                lflags &= ~TIOCM_RTS;
                olflags = lflags;
                ioctl(line, TIOCMSET, &lflags);
-               (void)signal(SIGHUP, sighandler);
-               (void)signal(SIGINT, sighandler);
-               (void)signal(SIGQUIT, sighandler);
-               (void)signal(SIGTERM, sighandler);
+               signal(SIGHUP, sighandler);
+               signal(SIGINT, sighandler);
+               signal(SIGQUIT, sighandler);
+               signal(SIGTERM, sighandler);
        }
 
        argc -= optind;
@@ -612,5 +612,5 @@ sighandler(int signo)
        tcsetattr(line, TCSANOW, &otty);
 
        signal(signo, SIG_DFL);
-       (void)kill(getpid(), signo);
+       kill(getpid(), signo);
 }
index 629aed1..5f8c00c 100644 (file)
@@ -29,7 +29,6 @@
  * @(#) Copyright (c) 1988, 1993, 1994 The Regents of the University of California.  All rights reserved.
  * @(#)number.c        8.3 (Berkeley) 5/4/95
  * $FreeBSD: src/games/number/number.c,v 1.12 1999/12/12 03:22:35 billf Exp $
- * $DragonFly: src/games/number/number.c,v 1.5 2008/06/05 18:06:30 swildner Exp $
  */
 
 #include <sys/types.h>
@@ -99,13 +98,13 @@ main(int argc, char **argv)
                        if (strchr(line, '\n') == NULL)
                                errx(1, "line too long.");
                        if (!first)
-                               (void)printf("...\n");
+                               printf("...\n");
                        convert(line);
                }
        else
                for (first = 1; *argv != NULL; first = 0, ++argv) {
                        if (!first)
-                               (void)printf("...\n");
+                               printf("...\n");
                        convert(*argv);
                }
        exit(0);
@@ -152,7 +151,7 @@ badnum:                     errx(1, "illegal number: %s", line);
                errx(1, "number too large, max %d digits.", MAXNUM);
 
        if (*line == '-') {
-               (void)printf("minus%s", lflag ? " " : "\n");
+               printf("minus%s", lflag ? " " : "\n");
                ++line;
                --len;
        }
@@ -162,21 +161,21 @@ badnum:                   errx(1, "illegal number: %s", line);
                for (p = fraction; *p != '\0'; ++p)
                        if (*p != '0') {
                                if (rval)
-                                       (void)printf("%sand%s",
+                                       printf("%sand%s",
                                            lflag ? " " : "",
                                            lflag ? " " : "\n");
                                if (unit(flen, fraction)) {
                                        if (lflag)
-                                               (void)printf(" ");
+                                               printf(" ");
                                        pfract(flen);
                                        rval = 1;
                                }
                                break;
                        }
        if (!rval)
-               (void)printf("zero%s", lflag ? "" : ".\n");
+               printf("zero%s", lflag ? "" : ".\n");
        if (lflag)
-               (void)printf("\n");
+               printf("\n");
 }
 
 int
@@ -191,7 +190,7 @@ unit(int len, char *p)
                        len -= off;
                        if (number(p, off)) {
                                rval = 1;
-                               (void)printf(" %s%s",
+                               printf(" %s%s",
                                    name3[len / 3], lflag ? " " : ".\n");
                        }
                        p += off;
@@ -200,14 +199,14 @@ unit(int len, char *p)
                        len -= 3;
                        if (number(p, 3)) {
                                rval = 1;
-                               (void)printf(" %s%s",
+                               printf(" %s%s",
                                    name3[len / 3], lflag ? " " : ".\n");
                        }
                }
        }
        if (number(p, len)) {
                if (!lflag)
-                       (void)printf(".\n");
+                       printf(".\n");
                rval = 1;
        }
        return (rval);
@@ -223,7 +222,7 @@ number(char *p, int len)
        case 3:
                if (*p != '0') {
                        rval = 1;
-                       (void)printf("%s hundred", name1[*p - '0']);
+                       printf("%s hundred", name1[*p - '0']);
                }
                ++p;
                /* FALLTHROUGH */
@@ -231,13 +230,13 @@ number(char *p, int len)
                val = (p[1] - '0') + (p[0] - '0') * 10;
                if (val) {
                        if (rval)
-                               (void)printf(" ");
+                               printf(" ");
                        if (val < 20)
-                               (void)printf("%s", name1[val]);
+                               printf("%s", name1[val]);
                        else {
-                               (void)printf("%s", name2[val / 10]);
+                               printf("%s", name2[val / 10]);
                                if (val % 10)
-                                       (void)printf("-%s", name1[val % 10]);
+                                       printf("-%s", name1[val % 10]);
                        }
                        rval = 1;
                }
@@ -245,7 +244,7 @@ number(char *p, int len)
        case 1:
                if (*p != '0') {
                        rval = 1;
-                       (void)printf("%s", name1[*p - '0']);
+                       printf("%s", name1[*p - '0']);
                }
        }
        return (rval);
@@ -258,13 +257,13 @@ pfract(int len)
 
        switch(len) {
        case 1:
-               (void)printf("tenths.\n");
+               printf("tenths.\n");
                break;
        case 2:
-               (void)printf("hundredths.\n");
+               printf("hundredths.\n");
                break;
        default:
-               (void)printf("%s%sths.\n", pref[len % 3], name3[len / 3]);
+               printf("%s%sths.\n", pref[len % 3], name3[len / 3]);
                break;
        }
 }
@@ -272,6 +271,6 @@ pfract(int len)
 void
 usage(void)
 {
-       (void)fprintf(stderr, "usage: number [# ...]\n");
+       fprintf(stderr, "usage: number [# ...]\n");
        exit(1);
 }
index e4e720e..4b02be9 100644 (file)
@@ -61,7 +61,7 @@ main(int argc, char **argv)
        for (len = 0; (ch = getchar()) != EOF;) {
                if (isalpha(ch)) {
                        if (len >= (int)sizeof(buf)) {
-                               (void)fprintf(stderr, "pig: ate too much!\n");
+                               fprintf(stderr, "pig: ate too much!\n");
                                exit(1);
                        }
                        buf[len++] = ch;
@@ -71,7 +71,7 @@ main(int argc, char **argv)
                        pigout(buf, len);
                        len = 0;
                }
-               (void)putchar(ch);
+               putchar(ch);
        }
        exit(0);
 }
@@ -87,7 +87,7 @@ pigout(char *buf, int len)
         * as a vowel if it appears first.
         */
        if (index("aeiouAEIOU", buf[0]) != NULL) {
-               (void)printf("%.*sway", len, buf);
+               printf("%.*sway", len, buf);
                return;
        }
 
@@ -102,12 +102,12 @@ pigout(char *buf, int len)
                    (buf[start] == 'u' || buf[start] == 'U'))
                        buf[len++] = buf[start++];
        }
-       (void)printf("%.*say", olen, buf + start);
+       printf("%.*say", olen, buf + start);
 }
 
 void
 usage(void)
 {
-       (void)fprintf(stderr, "usage: pig\n");
+       fprintf(stderr, "usage: pig\n");
        exit(1);
 }
index 828d9be..b334094 100644 (file)
@@ -31,7 +31,6 @@
  * @(#) Copyright (c) 1989, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)pom.c       8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/games/pom/pom.c,v 1.9 1999/11/30 03:49:09 billf Exp $
- * $DragonFly: src/games/pom/pom.c,v 1.4 2006/08/08 17:08:49 pavalos Exp $
  */
 
 /*
@@ -69,32 +68,30 @@ main(void)
        double days, today, tomorrow;
        int cnt;
 
-       (void) time(&tt);
+       time(&tt);
        GMT = gmtime(&tt);
        days = (GMT->tm_yday + 1) + ((GMT->tm_hour +
            (GMT->tm_min / 60.0) + (GMT->tm_sec / 3600.0)) / 24.0);
        for (cnt = EPOCH; cnt < GMT->tm_year; ++cnt)
                days += isleap(1900 + cnt) ? 366 : 365;
        today = potm(days) + .5;
-       (void)printf("The Moon is ");
+       printf("The Moon is ");
        if ((int)today == 100)
-               (void)printf("Full\n");
+               printf("Full\n");
        else if (!(int)today)
-               (void)printf("New\n");
+               printf("New\n");
        else {
                tomorrow = potm(days + 1);
                if ((int)today == 50)
-                       (void)printf("%s\n", tomorrow > today ?
+                       printf("%s\n", tomorrow > today ?
                            "at the First Quarter" : "at the Last Quarter");
                else {
-                       (void)printf("%s ", tomorrow > today ?
+                       printf("%s ", tomorrow > today ?
                            "Waxing" : "Waning");
                        if (today > 50)
-                               (void)printf("Gibbous (%1.0f%% of Full)\n",
-                                   today);
+                               printf("Gibbous (%1.0f%% of Full)\n", today);
                        else if (today < 50)
-                               (void)printf("Crescent (%1.0f%% of Full)\n",
-                                   today);
+                               printf("Crescent (%1.0f%% of Full)\n", today);
                }
        }
 
index a98d19f..0636a1b 100644 (file)
@@ -33,7 +33,6 @@
  * @(#) Copyright (c) 1991, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)quiz.c  8.3 (Berkeley) 5/4/95
  * $FreeBSD: src/games/quiz/quiz.c,v 1.12 1999/12/12 02:29:54 billf Exp $
- * $DragonFly: src/games/quiz/quiz.c,v 1.7 2007/09/08 10:49:00 swildner Exp $
  */
 
 #include <sys/types.h>
@@ -138,7 +137,7 @@ get_file(const char *file)
                        ++qsize;
                }
        }
-       (void)fclose(fp);
+       fclose(fp);
 }
 
 void
@@ -150,21 +149,21 @@ show_index(void)
 
        if ((pf = popen(_PATH_PAGER, "w")) == NULL)
                err("%s: %s", _PATH_PAGER, strerror(errno));
-       (void)fprintf(pf, "Subjects:\n\n");
+       fprintf(pf, "Subjects:\n\n");
        for (qp = qlist.q_next; qp; qp = qp->q_next) {
                for (s = next_cat(qp->q_text); s; s = next_cat(s)) {
                        if (!rxp_compile(s))
                                err("%s", rxperr);
                        if ((p = rxp_expand()) != '\0')
-                               (void)fprintf(pf, "%s ", p);
+                               fprintf(pf, "%s ", p);
                }
-               (void)fprintf(pf, "\n");
+               fprintf(pf, "\n");
        }
-       (void)fprintf(pf, "\n%s\n%s\n%s\n",
+       fprintf(pf, "\n%s\n%s\n%s\n",
 "For example, \"quiz victim killer\" prints a victim's name and you reply",
 "with the killer, and \"quiz killer victim\" works the other way around.",
 "Type an empty line to get the correct answer.");
-       (void)pclose(pf);
+       pclose(pf);
 }
 
 void
@@ -241,7 +240,7 @@ quiz(void)
                        qp->q_answered = TRUE;
                        continue;
                }
-               (void)strcpy(question, t);
+               strcpy(question, t);
                s = qp->q_text;
                for (i = 0; i < cattwo - 1; i++)
                        s = next_cat(s);
@@ -253,7 +252,7 @@ quiz(void)
                        continue;
                }
                qp->q_asked = TRUE;
-               (void)printf("%s?\n", question);
+               printf("%s?\n", question);
                for (;; ++guesses) {
                        if ((answer = fgetln(stdin, &len)) == NULL) {
                                score(rights, wrongs, guesses);
@@ -262,19 +261,19 @@ quiz(void)
                        answer[len - 1] = '\0';
                        downcase(answer);
                        if (rxp_match(answer)) {
-                               (void)printf("Right!\n");
+                               printf("Right!\n");
                                ++rights;
                                qp->q_answered = TRUE;
                                break;
                        }
                        if (*answer == '\0') {
-                               (void)printf("%s\n", t);
+                               printf("%s\n", t);
                                ++wrongs;
                                if (!tflag)
                                        qp->q_answered = TRUE;
                                break;
                        }
-                       (void)printf("What?\n");
+                       printf("What?\n");
                }
        }
        score(rights, wrongs, guesses);
@@ -323,10 +322,10 @@ appdstr(char *s, char *tp, size_t len)
 void
 score(u_int r, u_int w, u_int g)
 {
-       (void)printf("Rights %d, wrongs %d,", r, w);
+       printf("Rights %d, wrongs %d,", r, w);
        if (g)
-               (void)printf(" extra guesses %d,", g);
-       (void)printf(" score %d%%\n", (r + w + g) ? r * 100 / (r + w + g) : 0);
+               printf(" extra guesses %d,", g);
+       printf(" score %d%%\n", (r + w + g) ? r * 100 / (r + w + g) : 0);
 }
 
 void
@@ -342,7 +341,7 @@ downcase(char *p)
 void
 usage(void)
 {
-       (void)fprintf(stderr, "quiz [-t] [-i file] category1 category2\n");
+       fprintf(stderr, "quiz [-t] [-i file] category1 category2\n");
        exit(1);
 }
 
@@ -353,9 +352,9 @@ err(const char *fmt, ...)
 {
        va_list ap;
        va_start(ap, fmt);
-       (void)fprintf(stderr, "quiz: ");
-       (void)vfprintf(stderr, fmt, ap);
+       fprintf(stderr, "quiz: ");
+       vfprintf(stderr, fmt, ap);
        va_end(ap);
-       (void)fprintf(stderr, "\n");
+       fprintf(stderr, "\n");
        exit(1);
 }
index 6e14d14..328fdc7 100644 (file)
@@ -32,7 +32,6 @@
  *
  * @(#)rxp.c   8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/games/quiz/rxp.c,v 1.5 1999/12/12 02:29:54 billf Exp $
- * $DragonFly: src/games/quiz/rxp.c,v 1.4 2005/04/25 16:10:24 liamfoy Exp $
  */
 
 /*
@@ -106,7 +105,7 @@ rxp__compile(char *s, int first)
        *rp++ = 0;
        for (; *sp; ++sp) {
                if (rp - rxpbuf >= RXP_LINE_SZ - 4) {
-                       (void)snprintf(rxperr, sizeof(rxperr),
+                       snprintf(rxperr, sizeof(rxperr),
                            "regular expression too long %s", s);
                        return (FALSE);
                }
@@ -148,7 +147,7 @@ rxp__compile(char *s, int first)
                                        *alt_ptr = rp - rxpbuf;
                                }
                                if (first) {
-                                       (void)snprintf(rxperr, sizeof(rxperr),
+                                       snprintf(rxperr, sizeof(rxperr),
                                            "unmatched alternator in regexp %s",
                                             s);
                                        return (FALSE);
@@ -164,7 +163,7 @@ rxp__compile(char *s, int first)
                }
        }
        if (!first) {
-               (void)snprintf(rxperr, sizeof(rxperr),
+               snprintf(rxperr, sizeof(rxperr),
                    "unmatched alternator in regexp %s", s);
                return (FALSE);
        }
index 6e87a17..7364496 100644 (file)
@@ -67,7 +67,7 @@ main(int argc, char **argv)
                        break;
                case 'h':
                default:
-                       (void)fprintf(stderr, "usage: rain [-d delay]\n");
+                       fprintf(stderr, "usage: rain [-d delay]\n");
                        exit(1);
                }
        srandomdev();
@@ -76,12 +76,12 @@ main(int argc, char **argv)
        cols = COLS - 4;
        lines = LINES - 4;
 
-       (void)signal(SIGHUP, onsig);
-       (void)signal(SIGINT, onsig);
-       (void)signal(SIGQUIT, onsig);
-       (void)signal(SIGSTOP, onsig);
-       (void)signal(SIGTSTP, onsig);
-       (void)signal(SIGTERM, onsig);
+       signal(SIGHUP, onsig);
+       signal(SIGINT, onsig);
+       signal(SIGQUIT, onsig);
+       signal(SIGSTOP, onsig);
+       signal(SIGTSTP, onsig);
+       signal(SIGTERM, onsig);
 
        for (j = 4; j >= 0; --j) {
                xpos[j] = random() % cols + 2;
index 6702c66..01bb396 100644 (file)
@@ -32,7 +32,6 @@
  * @(#) Copyright (c) 1994 The Regents of the University of California.  All rights reserved.
  * @(#)random.c        8.5 (Berkeley) 4/5/94
  * $FreeBSD: src/games/random/random.c,v 1.17 2005/02/09 18:22:15 ru Exp $
- * $DragonFly: src/games/random/random.c,v 1.4 2005/03/02 06:59:23 cpressey Exp $
  */
 
 #include <sys/types.h>
@@ -156,7 +155,7 @@ main(int argc, char *argv[])
        selected = (int)(denom * random() / LONG_MAX) == 0;
        while ((ch = getchar()) != EOF) {
                if (selected)
-                       (void)putchar(ch);
+                       putchar(ch);
                if (ch == '\n') {
                        /* End of that line.  See if we got an error. */
                        if (ferror(stdout))
index 45d2c8a..5bc6949 100644 (file)
@@ -24,7 +24,6 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/games/random/randomize_fd.c,v 1.2.2.1 2003/02/15 10:34:35 seanc Exp $
- * $DragonFly: src/games/random/randomize_fd.c,v 1.2 2003/06/17 04:25:24 dillon Exp $
  */
 
 #include <sys/types.h>
@@ -194,7 +193,7 @@ randomize_fd(int fd, int type, int unique, double denom)
                }
        }
 
-       (void)close(fd);
+       close(fd);
 
        /* Necessary evil to compensate for files that don't end with a newline */
        if (bufc != i) {
index 732b928..0a09748 100644 (file)
@@ -29,7 +29,6 @@
  * @(#) Copyright (c) 1980, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)worms.c 8.1 (Berkeley) 5/31/93
  * $FreeBSD: src/games/worms/worms.c,v 1.8.2.1 2000/12/04 10:36:17 alex Exp $
- * $DragonFly: src/games/worms/worms.c,v 1.5 2007/04/18 18:32:12 swildner Exp $
  */
 
 /*
@@ -214,7 +213,7 @@ main(int argc, char **argv)
                        break;
                case '?':
                default:
-                       (void)fprintf(stderr,
+                       fprintf(stderr,
                            "usage: worms [-ft] [-d delay] [-l length] [-n number]\n");
                        exit(1);
                }
@@ -251,12 +250,12 @@ main(int argc, char **argv)
                        *ip++ = -1;
        }
 
-       (void)signal(SIGHUP, onsig);
-       (void)signal(SIGINT, onsig);
-       (void)signal(SIGQUIT, onsig);
-       (void)signal(SIGSTOP, onsig);
-       (void)signal(SIGTSTP, onsig);
-       (void)signal(SIGTERM, onsig);
+       signal(SIGHUP, onsig);
+       signal(SIGINT, onsig);
+       signal(SIGQUIT, onsig);
+       signal(SIGSTOP, onsig);
+       signal(SIGTSTP, onsig);
+       signal(SIGTERM, onsig);
 
        if (field) {
                const char *p = field;
index f6f2d2c..5eb2d93 100644 (file)
@@ -156,12 +156,12 @@ main(int argc, char **argv)
                case 'r':
                        room_num = atoi(optarg);
                        if (room_num < MIN_ROOMS_IN_CAVE) {
-                               (void)fprintf(stderr,
+                               fprintf(stderr,
        "No self-respecting wumpus would live in such a small cave!\n");
                                exit(1);
                        }
                        if (room_num > MAX_ROOMS_IN_CAVE) {
-                               (void)fprintf(stderr,
+                               fprintf(stderr,
        "Even wumpii can't furnish caves that large!\n");
                                exit(1);
                        }
@@ -169,7 +169,7 @@ main(int argc, char **argv)
                case 't':
                        link_num = atoi(optarg);
                        if (link_num < 2) {
-                               (void)fprintf(stderr,
+                               fprintf(stderr,
        "Wumpii like extra doors in their caves!\n");
                                exit(1);
                        }
@@ -181,7 +181,7 @@ main(int argc, char **argv)
 
        if (link_num > MAX_LINKS_IN_ROOM ||
            link_num > room_num - (room_num / 4)) {
-               (void)fprintf(stderr,
+               fprintf(stderr,
 "Too many tunnels!  The cave collapsed!\n(Fortunately, the wumpus escaped!)\n");
                exit(1);
        }
@@ -192,13 +192,13 @@ main(int argc, char **argv)
        }
 
        if (bat_num > room_num / 2) {
-               (void)fprintf(stderr,
+               fprintf(stderr,
 "The wumpus refused to enter the cave, claiming it was too crowded!\n");
                exit(1);
        }
 
        if (pit_num > room_num / 2) {
-               (void)fprintf(stderr,
+               fprintf(stderr,
 "The wumpus refused to enter the cave, claiming it was too dangerous!\n");
                exit(1);
        }
@@ -207,7 +207,7 @@ main(int argc, char **argv)
        cave_init();
 
        /* and we're OFF!  da dum, da dum, da dum, da dum... */
-       (void)printf(
+       printf(
 "\nYou're in a cave with %d rooms and %d tunnels leading from each room.\n\
 There are %d bat%s and %d pit%s scattered throughout the cave, and your\n\
 quiver holds %d custom super anti-evil Wumpus arrows.  Good luck.\n",
@@ -219,8 +219,8 @@ quiver holds %d custom super anti-evil Wumpus arrows.  Good luck.\n",
                arrows_left = arrow_num;
                do {
                        display_room_stats();
-                       (void)printf("Move or shoot? (m-s) ");
-                       (void)fflush(stdout);
+                       printf("Move or shoot? (m-s) ");
+                       fflush(stdout);
                        if (!fgets(answer, sizeof(answer), stdin))
                                break;
                } while (!take_action());
@@ -246,24 +246,24 @@ display_room_stats(void)
         * as describe whether there are pits, bats, & wumpii nearby.  It's
         * all pretty mindless, really.
         */
-       (void)printf(
+       printf(
 "\nYou are in room %d of the cave, and have %d arrow%s left.\n",
            player_loc, arrows_left, plural(arrows_left));
 
        if (bats_nearby())
-               (void)printf("*rustle* *rustle* (must be bats nearby)\n");
+               printf("*rustle* *rustle* (must be bats nearby)\n");
        if (pit_nearby())
-               (void)printf("*whoosh* (I feel a draft from some pits).\n");
+               printf("*whoosh* (I feel a draft from some pits).\n");
        if (wump_nearby())
-               (void)printf("*sniff* (I can smell the evil Wumpus nearby!)\n");
+               printf("*sniff* (I can smell the evil Wumpus nearby!)\n");
 
-       (void)printf("There are tunnels to rooms %d, ",
+       printf("There are tunnels to rooms %d, ",
           cave[player_loc].tunnel[0]);
 
        for (i = 1; i < link_num - 1; i++)
                if (cave[player_loc].tunnel[i] <= room_num)
-                       (void)printf("%d, ", cave[player_loc].tunnel[i]);
-       (void)printf("and %d.\n", cave[player_loc].tunnel[link_num - 1]);
+                       printf("%d, ", cave[player_loc].tunnel[i]);
+       printf("and %d.\n", cave[player_loc].tunnel[link_num - 1]);
 }
 
 int
@@ -289,9 +289,9 @@ take_action(void)
                        return(0);
                }
        if (random() % 15 == 1)
-               (void)printf("Que pasa?\n");
+               printf("Que pasa?\n");
        else
-               (void)printf("I don't understand!\n");
+               printf("I don't understand!\n");
        return(0);
 }
 
@@ -318,16 +318,16 @@ move_to(char *room_number)
 
        while (next_room < 1 || next_room > room_num + 1) {
                if (next_room < 0 && next_room != -1)
-(void)printf("Sorry, but we're constrained to a semi-Euclidean cave!\n");
+                       printf("Sorry, but we're constrained to a semi-Euclidean cave!\n");
                if (next_room > room_num + 1)
-(void)printf("What?  The cave surely isn't quite that big!\n");
+                       printf("What?  The cave surely isn't quite that big!\n");
                if (next_room == room_num + 1 &&
                    cave[player_loc].tunnel[link_num-1] != next_room) {
-                       (void)printf("What?  The cave isn't that big!\n");
+                       printf("What?  The cave isn't that big!\n");
                        ++next_room;
                }
-               (void)printf("To which room do you wish to move? ");
-               (void)fflush(stdout);
+               printf("To which room do you wish to move? ");
+               fflush(stdout);
                if (!fgets(answer, sizeof(answer), stdin))
                        return(1);
                next_room = atoi(answer);
@@ -340,9 +340,9 @@ move_to(char *room_number)
                        tunnel_available = 1;
 
        if (!tunnel_available) {
-               (void)printf("*Oof!*  (You hit the wall)\n");
+               printf("*Oof!*  (You hit the wall)\n");
                if (random() % 6 == 1) {
-(void)printf("Your colorful comments awaken the wumpus!\n");
+                       printf("Your colorful comments awaken the wumpus!\n");
                        move_wump();
                        if (wumpus_loc == player_loc) {
                                wump_kill();
@@ -373,7 +373,7 @@ move_to(char *room_number)
                }
 
                if (cave[next_room].has_a_bat) {
-                       (void)printf(
+                       printf(
 "*flap*  *flap*  *flap*  (humongous bats pick you up and move you%s!)\n",
                            just_moved_by_bats ? " again": "");
                        next_room = player_loc = (random() % room_num) + 1;
@@ -407,14 +407,14 @@ shoot(char *room_list)
        for (roomcnt = 1;; ++roomcnt, room_list = NULL) {
                if (!(p = strtok(room_list, " \t\n"))) {
                        if (roomcnt == 1) {
-                               (void)printf(
+                               printf(
                        "The arrow falls to the ground at your feet!\n");
                                return(0);
                        } else
                                break;
                }
                if (roomcnt > 5) {
-                       (void)printf(
+                       printf(
 "The arrow wavers in its flight and can go no further!\n");
                        break;
                }
@@ -425,7 +425,7 @@ shoot(char *room_list)
 
                if (ok) {
                        if (next > room_num) {
-                               (void)printf(
+                               printf(
 "A faint gleam tells you the arrow has gone through a magic tunnel!\n");
                                arrow_location = (random() % room_num) + 1;
                        } else
@@ -433,17 +433,17 @@ shoot(char *room_list)
                } else {
                        wumplink = (random() % link_num);
                        if (wumplink == player_loc)
-                               (void)printf(
+                               printf(
 "*thunk*  The arrow can't find a way from %d to %d and flys back into\n\
 your room!\n",
                                    arrow_location, next);
                        else if (cave[arrow_location].tunnel[wumplink] > room_num)
-                               (void)printf(
+                               printf(
 "*thunk*  The arrow flys randomly into a magic tunnel, thence into\n\
 room %d!\n",
                                    cave[arrow_location].tunnel[wumplink]);
                        else
-                               (void)printf(
+                               printf(
 "*thunk*  The arrow can't find a way from %d to %d and flys randomly\n\
 into room %d!\n",
                                    arrow_location, next,
@@ -453,12 +453,12 @@ into room %d!\n",
                }
                chance = random() % 10;
                if (roomcnt == 3 && chance < 2) {
-                       (void)printf(
+                       printf(
 "Your bowstring breaks!  *twaaaaaang*\n\
 The arrow is weakly shot and can go no further!\n");
                        break;
                } else if (roomcnt == 4 && chance < 6) {
-                       (void)printf(
+                       printf(
 "The arrow wavers in its flight and can go no further!\n");
                        break;
                }
@@ -564,10 +564,10 @@ try_again:                wumplink = (random() % room_num) + 1;
 #ifdef DEBUG
        if (debug)
                for (i = 1; i <= room_num; ++i) {
-                       (void)printf("<room %d  has tunnels to ", i);
+                       printf("<room %d  has tunnels to ", i);
                        for (j = 0; j < link_num; ++j)
-                               (void)printf("%d ", cave[i].tunnel[j]);
-                       (void)printf(">\n");
+                               printf("%d ", cave[i].tunnel[j]);
+                       printf(">\n");
                }
 #endif
 }
@@ -598,7 +598,7 @@ initialize_things_in_cave(void)
                cave[loc].has_a_bat = 1;
 #ifdef DEBUG
                if (debug)
-                       (void)printf("<bat in room %d>\n", loc);
+                       printf("<bat in room %d>\n", loc);
 #endif
        }
 
@@ -609,14 +609,14 @@ initialize_things_in_cave(void)
                cave[loc].has_a_pit = 1;
 #ifdef DEBUG
                if (debug)
-                       (void)printf("<pit in room %d>\n", loc);
+                       printf("<pit in room %d>\n", loc);
 #endif
        }
 
        wumpus_loc = (random() % room_num) + 1;
 #ifdef DEBUG
        if (debug)
-               (void)printf("<wumpus in room %d>\n", loc);
+               printf("<wumpus in room %d>\n", loc);
 #endif
 
        do {
@@ -636,15 +636,15 @@ getans(const char *prompt)
         * answered 'no'.
         */
        for (;;) {
-               (void)printf("%s", prompt);
-               (void)fflush(stdout);
+               printf("%s", prompt);
+               fflush(stdout);
                if (!fgets(buf, sizeof(buf), stdin))
                        return(0);
                if (*buf == 'N' || *buf == 'n')
                        return(0);
                if (*buf == 'Y' || *buf == 'y')
                        return(1);
-               (void)printf(
+               printf(
 "I don't understand your answer; please enter 'y' or 'n'!\n");
        }
        /* NOTREACHED */
@@ -724,7 +724,7 @@ instructions(void)
                return;
 
        if (access(_PATH_WUMPINFO, R_OK)) {
-               (void)printf(
+               printf(
 "Sorry, but the instruction file seems to have disappeared in a\n\
 puff of greasy black smoke! (poof)\n");
                return;
@@ -742,12 +742,12 @@ puff of greasy black smoke! (poof)\n");
                        err(1, "open %s", _PATH_WUMPINFO);
                if (dup2(fd, STDIN_FILENO) == -1)
                        err(1, "dup2");
-               (void)execl("/bin/sh", "sh", "-c", pager, NULL);
+               execl("/bin/sh", "sh", "-c", pager, NULL);
                err(1, "exec sh -c %s", pager);
        case -1:
                err(1, "fork");
        default:
-               (void)waitpid(pid, &status, 0);
+               waitpid(pid, &status, 0);
                break;
        }
 }
@@ -755,7 +755,7 @@ puff of greasy black smoke! (poof)\n");
 void
 usage(void)
 {
-       (void)fprintf(stderr,
+       fprintf(stderr,
 "usage: wump [-h] [-a arrows] [-b bats] [-p pits] [-r rooms] [-t tunnels]\n");
        exit(1);
 }
@@ -765,7 +765,7 @@ usage(void)
 void
 wump_kill(void)
 {
-       (void)printf(
+       printf(
 "*ROAR* *chomp* *snurfle* *chomp*!\n\
 Much to the delight of the Wumpus, you walked right into his mouth,\n\
 making you one of the easiest dinners he's ever had!  For you, however,\n\
@@ -777,7 +777,7 @@ passed out from the stench!\n");
 void
 kill_wump(void)
 {
-       (void)printf(
+       printf(
 "*thwock!* *groan* *crash*\n\n\
 A horrible roar fills the cave, and you realize, with a smile, that you\n\
 have slain the evil Wumpus and won the game!  You don't want to tarry for\n\
@@ -789,7 +789,7 @@ mightiest adventurer at a single whiff!!\n");
 void
 no_arrows(void)
 {
-       (void)printf(
+       printf(
 "\nYou turn and look at your quiver, and realize with a sinking feeling\n\
 that you've just shot your last arrow (figuratively, too).  Sensing this\n\
 with its psychic powers, the evil Wumpus rampagees through the cave, finds\n\
@@ -799,7 +799,7 @@ you, and with a mighty *ROAR* eats you alive!\n");
 void
 shoot_self(void)
 {
-       (void)printf(
+       printf(
 "\n*Thwack!*  A sudden piercing feeling informs you that the ricochet\n\
 of your wild arrow has resulted in it wedging in your side, causing\n\
 extreme agony.  The evil Wumpus, with its psychic powers, realizes this\n\
@@ -810,7 +810,7 @@ and immediately rushes to your side, not to help, alas, but to EAT YOU!\n\
 void
 jump(int where)
 {
-       (void)printf(
+       printf(
 "\nWith a jaunty step you enter the magic tunnel.  As you do, you\n\
 notice that the walls are shimmering and glowing.  Suddenly you feel\n\
 a very curious, warm sensation and find yourself in room %d!!\n", where);
@@ -819,7 +819,7 @@ a very curious, warm sensation and find yourself in room %d!!\n", where);
 void
 pit_kill(void)
 {
-       (void)printf(
+       printf(
 "*AAAUUUUGGGGGHHHHHhhhhhhhhhh...*\n\
 The whistling sound and updraft as you walked into this room of the\n\
 cave apparently wasn't enough to clue you in to the presence of the\n\
@@ -831,7 +831,7 @@ you can at least find out if Jules Verne was right...\n");
 void
 pit_survive(void)
 {
-       (void)printf(
+       printf(
 "Without conscious thought you grab for the side of the cave and manage\n\
 to grasp onto a rocky outcrop.  Beneath your feet stretches the limitless\n\
 depths of a bottomless pit!  Rock crumbles beneath your feet!\n");