From 67edfbaef8594c21df699a4b7e1aff07d926b9fc Mon Sep 17 00:00:00 2001 From: "rossberg@chromium.org" Date: Wed, 13 Nov 2013 12:18:52 +0000 Subject: [PATCH] Fix warnings R=yangguo@chromium.org BUG= Review URL: https://codereview.chromium.org/71373003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17688 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 2 ++ src/api.cc | 17 ++++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/v8.h b/include/v8.h index 6d97e19..f8ef7c1 100644 --- a/include/v8.h +++ b/include/v8.h @@ -329,6 +329,8 @@ template class Handle { friend Handle False(Isolate* isolate); friend class Context; friend class HandleScope; + friend class Object; + friend class Private; V8_INLINE static Handle New(Isolate* isolate, T* that); diff --git a/src/api.cc b/src/api.cc index e55e0aa..65e7345 100644 --- a/src/api.cc +++ b/src/api.cc @@ -3192,8 +3192,8 @@ bool v8::Object::ForceSet(v8::Handle key, bool v8::Object::SetPrivate(v8::Handle key, v8::Handle value) { - v8::Handle* key_as_value = reinterpret_cast*>(&key); - return Set(*key_as_value, value, DontEnum); + return Set(v8::Handle(reinterpret_cast(*key)), + value, DontEnum); } @@ -3249,8 +3249,7 @@ Local v8::Object::Get(uint32_t index) { Local v8::Object::GetPrivate(v8::Handle key) { - v8::Handle* key_as_value = reinterpret_cast*>(&key); - return Get(*key_as_value); + return Get(v8::Handle(reinterpret_cast(*key))); } @@ -3454,8 +3453,7 @@ bool v8::Object::Delete(v8::Handle key) { bool v8::Object::DeletePrivate(v8::Handle key) { - v8::Handle* key_as_value = reinterpret_cast*>(&key); - return Delete(*key_as_value); + return Delete(v8::Handle(reinterpret_cast(*key))); } @@ -3474,8 +3472,7 @@ bool v8::Object::Has(v8::Handle key) { bool v8::Object::HasPrivate(v8::Handle key) { - v8::Handle* key_as_value = reinterpret_cast*>(&key); - return Has(*key_as_value); + return Has(v8::Handle(reinterpret_cast(*key))); } @@ -6197,9 +6194,7 @@ Local v8::Private::New( symbol->set_name(*name); } Local result = Utils::ToLocal(symbol); - v8::Handle* result_as_private = - reinterpret_cast*>(&result); - return *result_as_private; + return v8::Handle(reinterpret_cast(*result)); } -- 2.7.4