Prefer rb_funcall2() over rb_funcall(). master
authorTilman Sauerbeck <tilman@code-monkey.de>
Sun, 8 Apr 2007 12:42:37 +0000 (14:42 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sun, 8 Apr 2007 12:42:37 +0000 (14:42 +0200)
ext/comments.c
ext/ext.c

index 03ba68009012eb329fb4f91b9402fe22bae36f48..6e6efd58460b787f541c82a1cbda9ccda9b5a7b9 100644 (file)
@@ -164,7 +164,7 @@ c_delete (VALUE self, VALUE key)
                struct RArray *pair = RARRAY (items->ptr[i]);
                VALUE tmp;
 
-               tmp = rb_funcall (pair->ptr[0], id_casecmp, 1, key);
+               tmp = rb_funcall2 (pair->ptr[0], id_casecmp, 1, &key);
                if (tmp == INT2FIX (0)) {
                        ret = pair->ptr[1];
                        pos = i;
@@ -279,7 +279,7 @@ c_aref (VALUE self, VALUE key)
                struct RArray *pair = RARRAY (items->ptr[i]);
                VALUE tmp;
 
-               tmp = rb_funcall (pair->ptr[0], id_casecmp, 1, key);
+               tmp = rb_funcall2 (pair->ptr[0], id_casecmp, 1, &key);
                if (tmp == INT2FIX (0))
                        return pair->ptr[1];
        }
@@ -306,9 +306,9 @@ c_aset (VALUE self, VALUE key, VALUE value)
                struct RArray *pair = RARRAY (items->ptr[i]);
                VALUE tmp;
 
-               tmp = rb_funcall (pair->ptr[0], id_casecmp, 1, key);
+               tmp = rb_funcall2 (pair->ptr[0], id_casecmp, 1, &key);
                if (tmp == INT2FIX (0)) {
-                       rb_funcall (pair->ptr[1], id_replace, 1, value);
+                       rb_funcall2 (pair->ptr[1], id_replace, 1, &value);
                        return pair->ptr[1];
                }
        }
@@ -340,7 +340,7 @@ c_has_key (VALUE self, VALUE key)
                struct RArray *pair = RARRAY (items->ptr[i]);
                VALUE tmp;
 
-               tmp = rb_funcall (pair->ptr[0], id_casecmp, 1, key);
+               tmp = rb_funcall2 (pair->ptr[0], id_casecmp, 1, &key);
                if (tmp == INT2FIX (0))
                        return Qtrue;
        }
@@ -426,7 +426,7 @@ c_compare (VALUE self, VALUE other)
                for (j = 0; j < 2; j++) {
                        VALUE tmp;
 
-                       tmp = rb_funcall (aa->ptr[j], id_compare, 1, bb->ptr[j]);
+                       tmp = rb_funcall2 (aa->ptr[j], id_compare, 1, &bb->ptr[j]);
                        if (FIX2INT (tmp) != 0)
                                return tmp;
                }
index 46ce0d178d1090296f6a74b16e29b205e692c706..957dc41260c77473fb548d18670f5388f1883890 100644 (file)
--- a/ext/ext.c
+++ b/ext/ext.c
@@ -192,7 +192,7 @@ c_write (VALUE self)
                        break;
        }
 
-       return rb_funcall (o->comments, id_length, 0);
+       return rb_funcall2 (o->comments, id_length, 0, NULL);
 }
 
 /*