cvs commit: src/sys/kern sched_ule.c

Max Laier max at love2party.net
Sat Mar 17 20:00:23 UTC 2007


On Saturday 17 March 2007 20:09, Jeff Roberson wrote:
> Any language lawyers care to comment on this?

I find this strange.  According to the spec "(Decrementing is equivalent 
to subtracting 1.)", but "pri = --pri % RQ_NQS;" will behave like you 
expect, while "pri = (pri - 1) % RQ_NQS;" clearly didn't.

> On Sat, 17 Mar 2007, Jeff Roberson wrote:
> > jeff        2007-03-17 18:13:33 UTC
> >
> >  FreeBSD src repository
> >
> >  Modified files:
> >    sys/kern             sched_ule.c
> >  Log:
> >   - Cast the intermediate value in priority computtion back down to
> >     unsigned char.  Weirdly, casting the 1 constant to u_char still
> > produces a signed integer result that is then used in the %
> > computation.  This avoids that mess all together and causes a 0 pri
> > to turn into 255 % 64 as we expect.
> >
> >  Reported by:    kkenn (about 4 times, thanks)
> >
> >  Revision  Changes    Path
> >  1.190     +1 -1      src/sys/kern/sched_ule.c

-- 
/"\  Best regards,                      | mlaier at freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier at EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20070317/6f9efb70/attachment.pgp


More information about the cvs-src mailing list