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: Do deprecated APIs provide byte swapping on the Mac Intel platform?



On 10/28/05 5:44 AM, Miles Henderson didst favor us with:

> Hi all,
> 
> Do deprecated APIs provide byte swapping on the Mac Intel platform? For
> example, consider the following code:
> 
> Rect bnds;
> PixMapHandle pm = GetGWorldPixMap(myport);
> if (pm)
> {
> bnds = (**pm).bounds;
> }
> 
> After doing the above, will bnds contain the right values or do I need to
> perform a swap manually? If there are byte swapping issues with some but not
> all deprecated APIs, does anyone have a list of deprecated APIs that have byte
> swapping issues?

With very, very few exceptions*, byte swapping is only an issue when reading
from or writing to disk, or transmitting data over a network or to another
process. APIs like GetGWorldPixMap only operate on data created at runtime
in your memory space, so there's never any byte-swapping to be done. Their
data is already in native endian.

As a nature consequence of the above, APIs (other than those that do
byte-swapping like CFSwapInt32HostToBig and the very few exceptions
mentioned above) never swap bytes as far as I know.

*IconFamilyHandle data is always big endian, for example, because you can
create them at runtime, read them from resources, or read them from .icns
files, so to they're always big endian to avoid confusion.

Larry

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Do deprecated APIs provide byte swapping on the Mac Intel platform? (From: "Miles Henderson" <email@hidden>)



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.