diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-10 10:37:39 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-10 10:37:39 +0000 |
commit | 0e8caa7d0f79c9514b4b4dbe9ac88b08e822e387 (patch) | |
tree | 4490705929fdb1765569a900d081e93c9f2d49f1 /random.c | |
parent | a8aaf133921e5cfcf6e0ee88dc6b69e9c52ecf75 (diff) | |
download | ruby-0e8caa7d0f79c9514b4b4dbe9ac88b08e822e387.tar.gz |
* bignum.c (rb_integer_pack): Returns sign instead of words.
(absint_numwords_generic): Follow the above change.
(big2str_base_powerof2): Follow the above change.
* internal.h: Ditto.
* hash.c (rb_hash): Ditto.
* pack.c (pack_pack): Ditto.
* random.c (int_pair_to_real_inclusive): Ditto.
(rand_init): Ditto.
(random_load): Ditto.
(limited_big_rand): Ditto.
* time.c (v2w_bignum): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r-- | random.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -295,7 +295,7 @@ int_pair_to_real_inclusive(uint32_t a, uint32_t b) } else { uint32_t uary[4]; - rb_integer_pack(x, NULL, uary, numberof(uary), sizeof(uint32_t), 0, + rb_integer_pack(x, uary, numberof(uary), sizeof(uint32_t), 0, INTEGER_PACK_MSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER); /* r = x >> 64 */ r = (double)uary[0] * (0x10000 * (double)0x10000) + (double)uary[1]; @@ -380,7 +380,7 @@ rand_init(struct MT *mt, VALUE vseed) len = MT_MAX_STATE; if (len > numberof(buf0)) buf = ALLOC_N(unsigned int, len); - rb_integer_pack(seed, &sign, buf, len, sizeof(uint32_t), 0, + sign = rb_integer_pack(seed, buf, len, sizeof(uint32_t), 0, INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER); if (sign < 0) sign = -sign; @@ -644,7 +644,7 @@ random_load(VALUE obj, VALUE dump) default: rb_raise(rb_eArgError, "wrong dump data"); } - rb_integer_pack(state, NULL, mt->state, numberof(mt->state), + rb_integer_pack(state, mt->state, numberof(mt->state), sizeof(*mt->state), 0, INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER); x = NUM2ULONG(left); @@ -754,7 +754,7 @@ limited_big_rand(struct MT *mt, VALUE limit) tmp = ALLOCV_N(uint32_t, vtmp, len*2); lim_array = tmp; rnd_array = tmp + len; - rb_integer_pack(limit, NULL, lim_array, len, sizeof(uint32_t), 0, + rb_integer_pack(limit, lim_array, len, sizeof(uint32_t), 0, INTEGER_PACK_LSWORD_FIRST|INTEGER_PACK_NATIVE_BYTE_ORDER); retry: |