From ae2fe781dd4aae16a2f03a4b9fb93514eb9886d4 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 13 May 1998 07:26:47 +0000 Subject: 1.1b9_19 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 1bf00927b7..9127a0de2b 100644 --- a/numeric.c +++ b/numeric.c @@ -12,6 +12,7 @@ #include "ruby.h" #include +#include static ID coerce; static ID to_i; @@ -42,12 +43,14 @@ num_coerce(x, y) return assoc_new(rb_Float(x), rb_Float(y)); } +static VALUE coerce_body(x) VALUE *x; { return rb_funcall(x[1], coerce, 1, x[0]); } +static VALUE coerce_rescue(x) VALUE *x; { @@ -66,7 +69,7 @@ do_coerce(x, y) VALUE a[2]; a[0] = *x; a[1] = *y; - ary = rb_rescue(coerce_body, a, coerce_rescue, a); + ary = rb_rescue(coerce_body, (VALUE)a, coerce_rescue, (VALUE)a); if (TYPE(ary) != T_ARRAY || RARRAY(ary)->len != 2) { TypeError("coerce must return [x, y]"); } -- cgit v1.2.3