Ben Combee wrote in message <[EMAIL PROTECTED]>...
>
>"Avi Halachmi" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>>
>> hi.
>> i want to create a textual ini file with types and creators of certain
>> applications.
>>
>> however, the type and creator are defined as (i.e. 'appl') single quoted
4
>> chars sequence.
>> this is leagal in ansi-c, but implementation dependant. i know it
>transforms
>> to UInt32 in codeWarrior.
>
>You can replace it with this macro
>
>#define FourByte(a,b,c,d)  ((UInt32)((a) << 24 + (b) << 16 + (c) << 8 +
>(d)))
>
>then rather than saying 'appl', you'd say FourByte('a','a','p','l').

I am sure that he meant "FourByte('a','p','p','l')"

>
>CodeWarrior always treats the multi-byte char constants as if they were in
>most-significant-byte-first order due to its Macintosh roots.
>

You could also use hex literals, if you are comfortable with them.
The hex literal for 'appl' would be 0x6170706C.

Now CW treats 'appl' correctly ... but what about GCC?  Does
it reveal it's Intel bias there?  Does 'appl' even compile w/ GCC?




--
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi/sec: not just a good idea, it's the LAW!






-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to