Re: Size-independent byte order swapping functions.

From: Pawel Jakub Dawidek (nick_at_garage.freebsd.pl)
Date: 11/25/03

  • Next message: Toni Andjelkovic: "Re: using devel/libusb to access USB"
    Date: Tue, 25 Nov 2003 09:38:26 +0100
    To: freebsd-hackers@FreeBSD.ORG
    
    
    

    On Mon, Nov 24, 2003 at 05:13:08PM -0800, David Schultz wrote:
    +> On Mon, Nov 24, 2003, Pawel Jakub Dawidek wrote:
    +> > If one is using strictly defined types as uint8_t, uint16_t, int32_t, etc.
    +> > those macros are helpful IMHO, because futher value size changes does not
    +> > affects code for byte order managing. This also does not hit perfromance,
    +> > because this should be resolved at compile-time.
    +>
    +> Cool, looks useful.
    +>
    +> > I'm not sure if dedicated epanic() is the best way to implement out-of-range
    +> > errors prevention - the more handy solution should cause compile error.
    +>
    +> See CTASSERT.

    I've tried, but you can't use CTASSERT() inside (?:).

    -- 
    Pawel Jakub Dawidek                       pawel@dawidek.net
    UNIX Systems Programmer/Administrator     http://garage.freebsd.pl
    Am I Evil? Yes, I Am!                     http://cerber.sourceforge.net
    
    



  • Next message: Toni Andjelkovic: "Re: using devel/libusb to access USB"

    Relevant Pages

    • Re: Size-independent byte order swapping functions.
      ... > those macros are helpful IMHO, because futher value size changes does not ... > affects code for byte order managing. ... > errors prevention - the more handy solution should cause compile error. ...
      (freebsd-hackers)
    • Size-independent byte order swapping functions.
      ... Macros in attached patch are designed for doing life a little easier. ... affects code for byte order managing. ... errors prevention - the more handy solution should cause compile error. ...
      (freebsd-hackers)