qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() st


From: Jes Sorensen
Subject: Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement
Date: Wed, 19 Jan 2011 11:03:41 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7

On 01/18/11 21:39, Anthony Liguori wrote:
> On 01/18/2011 02:36 PM, Jes Sorensen wrote:
>> On 01/18/11 21:30, Anthony Liguori wrote:  
>>> On 01/18/2011 10:53 AM, Eric Blake wrote:       
>>>> And it does, via the toupper() added earlier in the series (and which
>>>> has separately been pointed out that using qemu_toupper() might be
>>>> nicer).
>>>>        
>>> Ok.  Just taking the different case labels would be nicer IMHO.
>>>      
>> The old code did that, but I was suggested to do it this way, which I
>> think is cleaner too. Fewer lines of code are easier to read.
>>    
> toupper() is based on locale so it's not consistent.

If you can show me an actually used locale where the toupper() on
k/m/g/t doesn't result in K/M/G/T then I guess there's a case. Otherwise
I don't really see this being a real point.

I think we are hitting the point where it's about who's taste is better,
and not about the actual code in this discussion.

One point in favor of the patch is this:

Without the patch:
address@hidden qemu]$ size cutils.o
   text    data     bss     dec     hex filename
   4212       0       0    4212    1074 cutils.o
With patch:
address@hidden qemu]$ size cutils.o
   text    data     bss     dec     hex filename
   4196       0       0    4196    1064 cutils.o

IMHO it makes the code easier to read, but beyond that there isn't much.
If people are strongly against it, I'll just drop the patch. It's not
worth our time arguing over this level of detail. Otherwise I'd like to
see it applied.

Cheers,
Jes



reply via email to

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