Re: What is the default type for an integer literal (as relates to its use in NSLog)?
Re: What is the default type for an integer literal (as relates to its use in NSLog)?
- Subject: Re: What is the default type for an integer literal (as relates to its use in NSLog)?
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 15 Dec 2008 14:14:20 -0700
On Dec 15, 2008, at 2:06 PM, Stuart Malin wrote:
Yes, but then I lose the compile-time enforcement that only defined
values are supplied (as is achieved with typedef enum). So, as you
suggest, I see no reason not to leave as 32-bit. Yet Apple
doesn't... is there an advantage to their approach (other than the
type being unsigned)?
There is, but only if you're making a framework (or several) that has
to stand the test of time. Some of the enums, particularly bit masks,
may need more space in the future as new features are added to the OS,
in which case having it 64-bit up front on 64-bit operating systems
preserves compatibility. If you look at the NSEvent masks, it looks
like they're almost there...
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden