From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48394 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfIKp-0000uU-Gf for qemu-devel@nongnu.org; Tue, 18 Jan 2011 15:39:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfIKi-0002HJ-88 for qemu-devel@nongnu.org; Tue, 18 Jan 2011 15:39:23 -0500 Received: from mail-qy0-f180.google.com ([209.85.216.180]:43380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfIKi-0002H6-5m for qemu-devel@nongnu.org; Tue, 18 Jan 2011 15:39:16 -0500 Received: by qyk29 with SMTP id 29so38145qyk.4 for ; Tue, 18 Jan 2011 12:39:15 -0800 (PST) Message-ID: <4D35FA6E.80309@codemonkey.ws> Date: Tue, 18 Jan 2011 14:39:10 -0600 From: Anthony Liguori 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> In-Reply-To: <4D35F9DC.9040203@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes Sorensen Cc: kwolf@redhat.com, Alex.Williamson@redhat.com, Eric Blake , Markus Armbruster , qemu-devel@nongnu.org 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: >> >>> On 01/18/2011 09:50 AM, Anthony Liguori wrote: >>> >>> >>>>>> @@ -324,26 +324,26 @@ ssize_t strtosz_suffix(const char *nptr, char >>>>>> **end, const char default_suffix) >>>>>> } >>>>>> } >>>>>> switch (toupper(d)) { >>>>>> >>>>>> >>>> BTW, a useful change would be to accept both upper and lower case >>>> letters. >>>> >>>> >>> 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. Regards, Anthony Liguori > Cheers, > Jes >