mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* range.c: fixed type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a97e80ba74
commit
5a993c5d22
1 changed files with 9 additions and 9 deletions
18
range.c
18
range.c
|
@ -151,10 +151,10 @@ r_lt(VALUE a, VALUE b)
|
||||||
VALUE r = rb_funcall(a, id_cmp, 1, b);
|
VALUE r = rb_funcall(a, id_cmp, 1, b);
|
||||||
|
|
||||||
if (NIL_P(r))
|
if (NIL_P(r))
|
||||||
return Qfalse;
|
return (int)Qfalse;
|
||||||
if (rb_cmpint(r, a, b) < 0)
|
if (rb_cmpint(r, a, b) < 0)
|
||||||
return Qtrue;
|
return (int)Qtrue;
|
||||||
return Qfalse;
|
return (int)Qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -164,13 +164,13 @@ r_le(VALUE a, VALUE b)
|
||||||
VALUE r = rb_funcall(a, id_cmp, 1, b);
|
VALUE r = rb_funcall(a, id_cmp, 1, b);
|
||||||
|
|
||||||
if (NIL_P(r))
|
if (NIL_P(r))
|
||||||
return Qfalse;
|
return (int)Qfalse;
|
||||||
c = rb_cmpint(r, a, b);
|
c = rb_cmpint(r, a, b);
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
return (int)INT2FIX(0);
|
return (int)INT2FIX(0);
|
||||||
if (c < 0)
|
if (c < 0)
|
||||||
return Qtrue;
|
return (int)Qtrue;
|
||||||
return Qfalse;
|
return (int)Qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -677,8 +677,8 @@ rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp)
|
||||||
excl = EXCL(range);
|
excl = EXCL(range);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!rb_respond_to(range, id_beg)) return Qfalse;
|
if (!rb_respond_to(range, id_beg)) return (int)Qfalse;
|
||||||
if (!rb_respond_to(range, id_end)) return Qfalse;
|
if (!rb_respond_to(range, id_end)) return (int)Qfalse;
|
||||||
b = rb_funcall(range, id_beg, 0);
|
b = rb_funcall(range, id_beg, 0);
|
||||||
e = rb_funcall(range, id_end, 0);
|
e = rb_funcall(range, id_end, 0);
|
||||||
excl = RTEST(rb_funcall(range, rb_intern("exclude_end?"), 0));
|
excl = RTEST(rb_funcall(range, rb_intern("exclude_end?"), 0));
|
||||||
|
@ -686,7 +686,7 @@ rb_range_values(VALUE range, VALUE *begp, VALUE *endp, int *exclp)
|
||||||
*begp = b;
|
*begp = b;
|
||||||
*endp = e;
|
*endp = e;
|
||||||
*exclp = excl;
|
*exclp = excl;
|
||||||
return Qtrue;
|
return (int)Qtrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue