HEADSUP usb2 (usb4bsd) to become default in 2 weeks.
Dag-Erling Smørgrav
des at des.no
Mon Dec 29 09:23:47 UTC 2008
Hans Petter Selasky <hselasky at 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 Smørgrav - des at des.no
More information about the freebsd-current
mailing list