Re: stereo

New Message Reply Date view Thread view Subject view Author view

Martin Reddy (mxr++at++dcs.ed.ac.uk)
Wed, 18 Jun 1997 09:32:33 +0100 (BST)


> I don't understand what "if(*(int*)left)" does.
> [...]
> DrawChannel (pfChannel *channel, void *left)

"left" is therefore a pointer to void.

> if(*(int*)left) {

"(int *)left" casts this pointer to a pointer to an integer.

"*(int *)left" then dereferences this pointer to return the actual integer
that is pointed to by left.

if this value is TRUE (!=0), then the first section of the if statement is
performed. Otherwise, if the integer is FALSE (0), then the else bit is
performed.

> Does it make left into an integer or look to see if it's already one?

i.e. it returns the integer pointed to by left (it doesn't change left in
any way, so be careful when saying things like "make left into an
integer").

Martin.

---------------------------------------------------------------------------
Martin Reddy SRI International, AI Center
                                               Menlo Park, CA 94025-3493
reddy++at++ai.sri.com Tel. +44 131 650 5164 (temp)
http://www.ai.sri.com/~reddy Fax. +44 131 667 7209 (temp)

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:28 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.