aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl
diff options
context:
space:
mode:
authorGravatar chedeti <chedeti@google.com>2016-08-04 11:56:54 -0700
committerGravatar chedeti <chedeti@google.com>2016-08-04 11:56:54 -0700
commit76db7f9a7cdf6b5fd6706037c72de1dd131b181e (patch)
tree0f1e1d823d6d1a8c5dd1a13365cc00f08dab4aa1 /include/grpc++/impl
parent2e698457f370091111d0fe620bad306c743a3548 (diff)
use boost::make_shared
Diffstat (limited to 'include/grpc++/impl')
-rw-r--r--include/grpc++/impl/codegen/thrift_serializer.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/include/grpc++/impl/codegen/thrift_serializer.h b/include/grpc++/impl/codegen/thrift_serializer.h
index 04dcc699de..fcb0ffaad6 100644
--- a/include/grpc++/impl/codegen/thrift_serializer.h
+++ b/include/grpc++/impl/codegen/thrift_serializer.h
@@ -111,8 +111,8 @@ class ThriftSerializer {
Serialize(fields, &byte_buffer, &byte_buffer_size);
- gpr_slice slice =
- gpr_slice_from_copied_buffer((char*)byte_buffer, byte_buffer_size);
+ gpr_slice slice = gpr_slice_from_copied_buffer(
+ reinterpret_cast<const char*>(byte_buffer), byte_buffer_size);
*bp = grpc_raw_byte_buffer_create(&slice, 1);
@@ -131,12 +131,12 @@ class ThriftSerializer {
last_deserialized_ = true;
// reset buffer transport
- buffer_->resetBuffer((uint8_t*)serialized_buffer, length);
+ buffer_->resetBuffer(const_cast<uint8_t*>(serialized_buffer), length);
// read the protocol version if necessary
if (serialize_version_) {
std::string name = "";
- TMessageType mt = (TMessageType)0;
+ TMessageType mt = static_cast<TMessageType>(0);
int32_t seq_id = 0;
protocol_->readMessageBegin(name, mt, seq_id);
}
@@ -200,11 +200,9 @@ class ThriftSerializer {
bool serialize_version_;
void prepare() {
-
- buffer_.reset(new TMemoryBuffer());
-
+ buffer_ = boost::make_shared<TMemoryBuffer>(*(new TMemoryBuffer()));
// create a protocol for the memory buffer transport
- protocol_.reset(new Protocol(buffer_));
+ protocol_ = std::make_shared<Protocol>(*(new Protocol(buffer_)));
prepared_ = true;
}