> From: Brian Smith [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 26, 2003 8:00 AM
> To: Palm Developer Forum
> Subject: RE: Question on a routine
> 
> On Thu, 26 Jun 2003 [EMAIL PROTECTED] wrote:
> 
> > Then the expression:
> >
> >     &packed->status
> >
> > is the offset of the "status" member from the base address of a
> > LibPackedDBRecord.  Note that &packed->status does not reference the
> > value of "status" but only yields the offset of "status".  DmWrite
> > requires the offset.
> 
> Figured that's probably what it was.  That raises the 
> question, though,
> do the Palm OS headers not have an offsetof() macro?  Or was 
> this just to confuse? :-)

The prevalent use of this technique throughout the early Palm OS source code and 
samples lead me to believe that the author just didn't know about offsetof.  It was 
only in later versions of the OS and SDK (around Palm OS 3.5, I think) that the 
OffsetOf macro was added and used.

-- Keith

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to