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: GCC 4.0 GetKeys() and BigEndianLong for Intel



On Jun 16, 2005, at 1:48 AM, MacArthur, Ian (SELEX) (UK) wrote:

Sorry I wasn't clear enough there.  BigEndianLong is a long on
PowerPC and a struct on Intel.  Here's the Intel definition, from
Endian.h:

struct BigEndianLong {
   long                bigEndianValue;
};
typedef struct BigEndianLong            BigEndianLong;

So you want to swap theKeys[1].bigEndianValue on little-endian
systems, not theKeys[1].

Ouch!
I guess it's way to late to get it changed now, but that strikes me as exactly the sort of thing that will be a pain.
There's no real reason *why* it has to be a struct rather than just a long, I guess, but it forces us to use target specific code and to know the detail of the underlying implementation. Seems a shame. If it was just a long, we could simply call htonl() (for example) and get the Right Thing on *any* architecture.

I agree. It'd be even better if it GetKeys always returned an array of native-endian values, so you wouldn't have to do any swapping and you could just use the same code across all architectures. After all, that's what we've tried to do with most other APIs in the system.


Fortunately, since we haven't yet shipped a non-preview OS for Intel we can still make changes like this. I'd suggest filing a bug report. Send me the bug number when you get it back and I'll track it.

-Eric

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

This email sent to email@hidden
References: 
 >GCC 4.0 GetKeys() and BigEndianLong for Intel (From: "MacArthur, Ian (SELEX) (UK)" <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.