From b7c810f44e47a09dbd16adf08d67bf2d11a1a0fc Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 11 Mar 2011 09:10:39 -0800 Subject: [PATCH] Removed BUFFER_DATA macro --- src/Canvas.cc | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/Canvas.cc b/src/Canvas.cc index 5c325e8..f4662a4 100644 --- a/src/Canvas.cc +++ b/src/Canvas.cc @@ -16,16 +16,6 @@ Persistent Canvas::constructor; -/* - * Buffer data pointer access. - */ - -#if NODE_VERSION_AT_LEAST(0,3,0) -#define BUFFER_DATA(buf) Buffer::Data(buf->handle_) -#else -#define BUFFER_DATA(buf) buf->data() -#endif - /* * Initialize Canvas. */ @@ -161,7 +151,7 @@ Canvas::EIO_AfterToBuffer(eio_req *req) { closure->pfn->Call(Context::GetCurrent()->Global(), 1, argv); } else { Buffer *buf = Buffer::New(closure->len); - memcpy(BUFFER_DATA(buf), closure->data, closure->len); + memcpy(Buffer::Data(buf->handle_), closure->data, closure->len); Local argv[2] = { Local::New(Null()), Local::New(buf->handle_) }; closure->pfn->Call(Context::GetCurrent()->Global(), 2, argv); } @@ -207,7 +197,7 @@ Canvas::ToBuffer(const Arguments &args) { return ThrowException(Canvas::Error(status)); } else { Buffer *buf = Buffer::New(closure.len); - memcpy(BUFFER_DATA(buf), closure.data, closure.len); + memcpy(Buffer::Data(buf->handle_), closure.data, closure.len); return buf->handle_; } } @@ -222,7 +212,7 @@ streamPNG(void *c, const uint8_t *data, unsigned len) { HandleScope scope; closure_t *closure = (closure_t *) c; Local buf = Buffer::New(len); - memcpy(BUFFER_DATA(buf), data, len); + memcpy(Buffer::Data(buf->handle_), data, len); Local argv[3] = { Local::New(Null()) , Local::New(buf->handle_)