[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NewB Question

From: Paul Floyd
Subject: Re: NewB Question
Date: 13 Dec 2010 08:37:06 GMT
User-agent: slrn/ (SunOS)

On Sun, 12 Dec 2010 08:07:33 -0800 (PST), ArbolOne <> wrote:
> In this function:
> static inline void vlc_mouse_SetPressed( vlc_mouse_t *p_mouse,
>                                          int i_button )
> {
>     p_mouse->i_pressed |= 1 << i_button;
> }
> What is the meaning of 'p_mouse->i_pressed |= 1 << i_button;' ??

|= is "assignment or", the left value becomes the result of the bitwise
or of the left and right values. In this case, the right value is "1 <<

<< is shift left, the bit pattern (here, 1) is shifted left the right
value number of bits (i_button). I'll leave it to you to check up on
what happens if the number of bits is negative or more than the size
in bits of the destination.

A bientot
Paul Floyd       

reply via email to

[Prev in Thread] Current Thread [Next in Thread]