Re: "byte orders" question
Re: "byte orders" question
- Subject: Re: "byte orders" question
- From: Koen van der Drift <email@hidden>
- Date: Sun, 27 Nov 2011 12:38:47 -0500
On Nov 27, 2011, at 10:02 AM, Scott Ribe wrote:
> The purpose of casting? I think you need to review a C reference, you're casting a uint32_t to uint32_t * then back to uint32_t. In prior code you were casting something (unsigned char * ???) to uint32_t *, then dereferencing it, which would be a uint32_t, then casting that to a uint32_t.
That code is not mine, it came straight out of the docs describing the xml scheme, I copied it as is but couldn't get it to work, hence my initial question.
I now simplified my code a bit more, I changed:
res = ntohl((u_int32_t) ((u_int32_t *) value));
to:
res = ntohl(value);
> You might want to check that the data length is an exact multiple of 4, or rather 8 since you're expecting floats in pairs. And so on...
I will do that.
Thanks again for your help and suggestions.
- Koen.
_______________________________________________
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