-/* $NetBSD: hack.do_name.c,v 1.10 2009/06/29 23:05:33 dholland Exp $ */
+/* $NetBSD: hack.do_name.c,v 1.13 2011/08/07 06:03:45 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.do_name.c,v 1.10 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.do_name.c,v 1.13 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include <stdlib.h>
#include "hack.h"
#include "extern.h"
+static void do_oname(struct obj *);
+static char *xmonnam(struct monst *, int);
+static char *lmonnam(struct monst *);
+static char *visctrl(int);
+
coord
getpos(int force, const char *goal)
{
{
char buf[BUFSZ];
coord cc;
- int cx, cy, lth;
+ int cx, cy;
+ size_t lth;
unsigned i;
struct monst *mtmp, *mtmp2;
cc = getpos(0, "the monster you want to name");
* when there might be pointers around in unknown places. For now: only
* when obj is in the inventory.
*/
-void
+static void
do_oname(struct obj *obj)
{
struct obj *otmp, *otmp2;
- int lth;
+ size_t lth;
char buf[BUFSZ];
pline("What do you want to name %s? ", doname(obj));
getlin(buf);
#if 0
obfree(obj, otmp2); /* now unnecessary: no pointers on bill */
#endif
- free((char *) obj); /* let us hope nobody else saved a pointer */
+ free(obj); /* let us hope nobody else saved a pointer */
}
int
*str1 = str;
}
-const char *const ghostnames[] = {/* these names should have length < PL_NSIZ */
+static const char *const ghostnames[] = {
+ /* these names should have length < PL_NSIZ */
"adri", "andries", "andreas", "bert", "david", "dirk", "emile",
"frans", "fred", "greg", "hether", "jay", "john", "jon", "kay",
"kenny", "maud", "michiel", "mike", "peter", "robert", "ron",
"tom", "wilmar"
};
-char *
+static char *
xmonnam(struct monst *mtmp, int vb)
{
static char buf[BUFSZ]; /* %% */
(void) strlcpy(buf, shkname(mtmp), sizeof(buf));
break;
}
- /* fall into next case */
+ /* FALLTHROUGH */
default:
(void) snprintf(buf, sizeof(buf), "the %s%s",
mtmp->minvis ? "invisible " : "",
return (buf);
}
-char *
+static char *
lmonnam(struct monst *mtmp)
{
return (xmonnam(mtmp, 1));
return (bp);
}
-char *
+static char *
visctrl(int c)
{
static char ccc[3];