qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 2/8] ui: convert the SDL2 frontend to keycodemapd


From: Daniel P . Berrangé
Subject: Re: [Qemu-devel] [PULL 2/8] ui: convert the SDL2 frontend to keycodemapdb
Date: Thu, 1 Feb 2018 17:54:44 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Thu, Feb 01, 2018 at 12:37:26PM -0500, Paolo Bonzini wrote:
> On 01/02/2018 12:35, Daniel P. Berrangé wrote:
> > On Thu, Feb 01, 2018 at 12:28:02PM -0500, Paolo Bonzini wrote:
> >> On 25/01/2018 09:32, Gerd Hoffmann wrote:
> >>> --- a/include/ui/input.h
> >>> +++ b/include/ui/input.h
> >>> @@ -80,4 +80,7 @@ extern const guint16 qemu_input_map_qnum_to_qcode[];
> >>>  extern const guint qemu_input_map_qcode_to_linux_len;
> >>>  extern const guint16 qemu_input_map_qcode_to_linux[];
> >>
> >> Is there any reason to use the length variables rather than just
> >> ARRAY_SIZE()?  Coverity isn't able to see through the initializer and
> >> incorrectly complains that
> > 
> > ARRAY_SIZE can only be used if you can see the array variable
> > initialization, but this is the header file so all we have is
> > the extern declaration and thus the array size is unknown from
> > the places that need to use the _len variable.
> > 
> > We do in fact initalize the _len variable based on the ARRAY_SIZE,
> > but that's in the .c files.
> 
> Would it make sense for keymap-gen to also generate the header file, so
> that we can use an "extern const guint x[NNN]" declaration rather
> instead of "x[]"?

I could probably add such a feature to it....

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]