From 9ae968b31504e93c0435f5f1ed75fb2ab2c7cbea Mon Sep 17 00:00:00 2001 From: jsm Date: Sun, 24 Sep 2000 14:20:23 +0000 Subject: Add explicit no-ops to empty loops following the NetBSD style guide. --- battlestar/com2.c | 7 ++++--- battlestar/com3.c | 7 ++++--- battlestar/com5.c | 13 ++++++++----- battlestar/com6.c | 7 ++++--- 4 files changed, 20 insertions(+), 14 deletions(-) (limited to 'battlestar') diff --git a/battlestar/com2.c b/battlestar/com2.c index 4ae10313..fb70c0a1 100644 --- a/battlestar/com2.c +++ b/battlestar/com2.c @@ -1,4 +1,4 @@ -/* $NetBSD: com2.c,v 1.17 2000/09/24 09:46:57 jsm Exp $ */ +/* $NetBSD: com2.c,v 1.18 2000/09/24 14:20:23 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: com2.c,v 1.17 2000/09/24 09:46:57 jsm Exp $"); +__RCSID("$NetBSD: com2.c,v 1.18 2000/09/24 14:20:23 jsm Exp $"); #endif #endif /* not lint */ @@ -273,7 +273,8 @@ murder() void ravage() { - while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount); + while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount) + continue; if (wordtype[wordnumber] == NOUNS && (testbit(location[position].objects, wordvalue[wordnumber]) || (wordvalue[wordnumber] == NORMGOD && testbit(location[position].objects, BATHGOD)))) { ourtime++; diff --git a/battlestar/com3.c b/battlestar/com3.c index b5f48375..6716a831 100644 --- a/battlestar/com3.c +++ b/battlestar/com3.c @@ -1,4 +1,4 @@ -/* $NetBSD: com3.c,v 1.11 2000/09/24 09:46:57 jsm Exp $ */ +/* $NetBSD: com3.c,v 1.12 2000/09/24 14:20:23 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)com3.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: com3.c,v 1.11 2000/09/24 09:46:57 jsm Exp $"); +__RCSID("$NetBSD: com3.c,v 1.12 2000/09/24 14:20:23 jsm Exp $"); #endif #endif /* not lint */ @@ -114,7 +114,8 @@ bury() int value; if (testbit(inven, SHOVEL)) { - while (wordtype[++wordnumber] != OBJECT && wordtype[wordnumber] != NOUNS && wordnumber < wordcount); + while (wordtype[++wordnumber] != OBJECT && wordtype[wordnumber] != NOUNS && wordnumber < wordcount) + continue; value = wordvalue[wordnumber]; if (wordtype[wordnumber] == NOUNS && (testbit(location[position].objects, value) || value == BODY)) switch (value) { diff --git a/battlestar/com5.c b/battlestar/com5.c index 8be78a8c..3c2f791a 100644 --- a/battlestar/com5.c +++ b/battlestar/com5.c @@ -1,4 +1,4 @@ -/* $NetBSD: com5.c,v 1.15 2000/09/23 19:51:02 jsm Exp $ */ +/* $NetBSD: com5.c,v 1.16 2000/09/24 14:20:23 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)com5.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: com5.c,v 1.15 2000/09/23 19:51:02 jsm Exp $"); +__RCSID("$NetBSD: com5.c,v 1.16 2000/09/24 14:20:23 jsm Exp $"); #endif #endif /* not lint */ @@ -47,7 +47,8 @@ __RCSID("$NetBSD: com5.c,v 1.15 2000/09/23 19:51:02 jsm Exp $"); void kiss() { - while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount); + while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount) + continue; /* The goddess must be "taken" first if bathing. */ if (wordtype[wordnumber] == NOUNS && wordvalue[wordnumber] == NORMGOD && testbit(location[position].objects, BATHGOD)) { @@ -99,7 +100,8 @@ love() { int n; - while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount); + while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount) + continue; if (wordtype[wordnumber] == NOUNS) { if ((testbit(location[position].objects, BATHGOD) || testbit(location[position].objects, NORMGOD)) && @@ -266,7 +268,8 @@ give() last1 = last2 = 0; firstnumber = wordnumber; - while (wordtype[++wordnumber] != OBJECT && wordvalue[wordnumber] != AMULET && wordvalue[wordnumber] != MEDALION && wordvalue[wordnumber] != TALISMAN && wordnumber <= wordcount); + while (wordtype[++wordnumber] != OBJECT && wordvalue[wordnumber] != AMULET && wordvalue[wordnumber] != MEDALION && wordvalue[wordnumber] != TALISMAN && wordnumber <= wordcount) + continue; if (wordnumber <= wordcount) { obj = wordvalue[wordnumber]; if (obj == EVERYTHING) diff --git a/battlestar/com6.c b/battlestar/com6.c index 5009293b..5f4c8562 100644 --- a/battlestar/com6.c +++ b/battlestar/com6.c @@ -1,4 +1,4 @@ -/* $NetBSD: com6.c,v 1.19 2000/09/22 08:19:21 jsm Exp $ */ +/* $NetBSD: com6.c,v 1.20 2000/09/24 14:20:24 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)com6.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: com6.c,v 1.19 2000/09/22 08:19:21 jsm Exp $"); +__RCSID("$NetBSD: com6.c,v 1.20 2000/09/24 14:20:24 jsm Exp $"); #endif #endif /* not lint */ @@ -206,7 +206,8 @@ ride() puts("You climb onto the stallion and kick it in the guts. The stupid steed launches"); puts("forward through bush and fern. You are thrown and the horse gallops off."); clearbit(location[position].objects, HORSE); - while (!(position = rnd(NUMOFROOMS + 1)) || !OUTSIDE || !beenthere[position] || location[position].flyhere); + while (!(position = rnd(NUMOFROOMS + 1)) || !OUTSIDE || !beenthere[position] || location[position].flyhere) + continue; setbit(location[position].objects, HORSE); if (location[position].north) position = location[position].north; -- cgit v1.2.3-56-ge451