Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Do deprecated APIs provide byte swapping on the Mac Intel platform?
[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 Oct 28, 2005, at 3:49 AM, Laurence Harris wrote:

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.




Another exception: PICT data are kept big endian in memory, too; so you need to replace occurrences of

   &(**myPictHandle).picFrame 

by 

   Rect myPicFrame;
   QDGetPictureBounds(myPictHandle, &myPicFrame);


--(jm)

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

This email sent to email@hidden

References: 
 >Re: Do deprecated APIs provide byte swapping on the Mac Intel platform? (From: Laurence Harris <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.