ruby-changes:44939
From: nobu <ko1@a...>
Date: Wed, 7 Dec 2016 13:25:55 +0900 (JST)
Subject: [ruby-changes:44939] nobu:r57012 (trunk): hash.c: hash should be long
nobu 2016-12-07 13:25:50 +0900 (Wed, 07 Dec 2016) New Revision: 57012 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57012 Log: 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'. Modified files: trunk/hash.c Index: hash.c =================================================================== --- hash.c (revision 57011) +++ hash.c (revision 57012) @@ -162,7 +162,7 @@ rb_dbl_long_hash(double d) https://github.com/ruby/ruby/blob/trunk/hash.c#L162 #endif } -static inline st_index_t +static inline long any_hash(VALUE a, st_index_t (*other_func)(VALUE)) { VALUE hval; @@ -199,7 +199,7 @@ any_hash(VALUE a, st_index_t (*other_fun https://github.com/ruby/ruby/blob/trunk/hash.c#L199 } out: hnum <<= 1; - return (st_index_t)RSHIFT(hnum, 1); + return (long)RSHIFT(hnum, 1); } static st_index_t @@ -262,7 +262,7 @@ objid_hash(VALUE obj) https://github.com/ruby/ruby/blob/trunk/hash.c#L262 VALUE rb_obj_hash(VALUE obj) { - st_index_t hnum = any_hash(obj, objid_hash); + long hnum = any_hash(obj, objid_hash); return ST2FIX(hnum); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/