Re: Math.h functions with CGFloat
Re: Math.h functions with CGFloat
- Subject: Re: Math.h functions with CGFloat
- From: Graham Cox <email@hidden>
- Date: Wed, 11 Aug 2010 01:28:29 +1000
On 11/08/2010, at 1:08 AM, steven Hooley wrote:
> But then e.g. when building 32-bit i still have to cast the return
> value or i get the warning:-
>
> 'implicit conversion shortens 64-bit value into a 32-bit value'
>
> It seems that this warning is my fault because i have added the flag
> -Wshorten-64-to-32 which isn't enabled by default so maybe it
> shouldn't be?
If your code is working with CGFloat, then the warning isn't very helpful, because by using CGFloat you've elected to use 32-bit precision. If you want 'double', use 'double'. The warning could be useful on 64-bit compiles to indicate the inadvertent use of 'float' where you meant 'double' or 'CGFloat', but if you're only using CGFloat then that won't happen.
--Graham
_______________________________________________
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