ruby-changes:29933
From: akr <ko1@a...>
Date: Mon, 15 Jul 2013 13:50:58 +0900 (JST)
Subject: [ruby-changes:29933] akr:r41985 (trunk): * bignum.c: Add static assertions.
akr 2013-07-15 13:50:49 +0900 (Mon, 15 Jul 2013) New Revision: 41985 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41985 Log: * bignum.c: Add static assertions. Modified files: trunk/ChangeLog trunk/bignum.c Index: ChangeLog =================================================================== --- ChangeLog (revision 41984) +++ ChangeLog (revision 41985) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jul 15 13:46:26 2013 Tanaka Akira <akr@f...> + + * bignum.c: Add static assertions. + Mon Jul 15 13:36:02 2013 Masaki Matsushita <glass.saga@g...> * hash.c (rb_hash_each_pair): performance improvement by using Index: bignum.c =================================================================== --- bignum.c (revision 41984) +++ bignum.c (revision 41985) @@ -45,6 +45,12 @@ static VALUE big_three = Qnil; https://github.com/ruby/ruby/blob/trunk/bignum.c#L45 #endif STATIC_ASSERT(sizeof_bdigit_dbl, sizeof(BDIGIT_DBL) == SIZEOF_BDIGIT_DBL); +STATIC_ASSERT(sizeof_bdigit_dbl_signed, sizeof(BDIGIT_DBL_SIGNED) == SIZEOF_BDIGIT_DBL); +STATIC_ASSERT(sizeof_bdigit, SIZEOF_BDIGITS <= sizeof(BDIGIT)); +STATIC_ASSERT(sizeof_bdigit_and_dbl, SIZEOF_BDIGITS*2 <= SIZEOF_BDIGIT_DBL); +STATIC_ASSERT(bdigit_signedness, 0 < (BDIGIT)-1); +STATIC_ASSERT(bdigit_dbl_signedness, 0 < (BDIGIT_DBL)-1); +STATIC_ASSERT(bdigit_dbl_signed_signedness, 0 > (BDIGIT_DBL_SIGNED)-1); STATIC_ASSERT(rbignum_embed_len_max, RBIGNUM_EMBED_LEN_MAX <= (RBIGNUM_EMBED_LEN_MASK >> RBIGNUM_EMBED_LEN_SHIFT)); #ifdef WORDS_BIGENDIAN -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/