All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Jan Krupa <JKrupa@suse.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-trivial] [PATCH 3/3] qemu-char: add support for U-prefixed symbols
Date: Sun, 01 Sep 2013 19:23:39 +0400	[thread overview]
Message-ID: <52235BFB.1060506@msgid.tls.msk.ru> (raw)
In-Reply-To: <1377616488-16491-4-git-send-email-JKrupa@suse.com>

27.08.2013 19:14, Jan Krupa wrote:
> This patch adds support for Unicode symbols in keymap files. This
> feature was already used in some keyboard layouts in QEMU generated
> from XKB (e.g. Arabic) but it wasn't implemented in QEMU source code.
>
> Signed-off-by: Jan Krupa <jkrupa@suse.com>
> ---
>   ui/keymaps.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/ui/keymaps.c b/ui/keymaps.c
> index f373cc5..426a893 100644
> --- a/ui/keymaps.c
> +++ b/ui/keymaps.c
> @@ -33,6 +33,9 @@ static int get_keysym(const name2keysym_t *table,
>           if (!strcmp(p->name, name))
>               return p->keysym;
>       }
> +    if (strlen(name) == 5 && name[0] == 'U') {
> +        return (int)strtol(name + 1, NULL, 16);
> +    }

How about something like

   if (sscanf(name, "U%04x", &temp) == 1)

instead, to ensure it actually is a valid hex number?
Because this code will behave in interesting way
given, eg, "U" or "UU"... ;)  But I don't think this
really matters much...

Thanks,


WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: Jan Krupa <JKrupa@suse.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH 3/3] qemu-char: add support for U-prefixed symbols
Date: Sun, 01 Sep 2013 19:23:39 +0400	[thread overview]
Message-ID: <52235BFB.1060506@msgid.tls.msk.ru> (raw)
In-Reply-To: <1377616488-16491-4-git-send-email-JKrupa@suse.com>

27.08.2013 19:14, Jan Krupa wrote:
> This patch adds support for Unicode symbols in keymap files. This
> feature was already used in some keyboard layouts in QEMU generated
> from XKB (e.g. Arabic) but it wasn't implemented in QEMU source code.
>
> Signed-off-by: Jan Krupa <jkrupa@suse.com>
> ---
>   ui/keymaps.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/ui/keymaps.c b/ui/keymaps.c
> index f373cc5..426a893 100644
> --- a/ui/keymaps.c
> +++ b/ui/keymaps.c
> @@ -33,6 +33,9 @@ static int get_keysym(const name2keysym_t *table,
>           if (!strcmp(p->name, name))
>               return p->keysym;
>       }
> +    if (strlen(name) == 5 && name[0] == 'U') {
> +        return (int)strtol(name + 1, NULL, 16);
> +    }

How about something like

   if (sscanf(name, "U%04x", &temp) == 1)

instead, to ensure it actually is a valid hex number?
Because this code will behave in interesting way
given, eg, "U" or "UU"... ;)  But I don't think this
really matters much...

Thanks,

  reply	other threads:[~2013-09-01 15:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-27 15:14 [Qemu-trivial] [PATCH 0/3] qemu-char: keymap changes for Czech and Unicode support Jan Krupa
2013-08-27 15:14 ` [Qemu-devel] " Jan Krupa
2013-08-27 15:14 ` [Qemu-trivial] [PATCH 1/3] qemu-char: add Czech characters to VNC keysyms Jan Krupa
2013-08-27 15:14   ` [Qemu-devel] " Jan Krupa
2013-08-27 15:14   ` [Qemu-trivial] [PATCH 2/3] qemu-char: add Czech keymap file Jan Krupa
2013-08-27 15:14     ` [Qemu-devel] " Jan Krupa
2013-08-27 15:14     ` [Qemu-trivial] [PATCH 3/3] qemu-char: add support for U-prefixed symbols Jan Krupa
2013-08-27 15:14       ` [Qemu-devel] " Jan Krupa
2013-09-01 15:23       ` Michael Tokarev [this message]
2013-09-01 15:23         ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2013-09-01 15:19     ` [Qemu-trivial] [PATCH 2/3] qemu-char: add Czech keymap file Michael Tokarev
2013-09-01 15:19       ` [Qemu-devel] " Michael Tokarev

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=52235BFB.1060506@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=JKrupa@suse.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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.