KNF. ANSI'fy.

This commit is contained in:
uebayasi 2009-03-09 16:19:22 +00:00
parent 143d2214bf
commit 7c002f258b
2 changed files with 26 additions and 57 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty_pty.c,v 1.115 2009/01/22 14:38:35 yamt Exp $ */
/* $NetBSD: tty_pty.c,v 1.116 2009/03/09 16:19:22 uebayasi Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.115 2009/01/22 14:38:35 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.116 2009/03/09 16:19:22 uebayasi Exp $");
#include "opt_ptm.h"
@ -273,8 +273,7 @@ pty_check(int ptn)
* new value of maxptys.
*/
int
pty_maxptys(newmax, set)
int newmax, set;
pty_maxptys(int newmax, int set)
{
if (!set)
return (maxptys);
@ -303,8 +302,7 @@ pty_maxptys(newmax, set)
* Establish n (or default if n is 1) ptys in the system.
*/
void
ptyattach(n)
int n;
ptyattach(int n)
{
mutex_init(&pt_softc_mutex, MUTEX_DEFAULT, IPL_NONE);
@ -380,10 +378,7 @@ ptsclose(dev_t dev, int flag, int mode, struct lwp *l)
}
int
ptsread(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
ptsread(dev_t dev, struct uio *uio, int flag)
{
struct proc *p = curproc;
struct pt_softc *pti = pt_softc[minor(dev)];
@ -444,10 +439,7 @@ again:
* indirectly, when tty driver calls ptsstart.
*/
int
ptswrite(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
ptswrite(dev_t dev, struct uio *uio, int flag)
{
struct pt_softc *pti = pt_softc[minor(dev)];
struct tty *tp = pti->pt_tty;
@ -461,10 +453,7 @@ ptswrite(dev, uio, flag)
* Poll pseudo-tty.
*/
int
ptspoll(dev, events, l)
dev_t dev;
int events;
struct lwp *l;
ptspoll(dev_t dev, int events, struct lwp *l)
{
struct pt_softc *pti = pt_softc[minor(dev)];
struct tty *tp = pti->pt_tty;
@ -480,8 +469,7 @@ ptspoll(dev, events, l)
* Wake up process polling or sleeping for input from controlling tty.
*/
void
ptsstart(tp)
struct tty *tp;
ptsstart(struct tty *tp)
{
struct pt_softc *pti = pt_softc[minor(tp->t_dev)];
@ -502,9 +490,7 @@ ptsstart(tp)
* Stop output.
*/
void
ptsstop(tp, flush)
struct tty *tp;
int flush;
ptsstop(struct tty *tp, int flush)
{
struct pt_softc *pti = pt_softc[minor(tp->t_dev)];
@ -530,9 +516,7 @@ ptsstop(tp, flush)
}
void
ptcwakeup(tp, flag)
struct tty *tp;
int flag;
ptcwakeup(struct tty *tp, int flag)
{
struct pt_softc *pti = pt_softc[minor(tp->t_dev)];
@ -594,10 +578,7 @@ ptcclose(dev_t dev, int flag, int devtype, struct lwp *l)
}
int
ptcread(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
ptcread(dev_t dev, struct uio *uio, int flag)
{
struct pt_softc *pti = pt_softc[minor(dev)];
struct tty *tp = pti->pt_tty;
@ -682,10 +663,7 @@ out:
int
ptcwrite(dev, uio, flag)
dev_t dev;
struct uio *uio;
int flag;
ptcwrite(dev_t dev, struct uio *uio, int flag)
{
struct pt_softc *pti = pt_softc[minor(dev)];
struct tty *tp = pti->pt_tty;
@ -802,10 +780,7 @@ out:
}
int
ptcpoll(dev, events, l)
dev_t dev;
int events;
struct lwp *l;
ptcpoll(dev_t dev, int events, struct lwp *l)
{
struct pt_softc *pti = pt_softc[minor(dev)];
struct tty *tp = pti->pt_tty;
@ -984,8 +959,7 @@ ptckqfilter(dev_t dev, struct knote *kn)
}
struct tty *
ptytty(dev)
dev_t dev;
ptytty(dev_t dev)
{
struct pt_softc *pti = pt_softc[minor(dev)];
struct tty *tp = pti->pt_tty;
@ -995,12 +969,7 @@ ptytty(dev)
/*ARGSUSED*/
int
ptyioctl(dev, cmd, data, flag, l)
dev_t dev;
u_long cmd;
void *data;
int flag;
struct lwp *l;
ptyioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
{
struct pt_softc *pti = pt_softc[minor(dev)];
struct tty *tp = pti->pt_tty;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tty_subr.c,v 1.35 2009/01/22 14:38:35 yamt Exp $ */
/* $NetBSD: tty_subr.c,v 1.36 2009/03/09 16:19:22 uebayasi Exp $ */
/*
* Copyright (c) 1993, 1994 Theo de Raadt
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tty_subr.c,v 1.35 2009/01/22 14:38:35 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: tty_subr.c,v 1.36 2009/03/09 16:19:22 uebayasi Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -75,7 +75,7 @@ clalloc(struct clist *clp, int size, int quot)
if (!clp->c_cs)
return (-1);
if(quot) {
if (quot) {
clp->c_cq = kmem_zalloc(QMEM(size), KM_SLEEP);
if (!clp->c_cq) {
kmem_free(clp->c_cs, size);
@ -95,9 +95,9 @@ clalloc(struct clist *clp, int size, int quot)
void
clfree(struct clist *clp)
{
if(clp->c_cs)
if (clp->c_cs)
kmem_free(clp->c_cs, clp->c_cn);
if(clp->c_cq)
if (clp->c_cq)
kmem_free(clp->c_cq, QMEM(clp->c_cn));
clp->c_cs = clp->c_cq = NULL;
}
@ -263,7 +263,7 @@ putc(int c, struct clist *clp)
#if defined(DIAGNOSTIC) || 1
printf("putc: required clalloc\n");
#endif
if(clalloc(clp, 1024, 1)) {
if (clalloc(clp, 1024, 1)) {
out:
splx(s);
return -1;
@ -307,7 +307,7 @@ clrbits(u_char *cp, int off, int len)
int i;
u_char mask;
if(len==1) {
if (len==1) {
clrbit(cp, off);
return;
}
@ -320,10 +320,10 @@ clrbits(u_char *cp, int off, int len)
mask = ((1 << (ebi - sbi)) - 1) << sbi;
cp[sby] &= ~mask;
} else {
mask = (1<<sbi) - 1;
mask = (1 << sbi) - 1;
cp[sby++] &= mask;
mask = (1<<ebi) - 1;
mask = (1 << ebi) - 1;
cp[eby] &= ~mask;
for (i = sby; i < eby; i++)
@ -355,7 +355,7 @@ b_to_q(const u_char *cp, int count, struct clist *clp)
#if defined(DIAGNOSTIC) || 1
printf("b_to_q: required clalloc\n");
#endif
if(clalloc(clp, 1024, 1))
if (clalloc(clp, 1024, 1))
goto out;
}
clp->c_cf = clp->c_cl = clp->c_cs;
@ -447,7 +447,7 @@ firstc(struct clist *clp, int *c)
return NULL;
cp = clp->c_cf;
*c = *cp & 0xff;
if(clp->c_cq) {
if (clp->c_cq) {
#ifdef QBITS
if (isset(clp->c_cq, cp - clp->c_cs))
*c |= TTY_QUOTE;