[svn:parrot] r41968 - in trunk: include/parrot src/io

allison at svn.parrot.org allison at svn.parrot.org
Wed Oct 21 15:56:18 UTC 2009


Author: allison
Date: Wed Oct 21 15:56:18 2009
New Revision: 41968
URL: https://trac.parrot.org/parrot/changeset/41968

Log:
[cage] Allow a null IO object to be passed to close and flush, since both have
appropriate behaviors for handling null PMCs.

Modified:
   trunk/include/parrot/io.h
   trunk/src/io/api.c

Modified: trunk/include/parrot/io.h
==============================================================================
--- trunk/include/parrot/io.h	Wed Oct 21 15:51:56 2009	(r41967)
+++ trunk/include/parrot/io.h	Wed Oct 21 15:56:18 2009	(r41968)
@@ -144,9 +144,8 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_EXPORT
-INTVAL Parrot_io_close(PARROT_INTERP, ARGMOD(PMC *pmc))
+INTVAL Parrot_io_close(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         FUNC_MODIFIES(*pmc);
 
 PARROT_EXPORT
@@ -180,9 +179,8 @@
         __attribute__nonnull__(4);
 
 PARROT_EXPORT
-void Parrot_io_flush(PARROT_INTERP, ARGMOD(PMC *pmc))
+void Parrot_io_flush(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
         FUNC_MODIFIES(*pmc);
 
 PARROT_EXPORT
@@ -353,8 +351,7 @@
         FUNC_MODIFIES(*pmc);
 
 #define ASSERT_ARGS_Parrot_io_close __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(pmc))
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_io_close_piohandle __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_io_eof __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
@@ -366,8 +363,7 @@
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(sflags))
 #define ASSERT_ARGS_Parrot_io_flush __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(pmc))
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_io_fprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(pmc) \

Modified: trunk/src/io/api.c
==============================================================================
--- trunk/src/io/api.c	Wed Oct 21 15:51:56 2009	(r41967)
+++ trunk/src/io/api.c	Wed Oct 21 15:56:18 2009	(r41968)
@@ -212,7 +212,7 @@
 
 PARROT_EXPORT
 INTVAL
-Parrot_io_close(PARROT_INTERP, ARGMOD(PMC *pmc))
+Parrot_io_close(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
 {
     ASSERT_ARGS(Parrot_io_close)
     INTVAL result = 1;
@@ -301,7 +301,7 @@
 
 PARROT_EXPORT
 void
-Parrot_io_flush(PARROT_INTERP, ARGMOD(PMC *pmc))
+Parrot_io_flush(PARROT_INTERP, ARGMOD_NULLOK(PMC *pmc))
 {
     ASSERT_ARGS(Parrot_io_flush)
     if (PMC_IS_NULL(pmc))


More information about the parrot-commits mailing list