aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler
diff options
context:
space:
mode:
authorGravatar Austin Schuh <austin@peloton-tech.com>2015-06-05 22:46:01 -0700
committerGravatar Austin Schuh <austin@peloton-tech.com>2015-06-05 22:46:01 -0700
commit307af628e646cd67e659f327e549542c0f5e31b7 (patch)
treefba88b384ea6c70fd46edccd412e81e81430a77d /src/google/protobuf/compiler
parent68975a4e5071c5159258770edceec925e73ca2de (diff)
Marked another compiler literal unsigned.
When compiling a protobuf with gcc 4.1.2 for powerpc, I ran into another of the following warning message: INFO: From Compiling my_proto.pb.cc powerpc-603e-linux-gcc: bazel-out/local_linux-dbg/genfiles/my_proto.pb.cc: In member function `virtual void MyProto::Clear()': bazel-out/local_linux-dbg/genfiles/my_proto.pb.cc:223: warning: this decimal constant is unsigned only in ISO C90 The line in the proto file that was triggering it was: if (_has_bits_[24 / 32] & 4278190080) { ZR_(field1_, field2_); } _has_bits_ is a uint32. The constant mask should therefore be unsigned. This change updates the constant to be generated as unsigned.
Diffstat (limited to 'src/google/protobuf/compiler')
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_message.cc2
-rw-r--r--src/google/protobuf/compiler/plugin.pb.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc
index 212fe2e1..af85919a 100644
--- a/src/google/protobuf/compiler/cpp/cpp_message.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_message.cc
@@ -3510,7 +3510,7 @@ GenerateByteSize(io::Printer* printer) {
} else {
if (HasFieldPresence(descriptor_->file())) {
printer->Print(
- "if (_has_bits_[$index$ / 32] & $mask$) {\n",
+ "if (_has_bits_[$index$ / 32] & $mask$u) {\n",
"index", SimpleItoa(i),
"mask", SimpleItoa(mask));
printer->Indent();
diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc
index 344ed450..e7890fae 100644
--- a/src/google/protobuf/compiler/plugin.pb.cc
+++ b/src/google/protobuf/compiler/plugin.pb.cc
@@ -913,7 +913,7 @@ void CodeGeneratorResponse_File::SerializeWithCachedSizes(
int CodeGeneratorResponse_File::ByteSize() const {
int total_size = 0;
- if (_has_bits_[0 / 32] & 7) {
+ if (_has_bits_[0 / 32] & 7u) {
// optional string name = 1;
if (has_name()) {
total_size += 1 +