From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Nh5n0-0006lQ-4T for mharc-grub-devel@gnu.org; Mon, 15 Feb 2010 13:35:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nh5my-0006l1-IZ for grub-devel@gnu.org; Mon, 15 Feb 2010 13:35:20 -0500 Received: from [140.186.70.92] (port=36188 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nh5my-0006kl-2U for grub-devel@gnu.org; Mon, 15 Feb 2010 13:35:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nh5mx-0005E0-HK for grub-devel@gnu.org; Mon, 15 Feb 2010 13:35:19 -0500 Received: from gator297.hostgator.com ([74.53.228.114]:39308) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nh5mx-0005Dr-4l for grub-devel@gnu.org; Mon, 15 Feb 2010 13:35:19 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gibibit.com; h=Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; b=Ea2nv0TnHozlg8GbYTpm+3x6oOGcflhusIlvbmiRAo/q+uq68T2v4h/uF0hp3w82SZ6Ktln5k6ZRE+jGk5fPOEVDqteClJXJJRbke97yPU015t+G8+/ZJ5bOqrduYHks; Received: from spk.venturedesignservices.com ([65.61.115.34]:41763 helo=svelte) by gator297.hostgator.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Nh5mv-0003RB-BN; Mon, 15 Feb 2010 12:35:17 -0600 Date: Mon, 15 Feb 2010 10:35:16 -0800 From: Colin D Bennett To: Michal Suchanek Message-ID: <20100215103516.56c60815@svelte> In-Reply-To: References: <4B736F82.7010005@gmail.com> <4B742B70.3080303@gmail.com> <20100215090552.047346bf@svelte> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator297.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gibibit.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: The development of GNU GRUB Subject: Re: [RFC] Framebuffer rotation patch, or why 'unsigned' fails us X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 18:35:20 -0000 On Mon, 15 Feb 2010 19:14:57 +0100 Michal Suchanek wrote: > What is left unsigned is the framebuffer size in mode info and it > indeed requires some casts and causes trouble. It made me change one > of the transform routines to asymmetric types because it is used > (almost) exclusively on the mode info structure. The members of > mode_info should not ever become negative, though and the unsigned > type is probably meant to make that clear. I can't say if making that > clear outweights the possible issues when using the values in > calculations. I think it is obvious that width and height values are never negative. Since the data type (unsigned) is only visible the to programmer in the declaration of the struct, not in uses of its members, I think it would be just as effective to declare such values as signed types with a comment at the declaration like "/* Nonnegative */" to make it clear, and this would avoid signed/unsigned conversion/comparision problems. Regards, Colin