diff --git a/src/compiler/ruby_generator_helpers-inl.h b/src/compiler/ruby_generator_helpers-inl.h index 70fb980d918..67a5eedd09b 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 150ec8ed5ac..6976fa1b321 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(seconds(t.tv_sec)); + tp += + duration_cast(nanoseconds(t.tv_nsec)); return tp; }