Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NhVN1-0002ig-Pz for mharc-grub-devel@gnu.org; Tue, 16 Feb 2010 16:54:15 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NhVN0-0002i5-FR for grub-devel@gnu.org; Tue, 16 Feb 2010 16:54:14 -0500 Received: from [140.186.70.92] (port=55630 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhVMz-0002he-CI for grub-devel@gnu.org; Tue, 16 Feb 2010 16:54:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NhVMy-0004eJ-GL for grub-devel@gnu.org; Tue, 16 Feb 2010 16:54:13 -0500 Received: from mail-fx0-f215.google.com ([209.85.220.215]:52471) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NhVMy-0004eF-A9 for grub-devel@gnu.org; Tue, 16 Feb 2010 16:54:12 -0500 Received: by fxm7 with SMTP id 7so6903611fxm.8 for ; Tue, 16 Feb 2010 13:54:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type:content-transfer-encoding; bh=545imGttw/evIk8iWrZTdduE/+ZuVAGJ2pQlCsSn7tM=; b=Bc/9cQqCfPF3HIqXR60v+cZ3vhsTqzFdErLqhFnVrVCaSCtIgcYfiK/bNiEnpT/emt Xzkh/+X949bSIMBAfXEE5rlYnXrika6pT3WE+NkbiSPHvlwqJEqxcOA9BiZW0UlaxWp7 nsUwIcwfAvM2mR8GtJzl/O8vuL2iEs5F39krg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; b=ktHRGYHdUCTY4QxB8O3CKy74cBkwQfFwyxzzgkkexzas/wKvGUouOgH122ymvpRw9I 3jDuMGDRi+Du/v8JFeNALyuYlYzss5zm9UZfNKwvDUUaObdjjID0Zxk580U2GIjtGQkt ST6u1ncpE7pXoZb+k0msWcqMy2eAiGToOjE28= MIME-Version: 1.0 Sender: hramrach@gmail.com Received: by 10.239.136.133 with SMTP id h5mr710432hbh.126.1266357251158; Tue, 16 Feb 2010 13:54:11 -0800 (PST) In-Reply-To: References: <4B736F82.7010005@gmail.com> <4B7AC60B.1060804@gmail.com> From: Michal Suchanek Date: Tue, 16 Feb 2010 22:53:51 +0100 X-Google-Sender-Auth: ccc4b0ca86f53960 Message-ID: To: The development of GNU GRUB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [RFC] Framebuffer rotation patch 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: Tue, 16 Feb 2010 21:54:14 -0000 On 16 February 2010 22:05, Michal Suchanek wrote: > 2010/2/16 Vladimir '=CF=86-coder/phcoder' Serbinenko : >> Michal Suchanek wrote: >>>> With typeof macro this can be made type-neutral avoiding potential mis= takes. >>>> +static inline long >>>> +grub_min (long x, long y) >>>> +{ >>>> + =C2=A0if (x > y) >>>> + =C2=A0 =C2=A0return y; >>>> + =C2=A0else >>>> + =C2=A0 =C2=A0return x; >>>> +} >>>> + >>>> >>> >>> I don't see how typeof would be used. As I understand the docs it can >>> only set types relative to something what is already defined (and in >>> some cases actually dereference/call it) and there is nothing defined >>> at the point these functions are declared to copy the type from. >>> >> #include >> #define swap(a,b) {typeof (a) mytemp ## __LINE__; mytemp ## __LINE__ =3D >> b; b =3D a; a =3D mytemp ## __LINE__; } >> > > Unlike inlines this pollutes the local namespace with unexpected > identifiers.. Perhaps the temporary variable should be at least > prefixed with an underscore or something. > > But if that is ok then perhaps the existing functions in > include/grub/misc.h should be converted. > > There is grub_max, grub_abs and grub_div_roundup already. Hmm, we don't have stdio.h in grub. Perhaps it's no that good idea after all. Thanks Michal