Add missing casts to enable compilation with gcc 4.7

Change on 2014/12/16 by rsilvera <rsilvera@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82275653
pull/1/merge
rsilvera 10 years ago committed by Nicolas Noble
parent 20e2e3fba8
commit 081e3200c8
  1. 2
      src/compiler/ruby_generator_helpers-inl.h
  2. 5
      src/cpp/util/time.cc

@ -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(

@ -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;
}

Loading…
Cancel
Save