Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MU4w3-00038l-IB for mharc-grub-devel@gnu.org; Thu, 23 Jul 2009 16:30:39 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MU4w1-00037s-DA for grub-devel@gnu.org; Thu, 23 Jul 2009 16:30:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MU4vw-00035Q-EW for grub-devel@gnu.org; Thu, 23 Jul 2009 16:30:36 -0400 Received: from [199.232.76.173] (port=42834 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU4vw-00035K-AS for grub-devel@gnu.org; Thu, 23 Jul 2009 16:30:32 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:59902) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MU4vv-00031u-Um for grub-devel@gnu.org; Thu, 23 Jul 2009 16:30:32 -0400 Received: by bwz5 with SMTP id 5so755999bwz.42 for ; Thu, 23 Jul 2009 13:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=KO4khuTgb+KHhQiw+MFY8CDBcbr4UbLpBb6QIpJSqMs=; b=fEIbka3JJg4jnLI68ETskHgN66jjjMaL0HmApO/v0qL0SvmyIhIdsEXW2qB0U1DQi7 YarDTv8a0HAO2P0FyZzt8nH+2lgalEjsQqViGN6fK8MUy16YrqLRT/Xy/cUHCX8LWUN0 u44H5CZOrQrS+pd1iNR1pge+BJmn57QdVct0M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=xdcaBPuLeKAcLygjKu9Wrc91NezzbkxgE7ih+fE7dV4QzSgfRrvr5lPH+3VaaH8RPZ 712+12/ssszSissINSdROZn+HfXQD9OlYuKKSz4poZQkIBoXx3EzGa8gARIc/BvW3BMN UJHssOwVJ9Eh/mc+E/XLcmuuDgnuP7C3PcpGA= MIME-Version: 1.0 Received: by 10.204.118.134 with SMTP id v6mr2438930bkq.2.1248381030841; Thu, 23 Jul 2009 13:30:30 -0700 (PDT) In-Reply-To: <1248378660.2661.54.camel@mj> References: <1248347411.4660.81.camel@accesodirecto.casa> <1248359851.7855.2.camel@mj> <1248363011.4660.157.camel@accesodirecto.casa> <1248372662.4660.161.camel@accesodirecto.casa> <1248378660.2661.54.camel@mj> Date: Thu, 23 Jul 2009 22:30:30 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:30:37 -0000 >> > [GRUB_CPU_SIZEOF_VOID_P =3D=3D 8]: Changed to ... >> > [GRUB_CPU_SIZEOF_LONG =3D=3D 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. =A0Many change= s > are conditional; sometimes you add a new definition which is entirely > contained in a conditional. =A0It is very useful to indicate in the > change log the conditions for which the change applies. =A0Our 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. =A0This is not what i= s > happening here. > This is exactly what happens here: we change only what happens in conditionals [GRUB_CPU_SIZEOF_VOID_P =3D=3D 8] and [GRUB_CPU_SIZEOF_LONG =3D=3D 8] >> =A0 =A0 =A0 =A0 =A0 (UINT_TO_PTR): move outside wordsize conditionals >> =A0 =A0 =A0 =A0 =A0 (PTR_TO_UINT): new macro > > We should remove PTR_TO_UINT32 and PTR_TO_UINT64 with PTR_TO_UINT > everywhere. =A0I've checked that it doesn't introduce any warnings on any > platform. > Sometimes PTR_TOUINT32 with precision loss is exactly what the coder wants. A typical example is booting 32-bit OS on 64-bit platform. This is the case of booting linux on efi64. Then the code has to ensure that the target is below 4GiB (see my mm propositions for more on how to ensure it). But I'm ok with requirement of additional explicit cast in such cases as (grub_uint32_t) PTR_TO_UINT (x) > -- > Regards, > Pavel Roskin > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git