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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to