summaryrefslogtreecommitdiffstats
path: root/rogue/score.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-12 11:45:01 +0000
committerlukem <lukem@NetBSD.org>1997-10-12 11:45:01 +0000
commita0041450da452d421fa15f352d533a000c2e7921 (patch)
tree500a4c4a314b36a49f50552293c66aa268eb59f2 /rogue/score.c
parent8d2dd1244517d9cf4b4e1fd9a4914c5496e8dfac (diff)
downloadbsdgames-darwin-a0041450da452d421fa15f352d533a000c2e7921.tar.gz
bsdgames-darwin-a0041450da452d421fa15f352d533a000c2e7921.tar.zst
bsdgames-darwin-a0041450da452d421fa15f352d533a000c2e7921.zip
WARNSify (not an insignificant task...)
Diffstat (limited to 'rogue/score.c')
-rw-r--r--rogue/score.c74
1 files changed, 44 insertions, 30 deletions
diff --git a/rogue/score.c b/rogue/score.c
index 814c1d39..4bfcaccc 100644
--- a/rogue/score.c
+++ b/rogue/score.c
@@ -1,4 +1,4 @@
-/* $NetBSD: score.c,v 1.5 1995/04/22 10:28:26 cgd Exp $ */
+/* $NetBSD: score.c,v 1.6 1997/10/12 11:46:01 lukem Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: score.c,v 1.5 1995/04/22 10:28:26 cgd Exp $";
+__RCSID("$NetBSD: score.c,v 1.6 1997/10/12 11:46:01 lukem Exp $");
#endif
#endif /* not lint */
@@ -60,15 +61,10 @@ static char rcsid[] = "$NetBSD: score.c,v 1.5 1995/04/22 10:28:26 cgd Exp $";
#include "rogue.h"
#include "pathnames.h"
-extern char login_name[];
-extern char *m_names[];
-extern short max_level;
-extern boolean score_only, no_skull, msg_cleared;
-extern char *byebye_string, *nick_name;
-
+void
killed_by(monster, other)
-object *monster;
-short other;
+ object *monster;
+ short other;
{
char buf[128];
@@ -134,6 +130,7 @@ short other;
put_scores(monster, other);
}
+void
win()
{
unwield(rogue.weapon); /* disarm and relax */
@@ -157,13 +154,16 @@ win()
put_scores((object *) 0, WIN);
}
+void
quit(from_intrpt)
-boolean from_intrpt;
+ boolean from_intrpt;
{
char buf[128];
short i, orow, ocol;
boolean mc;
+ orow = ocol = 0;
+ mc = FALSE;
md_ignore_signals();
if (from_intrpt) {
@@ -198,9 +198,10 @@ boolean from_intrpt;
killed_by((object *) 0, QUIT);
}
+void
put_scores(monster, other)
-object *monster;
-short other;
+ object *monster;
+ short other;
{
short i, n, rank = 10, x, ne = 0, found_player = -1;
char scores[10][82];
@@ -274,8 +275,8 @@ short other;
rank = ne;
}
if (rank < 10) {
- insert_score(scores, n_names, nick_name, rank, ne, monster,
- other);
+ insert_score(scores, n_names, nick_name, rank, ne,
+ monster, other);
if (ne < 10) {
ne++;
}
@@ -324,12 +325,14 @@ short other;
clean_up("");
}
+void
insert_score(scores, n_names, n_name, rank, n, monster, other)
-char scores[][82];
-char n_names[][30];
-char *n_name;
-short rank, n;
-object *monster;
+ char scores[][82];
+ char n_names[][30];
+ char *n_name;
+ short rank, n;
+ object *monster;
+ int other;
{
short i;
char buf[128];
@@ -342,7 +345,8 @@ object *monster;
}
}
}
- sprintf(buf, "%2d %6d %s: ", rank+1, rogue.gold, login_name);
+ sprintf(buf, "%2d %6ld %s: ", rank+1, (long)rogue.gold,
+ login_name);
if (other) {
switch(other) {
@@ -386,8 +390,9 @@ object *monster;
(void) strcpy(n_names[rank], n_name);
}
+boolean
is_vowel(ch)
-short ch;
+ short ch;
{
return( (ch == 'a') ||
(ch == 'e') ||
@@ -396,6 +401,7 @@ short ch;
(ch == 'u') );
}
+void
sell_pack()
{
object *obj;
@@ -428,12 +434,14 @@ sell_pack()
message("", 0);
}
+int
get_value(obj)
-object *obj;
+ object *obj;
{
short wc;
int val;
+ val = 0;
wc = obj->which_kind;
switch(obj->what_is) {
@@ -475,6 +483,7 @@ object *obj;
return(val);
}
+void
id_all()
{
short i;
@@ -496,8 +505,9 @@ id_all()
}
}
+int
name_cmp(s1, s2)
-char *s1, *s2;
+ char *s1, *s2;
{
short i = 0;
int r;
@@ -511,9 +521,10 @@ char *s1, *s2;
return(r);
}
+void
xxxx(buf, n)
-char *buf;
-short n;
+ char *buf;
+ short n;
{
short i;
unsigned char c;
@@ -529,7 +540,7 @@ short n;
long
xxx(st)
-boolean st;
+ boolean st;
{
static long f, s;
long r;
@@ -545,8 +556,9 @@ boolean st;
return(r);
}
+void
nickize(buf, score, n_name)
-char *buf, *score, *n_name;
+ char *buf, *score, *n_name;
{
short i = 15, j;
@@ -570,9 +582,10 @@ char *buf, *score, *n_name;
}
}
+void
center(row, buf)
-short row;
-char *buf;
+ short row;
+ char *buf;
{
short margin;
@@ -580,6 +593,7 @@ char *buf;
mvaddstr(row, margin, buf);
}
+void
sf_error()
{
md_lock(0);