• 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
Comparisons and Operations on BigEndianLong
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Comparisons and Operations on BigEndianLong


  • Subject: Comparisons and Operations on BigEndianLong
  • From: Jeff Birac <email@hidden>
  • Date: Thu, 21 Sep 2006 17:59:31 -0400

I'm a newbie to Universal development. How do I deal (universally) with BigEndianLong values?

The following code (compiled fine for PPC) is meant to check if the Shift key is pressed. But the compiler (for i386) complains "error: no match for 'operator&' in 'theKeys[1] & 1'."


Boolean IsShiftKeyPressed() { KeyMap theKeys;

  ::GetKeys( theKeys );

  if ( theKeys[1] & 0x01 )
  {
    return( true );
  }

  return( false );
}

Events.h defines KeyMap...

typedef    BigEndianLong                   KeyMap[4];

Endian.h defines BigEndianLong...

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


So how would some Universal code check the first bit (masked 0x01) of the second member of the KeyMap theKeys[1] from the GetKeys() function?


Thanks in advance.

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


  • Follow-Ups:
    • Re: Comparisons and Operations on BigEndianLong
      • From: "Sean McBride" <email@hidden>
    • Re: Comparisons and Operations on BigEndianLong
      • From: Steve Christensen <email@hidden>
    • Re: Comparisons and Operations on BigEndianLong
      • From: Rua Haszard Morris <email@hidden>
  • Prev by Date: Re: GCC, DLLs are accumulated ?
  • Next by Date: Re: Comparisons and Operations on BigEndianLong
  • Previous by thread: Re: Class diagram not working
  • Next by thread: Re: Comparisons and Operations on BigEndianLong
  • Index(es):
    • Date
    • Thread