[ruby-cvs:62187] akr:r55024 (trunk): [Feature #12005] Unify Fixnum and Bignum into Integer

akr at ruby-lang.org akr at ruby-lang.org
Tue May 17 15:53:49 JST 2016


akr	2016-05-17 15:53:48 +0900 (Tue, 17 May 2016)

  New Revision: 55024

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55024

  Log:
    [Feature #12005] Unify Fixnum and Bignum into Integer
    
    * [Feature #12005] Unify Fixnum and Bignum into Integer
    
    * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums.
    
    * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from
      FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG.
    
    * vm_core.h: Ditto.
    
    * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead
      of FIXNUM_REDEFINED_OP_FLAG.
    
    * vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of
      rb_cFixnum and rb_cBignum.
      (C): Use Integer instead of Fixnum and Bignum.
    
    * numeric.c (fix_succ): Removed.
      (Init_Numeric): Define Fixnum as Integer.
    
    * bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum.
      (rb_int_coerce): replaced from rb_big_coerce and return fixnums
      as-is.
      (Init_Bignum): Define Bignum as Integer.
      Don't define ===.
    
    * error.c (builtin_class_name): Return "Integer" for fixnums.
    
    * sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum.
    
    * ext/-test-/testutil: New directory to test.
      Currently it provides utilities for fixnum and bignum.
    
    * ext/json/generator/generator.c: Define mInteger_to_json.
    
    * lib/mathn.rb (Fixnum#/): Redefinition removed.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c
    trunk/bootstraptest/test_literal.rb
    trunk/error.c
    trunk/ext/json/generator/generator.c
    trunk/ext/json/generator/generator.h
    trunk/include/ruby/ruby.h
    trunk/insns.def
    trunk/lib/mathn.rb
    trunk/numeric.c
    trunk/sprintf.c
    trunk/test/-ext-/num2int/test_num2int.rb
    trunk/test/-ext-/typeddata/test_typeddata.rb
    trunk/test/lib/test/unit/assertions.rb
    trunk/test/lib/test/unit.rb
    trunk/test/ruby/test_bignum.rb
    trunk/test/ruby/test_hash.rb
    trunk/test/ruby/test_integer.rb
    trunk/test/ruby/test_numeric.rb
    trunk/test/ruby/test_optimization.rb
    trunk/test/ruby/test_regexp.rb
    trunk/test/ruby/test_settracefunc.rb
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_insnhelper.c


More information about the ruby-cvs mailing list