From 5a555a984855e94b0fc3c9154da6b65208ba2c70 Mon Sep 17 00:00:00 2001 From: veego Date: Sun, 30 Aug 1998 09:19:36 +0000 Subject: Add braces to make the new egcs happy. --- larn/main.c | 15 +++++++++------ larn/monster.c | 16 ++++++++++------ larn/object.c | 10 ++++++---- larn/store.c | 7 ++++--- 4 files changed, 29 insertions(+), 19 deletions(-) (limited to 'larn') 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 #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 @@ -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 #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 @@ -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 #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."); } + } } } -- cgit v1.2.3-56-ge451