[nas] [patch] more ansification
Stefan Huehner
stefan at huehner.org
Sat Jul 15 16:29:21 MDT 2006
Hi,
attached patch convert more K&R style C to ANSI C in server/os.
Regards,
Stefan
-------------- next part --------------
Index: server/os/connection.c
===================================================================
--- server/os/connection.c (revision 153)
+++ server/os/connection.c (working copy)
@@ -410,8 +410,7 @@
Bool EstablishNewConnections();
static int
-MNX_open_tcp_socket (extra_fd)
-int *extra_fd;
+MNX_open_tcp_socket (int *extra_fd)
{
int fd, r, flags, retry;
char *tcp_dev, *check;
@@ -630,8 +629,7 @@
#if !defined(SVR4) || defined(SVR4_ACP)
static int
-connect_spipe(fd1, fd2)
- int fd1, fd2;
+connect_spipe(int fd1, int fd2)
{
long temp;
struct strfdinsert sbuf;
@@ -651,9 +649,7 @@
}
static int
-named_spipe(fd, path)
- int fd;
- char *path;
+named_spipe(int fd, char *path)
{
int oldUmask, ret;
struct stat sbuf;
@@ -1318,13 +1314,7 @@
}
static void
-AuthAudit (client, letin, saddr, len, proto_n, auth_proto)
- int client;
- Bool letin;
- struct sockaddr *saddr;
- int len;
- unsigned short proto_n;
- char *auth_proto;
+AuthAudit (int client, Bool letin, struct sockaddr *saddr, int len, unsigned short proto_n, char *auth_proto)
{
char addr[128];
@@ -1587,8 +1577,7 @@
************/
static void
-ErrorConnMax(fd)
- register int fd;
+ErrorConnMax(register int fd)
{
auConnSetupPrefix csp;
char pad[3];
@@ -1666,8 +1655,7 @@
#ifndef _MINIX
static void
-CloseDownFileDescriptor(oc)
- register OsCommPtr oc;
+CloseDownFileDescriptor(register OsCommPtr oc)
{
int connection = oc->fd;
@@ -2060,8 +2048,7 @@
}
static void
-CloseDownFileDescriptor(oc)
- register OsCommPtr oc;
+CloseDownFileDescriptor(register OsCommPtr oc)
{
int connection = oc->fd;
int i;
@@ -2501,8 +2488,7 @@
* Wakeup main thread if necessary
*/
static void
-UnblockMain(oc)
- register OsCommPtr oc;
+UnblockMain(reguster OsCommPtr oc)
{
if ((oc->status & IGNORE) == 0) {
WakeUpMainThread();
@@ -2510,8 +2496,7 @@
}
static char *
-OsCommFamily(family)
- int family;
+OsCommFamily(int family)
{
switch (family) {
case FamilyAmoeba:
@@ -2523,8 +2508,7 @@
}
static char *
-OsCommStatus(status)
- int status;
+OsCommStatus(int status)
{
static char buf[100];
@@ -2715,10 +2699,7 @@
}
static void
-TcpIpReaderSignalCatcher(sig, us, extra)
- signum sig;
- thread_ustate *us;
- char *extra;
+TcpIpReaderSignalCatcher(signum sig, thread_ustate *us, char *extra)
{
register OsCommPtr oc = (OsCommPtr) extra;
@@ -2735,9 +2716,7 @@
* TCP/IP reader thread
*/
static void
-TcpIpReaderThread(argptr, argsize)
- void *argptr;
- int argsize;
+TcpIpReaderThread(void *argptr, argsize argsize)
{
register OsCommPtr oc;
@@ -2783,7 +2762,7 @@
* thread prevents the main loop from blocking when there's no data.
*/
static void
-AmoebaTCPConnectorThread()
+AmoebaTCPConnectorThread(void)
{
capability svrcap, chancap;
nwio_tcpconf_t tcpconf;
Index: server/os/access.c
===================================================================
--- server/os/access.c (revision 153)
+++ server/os/access.c (working copy)
@@ -144,10 +144,7 @@
#if defined(SVR4) || defined(ISC)
/* ifioctl() for SVR4 from Ian Donaldson <iand at labtam.labtam.oz.au> */
static int
-ifioctl (fd, cmd, arg)
- int fd;
- int cmd;
- char *arg;
+ifioctl (int fd, int cmd, char *arg)
{
struct strioctl ioc;
int ret;
@@ -196,7 +193,7 @@
#endif /* SVR4 || ISC */
static int ConvertAddr(), CheckAddr();
-static Bool NewHost();
+static Bool NewHost (short family, pointer addr, int len);
typedef struct _host {
short family;
@@ -580,8 +577,7 @@
}
static Bool
-AuthorizedClient(client)
- ClientPtr client;
+AuthorizedClient(ClientPtr client)
{
int family;
socklen_t alen;
@@ -699,10 +695,7 @@
/* Add a host to the access control list. This is the internal interface
* called when starting or resetting the server */
static Bool
-NewHost (family, addr, len)
- short family;
- pointer addr;
- int len;
+NewHost (short family, pointer addr, int len)
{
register HOST *host;
@@ -818,10 +811,7 @@
/*ARGSUSED*/
static int
-CheckAddr (family, pAddr, length)
- int family;
- pointer pAddr;
- unsigned length;
+CheckAddr (int family, pointer pAddr, unsigned length)
{
int len;
Index: server/os/io.c
===================================================================
--- server/os/io.c (revision 153)
+++ server/os/io.c (working copy)
@@ -748,7 +748,7 @@
#ifndef AMOEBA
static ConnectionInputPtr
-AllocateInputBuffer()
+AllocateInputBuffer(void)
{
register ConnectionInputPtr oci;
@@ -769,7 +769,7 @@
}
static ConnectionOutputPtr
-AllocateOutputBuffer()
+AllocateOutputBuffer(void)
{
register ConnectionOutputPtr oco;
Index: server/os/WaitFor.c
===================================================================
--- server/os/WaitFor.c (revision 153)
+++ server/os/WaitFor.c (working copy)
@@ -383,8 +383,7 @@
}
static int
-SleepMainThread(timo)
- interval timo;
+SleepMainThread(interval timo)
{
return (sema_trydown(&main_sema, timo) == 0) ? 0 : -1;
@@ -660,9 +659,7 @@
}
static int
-timed_fwait(fwp, tvp)
-struct fwait *fwp;
-struct timeval *tvp;
+timed_fwait(struct fwait *fwp, struct timeval *tvp)
{
struct timeval tv;
int r;
Index: server/os/genalloca.c
===================================================================
--- server/os/genalloca.c (revision 153)
+++ server/os/genalloca.c (working copy)
@@ -76,7 +76,7 @@
#define STACK_DIR stack_dir
static void
-find_stack_direction (/* void */)
+find_stack_direction (void)
{
static char *addr = NULL; /* address of first
`dummy', once known */
More information about the Nas
mailing list