From cd0bf6e6d1b2415c6dea7b66ed204b1a76eff26c Mon Sep 17 00:00:00 2001 From: xsa Date: Wed, 3 Mar 2004 22:51:00 +0000 Subject: [PATCH] -Wall cleanup; ok sturm@. --- games/netris/patches/patch-curses_c | 11 +++++++++++ games/netris/patches/patch-game_c | 18 ++++++++++++++++++ games/netris/patches/patch-robot_c | 12 ++++++++++++ games/netris/patches/patch-util_c | 21 +++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 games/netris/patches/patch-curses_c create mode 100644 games/netris/patches/patch-game_c create mode 100644 games/netris/patches/patch-robot_c create mode 100644 games/netris/patches/patch-util_c diff --git a/games/netris/patches/patch-curses_c b/games/netris/patches/patch-curses_c new file mode 100644 index 00000000000..ce2dc9c48a4 --- /dev/null +++ b/games/netris/patches/patch-curses_c @@ -0,0 +1,11 @@ +$OpenBSD: patch-curses_c,v 1.1 2004/03/03 22:51:00 xsa Exp $ +--- curses.c.orig 2003-08-13 03:33:02.000000000 +0200 ++++ curses.c 2004-03-03 15:50:24.000000000 +0100 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + + #ifdef NCURSES_VERSION + # define HAVE_NCURSES diff --git a/games/netris/patches/patch-game_c b/games/netris/patches/patch-game_c new file mode 100644 index 00000000000..c4b9a9658cc --- /dev/null +++ b/games/netris/patches/patch-game_c @@ -0,0 +1,18 @@ +$OpenBSD: patch-game_c,v 1.1 2004/03/03 22:51:00 xsa Exp $ +--- game.c.orig 2003-08-13 03:33:02.000000000 +0200 ++++ game.c 2004-03-03 15:53:32.000000000 +0100 +@@ -58,11 +58,11 @@ ExtFunc void MapKeys(char *newKeys) + ch = (unsigned char) keyTable[k]; + if (used[ch]) { + if (iscntrl(ch) && ch < ' ') +- sprintf(scratch, "Ctrl-%c", ch + ('A' - 1)); ++ snprintf(scratch, sizeof scratch, "Ctrl-%c", ch + ('A' - 1)); + else if (isprint(ch)) +- sprintf(scratch, "\"%c\"", ch); ++ snprintf(scratch, sizeof scratch, "\"%c\"", ch); + else +- sprintf(scratch, "0x%X", ch); ++ snprintf(scratch, sizeof scratch, "0x%X", ch); + if (!errs) + fprintf(stderr, "Duplicate key mappings:\n"); + errs++; diff --git a/games/netris/patches/patch-robot_c b/games/netris/patches/patch-robot_c new file mode 100644 index 00000000000..603635cd8b1 --- /dev/null +++ b/games/netris/patches/patch-robot_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-robot_c,v 1.1 2004/03/03 22:51:00 xsa Exp $ +--- robot.c.orig 2003-08-13 03:33:02.000000000 +0200 ++++ robot.c 2004-03-03 16:03:26.000000000 +0100 +@@ -63,7 +63,7 @@ ExtFunc void InitRobot(char *robotProg) + close(to[1]); + close(from[0]); + close(from[1]); +- execl("/bin/sh", "sh", "-c", robotProg, NULL); ++ execl("/bin/sh", "sh", "-c", robotProg, (char *)NULL); + die("execl failed"); + } + close(to[0]); diff --git a/games/netris/patches/patch-util_c b/games/netris/patches/patch-util_c new file mode 100644 index 00000000000..f85dd93e272 --- /dev/null +++ b/games/netris/patches/patch-util_c @@ -0,0 +1,21 @@ +$OpenBSD: patch-util_c,v 1.1 2004/03/03 22:51:00 xsa Exp $ +--- util.c.orig 2003-08-13 03:33:02.000000000 +0200 ++++ util.c 2004-03-03 15:56:01.000000000 +0100 +@@ -35,7 +35,7 @@ static EventGenRec alarmGen = + { &alarmGen, 0, FT_read, -1, AlarmGenFunc, EM_alarm }; + static EventGenRec *nextGen = &alarmGen; + +-static myRandSeed = 1; ++static int myRandSeed = 1; + + static struct timeval baseTimeval; + +@@ -319,7 +319,7 @@ ExtFunc void AddEventGen(EventGenRec *ge + + ExtFunc void RemoveEventGen(EventGenRec *gen) + { +- /* assert(gen->next != NULL); /* Be more forgiving, for SIGINTs */ ++ /* assert(gen->next != NULL); */ /* Be more forgiving, for SIGINTs */ + if (gen->next) { + while (nextGen->next != gen) + nextGen = nextGen->next;