From 8be410f0653bfb22970381447acf685af4795c00 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 13 Feb 2001 05:09:11 +0000 Subject: * io.c (rb_io_ctl): do not call ioctl/fcntl for f2, if f and f2 have same fileno. * eval.c (rb_load): raise LocaJumpError if unexpected local jumps appear during load. * ext/socket/socket.c (bsock_close_read): don't call rb_thread_fd_close(); it's supposed to be called by io_io_close(). * ext/socket/socket.c (bsock_close_read): do not modify f and f2. * ext/socket/socket.c (bsock_close_write): ditto. * ext/socket/socket.c (sock_new): avoid dup(2) on sockets. * parse.y (primary): preserve and clear in_single and in_def using stack to prevent nested method errors in singleton class bodies. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- hash.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index bcda8065af..ce46f406af 100644 --- a/hash.c +++ b/hash.c @@ -79,16 +79,16 @@ static int rb_any_hash(a) VALUE a; { - unsigned int hval; + VALUE hval; switch (TYPE(a)) { case T_FIXNUM: case T_SYMBOL: - hval = a; + return (int)a; break; case T_STRING: - hval = rb_str_hash(a); + return rb_str_hash(a); break; default: @@ -98,9 +98,8 @@ rb_any_hash(a) hval = rb_funcall(hval, '%', 1, INT2FIX(65439)); } ENABLE_INTS; - hval = FIX2LONG(hval); + return (int)FIX2LONG(hval); } - return hval; } static struct st_hash_type objhash = { -- cgit v1.2.3