[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Framebuffer rotation patch
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: [RFC] Framebuffer rotation patch |
Date: |
Tue, 16 Feb 2010 17:21:31 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20091109) |
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
signature.asc
Description: OpenPGP digital signature
- Re: [RFC] Framebuffer rotation patch, or why 'unsigned' fails us, (continued)
- Re: [RFC] Framebuffer rotation patch, or why 'unsigned' fails us, Michal Suchanek, 2010/02/15
- Re: [RFC] Framebuffer rotation patch, or why 'unsigned' fails us, Colin D Bennett, 2010/02/15
- Re: [RFC] Framebuffer rotation patch, or why 'unsigned' fails us, Vladimir 'φ-coder/phcoder' Serbinenko, 2010/02/16
- Re: [RFC] Framebuffer rotation patch, or why 'unsigned' fails us, Michal Suchanek, 2010/02/16
- Re: [RFC] Framebuffer rotation patch, Vladimir 'φ-coder/phcoder' Serbinenko, 2010/02/16
- Re: [RFC] Framebuffer rotation patch, Michal Suchanek, 2010/02/16
- Re: [RFC] Framebuffer rotation patch, Isaac Dupree, 2010/02/16
- Re: [RFC] Framebuffer rotation patch, address@hidden, 2010/02/16
- [Off-topic] C++ enums, Isaac Dupree, 2010/02/16
Re: [RFC] Framebuffer rotation patch, Michal Suchanek, 2010/02/16