Windows fixes

pull/3423/head
Craig Tiller 9 years ago
parent f4fc5d2bfd
commit 04456843cd
  1. 6
      include/grpc++/impl/call.h
  2. 4
      src/cpp/proto/proto_utils.cc
  3. 8
      src/cpp/util/time.cc

@ -126,11 +126,11 @@ class WriteOptions {
}
private:
void SetBit(const gpr_int32 mask) { flags_ |= mask; }
void SetBit(const gpr_uint32 mask) { flags_ |= mask; }
void ClearBit(const gpr_int32 mask) { flags_ &= ~mask; }
void ClearBit(const gpr_uint32 mask) { flags_ &= ~mask; }
bool GetBit(const gpr_int32 mask) const { return flags_ & mask; }
bool GetBit(const gpr_uint32 mask) const { return (flags_ & mask) != 0; }
gpr_uint32 flags_;
};

@ -36,6 +36,7 @@
#include <grpc/grpc.h>
#include <grpc/byte_buffer.h>
#include <grpc/byte_buffer_reader.h>
#include <grpc/support/log.h>
#include <grpc/support/slice.h>
#include <grpc/support/slice_buffer.h>
#include <grpc/support/port_platform.h>
@ -111,7 +112,8 @@ class GrpcBufferReader GRPC_FINAL
if (backup_count_ > 0) {
*data = GPR_SLICE_START_PTR(slice_) + GPR_SLICE_LENGTH(slice_) -
backup_count_;
*size = backup_count_;
GPR_ASSERT(backup_count_ <= INT_MAX);
*size = (int)backup_count_;
backup_count_ = 0;
return true;
}

@ -57,8 +57,8 @@ void Timepoint2Timespec(const system_clock::time_point& from,
return;
}
nanoseconds nsecs = duration_cast<nanoseconds>(deadline - secs);
to->tv_sec = secs.count();
to->tv_nsec = nsecs.count();
to->tv_sec = (time_t)secs.count();
to->tv_nsec = (int)nsecs.count();
to->clock_type = GPR_CLOCK_REALTIME;
}
@ -73,8 +73,8 @@ void TimepointHR2Timespec(const high_resolution_clock::time_point& from,
return;
}
nanoseconds nsecs = duration_cast<nanoseconds>(deadline - secs);
to->tv_sec = secs.count();
to->tv_nsec = nsecs.count();
to->tv_sec = (time_t)secs.count();
to->tv_nsec = (int)nsecs.count();
to->clock_type = GPR_CLOCK_REALTIME;
}

Loading…
Cancel
Save