[macruby-changes] [1630] MacRuby/branches/experimental/random.c

source_changes at macosforge.org source_changes at macosforge.org
Thu May 28 21:37:25 PDT 2009


Revision: 1630
          http://trac.macosforge.org/projects/ruby/changeset/1630
Author:   lsansonetti at apple.com
Date:     2009-05-28 21:37:24 -0700 (Thu, 28 May 2009)
Log Message:
-----------
ported the random.c apis to the new runtime

Modified Paths:
--------------
    MacRuby/branches/experimental/random.c

Modified: MacRuby/branches/experimental/random.c
===================================================================
--- MacRuby/branches/experimental/random.c	2009-05-29 04:32:50 UTC (rev 1629)
+++ MacRuby/branches/experimental/random.c	2009-05-29 04:37:24 UTC (rev 1630)
@@ -327,7 +327,7 @@
  */
 
 static VALUE
-rb_f_srand(int argc, VALUE *argv, VALUE obj)
+rb_f_srand(VALUE obj, SEL sel, int argc, VALUE *argv)
 {
     VALUE seed, old;
 
@@ -447,7 +447,7 @@
  */
 
 static VALUE
-rb_f_rand(int argc, VALUE *argv, VALUE obj)
+rb_f_rand(VALUE obj, SEL sel, int argc, VALUE *argv)
 {
     VALUE vmax;
     long val, max;
@@ -503,7 +503,7 @@
 Init_Random(void)
 {
     rand_init(random_seed());
-    rb_define_global_function("srand", rb_f_srand, -1);
-    rb_define_global_function("rand", rb_f_rand, -1);
+    rb_objc_define_method(rb_mKernel, "srand", rb_f_srand, -1);
+    rb_objc_define_method(rb_mKernel, "rand", rb_f_rand, -1);
     rb_global_variable(&saved_seed);
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090528/02c31114/attachment.html>


More information about the macruby-changes mailing list