From 244398acccc1068be3ec7518ee53ad159dafc88e Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 8 Sep 2009 13:10:04 +0000 Subject: * include/ruby/st.h (st_hash_func): use st_index_t. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 39a66976c..710de3915 100644 --- a/proc.c +++ b/proc.c @@ -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); } -- cgit