[macruby-changes] [2276] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 11 10:29:50 PDT 2009


Revision: 2276
          http://trac.macosforge.org/projects/ruby/changeset/2276
Author:   pthomson at apple.com
Date:     2009-08-11 10:29:48 -0700 (Tue, 11 Aug 2009)
Log Message:
-----------
Fixed the method signatures for Object#taint, #tainted?, #inspect, #to_s, #freeze, and #frozen?, and changed an incorrect commect.

Modified Paths:
--------------
    MacRuby/trunk/ext/libyaml/rubyext.c
    MacRuby/trunk/object.c

Modified: MacRuby/trunk/ext/libyaml/rubyext.c
===================================================================
--- MacRuby/trunk/ext/libyaml/rubyext.c	2009-08-11 11:40:10 UTC (rev 2275)
+++ MacRuby/trunk/ext/libyaml/rubyext.c	2009-08-11 17:29:48 UTC (rev 2276)
@@ -16,8 +16,7 @@
 #include "yaml.h"
 
 // Ideas to speed this up:
-// have the resolver be an opaque CFMutableDictionary mapping C strings to VALUES
-// store that dictionary in the parser, fewer ivar accesses
+// none as of yet. need to figure out how to get Shark to link against this .bundle
 
 #define FNV1_32A_INIT 0x811c9dc5
 

Modified: MacRuby/trunk/object.c
===================================================================
--- MacRuby/trunk/object.c	2009-08-11 11:40:10 UTC (rev 2275)
+++ MacRuby/trunk/object.c	2009-08-11 17:29:48 UTC (rev 2276)
@@ -382,8 +382,8 @@
  *  initial execution context of Ruby programs returns ``main.''
  */
 
-VALUE
-rb_any_to_s(VALUE obj)
+static VALUE
+rb_any_to_string(VALUE obj, SEL sel)
 {
     const char *cname = rb_obj_classname(obj);
     VALUE str;
@@ -395,6 +395,12 @@
 }
 
 VALUE
+rb_any_to_s(VALUE obj)
+{
+	return rb_any_to_string(obj, 0);
+}
+
+VALUE
 rb_inspect(VALUE obj)
 {
     return rb_obj_as_string(rb_funcall(obj, id_inspect, 0, 0));
@@ -460,7 +466,7 @@
 
 
 static VALUE
-rb_obj_inspect(VALUE obj)
+rb_obj_inspect(VALUE obj, SEL sel)
 {
     if (TYPE(obj) == T_OBJECT) {
         bool has_ivar = false;
@@ -761,8 +767,8 @@
  *  Returns <code>true</code> if the object is tainted.
  */
 
-VALUE
-rb_obj_tainted(VALUE obj)
+static VALUE
+rb_obj_tainted_p(VALUE obj, SEL sel)
 {
     if (!SPECIAL_CONST_P(obj) && NATIVE(obj)) {
 	switch (TYPE(obj)) {
@@ -791,6 +797,12 @@
     return Qfalse;
 }
 
+VALUE
+rb_obj_tainted(VALUE obj)
+{
+	return rb_obj_tainted_p(obj, 0);
+}
+
 /*
  *  call-seq:
  *     obj.taint -> obj
@@ -800,8 +812,8 @@
  *  programs environment will refuse to accept tainted strings.
  */
 
-VALUE
-rb_obj_taint(VALUE obj)
+static VALUE
+rb_obj_taint_m(VALUE obj, SEL sel)
 {
     rb_secure(4);
     if (!SPECIAL_CONST_P(obj) && NATIVE(obj)) {
@@ -837,7 +849,13 @@
     return obj;
 }
 
+VALUE 
+rb_obj_taint(VALUE obj)
+{
+	return rb_obj_taint_m(obj, 0);
+}
 
+
 /*
  *  call-seq:
  *     obj.untaint    => obj
@@ -845,8 +863,8 @@
  *  Removes the taint from <i>obj</i>.
  */
 
-VALUE
-rb_obj_untaint(VALUE obj)
+static VALUE
+rb_obj_untaint_m(VALUE obj, SEL sel)
 {
     rb_secure(3);
     if (!SPECIAL_CONST_P(obj) && NATIVE(obj)) {
@@ -882,6 +900,12 @@
     return obj;
 }
 
+VALUE
+rb_obj_untaint(VALUE obj)
+{
+	return rb_obj_untaint_m(obj, 0);
+}
+
 void
 rb_obj_infect(VALUE obj1, VALUE obj2)
 {
@@ -909,8 +933,8 @@
  *     	from prog.rb:3
  */
 
-VALUE
-rb_obj_freeze(VALUE obj)
+static VALUE
+rb_obj_freeze_m(VALUE obj, SEL sel)
 {
     if (!OBJ_FROZEN(obj)) {
 	int type;
@@ -957,6 +981,12 @@
     return obj;
 }
 
+VALUE
+rb_obj_freeze(VALUE obj)
+{
+	return rb_obj_freeze_m(obj, 0);
+}
+
 /*
  *  call-seq:
  *     obj.frozen?    => true or false
@@ -968,8 +998,8 @@
  *     a.frozen?   #=> true
  */
 
-VALUE
-rb_obj_frozen_p(VALUE obj)
+static VALUE
+rb_obj_frozen(VALUE obj, SEL sel)
 {
     if (SPECIAL_CONST_P(obj)) {
 	if (!immediate_frozen_tbl) return Qfalse;
@@ -1005,7 +1035,13 @@
     }
 }
 
+VALUE
+rb_obj_frozen_p(VALUE obj)
+{
+	return rb_obj_frozen(obj, 0);
+}
 
+
 /*
  * Document-class: NilClass
  *
@@ -2750,13 +2786,13 @@
     rb_objc_define_method(rb_cNSObject, "clone", rb_obj_clone_imp, 0);
     rb_objc_define_method(rb_cNSObject, "dup", rb_nsobj_dup, 0);
 
-    rb_objc_define_method(rb_mKernel, "taint", rb_obj_taint, 0);
-    rb_objc_define_method(rb_mKernel, "tainted?", rb_obj_tainted, 0);
-    rb_objc_define_method(rb_mKernel, "untaint", rb_obj_untaint, 0);
-    rb_objc_define_method(rb_mKernel, "freeze", rb_obj_freeze, 0);
-    rb_objc_define_method(rb_mKernel, "frozen?", rb_obj_frozen_p, 0);
+    rb_objc_define_method(rb_mKernel, "taint", rb_obj_taint_m, 0);
+    rb_objc_define_method(rb_mKernel, "tainted?", rb_obj_tainted_p, 0);
+    rb_objc_define_method(rb_mKernel, "untaint", rb_obj_untaint_m, 0);
+    rb_objc_define_method(rb_mKernel, "freeze", rb_obj_freeze_m, 0);
+    rb_objc_define_method(rb_mKernel, "frozen?", rb_obj_frozen, 0);
 
-    rb_objc_define_method(rb_mKernel, "to_s", rb_any_to_s, 0);
+    rb_objc_define_method(rb_mKernel, "to_s", rb_any_to_string, 0);
     rb_objc_define_method(rb_mKernel, "inspect", rb_obj_inspect, 0);
     rb_objc_define_method(rb_mKernel, "methods", rb_obj_methods, -1);
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090811/885a005f/attachment.html>


More information about the macruby-changes mailing list