summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authormax <max@FreeBSD.org>1997-01-31 15:04:23 +0000
committermax <max@FreeBSD.org>1997-01-31 15:04:23 +0000
commitbd5d098ad1618add27294f6ecd8f541830ccc0d1 (patch)
tree971cae6c02aed6dcba6d5c070e8b012231c3bcea /games
parent1f160cfbad70d491e89658cd984e086c5e5210c9 (diff)
downloadFreeBSD-src-bd5d098ad1618add27294f6ecd8f541830ccc0d1.zip
FreeBSD-src-bd5d098ad1618add27294f6ecd8f541830ccc0d1.tar.gz
Style police:
- Indentation corrections - Spaces -> tabs. - func() -> func () (To be consistent with the original code.) - Check if getopt() returns -1, not EOF. Suggested by: bde
Diffstat (limited to 'games')
-rw-r--r--games/backgammon/backgammon/main.c6
-rw-r--r--games/backgammon/common_source/subs.c12
-rw-r--r--games/backgammon/teachgammon/teach.c4
3 files changed, 11 insertions, 11 deletions
diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c
index 64cd2a6..d5b059c 100644
--- a/games/backgammon/backgammon/main.c
+++ b/games/backgammon/backgammon/main.c
@@ -140,7 +140,7 @@ char **argv;
t = time(0);
srandom(t); /* 'random' seed */
- getarg (argc, argv);
+ getarg (argc, argv);
args[acnt] = NULL;
if (tflag) { /* clear screen */
noech &= ~(CRMOD|XTABS);
@@ -171,7 +171,7 @@ char **argv;
if (yorn(0)) {
fixtty (old); /* restore tty */
- args[0] = strdup("teachgammon");
+ args[0] = strdup ("teachgammon");
execv (TEACH,args);
tflag = 0; /* error! */
@@ -188,7 +188,7 @@ char **argv;
}
for (i = 0; i < acnt; i++)
- free(args[i]);
+ free (args[i]);
init(); /* initialize board */
diff --git a/games/backgammon/common_source/subs.c b/games/backgammon/common_source/subs.c
index 904ccbb..3c96026 100644
--- a/games/backgammon/common_source/subs.c
+++ b/games/backgammon/common_source/subs.c
@@ -311,7 +311,7 @@ register char **argv;
/* process arguments here. dashes are ignored, nbrw are ignored
if the game is being recovered */
- while ((ch = getopt(argc, argv, "nbrwp:t:s:")) != EOF) {
+ while ((ch = getopt (argc, argv, "nbrwp:t:s:")) != -1) {
switch (ch) {
/* don't ask if rules or instructions needed */
@@ -319,7 +319,7 @@ register char **argv;
if (rflag)
break;
aflag = 0;
- args[acnt++] = strdup("-n");
+ args[acnt++] = strdup ("-n");
break;
/* player is both read and white */
@@ -328,7 +328,7 @@ register char **argv;
break;
pnum = 0;
aflag = 0;
- args[acnt++] = strdup("-b");
+ args[acnt++] = strdup ("-b");
break;
/* player is red */
@@ -337,7 +337,7 @@ register char **argv;
break;
pnum = -1;
aflag = 0;
- args[acnt++] = strdup("-r");
+ args[acnt++] = strdup ("-r");
break;
/* player is white */
@@ -346,14 +346,14 @@ register char **argv;
break;
pnum = 1;
aflag = 0;
- args[acnt++] = strdup("-w");
+ args[acnt++] = strdup ("-w");
break;
/* print board after move according to following character */
case 'p':
if (optarg[0] != 'r' && optarg[0] != 'w' && optarg[0] != 'b')
break;
- args[acnt] = strdup("-p ");
+ args[acnt] = strdup ("-p ");
args[acnt++][2] = optarg[0];
if (optarg[0] == 'r')
bflag = 1;
diff --git a/games/backgammon/teachgammon/teach.c b/games/backgammon/teachgammon/teach.c
index 8d3ae25..7761ee6 100644
--- a/games/backgammon/teachgammon/teach.c
+++ b/games/backgammon/teachgammon/teach.c
@@ -152,7 +152,7 @@ char **argv;
}
leave() {
- register int i;
+ register int i;
if (tflag)
clear();
else
@@ -163,7 +163,7 @@ leave() {
args[acnt] = 0;
execv (EXEC,args);
for (i = 0; i < acnt; i++)
- free(args[i]);
+ free (args[i]);
writel ("Help! Backgammon program is missing\007!!\n");
exit (-1);
}
OpenPOWER on IntegriCloud