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

Fix implicit floating bool conversion #752

Merged

Conversation

julienmalik
Copy link
Collaborator

clang reports a number of implicit float-to-bool conversions.

@julienmalik
Copy link
Collaborator Author

@julienmalik
Copy link
Collaborator Author

Do NOT merge as-is since it is based on #753

@@ -487,7 +487,7 @@ OPJ_BOOL opj_tcd_rateallocate( opj_tcd_t *tcd,
OPJ_FLOAT64 lo = min;
OPJ_FLOAT64 hi = max;
OPJ_BOOL success = OPJ_FALSE;
OPJ_UINT32 maxlen = tcd_tcp->rates[layno] ? opj_uint_min(((OPJ_UINT32) ceil(tcd_tcp->rates[layno])), len) : len;
OPJ_UINT32 maxlen = tcd_tcp->rates[layno] > 0 ? opj_uint_min(((OPJ_UINT32) ceil(tcd_tcp->rates[layno])), len) : len;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't tcd_tcp->rates[layno] > 0.0f be more explicit ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@julienmalik julienmalik force-pushed the fix_implicit_floating_bool_conversion branch from 036d879 to 7117604 Compare April 27, 2016 07:14
@mayeut
Copy link
Collaborator

mayeut commented Apr 27, 2016

@julienmalik, could you refactor this PR following #753 merge

Thanks

@julienmalik julienmalik force-pushed the fix_implicit_floating_bool_conversion branch from 7117604 to e2d399f Compare April 28, 2016 07:54
@mayeut mayeut merged commit e982d03 into uclouvain:master Apr 28, 2016
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

Successfully merging this pull request may close these issues.

None yet

3 participants