diff options
author | jsm <jsm@NetBSD.org> | 2001-03-25 20:43:58 +0000 |
---|---|---|
committer | jsm <jsm@NetBSD.org> | 2001-03-25 20:43:58 +0000 |
commit | 00b8e31689c6400d8ad915067f021b8e246df989 (patch) | |
tree | eb00203724cf2a378ca54c9419738dd06661f34c /hack/hack.invent.c | |
parent | 57d9770b2eb590f5cad0b445cdbb91acb168736f (diff) | |
download | bsdgames-darwin-00b8e31689c6400d8ad915067f021b8e246df989.tar.gz bsdgames-darwin-00b8e31689c6400d8ad915067f021b8e246df989.tar.zst bsdgames-darwin-00b8e31689c6400d8ad915067f021b8e246df989.zip |
Make mostly gcc -W clean, and other cleanup:
Use const.
Add __noreturn__ attributes.
Add a __format__ attribute.
Add __unused__ attributes.
Use symbolic constants for open() and lseek().
Declare types of all function parameters; convert some function
definitions to ISO C form.
Ensure standard file descriptors are open on startup.
Check for errors writing output of makedefs.
Avoid duplicate definitions of variables.
Diffstat (limited to 'hack/hack.invent.c')
-rw-r--r-- | hack/hack.invent.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hack/hack.invent.c b/hack/hack.invent.c index 9cd1bb92..c81bdef6 100644 --- a/hack/hack.invent.c +++ b/hack/hack.invent.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.invent.c,v 1.6 1997/10/23 07:05:55 fair Exp $ */ +/* $NetBSD: hack.invent.c,v 1.7 2001/03/25 20:44:00 jsm Exp $ */ /* * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. @@ -6,7 +6,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: hack.invent.c,v 1.6 1997/10/23 07:05:55 fair Exp $"); +__RCSID("$NetBSD: hack.invent.c,v 1.7 2001/03/25 20:44:00 jsm Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -335,7 +335,7 @@ mkgoldobj(q) */ struct obj * getobj(let, word) - char *let, *word; + const char *let, *word; { struct obj *otmp; char ilet, ilet1, ilet2; @@ -508,7 +508,7 @@ ckunpaid(otmp) /* return the number of times fn was called successfully */ int ggetobj(word, fn, max) - char *word; + const char *word; int (*fn) __P((struct obj *)); int max; { @@ -799,7 +799,7 @@ dolook() { struct obj *otmp = NULL, *otmp0 = NULL; struct gold *gold = NULL; - char *verb = Blind ? "feel" : "see"; + const char *verb = Blind ? "feel" : "see"; int ct = 0; if (!u.uswallow) { @@ -866,6 +866,7 @@ stackobj(obj) int merged(otmp, obj, lose) struct obj *otmp, *obj; + int lose; { if (obj->otyp == otmp->otyp && obj->unpaid == otmp->unpaid && |