aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/ext/byte_buffer.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-11-06 12:50:14 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-11-06 12:50:14 -0800
commit0be9ad440878b94d9a68f35992c23e7f99375dbc (patch)
tree9ce37a5e50f1ee47df6d42ef3e44d63160e8d0dc /src/node/ext/byte_buffer.cc
parentc60659ad023d01f8d0f6ad0f87fefbd3740002d0 (diff)
parente759d2ad7abdb0702970eeccc5f033ff4b2a4c7f (diff)
Merge github.com:grpc/grpc into lfe3
Diffstat (limited to 'src/node/ext/byte_buffer.cc')
-rw-r--r--src/node/ext/byte_buffer.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc
index 1040f70d71..598b70946c 100644
--- a/src/node/ext/byte_buffer.cc
+++ b/src/node/ext/byte_buffer.cc
@@ -35,27 +35,27 @@ using Nan::MaybeLocal;
using v8::Function;
using v8::Local;
-using v8::Object;
using v8::Number;
+using v8::Object;
using v8::Value;
-grpc_byte_buffer *BufferToByteBuffer(Local<Value> buffer) {
+grpc_byte_buffer* BufferToByteBuffer(Local<Value> buffer) {
Nan::HandleScope scope;
grpc_slice slice = CreateSliceFromBuffer(buffer);
- grpc_byte_buffer *byte_buffer(grpc_raw_byte_buffer_create(&slice, 1));
+ grpc_byte_buffer* byte_buffer(grpc_raw_byte_buffer_create(&slice, 1));
grpc_slice_unref(slice);
return byte_buffer;
}
namespace {
-void delete_buffer(char *data, void *hint) {
- grpc_slice *slice = static_cast<grpc_slice *>(hint);
+void delete_buffer(char* data, void* hint) {
+ grpc_slice* slice = static_cast<grpc_slice*>(hint);
grpc_slice_unref(*slice);
delete slice;
}
-}
+} // namespace
-Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
+Local<Value> ByteBufferToBuffer(grpc_byte_buffer* buffer) {
Nan::EscapableHandleScope scope;
if (buffer == NULL) {
return scope.Escape(Nan::Null());
@@ -65,10 +65,10 @@ Local<Value> ByteBufferToBuffer(grpc_byte_buffer *buffer) {
Nan::ThrowError("Error initializing byte buffer reader.");
return scope.Escape(Nan::Undefined());
}
- grpc_slice *slice = new grpc_slice;
+ grpc_slice* slice = new grpc_slice;
*slice = grpc_byte_buffer_reader_readall(&reader);
grpc_byte_buffer_reader_destroy(&reader);
- char *result = reinterpret_cast<char *>(GRPC_SLICE_START_PTR(*slice));
+ char* result = reinterpret_cast<char*>(GRPC_SLICE_START_PTR(*slice));
size_t length = GRPC_SLICE_LENGTH(*slice);
Local<Value> buf =
Nan::NewBuffer(result, length, delete_buffer, slice).ToLocalChecked();