XRogue: convert to ANSI-style function declarations.

This commit is contained in:
John "Elwin" Edwards 2016-03-02 21:13:26 -05:00
parent e8e6e604c3
commit 2853120387
41 changed files with 1281 additions and 908 deletions

View file

@ -22,6 +22,8 @@
#include <string.h>
#include "rogue.h"
void doadd(char *fmt, va_list ap);
/*
* msg:
* Display a message at the top of the screen.
@ -77,7 +79,8 @@ addmsg(char *fmt, ...)
* player with the --More-- string. Then erase the message.
*/
rmmsg()
void
rmmsg(void)
{
if (mpos) {
wclear(msgw);
@ -96,7 +99,8 @@ rmmsg()
* is up there with the --More--)
*/
endmsg()
void
endmsg(void)
{
/* Needed to track where we are for 5.0 (PC) curses */
register int x, y;
@ -141,6 +145,7 @@ endmsg()
draw(msgw);
}
void
doadd(char *fmt, va_list ap)
{
vsprintf((char *) &msgbuf[newpos], fmt, ap);
@ -153,9 +158,8 @@ doadd(char *fmt, va_list ap)
* flgptr will be NULL if we don't know what the monster is yet!
*/
step_ok(y, x, can_on_monst, flgptr)
register int y, x, can_on_monst;
register struct thing *flgptr;
bool
step_ok(int y, int x, int can_on_monst, struct thing *flgptr)
{
/* can_on_monst = MONSTOK if all we care about are physical obstacles */
register struct linked_list *item;
@ -222,6 +226,7 @@ register struct thing *flgptr;
* returns true if it is ok for type to shoot over ch
*/
bool
shoot_ok(int ch)
{
switch (ch)
@ -240,10 +245,11 @@ shoot_ok(int ch)
/*
* status:
* Display the important stats line. Keep the cursor where it was.
* display: is TRUE, display unconditionally
*/
status(display)
bool display; /* is TRUE, display unconditionally */
void
status(bool display)
{
register struct stats *stat_ptr, *max_ptr;
register int oy = 0, ox = 0, temp;
@ -377,8 +383,8 @@ line_two:
* Sit around until the guy types the right key
*/
wait_for(ch)
register char ch;
void
wait_for(char ch)
{
register char c;
@ -407,10 +413,9 @@ register char ch;
* typed and then redraw the starting screen.
*/
over_win(oldwin, newin, maxy, maxx, cursory, cursorx, redraw)
WINDOW *oldwin, *newin;
int maxy, maxx, cursory, cursorx;
char redraw;
void
over_win(WINDOW *oldwin, WINDOW *newin, int maxy, int maxx, int cursory,
int cursorx, char redraw)
{
char blanks[LINELEN+1];
register int line, i;
@ -460,9 +465,8 @@ char redraw;
* function used to display a window and wait before returning
*/
show_win(scr, message)
register WINDOW *scr;
char *message;
void
show_win(WINDOW *scr, char *message)
{
mvwaddstr(scr, 0, 0, message);
touchwin(scr);
@ -477,9 +481,8 @@ char *message;
* 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);
@ -491,8 +494,8 @@ char *message;
* Restores the screen to the terminal
*/
restscr(scr)
WINDOW *scr;
void
restscr(WINDOW *scr)
{
clearok(scr,TRUE);
touchwin(scr);
@ -506,10 +509,7 @@ WINDOW *scr;
*/
unsigned long
netread(error, size, stream)
int *error;
int size;
FILE *stream;
netread(int *error, int size, FILE *stream)
{
unsigned long result = 0L, /* What we read in */
partial; /* Partial value */
@ -542,12 +542,13 @@ FILE *stream;
/*
* netwrite:
* Write out a byte, short, or long machine independently.
* value: What to write
* size: How much to write out
* stream: Where to write it
*/
netwrite(value, size, stream)
unsigned long value; /* What to write */
int size; /* How much to write out */
FILE *stream; /* Where to write it */
int
netwrite(unsigned long value, int size, FILE *stream)
{
int i; /* Goes through value one byte at a time */
char outc; /* The next character to be written */