Re: HEADSUP usb2 (usb4bsd) to become default in 2 weeks.

[ Available lists | Index of freebsd-current | Month of Dec 2008 | Week of 29 Dec 2008 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Dag-Erling Smørgrav <des@des.no>
Date
29 Dec 2008 09:23:47
Subject
Re: HEADSUP usb2 (usb4bsd) to become default in 2 weeks.
Message-ID
86d4fb72se.fsf@ds4.des.no


[ Hide this part ]
Hans Petter Selasky <hselasky@c2i.net> writes:
> LIBUSB20_ADD_BYTES() is a hack to circumvent things like un-constifying and
> making a byte increment to any pointer type. USB descriptors are byte-packed.
> I have tested the macro with several kinds of compilers and none have
> complained yet.

1) if you need to de-constify, your API is broken.

2) just because the compiler doesn't know it's wrong doesn't mean it
isn't.

3) the pointer magic you do in (for instance) libusb20_me_encode() and
libusb20_me_decode() won't work on strict-alignment platforms.

DES
--
Dag-Erling Smrgrav - des@des.no


Elapsed time: 0.313 seconds