From 00b8e31689c6400d8ad915067f021b8e246df989 Mon Sep 17 00:00:00 2001 From: jsm Date: Sun, 25 Mar 2001 20:43:58 +0000 Subject: 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. --- hack/hack.invent.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'hack/hack.invent.c') 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 #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 @@ -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 && -- cgit v1.2.3-56-ge451