summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-18 15:46:32 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-18 15:46:32 +0000
commita6024cdc1bc1ff792fc07a728e8156c71a891d48 (patch)
tree68951297008ce1658512146db431e0d0b86e7300 /include
parent07cad43677ec51b1a84cc48b070c2975f71e0431 (diff)
* numeric.c (rb_num2long): Returns a long.
(rb_num2ulong): Returns a unsigned long. * bignum.c (rb_big2long): Returns a long. (rb_big2ulong): Returns a unsigned long. * include/ruby/intern.h: Follow above changes. * include/ruby/ruby.h: Follow above changes. (rb_num2long_inline): No need to cast. (rb_num2ulong_inline): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/intern.h4
-rw-r--r--include/ruby/ruby.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index c69d378..374dc4c 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -102,9 +102,9 @@ VALUE rb_str_to_inum(VALUE, int, int);
VALUE rb_cstr2inum(const char*, int);
VALUE rb_str2inum(VALUE, int);
VALUE rb_big2str(VALUE, int);
-SIGNED_VALUE rb_big2long(VALUE);
+long rb_big2long(VALUE);
#define rb_big2int(x) rb_big2long(x)
-VALUE rb_big2ulong(VALUE);
+unsigned long rb_big2ulong(VALUE);
#define rb_big2uint(x) rb_big2ulong(x)
#if HAVE_LONG_LONG
LONG_LONG rb_big2ll(VALUE);
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 8de3a43..54fa9f1 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -592,15 +592,15 @@ NORETURN(void rb_insecure_operation(void));
VALUE rb_errinfo(void);
void rb_set_errinfo(VALUE);
-SIGNED_VALUE rb_num2long(VALUE);
-VALUE rb_num2ulong(VALUE);
+long rb_num2long(VALUE);
+unsigned long rb_num2ulong(VALUE);
static inline long
rb_num2long_inline(VALUE x)
{
if (FIXNUM_P(x))
return FIX2LONG(x);
else
- return (long)rb_num2long(x);
+ return rb_num2long(x);
}
#define NUM2LONG(x) rb_num2long_inline(x)
static inline unsigned long
@@ -609,7 +609,7 @@ rb_num2ulong_inline(VALUE x)
if (FIXNUM_P(x))
return (unsigned long)FIX2LONG(x);
else
- return (unsigned long)rb_num2ulong(x);
+ return rb_num2ulong(x);
}
#define NUM2ULONG(x) rb_num2ulong_inline(x)
#if SIZEOF_INT < SIZEOF_LONG