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.makemon.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'hack/hack.makemon.c') diff --git a/hack/hack.makemon.c b/hack/hack.makemon.c index b2e57fd1..1f6a174d 100644 --- a/hack/hack.makemon.c +++ b/hack/hack.makemon.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.makemon.c,v 1.4 1997/10/19 16:58:17 christos Exp $ */ +/* $NetBSD: hack.makemon.c,v 1.5 2001/03/25 20:44:01 jsm Exp $ */ /* * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. @@ -6,7 +6,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.makemon.c,v 1.4 1997/10/19 16:58:17 christos Exp $"); +__RCSID("$NetBSD: hack.makemon.c,v 1.5 2001/03/25 20:44:01 jsm Exp $"); #endif /* not lint */ #include "hack.h" @@ -23,8 +23,7 @@ struct monst zeromonst; * note that in this case we return only one of them (the one at [x,y]). */ struct monst * -makemon(ptr, x, y) - struct permonst *ptr; +makemon(const struct permonst *ptr, int x, int y) { struct monst *mtmp; int tmp, ct; @@ -169,7 +168,7 @@ foofull: } int -goodpos(x, y) +goodpos(int x, int y) { /* used only in mnexto and rloc */ return ( !(x < 1 || x > COLNO - 2 || y < 1 || y > ROWNO - 2 || @@ -213,7 +212,7 @@ mkmon_at(let, x, y) int x, y; { int ct; - struct permonst *ptr; + const struct permonst *ptr; for (ct = 0; ct < CMNUM; ct++) { ptr = &mons[ct]; -- cgit v1.2.3-56-ge451