From 707a0a946d55df772012b282c594df790371ec23 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 27 Aug 1998 03:55:54 +0000 Subject: 1.1c3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'object.c') diff --git a/object.c b/object.c index 3dc1243141..7253baa376 100644 --- a/object.c +++ b/object.c @@ -68,11 +68,18 @@ any_to_a(obj) return ary_new3(1, obj); } +static VALUE +obj_hash(obj) + VALUE obj; +{ + return (long)obj|FIXNUM_FLAG; +} + static VALUE obj_id(obj) VALUE obj; { - return INT2NUM((int)obj); + return INT2NUM((long)obj); } static VALUE @@ -963,7 +970,7 @@ Init_Object() rb_define_method(mKernel, "eql?", obj_equal, 1); - rb_define_method(mKernel, "hash", obj_id, 0); + rb_define_method(mKernel, "hash", obj_hash, 0); rb_define_method(mKernel, "id", obj_id, 0); rb_define_method(mKernel, "__id__", obj_id, 0); rb_define_method(mKernel, "type", obj_type, 0); -- cgit v1.2.3