aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-07 04:25:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-07 04:25:50 +0000
commit14c1f452b121a469ee2a0faccb15729ca0c53283 (patch)
treea638a5342d2396d4584b42336d1f6c082ca5de8e /hash.c
parentbc4426e3a768bd8d689510a2e77483e8a935ef26 (diff)
downloadruby-14c1f452b121a469ee2a0faccb15729ca0c53283.tar.gz
hash.c: hash should be long
* hash.c (any_hash): should return `long', because ruby assumes the hash value of the object id of an object is `long'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index afbc5220fb..785e56ffcf 100644
--- a/hash.c
+++ b/hash.c
@@ -162,7 +162,7 @@ rb_dbl_long_hash(double d)
#endif
}
-static inline st_index_t
+static inline long
any_hash(VALUE a, st_index_t (*other_func)(VALUE))
{
VALUE hval;
@@ -199,7 +199,7 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
}
out:
hnum <<= 1;
- return (st_index_t)RSHIFT(hnum, 1);
+ return (long)RSHIFT(hnum, 1);
}
static st_index_t
@@ -262,7 +262,7 @@ objid_hash(VALUE obj)
VALUE
rb_obj_hash(VALUE obj)
{
- st_index_t hnum = any_hash(obj, objid_hash);
+ long hnum = any_hash(obj, objid_hash);
return ST2FIX(hnum);
}