[svn:parrot] r36615 - in branches/rename_pccinvoke/src: io pmc

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Thu Feb 12 02:16:24 UTC 2009


Author: whiteknight
Date: Thu Feb 12 02:16:22 2009
New Revision: 36615
URL: https://trac.parrot.org/parrot/changeset/36615

Log:
[rename_pccinvoke] update src/io/api.c nd a few other files that need to be fixed to make this work. 3 weird test failures that I'm having trouble reproducing outside of make test. will debug tomorrow

Modified:
   branches/rename_pccinvoke/src/io/api.c
   branches/rename_pccinvoke/src/pmc/cpointer.pmc

Modified: branches/rename_pccinvoke/src/io/api.c
==============================================================================
--- branches/rename_pccinvoke/src/io/api.c	Thu Feb 12 01:01:11 2009	(r36614)
+++ branches/rename_pccinvoke/src/io/api.c	Thu Feb 12 02:16:22 2009	(r36615)
@@ -116,7 +116,9 @@
     else
         new_filehandle = pmc;
 
-    Parrot_PCCINVOKE(interp, new_filehandle, CONST_STRING(interp, "open"), "SS->P",
+    if (!mode)
+        mode = CONST_STRING(interp, "r");
+    Parrot_pcc_invoke_method_from_c_args(interp, new_filehandle, CONST_STRING(interp, "open"), "SS->P",
             path, mode, &new_filehandle);
 
     return new_filehandle;
@@ -185,7 +187,7 @@
     if (PMC_IS_NULL(pmc))
         return -1;
 
-    Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "close"), "->I", &result);
+    Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "close"), "->I", &result);
 
     return result;
 }
@@ -210,7 +212,7 @@
     if (PMC_IS_NULL(pmc))
         return 1;
 
-    Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "is_closed"), "->I", &result);
+    Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "is_closed"), "->I", &result);
     return result;
 }
 
@@ -232,7 +234,7 @@
     if (PMC_IS_NULL(pmc))
         return;
 
-    Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "flush"), "->");
+    Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "flush"), "->");
 }
 
 /*
@@ -253,8 +255,8 @@
 Parrot_io_reads(PARROT_INTERP, ARGMOD(PMC *pmc), size_t length)
 {
     ASSERT_ARGS(Parrot_io_reads)
-    STRING *result;
-    Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "read"), "I->S",
+    STRING *result = NULL;
+    Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "read"), "I->S",
             length, &result);
     return result;
 }
@@ -277,8 +279,8 @@
 Parrot_io_readline(PARROT_INTERP, ARGMOD(PMC *pmc))
 {
     ASSERT_ARGS(Parrot_io_readline)
-    STRING *result;
-    Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "readline"), "->S",
+    STRING *result = NULL;
+    Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "readline"), "->S",
             &result);
     return result;
 }
@@ -409,7 +411,7 @@
     if (PMC_IS_NULL(pmc))
             return 1;
 
-    Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "eof"), "->I",
+    Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "eof"), "->I",
             &result);
 
     return result;
@@ -455,7 +457,7 @@
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
             "Cannot write to null PMC");
 
-    Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "puts"), "S->I",
+    Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "puts"), "S->I",
             s, &result);
     return result;
 

Modified: branches/rename_pccinvoke/src/pmc/cpointer.pmc
==============================================================================
--- branches/rename_pccinvoke/src/pmc/cpointer.pmc	Thu Feb 12 01:01:11 2009	(r36614)
+++ branches/rename_pccinvoke/src/pmc/cpointer.pmc	Thu Feb 12 02:16:22 2009	(r36615)
@@ -99,8 +99,8 @@
             }
             else if (Parrot_str_not_equal(interp, data->sig, CONST_STRING(interp, "S")) == 0) {
                 STRING **str_pointer = (STRING **) data->pointer;
-                PARROT_ASSERT(*str_pointer);
-                pobject_lives(interp, (PObj *) *str_pointer);
+                if(*str_pointer)
+                    pobject_lives(interp, (PObj *) *str_pointer);
             }
         }
 


More information about the parrot-commits mailing list