神刀安全网

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 fromFIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG.

  • vm_core.h: Ditto.

  • vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG insteadof 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.

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Unify Fixnum and Bignum into Integer

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址