From 80ac8c6d04c04ec1f892883397507f32292ae590 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 6 May 2009 09:42:48 -0700 Subject: Ansify prototypes and move extern declarations to header files Signed-off-by: Alan Coopersmith --- fd.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'fd.c') diff --git a/fd.c b/fd.c index af6c79b..9c7dffa 100644 --- a/fd.c +++ b/fd.c @@ -74,7 +74,6 @@ #include #include /* struct servent * and struct hostent * */ #include /* for EINTR, EADDRINUSE, ... */ -extern int errno; /* @@ -92,7 +91,7 @@ extern int errno; /* ************************************************************ */ void -InitializeFD() +InitializeFD(void) { register short i; @@ -145,11 +144,11 @@ InitializeFD() /* ************************************************************ */ void -UsingFD(fd, Handler, FlushHandler, trans_conn) - FD fd; - void (*Handler)(int); - void (*FlushHandler)(int); - XtransConnInfo trans_conn; +UsingFD( + FD fd, + void (*Handler)(int), + void (*FlushHandler)(int), + XtransConnInfo trans_conn) { if (FDD[fd].Busy) NotUsingFD(fd); @@ -178,8 +177,8 @@ UsingFD(fd, Handler, FlushHandler, trans_conn) /* ************************************************************ */ void -NotUsingFD(fd) - FD fd; +NotUsingFD( + FD fd) { debug(128,(stderr, "Not Using FD %d\n", fd)); @@ -207,8 +206,8 @@ XtransConnInfo GetXTransConnInfo(FD fd) /* ************************************************************ */ static void -EOFonFD(fd) - FD fd; +EOFonFD ( + FD fd) { enterprocedure("EOFonFD"); debug(128,(stderr, "EOF on %d\n", fd)); @@ -222,8 +221,8 @@ EOFonFD(fd) } FD -AcceptConnection (ConnectionSocket) - FD ConnectionSocket; +AcceptConnection ( + FD ConnectionSocket) { FD ClientFD; struct sockaddr_in from; @@ -265,17 +264,17 @@ AcceptConnection (ConnectionSocket) } FD -MakeConnection(server, port, report, trans_conn) - char *server; - short port; - int report; - XtransConnInfo *trans_conn; /* transport connection object */ +MakeConnection( + char *server, + short port, + int report, + XtransConnInfo *trans_conn /* transport connection object */ + ) { FD ServerFD; #ifdef USE_XTRANS char address[256]; int connect_stat; - extern long ServerBasePort; snprintf (address, sizeof(address), "%s:%d", server, port - ServerBasePort); if ( (*trans_conn = _X11TransOpenCOTSClient(address)) == NULL ) { @@ -404,9 +403,6 @@ MakeConnection(server, port, report, trans_conn) /* */ /* ************************************************************ */ -#include /* for EINTR, EADDRINUSE, ... */ -extern int errno; - int MainLoop(void) { -- cgit v1.2.1