Super-Rogue: convert to ANSI-style function declarations.

This fixes most of the build warnings.
This commit is contained in:
John "Elwin" Edwards 2016-01-31 13:45:07 -05:00
parent 0f87d5b4d8
commit 59f448e92e
33 changed files with 783 additions and 518 deletions

View file

@ -20,7 +20,7 @@
#include "rogue.h"
#include "rogue.ext"
int md_readchar(WINDOW *win);
void doadd(char *fmt, va_list ap);
/*
* msg:
@ -29,6 +29,7 @@ int md_readchar(WINDOW *win);
static char msgbuf[BUFSIZ];
static int newpos = 0;
void
msg(char *fmt, ...)
{
va_list ap;
@ -54,6 +55,7 @@ msg(char *fmt, ...)
* addmsg:
* Add things to the current message
*/
void
addmsg(char *fmt, ...)
{
va_list ap;
@ -68,7 +70,8 @@ addmsg(char *fmt, ...)
* Display a new msg, giving him a chance to see the
* previous one if it is up there with the --More--
*/
endmsg()
void
endmsg(void)
{
strcpy(huh, msgbuf);
if (mpos > 0) {
@ -88,6 +91,7 @@ endmsg()
* doadd:
* Perform a printf into a buffer
*/
void
doadd(char *fmt, va_list ap)
{
vsprintf(&msgbuf[newpos], fmt, ap);
@ -98,8 +102,8 @@ doadd(char *fmt, va_list ap)
* step_ok:
* Returns TRUE if it is ok to step on ch
*/
step_ok(ch)
unsigned char ch;
bool
step_ok(unsigned char ch)
{
if (dead_end(ch))
return FALSE;
@ -113,8 +117,8 @@ unsigned char ch;
* dead_end:
* Returns TRUE if you cant walk through that character
*/
dead_end(ch)
char ch;
bool
dead_end(char ch)
{
if (ch == '-' || ch == '|' || ch == ' ' || ch == SECRETDOOR)
return TRUE;
@ -129,7 +133,8 @@ char ch;
* getchar.
*/
readchar()
int
readchar(void)
{
char c;
@ -148,8 +153,8 @@ char *hungstr[] = {
* status:
* Display the important stats line. Keep the cursor where it was.
*/
status(fromfuse)
int fromfuse;
void
status(int fromfuse)
{
reg int totwght, carwght;
reg struct real *stef, *stre, *stmx;
@ -220,7 +225,8 @@ int fromfuse;
* dispmax:
* Display the hero's maximum status
*/
dispmax()
void
dispmax(void)
{
reg struct real *hmax;
@ -233,8 +239,8 @@ dispmax()
* illeg_ch:
* Returns TRUE if a char shouldn't show on the screen
*/
illeg_ch(ch)
unsigned char ch;
bool
illeg_ch(unsigned char ch)
{
if (ch < 32 || ch > 127)
return TRUE;
@ -247,9 +253,8 @@ unsigned char ch;
* wait_for:
* Sit around until the guy types the right key
*/
wait_for(win,ch)
WINDOW *win;
char ch;
void
wait_for(WINDOW *win, char ch)
{
register char c;
@ -293,9 +298,8 @@ gettime()
* dbotline:
* Displays message on bottom line and waits for a space to return
*/
dbotline(scr,message)
WINDOW *scr;
char *message;
void
dbotline(WINDOW *scr, char *message)
{
mvwaddstr(scr,LINES-1,0,message);
draw(scr);
@ -307,8 +311,8 @@ char *message;
* restscr:
* Restores the screen to the terminal
*/
restscr(scr)
WINDOW *scr;
void
restscr(WINDOW *scr)
{
clearok(scr,TRUE);
touchwin(scr);
@ -318,8 +322,8 @@ WINDOW *scr;
* npch:
* Get the next char in line for inventories
*/
npch(ch)
char ch;
char
npch(char ch)
{
reg char nch;
if (ch >= 'z')