diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-27 06:56:46 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-27 06:56:46 +0000 |
commit | a971778b399ae42cc694a207cb0a5e3f3ae74d74 (patch) | |
tree | ba841f6cf9f28358be5706afab57cb4016ffb2a1 | |
parent | daaa605b798e969e880176bb5ac38cf52d29bd99 (diff) |
* pack.c: check assuption on QUAD_SIZE and SIZEOF_LONG.
* bignum.c: check assuption on SIZEOF_LONG and SIZEOF_BDIGITS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | bignum.c | 4 | ||||
-rw-r--r-- | pack.c | 6 |
3 files changed, 16 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Sat Feb 27 15:54:55 2010 Tanaka Akira <akr@fsij.org> + + * pack.c: check assuption on QUAD_SIZE and SIZEOF_LONG. + + * bignum.c: check assuption on SIZEOF_LONG and SIZEOF_BDIGITS. + Sat Feb 27 03:48:18 2010 Tanaka Akira <akr@fsij.org> * pack.c: fix q and Q for big endian environments which have no @@ -304,6 +304,10 @@ rb_int2inum(SIGNED_VALUE n) return rb_int2big(n); } +#if SIZEOF_LONG % SIZEOF_BDIGITS != 0 +# error unexpected SIZEOF_LONG : SIZEOF_BDIGITS ratio +#endif + void rb_big_pack(VALUE val, unsigned long *buf, long num_longs) { @@ -740,6 +740,9 @@ pack_pack(VALUE ary, VALUE fmt) #endif #if SIZEOF_LONG != QUAD_SIZE || defined(FORCE_BIG_PACK) +#if QUAD_SIZE % SIZEOF_LONG != 0 +# error unexpected QUAD_SIZE : SIZEOF_LONG ratio +#endif case QUAD_SIZE: while (len-- > 0) { unsigned long tmp[QUAD_SIZE/SIZEOF_LONG]; @@ -1662,6 +1665,9 @@ pack_unpack(VALUE str, VALUE fmt) #endif #if (SIZEOF_LONG != QUAD_SIZE && (!defined(HAVE_LONG_LONG) || SIZEOF_LONG_LONG != QUAD_SIZE)) || defined(FORCE_BIG_PACK) +#if QUAD_SIZE % SIZEOF_LONG != 0 +# error unexpected QUAD_SIZE : SIZEOF_LONG ratio +#endif case QUAD_SIZE: if (bigendian_p != BIGENDIAN_P()) rb_bug("unexpected endian for unpack"); |