aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/csharp/csharp_message.cc
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2016-04-06 10:17:13 +0100
committerJon Skeet <jonskeet@google.com>2016-04-06 10:17:13 +0100
commitbfd1c84a3dab01683c4e97dc401f5a4a264a7e7e (patch)
tree1402a1f716d65adce7b27bd0d1cb01c636e27606 /src/google/protobuf/compiler/csharp/csharp_message.cc
parent89719f07a35bee3c20e746944773587ac2a47444 (diff)
downloadprotobuf-bfd1c84a3dab01683c4e97dc401f5a4a264a7e7e.tar.gz
protobuf-bfd1c84a3dab01683c4e97dc401f5a4a264a7e7e.tar.bz2
protobuf-bfd1c84a3dab01683c4e97dc401f5a4a264a7e7e.zip
Line-wrapping changes only for C# generator code
This should have no behavioral changes at all. This doesn't strictly enforce an 80-column limit, but removes the most egregious violations. The indentation in the C# generator code is inconsistent in general, unfortunately - if we have any good tools that can be trusted to reformat, I'd be happy to apply them.
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_message.cc')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc
index 3b54040d..532da6b9 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_message.cc
@@ -60,7 +60,8 @@ bool CompareFieldNumbers(const FieldDescriptor* d1, const FieldDescriptor* d2) {
return d1->number() < d2->number();
}
-MessageGenerator::MessageGenerator(const Descriptor* descriptor, const Options* options)
+MessageGenerator::MessageGenerator(const Descriptor* descriptor,
+ const Options* options)
: SourceGeneratorBase(descriptor->file(), options),
descriptor_(descriptor) {
@@ -185,7 +186,8 @@ void MessageGenerator::Generate(io::Printer* printer) {
}
printer->Outdent();
printer->Print("}\n");
- // TODO: Should we put the oneof .proto comments here? It's unclear exactly where they should go.
+ // 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"
@@ -220,7 +222,8 @@ void MessageGenerator::Generate(io::Printer* printer) {
for (int i = 0; i < descriptor_->nested_type_count(); i++) {
// Don't generate nested types for maps...
if (!IsMapEntryMessage(descriptor_->nested_type(i))) {
- MessageGenerator messageGenerator(descriptor_->nested_type(i), this->options());
+ MessageGenerator messageGenerator(
+ descriptor_->nested_type(i), this->options());
messageGenerator.Generate(printer);
}
}
@@ -268,7 +271,8 @@ void MessageGenerator::GenerateCloningCode(io::Printer* printer) {
// Clone just the right field for each oneof
for (int i = 0; i < descriptor_->oneof_decl_count(); ++i) {
vars["name"] = UnderscoresToCamelCase(descriptor_->oneof_decl(i)->name(), false);
- vars["property_name"] = UnderscoresToCamelCase(descriptor_->oneof_decl(i)->name(), true);
+ vars["property_name"] = UnderscoresToCamelCase(
+ descriptor_->oneof_decl(i)->name(), true);
printer->Print(vars, "switch (other.$property_name$Case) {\n");
printer->Indent();
for (int j = 0; j < descriptor_->oneof_decl(i)->field_count(); j++) {
@@ -449,7 +453,8 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
uint32 tag = internal::WireFormatLite::MakeTag(field->number(), wt);
// Handle both packed and unpacked repeated fields with the same Read*Array call;
// the two generated cases are the packed and unpacked tags.
- // TODO(jonskeet): Check that is_packable is equivalent to is_repeated && wt in { VARINT, FIXED32, FIXED64 }.
+ // TODO(jonskeet): Check that is_packable is equivalent to
+ // is_repeated && wt in { VARINT, FIXED32, FIXED64 }.
// It looks like it is...
if (field->is_packable()) {
printer->Print(