• 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: UInt32 and ==
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UInt32 and ==


  • Subject: Re: UInt32 and ==
  • From: Dan Crevier <email@hidden>
  • Date: Tue, 09 Apr 2002 22:54:32 -0700

On 4/9/2002 7:07 PM, "Jaeho Chang" <email@hidden> wrote:

>> - (Boolean) isReadable
>> {
>> return( ( auParamInfo.flags &
>> kAudioUnitParameterFlag_IsReadable ) != 0 );
>> }
>
> I tried this:
> - (Boolean) isReadable
> {
> return( auParamInfo.flags &
> kAudioUnitParameterFlag_IsReadable != 0 );
> }
>
> But this did not work. I forgot that != is done before &.
> This made me think the problem was in internal
> comparing mechanism...

You are missing ()'s. What you wrote means:

return( auParamInfo.flags &
(kAudioUnitParameterFlag_IsReadable != 0) );

Which is effectively ANDing auParamInfo.flags and 1.

Dan
_______________________________________________
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.

References: 
 >Re: UInt32 and == (From: Jaeho Chang <email@hidden>)

  • Prev by Date: Re: How to make mailto: links clickable
  • Next by Date: Re: why Obj-C
  • Previous by thread: Re: UInt32 and ==
  • Next by thread: ObjC and C++
  • Index(es):
    • Date
    • Thread