diff options
author | christos <christos@NetBSD.org> | 1997-10-19 16:56:41 +0000 |
---|---|---|
committer | christos <christos@NetBSD.org> | 1997-10-19 16:56:41 +0000 |
commit | 84e7d0704483ce39bbdeacd5e676168db6fa664f (patch) | |
tree | f9ffeffa1a4342e749494bc3f5618552435839af /hack/hack.rip.c | |
parent | f73f1009084e75624e3bc00fef9cf4749de80dcc (diff) | |
download | bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.tar.gz bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.tar.zst bsdgames-darwin-84e7d0704483ce39bbdeacd5e676168db6fa664f.zip |
WARNsify...
Diffstat (limited to 'hack/hack.rip.c')
-rw-r--r-- | hack/hack.rip.c | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/hack/hack.rip.c b/hack/hack.rip.c index ced3a27b..f9252d78 100644 --- a/hack/hack.rip.c +++ b/hack/hack.rip.c @@ -1,17 +1,18 @@ +/* $NetBSD: hack.rip.c,v 1.5 1997/10/19 16:58:53 christos Exp $ */ + /* * Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ +#include <sys/cdefs.h> #ifndef lint -static char rcsid[] = "$NetBSD: hack.rip.c,v 1.4 1995/03/23 08:31:23 cgd Exp $"; -#endif /* not lint */ +__RCSID("$NetBSD: hack.rip.c,v 1.5 1997/10/19 16:58:53 christos Exp $"); +#endif /* not lint */ -#include <stdio.h> #include "hack.h" +#include "extern.h" -extern char plname[]; - -static char *riptop= "\ +static char *riptop = "\ ----------\n\ / \\\n\ / REST \\\n\ @@ -19,14 +20,16 @@ static char *riptop= "\ / PEACE \\\n\ / \\"; -static char *ripmid = " | %*s%*s |\n"; +static char *ripmid = " | %*s%*s |\n"; -static char *ripbot = "\ +static char *ripbot = "\ *| * * * | *\n\ _________)/\\\\_//(\\/(/\\)/\\//\\/|_)_______"; -outrip(){ - char buf[BUFSZ]; +void +outrip() +{ + char buf[BUFSZ]; cls(); curs(1, 8); @@ -37,24 +40,26 @@ outrip(){ (void) sprintf(buf, "%ld AU", u.ugold); center(7, buf); (void) sprintf(buf, "killed by%s", - !strncmp(killer, "the ", 4) ? "" : - !strcmp(killer, "starvation") ? "" : - index(vowels, *killer) ? " an" : " a"); + !strncmp(killer, "the ", 4) ? "" : + !strcmp(killer, "starvation") ? "" : + strchr(vowels, *killer) ? " an" : " a"); center(8, buf); (void) strcpy(buf, killer); - { - register int i1; - if((i1 = strlen(buf)) > 16) { - register int i,i0; + { + int i1; + if ((i1 = strlen(buf)) > 16) { + int i, i0; i0 = i1 = 0; - for(i = 0; i <= 16; i++) - if(buf[i] == ' ') i0 = i, i1 = i+1; - if(!i0) i0 = i1 = 16; + for (i = 0; i <= 16; i++) + if (buf[i] == ' ') + i0 = i, i1 = i + 1; + if (!i0) + i0 = i1 = 16; buf[i1 + 16] = 0; buf[i0] = 0; } center(9, buf); - center(10, buf+i1); + center(10, buf + i1); } (void) sprintf(buf, "%4d", getyear()); center(11, buf); @@ -62,8 +67,11 @@ outrip(){ getret(); } -center(line, text) int line; char *text; { - register int n = strlen(text)/2; - printf(ripmid, 8+n, text, 8-n, ""); +void +center(line, text) + int line; + char *text; +{ + int n = strlen(text) / 2; + printf(ripmid, 8 + n, text, 8 - n, ""); } - |