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

petdance at svn.parrot.org petdance at svn.parrot.org
Wed Apr 28 16:05:25 UTC 2010


Author: petdance
Date: Wed Apr 28 16:05:25 2010
New Revision: 46110
URL: https://trac.parrot.org/parrot/changeset/46110

Log:
fixed some ARGINs that were set to SHIM

Modified:
   trunk/include/parrot/io_portable.h
   trunk/src/io/portable.c

Modified: trunk/include/parrot/io_portable.h
==============================================================================
--- trunk/include/parrot/io_portable.h	Wed Apr 28 15:52:24 2010	(r46109)
+++ trunk/include/parrot/io_portable.h	Wed Apr 28 16:05:25 2010	(r46110)
@@ -36,7 +36,9 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*filehandle);
 
-INTVAL Parrot_io_flush_portable(SHIM_INTERP, SHIM(PMC *filehandle));
+INTVAL Parrot_io_flush_portable(SHIM_INTERP, ARGIN(PMC *filehandle))
+        __attribute__nonnull__(2);
+
 INTVAL Parrot_io_getblksize_portable(PIOHANDLE fptr);
 INTVAL Parrot_io_init_portable(PARROT_INTERP)
         __attribute__nonnull__(1);
@@ -72,9 +74,10 @@
         __attribute__nonnull__(3);
 
 size_t Parrot_io_read_portable(PARROT_INTERP,
-    SHIM(PMC *filehandle),
+    ARGIN(PMC *filehandle),
     ARGIN(STRING **buf))
         __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
 PIOOFF_T Parrot_io_seek_portable(PARROT_INTERP,
@@ -102,7 +105,8 @@
 #define ASSERT_ARGS_Parrot_io_fdopen_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(filehandle))
-#define ASSERT_ARGS_Parrot_io_flush_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_io_flush_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(filehandle))
 #define ASSERT_ARGS_Parrot_io_getblksize_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
 #define ASSERT_ARGS_Parrot_io_init_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
@@ -121,6 +125,7 @@
     , PARROT_ASSERT_ARG(buf))
 #define ASSERT_ARGS_Parrot_io_read_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(filehandle) \
     , PARROT_ASSERT_ARG(buf))
 #define ASSERT_ARGS_Parrot_io_seek_portable __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \

Modified: trunk/src/io/portable.c
==============================================================================
--- trunk/src/io/portable.c	Wed Apr 28 15:52:24 2010	(r46109)
+++ trunk/src/io/portable.c	Wed Apr 28 16:05:25 2010	(r46110)
@@ -349,7 +349,7 @@
 */
 
 INTVAL
-Parrot_io_flush_portable(SHIM_INTERP, SHIM(PMC *filehandle))
+Parrot_io_flush_portable(SHIM_INTERP, ARGIN(PMC *filehandle))
 {
     ASSERT_ARGS(Parrot_io_flush_portable)
     return fflush((FILE *)Parrot_io_get_os_handle(interp, filehandle));
@@ -369,7 +369,7 @@
 */
 
 size_t
-Parrot_io_read_portable(PARROT_INTERP, SHIM(PMC *filehandle),
+Parrot_io_read_portable(PARROT_INTERP, ARGIN(PMC *filehandle),
               ARGIN(STRING **buf))
 {
     ASSERT_ARGS(Parrot_io_read_portable)
@@ -424,15 +424,15 @@
 */
 
 PIOOFF_T
-Parrot_io_seek_portable(PARROT_INTERP, ARGMOD(PMC *filehandle),
-              PIOOFF_T offset, INTVAL whence)
+Parrot_io_seek_portable(PARROT_INTERP, ARGMOD(PMC *filehandle), PIOOFF_T offset, INTVAL whence)
 {
     ASSERT_ARGS(Parrot_io_seek_portable)
-    PIOOFF_T pos;
     errno = 0;
 
-    if ((pos = fseek((FILE *)Parrot_io_get_os_handle(interp, filehandle),
-                    (long)offset, whence)) >= 0)
+    const PIOOFF_T pos = fseek(
+            (FILE *)Parrot_io_get_os_handle(interp, filehandle), (long)offset, whence);
+
+    if (pos >= 0)
         Parrot_io_set_file_position(interp, filehandle, pos);
 
     /* Seek clears EOF */


More information about the parrot-commits mailing list