From 081e3200c8da1d6bb755191180921270192fec73 Mon Sep 17 00:00:00 2001 From: rsilvera Date: Tue, 16 Dec 2014 15:57:35 -0800 Subject: [PATCH] Add missing casts to enable compilation with gcc 4.7 Change on 2014/12/16 by rsilvera ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=82275653 --- src/compiler/ruby_generator_helpers-inl.h | 2 +- src/cpp/util/time.cc | 5 +++-- 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 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; }