summaryrefslogtreecommitdiffstats
path: root/larn
diff options
context:
space:
mode:
authorveego <veego@NetBSD.org>1998-08-30 09:19:36 +0000
committerveego <veego@NetBSD.org>1998-08-30 09:19:36 +0000
commit5a555a984855e94b0fc3c9154da6b65208ba2c70 (patch)
tree285ed9cc28655053e6f1520670b43ae864d0c264 /larn
parentc4c1ed4f214d1b50a09d0c42fa9c741ac18fb482 (diff)
downloadbsdgames-darwin-5a555a984855e94b0fc3c9154da6b65208ba2c70.tar.gz
bsdgames-darwin-5a555a984855e94b0fc3c9154da6b65208ba2c70.tar.zst
bsdgames-darwin-5a555a984855e94b0fc3c9154da6b65208ba2c70.zip
Add braces to make the new egcs happy.
Diffstat (limited to 'larn')
-rw-r--r--larn/main.c15
-rw-r--r--larn/monster.c16
-rw-r--r--larn/object.c10
-rw-r--r--larn/store.c7
4 files changed, 29 insertions, 19 deletions
diff --git a/larn/main.c b/larn/main.c
index d386ed36..fbc0fc6f 100644
--- a/larn/main.c
+++ b/larn/main.c
@@ -1,9 +1,9 @@
-/* $NetBSD: main.c,v 1.13 1998/07/27 01:12:35 mycroft Exp $ */
+/* $NetBSD: main.c,v 1.14 1998/08/30 09:19:38 veego Exp $ */
/* main.c */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.13 1998/07/27 01:12:35 mycroft Exp $");
+__RCSID("$NetBSD: main.c,v 1.14 1998/08/30 09:19:38 veego Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -72,15 +72,17 @@ main(argc, argv)
init_term(); /* setup the terminal (find out what type)
* for termcap */
#endif /* VT100 */
- if (((ptr = getlogin()) == 0) || (*ptr == 0)) /* try to get login name */
- if ((pwe = getpwuid(getuid())) != NULL)/* can we get it from
- * /etc/passwd? */
+ /* try to get login name */
+ if (((ptr = getlogin()) == 0) || (*ptr == 0)) {
+ /* can we get it from /etc/passwd? */
+ if ((pwe = getpwuid(getuid())) != NULL)
ptr = pwe->pw_name;
else if ((ptr = getenv("USER")) == 0)
if ((ptr = getenv("LOGNAME")) == 0) {
noone: write(2, "Can't find your logname. Who Are You?\n", 39);
exit(1);
}
+ }
if (ptr == 0)
goto noone;
if (strlen(ptr) == 0)
@@ -1201,7 +1203,7 @@ eatcookie()
while (1) {
if ((i = whatitem("eat")) == '\33')
return;
- if (i != '.')
+ if (i != '.') {
if (i == '*')
showeat();
else {
@@ -1223,6 +1225,7 @@ eatcookie()
lprcat("\nYou can't eat that!");
return;
}
+ }
}
}
diff --git a/larn/monster.c b/larn/monster.c
index d12601b0..3761bb82 100644
--- a/larn/monster.c
+++ b/larn/monster.c
@@ -1,4 +1,4 @@
-/* $NetBSD: monster.c,v 1.5 1997/10/18 20:03:29 christos Exp $ */
+/* $NetBSD: monster.c,v 1.6 1998/08/30 09:19:38 veego Exp $ */
/*
* monster.c Larn is copyrighted 1986 by Noah Morgan.
@@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: monster.c,v 1.5 1997/10/18 20:03:29 christos Exp $");
+__RCSID("$NetBSD: monster.c,v 1.6 1998/08/30 09:19:38 veego Exp $");
#endif /* not lint */
#include <string.h>
@@ -965,7 +965,7 @@ omnidirect(spnum, dam, str)
return; /* bad args */
for (x = playerx - 1; x < playerx + 2; x++)
for (y = playery - 1; y < playery + 2; y++) {
- if ((m = mitem[x][y]) != 0)
+ if ((m = mitem[x][y]) != 0) {
if (nospell(spnum, m) == 0) {
ifblind(x, y);
cursors();
@@ -977,6 +977,7 @@ omnidirect(spnum, dam, str)
lasthx = x;
lasthy = y;
}
+ }
}
}
@@ -1512,11 +1513,12 @@ spattack(x, xx, yy)
switch (x) {
case 1: /* rust your armor, j=1 when rusting has occurred */
m = k = c[WEAR];
- if ((i = c[SHIELD]) != -1)
+ if ((i = c[SHIELD]) != -1) {
if (--ivenarg[i] < -1)
ivenarg[i] = -1;
else
j = 1;
+ }
if ((j == 0) && (k != -1)) {
m = iven[k];
for (i = 0; i < ARMORTYPES; i++)
@@ -1710,8 +1712,8 @@ annihilate()
u_char *p;
for (k = 0, i = playerx - 1; i <= playerx + 1; i++)
for (j = playery - 1; j <= playery + 1; j++)
- if (!vxy(&i, &j)) /* if not out of bounds */
- if (*(p = &mitem[i][j])) /* if a monster there */
+ if (!vxy(&i, &j)) { /* if not out of bounds */
+ if (*(p = &mitem[i][j])) { /* if a monster there */
if (*p < DEMONLORD + 2) {
k += monster[*p].experience;
*p = know[i][j] = 0;
@@ -1719,6 +1721,8 @@ annihilate()
lprintf("\nThe %s barely escapes being annihilated!", monster[*p].name);
hitp[i][j] = (hitp[i][j] >> 1) + 1; /* lose half hit points */
}
+ }
+ }
if (k > 0) {
lprcat("\nYou hear loud screams of agony!");
raiseexperience((long) k);
diff --git a/larn/object.c b/larn/object.c
index 60950a44..bfda5a17 100644
--- a/larn/object.c
+++ b/larn/object.c
@@ -1,10 +1,10 @@
-/* $NetBSD: object.c,v 1.8 1997/10/18 20:03:38 christos Exp $ */
+/* $NetBSD: object.c,v 1.9 1998/08/30 09:19:38 veego Exp $ */
/* object.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: object.c,v 1.8 1997/10/18 20:03:38 christos Exp $");
+__RCSID("$NetBSD: object.c,v 1.9 1998/08/30 09:19:38 veego Exp $");
#endif /* not lint */
#include "header.h"
#include "extern.h"
@@ -1110,8 +1110,8 @@ void
opit()
{
int i;
- if (rnd(101) < 81)
- if (rnd(70) > 9 * c[DEXTERITY] - packweight() || rnd(101) < 5)
+ if (rnd(101) < 81) {
+ if (rnd(70) > 9 * c[DEXTERITY] - packweight() || rnd(101) < 5) {
if (level == MAXLEVEL - 1)
obottomless();
else if (level == MAXLEVEL + MAXVLEVEL - 1)
@@ -1131,6 +1131,8 @@ opit()
newcavelevel(level + 1);
draws(0, MAXX, 0, MAXY);
}
+ }
+ }
}
void
diff --git a/larn/store.c b/larn/store.c
index 01a3b483..fce6efc3 100644
--- a/larn/store.c
+++ b/larn/store.c
@@ -1,4 +1,4 @@
-/* $NetBSD: store.c,v 1.6 1997/10/18 20:03:52 christos Exp $ */
+/* $NetBSD: store.c,v 1.7 1998/08/30 09:19:38 veego Exp $ */
/*-
* Copyright (c) 1988 The Regents of the University of California.
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)store.c 5.4 (Berkeley) 5/13/91";
#else
-__RCSID("$NetBSD: store.c,v 1.6 1997/10/18 20:03:52 christos Exp $");
+__RCSID("$NetBSD: store.c,v 1.7 1998/08/30 09:19:38 veego Exp $");
#endif
#endif /* not lint */
@@ -790,7 +790,7 @@ otradepost()
j = 1;
cnsitm();
} /* can't sell unidentified item */
- if (!j)
+ if (!j) {
if (i == '*') {
clear();
qshowstr();
@@ -837,6 +837,7 @@ otradepost()
if (j <= maxitm + 2)
lprcat("\nSo sorry, but we are not authorized to accept that item.");
}
+ }
}
}