diff options
author | Nicolas Noble <nicolasnoble@users.noreply.github.com> | 2017-11-06 12:36:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-06 12:36:46 -0800 |
commit | e759d2ad7abdb0702970eeccc5f033ff4b2a4c7f (patch) | |
tree | b958e8ecb8856bdd1cf7fbfe35c98a0873b130fd /src/node/ext/byte_buffer.cc | |
parent | 4f22c919e1207af206fc83e7378f04e047f7c78d (diff) | |
parent | 34992a63e0def16262d7fc9cac10ab527ac8eaa6 (diff) |
Merge pull request #13255 from ctiller/50
Update clang-format to 5.0
Diffstat (limited to 'src/node/ext/byte_buffer.cc')
-rw-r--r-- | src/node/ext/byte_buffer.cc | 18 |
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(); |