-
Notifications
You must be signed in to change notification settings - Fork 257
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
Small changes made according to static analyzer results #42
Conversation
…and 'false' & IsBitSet() It seems that ' : 1' alignments cause signed integers to be either -1 or 0. While -1 is true and 0 is false reverse might not be always correct when true is defined 1. Maybe change feature variables to bool ?
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
CLAs look good, thanks! |
So unfortunately this PR is changing the API and may break client code. |
… 'true' and 'false' & IsBitSet()" This reverts commit 319bd6f.
Sync with head
I have realized that bit_utils.h is internal so made some changes there instead of structs. Still not the best but I could not think any other solution without changing structures. |
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.
Let's set 58a232c aside for now. I have to think this through. The rest of the PR is welcome though.
Yeah it is definitely not the best way since something like x == TRUE can result in absolute mess if TRUE is used instead of true mistakenly. I could not think any other high level change to fix this so I agree that this commit should be dropped in favor of a potential lower level change later. I'm reverting this commit now. |
Thx a lot for your patience and for contributing to |
Sure! |
I did not want to to change type of feature variables since it seems that they are getting accessed directly by other projects but could not find any other solution. Making them bool would probably break portability. Other option might be defining TRUE as -1 then modifying related parts.
Feature variable returning functions (Get...FeaturesEnumValue) are kept intact as automatic casting should not cause any problem. And because variables are all aligned, there should be no warning because of this casting in compilers other than VS. (I did not test though).