From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50282 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Phioa-00057N-Jn for qemu-devel@nongnu.org; Tue, 25 Jan 2011 08:20:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhioZ-000704-Ky for qemu-devel@nongnu.org; Tue, 25 Jan 2011 08:20:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhioZ-000700-Bz for qemu-devel@nongnu.org; Tue, 25 Jan 2011 08:20:07 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] Re: [PATCH v4 0/4] strtosz() cleanups References: <1295883211-18288-1-git-send-email-Jes.Sorensen@redhat.com> <4D3D9E8B.20000@redhat.com> <4D3DB6A2.3060903@mail.berlios.de> <4D3E955B.2070705@redhat.com> <4D3EB974.2050201@redhat.com> Date: Tue, 25 Jan 2011 14:19:51 +0100 In-Reply-To: <4D3EB974.2050201@redhat.com> (Jes Sorensen's message of "Tue, 25 Jan 2011 12:52:20 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes Sorensen Cc: Kevin Wolf , qemu-devel@nongnu.org Jes Sorensen writes: > On 01/25/11 11:14, Markus Armbruster wrote: >> Jes Sorensen writes: >> >>> On 01/24/11 18:28, Stefan Weil wrote: >>>> There was some discussion regarding this patch set. >>>> I agree with Markus that part of the first patch >>>> should be removed: don't change char to unsigned char. >>> >>> The unsigned char should definitely go in, leaving it as a signed char >>> doesn't serve any purpose. >> >> Leaving something as is doesn't need justification. Changing it does. >> The justification presented so far was "it is prettier to match the real >> behavior of pure toupper()". Which I don't buy. But without commit >> access, I'm not a buyer. > > Well that is just too bad. qemu_toupper() is a hack around the fact that > people often forget to use the right type, it is not an excuse for using > the wrong type in the code. qemu_toupper() is designed to work correctly for any character argument, be it signed or unsigned. The fact that toupper() works only for unsigned character values is irrelevant for qemu_toupper(). The fact that qemu_toupper()'s implementation uses toupper() is an implementation detail.