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
This commit is contained in:
parent
9db0b2d7ee
commit
f2b6e9f05f
6
hash.c
6
hash.c
@ -162,7 +162,7 @@ rb_dbl_long_hash(double d)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline st_index_t
|
static inline long
|
||||||
any_hash(VALUE a, st_index_t (*other_func)(VALUE))
|
any_hash(VALUE a, st_index_t (*other_func)(VALUE))
|
||||||
{
|
{
|
||||||
VALUE hval;
|
VALUE hval;
|
||||||
@ -199,7 +199,7 @@ any_hash(VALUE a, st_index_t (*other_func)(VALUE))
|
|||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
hnum <<= 1;
|
hnum <<= 1;
|
||||||
return (st_index_t)RSHIFT(hnum, 1);
|
return (long)RSHIFT(hnum, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static st_index_t
|
static st_index_t
|
||||||
@ -262,7 +262,7 @@ objid_hash(VALUE obj)
|
|||||||
VALUE
|
VALUE
|
||||||
rb_obj_hash(VALUE obj)
|
rb_obj_hash(VALUE obj)
|
||||||
{
|
{
|
||||||
st_index_t hnum = any_hash(obj, objid_hash);
|
long hnum = any_hash(obj, objid_hash);
|
||||||
return ST2FIX(hnum);
|
return ST2FIX(hnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user