From owner-p4-projects@FreeBSD.ORG Tue Aug 11 07:57:28 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 017771065673; Tue, 11 Aug 2009 07:57:28 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2BA6106566B; Tue, 11 Aug 2009 07:57:27 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.swip.net [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id 1F11F8FC2B; Tue, 11 Aug 2009 07:57:26 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=8kq7sC2nJEMA:10 a=hlIU1J3LQChSjWV/CGRL5g==:17 a=9XHMQrXkheRothPeSJ0A:9 a=PoJaZNCj66FC4aB3vcWrCyqGg8MA:4 Received: from [193.217.167.6] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 1120686282; Tue, 11 Aug 2009 08:57:22 +0200 From: Hans Petter Selasky To: Sylvestre Gallon Date: Tue, 11 Aug 2009 08:57:27 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-BETA2; KDE/4.2.4; i386; ; ) References: <200908101921.n7AJLbUb077185@repoman.freebsd.org> In-Reply-To: <200908101921.n7AJLbUb077185@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908110857.28422.hselasky@c2i.net> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 167185 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2009 07:57:29 -0000 On Monday 10 August 2009 21:21:37 Sylvestre Gallon wrote: > +#define SAFE_OPS(fops, field, err) \ > + if (fops->field == NULL) \ > + err = generic_roothub_fops.field(sc, &len, &value, &index); > \ + else \ > + err = fops->field(sc, &len, &value, &index) > + There is another way you can solve this at compile time! #define USB_RHUB_SAFE_OPS \ .fieldxxx = , .fieldyyy = , struct usb_root_hub_ops table = { USB_ROOT_HUB_SAFE_OPS, .fieldxxx = , /* override */ }; This almost sounds like virtuals in C. Please check what the C99 standard says about initialising the same field multiple times. --HPS