• 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: Problem parsing file in 64 bit build.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem parsing file in 64 bit build.


  • Subject: Re: Problem parsing file in 64 bit build.
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 07 May 2012 16:55:13 -0700

On May 7, 2012, at 4:35 PM, Graham Cox wrote:

> The alternative would be to pull out each data field one by one, which I'm sure is also considered acceptable practice, but for this file type, using structs has proved to be a lot easier, not least because of a) the strange mix of big-endian and little-endian values in the same file and b) the presence of directly formatted 'double' values that are not platform independent.

I agree; using structs for this results in the cleanest code.

> Some discussion of the merit of #pragma pack(n) versus other methods would be useful here, it's not something I've had to deal with very much.

Assuming this just needs to support Mac and/or iOS, go ahead and use #pragma pack. If your code really has to be fully cross-platform, then things get dicier because #pragma pack isn’t supported by all compilers.

—Jens
_______________________________________________

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: 
 >Problem parsing file in 64 bit build. (From: Graham Cox <email@hidden>)
 >Re: Problem parsing file in 64 bit build. (From: Quincey Morris <email@hidden>)
 >Re: Problem parsing file in 64 bit build. (From: Graham Cox <email@hidden>)
 >Re: Problem parsing file in 64 bit build. (From: Quincey Morris <email@hidden>)
 >Re: Problem parsing file in 64 bit build. (From: Charles Srstka <email@hidden>)
 >Re: Problem parsing file in 64 bit build. (From: "Stephen J. Butler" <email@hidden>)
 >Re: Problem parsing file in 64 bit build. (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Implementing undo in custom model object for lots of properties
  • Next by Date: Re: inconsistent behavior of NSString's localizedCaseInsensitiveCompare
  • Previous by thread: Re: Problem parsing file in 64 bit build.
  • Next by thread: iOS + and X buttons
  • Index(es):
    • Date
    • Thread