aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/compiler/ruby_generator_helpers-inl.h2
-rw-r--r--src/cpp/util/time.cc5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/ruby_generator_helpers-inl.h b/src/compiler/ruby_generator_helpers-inl.h
index 70fb980d91..67a5eedd09 100644
--- a/src/compiler/ruby_generator_helpers-inl.h
+++ b/src/compiler/ruby_generator_helpers-inl.h
@@ -44,7 +44,7 @@ namespace grpc_ruby_generator {
inline bool ServicesFilename(const google::protobuf::FileDescriptor* file,
string* file_name_or_error) {
// Get output file name.
- static const int proto_suffix_length = 6; // length of ".proto"
+ static const unsigned proto_suffix_length = 6; // length of ".proto"
if (file->name().size() > proto_suffix_length &&
file->name().find_last_of(".proto") == file->name().size() - 1) {
*file_name_or_error = file->name().substr(
diff --git a/src/cpp/util/time.cc b/src/cpp/util/time.cc
index 150ec8ed5a..6976fa1b32 100644
--- a/src/cpp/util/time.cc
+++ b/src/cpp/util/time.cc
@@ -54,8 +54,9 @@ void Timepoint2Timespec(const system_clock::time_point& from,
system_clock::time_point Timespec2Timepoint(gpr_timespec t) {
system_clock::time_point tp;
- tp += seconds(t.tv_sec);
- tp += nanoseconds(t.tv_nsec);
+ tp += duration_cast<system_clock::time_point::duration>(seconds(t.tv_sec));
+ tp +=
+ duration_cast<system_clock::time_point::duration>(nanoseconds(t.tv_nsec));
return tp;
}