From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=46537 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfUtI-0002ES-EC for qemu-devel@nongnu.org; Wed, 19 Jan 2011 05:03:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfUtH-00076l-1J for qemu-devel@nongnu.org; Wed, 19 Jan 2011 05:03:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfUtG-00076f-PY for qemu-devel@nongnu.org; Wed, 19 Jan 2011 05:03:46 -0500 Message-ID: <4D36B6FD.8080100@redhat.com> Date: Wed, 19 Jan 2011 11:03:41 +0100 From: Jes Sorensen MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/2] strtosz(): Use suffix macros in switch() statement References: <1295284345-24524-1-git-send-email-Jes.Sorensen@redhat.com> <1295284345-24524-3-git-send-email-Jes.Sorensen@redhat.com> <4D35C4E7.4080704@codemonkey.ws> <4D35C57A.4040206@redhat.com> <4D35F84A.3060806@codemonkey.ws> <4D35F9DC.9040203@redhat.com> <4D35FA6E.80309@codemonkey.ws> In-Reply-To: <4D35FA6E.80309@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: kwolf@redhat.com, Alex.Williamson@redhat.com, Eric Blake , Markus Armbruster , qemu-devel@nongnu.org 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: jes@red-feather qemu]$ size cutils.o text data bss dec hex filename 4212 0 0 4212 1074 cutils.o With patch: [jes@red-feather 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