-
Notifications
You must be signed in to change notification settings - Fork 778
Resolve some default error warnings #7191
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
Resolve some default error warnings #7191
Conversation
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.
LGTM
DxilContainerValidation.cpp has some int / bool comparisons that cause default error warnings in some of the private builds. This needs to be addressed. This PR changes the comparisons by converting the numerical expressions into the appropriate boolean, then comparing the booleans.
DxilContainerValidation.cpp has some int / bool comparisons that cause default error warnings in some of the private builds. This needs to be addressed. This PR changes the comparisons by converting the numerical expressions into the appropriate boolean, then comparing the booleans.
else | ||
Mismatch |= PSVSE0->SemanticKind != static_cast<uint8_t>(SE.GetKind()); | ||
Mismatch |= PSVSE0->SemanticKind != static_cast<uint8_t>(SE.GetKind()) == 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.
This change was unnecessary, plus it scares me a bit how we would be dependent on a left to right order of evaluating the comparison operations without parentheses to enforce the correct order (and the final comparison is basically (bool) == (int)
).
Also, we could use != 0
everywhere instead of == 0 ? false : true
. That would be keeping with most of the other similar code elsewhere in this file, and it's easier to read.
DxilContainerValidation.cpp has some int / bool comparisons that cause default error warnings in some of the private builds. This needs to be addressed. This PR changes the comparisons by converting the numerical expressions into the appropriate boolean, then comparing the booleans.
DxilContainerValidation.cpp has some int / bool comparisons that cause default error warnings in some of the private builds.
This needs to be addressed. This PR changes the comparisons by converting the numerical expressions into the appropriate boolean, then comparing the booleans.