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

Should we enforce unsignedness more strictly? #67

Open
fridtjof opened this issue Jan 7, 2019 · 1 comment
Open

Should we enforce unsignedness more strictly? #67

fridtjof opened this issue Jan 7, 2019 · 1 comment
Labels
bug Bugs or misbehaviour.
Projects

Comments

@fridtjof
Copy link
Member

fridtjof commented Jan 7, 2019

There are various places (example: matrix_getx, matrix_gety, sdl_event_break in out_sdl2.c) where an int is used instead of a uint.
Should we make variables strictly unsigned where it makes sense, or is allowed by all uses of that variable?
Of course, I'm only suggesting this because CLion told me to. :D

@vifino
Copy link
Member

vifino commented Jan 7, 2019

Yeah, it should be unsigned for the most part.
The issue with that is that math is a bit iffy, you're bound to underflow when calculating things.
So some things still rely on signed positions.
But other than that, the default should be unsigned.

@vifino vifino added the bug Bugs or misbehaviour. label Jan 7, 2019
@vifino vifino added this to In progress in Core Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs or misbehaviour.
Projects
Core
  
In progress
Development

No branches or pull requests

2 participants