Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Dec 2008 10:23:45 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-current@freebsd.org, current@freebsd.org, Alfred Perlstein <alfred@freebsd.org>
Subject:   Re: HEADSUP usb2 (usb4bsd) to become default in 2 weeks.
Message-ID:  <86d4fb72se.fsf@ds4.des.no>
In-Reply-To: <200812231736.29198.hselasky@c2i.net> (Hans Petter Selasky's message of "Tue, 23 Dec 2008 17:36:28 %2B0100")
References:  <20081222214010.GA18389@elvis.mu.org> <20081223151942.GP18389@elvis.mu.org> <86y6y6ubxc.fsf@ds4.des.no> <200812231736.29198.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hans Petter Selasky <hselasky@c2i.net> writes:
> LIBUSB20_ADD_BYTES() is a hack to circumvent things like un-constifying a=
nd=20
> making a byte increment to any pointer type. USB descriptors are byte-pac=
ked.=20
> I have tested the macro with several kinds of compilers and none have=20
> 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
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86d4fb72se.fsf>