From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJ4Z-0001gC-4w for qemu-devel@nongnu.org; Thu, 01 Feb 2018 12:54:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJ4W-0008G3-20 for qemu-devel@nongnu.org; Thu, 01 Feb 2018 12:54:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46320) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ehJ4V-0008ED-So for qemu-devel@nongnu.org; Thu, 01 Feb 2018 12:54:51 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0811DC0587DC for ; Thu, 1 Feb 2018 17:54:51 +0000 (UTC) Date: Thu, 1 Feb 2018 17:54:44 +0000 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Message-ID: <20180201175444.GY22810@redhat.com> Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= References: <20180125143218.29528-1-kraxel@redhat.com> <20180125143218.29528-3-kraxel@redhat.com> <65124689-6705-71ee-561c-8d4b25b30e16@redhat.com> <20180201173529.GX22810@redhat.com> <6199d545-e7ae-ad95-6695-a63a714cb45c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6199d545-e7ae-ad95-6695-a63a714cb45c@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 2/8] ui: convert the SDL2 frontend to keycodemapdb List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Gerd Hoffmann , qemu-devel@nongnu.org On Thu, Feb 01, 2018 at 12:37:26PM -0500, Paolo Bonzini wrote: > On 01/02/2018 12:35, Daniel P. Berrang=C3=A9 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 an= d > >> incorrectly complains that > >=20 > > 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. > >=20 > > We do in fact initalize the _len variable based on the ARRAY_SIZE, > > but that's in the .c files. >=20 > 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 --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :|