discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSInteger versus int


From: David Chisnall
Subject: Re: NSInteger versus int
Date: Thu, 6 Aug 2009 17:55:38 +0100

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]