From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk9Mq-0000DJ-As for qemu-devel@nongnu.org; Wed, 14 Sep 2016 08:32:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bk9Mm-0002Mh-3Q for qemu-devel@nongnu.org; Wed, 14 Sep 2016 08:32:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk9Ml-0002Ma-Tc for qemu-devel@nongnu.org; Wed, 14 Sep 2016 08:32:40 -0400 Date: Wed, 14 Sep 2016 13:32:36 +0100 From: "Daniel P. Berrange" Message-ID: <20160914123235.GN28399@redhat.com> Reply-To: "Daniel P. Berrange" References: <1470756748-18933-1-git-send-email-berrange@redhat.com> <1470756748-18933-12-git-send-email-berrange@redhat.com> <20160809162447.GM1530@redhat.com> <20160902211348.GG21771@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160902211348.GG21771@stefanha-x1.localdomain> Subject: Re: [Qemu-devel] [PATCH for-2.8 v1 11/60] trace: remove use of event ID enums from APIs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , qemu-devel@nongnu.org, Stefan Hajnoczi On Fri, Sep 02, 2016 at 05:13:48PM -0400, Stefan Hajnoczi wrote: > On Tue, Aug 09, 2016 at 06:26:49PM +0200, Paolo Bonzini wrote: > > > > > > On 09/08/2016 18:24, Daniel P. Berrange wrote: > > >>> > > -static inline TraceEventID trace_event_get_id(TraceEvent *ev) > > >>> > > +static inline size_t trace_event_get_id(TraceEvent *ev) > > >>> > > { > > >>> > > assert(ev != NULL); > > >>> > > return ev->id; > > >> > > > >> > Perhaps "unsigned" is a better match than size_t? > > > I don't mind either way - I just happen to personally always use size_t > > > for anything that ends up being used primarily as an array index. > > > > Makes sense. I was thinking of simpletrace's 32-bit id instead. > > I think unsigned is slightly clearer since it expresses the intent that > the values are limited to 32 bits. I'll switch to 'uint32_t' since that unambigously matches that simpletrace mandates. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|