On Sun, 12 Dec 2010 08:07:33 -0800 (PST), ArbolOne <arbol...@gmail.com> 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 <<
i_button".

<< 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
-- 
Paul Floyd                 http://paulf.free.fr
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to