diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-08 13:10:04 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-09-08 13:10:04 +0000 |
commit | 31b7ae00c05aef76416c767df92be45d62e9d06a (patch) | |
tree | 87743fd1893484f1af704d20e3695810ea21a893 /proc.c | |
parent | 034414741e4616f7a305f12fe36e1f9a6b0ff074 (diff) |
* include/ruby/st.h (st_hash_func): use st_index_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -771,12 +771,13 @@ proc_eq(VALUE self, VALUE other) static VALUE proc_hash(VALUE self) { - long hash; + st_index_t hash; rb_proc_t *proc; GetProcPtr(self, proc); - hash = (long)proc->block.iseq; - hash ^= (long)proc->envval; - hash ^= (long)proc->block.lfp >> 16; + hash = rb_hash_start((st_index_t)proc->block.iseq); + hash = rb_hash_uint(hash, (st_index_t)proc->envval); + hash = rb_hash_uint(hash, (st_index_t)proc->block.lfp >> 16); + hash = rb_hash_end(hash); return LONG2FIX(hash); } @@ -993,12 +994,13 @@ static VALUE method_hash(VALUE method) { struct METHOD *m; - long hash; + st_index_t hash; TypedData_Get_Struct(method, struct METHOD, &method_data_type, m); - hash = (long)m->rclass; - hash ^= (long)m->recv; - hash ^= (long)m->me.def; + hash = rb_hash_start((st_index_t)m->rclass); + hash = rb_hash_uint(hash, (st_index_t)m->recv); + hash = rb_hash_uint(hash, (st_index_t)m->me.def); + hash = rb_hash_end(hash); return INT2FIX(hash); } |