Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names

2012-07-27 Thread Markus Armbruster
Anthony Liguori aligu...@us.ibm.com writes: We don't use the standard C functions for conversion because we don't want to depend on the user's locale. All option names in QEMU are en_US in plain ASCII. Fails to explain the important part, namely the actual change to option comparison!

Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names

2012-07-27 Thread Peter Maydell
On 27 July 2012 08:44, Markus Armbruster arm...@redhat.com wrote: The implementation is too longwinded for my taste :) static unsigned char opt_canon_ch(char ch) { if (ch = 'A' ch = 'Z') { return 'a' + (ch - 'A'); } else if (ch == '_') { return '-'; }

[Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names

2012-07-25 Thread Anthony Liguori
We don't use the standard C functions for conversion because we don't want to depend on the user's locale. All option names in QEMU are en_US in plain ASCII. Signed-off-by: Anthony Liguori aligu...@us.ibm.com --- qemu-option.c | 53 +

Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names

2012-07-25 Thread Eric Blake
On 07/25/2012 10:25 AM, Anthony Liguori wrote: We don't use the standard C functions for conversion because we don't want to depend on the user's locale. All option names in QEMU are en_US in plain ASCII. [Wondering if I should bring up the US 'canceled' vs. UK 'cancelled' as a counterpoint

Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names

2012-07-25 Thread Eric Blake
On 07/25/2012 10:45 AM, Eric Blake wrote: On 07/25/2012 10:25 AM, Anthony Liguori wrote: We don't use the standard C functions for conversion because we don't want to depend on the user's locale. All option names in QEMU are en_US in plain ASCII. +static int opt_tolower(int ch) +{ +

Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names

2012-07-25 Thread Peter Maydell
On 25 July 2012 17:25, Anthony Liguori aligu...@us.ibm.com wrote: We don't use the standard C functions for conversion because we don't want to depend on the user's locale. All option names in QEMU are en_US in plain ASCII. Signed-off-by: Anthony Liguori aligu...@us.ibm.com ---

Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names

2012-07-25 Thread Anthony Liguori
Eric Blake ebl...@redhat.com writes: On 07/25/2012 10:45 AM, Eric Blake wrote: On 07/25/2012 10:25 AM, Anthony Liguori wrote: We don't use the standard C functions for conversion because we don't want to depend on the user's locale. All option names in QEMU are en_US in plain ASCII.

Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names

2012-07-25 Thread Peter Maydell
On 25 July 2012 18:33, Anthony Liguori aligu...@us.ibm.com wrote: Peter Maydell peter.mayd...@linaro.org writes: This is not in line with the return value that the C library strcmp() would return. C99 7.21.4 says The sign of a nonzero value returned by the comparison functions memcmp, strcmp,

Re: [Qemu-devel] [PATCH 1/2] qemu-opts: introduce a function to compare option names

2012-07-25 Thread Anthony Liguori
Peter Maydell peter.mayd...@linaro.org writes: On 25 July 2012 17:25, Anthony Liguori aligu...@us.ibm.com wrote: We don't use the standard C functions for conversion because we don't want to depend on the user's locale. All option names in QEMU are en_US in plain ASCII. Signed-off-by: