Re: Quick DO endian question
Re: Quick DO endian question
- Subject: Re: Quick DO endian question
- From: Michael Ash <email@hidden>
- Date: Thu, 25 Jun 2009 00:54:49 -0400
On Wed, Jun 24, 2009 at 11:43 PM, Michael Vannorsdel<email@hidden> wrote:
> Do messages to remote proxies (a vended DO object) need to have their
> arguments adjusted for endianness or does DO handle that on its own?
>
> ie:
>
> [rootProxy myNumberIs:someInt32];
>
> would I need to standardize alignment in the above or leave it alone.
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.
Mike
_______________________________________________
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