Re: UInt32 and ==
Re: UInt32 and ==
- Subject: Re: UInt32 and ==
- From: rsharp <email@hidden>
- Date: Tue, 9 Apr 2002 10:54:59 -0500 (CDT)
On Tue, 9 Apr 2002, Jaeho Chang wrote:
>
This does not return right results:
>
>
- (Boolean) isReadable
>
{
>
return (auParamInfo.flags & kAudioUnitParameterFlag_IsReadable);
>
}
>
>
but this does:
>
>
- (Boolean) isReadable
>
{
>
return (((UInt32) auParamInfo.flags &
>
kAudioUnitParameterFlag_IsReadable) == ((UInt32)
>
kAudioUnitParameterFlag_IsReadable));
>
}
As others have pointed out, the Boolean is an 8-bit container and not
suitable to hold the result. Whenever I assign values to a boolean type,
I use boolean expresions. In the case of your method, I would do:
- (Boolean) isReadable
{
return( ( auParamInfo.flags &
kAudioUnitParameterFlag_IsReadable ) != 0 );
}
Rick Sharp
Instant Interactive(tm)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.