summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-09 11:34:17 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-09 11:34:17 +0000
commitac2864a871ae15ece8d268d47d9e9a1821b0c70b (patch)
tree325e02b244ed22a0135d3f0d93b3c186670b8482 /hash.c
parent4ee57e088fad7e383e851778c6fd44e87335eb0c (diff)
* hash.c (rb_objid_hash): should return `long'. brushup r44534.
* object.c (rb_obj_hash): follow above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hash.c b/hash.c
index 7074413..87f5128 100644
--- a/hash.c
+++ b/hash.c
@@ -122,7 +122,7 @@ rb_hash(VALUE obj)
return hval;
}
-st_index_t rb_objid_hash(st_index_t index);
+long rb_objid_hash(st_index_t index);
static st_index_t
rb_any_hash(VALUE a)
@@ -132,8 +132,7 @@ rb_any_hash(VALUE a)
if (SPECIAL_CONST_P(a)) {
if (a == Qundef) return 0;
- /* assume hnum is long, so need to drop upper dword on LLP64. */
- hnum = (long)rb_objid_hash((st_index_t)a);
+ hnum = rb_objid_hash((st_index_t)a);
}
else if (BUILTIN_TYPE(a) == T_STRING) {
hnum = rb_str_hash(a);
@@ -146,7 +145,7 @@ rb_any_hash(VALUE a)
return (st_index_t)RSHIFT(hnum, 1);
}
-st_index_t
+long
rb_objid_hash(st_index_t index)
{
st_index_t hnum = rb_hash_start(index);