Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo in rgba.c rgba_clear #29

Closed
daym opened this issue Sep 25, 2014 · 3 comments
Closed

typo in rgba.c rgba_clear #29

daym opened this issue Sep 25, 2014 · 3 comments

Comments

@daym
Copy link

daym commented Sep 25, 2014

Fixed by

@@ -226,7 +231,7 @@ void rgba_clear(rgba_surface_t *rgba)
                return;

        rgba_fill(rgba, &rgba->dirty, 0x00000000);
-       rgba->flags &= ~(RGBA_FLAG_DIRTY || RGBA_FLAG_NEEDS_CLEAR);
+       rgba->flags &= ~(RGBA_FLAG_DIRTY | RGBA_FLAG_NEEDS_CLEAR);
@Moorviper
Copy link

why is it a typo??
Logical Or Operator = ||
Bitwise Or Operator = |

i think the logical should be used

@daym
Copy link
Author

daym commented Sep 25, 2014

why is it a typo??

() is a bitwise operator (which does inversion). It makes little sense to mix bitwise () and logical (||) in that fashion.

Also, doing &(a|b) is a common idiom to clear the stated flags while &(a||b) is senseless (would always clear bit 0 - if a or b is not equal to 0, which is the case).

i think the logical should be used

Why do you think that?

@rellla
Copy link
Member

rellla commented Sep 25, 2014

daym seems to be right.
fixed with 1a41433

@rellla rellla closed this as completed Sep 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants