ruby-changes:29102
From: akr <ko1@a...>
Date: Sat, 8 Jun 2013 00:39:27 +0900 (JST)
Subject: [ruby-changes:29102] akr:r41154 (trunk): * bignum.c (validate_integer_pack_format): Renamed from
akr 2013-06-08 00:39:07 +0900 (Sat, 08 Jun 2013) New Revision: 41154 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41154 Log: * bignum.c (validate_integer_pack_format): Renamed from validate_integer_format. (integer_pack_loop_setup): Renamed from integer_format_loop_setup. (integer_pack_fill_dd): Renamed from int_export_fill_dd. (integer_pack_take_lowbits): Renamed from int_export_take_lowbits. (integer_unpack_push_bits): Renamed from int_import_push_bits. Modified files: trunk/ChangeLog trunk/bignum.c Index: ChangeLog =================================================================== --- ChangeLog (revision 41153) +++ ChangeLog (revision 41154) @@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Jun 8 00:37:32 2013 Tanaka Akira <akr@f...> + + * bignum.c (validate_integer_pack_format): Renamed from + validate_integer_format. + (integer_pack_loop_setup): Renamed from integer_format_loop_setup. + (integer_pack_fill_dd): Renamed from int_export_fill_dd. + (integer_pack_take_lowbits): Renamed from int_export_take_lowbits. + (integer_unpack_push_bits): Renamed from int_import_push_bits. + Fri Jun 7 23:58:06 2013 Tanaka Akira <akr@f...> * bignum.c (rb_integer_pack): Arguments changed. Use flags to Index: bignum.c =================================================================== --- bignum.c (revision 41153) +++ bignum.c (revision 41154) @@ -546,7 +546,7 @@ rb_absint_size_in_word(VALUE val, size_t https://github.com/ruby/ruby/blob/trunk/bignum.c#L546 INTEGER_PACK_NATIVE_BYTE_ORDER) static void -validate_integer_format(size_t wordsize, size_t nails, int flags) +validate_integer_pack_format(size_t wordsize, size_t nails, int flags) { int wordorder_bits = flags & INTEGER_PACK_WORDORDER_MASK; int byteorder_bits = flags & INTEGER_PACK_BYTEORDER_MASK; @@ -566,7 +566,7 @@ validate_integer_format(size_t wordsize, https://github.com/ruby/ruby/blob/trunk/bignum.c#L566 } static void -integer_format_loop_setup( +integer_pack_loop_setup( size_t numwords, size_t wordsize, size_t nails, int flags, size_t *word_num_fullbytes_ret, int *word_num_partialbits_ret, @@ -619,12 +619,12 @@ integer_format_loop_setup( https://github.com/ruby/ruby/blob/trunk/bignum.c#L619 #endif } if (byteorder_bits == INTEGER_PACK_MSBYTE_FIRST) { - byte_step = -1; byte_start = wordsize-1; + byte_step = -1; } else { - byte_step = 1; byte_start = 0; + byte_step = 1; } *word_num_partialbits_ret = word_num_partialbits; @@ -639,7 +639,7 @@ integer_format_loop_setup( https://github.com/ruby/ruby/blob/trunk/bignum.c#L639 } static inline void -int_export_fill_dd(BDIGIT **dpp, BDIGIT **dep, BDIGIT_DBL *ddp, int *numbits_in_dd_p) +integer_pack_fill_dd(BDIGIT **dpp, BDIGIT **dep, BDIGIT_DBL *ddp, int *numbits_in_dd_p) { if (*dpp < *dep && SIZEOF_BDIGITS * CHAR_BIT <= (int)sizeof(*ddp) * CHAR_BIT - *numbits_in_dd_p) { *ddp |= (BDIGIT_DBL)(*(*dpp)++) << *numbits_in_dd_p; @@ -652,7 +652,7 @@ int_export_fill_dd(BDIGIT **dpp, BDIGIT https://github.com/ruby/ruby/blob/trunk/bignum.c#L652 } static inline BDIGIT_DBL -int_export_take_lowbits(int n, BDIGIT_DBL *ddp, int *numbits_in_dd_p) +integer_pack_take_lowbits(int n, BDIGIT_DBL *ddp, int *numbits_in_dd_p) { BDIGIT_DBL ret; ret = (*ddp) & (((BDIGIT_DBL)1 << n) - 1); @@ -692,7 +692,7 @@ rb_integer_pack(VALUE val, int *signp, s https://github.com/ruby/ruby/blob/trunk/bignum.c#L692 val = rb_to_int(val); - validate_integer_format(wordsize, nails, flags); + validate_integer_pack_format(wordsize, nails, flags); if (words && SIZE_MAX / wordsize < numwords) rb_raise(rb_eArgError, "too big count * wordsize: %"PRI_SIZE_PREFIX"u * %"PRI_SIZE_PREFIX"u", numwords, wordsize); @@ -778,7 +778,7 @@ rb_integer_pack(VALUE val, int *signp, s https://github.com/ruby/ruby/blob/trunk/bignum.c#L778 BDIGIT_DBL dd; int numbits_in_dd; - integer_format_loop_setup(numwords, wordsize, nails, flags, + integer_pack_loop_setup(numwords, wordsize, nails, flags, &word_num_fullbytes, &word_num_partialbits, &word_num_nailbytes, &word_start, &word_step, &word_last, &byte_start, &byte_step); @@ -789,9 +789,9 @@ rb_integer_pack(VALUE val, int *signp, s https://github.com/ruby/ruby/blob/trunk/bignum.c#L789 numbits_in_dd = 0; #define FILL_DD \ - int_export_fill_dd(&dp, &de, &dd, &numbits_in_dd) + integer_pack_fill_dd(&dp, &de, &dd, &numbits_in_dd) #define TAKE_LOWBITS(n) \ - int_export_take_lowbits(n, &dd, &numbits_in_dd) + integer_pack_take_lowbits(n, &dd, &numbits_in_dd) while (1) { index_in_word = 0; @@ -835,7 +835,7 @@ rb_integer_pack(VALUE val, int *signp, s https://github.com/ruby/ruby/blob/trunk/bignum.c#L835 } static inline void -int_import_push_bits(int data, int numbits, BDIGIT_DBL *ddp, int *numbits_in_dd_p, BDIGIT **dpp) +integer_unpack_push_bits(int data, int numbits, BDIGIT_DBL *ddp, int *numbits_in_dd_p, BDIGIT **dpp) { (*ddp) |= ((BDIGIT_DBL)data) << (*numbits_in_dd_p); *numbits_in_dd_p += numbits; @@ -882,7 +882,7 @@ rb_integer_unpack(int sign, const void * https://github.com/ruby/ruby/blob/trunk/bignum.c#L882 BDIGIT_DBL dd; int numbits_in_dd; - validate_integer_format(wordsize, nails, flags); + validate_integer_pack_format(wordsize, nails, flags); if (SIZE_MAX / wordsize < numwords) rb_raise(rb_eArgError, "too big numwords * wordsize: %"PRI_SIZE_PREFIX"u * %"PRI_SIZE_PREFIX"u", numwords, wordsize); if (sign != 1 && sign != 0 && sign != -1) @@ -906,7 +906,7 @@ rb_integer_unpack(int sign, const void * https://github.com/ruby/ruby/blob/trunk/bignum.c#L906 dp = BDIGITS(result); de = dp + RBIGNUM_LEN(result); - integer_format_loop_setup(numwords, wordsize, nails, flags, + integer_pack_loop_setup(numwords, wordsize, nails, flags, &word_num_fullbytes, &word_num_partialbits, NULL, &word_start, &word_step, &word_last, &byte_start, &byte_step); @@ -917,7 +917,7 @@ rb_integer_unpack(int sign, const void * https://github.com/ruby/ruby/blob/trunk/bignum.c#L917 numbits_in_dd = 0; #define PUSH_BITS(data, numbits) \ - int_import_push_bits(data, numbits, &dd, &numbits_in_dd, &dp) + integer_unpack_push_bits(data, numbits, &dd, &numbits_in_dd, &dp) while (1) { index_in_word = 0; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/