DragonFly BSD
DragonFly commits List (threaded) for 2005-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sbin/route route.c


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Wed, 16 Mar 2005 06:34:44 +0100
Mail-followup-to: commits@crater.dragonflybsd.org

On Tue, Mar 15, 2005 at 09:21:36PM -0800, Chris Pressey wrote:
> > I think that should be
> > 
> >   splim = (u_short *)sa->sa_data +
> >       (sa->sa_len - offsetof(sa->sa_data)) / sizeof(u_short);
> > 
> > but that'd be the same as the thing I committed, just longer.
> 
> (With the exception of the "+ 1", which AFAICT is there so that the
> division by sizeof(u_short) (or ">> 1" in the old version) doesn't cut
> off the last short if sa_len is odd...)

You are right with the versions being functionally identical.
The compiler should create the same code, the difference is
which the limit is based on.

What I meant about the u_short usage is, that the hex printing should be
done byte wise, not word wise.

Joerg



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]