-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Don't rely on non-standard 'INT32_MAX' / 'INT32_MIN'. #84
Don't rely on non-standard 'INT32_MAX' / 'INT32_MIN'. #84
Conversation
Define safe constants to use when padding enums. Fixes #80.
@@ -106,8 +106,8 @@ void EnumGenerator::GenerateDefinition(io::Printer* printer) { | |||
// INT32_MIN and INT32_MAX | |||
if (descriptor_->value_count() > 0) printer->Print(",\n"); | |||
printer->Print(vars, | |||
"$classname$_$prefix$INT_MIN_SENTINEL_DO_NOT_USE_ = INT32_MIN,\n" | |||
"$classname$_$prefix$INT_MAX_SENTINEL_DO_NOT_USE_ = INT32_MAX"); | |||
"$classname$_$prefix$INT_MIN_SENTINEL_DO_NOT_USE_ = PROTOBUF_ENUM_MIN,\n" |
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.
Can you change them to use "kint32min" and "kint32max" (defined here) and remove the inclusion of <stdint.h>?
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.
Done in 8b2aafe.
Please sign Google CLA here: https://cla.developers.google.com/about/google-individual Thanks! |
I've signed both the individual CLA and the corporate one on behalf of my company, Agendaless Consulting, Inc. @silvolu can confirm that I am currently on contract with Google, working on the https://github.com/GoogleCloudPlatform/gcloud-python project. |
Incorporates feedback from @xfxyjwf: #84 (comment).
Found it, thanks! |
Don't rely on non-standard 'INT32_MAX' / 'INT32_MIN'.
Hi Tres, I couldn't find your signed CLA on our new CLA query system (but could find it in the old one). I contacted the team maintaing the new query system and was told that you need to sign the CLA again to have the information updated there. Could you please help do so? It's not necessary but would help us to identify you as a CLA signer when accepting your patches. |
@xfxyjwf done. |
Thanks! |
Fix upb load descriptor when no messages defined in prorto.
…_MAX_MIN Don't rely on non-standard 'INT32_MAX' / 'INT32_MIN'.
Define safe constants to use when padding enums.
Fixes #80.