aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2015-02-17 18:23:41 -0800
committerJosh Haberman <jhaberman@gmail.com>2015-02-17 18:23:41 -0800
commitcb3caf1e61126fd18fa63e2a0e91bf71ab4ac3c9 (patch)
treee7e5dd284e2384dfaf1f8eff0eb2f3feab944872 /src/google/protobuf/compiler
parentf473bb9903370cc9324b0881873e0d0861f5d325 (diff)
downloadprotobuf-cb3caf1e61126fd18fa63e2a0e91bf71ab4ac3c9.tar.gz
protobuf-cb3caf1e61126fd18fa63e2a0e91bf71ab4ac3c9.tar.bz2
protobuf-cb3caf1e61126fd18fa63e2a0e91bf71ab4ac3c9.zip
Integrate changes from Google open-source branch.
Diffstat (limited to 'src/google/protobuf/compiler')
-rw-r--r--src/google/protobuf/compiler/parser_unittest.cc28
-rw-r--r--src/google/protobuf/compiler/python/python_generator.cc5
-rw-r--r--src/google/protobuf/compiler/python/python_generator.h3
-rw-r--r--src/google/protobuf/compiler/ruby/ruby_generator.cc7
4 files changed, 30 insertions, 13 deletions
diff --git a/src/google/protobuf/compiler/parser_unittest.cc b/src/google/protobuf/compiler/parser_unittest.cc
index 638a83b9..fe0719f8 100644
--- a/src/google/protobuf/compiler/parser_unittest.cc
+++ b/src/google/protobuf/compiler/parser_unittest.cc
@@ -401,13 +401,27 @@ TEST_F(ParseMessageTest, FieldDefaults) {
" field { type:TYPE_BOOL default_value:\"true\" " ETC " }"
" field { type_name:\"Foo\" default_value:\"FOO\" " ETC " }"
- " field { type:TYPE_INT32 default_value:\"2147483647\" " ETC " }"
- " field { type:TYPE_INT32 default_value:\"-2147483648\" " ETC " }"
- " field { type:TYPE_UINT32 default_value:\"4294967295\" " ETC " }"
- " field { type:TYPE_INT64 default_value:\"9223372036854775807\" " ETC " }"
- " field { type:TYPE_INT64 default_value:\"-9223372036854775808\" " ETC " }"
- " field { type:TYPE_UINT64 default_value:\"18446744073709551615\" " ETC " }"
- " field { type:TYPE_DOUBLE default_value:\"43981\" " ETC " }"
+ " field {"
+ " type:TYPE_INT32 default_value:\"2147483647\" " ETC
+ " }"
+ " field {"
+ " type:TYPE_INT32 default_value:\"-2147483648\" " ETC
+ " }"
+ " field {"
+ " type:TYPE_UINT32 default_value:\"4294967295\" " ETC
+ " }"
+ " field {"
+ " type:TYPE_INT64 default_value:\"9223372036854775807\" " ETC
+ " }"
+ " field {"
+ " type:TYPE_INT64 default_value:\"-9223372036854775808\" " ETC
+ " }"
+ " field {"
+ " type:TYPE_UINT64 default_value:\"18446744073709551615\" " ETC
+ " }"
+ " field {"
+ " type:TYPE_DOUBLE default_value:\"43981\" " ETC
+ " }"
"}");
#undef ETC
}
diff --git a/src/google/protobuf/compiler/python/python_generator.cc b/src/google/protobuf/compiler/python/python_generator.cc
index b30d1972..0c65b993 100644
--- a/src/google/protobuf/compiler/python/python_generator.cc
+++ b/src/google/protobuf/compiler/python/python_generator.cc
@@ -581,14 +581,15 @@ void Generator::PrintServiceDescriptor(
}
-void Generator::PrintDescriptorKeyAndModuleName(const ServiceDescriptor& descriptor) const {
+void Generator::PrintDescriptorKeyAndModuleName(
+ const ServiceDescriptor& descriptor) const {
printer_->Print(
"$descriptor_key$ = $descriptor_name$,\n",
"descriptor_key", kDescriptorKey,
"descriptor_name", ModuleLevelServiceDescriptorName(descriptor));
printer_->Print(
"__module__ = '$module_name$'\n",
- "module_name", ModuleName(file_->name()));
+ "module_name", ModuleName(file_->name()));
}
void Generator::PrintServiceClass(const ServiceDescriptor& descriptor) const {
diff --git a/src/google/protobuf/compiler/python/python_generator.h b/src/google/protobuf/compiler/python/python_generator.h
index ee68ad72..2ddac601 100644
--- a/src/google/protobuf/compiler/python/python_generator.h
+++ b/src/google/protobuf/compiler/python/python_generator.h
@@ -127,7 +127,8 @@ class LIBPROTOC_EXPORT Generator : public CodeGenerator {
void PrintServiceDescriptor(const ServiceDescriptor& descriptor) const;
void PrintServiceClass(const ServiceDescriptor& descriptor) const;
void PrintServiceStub(const ServiceDescriptor& descriptor) const;
- void PrintDescriptorKeyAndModuleName(const ServiceDescriptor& descriptor) const ;
+ void PrintDescriptorKeyAndModuleName(
+ const ServiceDescriptor& descriptor) const ;
void PrintEnumValueDescriptor(const EnumValueDescriptor& descriptor) const;
string OptionsValue(const string& class_name,
diff --git a/src/google/protobuf/compiler/ruby/ruby_generator.cc b/src/google/protobuf/compiler/ruby/ruby_generator.cc
index 82ccd72b..6fed1d46 100644
--- a/src/google/protobuf/compiler/ruby/ruby_generator.cc
+++ b/src/google/protobuf/compiler/ruby/ruby_generator.cc
@@ -47,7 +47,7 @@ namespace compiler {
namespace ruby {
// Forward decls.
-std::string IntToString(uint32_t value);
+std::string IntToString(uint32 value);
std::string StripDotProto(const std::string& proto_file);
std::string LabelForField(google::protobuf::FieldDescriptor* field);
std::string TypeName(google::protobuf::FieldDescriptor* field);
@@ -64,7 +64,7 @@ void GenerateEnumAssignment(
const google::protobuf::EnumDescriptor* en,
google::protobuf::io::Printer* printer);
-std::string IntToString(uint32_t value) {
+std::string IntToString(uint32 value) {
std::ostringstream os;
os << value;
return os.str();
@@ -299,7 +299,8 @@ bool Generator::Generate(
string* error) const {
std::string filename =
StripDotProto(file->name()) + ".rb";
- scoped_ptr<io::ZeroCopyOutputStream> output(generator_context->Open(filename));
+ scoped_ptr<io::ZeroCopyOutputStream> output(
+ generator_context->Open(filename));
io::Printer printer(output.get(), '$');
GenerateFile(file, &printer);