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

float2fix's argument lacks parenthesis #59

Open
Eiyeron opened this issue Jan 16, 2020 · 0 comments
Open

float2fix's argument lacks parenthesis #59

Eiyeron opened this issue Jan 16, 2020 · 0 comments

Comments

@Eiyeron
Copy link

Eiyeron commented Jan 16, 2020

Hello. I'm currently in search of works done around affine transformations to have reference results to build my own idea and I found your library like this. So far, I like to tinker around it, so I'll see later if I'm going to stick with it for some prototypes.

I just found an issue with float2fix: its implementation doesn't wrap properly its argument in the macro's expansion

#define float2fix(f)	(fix_t)(f*(1 << FIXED_BITS))

should be instead

#define float2fix(f)	(fix_t)((f)*(1 << FIXED_BITS))

Else it breaks once the the user code involves operations other than just value/variable.
(I didn't think a PR for such a microscopic change felt relevant)

Have a nice day

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

1 participant