From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWChT-000290-Fu for qemu-devel@nongnu.org; Sun, 30 Aug 2015 20:11:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWChQ-0004ie-9Y for qemu-devel@nongnu.org; Sun, 30 Aug 2015 20:11:51 -0400 Received: from domu-toccata.ens-lyon.fr ([140.77.166.138]:38948 helo=sonata.ens-lyon.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWChQ-0004hU-2N for qemu-devel@nongnu.org; Sun, 30 Aug 2015 20:11:48 -0400 Date: Mon, 31 Aug 2015 02:11:45 +0200 From: Samuel Thibault Message-ID: <20150831001145.GD3238@var.home> References: <20150830142152.GB13186@var.home> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] baum: Add support for typing ascii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers Hello, Peter Maydell, le Sun 30 Aug 2015 19:34:25 +0100, a =E9crit : > > + fprintf(stderr,"passdots %x\n", dots); >=20 > Should this be a DPRINTF ? D'oh. Sure. > (Try scripts/checkpatch.pl.) Ah, I didn't remember there was one. Will use it. > > + if (nabcc_translation[dots] =3D=3D keysym) > > + { > > + DPRINTF("dots %x\n", dots); > > + baum_send_key2(baum, BAUM_RSP_EntryKeys, dot= s << 8); > > + baum_send_key2(baum, BAUM_RSP_EntryKeys, 0); > > + break; > > + } >=20 > Does this happen often enough to make a glib hashtable preferable > to the linear scan through a 256-entry array ? I also wondered. this happens only when the user types on the keyboard, so it's really not frequent. An alternative would be to use a 256-entry array which would be exactly the reverse of nabcc_translation. But that would take memory and time to build it (or copy/paste in the source code to hardcode it) while it's really not processed often. The converse (i.e. uses of nabcc_translation), however, is done very often, on each character output. Samuel