* include/ruby/ruby.h (INT2NUM): just use a simple macro on LP64.
(UINT2NUM): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f61354c405
commit
93ee8dea67
@ -1,3 +1,8 @@
|
|||||||
|
Fri Aug 22 05:29:17 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* include/ruby/ruby.h (INT2NUM): just use a simple macro on LP64.
|
||||||
|
(UINT2NUM): ditto.
|
||||||
|
|
||||||
Fri Aug 22 05:10:07 2008 Tanaka Akira <akr@fsij.org>
|
Fri Aug 22 05:10:07 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* io.c (rb_file_open_generic): take filename as a VALUE.
|
* io.c (rb_file_open_generic): take filename as a VALUE.
|
||||||
|
@ -451,30 +451,35 @@ double rb_num2dbl(VALUE);
|
|||||||
|
|
||||||
VALUE rb_uint2big(VALUE);
|
VALUE rb_uint2big(VALUE);
|
||||||
VALUE rb_int2big(SIGNED_VALUE);
|
VALUE rb_int2big(SIGNED_VALUE);
|
||||||
|
|
||||||
|
#if SIZEOF_INT < SIZEOF_VALUE
|
||||||
|
# define INT2NUM(v) INT2FIX((int)(v))
|
||||||
|
# define UINT2NUM(v) LONG2FIX((unsigned int)(v))
|
||||||
|
#else
|
||||||
static inline VALUE
|
static inline VALUE
|
||||||
INT2NUM(int v)
|
INT2NUM(int v)
|
||||||
{
|
{
|
||||||
# if SIZEOF_VALUE <= SIZEOF_INT
|
|
||||||
if (!FIXABLE(v))
|
if (!FIXABLE(v))
|
||||||
return rb_int2big(v);
|
return rb_int2big(v);
|
||||||
# endif
|
|
||||||
return INT2FIX(v);
|
return INT2FIX(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline VALUE
|
||||||
|
UINT2NUM(unsigned int v)
|
||||||
|
{
|
||||||
|
if (!POSFIXABLE(v))
|
||||||
|
return rb_uint2big(v);
|
||||||
|
return LONG2FIX(v);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline VALUE
|
static inline VALUE
|
||||||
LONG2NUM(long v)
|
LONG2NUM(long v)
|
||||||
{
|
{
|
||||||
if (FIXABLE(v)) return LONG2FIX(v);
|
if (FIXABLE(v)) return LONG2FIX(v);
|
||||||
return rb_int2big(v);
|
return rb_int2big(v);
|
||||||
}
|
}
|
||||||
static inline VALUE
|
|
||||||
UINT2NUM(unsigned int v)
|
|
||||||
{
|
|
||||||
# if SIZEOF_VALUE <= SIZEOF_INT
|
|
||||||
if (!POSFIXABLE(v))
|
|
||||||
return rb_uint2big(v);
|
|
||||||
# endif
|
|
||||||
return LONG2FIX(v);
|
|
||||||
}
|
|
||||||
static inline VALUE
|
static inline VALUE
|
||||||
ULONG2NUM(unsigned long v)
|
ULONG2NUM(unsigned long v)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user