ANSIfy + __dead

This commit is contained in:
joerg 2011-09-06 18:32:03 +00:00
parent 96c339267b
commit 68168df687
11 changed files with 73 additions and 98 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ctl.c,v 1.8 2009/04/13 23:43:36 lukem Exp $ */
/* $NetBSD: ctl.c,v 1.9 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)ctl.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: ctl.c,v 1.8 2009/04/13 23:43:36 lukem Exp $");
__RCSID("$NetBSD: ctl.c,v 1.9 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
/*
@ -64,7 +64,7 @@ int invitation_waiting = 0;
CTL_MSG msg;
void
open_sockt()
open_sockt(void)
{
socklen_t length;
@ -113,8 +113,7 @@ open_ctl()
/* print_addr is a debug print routine */
void
print_addr(addr)
struct sockaddr_in addr;
print_addr(struct sockaddr_in addr)
{
int i;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ctl_transact.c,v 1.10 2009/04/13 23:43:36 lukem Exp $ */
/* $NetBSD: ctl_transact.c,v 1.11 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)ctl_transact.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: ctl_transact.c,v 1.10 2009/04/13 23:43:36 lukem Exp $");
__RCSID("$NetBSD: ctl_transact.c,v 1.11 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
#include "talk.h"
@ -52,11 +52,7 @@ __RCSID("$NetBSD: ctl_transact.c,v 1.10 2009/04/13 23:43:36 lukem Exp $");
* of time
*/
void
ctl_transact(target, tmsg, type, rp)
struct in_addr target;
CTL_MSG tmsg;
int type;
CTL_RESPONSE *rp;
ctl_transact(struct in_addr target, CTL_MSG tmsg, int type, CTL_RESPONSE *rp)
{
struct pollfd set[1];
int nready, cc;

View File

@ -1,4 +1,4 @@
/* $NetBSD: display.c,v 1.8 2009/04/13 23:43:36 lukem Exp $ */
/* $NetBSD: display.c,v 1.9 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)display.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: display.c,v 1.8 2009/04/13 23:43:36 lukem Exp $");
__RCSID("$NetBSD: display.c,v 1.9 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
/*
@ -55,8 +55,7 @@ int curses_initialized = 0;
* a argument of the form --foo at least once.
*/
int
max(a,b)
int a, b;
max(int a, int b)
{
return (a > b ? a : b);
@ -67,10 +66,7 @@ max(a,b)
* characters while we are at it.
*/
void
display(win, text, size)
xwin_t *win;
char *text;
int size;
display(xwin_t *win, char *text, int size)
{
int i;
char cch;
@ -163,9 +159,7 @@ display(win, text, size)
* Read the character at the indicated position in win
*/
int
readwin(win, line, col)
WINDOW *win;
int line, col;
readwin(WINDOW *win, int line, int col)
{
int oldline, oldcol;
int c;
@ -182,9 +176,7 @@ readwin(win, line, col)
* so that the current position is obvious
*/
void
xscroll(win, flag)
xwin_t *win;
int flag;
xscroll(xwin_t *win, int flag)
{
if (flag == -1) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: get_addrs.c,v 1.9 2011/08/31 16:24:58 plunky Exp $ */
/* $NetBSD: get_addrs.c,v 1.10 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)get_addrs.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: get_addrs.c,v 1.9 2011/08/31 16:24:58 plunky Exp $");
__RCSID("$NetBSD: get_addrs.c,v 1.10 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
#include "talk.h"
@ -45,8 +45,7 @@ __RCSID("$NetBSD: get_addrs.c,v 1.9 2011/08/31 16:24:58 plunky Exp $");
#include "talk_ctl.h"
void
get_addrs(my_machine_name, his_machine_name)
const char *my_machine_name, *his_machine_name;
get_addrs(const char *my_machine_name, const char *his_machine_name)
{
struct hostent *hp;
struct servent *sp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: get_names.c,v 1.14 2009/04/13 23:43:36 lukem Exp $ */
/* $NetBSD: get_names.c,v 1.15 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)get_names.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: get_names.c,v 1.14 2009/04/13 23:43:36 lukem Exp $");
__RCSID("$NetBSD: get_names.c,v 1.15 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
#include "talk.h"
@ -51,9 +51,7 @@ extern CTL_MSG msg;
* Determine the local and remote user, tty, and machines
*/
void
get_names(argc, argv)
int argc;
char *argv[];
get_names(int argc, char *argv[])
{
char hostname[MAXHOSTNAMELEN + 1];
const char *his_name, *my_name;

View File

@ -1,4 +1,4 @@
/* $NetBSD: init_disp.c,v 1.11 2003/08/07 11:16:04 agc Exp $ */
/* $NetBSD: init_disp.c,v 1.12 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)init_disp.c 8.2 (Berkeley) 2/16/94";
#endif
__RCSID("$NetBSD: init_disp.c,v 1.11 2003/08/07 11:16:04 agc Exp $");
__RCSID("$NetBSD: init_disp.c,v 1.12 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
/*
@ -56,7 +56,7 @@ __RCSID("$NetBSD: init_disp.c,v 1.11 2003/08/07 11:16:04 agc Exp $");
* and build the various windows.
*/
void
init_display()
init_display(void)
{
struct sigaction sa;
@ -99,7 +99,7 @@ init_display()
* connection are the three edit characters.
*/
void
set_edit_chars()
set_edit_chars(void)
{
char buf[3];
int cc;
@ -127,8 +127,7 @@ set_edit_chars()
}
void
sig_sent(dummy)
int dummy;
sig_sent(int dummy)
{
message("Connection closing. Exiting");
@ -139,7 +138,7 @@ sig_sent(dummy)
* All done talking...hang up the phone and reset terminal thingy's
*/
void
quit()
quit(void)
{
if (curses_initialized) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: invite.c,v 1.8 2009/04/13 23:43:36 lukem Exp $ */
/* $NetBSD: invite.c,v 1.9 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)invite.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: invite.c,v 1.8 2009/04/13 23:43:36 lukem Exp $");
__RCSID("$NetBSD: invite.c,v 1.9 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
#include "talk.h"
@ -57,11 +57,11 @@ __RCSID("$NetBSD: invite.c,v 1.8 2009/04/13 23:43:36 lukem Exp $");
* These are used to delete the
* invitations.
*/
int local_id, remote_id;
jmp_buf invitebuf;
static int local_id, remote_id;
static jmp_buf invitebuf;
void
invite_remote()
invite_remote(void)
{
int new_sockt;
struct itimerval itimer;
@ -117,8 +117,7 @@ invite_remote()
* Routine called on interrupt to re-invite the callee
*/
void
re_invite(dummy)
int dummy;
re_invite(int dummy)
{
message("Ringing your party again");
@ -146,7 +145,7 @@ static const char *answers[] = {
* Transmit the invitation and process the response
*/
void
announce_invite()
announce_invite(void)
{
CTL_RESPONSE response;
@ -167,7 +166,7 @@ announce_invite()
* Tell the daemon to remove your invitation
*/
void
send_delete()
send_delete(void)
{
msg.type = DELETE;

View File

@ -1,4 +1,4 @@
/* $NetBSD: io.c,v 1.13 2009/04/13 23:43:36 lukem Exp $ */
/* $NetBSD: io.c,v 1.14 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: io.c,v 1.13 2009/04/13 23:43:36 lukem Exp $");
__RCSID("$NetBSD: io.c,v 1.14 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
/*
@ -58,7 +58,7 @@ __RCSID("$NetBSD: io.c,v 1.13 2009/04/13 23:43:36 lukem Exp $");
* The routine to do the actual talking
*/
void
talk()
talk(void)
{
struct pollfd set[2];
int nb;
@ -113,8 +113,7 @@ talk()
* on the screen and then exits. (i.e. a curses version of perror)
*/
void
p_error(string)
const char *string;
p_error(const char *string)
{
wmove(my_win.x_win, current_line%my_win.x_nlines, 0);
wprintw(my_win.x_win, "[%s : %s (%d)]\n",
@ -129,8 +128,7 @@ p_error(string)
* Display string in the standard location
*/
void
message(string)
const char *string;
message(const char *string)
{
wmove(my_win.x_win, current_line % my_win.x_nlines, 0);
wprintw(my_win.x_win, "[%s]", string);

View File

@ -1,4 +1,4 @@
/* $NetBSD: msgs.c,v 1.6 2009/04/13 23:43:36 lukem Exp $ */
/* $NetBSD: msgs.c,v 1.7 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)msgs.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: msgs.c,v 1.6 2009/04/13 23:43:36 lukem Exp $");
__RCSID("$NetBSD: msgs.c,v 1.7 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
/*
@ -53,14 +53,13 @@ const char *current_state;
int current_line = 0;
void
disp_msg(dummy)
int dummy;
disp_msg(int dummy)
{
message(current_state);
}
void
start_msgs()
start_msgs(void)
{
struct itimerval itimer;
@ -72,7 +71,7 @@ start_msgs()
}
void
end_msgs()
end_msgs(void)
{
struct itimerval itimer;

View File

@ -1,4 +1,4 @@
/* $NetBSD: talk.c,v 1.7 2008/07/21 14:19:26 lukem Exp $ */
/* $NetBSD: talk.c,v 1.8 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\
#if 0
static char sccsid[] = "@(#)talk.c 8.1 (Berkeley) 6/6/93";
#endif
__RCSID("$NetBSD: talk.c,v 1.7 2008/07/21 14:19:26 lukem Exp $");
__RCSID("$NetBSD: talk.c,v 1.8 2011/09/06 18:32:03 joerg Exp $");
#endif /* not lint */
#include "talk.h"
@ -59,12 +59,8 @@ __RCSID("$NetBSD: talk.c,v 1.7 2008/07/21 14:19:26 lukem Exp $");
* Modified to run under 4.1c by Peter Moore 3/17/83
*/
int main __P((int, char **));
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
setlocale(LC_ALL, "");

View File

@ -1,4 +1,4 @@
/* $NetBSD: talk.h,v 1.8 2009/04/13 23:43:36 lukem Exp $ */
/* $NetBSD: talk.h,v 1.9 2011/09/06 18:32:03 joerg Exp $ */
/*
* Copyright (c) 1983, 1993
@ -61,29 +61,29 @@ extern xwin_t my_win;
extern xwin_t his_win;
extern WINDOW *line_win;
void announce_invite __P((void));
int check_local __P((void));
void ctl_transact __P((struct in_addr, CTL_MSG, int, CTL_RESPONSE *));
void display __P((xwin_t *, char *, int));
void disp_msg __P((int));
void end_msgs __P((void));
void get_addrs __P((const char *, const char *));
void get_names __P((int, char **));
void init_display __P((void));
void invite_remote __P((void));
int look_for_invite __P((CTL_RESPONSE *));
int max __P((int, int));
void message __P((const char *));
void open_ctl __P((void));
void open_sockt __P((void));
void print_addr __P((struct sockaddr_in));
void p_error __P((const char *));
void quit __P((void));
int readwin __P((WINDOW *, int, int));
void re_invite __P((int));
void send_delete __P((void));
void set_edit_chars __P((void));
void sig_sent __P((int));
void start_msgs __P((void));
void talk __P((void));
void xscroll __P((xwin_t *, int));
void announce_invite(void);
int check_local(void);
void ctl_transact(struct in_addr, CTL_MSG, int, CTL_RESPONSE *);
void display(xwin_t *, char *, int);
void disp_msg(int);
void end_msgs(void);
void get_addrs(const char *, const char *);
void get_names(int, char **);
void init_display(void);
void invite_remote(void);
int look_for_invite(CTL_RESPONSE *);
int max(int, int);
void message(const char *);
void open_ctl(void);
void open_sockt(void);
void print_addr(struct sockaddr_in);
void p_error(const char *) __dead;
void quit(void) __dead;
int readwin(WINDOW *, int, int);
void re_invite(int) __dead;
void send_delete(void);
void set_edit_chars(void);
void sig_sent(int) __dead;
void start_msgs(void);
void talk(void) __dead;
void xscroll(xwin_t *, int);