• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Universal Binary Problem (Carbon Issue?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Universal Binary Problem (Carbon Issue?) (From: Aram Kudurshian <email@hidden>)

  • Prev by Date: NSSearchField Predicate Failure: Unable to use '<attribute name> == $value' for scalers
  • Next by Date: Re: NSApplication terminate: behavior
  • Previous by thread: Universal Binary Problem (Carbon Issue?)
  • Next by thread: Re: Universal Binary Problem (Carbon Issue?)
  • Index(es):
    • Date
    • Thread