[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSInteger versus int
From: |
Martin Kalbfuß |
Subject: |
Re: NSInteger versus int |
Date: |
Thu, 6 Aug 2009 10:26:35 -0700 (PDT) |
I don't understand completely. Isn't 64bit register always big enough to hold
an int?
David Chisnall wrote:
>
> On 6 Aug 2009, at 17:50, Martin Kalbfuß wrote:
>
>> When should I use the NS types? I can't see a reason for there
>> exsistens. I'm
>> not sure if my sdl wrapper should use them.
>
> NSInteger exists to make it easier for C89 code to be 64-bit safe.
> NSInteger is equivalent to C99's intptr_t; an integer which is
> guaranteed to be the same width as a pointer. You can safely cast
> between void* and NSInteger, but you can't (always) safely cast
> between void* and int.
>
> David
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
>
>
--
View this message in context:
http://www.nabble.com/NSInteger-versus-int-tp24850339p24850990.html
Sent from the GNUstep - General mailing list archive at Nabble.com.