From 94ecf211e574a3d8440efb5018d41fd0e1a92d1b Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 7 May 2009 05:01:56 +0000 Subject: [PATCH] * range.c (r_le): fixed types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 +++- range.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8eaf65b4d..0eefff6758 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -Thu May 7 13:58:52 2009 Nobuyoshi Nakada +Thu May 7 14:01:55 2009 Nobuyoshi Nakada + + * range.c (r_le): fixed types. * range.c (range_eql): fixed rdoc. diff --git a/range.c b/range.c index 4021d7d844..3ffbb750fc 100644 --- a/range.c +++ b/range.c @@ -161,7 +161,7 @@ r_le(VALUE a, VALUE b) return Qfalse; c = rb_cmpint(r, a, b); if (c == 0) - return INT2FIX(0); + return (int)INT2FIX(0); if (c < 0) return Qtrue; return Qfalse; @@ -213,7 +213,7 @@ range_eql(VALUE range, VALUE obj) static VALUE range_hash(VALUE range) { - unsigned hash = EXCL(range); + unsigned long hash = EXCL(range); VALUE v; hash = rb_hash_start(hash); @@ -242,9 +242,9 @@ range_each_func(VALUE range, VALUE (*func) (VALUE, void *), void *arg) } } else { - while (RTEST(c = r_le(v, e))) { + while ((c = r_le(v, e)) != Qfalse) { (*func) (v, arg); - if (c == INT2FIX(0)) + if (c == (int)INT2FIX(0)) break; v = rb_funcall(v, id_succ, 0, 0); }