ruby-changes:43526
From: usa <ko1@a...>
Date: Thu, 7 Jul 2016 00:07:49 +0900 (JST)
Subject: [ruby-changes:43526] usa:r55599 (ruby_2_2): * bignum.c (Init_Bignum): revert a part of previous commit (r55598),
usa 2016-07-07 00:07:44 +0900 (Thu, 07 Jul 2016) New Revision: 55599 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55599 Log: * bignum.c (Init_Bignum): revert a part of previous commit (r55598), because the implementation of Object#hash is a little difference from trunk. cf. [Backport #12391] Modified files: branches/ruby_2_2/ChangeLog branches/ruby_2_2/bignum.c branches/ruby_2_2/version.h Index: ruby_2_2/version.h =================================================================== --- ruby_2_2/version.h (revision 55598) +++ ruby_2_2/version.h (revision 55599) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1 #define RUBY_VERSION "2.2.6" -#define RUBY_RELEASE_DATE "2016-07-06" -#define RUBY_PATCHLEVEL 341 +#define RUBY_RELEASE_DATE "2016-07-07" +#define RUBY_PATCHLEVEL 342 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 7 -#define RUBY_RELEASE_DAY 6 +#define RUBY_RELEASE_DAY 7 #include "ruby/version.h" Index: ruby_2_2/bignum.c =================================================================== --- ruby_2_2/bignum.c (revision 55598) +++ ruby_2_2/bignum.c (revision 55599) @@ -6780,6 +6780,15 @@ rb_big_aref(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/bignum.c#L6780 return (xds[s1] & bit) ? INT2FIX(1) : INT2FIX(0); } +/* + * call-seq: + * big.hash -> fixnum + * + * Compute a hash based on the value of _big_. + * + * See also Object#hash. + */ + VALUE rb_big_hash(VALUE x) { @@ -7019,6 +7028,7 @@ Init_Bignum(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/bignum.c#L7028 rb_define_method(rb_cBignum, "<=", big_le, 1); rb_define_method(rb_cBignum, "===", rb_big_eq, 1); rb_define_method(rb_cBignum, "eql?", rb_big_eql, 1); + rb_define_method(rb_cBignum, "hash", rb_big_hash, 0); rb_define_method(rb_cBignum, "to_f", rb_big_to_f, 0); rb_define_method(rb_cBignum, "abs", rb_big_abs, 0); rb_define_method(rb_cBignum, "magnitude", rb_big_abs, 0); Index: ruby_2_2/ChangeLog =================================================================== --- ruby_2_2/ChangeLog (revision 55598) +++ ruby_2_2/ChangeLog (revision 55599) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1 +Thu Jul 7 00:05:00 2016 NAKAMURA Usaku <usa@r...> + + * bignum.c (Init_Bignum): revert a part of previous commit (r55598), + because the implementation of Object#hash is a little difference from + trunk. cf. [Backport #12391] + Wed Jul 6 23:02:03 2016 Kenta Murata <mrkn@m...> * bignum.c (rb_big_hash): make it public function to be available in -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/