Module Name: src
Committed By: dholland
Date: Mon May 25 04:33:53 UTC 2009
Modified Files:
src/games/tetris: input.c scores.c screen.c shapes.c tetris.c tetris.h
Log Message:
ANSIfy function declarations.
Some object file diffs, but they are harmless. (Mostly they seem to
come from internal counters in gcc... and in one case the order of two
instructions was harmlessly swapped, which is odd and annoying.)
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/tetris/input.c src/games/tetris/tetris.h
cvs rdiff -u -r1.14 -r1.15 src/games/tetris/scores.c
cvs rdiff -u -r1.22 -r1.23 src/games/tetris/screen.c
cvs rdiff -u -r1.7 -r1.8 src/games/tetris/shapes.c
cvs rdiff -u -r1.20 -r1.21 src/games/tetris/tetris.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/games/tetris/input.c
diff -u src/games/tetris/input.c:1.10 src/games/tetris/input.c:1.11
--- src/games/tetris/input.c:1.10 Sun Mar 19 00:50:28 2006
+++ src/games/tetris/input.c Mon May 25 04:33:53 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: input.c,v 1.10 2006/03/19 00:50:28 christos Exp $ */
+/* $NetBSD: input.c,v 1.11 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -72,8 +72,7 @@
* Return 0 => no input, 1 => can read() from stdin
*/
int
-rwait(tvp)
- struct timeval *tvp;
+rwait(struct timeval *tvp)
{
struct pollfd set[1];
struct timeval starttv, endtv;
@@ -120,7 +119,7 @@
* Eat any input that might be available.
*/
void
-tsleep()
+tsleep(void)
{
struct timeval tv;
char c;
@@ -136,7 +135,7 @@
* getchar with timeout.
*/
int
-tgetchar()
+tgetchar(void)
{
static struct timeval timeleft;
char c;
Index: src/games/tetris/tetris.h
diff -u src/games/tetris/tetris.h:1.10 src/games/tetris/tetris.h:1.11
--- src/games/tetris/tetris.h:1.10 Tue Jan 27 20:30:30 2004
+++ src/games/tetris/tetris.h Mon May 25 04:33:53 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: tetris.h,v 1.10 2004/01/27 20:30:30 jsm Exp $ */
+/* $NetBSD: tetris.h,v 1.11 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -171,4 +171,4 @@
int fits_in(const struct shape *, int);
void place(const struct shape *, int, int);
-void stop(const char *) __attribute__((__noreturn__));
+void stop(const char *) __dead;
Index: src/games/tetris/scores.c
diff -u src/games/tetris/scores.c:1.14 src/games/tetris/scores.c:1.15
--- src/games/tetris/scores.c:1.14 Thu Jun 1 16:12:27 2006
+++ src/games/tetris/scores.c Mon May 25 04:33:53 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: scores.c,v 1.14 2006/06/01 16:12:27 drochner Exp $ */
+/* $NetBSD: scores.c,v 1.15 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -90,8 +90,7 @@
* Note, we assume closing the stdio file releases the lock.
*/
static void
-getscores(fpp)
- FILE **fpp;
+getscores(FILE **fpp)
{
int sd, mint, lck;
mode_t mask;
@@ -145,8 +144,7 @@
}
void
-savescore(level)
- int level;
+savescore(int level)
{
struct highscore *sp;
int i;
@@ -212,7 +210,7 @@
* The result is always trimmed to fit in a score.
*/
static char *
-thisuser()
+thisuser(void)
{
const char *p;
struct passwd *pw;
@@ -244,8 +242,7 @@
* listed first in the highscore file.
*/
static int
-cmpscores(x, y)
- const void *x, *y;
+cmpscores(const void *x, const void *y)
{
const struct highscore *a, *b;
long l;
@@ -274,9 +271,7 @@
* Caveat: the highest score on each level is always kept.
*/
static int
-checkscores(hs, num)
- struct highscore *hs;
- int num;
+checkscores(struct highscore *hs, int num)
{
struct highscore *sp;
int i, j, k, numnames;
@@ -349,8 +344,7 @@
* before it can be shown anyway.
*/
void
-showscores(level)
- int level;
+showscores(int level)
{
struct highscore *sp;
int i, n, c;
@@ -404,11 +398,7 @@
}
static void
-printem(level, offset, hs, n, me)
- int level, offset;
- struct highscore *hs;
- int n;
- const char *me;
+printem(int level, int offset, struct highscore *hs, int n, const char *me)
{
struct highscore *sp;
int nrows, row, col, item, i, highlight;
Index: src/games/tetris/screen.c
diff -u src/games/tetris/screen.c:1.22 src/games/tetris/screen.c:1.23
--- src/games/tetris/screen.c:1.22 Mon Jan 28 01:38:59 2008
+++ src/games/tetris/screen.c Mon May 25 04:33:53 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.c,v 1.22 2008/01/28 01:38:59 dholland Exp $ */
+/* $NetBSD: screen.c,v 1.23 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -123,8 +123,7 @@
* Routine used by tputs().
*/
int
-put(c)
- int c;
+put(int c)
{
return (putchar(c));
@@ -150,7 +149,7 @@
* Set up from termcap.
*/
void
-scr_init()
+scr_init(void)
{
static int bsflag, xsflag, sgnum;
#ifdef unneeded
@@ -217,8 +216,7 @@
static jmp_buf scr_onstop;
static void
-stopset(sig)
- int sig;
+stopset(int sig)
{
sigset_t set;
@@ -231,8 +229,7 @@
}
static void
-scr_stop(sig)
- int sig;
+scr_stop(int sig)
{
sigset_t set;
@@ -249,7 +246,7 @@
* Set up screen mode.
*/
void
-scr_set()
+scr_set(void)
{
struct winsize ws;
struct termios newtt;
@@ -316,7 +313,7 @@
* End screen mode.
*/
void
-scr_end()
+scr_end(void)
{
sigset_t nsigset, osigset;
@@ -341,8 +338,7 @@
}
void
-stop(why)
- const char *why;
+stop(const char *why)
{
if (isset)
@@ -355,7 +351,7 @@
* Clear the screen, forgetting the current contents in the process.
*/
void
-scr_clear()
+scr_clear(void)
{
putpad(CLstr);
@@ -373,7 +369,7 @@
* Update the screen.
*/
void
-scr_update()
+scr_update(void)
{
cell *bp, *sp;
regcell so, cur_so = 0;
@@ -485,9 +481,7 @@
* (We need its length in case we have to overwrite with blanks.)
*/
void
-scr_msg(s, set)
- char *s;
- int set;
+scr_msg(char *s, int set)
{
if (set || CEstr == NULL) {
Index: src/games/tetris/shapes.c
diff -u src/games/tetris/shapes.c:1.7 src/games/tetris/shapes.c:1.8
--- src/games/tetris/shapes.c:1.7 Sun Oct 22 08:09:24 2006
+++ src/games/tetris/shapes.c Mon May 25 04:33:53 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: shapes.c,v 1.7 2006/10/22 08:09:24 mrg Exp $ */
+/* $NetBSD: shapes.c,v 1.8 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -79,9 +79,7 @@
* taking the current board into account.
*/
int
-fits_in(shape, pos)
- const struct shape *shape;
- int pos;
+fits_in(const struct shape *shape, int pos)
{
const int *o = shape->off;
@@ -96,9 +94,7 @@
* if `onoff' is 1, and off if `onoff' is 0.
*/
void
-place(shape, pos, onoff)
- const struct shape *shape;
- int pos, onoff;
+place(const struct shape *shape, int pos, int onoff)
{
const int *o = shape->off;
Index: src/games/tetris/tetris.c
diff -u src/games/tetris/tetris.c:1.20 src/games/tetris/tetris.c:1.21
--- src/games/tetris/tetris.c:1.20 Mon May 25 00:46:01 2009
+++ src/games/tetris/tetris.c Mon May 25 04:33:53 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: tetris.c,v 1.20 2009/05/25 00:46:01 dholland Exp $ */
+/* $NetBSD: tetris.c,v 1.21 2009/05/25 04:33:53 dholland Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -86,7 +86,7 @@
* right edges are set.
*/
static void
-setup_board()
+setup_board(void)
{
int i;
cell *p;
@@ -100,7 +100,7 @@
* Elide any full active rows.
*/
static void
-elide()
+elide(void)
{
int i, j, base;
cell *p;
@@ -125,9 +125,7 @@
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int pos, c;
const char *keys;
@@ -321,8 +319,7 @@
}
void
-onintr(signo)
- int signo __unused;
+onintr(int signo __unused)
{
scr_clear();
scr_end();
@@ -330,7 +327,7 @@
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: tetris [-ps] [-k keys] [-l level]\n");
exit(1);