qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] baum: Add support for typing ascii


From: Samuel Thibault
Subject: Re: [Qemu-devel] [PATCH] baum: Add support for typing ascii
Date: Mon, 31 Aug 2015 02:11:45 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Hello,

Peter Maydell, le Sun 30 Aug 2015 19:34:25 +0100, a écrit :
> > +                    fprintf(stderr,"passdots %x\n", dots);
> 
> 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] == keysym)
> > +                    {
> > +                        DPRINTF("dots %x\n", dots);
> > +                        baum_send_key2(baum, BAUM_RSP_EntryKeys, dots << 
> > 8);
> > +                        baum_send_key2(baum, BAUM_RSP_EntryKeys, 0);
> > +                        break;
> > +                    }
> 
> 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



reply via email to

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