aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler
diff options
context:
space:
mode:
authorGravatar nnoble <nnoble@google.com>2014-12-11 16:06:57 -0800
committerGravatar Nicolas Noble <nnoble@google.com>2014-12-12 16:10:46 -0800
commitc78b34075da76ccf45a7b2c40d90a12458ab4326 (patch)
treeb199b2f585add44d86e273891da05234d82ad2b0 /src/compiler
parent87da1b937dc478a1562c1e0ed6c80256e7ee2c53 (diff)
Fixing C++ and ruby code generators for the opensource build.
Change on 2014/12/11 by nnoble <nnoble@google.com> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=81921764
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/ruby_generator.cc4
-rw-r--r--src/compiler/ruby_generator.h8
-rw-r--r--src/compiler/ruby_generator_map-inl.h5
3 files changed, 10 insertions, 7 deletions
diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc
index 2d56c4bedc..64a81526fe 100644
--- a/src/compiler/ruby_generator.cc
+++ b/src/compiler/ruby_generator.cc
@@ -59,11 +59,11 @@ namespace {
void PrintMethod(const MethodDescriptor* method, const string& package,
Printer* out) {
string input_type = RubyTypeOf(method->input_type()->name(), package);
- if (method->options().has_client_streaming()) {
+ if (method->client_streaming()) {
input_type = "stream(" + input_type + ")";
}
string output_type = RubyTypeOf(method->output_type()->name(), package);
- if (method->options().has_server_streaming()) {
+ if (method->server_streaming()) {
output_type = "stream(" + output_type + ")";
}
map<string, string> method_vars = ListToDict({
diff --git a/src/compiler/ruby_generator.h b/src/compiler/ruby_generator.h
index dae744de2d..4f13f1a33b 100644
--- a/src/compiler/ruby_generator.h
+++ b/src/compiler/ruby_generator.h
@@ -36,9 +36,13 @@
#include <string>
-namespace proto2 {
+using namespace std;
+
+namespace google {
+namespace protobuf {
class FileDescriptor;
-} // namespace proto2
+} // namespace protobuf
+} // namespace google
namespace grpc_ruby_generator {
diff --git a/src/compiler/ruby_generator_map-inl.h b/src/compiler/ruby_generator_map-inl.h
index 3db65371b1..ea5050652b 100644
--- a/src/compiler/ruby_generator_map-inl.h
+++ b/src/compiler/ruby_generator_map-inl.h
@@ -40,7 +40,6 @@
#include <string>
#include <vector>
-#include "base/logging.h"
using std::initializer_list;
using std::map;
@@ -52,11 +51,11 @@ namespace grpc_ruby_generator {
// into a map of key* to value*. Is merely a readability helper for later code.
inline map<string, string> ListToDict(const initializer_list<string>& values) {
if (values.size() % 2 != 0) {
- LOG(FATAL) << "Not every 'key' has a value in `values`.";
+ // MOE: insert std::cerr << "Not every 'key' has a value in `values`." << std::endl;
}
map<string, string> value_map;
auto value_iter = values.begin();
- for (int i = 0; i < values.size()/2; ++i) {
+ for (unsigned i = 0; i < values.size()/2; ++i) {
string key = *value_iter;
++value_iter;
string value = *value_iter;