Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Porting from Linux to MacOS



>> The number one issue is byte swapping. Far too many people
>> assume that 16
>> and 32 bit values can be read from a file directly into int's
>> and short's.
>> This is no longer the case. The bytes are reversed on PowerPC/680x0
>> processors. (Floats and doubles too).
>
> Just to be very clear, bits within the bytes themselves aren't reversed

Unless you are talking about a bitfield. When porting code we have found
that some sloppy programmers use bitfields to set values into the structures
and then case statements with constants to test for various combinations.

Not only is the byte order backwards, but the bit field order is backwards
also. This might also be compiler dependent.

_________________________________________________________________________
Gridz 1.3 ---- www.gridz.com ---- NetSpace will never be the same again
_________________________________________________________________________
Howard Shere | Green Dragon Creations | Water Valley Interchange
President | 301 N. Main St. | P.O. Box 70
Software Sculptor | Water Valley, MS 38965 | Water Valley, MS 38965
| email@hidden | email@hidden
| www.greendragon.com | www.watervalley.net
| 1-662-473-4225 | 1-662-473-9209




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.