On Tue, 16 Nov 1999, Pierre Beyssac wrote:
> On Tue, Nov 16, 1999 at 03:17:43PM +1100, Bruce Evans wrote:
> > On Mon, 15 Nov 1999, Pierre Beyssac wrote:
> > > - volatile u_short answer = 0;
> > > + union {
> > > + u_int16_t us;
> > > + u_int8_t uc[2];
> > > + } answer;
> >
> > This has indentation bugs.
>
> Uh, which one(s) do you mean exactly? The 4-space indented union
> (I just followed style(9)) or the double space before uc[2] (it
> was just to align us and uc vertically)?
See Sheldon's reply. u_int16_t and u_int8_t are too wide for the
normal indentation rules to apply. Various inconsistent formattings
are used for them. E.g., in Lite2, <ufs/ufs/dir.h> uses an extra space
in one struct and an extra tab in the others. This is another reason
to use u_short :-).
> > ping.c still assumes that u_short is u_int16_t everywhere else.
>
> But in_cksum() is more or less self-contained. Probably it's more
> consistent (even withing in_cksum which uses u_short elsewhere) to
> change back the union to u_short and u_char, though.
There are better examples to copy in the kernel. They still use too
many shorts, ints and union hacks, however. The alpha version is
most interesting.
Bruce
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message