From: Wei Liu Subject: Re: [PATCH V3] xl: create VFB for PV guest when VNC is specified Date: Tue, 17 Dec 2013 21:51:20 +0000 Message-ID: <20131217215120.GA17825@zion.uk.xensource.com> References: <52B0373D.1080602@citrix.com> <20131217114044.GD26994@zion.uk.xensource.com> <1387280489.27441.54.camel@kazak.uk.xensource.com> <20131217114948.GE26994@zion.uk.xensource.com> <21168.26479.367333.933990@mariner.uk.xensource.com> <20131217151602.GA6093@zion.uk.xensource.com> <21168.30890.498488.182257@mariner.uk.xensource.com> <1387298446.1025.8.camel@dagon.hellion.org.uk> <20131217165259.GB7098@zion.uk.xensource.com> <21168.37450.605599.194313@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <21168.37450.605599.194313@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Andrew Cooper , Wei Liu , Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, Dec 17, 2013 at 06:04:58PM +0000, Ian Jackson wrote: [...] > As I've said I think evaluating the arguments multiple times is > better. After all they have to be lvalues. > > So I would do: > > #define ARRAY_EXTEND_INIT(array,count,initfn) \ > ({ \ > typeof((count)) array_extend_old_count = (count); \ > (count)++; \ > (array) = xrealloc((array), sizeof(*array) * (count)); \ > (initfn)(&(array)[array_extend_old_count]); \ > &(array)[array_extend_old_count]; \ > }) > I will take this macro. I don't really have strong opinion on macro tricks. If you think this is better so be it. The way this macro is written does affect the core fuctionality of this patch anyway. :-) Wei.