From c4642f8b3d21d9d519afa243ebf6c733ce802b5e Mon Sep 17 00:00:00 2001 From: Carl Mastrangelo Date: Tue, 17 Jan 2017 12:50:25 -0800 Subject: [PATCH] compile: add std:: to all stl types --- .../src/java_plugin/cpp/java_generator.cpp | 46 +++++++++---------- compiler/src/java_plugin/cpp/java_plugin.cpp | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp index 6cfb97a43d..910c2c0ed7 100644 --- a/compiler/src/java_plugin/cpp/java_generator.cpp +++ b/compiler/src/java_plugin/cpp/java_generator.cpp @@ -133,14 +133,14 @@ static void GrpcSplitStringToIteratorUsing(const string& full, // TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. static void GrpcSplitStringUsing(const string& full, const char* delim, - vector* result) { - std::back_insert_iterator< vector > it(*result); + std::vector* result) { + std::back_insert_iterator< std::vector > it(*result); GrpcSplitStringToIteratorUsing(full, delim, it); } // TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. -static vector GrpcSplit(const string& full, const char* delim) { - vector result; +static std::vector GrpcSplit(const string& full, const char* delim) { + std::vector result; GrpcSplitStringUsing(full, delim, &result); return result; } @@ -216,7 +216,7 @@ static string GrpcGetCommentsForDescriptor(const DescriptorType* descriptor) { } // TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. -static vector GrpcGetDocLines(const string& comments) { +static std::vector GrpcGetDocLines(const string& comments) { if (!comments.empty()) { // TODO(kenton): Ideally we should parse the comment text as Markdown and // write it back as HTML, but this requires a Markdown parser. For now @@ -226,24 +226,24 @@ static vector GrpcGetDocLines(const string& comments) { // HTML-escape them so that they don't accidentally close the doc comment. string escapedComments = GrpcEscapeJavadoc(comments); - vector lines = GrpcSplit(escapedComments, "\n"); + std::vector lines = GrpcSplit(escapedComments, "\n"); while (!lines.empty() && lines.back().empty()) { lines.pop_back(); } return lines; } - return vector(); + return std::vector(); } // TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. template -static vector GrpcGetDocLinesForDescriptor(const DescriptorType* descriptor) { +static std::vector GrpcGetDocLinesForDescriptor(const DescriptorType* descriptor) { return GrpcGetDocLines(GrpcGetCommentsForDescriptor(descriptor)); } // TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. static void GrpcWriteDocCommentBody(Printer* printer, - const vector& lines, + const std::vector& lines, bool surroundWithPreTag) { if (!lines.empty()) { if (surroundWithPreTag) { @@ -270,7 +270,7 @@ static void GrpcWriteDocCommentBody(Printer* printer, // TODO(nmittler): Remove once protobuf includes javadoc methods in distribution. static void GrpcWriteDocComment(Printer* printer, const string& comments) { printer->Print("/**\n"); - vector lines = GrpcGetDocLines(comments); + std::vector lines = GrpcGetDocLines(comments); GrpcWriteDocCommentBody(printer, lines, false); printer->Print(" */\n"); } @@ -281,7 +281,7 @@ static void GrpcWriteServiceDocComment(Printer* printer, // Deviating from protobuf to avoid extraneous docs // (see https://github.com/google/protobuf/issues/1406); printer->Print("/**\n"); - vector lines = GrpcGetDocLinesForDescriptor(service); + std::vector lines = GrpcGetDocLinesForDescriptor(service); GrpcWriteDocCommentBody(printer, lines, true); printer->Print(" */\n"); } @@ -292,14 +292,14 @@ void GrpcWriteMethodDocComment(Printer* printer, // Deviating from protobuf to avoid extraneous docs // (see https://github.com/google/protobuf/issues/1406); printer->Print("/**\n"); - vector lines = GrpcGetDocLinesForDescriptor(method); + std::vector lines = GrpcGetDocLinesForDescriptor(method); GrpcWriteDocCommentBody(printer, lines, true); printer->Print(" */\n"); } static void PrintMethodFields( - const ServiceDescriptor* service, map* vars, Printer* p, - ProtoFlavor flavor) { + const ServiceDescriptor* service, std::map* vars, + Printer* p, ProtoFlavor flavor) { p->Print("// Static method descriptors that strictly reflect the proto.\n"); (*vars)["service_name"] = service->name(); for (int i = 0; i < service->method_count(); ++i) { @@ -432,12 +432,12 @@ enum CallType { }; static void PrintBindServiceMethodBody(const ServiceDescriptor* service, - map* vars, + std::map* vars, Printer* p, bool generate_nano); static void PrintDeprecatedDocComment(const ServiceDescriptor* service, - map* vars, + std::map* vars, Printer* p) { p->Print( *vars, @@ -470,7 +470,7 @@ static void PrintDeprecatedDocComment(const ServiceDescriptor* service, // Prints a client interface or implementation class, or a server interface. static void PrintStub( const ServiceDescriptor* service, - map* vars, + std::map* vars, Printer* p, StubType type, bool generate_nano, bool enable_deprecated) { const string service_name = service->name(); @@ -766,12 +766,12 @@ static bool CompareMethodClientStreaming(const MethodDescriptor* method1, // Place all method invocations into a single class to reduce memory footprint // on Android. static void PrintMethodHandlerClass(const ServiceDescriptor* service, - map* vars, + std::map* vars, Printer* p, bool generate_nano, bool enable_deprecated) { // Sort method ids based on client_streaming() so switch tables are compact. - vector sorted_methods(service->method_count()); + std::vector sorted_methods(service->method_count()); for (int i = 0; i < service->method_count(); ++i) { sorted_methods[i] = service->method(i); } @@ -882,7 +882,7 @@ static void PrintMethodHandlerClass(const ServiceDescriptor* service, } static void PrintGetServiceDescriptorMethod(const ServiceDescriptor* service, - map* vars, + std::map* vars, Printer* p, ProtoFlavor flavor) { (*vars)["service_name"] = service->name(); @@ -960,7 +960,7 @@ static void PrintGetServiceDescriptorMethod(const ServiceDescriptor* service, } static void PrintBindServiceMethodBody(const ServiceDescriptor* service, - map* vars, + std::map* vars, Printer* p, bool generate_nano) { (*vars)["service_name"] = service->name(); @@ -1017,7 +1017,7 @@ static void PrintBindServiceMethodBody(const ServiceDescriptor* service, } static void PrintService(const ServiceDescriptor* service, - map* vars, + std::map* vars, Printer* p, ProtoFlavor flavor, bool enable_deprecated) { @@ -1168,7 +1168,7 @@ void GenerateService(const ServiceDescriptor* service, bool enable_deprecated) { // All non-generated classes must be referred by fully qualified names to // avoid collision with generated classes. - map vars; + std::map vars; vars["String"] = "java.lang.String"; vars["Override"] = "java.lang.Override"; vars["Deprecated"] = "java.lang.Deprecated"; diff --git a/compiler/src/java_plugin/cpp/java_plugin.cpp b/compiler/src/java_plugin/cpp/java_plugin.cpp index 1e3ea52aee..72ead37841 100644 --- a/compiler/src/java_plugin/cpp/java_plugin.cpp +++ b/compiler/src/java_plugin/cpp/java_plugin.cpp @@ -31,7 +31,7 @@ class JavaGrpcGenerator : public google::protobuf::compiler::CodeGenerator { const string& parameter, google::protobuf::compiler::GeneratorContext* context, string* error) const { - vector > options; + std::vector > options; google::protobuf::compiler::ParseGeneratorParameter(parameter, &options); java_grpc_generator::ProtoFlavor flavor =