projects
/
ruby-ecore.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
087974f
)
Made Timer#initialize reject infinite floats for the interval.
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Sun, 8 Apr 2007 12:00:20 +0000
(14:00 +0200)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Sun, 8 Apr 2007 12:00:20 +0000
(14:00 +0200)
src/ecore/rb_timer.c
patch
|
blob
|
history
diff --git
a/src/ecore/rb_timer.c
b/src/ecore/rb_timer.c
index 4d05d48d66a4284a91d73a3e2c1e81307285eea5..6ef4d75c06d2a26b1240db3bf7fd95d8b8c9cc03 100644
(file)
--- a/
src/ecore/rb_timer.c
+++ b/
src/ecore/rb_timer.c
@@
-84,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),