Re: Universal Binary Problem (Carbon Issue?)
Re: Universal Binary Problem (Carbon Issue?)
- Subject: Re: Universal Binary Problem (Carbon Issue?)
- From: Nick Zitzmann <email@hidden>
- Date: Fri, 20 Jan 2006 13:06:08 -0700
On Jan 20, 2006, at 12:00 PM, Aram Kudurshian wrote:
4 Errors appear for the following method; each on the lines with
the binary &. Xcode asserts the following - error: invalid
operands to binary & . Why does this work for a PPC target but not
Intel? Is it because I'm accessing a Carbon data structure?
[...]
KeyMap theKeys;
You're receiving this error because of the KeyMap typedef data
structure. On little-endian systems, a KeyMap is a very different
data structure than it is on big-endian systems. So instead of doing
this:
return (((theKeys[1] & 0x0008) ? 1 : 0) == ((inMask &
kHPControlModifierKey) ? 1 : 0)) &&
(((theKeys[1] & 0x0004) ? 1 : 0) == ((inMask &
kHPOptionModifierKey ) ? 1 : 0)) &&
(((theKeys[1] & 0x0001) ? 1 : 0) == ((inMask &
kHPShiftModifierKey ) ? 1 : 0)) &&
(((theKeys[1] & 0x8000) ? 1 : 0) == ((inMask &
kHPCommandModifierKey) ? 1 : 0));
...when building on Intel, do this instead:
return (((theKeys[1].bigEndianValue & 0x0008) ? 1 : 0) ==
((inMask & kHPControlModifierKey) ? 1 : 0)) &&
(((theKeys[1].bigEndianValue & 0x0004) ? 1 : 0) == ((inMask &
kHPOptionModifierKey ) ? 1 : 0)) &&
(((theKeys[1].bigEndianValue & 0x0001) ? 1 : 0) == ((inMask &
kHPShiftModifierKey ) ? 1 : 0)) &&
(((theKeys[1].bigEndianValue & 0x8000) ? 1 : 0) == ((inMask &
kHPCommandModifierKey) ? 1 : 0));
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden