From 08c458174cb14449ba873b5d3389c11c01093fc8 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Tue, 22 May 2012 12:17:31 -0500 Subject: [PATCH] Use equivalence classe for integer conversion --- ext/v8/array.cc | 2 +- ext/v8/function.cc | 4 ++-- ext/v8/invocation.cc | 2 +- ext/v8/rr.cc | 2 +- ext/v8/template.cc | 2 +- ext/v8/value.cc | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/v8/array.cc b/ext/v8/array.cc index ab4b9bb..dafaf18 100644 --- a/ext/v8/array.cc +++ b/ext/v8/array.cc @@ -16,7 +16,7 @@ VALUE Array::New(int argc, VALUE argv[], VALUE self) { } VALUE Array::Length(VALUE self) { - return UINT2NUM(Array(self)->Length()); + return UInt32(Array(self)->Length()); } VALUE Array::CloneElementAt(VALUE self, VALUE index) { diff --git a/ext/v8/function.cc b/ext/v8/function.cc index 01a6476..5c6a602 100644 --- a/ext/v8/function.cc +++ b/ext/v8/function.cc @@ -43,11 +43,11 @@ namespace rr { } VALUE Function::GetScriptLineNumber(VALUE self) { - return INT2FIX(Function(self)->GetScriptLineNumber()); + return Int(Function(self)->GetScriptLineNumber()); } VALUE Function::GetScriptColumnNumber(VALUE self) { - return INT2FIX(Function(self)->GetScriptColumnNumber()); + return Int(Function(self)->GetScriptColumnNumber()); } VALUE Function::GetScriptId(VALUE self) { diff --git a/ext/v8/invocation.cc b/ext/v8/invocation.cc index 497e530..237160f 100644 --- a/ext/v8/invocation.cc +++ b/ext/v8/invocation.cc @@ -57,7 +57,7 @@ namespace rr { } VALUE Invocation::Arguments::Length(VALUE self) { - return INT2FIX(Arguments(self)->Length()); + return Int(Arguments(self)->Length()); } VALUE Invocation::Arguments::Get(VALUE self, VALUE index) { diff --git a/ext/v8/rr.cc b/ext/v8/rr.cc index 5fed193..c3ec1e1 100644 --- a/ext/v8/rr.cc +++ b/ext/v8/rr.cc @@ -68,7 +68,7 @@ namespace rr { return *this; } ClassBuilder& ClassBuilder::defineEnumConst(const char* name, int value) { - rb_define_const(this->value, name, INT2FIX(value)); + rb_define_const(this->value, name, Int(value)); return *this; } ClassBuilder& ClassBuilder::store(VALUE* storage) { diff --git a/ext/v8/template.cc b/ext/v8/template.cc index 7a01cb1..757c167 100644 --- a/ext/v8/template.cc +++ b/ext/v8/template.cc @@ -94,7 +94,7 @@ namespace rr { } VALUE ObjectTemplate::InternalFieldCount(VALUE self) { - return INT2FIX(ObjectTemplate(self)->InternalFieldCount()); + return Int(ObjectTemplate(self)->InternalFieldCount()); } VALUE ObjectTemplate::SetInternalFieldCount(VALUE self, VALUE count) { diff --git a/ext/v8/value.cc b/ext/v8/value.cc index be4b395..d380676 100644 --- a/ext/v8/value.cc +++ b/ext/v8/value.cc @@ -31,10 +31,10 @@ Value::operator VALUE() { return External((v8::Handle)v8::External::Cast(*handle)); } if (handle->IsUint32()) { - return UINT2NUM(handle->Uint32Value()); + return UInt32(handle->Uint32Value()); } if (handle->IsInt32()) { - return INT2FIX(handle->Int32Value()); + return Int(handle->Int32Value()); } if (handle->IsBoolean()) { return handle->BooleanValue() ? Qtrue : Qfalse;