From owner-freebsd-current@FreeBSD.ORG Mon Dec 29 09:23:47 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C12581065687; Mon, 29 Dec 2008 09:23:47 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 7510E8FC08; Mon, 29 Dec 2008 09:23:47 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 57E126D449; Mon, 29 Dec 2008 09:23:46 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 408C384443; Mon, 29 Dec 2008 10:23:46 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Hans Petter Selasky References: <20081222214010.GA18389@elvis.mu.org> <20081223151942.GP18389@elvis.mu.org> <86y6y6ubxc.fsf@ds4.des.no> <200812231736.29198.hselasky@c2i.net> Date: Mon, 29 Dec 2008 10:23:45 +0100 In-Reply-To: <200812231736.29198.hselasky@c2i.net> (Hans Petter Selasky's message of "Tue, 23 Dec 2008 17:36:28 +0100") Message-ID: <86d4fb72se.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org, current@freebsd.org, Alfred Perlstein Subject: Re: HEADSUP usb2 (usb4bsd) to become default in 2 weeks. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Dec 2008 09:23:47 -0000 Hans Petter Selasky 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