Run clang-format-all.sh

pull/28/head
Yang Gao 10 years ago
parent 1ff11f6d04
commit 5680ff4687
  1. 33
      src/compiler/cpp_generator.cc
  2. 1
      src/core/support/log_posix.c
  3. 8
      test/core/util/test_config.c

@ -182,11 +182,12 @@ void PrintHeaderServerMethod(google::protobuf::io::Printer* printer,
"::grpc::ServerContext* context, const $Request$* request, " "::grpc::ServerContext* context, const $Request$* request, "
"::grpc::ServerWriter< $Response$>* writer);\n"); "::grpc::ServerWriter< $Response$>* writer);\n");
} else if (BidiStreaming(method)) { } else if (BidiStreaming(method)) {
printer->Print(*vars, printer->Print(
"virtual ::grpc::Status $Method$(" *vars,
"::grpc::ServerContext* context, " "virtual ::grpc::Status $Method$("
"::grpc::ServerReaderWriter< $Response$, $Request$>* stream);" "::grpc::ServerContext* context, "
"\n"); "::grpc::ServerReaderWriter< $Response$, $Request$>* stream);"
"\n");
} }
} }
@ -269,9 +270,10 @@ void PrintSourceClientMethod(google::protobuf::io::Printer* printer,
"context, request, response);\n" "context, request, response);\n"
"}\n\n"); "}\n\n");
} else if (ClientOnlyStreaming(method)) { } else if (ClientOnlyStreaming(method)) {
printer->Print(*vars, printer->Print(
"::grpc::ClientWriter< $Request$>* $Service$::Stub::$Method$(" *vars,
"::grpc::ClientContext* context, $Response$* response) {\n"); "::grpc::ClientWriter< $Request$>* $Service$::Stub::$Method$("
"::grpc::ClientContext* context, $Response$* response) {\n");
printer->Print(*vars, printer->Print(*vars,
" return new ::grpc::ClientWriter< $Request$>(" " return new ::grpc::ClientWriter< $Request$>("
"channel()->CreateStream(" "channel()->CreateStream("
@ -361,13 +363,14 @@ void PrintSourceService(google::protobuf::io::Printer* printer,
const google::protobuf::ServiceDescriptor* service, const google::protobuf::ServiceDescriptor* service,
map<string, string>* vars) { map<string, string>* vars) {
(*vars)["Service"] = service->name(); (*vars)["Service"] = service->name();
printer->Print(*vars, printer->Print(
"$Service$::Stub* $Service$::NewStub(" *vars,
"const std::shared_ptr< ::grpc::ChannelInterface>& channel) {\n" "$Service$::Stub* $Service$::NewStub("
" $Service$::Stub* stub = new $Service$::Stub();\n" "const std::shared_ptr< ::grpc::ChannelInterface>& channel) {\n"
" stub->set_channel(channel);\n" " $Service$::Stub* stub = new $Service$::Stub();\n"
" return stub;\n" " stub->set_channel(channel);\n"
"};\n\n"); " return stub;\n"
"};\n\n");
for (int i = 0; i < service->method_count(); ++i) { for (int i = 0; i < service->method_count(); ++i) {
PrintSourceClientMethod(printer, service->method(i), vars); PrintSourceClientMethod(printer, service->method(i), vars);
} }

@ -31,7 +31,6 @@
* *
*/ */
#ifndef _POSIX_C_SOURCE #ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112L #define _POSIX_C_SOURCE 200112L
#endif #endif

@ -39,16 +39,12 @@
#if GPR_GETPID_IN_UNISTD_H #if GPR_GETPID_IN_UNISTD_H
#include <unistd.h> #include <unistd.h>
static int seed() { static int seed() { return getpid(); }
return getpid();
}
#endif #endif
#if GPR_GETPID_IN_PROCESS_H #if GPR_GETPID_IN_PROCESS_H
#include <process.h> #include <process.h>
static int seed(void) { static int seed(void) { return _getpid(); }
return _getpid();
}
#endif #endif
void grpc_test_init(int argc, char **argv) { void grpc_test_init(int argc, char **argv) {

Loading…
Cancel
Save