cvs commit: src/sys/sparc64/include endian.h src/sys/sun4v/include endian.h

Marius Strobl marius at FreeBSD.org
Mon Oct 30 21:50:21 UTC 2006


marius      2006-10-30 21:50:11 UTC

  FreeBSD src repository

  Modified files:
    sys/sparc64/include  endian.h 
    sys/sun4v/include    endian.h 
  Log:
  In the replacement text of the __bswapN_const() macros encapsulate the
  argument in parentheses so these macros are safe to use and invocations
  with an expression as the argument like __bswap32_const(42 << 23 | 13)
  work as expected. Additionally, mask all the individually shifted bytes
  as appropriate so the bytes which exceed the width of the respective
  __bswapN_const() macro in invocations like __bswap16_const(0xdead600d)
  are ignored like it's the case with the corresponding __bswapN_var()
  function.
  
  MFC after:      3 days
  
  Revision  Changes    Path
  1.16      +12 -8     src/sys/sparc64/include/endian.h
  1.2       +12 -8     src/sys/sun4v/include/endian.h


More information about the cvs-src mailing list