Re: Quick DO endian question
Re: Quick DO endian question
- Subject: Re: Quick DO endian question
- From: Michael Vannorsdel <email@hidden>
- Date: Thu, 25 Jun 2009 20:54:33 -0600
Thanks for the confirmation. I did some testing using Rosetta and
didn't see endian problems but I wanted to make sure this was intended
and reliable on actual PPC and not just an anomaly leading me to
believe the byte swapping was automatic for explicit types.
On Jun 24, 2009, at 10:54 PM, Michael Ash wrote:
This is the sort of thing that would be trivial to test if you have an
Intel machine on hand....
In any case, the answer is no, you do not need to worry about
endianness in any data whose types that DO can see. DO gets full type
information about arguments and return values from the ObjC runtime,
and uses this to do any necessary conversions. Not just endianness,
but also size conversion (and potentially format conversion for
floating-point values, although everything Mac OS X runs on or
conceivably will run on uses IEEE754 format floats) will be done for
you.
Note the qualifier "whose types that DO can see". If you're shipping
around, say, raw data inside an NSData object, then DO can't know what
kind of stuff is in there and it will not do the conversion for you.
This is a pretty rare occurrence, of course, so normally you won't
have to worry about it.
_______________________________________________
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