• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "byte orders" question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >"byte orders" question (From: Koen van der Drift <email@hidden>)
 >Re: "byte orders" question (From: Ben Kennedy <email@hidden>)
 >Re: "byte orders" question (From: Koen van der Drift <email@hidden>)
 >Re: "byte orders" question (From: Scott Ribe <email@hidden>)
 >Re: "byte orders" question (From: Koen van der Drift <email@hidden>)
 >Re: "byte orders" question (From: "Glenn L. Austin" <email@hidden>)
 >Re: "byte orders" question (From: Koen van der Drift <email@hidden>)
 >Re: "byte orders" question (From: Scott Ribe <email@hidden>)
 >Re: "byte orders" question (From: Koen van der Drift <email@hidden>)
 >Re: "byte orders" question (From: Scott Ribe <email@hidden>)
 >Re: "byte orders" question (From: Koen van der Drift <email@hidden>)
 >Re: "byte orders" question (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: MapKit
  • Next by Date: Re: awakeFromInsert called twice with nested contexts
  • Previous by thread: Re: "byte orders" question
  • Next by thread: Re: "byte orders" question
  • Index(es):
    • Date
    • Thread