Date: Sun, 31 Jan 1999 22:00:09 -0800 From: Don Lewis <Don.Lewis@tsc.tdk.com> To: Poul-Henning Kamp <phk@critter.freebsd.dk>, current@FreeBSD.ORG Subject: Re: btokup().. patch to STYLE(9) (fwd) Message-ID: <199902010600.WAA07742@salsa.gv.tsc.tdk.com> In-Reply-To: Poul-Henning Kamp <phk@critter.freebsd.dk> "Re: btokup().. patch to STYLE(9) (fwd)" (Jan 29, 9:13am)
next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 29, 9:13am, Poul-Henning Kamp wrote:
} Subject: Re: btokup().. patch to STYLE(9) (fwd)
}
} On the other hand style(9) should still firmly outlaw stuff like:
}
} /* wait 10 ms */
} if (((error = tsleep((caddr_t)dev, PPBPRI | PCATCH,
} "ppbpoll", hz/100)) != EWOULDBLOCK) != 0) {
} return (error);
} }
The "!= 0" is obviously bogus, but what about:
if ((error = tsleep((caddr_t)dev, PPBPRI | PCATCH, "ppbpoll", hz/100))
!= EWOULDBLOCK) {
return (error);
}
It would be better if the "!=" fit on the previous line.
What if the expression fit on one 80 character line?
BTW, something I like that I picked up from Paul Vixie's code is indenting
all the arguments to a function by the same amount. Forcing an unneccesary
line wrap:
if ((error = tsleep((caddr_t)dev, PPBPRI | PCATCH,
"ppbpoll", hz/100)) != EWOULDBLOCK) {
return (error);
}
which isn't real clean because of the trailing "!= EWOULDBLOCK". The
downside of this style is that some arguments won't fit in the available
space or the argument list will occupy quite a few lines if the arguments
start too far to the right.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902010600.WAA07742>
