Comparisons and Operations on BigEndianLong
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