gcc7: fix ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool… #1371

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@alagoutte
Contributor

…-context]

May be also update the comment

@alagoutte alagoutte gcc7: fix ‘*’ in boolean context, suggest ‘&&’ instead [-Wint-in-bool…
…-context]
ccf6b91

@alagoutte, thanks for your PR! By analyzing the history of the files in this pull request, we identified @yangtse, @bagder and @jay to be potential reviewers.

@bagder bagder added the build label Mar 30, 2017
@bagder
bagder approved these changes Mar 30, 2017 View changes

Yes, there's really no point in actually doing the math there.

@bagder bagder closed this in 244e0a3 Mar 30, 2017
Owner
bagder commented Mar 30, 2017

Thanks!

Contributor

May be also update the comment ?

So at this
* point returning a value different from sz*nmemb indicates failure. <=

Owner
bagder commented Mar 30, 2017

I don't think we need to. I think the comment explains the logic fine why we return what we do, even if it doesn't match the code exactly. Changing the comment to look like the code makes the language in the comment harder to follow I think?

Contributor

may be add different from sz*nmemb (ak sz && nmemb)

Owner
bagder commented Mar 30, 2017

The comment is based on the explanation in the man page:

This callback function must return the number of bytes actually taken care of. If that amount differs from the amount passed in to your function, it'll signal an error to the library.

... and sz * nbmemb is the actual size...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment