ruby-changes:14903
From: akr <ko1@a...>
Date: Sat, 27 Feb 2010 15:57:08 +0900 (JST)
Subject: [ruby-changes:14903] Ruby:r26773 (trunk): * pack.c: check assuption on QUAD_SIZE and SIZEOF_LONG.
akr 2010-02-27 15:56:46 +0900 (Sat, 27 Feb 2010) New Revision: 26773 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26773 Log: * pack.c: check assuption on QUAD_SIZE and SIZEOF_LONG. * bignum.c: check assuption on SIZEOF_LONG and SIZEOF_BDIGITS. Modified files: trunk/ChangeLog trunk/bignum.c trunk/pack.c Index: ChangeLog =================================================================== --- ChangeLog (revision 26772) +++ ChangeLog (revision 26773) @@ -1,3 +1,9 @@ +Sat Feb 27 15:54:55 2010 Tanaka Akira <akr@f...> + + * 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@f...> * pack.c: fix q and Q for big endian environments which have no Index: pack.c =================================================================== --- pack.c (revision 26772) +++ pack.c (revision 26773) @@ -740,6 +740,9 @@ #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 @@ #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"); Index: bignum.c =================================================================== --- bignum.c (revision 26772) +++ bignum.c (revision 26773) @@ -304,6 +304,10 @@ 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) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/