switch source tree from k&r to c99
This commit is contained in:
@@ -131,7 +131,7 @@ struct tchars inittyb2, curttyb2;
|
||||
* used unconditionally because it conflicts with the 'bool' one.
|
||||
*/
|
||||
#ifdef NEED_HAS_COLORS_DECL
|
||||
int has_colors();
|
||||
int has_colors(void);
|
||||
#endif
|
||||
|
||||
#if defined(TTY_GRAPHICS) && ((!defined(SYSV) && !defined(HPUX)) \
|
||||
@@ -154,8 +154,7 @@ struct termstruct inittyb, curttyb;
|
||||
|
||||
#ifdef POSIX_TYPES
|
||||
static int
|
||||
speednum(speed)
|
||||
speed_t speed;
|
||||
speednum(speed_t speed)
|
||||
{
|
||||
switch (speed) {
|
||||
case B0:
|
||||
@@ -197,7 +196,7 @@ speed_t speed;
|
||||
#endif
|
||||
|
||||
static void
|
||||
setctty()
|
||||
setctty(void)
|
||||
{
|
||||
if (STTY(&curttyb) < 0 || STTY2(&curttyb2) < 0)
|
||||
perror("NetHack (setctty)");
|
||||
@@ -209,7 +208,7 @@ setctty()
|
||||
* Called by startup() in termcap.c and after returning from ! or ^Z
|
||||
*/
|
||||
void
|
||||
gettty()
|
||||
gettty(void)
|
||||
{
|
||||
if (GTTY(&inittyb) < 0 || GTTY2(&inittyb2) < 0)
|
||||
perror("NetHack (gettty)");
|
||||
@@ -231,8 +230,7 @@ gettty()
|
||||
|
||||
/* reset terminal to original state */
|
||||
void
|
||||
settty(s)
|
||||
const char *s;
|
||||
settty(const char *s)
|
||||
{
|
||||
end_screen();
|
||||
if (s)
|
||||
@@ -247,7 +245,7 @@ const char *s;
|
||||
}
|
||||
|
||||
void
|
||||
setftty()
|
||||
setftty(void)
|
||||
{
|
||||
unsigned ef, cf;
|
||||
int change = 0;
|
||||
@@ -314,7 +312,7 @@ setftty()
|
||||
start_screen();
|
||||
}
|
||||
|
||||
void intron() /* enable kbd interupts if enabled when game started */
|
||||
void intron(void) /* enable kbd interupts if enabled when game started */
|
||||
{
|
||||
#ifdef TTY_GRAPHICS
|
||||
/* Ugly hack to keep from changing tty modes for non-tty games -dlc */
|
||||
@@ -326,7 +324,7 @@ void intron() /* enable kbd interupts if enabled when game started */
|
||||
#endif
|
||||
}
|
||||
|
||||
void introff() /* disable kbd interrupts if required*/
|
||||
void introff(void) /* disable kbd interrupts if required*/
|
||||
{
|
||||
#ifdef TTY_GRAPHICS
|
||||
/* Ugly hack to keep from changing tty modes for non-tty games -dlc */
|
||||
@@ -349,13 +347,13 @@ int sco_flag_console = 0;
|
||||
int sco_map_valid = -1;
|
||||
unsigned char sco_chanmap_buf[BSIZE];
|
||||
|
||||
void NDECL(sco_mapon);
|
||||
void NDECL(sco_mapoff);
|
||||
void NDECL(check_sco_console);
|
||||
void NDECL(init_sco_cons);
|
||||
void sco_mapon(void);
|
||||
void sco_mapoff(void);
|
||||
void check_sco_console(void);
|
||||
void init_sco_cons(void);
|
||||
|
||||
void
|
||||
sco_mapon()
|
||||
sco_mapon(void)
|
||||
{
|
||||
#ifdef TTY_GRAPHICS
|
||||
if (WINDOWPORT("tty") && sco_flag_console) {
|
||||
@@ -368,7 +366,7 @@ sco_mapon()
|
||||
}
|
||||
|
||||
void
|
||||
sco_mapoff()
|
||||
sco_mapoff(void)
|
||||
{
|
||||
#ifdef TTY_GRAPHICS
|
||||
if (WINDOWPORT("tty") && sco_flag_console) {
|
||||
@@ -381,7 +379,7 @@ sco_mapoff()
|
||||
}
|
||||
|
||||
void
|
||||
check_sco_console()
|
||||
check_sco_console(void)
|
||||
{
|
||||
if (isatty(0) && ioctl(0, CONS_GET, 0) != -1) {
|
||||
sco_flag_console = 1;
|
||||
@@ -389,7 +387,7 @@ check_sco_console()
|
||||
}
|
||||
|
||||
void
|
||||
init_sco_cons()
|
||||
init_sco_cons(void)
|
||||
{
|
||||
#ifdef TTY_GRAPHICS
|
||||
if (WINDOWPORT("tty") && sco_flag_console) {
|
||||
@@ -413,13 +411,13 @@ init_sco_cons()
|
||||
|
||||
int linux_flag_console = 0;
|
||||
|
||||
void NDECL(linux_mapon);
|
||||
void NDECL(linux_mapoff);
|
||||
void NDECL(check_linux_console);
|
||||
void NDECL(init_linux_cons);
|
||||
void linux_mapon(void);
|
||||
void linux_mapoff(void);
|
||||
void check_linux_console(void);
|
||||
void init_linux_cons(void);
|
||||
|
||||
void
|
||||
linux_mapon()
|
||||
linux_mapon(void)
|
||||
{
|
||||
#ifdef TTY_GRAPHICS
|
||||
if (WINDOWPORT("tty") && linux_flag_console) {
|
||||
@@ -429,7 +427,7 @@ linux_mapon()
|
||||
}
|
||||
|
||||
void
|
||||
linux_mapoff()
|
||||
linux_mapoff(void)
|
||||
{
|
||||
#ifdef TTY_GRAPHICS
|
||||
if (WINDOWPORT("tty") && linux_flag_console) {
|
||||
@@ -439,7 +437,7 @@ linux_mapoff()
|
||||
}
|
||||
|
||||
void
|
||||
check_linux_console()
|
||||
check_linux_console(void)
|
||||
{
|
||||
struct vt_mode vtm;
|
||||
|
||||
@@ -449,7 +447,7 @@ check_linux_console()
|
||||
}
|
||||
|
||||
void
|
||||
init_linux_cons()
|
||||
init_linux_cons(void)
|
||||
{
|
||||
#ifdef TTY_GRAPHICS
|
||||
if (WINDOWPORT("tty") && linux_flag_console) {
|
||||
@@ -466,20 +464,19 @@ init_linux_cons()
|
||||
|
||||
#ifndef __begui__ /* the Be GUI will define its own error proc */
|
||||
/* fatal error */
|
||||
/*VARARGS1*/
|
||||
void error
|
||||
VA_DECL(const char *, s)
|
||||
void
|
||||
error(const char *s, ...)
|
||||
{
|
||||
VA_START(s);
|
||||
VA_INIT(s, const char *);
|
||||
va_list the_args;
|
||||
|
||||
va_start(the_args, s);
|
||||
if (iflags.window_inited)
|
||||
exit_nhwindows((char *) 0); /* for tty, will call settty() */
|
||||
if (settty_needed)
|
||||
settty((char *) 0);
|
||||
Vprintf(s, VA_ARGS);
|
||||
Vprintf(s, the_args);
|
||||
(void) putchar('\n');
|
||||
VA_END();
|
||||
va_end(the_args);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif /* !__begui__ */
|
||||
|
||||
Reference in New Issue
Block a user