From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MU4iI-00005z-Pt for mharc-grub-devel@gnu.org; Thu, 23 Jul 2009 16:16:26 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MU4iD-0008Uk-DC for grub-devel@gnu.org; Thu, 23 Jul 2009 16:16:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MU4i6-0008R6-M8 for grub-devel@gnu.org; Thu, 23 Jul 2009 16:16:18 -0400 Received: from [199.232.76.173] (port=46498 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU4i5-0008Ql-Lt for grub-devel@gnu.org; Thu, 23 Jul 2009 16:16:13 -0400 Received: from c60.cesmail.net ([216.154.195.49]:4324) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1MU4i5-0000UD-1u for grub-devel@gnu.org; Thu, 23 Jul 2009 16:16:13 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 23 Jul 2009 16:16:05 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id B07C434C6A for ; Thu, 23 Jul 2009 16:26:53 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <1248372662.4660.161.camel@accesodirecto.casa> References: <1248347411.4660.81.camel@accesodirecto.casa> <1248359851.7855.2.camel@mj> <1248363011.4660.157.camel@accesodirecto.casa> <1248372662.4660.161.camel@accesodirecto.casa> Content-Type: text/plain; charset="ISO-8859-1" Date: Thu, 23 Jul 2009 15:51:00 -0400 Message-Id: <1248378660.2661.54.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 (2.26.3-1.fc11) Content-Transfer-Encoding: 8bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Check for the appropriate condition in types.h X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 20:16:22 -0000 On Thu, 2009-07-23 at 20:11 +0200, Javier Martín wrote: > El jue, 23-07-2009 a las 17:40 +0200, Vladimir 'phcoder' Serbinenko > escribió: > > Actualy I should have used ALIGN_UP here > It's just a random sample of code, brought up by a search for (long). > I'm pretty sure more examples abound. > > > > Regarding the ChangeLog entry, I always have problems with them. What > > > about this one?: > > > 2009-07-23 Javier Martin > > > * include/grub/types.h (GRUB_CPU_SIZEOF_VOID_P): substitute for > > This would suggest that you modify GRUB_CPU_SIZEOF_VOID_P macro which > > isn't the case. I would prefer something like: > > [GRUB_CPU_SIZEOF_VOID_P == 8]: Changed to ... > > [GRUB_CPU_SIZEOF_LONG == 8]: ... this. > Ok, let's adopt this form instead. The proposed ChangeLog would now be: >From the GNU Coding Standards: "C programs often contain compile-time `#if' conditionals. Many changes are conditional; sometimes you add a new definition which is entirely contained in a conditional. It is very useful to indicate in the change log the conditions for which the change applies. Our convention for indicating conditional changes is to use square brackets around the name of the condition." It means that the square brackets are used if the changes only affect the code under the condition specified in brackets. This is not what is happening here. > (UINT_TO_PTR): move outside wordsize conditionals > (PTR_TO_UINT): new macro We should remove PTR_TO_UINT32 and PTR_TO_UINT64 with PTR_TO_UINT everywhere. I've checked that it doesn't introduce any warnings on any platform. There should be no need to combine a cast to a scalar type with a cast to change the type precision. By eliminating the second cast, we make it possible for the compiler to catch precision loss. -- Regards, Pavel Roskin