Re: Getting true 32-bit integers with NSNumber?
Re: Getting true 32-bit integers with NSNumber?
- Subject: Re: Getting true 32-bit integers with NSNumber?
- From: Alex Hall <email@hidden>
- Date: Mon, 02 Dec 2013 12:47:32 -0500
Thanks for the help everyone. Instead of NSUIntegers I now use ALuints, and instead of calling unsignedIntegerValue on NSNumbers I now call unsignedIntValue. My warnings have gone from over 80 to around 30, so this is definitely the right track. The only snag now is that dictionary the controller uses - it wants to store buffers and sources (OpenAL values), but OpenAL needs those to be uints which a dictionary can't store. So, I now need to figure out where to use NSNumbers versus basic unsigned ints. I'm not asking for help - I know how to do it, but it will be tedious - just letting you know that your responses were a big help and I'm on the way. If I ever compile this targeted at iOS7, though, I have a feeling I'll get a lot of warnings about 64-bit compatibility. :)
On Dec 2, 2013, at 11:54 AM, Jens Alfke <email@hidden> wrote:
>
> On Dec 2, 2013, at 2:31 AM, ChanMaxthon <email@hidden> wrote:
>
>> I am just making an example and a point - check what (u)int32_t or (u)int64_t is typedef'd to and return that type.
>
> The OP wants a real-world solution, not an abstract theoretical example of the worst-case way to handle it.
>
> If you want a 32-bit int, call -intValue. If you’re ultra paranoid about int changing to 64-bit in the future and you don’t want to have to fix a warning in that code later on, cast the result to int32_t.
>
> —Jens
> _______________________________________________
>
> 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
Have a great day,
Alex (msg sent from Mac Mini)
email@hidden
_______________________________________________
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