diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-10-29 12:27:24 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2013-10-29 15:09:44 -0700 |
commit | 93f75a86bf6c87aa897312740aab61282b0eff1d (patch) | |
tree | 18c33d405b8f22bfeeb1a35cba45fa3b9d9703ed /src/tty_wrap.cc | |
parent | 4b84e42f67d7754574bf7d289524f6dffcb5e14a (diff) | |
download | android-node-v8-93f75a86bf6c87aa897312740aab61282b0eff1d.tar.gz android-node-v8-93f75a86bf6c87aa897312740aab61282b0eff1d.tar.bz2 android-node-v8-93f75a86bf6c87aa897312740aab61282b0eff1d.zip |
src: use function to get internal pointer
Remove the NODE_{WRAP,UNWRAP} macros and instead use template functions.
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r-- | src/tty_wrap.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index aad19a7e60..bf94309cda 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -28,6 +28,8 @@ #include "node_wrap.h" #include "req_wrap.h" #include "stream_wrap.h" +#include "util.h" +#include "util-inl.h" namespace node { @@ -89,9 +91,7 @@ void TTYWrap::Initialize(Handle<Object> target, TTYWrap* TTYWrap::Unwrap(Local<Object> obj) { - TTYWrap* wrap; - NODE_UNWRAP(obj, TTYWrap, wrap); - return wrap; + return UnwrapObject<TTYWrap>(obj); } @@ -135,8 +135,7 @@ void TTYWrap::IsTTY(const FunctionCallbackInfo<Value>& args) { void TTYWrap::GetWindowSize(const FunctionCallbackInfo<Value>& args) { HandleScope scope(node_isolate); - TTYWrap* wrap; - NODE_UNWRAP(args.This(), TTYWrap, wrap); + TTYWrap* wrap = UnwrapObject<TTYWrap>(args.This()); assert(args[0]->IsArray()); int width, height; @@ -155,8 +154,7 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo<Value>& args) { void TTYWrap::SetRawMode(const FunctionCallbackInfo<Value>& args) { HandleScope scope(node_isolate); - TTYWrap* wrap; - NODE_UNWRAP(args.This(), TTYWrap, wrap); + TTYWrap* wrap = UnwrapObject<TTYWrap>(args.This()); int err = uv_tty_set_mode(&wrap->handle_, args[0]->IsTrue()); args.GetReturnValue().Set(err); |