>>>>> "JP" == Joerg Plate <[EMAIL PROTECTED]> writes:

  >> const int slot = (reg_alloc + 7) >> 3; reg_alloc = slot << 3;

  >> This is where I start not to understand.  Why reg_alloc + 7? Why
  >> shift left and right by 3?

  JP> That's just a rounding up (if necessary) to a multiple of 8 (2<<3).

and those sort of things should be macros as they are confusing
otherwise and annoying to change. and named something like
ROUND_UP_TO_BOUNDARY. as others have said it is a common idiom. and i
agree that there should be comments on WHY the rounding is used/needed.

uri, an expired c hacker recalling painful issues :)

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to