summaryrefslogtreecommitdiff
path: root/range.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-07 05:27:01 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-07 05:27:01 +0000
commitc9f4686694542543864895d6c61c1ef58d58a564 (patch)
treef078d8b669b793ff8665e26d445cb50dabec75e0 /range.c
parent6a100f3ce470fe659a88e46138068b7a8611f650 (diff)
* string.c (rb_str_new2): NULL pointer check added.
* class.c (rb_define_module_under): should locate predefined module using rb_const_defined_at(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r--range.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/range.c b/range.c
index b18951dcbc..cd1413811f 100644
--- a/range.c
+++ b/range.c
@@ -106,7 +106,7 @@ range_eq(range, obj)
}
static int
-r_eq(a,b)
+r_eq(a, b)
VALUE a, b;
{
VALUE r;
@@ -119,22 +119,22 @@ r_eq(a,b)
}
static int
-r_lt(a,b)
+r_lt(a, b)
VALUE a, b;
{
VALUE r = rb_funcall(a, id_cmp, 1, b);
- if (NUM2LONG(r) < 0) return Qtrue;
+ if (rb_cmpint(r) < 0) return Qtrue;
return Qfalse;
}
static int
-r_le(a,b)
+r_le(a, b)
VALUE a, b;
{
VALUE r = rb_funcall(a, id_cmp, 1, b);
- if (NUM2LONG(r) <= 0) return Qtrue;
+ if (rb_cmpint(r) <= 0) return Qtrue;
return Qfalse;
}
@@ -144,7 +144,7 @@ r_gt(a,b)
{
VALUE r = rb_funcall(a, id_cmp, 1, b);
- if (NUM2LONG(r) > 0) return Qtrue;
+ if (rb_cmpint(r) > 0) return Qtrue;
return Qfalse;
}