summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-08-27 03:55:54 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-08-27 03:55:54 +0000
commit707a0a946d55df772012b282c594df790371ec23 (patch)
tree84dec9dacaafa14ca3507be443a228137fea9a03 /object.c
parent39ac1d7c22072f2d520738098692bdbce2f380df (diff)
1.1c3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/object.c b/object.c
index 3dc1243141..7253baa376 100644
--- a/object.c
+++ b/object.c
@@ -69,10 +69,17 @@ any_to_a(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);