Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc b/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc
index e42ec2801fcb269a5f3de1d7d336549cdf4af8eb..fa1047e874a553ce20132905eb8251faffab6c6c 100644
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc
+++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.cc
@@ -61,7 +61,7 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor,
int builderBitIndex,
const FieldGeneratorInfo* info,
ClassNameResolver* name_resolver,
- map<string, string>* variables) {
+ std::map<string, string>* variables) {
SetCommonFieldVariables(descriptor, info, variables);
(*variables)["type"] = PrimitiveTypeName(GetJavaType(descriptor));
@@ -75,7 +75,8 @@ void SetPrimitiveVariables(const FieldDescriptor* descriptor,
"" : ("= " + ImmutableDefaultValue(descriptor, name_resolver));
(*variables)["capitalized_type"] =
GetCapitalizedType(descriptor, /* immutable = */ true);
- (*variables)["tag"] = SimpleItoa(WireFormat::MakeTag(descriptor));
+ (*variables)["tag"] =
+ SimpleItoa(static_cast<int32>(WireFormat::MakeTag(descriptor)));
(*variables)["tag_size"] = SimpleItoa(
WireFormat::TagSize(descriptor->number(), GetType(descriptor)));
if (IsReferenceType(GetJavaType(descriptor))) {
@@ -777,8 +778,8 @@ GenerateSerializationCode(io::Printer* printer) const {
// That makes it safe to rely on the memoized size here.
printer->Print(variables_,
"if (get$capitalized_name$List().size() > 0) {\n"
- " output.writeRawVarint32($tag$);\n"
- " output.writeRawVarint32($name$MemoizedSerializedSize);\n"
+ " output.writeUInt32NoTag($tag$);\n"
+ " output.writeUInt32NoTag($name$MemoizedSerializedSize);\n"
"}\n"
"for (int i = 0; i < $name$_.size(); i++) {\n"
" output.write$capitalized_type$NoTag($name$_.get(i));\n"

Powered by Google App Engine
This is Rietveld 408576698