Skip to content

Fix implicit floating bool conversion#752

Merged
mayeut merged 4 commits intouclouvain:masterfrom
julienmalik:fix_implicit_floating_bool_conversion
Apr 28, 2016
Merged

Fix implicit floating bool conversion#752
mayeut merged 4 commits intouclouvain:masterfrom
julienmalik:fix_implicit_floating_bool_conversion

Conversation

@julienmalik
Copy link
Copy Markdown
Collaborator

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

@julienmalik
Copy link
Copy Markdown
Collaborator Author

@julienmalik
Copy link
Copy Markdown
Collaborator Author

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

Comment thread src/lib/openjp2/tcd.c Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

3 participants