• 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: MFC Porting Issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MFC Porting Issues


  • Subject: Re: MFC Porting Issues
  • From: Kevin Wojniak <email@hidden>
  • Date: Fri, 20 Jan 2006 16:41:32 -0500

I think I realized what the problem is. When I was comparing the values in the debugger to the actual data it's reading from, some of the values appeared to not have been byte swapped, while others were. And this was only on the 2nd time, not the first. But I realized that when I'm swapping the bytes, I'm only working on the pointer, which is still pointer to the original data, so the original data is getting swapped back and forth each time. So I guess I have to change how it stores and reads this structure.

Thanks for everyone's help.

Kevin


On Jan 20, 2006, at 4:21 PM, Dave Camp wrote:

On Jan 20, 2006, at 12:58 PM, Kevin Wojniak wrote:

Oops, yes WORD = unsigned short, sorry.

I'm not sure what you mean by structure packing..

typedef struct { BYTE b1[8]; DWORD height; DWORD width; WORD w1; WORD bitDepth; DWORD d2; DWORD blockLen; } IPOD_PICTURE_HEADER;


BYTE = unsigned char DWORD = unsigned long WORD = unsigned char

Structure packing is how the fields of a struct are laid out in memory. For example, does the bitDepth field immediately follow the w1 field, or is there two bytes of padding preceding it so that it will be aligned on a 4 byte boundary. This is usually controlled by compiler directives and different processors prefer different packing schemes for efficiency.


Dave

---
The path of least resistance, it's not just for electricity any more.




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: MFC Porting Issues
      • From: Ricky Sharp <email@hidden>
References: 
 >MFC Porting Issues (From: Kevin Wojniak <email@hidden>)
 >Re: MFC Porting Issues (From: Shawn Erickson <email@hidden>)
 >Re: MFC Porting Issues (From: Kevin Wojniak <email@hidden>)
 >Re: MFC Porting Issues (From: Dave Camp <email@hidden>)

  • Prev by Date: Re: Two questions about NSCalendar
  • Next by Date: NSTableView cells with custom views: tab order
  • Previous by thread: Re: MFC Porting Issues
  • Next by thread: Re: MFC Porting Issues
  • Index(es):
    • Date
    • Thread