All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [RFC] Framebuffer rotation patch
Date: Tue, 16 Feb 2010 17:21:31 +0100	[thread overview]
Message-ID: <4B7AC60B.1060804@gmail.com> (raw)
In-Reply-To: <a5d587fb1002160808r30f64be3sa865ff3cf2d42ff9@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]

Michal Suchanek wrote:
>> With typeof macro this can be made type-neutral avoiding potential mistakes.
>> +static inline long
>> +grub_min (long x, long y)
>> +{
>> +  if (x > y)
>> +    return y;
>> +  else
>> +    return 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 <stdio.h>
#define swap(a,b) {typeof (a) mytemp ## __LINE__; mytemp ## __LINE__ =
b; b = a; a = mytemp ## __LINE__; }

int
main ()
{
  int x = 1, y = 2;
  swap (x,y);
  printf ("%d, %d\n", x, y);
}


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]

  reply	other threads:[~2010-02-16 16:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28  8:03 [RFC] Framebuffer rotation patch Michal Suchanek
2009-08-29 10:24 ` Michal Suchanek
2010-02-11  2:46 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-11 10:19   ` Michal Suchanek
2010-02-11 10:52     ` Michal Suchanek
2010-02-11 16:11       ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-11 16:08     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-13 17:29       ` Michal Suchanek
2010-02-15 17:05         ` [RFC] Framebuffer rotation patch, or why 'unsigned' fails us Colin D Bennett
2010-02-15 18:14           ` Michal Suchanek
2010-02-15 18:35             ` Colin D Bennett
2010-02-16 12:35             ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-16 20:53               ` Michal Suchanek
2010-02-16 12:32         ` [RFC] Framebuffer rotation patch Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-16 15:52           ` Michal Suchanek
2010-02-16 18:03             ` Isaac Dupree
2010-02-16 18:15               ` richardvoigt
2010-02-16 18:47                 ` [Off-topic] C++ enums Isaac Dupree
2010-02-16 16:08   ` [RFC] Framebuffer rotation patch Michal Suchanek
2010-02-16 16:21     ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2010-02-16 21:05       ` Michal Suchanek
2010-02-16 21:14         ` richardvoigt
2010-02-16 23:19           ` Michal Suchanek
2010-02-16 21:53         ` Michal Suchanek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B7AC60B.1060804@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.