aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/any.pb.h6
-rw-r--r--src/google/protobuf/api.pb.h6
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_file.cc6
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message.cc102
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_reflection_class.cc6
-rw-r--r--src/google/protobuf/compiler/plugin.pb.h6
-rw-r--r--src/google/protobuf/descriptor.pb.h6
-rw-r--r--src/google/protobuf/duration.pb.h6
-rw-r--r--src/google/protobuf/empty.pb.h6
-rw-r--r--src/google/protobuf/field_mask.pb.h6
-rw-r--r--src/google/protobuf/source_context.pb.h6
-rw-r--r--src/google/protobuf/struct.pb.h6
-rw-r--r--src/google/protobuf/stubs/structurally_valid.cc31
-rw-r--r--src/google/protobuf/stubs/structurally_valid_unittest.cc30
-rw-r--r--src/google/protobuf/timestamp.pb.h6
-rw-r--r--src/google/protobuf/type.pb.h6
-rw-r--r--src/google/protobuf/util/json_util.h8
-rw-r--r--src/google/protobuf/wrappers.pb.h6
18 files changed, 172 insertions, 83 deletions
diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h
index 673d335a..40890d41 100644
--- a/src/google/protobuf/any.pb.h
+++ b/src/google/protobuf/any.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/any.proto
-#ifndef PROTOBUF_google_2fprotobuf_2fany_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fany_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2fany_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2fany_2eproto_INCLUDED
#include <string>
@@ -329,4 +329,4 @@ inline void Any::set_allocated_value(::std::string* value) {
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2fany_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2fany_2eproto_INCLUDED
diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h
index ffcba0fd..b329e1ae 100644
--- a/src/google/protobuf/api.pb.h
+++ b/src/google/protobuf/api.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/api.proto
-#ifndef PROTOBUF_google_2fprotobuf_2fapi_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fapi_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2fapi_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2fapi_2eproto_INCLUDED
#include <string>
@@ -1182,4 +1182,4 @@ inline void Mixin::set_allocated_root(::std::string* root) {
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2fapi_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2fapi_2eproto_INCLUDED
diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc
index 1f90ae43..a922ee97 100644
--- a/src/google/protobuf/compiler/cpp/cpp_file.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_file.cc
@@ -1145,8 +1145,8 @@ void FileGenerator::GenerateTopHeaderGuard(io::Printer* printer,
"// Generated by the protocol buffer compiler. DO NOT EDIT!\n"
"// source: $filename$\n"
"\n"
- "#ifndef PROTOBUF_$filename_identifier$__INCLUDED\n"
- "#define PROTOBUF_$filename_identifier$__INCLUDED\n"
+ "#ifndef PROTOBUF_$filename_identifier$_INCLUDED\n"
+ "#define PROTOBUF_$filename_identifier$_INCLUDED\n"
"\n"
"#include <string>\n",
"filename", file_->name(), "filename_identifier", filename_identifier);
@@ -1156,7 +1156,7 @@ void FileGenerator::GenerateTopHeaderGuard(io::Printer* printer,
void FileGenerator::GenerateBottomHeaderGuard(
io::Printer* printer, const string& filename_identifier) {
printer->Print(
- "#endif // PROTOBUF_$filename_identifier$__INCLUDED\n",
+ "#endif // PROTOBUF_$filename_identifier$_INCLUDED\n",
"filename_identifier", filename_identifier);
}
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc
index ad9f8a16..17b4a071 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_message.cc
@@ -111,7 +111,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
WriteMessageDocComment(printer, descriptor_);
AddDeprecatedFlag(printer);
-
+
printer->Print(
vars,
"$access_level$ sealed partial class $class_name$ : pb::IMessage<$class_name$> {\n");
@@ -119,14 +119,17 @@ void MessageGenerator::Generate(io::Printer* printer) {
// All static fields and properties
printer->Print(
- vars,
- "private static readonly pb::MessageParser<$class_name$> _parser = new pb::MessageParser<$class_name$>(() => new $class_name$());\n");
+ vars,
+ "private static readonly pb::MessageParser<$class_name$> _parser = new pb::MessageParser<$class_name$>(() => new $class_name$());\n");
+
+ printer->Print(
+ "private pb::UnknownFieldSet _unknownFields;\n");
WriteGeneratedCodeAttributes(printer);
printer->Print(
- vars,
- "public static pb::MessageParser<$class_name$> Parser { get { return _parser; } }\n\n");
+ vars,
+ "public static pb::MessageParser<$class_name$> Parser { get { return _parser; } }\n\n");
// Access the message descriptor via the relevant file descriptor or containing message descriptor.
if (!descriptor_->containing_type()) {
@@ -139,14 +142,14 @@ void MessageGenerator::Generate(io::Printer* printer) {
WriteGeneratedCodeAttributes(printer);
printer->Print(
- vars,
- "public static pbr::MessageDescriptor Descriptor {\n"
- " get { return $descriptor_accessor$; }\n"
- "}\n"
- "\n");
+ vars,
+ "public static pbr::MessageDescriptor Descriptor {\n"
+ " get { return $descriptor_accessor$; }\n"
+ "}\n"
+ "\n");
WriteGeneratedCodeAttributes(printer);
printer->Print(
- vars,
+ vars,
"pbr::MessageDescriptor pb::IMessage.Descriptor {\n"
" get { return Descriptor; }\n"
"}\n"
@@ -209,18 +212,18 @@ void MessageGenerator::Generate(io::Printer* printer) {
printer->Print("}\n");
// TODO: Should we put the oneof .proto comments here?
// It's unclear exactly where they should go.
- printer->Print(
- vars,
- "private $property_name$OneofCase $name$Case_ = $property_name$OneofCase.None;\n");
- WriteGeneratedCodeAttributes(printer);
- printer->Print(
- vars,
- "public $property_name$OneofCase $property_name$Case {\n"
- " get { return $name$Case_; }\n"
- "}\n\n");
- WriteGeneratedCodeAttributes(printer);
- printer->Print(
- vars,
+ printer->Print(
+ vars,
+ "private $property_name$OneofCase $name$Case_ = $property_name$OneofCase.None;\n");
+ WriteGeneratedCodeAttributes(printer);
+ printer->Print(
+ vars,
+ "public $property_name$OneofCase $property_name$Case {\n"
+ " get { return $name$Case_; }\n"
+ "}\n\n");
+ WriteGeneratedCodeAttributes(printer);
+ printer->Print(
+ vars,
"public void Clear$property_name$() {\n"
" $name$Case_ = $property_name$OneofCase.None;\n"
" $name$_ = null;\n"
@@ -317,6 +320,9 @@ void MessageGenerator::GenerateCloningCode(io::Printer* printer) {
printer->Outdent();
printer->Print("}\n\n");
}
+ // Clone unknown fields
+ printer->Print(
+ "_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);\n");
printer->Outdent();
printer->Print("}\n\n");
@@ -337,15 +343,15 @@ void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
vars["class_name"] = class_name();
// Equality
- WriteGeneratedCodeAttributes(printer);
+ WriteGeneratedCodeAttributes(printer);
printer->Print(
vars,
"public override bool Equals(object other) {\n"
" return Equals(other as $class_name$);\n"
"}\n\n");
- WriteGeneratedCodeAttributes(printer);
- printer->Print(
- vars,
+ WriteGeneratedCodeAttributes(printer);
+ printer->Print(
+ vars,
"public bool Equals($class_name$ other) {\n"
" if (ReferenceEquals(other, null)) {\n"
" return false;\n"
@@ -365,13 +371,13 @@ void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
}
printer->Outdent();
printer->Print(
- " return true;\n"
+ " return Equals(_unknownFields, other._unknownFields);\n"
"}\n\n");
// GetHashCode
// Start with a non-zero value to easily distinguish between null and "empty" messages.
- WriteGeneratedCodeAttributes(printer);
- printer->Print(
+ WriteGeneratedCodeAttributes(printer);
+ printer->Print(
"public override int GetHashCode() {\n"
" int hash = 1;\n");
printer->Indent();
@@ -384,12 +390,16 @@ void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
printer->Print("hash ^= (int) $name$Case_;\n",
"name", UnderscoresToCamelCase(descriptor_->oneof_decl(i)->name(), false));
}
- printer->Print("return hash;\n");
+ printer->Print(
+ "if (_unknownFields != null) {\n"
+ " hash ^= _unknownFields.GetHashCode();\n"
+ "}\n"
+ "return hash;\n");
printer->Outdent();
printer->Print("}\n\n");
- WriteGeneratedCodeAttributes(printer);
- printer->Print(
+ WriteGeneratedCodeAttributes(printer);
+ printer->Print(
"public override string ToString() {\n"
" return pb::JsonFormatter.ToDiagnosticString(this);\n"
"}\n\n");
@@ -408,11 +418,17 @@ void MessageGenerator::GenerateMessageSerializationMethods(io::Printer* printer)
generator->GenerateSerializationCode(printer);
}
+ // Serialize unknown fields
+ printer->Print(
+ "if (_unknownFields != null) {\n"
+ " _unknownFields.WriteTo(output);\n"
+ "}\n");
+
// TODO(jonskeet): Memoize size of frozen messages?
printer->Outdent();
printer->Print(
- "}\n"
- "\n");
+ "}\n"
+ "\n");
WriteGeneratedCodeAttributes(printer);
printer->Print(
"public int CalculateSize() {\n");
@@ -423,6 +439,12 @@ void MessageGenerator::GenerateMessageSerializationMethods(io::Printer* printer)
CreateFieldGeneratorInternal(descriptor_->field(i)));
generator->GenerateSerializedSizeCode(printer);
}
+
+ printer->Print(
+ "if (_unknownFields != null) {\n"
+ " size += _unknownFields.CalculateSize();\n"
+ "}\n");
+
printer->Print("return size;\n");
printer->Outdent();
printer->Print("}\n\n");
@@ -473,8 +495,14 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
printer->Outdent();
printer->Print("}\n\n");
}
+ // Merge unknown fields.
+ printer->Print(
+ "_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);\n");
+
printer->Outdent();
printer->Print("}\n\n");
+
+
WriteGeneratedCodeAttributes(printer);
printer->Print("public void MergeFrom(pb::CodedInputStream input) {\n");
printer->Indent();
@@ -486,14 +514,14 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
printer->Indent();
// Option messages need to store unknown fields so that options can be parsed later.
if (IsDescriptorOptionMessage(descriptor_)) {
- printer->Print(
+ printer->Print(
"default:\n"
" CustomOptions = CustomOptions.ReadOrSkipUnknownField(input);\n"
" break;\n");
} else {
printer->Print(
"default:\n"
- " input.SkipLastField();\n" // We're not storing the data, but we still need to consume it.
+ " _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);\n"
" break;\n");
}
for (int i = 0; i < fields_by_number().size(); i++) {
diff --git a/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc b/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
index bac9aef7..5ddd616e 100644
--- a/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_reflection_class.cc
@@ -104,8 +104,10 @@ void ReflectionClassGenerator::Generate(io::Printer* printer) {
void ReflectionClassGenerator::WriteIntroduction(io::Printer* printer) {
printer->Print(
- "// Generated by the protocol buffer compiler. DO NOT EDIT!\n"
- "// source: $file_name$\n"
+ "// <auto-generated>\n"
+ "// Generated by the protocol buffer compiler. DO NOT EDIT!\n"
+ "// source: $file_name$\n"
+ "// </auto-generated>\n"
"#pragma warning disable 1591, 0612, 3021\n"
"#region Designer generated code\n"
"\n"
diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h
index 9618ec00..1fb3061a 100644
--- a/src/google/protobuf/compiler/plugin.pb.h
+++ b/src/google/protobuf/compiler/plugin.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/compiler/plugin.proto
-#ifndef PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto_INCLUDED
#include <string>
@@ -1383,4 +1383,4 @@ CodeGeneratorResponse::file() const {
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2fcompiler_2fplugin_2eproto_INCLUDED
diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h
index 3f964afe..ae71d619 100644
--- a/src/google/protobuf/descriptor.pb.h
+++ b/src/google/protobuf/descriptor.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/descriptor.proto
-#ifndef PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto_INCLUDED
#include <string>
@@ -11613,4 +11613,4 @@ inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::MethodOption
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto_INCLUDED
diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h
index bc1a043e..376b28f3 100644
--- a/src/google/protobuf/duration.pb.h
+++ b/src/google/protobuf/duration.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/duration.proto
-#ifndef PROTOBUF_google_2fprotobuf_2fduration_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fduration_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2fduration_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2fduration_2eproto_INCLUDED
#include <string>
@@ -238,4 +238,4 @@ inline void Duration::set_nanos(::google::protobuf::int32 value) {
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2fduration_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2fduration_2eproto_INCLUDED
diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h
index 88be1475..505fc3c0 100644
--- a/src/google/protobuf/empty.pb.h
+++ b/src/google/protobuf/empty.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/empty.proto
-#ifndef PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2fempty_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2fempty_2eproto_INCLUDED
#include <string>
@@ -196,4 +196,4 @@ class LIBPROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2fempty_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2fempty_2eproto_INCLUDED
diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h
index 76be06a7..8773499d 100644
--- a/src/google/protobuf/field_mask.pb.h
+++ b/src/google/protobuf/field_mask.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/field_mask.proto
-#ifndef PROTOBUF_google_2fprotobuf_2ffield_5fmask_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2ffield_5fmask_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2ffield_5fmask_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2ffield_5fmask_2eproto_INCLUDED
#include <string>
@@ -273,4 +273,4 @@ FieldMask::mutable_paths() {
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2ffield_5fmask_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2ffield_5fmask_2eproto_INCLUDED
diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h
index 9f8255cd..c974ea89 100644
--- a/src/google/protobuf/source_context.pb.h
+++ b/src/google/protobuf/source_context.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/source_context.proto
-#ifndef PROTOBUF_google_2fprotobuf_2fsource_5fcontext_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fsource_5fcontext_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2fsource_5fcontext_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2fsource_5fcontext_2eproto_INCLUDED
#include <string>
@@ -249,4 +249,4 @@ inline void SourceContext::set_allocated_file_name(::std::string* file_name) {
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2fsource_5fcontext_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2fsource_5fcontext_2eproto_INCLUDED
diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h
index ada1a189..8f1b064d 100644
--- a/src/google/protobuf/struct.pb.h
+++ b/src/google/protobuf/struct.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/struct.proto
-#ifndef PROTOBUF_google_2fprotobuf_2fstruct_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fstruct_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2fstruct_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2fstruct_2eproto_INCLUDED
#include <string>
@@ -1039,4 +1039,4 @@ inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::NullValue>()
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2fstruct_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2fstruct_2eproto_INCLUDED
diff --git a/src/google/protobuf/stubs/structurally_valid.cc b/src/google/protobuf/stubs/structurally_valid.cc
index d79a6ee4..b2239682 100644
--- a/src/google/protobuf/stubs/structurally_valid.cc
+++ b/src/google/protobuf/stubs/structurally_valid.cc
@@ -1,4 +1,33 @@
-// Copyright 2005-2008 Google Inc. All Rights Reserved.
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
// Author: jrm@google.com (Jim Meehan)
#include <google/protobuf/stubs/common.h>
diff --git a/src/google/protobuf/stubs/structurally_valid_unittest.cc b/src/google/protobuf/stubs/structurally_valid_unittest.cc
index 90888885..eec07a87 100644
--- a/src/google/protobuf/stubs/structurally_valid_unittest.cc
+++ b/src/google/protobuf/stubs/structurally_valid_unittest.cc
@@ -1,3 +1,33 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc. All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
// Copyright 2008 Google Inc. All Rights Reserved.
// Author: xpeng@google.com (Peter Peng)
diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h
index 31936ff2..8e5911fe 100644
--- a/src/google/protobuf/timestamp.pb.h
+++ b/src/google/protobuf/timestamp.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/timestamp.proto
-#ifndef PROTOBUF_google_2fprotobuf_2ftimestamp_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2ftimestamp_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2ftimestamp_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2ftimestamp_2eproto_INCLUDED
#include <string>
@@ -238,4 +238,4 @@ inline void Timestamp::set_nanos(::google::protobuf::int32 value) {
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2ftimestamp_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2ftimestamp_2eproto_INCLUDED
diff --git a/src/google/protobuf/type.pb.h b/src/google/protobuf/type.pb.h
index 7a2135c4..c5e800c3 100644
--- a/src/google/protobuf/type.pb.h
+++ b/src/google/protobuf/type.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/type.proto
-#ifndef PROTOBUF_google_2fprotobuf_2ftype_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2ftype_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2ftype_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2ftype_2eproto_INCLUDED
#include <string>
@@ -2403,4 +2403,4 @@ inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::Syntax>() {
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2ftype_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2ftype_2eproto_INCLUDED
diff --git a/src/google/protobuf/util/json_util.h b/src/google/protobuf/util/json_util.h
index dee3ddba..b1c69813 100644
--- a/src/google/protobuf/util/json_util.h
+++ b/src/google/protobuf/util/json_util.h
@@ -56,10 +56,10 @@ struct JsonPrintOptions {
// Whether to add spaces, line breaks and indentation to make the JSON output
// easy to read.
bool add_whitespace;
- // Whether to always print primitive fields. By default primitive fields with
- // default values will be omitted in JSON joutput. For example, an int32 field
- // set to 0 will be omitted. Set this flag to true will override the default
- // behavior and print primitive fields regardless of their values.
+ // Whether to always print primitive fields. By default proto3 primitive
+ // fields with default values will be omitted in JSON output. For example, an
+ // int32 field set to 0 will be omitted. Set this flag to true will override
+ // the default behavior and print primitive fields regardless of their values.
bool always_print_primitive_fields;
// Whether to always print enums as ints. By default they are rendered as
// strings.
diff --git a/src/google/protobuf/wrappers.pb.h b/src/google/protobuf/wrappers.pb.h
index 18c7a2cd..e533ca1d 100644
--- a/src/google/protobuf/wrappers.pb.h
+++ b/src/google/protobuf/wrappers.pb.h
@@ -1,8 +1,8 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/protobuf/wrappers.proto
-#ifndef PROTOBUF_google_2fprotobuf_2fwrappers_2eproto__INCLUDED
-#define PROTOBUF_google_2fprotobuf_2fwrappers_2eproto__INCLUDED
+#ifndef PROTOBUF_google_2fprotobuf_2fwrappers_2eproto_INCLUDED
+#define PROTOBUF_google_2fprotobuf_2fwrappers_2eproto_INCLUDED
#include <string>
@@ -1533,4 +1533,4 @@ inline void BytesValue::unsafe_arena_set_allocated_value(
// @@protoc_insertion_point(global_scope)
-#endif // PROTOBUF_google_2fprotobuf_2fwrappers_2eproto__INCLUDED
+#endif // PROTOBUF_google_2fprotobuf_2fwrappers_2eproto_INCLUDED