X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=src%2Fecore%2Frb_timer.c;h=6ef4d75c06d2a26b1240db3bf7fd95d8b8c9cc03;hb=f8c0f815b18adf3d1ea53bd177df636ffd532b08;hp=939a88d9df91c8a64a0f8e5790ad10b107255d31;hpb=fa957a85d2bac8f3ec0845737540254f25d6685c;p=ruby-ecore.git diff --git a/src/ecore/rb_timer.c b/src/ecore/rb_timer.c index 939a88d..6ef4d75 100644 --- a/src/ecore/rb_timer.c +++ b/src/ecore/rb_timer.c @@ -1,6 +1,4 @@ /* - * $Id: rb_timer.c 351 2006-02-10 15:25:40Z tilman $ - * * Copyright (C) 2004 ruby-ecore team (see AUTHORS) * * This library is free software; you can redistribute it and/or @@ -86,6 +84,11 @@ static VALUE c_init (VALUE self, VALUE interval) if (!rb_block_given_p ()) rb_raise (rb_eStandardError, "block missing"); + interval = rb_funcall2 (interval, rb_intern ("to_f"), 0, NULL); + + if (rb_funcall2 (interval, rb_intern ("finite?"), 0, NULL) == Qfalse) + rb_raise (rb_eArgError, "Argument must not be infinite"); + timer->callback = rb_block_proc (); timer->deleted = false; timer->real = ecore_timer_add (NUM2DBL (interval),