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