It shouldn't be.  What you're doing is writing non-portable code by assuming
how scalars are stored in memory.  Stop doing that, and you'll have no more
concerns.  :-)

You can't have it both ways.  If the resource data is changed to Little
Endian format, then:

        WinDrawChars (&creatorID, 4, x, y);

is going to break.  However, if the resource data is kept in Big Endian
format, then:
        if (creatorID == 'myCR') {...}

is going to break.  There's no way to keep both intact.

Writing portable code that doesn't assume endianness is quite possible.  For
instance, PalmDebugger (which runs on both Macs and PCs and which prints out
creator IDs and database types) uses the following:

        char    buffer[5];

        buffer[0] = (char) (creatorID >> 24);
        buffer[1] = (char) (creatorID >> 16);
        buffer[2] = (char) (creatorID >> 8);
        buffer[4] = (char) (creatorID >> 0);
        buffer[5] = (char) (0);

        CheckForNonPrintableCharacters (buffer);
        DoPrint (buffer);

(And I'm sure there are people on this list quite capable of punching holes
in even *that* quite reasonable example.  :-)  )

-- Keith

-----Original Message-----
From: Michael Glickman [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 06, 2002 6:54 PM
To: Palm Developer Forum
Subject: RE: Palm and ARM (Was: PL/I for Palm ?)


Not a major, but a concern :-)
M.


-----Original Message-----
From: Gavin Maxwell [mailto:[EMAIL PROTECTED]]
Sent: Monday, 7 January 2002 1:36 PM
To: Palm Developer Forum
Subject: RE: Palm and ARM (Was: PL/I for Palm ?)


Is that really your major concern Michael? :-)

Gavin.

-----Original Message-----
From: Michael Glickman [mailto:[EMAIL PROTECTED]]
Sent: Monday, 7 January 2002 1:10 PM
To: Palm Developer Forum
Subject: RE: Palm and ARM (Was: PL/I for Palm ?)




-----Original Message-----
From: Aaron Ardiri [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 5 January 2002 1:59 PM
To: Palm Developer Forum
Subject: Re: Palm and ARM (Was: PL/I for Palm ?)

> pilrc already has ARM support :) 

What you probably meant is that the resources are unaffected by CPU type...
well, at least we can hope.

How about creator ID and DB/Resource type ? I am not quite certain what is
the natural way to store that on a little-endian machine like ARM. In
particular, will we still be able to treat CreatorID as a char string, e.g.
WinDrawChars (&creatorID, 4, x, y) ?. For me it will be a bit of a hassle if
we can't.

And (as John suggested) we can have resources over 64k with ARM (which will
be really great!), that might also affect pilrc.

Michael

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

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

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

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

Reply via email to