-/* $NetBSD: hack.mkobj.c,v 1.6 2003/04/02 18:36:38 jsm Exp $ */
+/* $NetBSD: hack.mkobj.c,v 1.9 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.mkobj.c,v 1.6 2003/04/02 18:36:38 jsm Exp $");
+__RCSID("$NetBSD: hack.mkobj.c,v 1.9 2011/08/07 06:03:45 dholland Exp $");
#endif /* not lint */
#include "hack.h"
#include "extern.h"
-char mkobjstr[] = "))[[!!!!????%%%%/=**))[[!!!!????%%%%/=**(%";
+static const char mkobjstr[] = "))[[!!!!????%%%%/=**))[[!!!!????%%%%/=**(%";
struct obj *
-mkobj_at(let, x, y)
- int let, x, y;
+mkobj_at(int let, int x, int y)
{
struct obj *otmp = mkobj(let);
otmp->ox = x;
}
void
-mksobj_at(otyp, x, y)
- int otyp, x, y;
+mksobj_at(int otyp, int x, int y)
{
struct obj *otmp = mksobj(otyp);
otmp->ox = x;
}
struct obj *
-mkobj(let)
- int let;
+mkobj(int let)
{
if (!let)
let = mkobjstr[rn2(sizeof(mkobjstr) - 1)];
struct obj zeroobj;
struct obj *
-mksobj(otyp)
- int otyp;
+mksobj(int otyp)
{
struct obj *otmp;
char let = objects[otyp].oc_olet;
if (otmp->otyp == TIN)
otmp->spe = rnd(...);
#endif /* NOT_YET_IMPLEMENTED */
- /* fall into next case */
+ /* FALLTHROUGH */
case GEM_SYM:
otmp->quan = rn2(6) ? 1 : 2;
+ break;
case TOOL_SYM:
case CHAIN_SYM:
case BALL_SYM:
}
int
-letter(c)
- int c;
+letter(int c)
{
return (('@' <= c && c <= 'Z') || ('a' <= c && c <= 'z'));
}
int
-weight(obj)
- struct obj *obj;
+weight(struct obj *obj)
{
int wt = objects[obj->otyp].oc_weight;
return (wt ? wt * obj->quan : (obj->quan + 1) / 2);