-
Notifications
You must be signed in to change notification settings - Fork 137
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 sign comparison warnings #437
base: master
Are you sure you want to change the base?
Conversation
@MitchellCash so does this more or less replace #366? |
to eliminate signed/unsigned comparison warnings
nFile's null value is -1. Cast that to unsigned int, to avoid warning. Additionally, avoid nFile==0 because the first valid value is 1.
7f81026
to
a35e228
Compare
this was in bitcoinrpc.cpp but has been moved since the original patch
@IngCr3at1on now it does ;) |
{ | ||
if (nRndPos1 == nRndPos2) | ||
return; | ||
|
||
assert(nRndPos1 >= 0 && nRndPos2 >= 0); |
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.
So essentially this is meant to ensure that the RndPos# variables are positive...
I'm wondering if there is any chance that they could ever be negative (if they were and this was left in place it would actually crash the application; I'm not sure what the behavior would be with this check missing); just because it was removed in Bitcoin doesn't necessarily mean it's safe or a good idea for us to remove it though...
Thoughts?
This does take some thunder from #366 but I think the commit messages are more detailed and it also includes some extra changes/improvements that #366 does not.