diff options
author | christos <christos@NetBSD.org> | 2001-02-05 00:57:32 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 2001-02-05 00:57:32 +0000 |
commit | b1c8e14afd5a078ca925fe471733a693ca4a8076 (patch) | |
tree | 479753089c657c4900becbda1592945edbc418bb /larn/object.c | |
parent | 5813ff28d2110a139386e10f5e3977f3b88dbda8 (diff) | |
download | bsdgames-darwin-b1c8e14afd5a078ca925fe471733a693ca4a8076.tar.gz bsdgames-darwin-b1c8e14afd5a078ca925fe471733a693ca4a8076.tar.zst bsdgames-darwin-b1c8e14afd5a078ca925fe471733a693ca4a8076.zip |
- rename getchar to lgetchar to avoid conflicts with the stdio getchar
- fix redundant decls and nested externs
- use snprintf instead of sprintf
Diffstat (limited to 'larn/object.c')
-rw-r--r-- | larn/object.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/larn/object.c b/larn/object.c index bfda5a17..59df0215 100644 --- a/larn/object.c +++ b/larn/object.c @@ -1,10 +1,10 @@ -/* $NetBSD: object.c,v 1.9 1998/08/30 09:19:38 veego Exp $ */ +/* $NetBSD: object.c,v 1.10 2001/02/05 00:57:34 christos Exp $ */ /* object.c Larn is copyrighted 1986 by Noah Morgan. */ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: object.c,v 1.9 1998/08/30 09:19:38 veego Exp $"); +__RCSID("$NetBSD: object.c,v 1.10 2001/02/05 00:57:34 christos Exp $"); #endif /* not lint */ #include "header.h" #include "extern.h" @@ -149,7 +149,7 @@ lookforobject() lprcat("\nDo you (g) go inside, or (i) stay here? "); i = 0; while ((i != 'g') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if (i == 'g') { oschool(); /* the college of larn */ } else @@ -174,7 +174,7 @@ lookforobject() lprcat("\nDo you (g) go inside, or (i) stay here? "); j = 0; while ((j != 'g') && (j != 'i') && (j != '\33')) - j = getchar(); + j = lgetchar(); if (j == 'g') { if (i == OBANK) obank(); @@ -197,7 +197,7 @@ lookforobject() lprcat("\nDo you (g) go inside, or (i) stay here? "); i = 0; while ((i != 'g') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if (i == 'g') dndstore(); /* the dnd adventurers store */ else @@ -220,7 +220,7 @@ lookforobject() iopts(); i = 0; while ((i != 'c') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if ((i == '\33') || (i == 'i')) { ignore(); break; @@ -239,7 +239,7 @@ lookforobject() iopts(); i = 0; while ((i != 'o') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if ((i == '\33') || (i == 'i')) { ignore(); playerx = lastpx; @@ -290,7 +290,7 @@ lookforobject() iopts(); i = 0; while ((i != 'g') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if (i == 'g') { newcavelevel(1); playerx = 33; @@ -310,7 +310,7 @@ lookforobject() iopts(); i = 0; while ((i != 'c') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if ((i == '\33') || (i == 'i')) { ignore(); break; @@ -350,7 +350,7 @@ lookforobject() iopts(); i = 0; while ((i != 'c') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if ((i == '\33') || (i == 'i')) { ignore(); break; @@ -446,7 +446,7 @@ lookforobject() lprcat("\nDo you (g) go inside, or (i) stay here? "); i = 0; while ((i != 'g') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if (i == 'g') otradepost(); else @@ -460,7 +460,7 @@ lookforobject() lprcat("\nDo you (g) go inside, or (i) stay here? "); i = 0; while ((i != 'g') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if (i == 'g') ohome(); else @@ -481,7 +481,7 @@ lookforobject() lprcat("\nDo you (g) go inside, or (i) stay here? "); i = 0; while ((i != 'g') && (i != 'i') && (i != '\33')) - i = getchar(); + i = lgetchar(); if (i == 'g') olrs(); /* the larn revenue service */ else @@ -525,7 +525,7 @@ finditem(itm) iopts(); i = 0; while (i != 't' && i != 'i' && i != '\33') - i = getchar(); + i = lgetchar(); if (i == 't') { lprcat("take"); if (take(itm, tmp) == 0) @@ -558,7 +558,7 @@ ostairs(dir) lprcat("or (f) kick stairs? "); while (1) - switch (getchar()) { + switch (lgetchar()) { case '\33': case 's': case 'i': @@ -663,7 +663,7 @@ opotion(pot) lprcat("\nDo you (d) drink it, (t) take it"); iopts(); while (1) - switch (getchar()) { + switch (lgetchar()) { case '\33': case 'i': ignore(); @@ -879,7 +879,7 @@ oscroll(typ) lprcat("(t) take it"); iopts(); while (1) - switch (getchar()) { + switch (lgetchar()) { case '\33': case 'i': ignore(); @@ -1173,7 +1173,7 @@ obook() lprcat("(t) take it"); iopts(); while (1) - switch (getchar()) { + switch (lgetchar()) { case '\33': case 'i': ignore(); @@ -1223,7 +1223,7 @@ ocookie() lprcat("\nDo you (e) eat it, (t) take it"); iopts(); while (1) - switch (getchar()) { + switch (lgetchar()) { case '\33': case 'i': ignore(); @@ -1323,9 +1323,9 @@ ohome() lprcat(" to continue, "); standout("escape"); lprcat(" to leave ----- "); - i = getchar(); + i = lgetchar(); while (i != '\33' && i != '\n') - i = getchar(); + i = lgetchar(); if (i == '\33') { drawscreen(); nosignal = 0; /* enable signals */ |