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 majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to