All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@gnu.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] baum: Add support for typing ascii
Date: Mon, 31 Aug 2015 02:11:45 +0200	[thread overview]
Message-ID: <20150831001145.GD3238@var.home> (raw)
In-Reply-To: <CAFEAcA8-TKR=HWtZjv12et2VBT+6_MUE9GtYccwG6pBN817kFQ@mail.gmail.com>

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	other threads:[~2015-08-31  0:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-30 14:21 [Qemu-devel] [PATCH] baum: Add support for typing ascii Samuel Thibault
2015-08-30 18:34 ` Peter Maydell
2015-08-31  0:11   ` Samuel Thibault [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150831001145.GD3238@var.home \
    --to=samuel.thibault@gnu.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.