-
Notifications
You must be signed in to change notification settings - Fork 466
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
Fix implicit floating bool conversion #752
Conversation
clang 3.9 warnings : |
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; |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
036d879
to
7117604
Compare
With or without the warning fixes : |
@julienmalik, could you refactor this PR following #753 merge Thanks |
…olean: 'OPJ_FLOAT32' (aka 'float') to '_Bool'
…olean: 'OPJ_FLOAT32' (aka 'float') to '_Bool'
7117604
to
e2d399f
Compare
clang reports a number of implicit float-to-bool conversions.