aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-01-15 23:07:04 -0800
committerGravatar Yang Gao <yangg@google.com>2015-01-15 23:07:04 -0800
commit0aa22c3ce1e17b4c96cac35b0a2420604578534f (patch)
tree10417909fb90c1fcd97a0c5312e169f31831ddf3 /src
parentd7c16868a5543e6248420e378344e17f3abc0361 (diff)
parent7f06f9eb85174c1a6fc27106379b8d1a190543b0 (diff)
Merge pull request #81 from ctiller/update
Merge master into branch
Diffstat (limited to 'src')
-rw-r--r--src/compiler/cpp_generator.cc33
-rw-r--r--src/compiler/cpp_generator.h10
-rw-r--r--src/compiler/cpp_generator_helpers.h25
-rw-r--r--src/compiler/cpp_plugin.cc12
-rw-r--r--src/compiler/ruby_generator.cc31
-rw-r--r--src/compiler/ruby_generator.h4
-rw-r--r--src/compiler/ruby_generator_helpers-inl.h4
-rw-r--r--src/compiler/ruby_generator_map-inl.h9
-rw-r--r--src/compiler/ruby_generator_string-inl.h39
-rw-r--r--src/compiler/ruby_plugin.cc9
-rw-r--r--src/core/iomgr/alarm.c4
-rw-r--r--src/core/iomgr/alarm_internal.h6
-rw-r--r--src/core/iomgr/iomgr.c10
-rw-r--r--src/core/iomgr/iomgr.h4
-rw-r--r--src/core/iomgr/iomgr_internal.h8
-rw-r--r--src/core/iomgr/iomgr_posix.c4
-rw-r--r--src/core/iomgr/iomgr_posix.h4
-rw-r--r--src/core/iomgr/pollset_posix.c6
-rw-r--r--src/core/iomgr/pollset_posix.h2
-rw-r--r--src/core/iomgr/socket_utils_common_posix.c4
-rw-r--r--src/core/iomgr/socket_utils_posix.h2
-rw-r--r--src/core/iomgr/tcp_server.h2
-rw-r--r--src/core/iomgr/tcp_server_posix.c6
-rw-r--r--src/core/security/credentials.c4
-rw-r--r--src/core/statistics/census_init.c4
-rw-r--r--src/core/statistics/census_interface.h6
-rw-r--r--src/core/statistics/census_log.c10
-rw-r--r--src/core/statistics/census_log.h8
-rw-r--r--src/core/statistics/census_rpc_stats.c10
-rw-r--r--src/core/statistics/census_rpc_stats.h6
-rw-r--r--src/core/statistics/census_tracing.c16
-rw-r--r--src/core/statistics/census_tracing.h8
-rw-r--r--src/core/support/cpu.h4
-rw-r--r--src/core/support/cpu_linux.c4
-rw-r--r--src/core/support/cpu_posix.c4
-rw-r--r--src/core/support/log_linux.c2
-rw-r--r--src/core/support/log_posix.c2
-rw-r--r--src/core/support/slice.c2
-rw-r--r--src/core/support/string.c2
-rw-r--r--src/core/surface/call.c11
-rw-r--r--src/core/surface/completion_queue.c4
-rw-r--r--src/core/surface/init.c4
-rw-r--r--src/core/transport/chttp2/alpn.c2
-rw-r--r--src/core/transport/chttp2/alpn.h2
-rw-r--r--src/core/transport/chttp2/frame_settings.c2
-rw-r--r--src/core/transport/chttp2/frame_settings.h2
-rw-r--r--src/core/transport/chttp2/gen_hpack_tables.c14
-rw-r--r--src/core/transport/metadata.c2
-rw-r--r--src/core/transport/metadata.h2
-rwxr-xr-xsrc/ruby/grpc.gemspec2
50 files changed, 187 insertions, 190 deletions
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index 94e56d73a6..29bd3560f3 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -31,6 +31,9 @@
*
*/
+#include <string>
+#include <map>
+
#include "src/compiler/cpp_generator.h"
#include "src/compiler/cpp_generator_helpers.h"
@@ -92,8 +95,8 @@ bool HasBidiStreaming(const google::protobuf::FileDescriptor* file) {
}
} // namespace
-string GetHeaderIncludes(const google::protobuf::FileDescriptor* file) {
- string temp =
+std::string GetHeaderIncludes(const google::protobuf::FileDescriptor* file) {
+ std::string temp =
"#include \"grpc++/impl/internal_stub.h\"\n"
"#include \"grpc++/status.h\"\n"
"\n"
@@ -121,7 +124,7 @@ string GetHeaderIncludes(const google::protobuf::FileDescriptor* file) {
return temp;
}
-string GetSourceIncludes() {
+std::string GetSourceIncludes() {
return "#include \"grpc++/channel_interface.h\"\n"
"#include \"grpc++/impl/rpc_method.h\"\n"
"#include \"grpc++/impl/rpc_service_method.h\"\n"
@@ -130,7 +133,7 @@ string GetSourceIncludes() {
void PrintHeaderClientMethod(google::protobuf::io::Printer* printer,
const google::protobuf::MethodDescriptor* method,
- map<string, string>* vars) {
+ std::map<std::string, std::string>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] =
grpc_cpp_generator::ClassName(method->input_type(), true);
@@ -159,7 +162,7 @@ void PrintHeaderClientMethod(google::protobuf::io::Printer* printer,
void PrintHeaderServerMethod(google::protobuf::io::Printer* printer,
const google::protobuf::MethodDescriptor* method,
- map<string, string>* vars) {
+ std::map<std::string, std::string>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] =
grpc_cpp_generator::ClassName(method->input_type(), true);
@@ -193,7 +196,7 @@ void PrintHeaderServerMethod(google::protobuf::io::Printer* printer,
void PrintHeaderService(google::protobuf::io::Printer* printer,
const google::protobuf::ServiceDescriptor* service,
- map<string, string>* vars) {
+ std::map<std::string, std::string>* vars) {
(*vars)["Service"] = service->name();
printer->Print(*vars,
@@ -238,11 +241,11 @@ void PrintHeaderService(google::protobuf::io::Printer* printer,
printer->Print("};\n");
}
-string GetHeaderServices(const google::protobuf::FileDescriptor* file) {
- string output;
+std::string GetHeaderServices(const google::protobuf::FileDescriptor* file) {
+ std::string output;
google::protobuf::io::StringOutputStream output_stream(&output);
google::protobuf::io::Printer printer(&output_stream, '$');
- map<string, string> vars;
+ std::map<std::string, std::string> vars;
for (int i = 0; i < file->service_count(); ++i) {
PrintHeaderService(&printer, file->service(i), &vars);
@@ -253,7 +256,7 @@ string GetHeaderServices(const google::protobuf::FileDescriptor* file) {
void PrintSourceClientMethod(google::protobuf::io::Printer* printer,
const google::protobuf::MethodDescriptor* method,
- map<string, string>* vars) {
+ std::map<std::string, std::string>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] =
grpc_cpp_generator::ClassName(method->input_type(), true);
@@ -311,7 +314,7 @@ void PrintSourceClientMethod(google::protobuf::io::Printer* printer,
void PrintSourceServerMethod(google::protobuf::io::Printer* printer,
const google::protobuf::MethodDescriptor* method,
- map<string, string>* vars) {
+ std::map<std::string, std::string>* vars) {
(*vars)["Method"] = method->name();
(*vars)["Request"] =
grpc_cpp_generator::ClassName(method->input_type(), true);
@@ -361,7 +364,7 @@ void PrintSourceServerMethod(google::protobuf::io::Printer* printer,
void PrintSourceService(google::protobuf::io::Printer* printer,
const google::protobuf::ServiceDescriptor* service,
- map<string, string>* vars) {
+ std::map<std::string, std::string>* vars) {
(*vars)["Service"] = service->name();
printer->Print(
*vars,
@@ -455,11 +458,11 @@ void PrintSourceService(google::protobuf::io::Printer* printer,
printer->Print("}\n\n");
}
-string GetSourceServices(const google::protobuf::FileDescriptor* file) {
- string output;
+std::string GetSourceServices(const google::protobuf::FileDescriptor* file) {
+ std::string output;
google::protobuf::io::StringOutputStream output_stream(&output);
google::protobuf::io::Printer printer(&output_stream, '$');
- map<string, string> vars;
+ std::map<std::string, std::string> vars;
// Package string is empty or ends with a dot. It is used to fully qualify
// method names.
vars["Package"] = file->package();
diff --git a/src/compiler/cpp_generator.h b/src/compiler/cpp_generator.h
index 8bd785f13e..1a74211b71 100644
--- a/src/compiler/cpp_generator.h
+++ b/src/compiler/cpp_generator.h
@@ -42,21 +42,19 @@ class FileDescriptor;
} // namespace protobuf
} // namespace google
-using namespace std;
-
namespace grpc_cpp_generator {
// Return the includes needed for generated header file.
-string GetHeaderIncludes(const google::protobuf::FileDescriptor* file);
+std::string GetHeaderIncludes(const google::protobuf::FileDescriptor* file);
// Return the includes needed for generated source file.
-string GetSourceIncludes();
+std::string GetSourceIncludes();
// Return the services for generated header file.
-string GetHeaderServices(const google::protobuf::FileDescriptor* file);
+std::string GetHeaderServices(const google::protobuf::FileDescriptor* file);
// Return the services for generated source file.
-string GetSourceServices(const google::protobuf::FileDescriptor* file);
+std::string GetSourceServices(const google::protobuf::FileDescriptor* file);
} // namespace grpc_cpp_generator
diff --git a/src/compiler/cpp_generator_helpers.h b/src/compiler/cpp_generator_helpers.h
index ba251faf29..1ad3cb2db3 100644
--- a/src/compiler/cpp_generator_helpers.h
+++ b/src/compiler/cpp_generator_helpers.h
@@ -39,14 +39,12 @@
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.pb.h>
-using namespace std;
-
namespace grpc_cpp_generator {
-inline bool StripSuffix(string* filename, const string& suffix) {
+inline bool StripSuffix(std::string* filename, const std::string& suffix) {
if (filename->length() >= suffix.length()) {
size_t suffix_pos = filename->length() - suffix.length();
- if (filename->compare(suffix_pos, string::npos, suffix) == 0) {
+ if (filename->compare(suffix_pos, std::string::npos, suffix) == 0) {
filename->resize(filename->size() - suffix.size());
return true;
}
@@ -55,19 +53,20 @@ inline bool StripSuffix(string* filename, const string& suffix) {
return false;
}
-inline string StripProto(string filename) {
+inline std::string StripProto(std::string filename) {
if (!StripSuffix(&filename, ".protodevel")) {
StripSuffix(&filename, ".proto");
}
return filename;
}
-inline string StringReplace(string str, const string& from, const string& to) {
+inline std::string StringReplace(std::string str, const std::string& from,
+ const std::string& to) {
size_t pos = 0;
for (;;) {
pos = str.find(from, pos);
- if (pos == string::npos) {
+ if (pos == std::string::npos) {
break;
}
str.replace(pos, from.length(), to);
@@ -77,23 +76,23 @@ inline string StringReplace(string str, const string& from, const string& to) {
return str;
}
-inline string DotsToColons(const string& name) {
+inline std::string DotsToColons(const std::string& name) {
return StringReplace(name, ".", "::");
}
-inline string DotsToUnderscores(const string& name) {
+inline std::string DotsToUnderscores(const std::string& name) {
return StringReplace(name, ".", "_");
}
-inline string ClassName(const google::protobuf::Descriptor* descriptor,
- bool qualified) {
+inline std::string ClassName(const google::protobuf::Descriptor* descriptor,
+ bool qualified) {
// Find "outer", the descriptor of the top-level message in which
// "descriptor" is embedded.
const google::protobuf::Descriptor* outer = descriptor;
while (outer->containing_type() != NULL) outer = outer->containing_type();
- const string& outer_name = outer->full_name();
- string inner_name = descriptor->full_name().substr(outer_name.size());
+ const std::string& outer_name = outer->full_name();
+ std::string inner_name = descriptor->full_name().substr(outer_name.size());
if (qualified) {
return "::" + DotsToColons(outer_name) + DotsToUnderscores(inner_name);
diff --git a/src/compiler/cpp_plugin.cc b/src/compiler/cpp_plugin.cc
index 17836b1612..e43278529d 100644
--- a/src/compiler/cpp_plugin.cc
+++ b/src/compiler/cpp_plugin.cc
@@ -35,6 +35,8 @@
//
#include <memory>
+#include <string>
+
#include "src/compiler/cpp_generator.h"
#include "src/compiler/cpp_generator_helpers.h"
#include <google/protobuf/descriptor.h>
@@ -50,9 +52,9 @@ class CppGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
virtual ~CppGrpcGenerator() {}
virtual bool Generate(const google::protobuf::FileDescriptor* file,
- const string& parameter,
+ const std::string& parameter,
google::protobuf::compiler::GeneratorContext* context,
- string* error) const {
+ std::string* error) const {
if (file->options().cc_generic_services()) {
*error =
"cpp grpc proto compiler plugin does not work with generic "
@@ -61,7 +63,7 @@ class CppGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
return false;
}
- string file_name = grpc_cpp_generator::StripProto(file->name());
+ std::string file_name = grpc_cpp_generator::StripProto(file->name());
// Generate .pb.h
Insert(context, file_name + ".pb.h", "includes",
@@ -80,8 +82,8 @@ class CppGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
private:
// Insert the given code into the given file at the given insertion point.
void Insert(google::protobuf::compiler::GeneratorContext* context,
- const string& filename, const string& insertion_point,
- const string& code) const {
+ const std::string& filename, const std::string& insertion_point,
+ const std::string& code) const {
std::unique_ptr<google::protobuf::io::ZeroCopyOutputStream> output(
context->OpenForInsert(filename, insertion_point));
google::protobuf::io::CodedOutputStream coded_out(output.get());
diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc
index fae8858ff7..393f8f3b59 100644
--- a/src/compiler/ruby_generator.cc
+++ b/src/compiler/ruby_generator.cc
@@ -32,6 +32,7 @@
*/
#include <cctype>
+#include <string>
#include <map>
#include <vector>
@@ -56,17 +57,17 @@ namespace grpc_ruby_generator {
namespace {
// Prints out the method using the ruby gRPC DSL.
-void PrintMethod(const MethodDescriptor* method, const string& package,
+void PrintMethod(const MethodDescriptor* method, const std::string& package,
Printer* out) {
- string input_type = RubyTypeOf(method->input_type()->name(), package);
+ std::string input_type = RubyTypeOf(method->input_type()->name(), package);
if (method->client_streaming()) {
input_type = "stream(" + input_type + ")";
}
- string output_type = RubyTypeOf(method->output_type()->name(), package);
+ std::string output_type = RubyTypeOf(method->output_type()->name(), package);
if (method->server_streaming()) {
output_type = "stream(" + output_type + ")";
}
- map<string, string> method_vars = ListToDict({
+ std::map<std::string, std::string> method_vars = ListToDict({
"mth.name", method->name(), "input.type", input_type, "output.type",
output_type,
});
@@ -74,22 +75,22 @@ void PrintMethod(const MethodDescriptor* method, const string& package,
}
// Prints out the service using the ruby gRPC DSL.
-void PrintService(const ServiceDescriptor* service, const string& package,
+void PrintService(const ServiceDescriptor* service, const std::string& package,
Printer* out) {
if (service->method_count() == 0) {
return;
}
// Begin the service module
- map<string, string> module_vars = ListToDict({
+ std::map<std::string, std::string> module_vars = ListToDict({
"module.name", CapitalizeFirst(service->name()),
});
out->Print(module_vars, "module $module.name$\n");
out->Indent();
// TODO(temiola): add documentation
- string doc = "TODO: add proto service documentation here";
- map<string, string> template_vars = ListToDict({
+ std::string doc = "TODO: add proto service documentation here";
+ std::map<std::string, std::string> template_vars = ListToDict({
"Documentation", doc,
});
out->Print("\n");
@@ -103,7 +104,7 @@ void PrintService(const ServiceDescriptor* service, const string& package,
out->Print("\n");
out->Print("self.marshal_class_method = :encode\n");
out->Print("self.unmarshal_class_method = :decode\n");
- map<string, string> pkg_vars = ListToDict({
+ std::map<std::string, std::string> pkg_vars = ListToDict({
"service.name", service->name(), "pkg.name", package,
});
out->Print(pkg_vars, "self.service_name = '$pkg.name$.$service.name$'\n");
@@ -124,8 +125,8 @@ void PrintService(const ServiceDescriptor* service, const string& package,
} // namespace
-string GetServices(const FileDescriptor* file) {
- string output;
+std::string GetServices(const FileDescriptor* file) {
+ std::string output;
StringOutputStream output_stream(&output);
Printer out(&output_stream, '$');
@@ -136,7 +137,7 @@ string GetServices(const FileDescriptor* file) {
}
// Write out a file header.
- map<string, string> header_comment_vars = ListToDict({
+ std::map<std::string, std::string> header_comment_vars = ListToDict({
"file.name", file->name(), "file.package", file->package(),
});
out.Print("# Generated by the protocol buffer compiler. DO NOT EDIT!\n");
@@ -148,16 +149,16 @@ string GetServices(const FileDescriptor* file) {
// Write out require statemment to import the separately generated file
// that defines the messages used by the service. This is generated by the
// main ruby plugin.
- map<string, string> dep_vars = ListToDict({
+ std::map<std::string, std::string> dep_vars = ListToDict({
"dep.name", MessagesRequireName(file),
});
out.Print(dep_vars, "require '$dep.name$'\n");
// Write out services within the modules
out.Print("\n");
- vector<string> modules = Split(file->package(), '.');
+ std::vector<std::string> modules = Split(file->package(), '.');
for (size_t i = 0; i < modules.size(); ++i) {
- map<string, string> module_vars = ListToDict({
+ std::map<std::string, std::string> module_vars = ListToDict({
"module.name", CapitalizeFirst(modules[i]),
});
out.Print(module_vars, "module $module.name$\n");
diff --git a/src/compiler/ruby_generator.h b/src/compiler/ruby_generator.h
index 4f13f1a33b..0306536d08 100644
--- a/src/compiler/ruby_generator.h
+++ b/src/compiler/ruby_generator.h
@@ -36,8 +36,6 @@
#include <string>
-using namespace std;
-
namespace google {
namespace protobuf {
class FileDescriptor;
@@ -46,7 +44,7 @@ class FileDescriptor;
namespace grpc_ruby_generator {
-string GetServices(const google::protobuf::FileDescriptor* file);
+std::string GetServices(const google::protobuf::FileDescriptor* file);
} // namespace grpc_ruby_generator
diff --git a/src/compiler/ruby_generator_helpers-inl.h b/src/compiler/ruby_generator_helpers-inl.h
index 8263e353b2..7b973ed9eb 100644
--- a/src/compiler/ruby_generator_helpers-inl.h
+++ b/src/compiler/ruby_generator_helpers-inl.h
@@ -42,7 +42,7 @@
namespace grpc_ruby_generator {
inline bool ServicesFilename(const google::protobuf::FileDescriptor* file,
- string* file_name_or_error) {
+ std::string* file_name_or_error) {
// Get output file name.
static const unsigned proto_suffix_length = 6; // length of ".proto"
if (file->name().size() > proto_suffix_length &&
@@ -57,7 +57,7 @@ inline bool ServicesFilename(const google::protobuf::FileDescriptor* file,
}
}
-inline string MessagesRequireName(
+inline std::string MessagesRequireName(
const google::protobuf::FileDescriptor* file) {
return Replace(file->name(), ".proto", "");
}
diff --git a/src/compiler/ruby_generator_map-inl.h b/src/compiler/ruby_generator_map-inl.h
index fa86fbb956..a49650a2f7 100644
--- a/src/compiler/ruby_generator_map-inl.h
+++ b/src/compiler/ruby_generator_map-inl.h
@@ -48,17 +48,18 @@ namespace grpc_ruby_generator {
// Converts an initializer list of the form { key0, value0, key1, value1, ... }
// 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) {
+inline std::map<std::string, std::string> ListToDict(
+ const initializer_list<std::string>& values) {
if (values.size() % 2 != 0) {
// MOE: insert std::cerr << "Not every 'key' has a value in `values`."
// << std::endl;
}
- map<string, string> value_map;
+ std::map<std::string, std::string> value_map;
auto value_iter = values.begin();
for (unsigned i = 0; i < values.size() / 2; ++i) {
- string key = *value_iter;
+ std::string key = *value_iter;
++value_iter;
- string value = *value_iter;
+ std::string value = *value_iter;
value_map[key] = value;
++value_iter;
}
diff --git a/src/compiler/ruby_generator_string-inl.h b/src/compiler/ruby_generator_string-inl.h
index 44e17a202a..a253f78d49 100644
--- a/src/compiler/ruby_generator_string-inl.h
+++ b/src/compiler/ruby_generator_string-inl.h
@@ -45,10 +45,10 @@ using std::transform;
namespace grpc_ruby_generator {
// Split splits a string using char into elems.
-inline vector<string>& Split(const string& s, char delim,
- vector<string>* elems) {
- stringstream ss(s);
- string item;
+inline std::vector<std::string>& Split(const std::string& s, char delim,
+ std::vector<std::string>* elems) {
+ std::stringstream ss(s);
+ std::string item;
while (getline(ss, item, delim)) {
elems->push_back(item);
}
@@ -56,16 +56,17 @@ inline vector<string>& Split(const string& s, char delim,
}
// Split splits a string using char, returning the result in a vector.
-inline vector<string> Split(const string& s, char delim) {
- vector<string> elems;
+inline std::vector<std::string> Split(const std::string& s, char delim) {
+ std::vector<std::string> elems;
Split(s, delim, &elems);
return elems;
}
// Replace replaces from with to in s.
-inline string Replace(string s, const string& from, const string& to) {
+inline std::string Replace(std::string s, const std::string& from,
+ const std::string& to) {
size_t start_pos = s.find(from);
- if (start_pos == string::npos) {
+ if (start_pos == std::string::npos) {
return s;
}
s.replace(start_pos, from.length(), to);
@@ -73,10 +74,10 @@ inline string Replace(string s, const string& from, const string& to) {
}
// ReplaceAll replaces all instances of search with replace in s.
-inline string ReplaceAll(string s, const string& search,
- const string& replace) {
+inline std::string ReplaceAll(std::string s, const std::string& search,
+ const std::string& replace) {
size_t pos = 0;
- while ((pos = s.find(search, pos)) != string::npos) {
+ while ((pos = s.find(search, pos)) != std::string::npos) {
s.replace(pos, search.length(), replace);
pos += replace.length();
}
@@ -84,9 +85,10 @@ inline string ReplaceAll(string s, const string& search,
}
// ReplacePrefix replaces from with to in s if search is a prefix of s.
-inline bool ReplacePrefix(string* s, const string& from, const string& to) {
+inline bool ReplacePrefix(std::string* s, const std::string& from,
+ const std::string& to) {
size_t start_pos = s->find(from);
- if (start_pos == string::npos || start_pos != 0) {
+ if (start_pos == std::string::npos || start_pos != 0) {
return false;
}
s->replace(start_pos, from.length(), to);
@@ -94,7 +96,7 @@ inline bool ReplacePrefix(string* s, const string& from, const string& to) {
}
// CapitalizeFirst capitalizes the first char in a string.
-inline string CapitalizeFirst(string s) {
+inline std::string CapitalizeFirst(std::string s) {
if (s.empty()) {
return s;
}
@@ -103,14 +105,15 @@ inline string CapitalizeFirst(string s) {
}
// RubyTypeOf updates a proto type to the required ruby equivalent.
-inline string RubyTypeOf(const string& a_type, const string& package) {
- string res(a_type);
+inline std::string RubyTypeOf(const std::string& a_type,
+ const std::string& package) {
+ std::string res(a_type);
ReplacePrefix(&res, package, ""); // remove the leading package if present
ReplacePrefix(&res, ".", ""); // remove the leading . (no package)
- if (res.find('.') == string::npos) {
+ if (res.find('.') == std::string::npos) {
return res;
} else {
- vector<string> prefixes_and_type = Split(res, '.');
+ std::vector<std::string> prefixes_and_type = Split(res, '.');
for (unsigned int i = 0; i < prefixes_and_type.size(); ++i) {
if (i != 0) {
res += "::"; // switch '.' to the ruby module delim
diff --git a/src/compiler/ruby_plugin.cc b/src/compiler/ruby_plugin.cc
index c1748cfaeb..86c0e11e1c 100644
--- a/src/compiler/ruby_plugin.cc
+++ b/src/compiler/ruby_plugin.cc
@@ -37,6 +37,7 @@
// and net/proto2/compiler/public/plugin.h for more information on plugins.
#include <memory>
+#include <string>
#include "src/compiler/ruby_generator.h"
#include "src/compiler/ruby_generator_helpers-inl.h"
@@ -52,16 +53,16 @@ class RubyGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
~RubyGrpcGenerator() override {}
bool Generate(const google::protobuf::FileDescriptor* file,
- const string& parameter,
+ const std::string& parameter,
google::protobuf::compiler::GeneratorContext* context,
- string* error) const override {
- string code = grpc_ruby_generator::GetServices(file);
+ std::string* error) const override {
+ std::string code = grpc_ruby_generator::GetServices(file);
if (code.size() == 0) {
return true; // don't generate a file if there are no services
}
// Get output file name.
- string file_name;
+ std::string file_name;
if (!grpc_ruby_generator::ServicesFilename(file, &file_name)) {
return false;
}
diff --git a/src/core/iomgr/alarm.c b/src/core/iomgr/alarm.c
index 2664879323..5b80368e3a 100644
--- a/src/core/iomgr/alarm.c
+++ b/src/core/iomgr/alarm.c
@@ -100,7 +100,7 @@ void grpc_alarm_list_init(gpr_timespec now) {
}
}
-void grpc_alarm_list_shutdown() {
+void grpc_alarm_list_shutdown(void) {
int i;
while (run_some_expired_alarms(NULL, gpr_inf_future, NULL, 0))
;
@@ -360,7 +360,7 @@ int grpc_alarm_check(gpr_mu *drop_mu, gpr_timespec now, gpr_timespec *next) {
return run_some_expired_alarms(drop_mu, now, next, 1);
}
-gpr_timespec grpc_alarm_list_next_timeout() {
+gpr_timespec grpc_alarm_list_next_timeout(void) {
gpr_timespec out;
gpr_mu_lock(&g_mu);
out = g_shard_queue[0]->min_deadline;
diff --git a/src/core/iomgr/alarm_internal.h b/src/core/iomgr/alarm_internal.h
index 12b6ab4286..5c6b869302 100644
--- a/src/core/iomgr/alarm_internal.h
+++ b/src/core/iomgr/alarm_internal.h
@@ -42,12 +42,12 @@
int grpc_alarm_check(gpr_mu *drop_mu, gpr_timespec now, gpr_timespec *next);
void grpc_alarm_list_init(gpr_timespec now);
-void grpc_alarm_list_shutdown();
+void grpc_alarm_list_shutdown(void);
-gpr_timespec grpc_alarm_list_next_timeout();
+gpr_timespec grpc_alarm_list_next_timeout(void);
/* the following must be implemented by each iomgr implementation */
-void grpc_kick_poller();
+void grpc_kick_poller(void);
#endif /* __GRPC_INTERNAL_IOMGR_ALARM_INTERNAL_H_ */
diff --git a/src/core/iomgr/iomgr.c b/src/core/iomgr/iomgr.c
index 03f56a50a3..7f266ab235 100644
--- a/src/core/iomgr/iomgr.c
+++ b/src/core/iomgr/iomgr.c
@@ -80,9 +80,9 @@ static void background_callback_executor(void *ignored) {
gpr_event_set(&g_background_callback_executor_done, (void *)1);
}
-void grpc_kick_poller() { gpr_cv_broadcast(&g_cv); }
+void grpc_kick_poller(void) { gpr_cv_broadcast(&g_cv); }
-void grpc_iomgr_init() {
+void grpc_iomgr_init(void) {
gpr_thd_id id;
gpr_mu_init(&g_mu);
gpr_cv_init(&g_cv);
@@ -93,7 +93,7 @@ void grpc_iomgr_init() {
gpr_thd_new(&id, background_callback_executor, NULL, NULL);
}
-void grpc_iomgr_shutdown() {
+void grpc_iomgr_shutdown(void) {
delayed_callback *cb;
gpr_timespec shutdown_deadline =
gpr_time_add(gpr_now(), gpr_time_from_seconds(10));
@@ -134,13 +134,13 @@ void grpc_iomgr_shutdown() {
gpr_cv_destroy(&g_cv);
}
-void grpc_iomgr_ref() {
+void grpc_iomgr_ref(void) {
gpr_mu_lock(&g_mu);
++g_refs;
gpr_mu_unlock(&g_mu);
}
-void grpc_iomgr_unref() {
+void grpc_iomgr_unref(void) {
gpr_mu_lock(&g_mu);
if (0 == --g_refs) {
gpr_cv_signal(&g_cv);
diff --git a/src/core/iomgr/iomgr.h b/src/core/iomgr/iomgr.h
index 16991a9b90..06dc2e5dbf 100644
--- a/src/core/iomgr/iomgr.h
+++ b/src/core/iomgr/iomgr.h
@@ -37,8 +37,8 @@
/* gRPC Callback definition */
typedef void (*grpc_iomgr_cb_func)(void *arg, int success);
-void grpc_iomgr_init();
-void grpc_iomgr_shutdown();
+void grpc_iomgr_init(void);
+void grpc_iomgr_shutdown(void);
/* This function is called from within a callback or from anywhere else
and causes the invocation of a callback at some point in the future */
diff --git a/src/core/iomgr/iomgr_internal.h b/src/core/iomgr/iomgr_internal.h
index 5f72542777..e9962a0f66 100644
--- a/src/core/iomgr/iomgr_internal.h
+++ b/src/core/iomgr/iomgr_internal.h
@@ -42,10 +42,10 @@ int grpc_maybe_call_delayed_callbacks(gpr_mu *drop_mu, int success);
void grpc_iomgr_add_delayed_callback(grpc_iomgr_cb_func cb, void *cb_arg,
int success);
-void grpc_iomgr_ref();
-void grpc_iomgr_unref();
+void grpc_iomgr_ref(void);
+void grpc_iomgr_unref(void);
-void grpc_iomgr_platform_init();
-void grpc_iomgr_platform_shutdown();
+void grpc_iomgr_platform_init(void);
+void grpc_iomgr_platform_shutdown(void);
#endif /* __GRPC_INTERNAL_IOMGR_IOMGR_INTERNAL_H_ */
diff --git a/src/core/iomgr/iomgr_posix.c b/src/core/iomgr/iomgr_posix.c
index ff9195ec1d..61fec6bc53 100644
--- a/src/core/iomgr/iomgr_posix.c
+++ b/src/core/iomgr/iomgr_posix.c
@@ -33,6 +33,6 @@
#include "src/core/iomgr/iomgr_posix.h"
-void grpc_iomgr_platform_init() { grpc_pollset_global_init(); }
+void grpc_iomgr_platform_init(void) { grpc_pollset_global_init(); }
-void grpc_iomgr_platform_shutdown() { grpc_pollset_global_shutdown(); }
+void grpc_iomgr_platform_shutdown(void) { grpc_pollset_global_shutdown(); }
diff --git a/src/core/iomgr/iomgr_posix.h b/src/core/iomgr/iomgr_posix.h
index ca5af3e527..86973a050d 100644
--- a/src/core/iomgr/iomgr_posix.h
+++ b/src/core/iomgr/iomgr_posix.h
@@ -36,7 +36,7 @@
#include "src/core/iomgr/iomgr_internal.h"
-void grpc_pollset_global_init();
-void grpc_pollset_global_shutdown();
+void grpc_pollset_global_init(void);
+void grpc_pollset_global_shutdown(void);
#endif /* __GRPC_INTERNAL_IOMGR_IOMGR_POSIX_H_ */
diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c
index ff00e06429..6f1b3ced7d 100644
--- a/src/core/iomgr/pollset_posix.c
+++ b/src/core/iomgr/pollset_posix.c
@@ -129,9 +129,9 @@ void grpc_kick_drain(grpc_pollset *p) {
/* global state management */
-grpc_pollset *grpc_backup_pollset() { return &g_backup_pollset; }
+grpc_pollset *grpc_backup_pollset(void) { return &g_backup_pollset; }
-void grpc_pollset_global_init() {
+void grpc_pollset_global_init(void) {
int i;
gpr_thd_id id;
@@ -151,7 +151,7 @@ void grpc_pollset_global_init() {
gpr_thd_new(&id, backup_poller, NULL, NULL);
}
-void grpc_pollset_global_shutdown() {
+void grpc_pollset_global_shutdown(void) {
int i;
/* terminate the backup poller thread */
diff --git a/src/core/iomgr/pollset_posix.h b/src/core/iomgr/pollset_posix.h
index f051079f5b..32a8f533ae 100644
--- a/src/core/iomgr/pollset_posix.h
+++ b/src/core/iomgr/pollset_posix.h
@@ -86,7 +86,7 @@ void grpc_kick_drain(grpc_pollset *p);
regardless of applications listening to events. Relying on this is slow
however (the backup pollset only listens every 100ms or so) - so it's not
to be relied on. */
-grpc_pollset *grpc_backup_pollset();
+grpc_pollset *grpc_backup_pollset(void);
/* turn a pollset into a multipoller: platform specific */
void grpc_platform_become_multipoller(grpc_pollset *pollset,
diff --git a/src/core/iomgr/socket_utils_common_posix.c b/src/core/iomgr/socket_utils_common_posix.c
index 7f2b43f2ca..d65b025d70 100644
--- a/src/core/iomgr/socket_utils_common_posix.c
+++ b/src/core/iomgr/socket_utils_common_posix.c
@@ -115,7 +115,7 @@ int grpc_set_socket_low_latency(int fd, int low_latency) {
static gpr_once g_probe_ipv6_once = GPR_ONCE_INIT;
static int g_ipv6_loopback_available;
-static void probe_ipv6_once() {
+static void probe_ipv6_once(void) {
int fd = socket(AF_INET6, SOCK_STREAM, 0);
g_ipv6_loopback_available = 0;
if (fd < 0) {
@@ -135,7 +135,7 @@ static void probe_ipv6_once() {
}
}
-int grpc_ipv6_loopback_available() {
+int grpc_ipv6_loopback_available(void) {
gpr_once_init(&g_probe_ipv6_once, probe_ipv6_once);
return g_ipv6_loopback_available;
}
diff --git a/src/core/iomgr/socket_utils_posix.h b/src/core/iomgr/socket_utils_posix.h
index 9c5d93c2b4..a84457f01d 100644
--- a/src/core/iomgr/socket_utils_posix.h
+++ b/src/core/iomgr/socket_utils_posix.h
@@ -61,7 +61,7 @@ int grpc_set_socket_low_latency(int fd, int low_latency);
and bind IPv6 sockets, but cannot connect to a getsockname() of [::]:port
without a valid loopback interface. Rather than expose this half-broken
state to library users, we turn off IPv6 sockets. */
-int grpc_ipv6_loopback_available();
+int grpc_ipv6_loopback_available(void);
/* An enum to keep track of IPv4/IPv6 socket modes.
diff --git a/src/core/iomgr/tcp_server.h b/src/core/iomgr/tcp_server.h
index d881e146b9..8ffd7d3569 100644
--- a/src/core/iomgr/tcp_server.h
+++ b/src/core/iomgr/tcp_server.h
@@ -46,7 +46,7 @@ typedef struct grpc_tcp_server grpc_tcp_server;
typedef void (*grpc_tcp_server_cb)(void *arg, grpc_endpoint *ep);
/* Create a server, initially not bound to any ports */
-grpc_tcp_server *grpc_tcp_server_create();
+grpc_tcp_server *grpc_tcp_server_create(void);
/* Start listening to bound ports */
void grpc_tcp_server_start(grpc_tcp_server *server, grpc_pollset *pollset,
diff --git a/src/core/iomgr/tcp_server_posix.c b/src/core/iomgr/tcp_server_posix.c
index 753e24c38e..5762eb8a97 100644
--- a/src/core/iomgr/tcp_server_posix.c
+++ b/src/core/iomgr/tcp_server_posix.c
@@ -84,7 +84,7 @@ struct grpc_tcp_server {
size_t port_capacity;
};
-grpc_tcp_server *grpc_tcp_server_create() {
+grpc_tcp_server *grpc_tcp_server_create(void) {
grpc_tcp_server *s = gpr_malloc(sizeof(grpc_tcp_server));
gpr_mu_init(&s->mu);
gpr_cv_init(&s->cv);
@@ -120,7 +120,7 @@ void grpc_tcp_server_destroy(grpc_tcp_server *s) {
}
/* get max listen queue size on linux */
-static void init_max_accept_queue_size() {
+static void init_max_accept_queue_size(void) {
int n = SOMAXCONN;
char buf[64];
FILE *fp = fopen("/proc/sys/net/core/somaxconn", "r");
@@ -147,7 +147,7 @@ static void init_max_accept_queue_size() {
}
}
-static int get_max_accept_queue_size() {
+static int get_max_accept_queue_size(void) {
gpr_once_init(&s_init_max_accept_queue_size, init_max_accept_queue_size);
return s_max_accept_queue_size;
}
diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c
index d3bba0fb1f..006d863e27 100644
--- a/src/core/security/credentials.c
+++ b/src/core/security/credentials.c
@@ -637,8 +637,8 @@ grpc_credentials *grpc_fake_transport_security_credentials_create(void) {
return c;
}
-grpc_server_credentials *
-grpc_fake_transport_security_server_credentials_create() {
+grpc_server_credentials *grpc_fake_transport_security_server_credentials_create(
+ void) {
grpc_server_credentials *c = gpr_malloc(sizeof(grpc_server_credentials));
memset(c, 0, sizeof(grpc_server_credentials));
c->type = GRPC_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY;
diff --git a/src/core/statistics/census_init.c b/src/core/statistics/census_init.c
index bcb9ff9ad4..cbf2089f3f 100644
--- a/src/core/statistics/census_init.c
+++ b/src/core/statistics/census_init.c
@@ -37,13 +37,13 @@
#include "src/core/statistics/census_rpc_stats.h"
#include "src/core/statistics/census_tracing.h"
-void census_init() {
+void census_init(void) {
gpr_log(GPR_INFO, "Initialize census library.");
census_tracing_init();
census_stats_store_init();
}
-void census_shutdown() {
+void census_shutdown(void) {
gpr_log(GPR_INFO, "Shutdown census library.");
census_stats_store_shutdown();
census_tracing_shutdown();
diff --git a/src/core/statistics/census_interface.h b/src/core/statistics/census_interface.h
index af9c70c4fb..8e586382f7 100644
--- a/src/core/statistics/census_interface.h
+++ b/src/core/statistics/census_interface.h
@@ -49,10 +49,10 @@ typedef struct census_op_id {
typedef struct census_rpc_stats census_rpc_stats;
/* Initializes Census library. No-op if Census is already initialized. */
-void census_init();
+void census_init(void);
/* Shutdown Census Library. */
-void census_shutdown();
+void census_shutdown(void);
/* Annotates grpc method name on a census_op_id. The method name has the format
of <full quantified rpc service name>/<rpc function name>. Returns 0 iff
@@ -68,7 +68,7 @@ int census_add_method_tag(census_op_id op_id, const char* method_name);
void census_tracing_print(census_op_id op_id, const char* annotation);
/* Starts tracing for an RPC. Returns a locally unique census_op_id */
-census_op_id census_tracing_start_op();
+census_op_id census_tracing_start_op(void);
/* Ends tracing. Calling this function will invalidate the input op_id. */
void census_tracing_end_op(census_op_id op_id);
diff --git a/src/core/statistics/census_log.c b/src/core/statistics/census_log.c
index 56fa430bbd..404e92cc62 100644
--- a/src/core/statistics/census_log.c
+++ b/src/core/statistics/census_log.c
@@ -368,7 +368,7 @@ static void cl_block_end_read(cl_block* block) {
/* Allocates a new free block (or recycles an available dirty block if log is
configured to discard old records). Returns NULL if out-of-space. */
-static cl_block* cl_allocate_block() {
+static cl_block* cl_allocate_block(void) {
cl_block* block = cl_block_list_head(&g_log.free_block_list);
if (block != NULL) {
cl_block_list_remove(&g_log.free_block_list, block);
@@ -496,7 +496,7 @@ void census_log_initialize(size_t size_in_mb, int discard_old_records) {
g_log.initialized = 1;
}
-void census_log_shutdown() {
+void census_log_shutdown(void) {
GPR_ASSERT(g_log.initialized);
gpr_mu_destroy(&g_log.lock);
gpr_free_aligned(g_log.core_local_blocks);
@@ -551,7 +551,7 @@ void census_log_end_write(void* record, size_t bytes_written) {
cl_block_end_write(cl_get_block(record), bytes_written);
}
-void census_log_init_reader() {
+void census_log_init_reader(void) {
GPR_ASSERT(g_log.initialized);
gpr_mu_lock(&g_log.lock);
/* If a block is locked for reading unlock it. */
@@ -584,7 +584,7 @@ const void* census_log_read_next(size_t* bytes_available) {
return NULL;
}
-size_t census_log_remaining_space() {
+size_t census_log_remaining_space(void) {
size_t space;
GPR_ASSERT(g_log.initialized);
gpr_mu_lock(&g_log.lock);
@@ -598,7 +598,7 @@ size_t census_log_remaining_space() {
return space;
}
-int census_log_out_of_space_count() {
+int census_log_out_of_space_count(void) {
GPR_ASSERT(g_log.initialized);
return gpr_atm_acq_load(&g_log.out_of_space_count);
}
diff --git a/src/core/statistics/census_log.h b/src/core/statistics/census_log.h
index fa9229b122..0d89df7992 100644
--- a/src/core/statistics/census_log.h
+++ b/src/core/statistics/census_log.h
@@ -53,7 +53,7 @@ void census_log_initialize(size_t size_in_mb, int discard_old_records);
- no in progress or future call to any census_log functions
- no incomplete records
*/
-void census_log_shutdown();
+void census_log_shutdown(void);
/* Allocates and returns a 'size' bytes record and marks it in use. A
subsequent census_log_end_write() marks the record complete. The
@@ -74,7 +74,7 @@ void census_log_end_write(void* record, size_t bytes_written);
is read. census_log_init_reader() starts the iteration or aborts the
current iteration.
*/
-void census_log_init_reader();
+void census_log_init_reader(void);
const void* census_log_read_next(size_t* bytes_available);
/* Returns estimated remaining space across all blocks, in bytes. If log is
@@ -82,10 +82,10 @@ const void* census_log_read_next(size_t* bytes_available);
returns space available in empty blocks (partially filled blocks are
treated as full).
*/
-size_t census_log_remaining_space();
+size_t census_log_remaining_space(void);
/* Returns the number of times gprc_stats_log_start_write() failed due to
out-of-space. */
-int census_log_out_of_space_count();
+int census_log_out_of_space_count(void);
#endif /* __GRPC_INTERNAL_STATISTICS_LOG_H__ */
diff --git a/src/core/statistics/census_rpc_stats.c b/src/core/statistics/census_rpc_stats.c
index a1ac2abff3..2db3054a0d 100644
--- a/src/core/statistics/census_rpc_stats.c
+++ b/src/core/statistics/census_rpc_stats.c
@@ -59,9 +59,9 @@ static gpr_mu g_mu;
static census_ht* g_client_stats_store = NULL;
static census_ht* g_server_stats_store = NULL;
-static void init_mutex() { gpr_mu_init(&g_mu); }
+static void init_mutex(void) { gpr_mu_init(&g_mu); }
-static void init_mutex_once() {
+static void init_mutex_once(void) {
gpr_once_init(&g_stats_store_mu_init, init_mutex);
}
@@ -115,7 +115,7 @@ static gpr_timespec min_hour_total_intervals[3] = {
static const census_window_stats_stat_info window_stats_settings = {
sizeof(census_rpc_stats), init_rpc_stats, stat_add, stat_add_proportion};
-census_rpc_stats* census_rpc_stats_create_empty() {
+census_rpc_stats* census_rpc_stats_create_empty(void) {
census_rpc_stats* ret =
(census_rpc_stats*)gpr_malloc(sizeof(census_rpc_stats));
memset(ret, 0, sizeof(census_rpc_stats));
@@ -220,7 +220,7 @@ void census_get_server_stats(census_aggregated_rpc_stats* data) {
get_stats(g_server_stats_store, data);
}
-void census_stats_store_init() {
+void census_stats_store_init(void) {
gpr_log(GPR_INFO, "Initialize census stats store.");
init_mutex_once();
gpr_mu_lock(&g_mu);
@@ -233,7 +233,7 @@ void census_stats_store_init() {
gpr_mu_unlock(&g_mu);
}
-void census_stats_store_shutdown() {
+void census_stats_store_shutdown(void) {
gpr_log(GPR_INFO, "Shutdown census stats store.");
init_mutex_once();
gpr_mu_lock(&g_mu);
diff --git a/src/core/statistics/census_rpc_stats.h b/src/core/statistics/census_rpc_stats.h
index a9c999aa5c..81466907fd 100644
--- a/src/core/statistics/census_rpc_stats.h
+++ b/src/core/statistics/census_rpc_stats.h
@@ -53,7 +53,7 @@ struct census_rpc_stats {
};
/* Creates an empty rpc stats object on heap. */
-census_rpc_stats* census_rpc_stats_create_empty();
+census_rpc_stats* census_rpc_stats_create_empty(void);
typedef struct census_per_method_rpc_stats {
const char* method;
@@ -91,8 +91,8 @@ void census_get_server_stats(census_aggregated_rpc_stats* data_map);
DO NOT CALL from outside of grpc code. */
void census_get_client_stats(census_aggregated_rpc_stats* data_map);
-void census_stats_store_init();
-void census_stats_store_shutdown();
+void census_stats_store_init(void);
+void census_stats_store_shutdown(void);
#ifdef __cplusplus
}
diff --git a/src/core/statistics/census_tracing.c b/src/core/statistics/census_tracing.c
index 45302cd6ab..8c7cf11642 100644
--- a/src/core/statistics/census_tracing.c
+++ b/src/core/statistics/census_tracing.c
@@ -93,11 +93,13 @@ static gpr_uint64 op_id_2_uint64(census_op_id* id) {
return ret;
}
-static void init_mutex() { gpr_mu_init(&g_mu); }
+static void init_mutex(void) { gpr_mu_init(&g_mu); }
-static void init_mutex_once() { gpr_once_init(&g_init_mutex_once, init_mutex); }
+static void init_mutex_once(void) {
+ gpr_once_init(&g_init_mutex_once, init_mutex);
+}
-census_op_id census_tracing_start_op() {
+census_op_id census_tracing_start_op(void) {
gpr_mu_lock(&g_mu);
{
trace_obj* ret = (trace_obj*)gpr_malloc(sizeof(trace_obj));
@@ -164,7 +166,7 @@ void census_tracing_end_op(census_op_id op_id) {
gpr_mu_unlock(&g_mu);
}
-void census_tracing_init() {
+void census_tracing_init(void) {
gpr_log(GPR_INFO, "Initialize census trace store.");
init_mutex_once();
gpr_mu_lock(&g_mu);
@@ -177,7 +179,7 @@ void census_tracing_init() {
gpr_mu_unlock(&g_mu);
}
-void census_tracing_shutdown() {
+void census_tracing_shutdown(void) {
gpr_log(GPR_INFO, "Shutdown census trace store.");
gpr_mu_lock(&g_mu);
if (g_trace_store != NULL) {
@@ -189,9 +191,9 @@ void census_tracing_shutdown() {
gpr_mu_unlock(&g_mu);
}
-void census_internal_lock_trace_store() { gpr_mu_lock(&g_mu); }
+void census_internal_lock_trace_store(void) { gpr_mu_lock(&g_mu); }
-void census_internal_unlock_trace_store() { gpr_mu_unlock(&g_mu); }
+void census_internal_unlock_trace_store(void) { gpr_mu_unlock(&g_mu); }
trace_obj* census_get_trace_obj_locked(census_op_id op_id) {
if (g_trace_store == NULL) {
diff --git a/src/core/statistics/census_tracing.h b/src/core/statistics/census_tracing.h
index 2285a5cd6b..604096ba54 100644
--- a/src/core/statistics/census_tracing.h
+++ b/src/core/statistics/census_tracing.h
@@ -38,10 +38,10 @@
typedef struct trace_obj trace_obj;
/* Initializes trace store. This function is thread safe. */
-void census_tracing_init();
+void census_tracing_init(void);
/* Shutsdown trace store. This function is thread safe. */
-void census_tracing_shutdown();
+void census_tracing_shutdown(void);
/* Gets trace obj corresponding to the input op_id. Returns NULL if trace store
is not initialized or trace obj is not found. Requires trace store being
@@ -50,8 +50,8 @@ trace_obj* census_get_trace_obj_locked(census_op_id op_id);
/* The following two functions acquire and release the trace store global lock.
They are for census internal use only. */
-void census_internal_lock_trace_store();
-void census_internal_unlock_trace_store();
+void census_internal_lock_trace_store(void);
+void census_internal_unlock_trace_store(void);
/* Gets method tag name associated with the input trace object. */
const char* census_get_trace_method_name(const trace_obj* trace);
diff --git a/src/core/support/cpu.h b/src/core/support/cpu.h
index 2435ec0353..1c2dde74ee 100644
--- a/src/core/support/cpu.h
+++ b/src/core/support/cpu.h
@@ -38,12 +38,12 @@
/* Return the number of CPU cores on the current system. Will return 0 if
if information is not available. */
-int gpr_cpu_num_cores();
+int gpr_cpu_num_cores(void);
/* Return the CPU on which the current thread is executing; N.B. This should
be considered advisory only - it is possible that the thread is switched
to a different CPU at any time. Returns a value in range
[0, gpr_cpu_num_cores() - 1] */
-int gpr_cpu_current_cpu();
+int gpr_cpu_current_cpu(void);
#endif /* __GRPC_INTERNAL_SUPPORT_CPU_H__ */
diff --git a/src/core/support/cpu_linux.c b/src/core/support/cpu_linux.c
index 922b61c3c5..d800628806 100644
--- a/src/core/support/cpu_linux.c
+++ b/src/core/support/cpu_linux.c
@@ -75,7 +75,7 @@
#include <grpc/support/log.h>
-int gpr_cpu_num_cores() {
+int gpr_cpu_num_cores(void) {
static int ncpus = 0;
if (ncpus == 0) {
ncpus = sysconf(_SC_NPROCESSORS_ONLN);
@@ -87,7 +87,7 @@ int gpr_cpu_num_cores() {
return ncpus;
}
-int gpr_cpu_current_cpu() {
+int gpr_cpu_current_cpu(void) {
int cpu = sched_getcpu();
if (cpu < 0) {
gpr_log(GPR_ERROR, "Error determining current CPU: %s\n", strerror(errno));
diff --git a/src/core/support/cpu_posix.c b/src/core/support/cpu_posix.c
index 3dd1c548b0..2ea80807fc 100644
--- a/src/core/support/cpu_posix.c
+++ b/src/core/support/cpu_posix.c
@@ -45,7 +45,7 @@
static __thread char magic_thread_local;
-int gpr_cpu_num_cores() {
+int gpr_cpu_num_cores(void) {
static int ncpus = 0;
if (ncpus == 0) {
ncpus = sysconf(_SC_NPROCESSORS_ONLN);
@@ -63,7 +63,7 @@ static size_t shard_ptr(const void *info) {
return ((x >> 4) ^ (x >> 9) ^ (x >> 14)) % gpr_cpu_num_cores();
}
-int gpr_cpu_current_cpu() {
+int gpr_cpu_current_cpu(void) {
/* NOTE: there's no way I know to return the actual cpu index portably...
most code that's using this is using it to shard across work queues though,
so here we use thread identity instead to achieve a similar though not
diff --git a/src/core/support/log_linux.c b/src/core/support/log_linux.c
index 36fb4b5051..a0307e1a9a 100644
--- a/src/core/support/log_linux.c
+++ b/src/core/support/log_linux.c
@@ -47,7 +47,7 @@
#include <sys/syscall.h>
#include <unistd.h>
-static long gettid() { return syscall(__NR_gettid); }
+static long gettid(void) { return syscall(__NR_gettid); }
void gpr_log(const char *file, int line, gpr_log_severity severity,
const char *format, ...) {
diff --git a/src/core/support/log_posix.c b/src/core/support/log_posix.c
index ee2705a2c2..1292c9e8c3 100644
--- a/src/core/support/log_posix.c
+++ b/src/core/support/log_posix.c
@@ -50,7 +50,7 @@
#include <time.h>
#include <pthread.h>
-static gpr_intptr gettid() { return (gpr_intptr)pthread_self(); }
+static gpr_intptr gettid(void) { return (gpr_intptr)pthread_self(); }
void gpr_log(const char *file, int line, gpr_log_severity severity,
const char *format, ...) {
diff --git a/src/core/support/slice.c b/src/core/support/slice.c
index fcdeb478fb..836a5a6c2a 100644
--- a/src/core/support/slice.c
+++ b/src/core/support/slice.c
@@ -37,7 +37,7 @@
#include <string.h>
-gpr_slice gpr_empty_slice() {
+gpr_slice gpr_empty_slice(void) {
gpr_slice out;
out.refcount = 0;
out.data.inlined.length = 0;
diff --git a/src/core/support/string.c b/src/core/support/string.c
index b1f0795846..7960547735 100644
--- a/src/core/support/string.c
+++ b/src/core/support/string.c
@@ -63,7 +63,7 @@ typedef struct {
char *data;
} hexout;
-static hexout hexout_create() {
+static hexout hexout_create(void) {
hexout r = {0, 0, NULL};
return r;
}
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index d8a34cf68d..eefce52aae 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -600,17 +600,6 @@ grpc_call_error grpc_call_server_end_initial_metadata(grpc_call *call,
return GRPC_CALL_OK;
}
-grpc_call_error grpc_call_accept(grpc_call *call, grpc_completion_queue *cq,
- void *finished_tag, gpr_uint32 flags) {
- grpc_call_error err;
-
- err = grpc_call_server_accept(call, cq, finished_tag);
- if (err != GRPC_CALL_OK) return err;
- err = grpc_call_server_end_initial_metadata(call, flags);
- if (err != GRPC_CALL_OK) return err;
- return GRPC_CALL_OK;
-}
-
void grpc_call_client_initial_metadata_complete(
grpc_call_element *surface_element) {
grpc_call *call = grpc_call_from_top_element(surface_element);
diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c
index b59c36e03a..0f09933fc0 100644
--- a/src/core/surface/completion_queue.c
+++ b/src/core/surface/completion_queue.c
@@ -85,7 +85,7 @@ struct grpc_completion_queue {
/* Default do-nothing on_finish function */
static void null_on_finish(void *user_data, grpc_op_error error) {}
-grpc_completion_queue *grpc_completion_queue_create() {
+grpc_completion_queue *grpc_completion_queue_create(void) {
grpc_completion_queue *cc = gpr_malloc(sizeof(grpc_completion_queue));
memset(cc, 0, sizeof(*cc));
/* Initial ref is dropped by grpc_completion_queue_shutdown */
@@ -251,7 +251,7 @@ void grpc_cq_end_new_rpc(grpc_completion_queue *cc, void *tag, grpc_call *call,
}
/* Create a GRPC_QUEUE_SHUTDOWN event without queuing it anywhere */
-static event *create_shutdown_event() {
+static event *create_shutdown_event(void) {
event *ev = gpr_malloc(sizeof(event));
ev->base.type = GRPC_QUEUE_SHUTDOWN;
ev->base.call = NULL;
diff --git a/src/core/surface/init.c b/src/core/surface/init.c
index 832ec085c7..b5019eb03f 100644
--- a/src/core/surface/init.c
+++ b/src/core/surface/init.c
@@ -35,12 +35,12 @@
#include "src/core/statistics/census_interface.h"
#include "src/core/iomgr/iomgr.h"
-void grpc_init() {
+void grpc_init(void) {
grpc_iomgr_init();
census_init();
}
-void grpc_shutdown() {
+void grpc_shutdown(void) {
grpc_iomgr_shutdown();
census_shutdown();
}
diff --git a/src/core/transport/chttp2/alpn.c b/src/core/transport/chttp2/alpn.c
index 8107406f8b..bc4e789f60 100644
--- a/src/core/transport/chttp2/alpn.c
+++ b/src/core/transport/chttp2/alpn.c
@@ -46,7 +46,7 @@ int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size) {
return 0;
}
-size_t grpc_chttp2_num_alpn_versions() {
+size_t grpc_chttp2_num_alpn_versions(void) {
return GPR_ARRAY_SIZE(supported_versions);
}
diff --git a/src/core/transport/chttp2/alpn.h b/src/core/transport/chttp2/alpn.h
index de4da8fedb..cb96f17831 100644
--- a/src/core/transport/chttp2/alpn.h
+++ b/src/core/transport/chttp2/alpn.h
@@ -40,7 +40,7 @@
int grpc_chttp2_is_alpn_version_supported(const char *version, size_t size);
/* Returns the number of protocol versions to advertise */
-size_t grpc_chttp2_num_alpn_versions();
+size_t grpc_chttp2_num_alpn_versions(void);
/* Returns the protocol version at index i (0 <= i <
* grpc_chttp2_num_alpn_versions()) */
diff --git a/src/core/transport/chttp2/frame_settings.c b/src/core/transport/chttp2/frame_settings.c
index d8bc492870..3ca973c07b 100644
--- a/src/core/transport/chttp2/frame_settings.c
+++ b/src/core/transport/chttp2/frame_settings.c
@@ -102,7 +102,7 @@ gpr_slice grpc_chttp2_settings_create(gpr_uint32 *old, const gpr_uint32 *new,
return output;
}
-gpr_slice grpc_chttp2_settings_ack_create() {
+gpr_slice grpc_chttp2_settings_ack_create(void) {
gpr_slice output = gpr_slice_malloc(9);
fill_header(GPR_SLICE_START_PTR(output), 0, GRPC_CHTTP2_FLAG_ACK);
return output;
diff --git a/src/core/transport/chttp2/frame_settings.h b/src/core/transport/chttp2/frame_settings.h
index 855f9636bb..fc513913d9 100644
--- a/src/core/transport/chttp2/frame_settings.h
+++ b/src/core/transport/chttp2/frame_settings.h
@@ -88,7 +88,7 @@ extern const grpc_chttp2_setting_parameters
gpr_slice grpc_chttp2_settings_create(gpr_uint32 *old, const gpr_uint32 *new,
gpr_uint32 force_mask, size_t count);
/* Create an ack settings frame */
-gpr_slice grpc_chttp2_settings_ack_create();
+gpr_slice grpc_chttp2_settings_ack_create(void);
grpc_chttp2_parse_error grpc_chttp2_settings_parser_begin_frame(
grpc_chttp2_settings_parser *parser, gpr_uint32 length, gpr_uint8 flags,
diff --git a/src/core/transport/chttp2/gen_hpack_tables.c b/src/core/transport/chttp2/gen_hpack_tables.c
index 3b9e8ed4dc..cd78fcc39a 100644
--- a/src/core/transport/chttp2/gen_hpack_tables.c
+++ b/src/core/transport/chttp2/gen_hpack_tables.c
@@ -86,7 +86,7 @@ static unsigned char suffix_mask(unsigned char prefix_len) {
return ~prefix_mask(prefix_len);
}
-static void generate_first_byte_lut() {
+static void generate_first_byte_lut(void) {
int i, j, n;
const spec *chrspec;
unsigned char suffix;
@@ -136,21 +136,21 @@ typedef struct { char included[GRPC_CHTTP2_NUM_HUFFSYMS]; } symset;
typedef struct { int values[16]; } nibblelut;
/* returns a symset that includes all possible symbols */
-static symset symset_all() {
+static symset symset_all(void) {
symset x;
memset(x.included, 1, sizeof(x.included));
return x;
}
/* returns a symset that includes no symbols */
-static symset symset_none() {
+static symset symset_none(void) {
symset x;
memset(x.included, 0, sizeof(x.included));
return x;
}
/* returns an empty nibblelut */
-static nibblelut nibblelut_empty() {
+static nibblelut nibblelut_empty(void) {
nibblelut x;
int i;
for (i = 0; i < 16; i++) {
@@ -296,7 +296,7 @@ static void dump_ctbl(const char *name) {
printf("};\n");
}
-static void generate_huff_tables() {
+static void generate_huff_tables(void) {
int i;
build_dec_tbl(state_index(0, symset_all(), &i), 0, 0, 0, -1, symset_all());
@@ -317,7 +317,7 @@ static void generate_huff_tables() {
dump_ctbl("emit_sub_tbl");
}
-static void generate_base64_huff_encoder_table() {
+static void generate_base64_huff_encoder_table(void) {
static const char alphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int i;
@@ -332,7 +332,7 @@ static void generate_base64_huff_encoder_table() {
printf("};\n");
}
-static void generate_base64_inverse_table() {
+static void generate_base64_inverse_table(void) {
static const char alphabet[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
unsigned char inverse[256];
diff --git a/src/core/transport/metadata.c b/src/core/transport/metadata.c
index e8ab216671..6881b871ec 100644
--- a/src/core/transport/metadata.c
+++ b/src/core/transport/metadata.c
@@ -154,7 +154,7 @@ grpc_mdctx *grpc_mdctx_create_with_seed(gpr_uint32 seed) {
return ctx;
}
-grpc_mdctx *grpc_mdctx_create() {
+grpc_mdctx *grpc_mdctx_create(void) {
/* This seed is used to prevent remote connections from controlling hash table
* collisions. It needs to be somewhat unpredictable to a remote connection.
*/
diff --git a/src/core/transport/metadata.h b/src/core/transport/metadata.h
index 943e65a981..ac845def37 100644
--- a/src/core/transport/metadata.h
+++ b/src/core/transport/metadata.h
@@ -82,7 +82,7 @@ struct grpc_mdelem {
};
/* Create/orphan a metadata context */
-grpc_mdctx *grpc_mdctx_create();
+grpc_mdctx *grpc_mdctx_create(void);
grpc_mdctx *grpc_mdctx_create_with_seed(gpr_uint32 seed);
void grpc_mdctx_orphan(grpc_mdctx *mdctx);
diff --git a/src/ruby/grpc.gemspec b/src/ruby/grpc.gemspec
index 3e1dcd578b..53fdd29a79 100755
--- a/src/ruby/grpc.gemspec
+++ b/src/ruby/grpc.gemspec
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.add_dependency 'xray'
s.add_dependency 'logging', '~> 1.8'
- s.add_dependency 'google-protobuf', '~> 3.0.0alpha'
+ s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1'
s.add_dependency 'minitest', '~> 5.4' # not a dev dependency, used by the interop tests
s.add_development_dependency "bundler", "~> 1.7"