mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ruby.h: define RBIGNUM_EMBED_LEN_MAX by macros
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros defined in defines.h, instead of complex and repeated expression. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b28608f780
commit
4efba669ec
2 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sun Nov 24 00:44:30 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): define by macros
|
||||||
|
defined in defines.h, instead of complex and repeated expression.
|
||||||
|
|
||||||
Sat Nov 23 22:22:26 2013 Tanaka Akira <akr@fsij.org>
|
Sat Nov 23 22:22:26 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Limit the value to
|
* include/ruby/ruby.h (RBIGNUM_EMBED_LEN_MAX): Limit the value to
|
||||||
|
|
|
@ -1069,9 +1069,11 @@ struct RStruct {
|
||||||
|
|
||||||
#define RBIGNUM_EMBED_LEN_NUMBITS 3
|
#define RBIGNUM_EMBED_LEN_NUMBITS 3
|
||||||
#ifndef RBIGNUM_EMBED_LEN_MAX
|
#ifndef RBIGNUM_EMBED_LEN_MAX
|
||||||
# define RBIGNUM_EMBED_LEN_MAX \
|
# if (SIZEOF_VALUE*3/SIZEOF_BDIGITS) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1
|
||||||
(((int)((sizeof(VALUE)*3)/sizeof(BDIGIT))) < (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1 ? \
|
# define RBIGNUM_EMBED_LEN_MAX (SIZEOF_VALUE*3/SIZEOF_BDIGITS)
|
||||||
((int)((sizeof(VALUE)*3)/sizeof(BDIGIT))) : (1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
|
# else
|
||||||
|
# define RBIGNUM_EMBED_LEN_MAX ((1 << RBIGNUM_EMBED_LEN_NUMBITS)-1)
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
struct RBignum {
|
struct RBignum {
|
||||||
struct RBasic basic;
|
struct RBasic basic;
|
||||||
|
|
Loading…
Add table
Reference in a new issue