Skip to content
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

Merged
merged 2 commits into from
Nov 18, 2014
Merged

Don't rely on non-standard 'INT32_MAX' / 'INT32_MIN'. #84

merged 2 commits into from
Nov 18, 2014

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Nov 17, 2014

Define safe constants to use when padding enums.

Fixes #80.

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"
Copy link
Contributor

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>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 8b2aafe.

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Nov 17, 2014

Please sign Google CLA here: https://cla.developers.google.com/about/google-individual

Thanks!

@tseaver
Copy link
Contributor Author

tseaver commented Nov 18, 2014

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.

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Nov 18, 2014

Found it, thanks!

xfxyjwf added a commit that referenced this pull request Nov 18, 2014
Don't rely on non-standard 'INT32_MAX' / 'INT32_MIN'.
@xfxyjwf xfxyjwf merged commit 53c1029 into protocolbuffers:master Nov 18, 2014
@xfxyjwf
Copy link
Contributor

xfxyjwf commented Nov 19, 2014

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.

@tseaver
Copy link
Contributor Author

tseaver commented Nov 19, 2014

@xfxyjwf done.

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Nov 19, 2014

Thanks!

@tseaver tseaver deleted the fix_80-avoid_INT32_MAX_MIN branch November 19, 2014 00:18
TeBoring pushed a commit to TeBoring/protobuf that referenced this pull request Jan 19, 2019
Fix upb load descriptor when no messages defined in prorto.
bithium pushed a commit to bithium/protobuf that referenced this pull request Sep 4, 2023
…_MAX_MIN

Don't rely on non-standard 'INT32_MAX' / 'INT32_MIN'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'make check' fails on Ubuntu 12.04
2 participants