[svn:parrot] r45908 - in branches/string_consting: include/parrot src/io

bacek at svn.parrot.org bacek at svn.parrot.org
Thu Apr 22 13:04:23 UTC 2010


Author: bacek
Date: Thu Apr 22 13:04:23 2010
New Revision: 45908
URL: https://trac.parrot.org/parrot/changeset/45908

Log:
Constify IO more

Modified:
   branches/string_consting/include/parrot/io.h
   branches/string_consting/src/io/buffer.c
   branches/string_consting/src/io/unix.c
   branches/string_consting/src/io/utf8.c

Modified: branches/string_consting/include/parrot/io.h
==============================================================================
--- branches/string_consting/include/parrot/io.h	Thu Apr 22 13:04:05 2010	(r45907)
+++ branches/string_consting/include/parrot/io.h	Thu Apr 22 13:04:23 2010	(r45908)
@@ -495,7 +495,7 @@
 
 size_t Parrot_io_write_buffer(PARROT_INTERP,
     ARGMOD(PMC *filehandle),
-    ARGIN(STRING *s))
+    ARGIN(const STRING *s))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
@@ -552,12 +552,11 @@
 
 size_t Parrot_io_write_utf8(PARROT_INTERP,
     ARGMOD(PMC *filehandle),
-    ARGMOD(STRING *s))
+    ARGIN(const STRING *s))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3)
-        FUNC_MODIFIES(*filehandle)
-        FUNC_MODIFIES(*s);
+        FUNC_MODIFIES(*filehandle);
 
 #define ASSERT_ARGS_Parrot_io_read_utf8 __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \

Modified: branches/string_consting/src/io/buffer.c
==============================================================================
--- branches/string_consting/src/io/buffer.c	Thu Apr 22 13:04:05 2010	(r45907)
+++ branches/string_consting/src/io/buffer.c	Thu Apr 22 13:04:23 2010	(r45908)
@@ -545,8 +545,8 @@
 
 /*
 
-=item C<size_t Parrot_io_write_buffer(PARROT_INTERP, PMC *filehandle, STRING
-*s)>
+=item C<size_t Parrot_io_write_buffer(PARROT_INTERP, PMC *filehandle, const
+STRING *s)>
 
 The buffer layer's C<Write> function.
 
@@ -555,7 +555,8 @@
 */
 
 size_t
-Parrot_io_write_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle), ARGIN(STRING *s))
+Parrot_io_write_buffer(PARROT_INTERP, ARGMOD(PMC *filehandle),
+        ARGIN(const STRING *s))
 {
     ASSERT_ARGS(Parrot_io_write_buffer)
     unsigned char * const buffer_start = Parrot_io_get_buffer_start(interp, filehandle);

Modified: branches/string_consting/src/io/unix.c
==============================================================================
--- branches/string_consting/src/io/unix.c	Thu Apr 22 13:04:05 2010	(r45907)
+++ branches/string_consting/src/io/unix.c	Thu Apr 22 13:04:23 2010	(r45908)
@@ -133,8 +133,8 @@
 
 /*
 
-=item C<PMC * Parrot_io_open_unix(PARROT_INTERP, PMC *filehandle, STRING *path,
-INTVAL flags)>
+=item C<PMC * Parrot_io_open_unix(PARROT_INTERP, PMC *filehandle, const STRING
+*path, INTVAL flags)>
 
 Opens a string C<path>. C<flags> is a bitwise C<or> combination of C<PIO_F_*>
 flag values.
@@ -147,7 +147,7 @@
 PARROT_CAN_RETURN_NULL
 PMC *
 Parrot_io_open_unix(PARROT_INTERP, ARGMOD_NULLOK(PMC *filehandle),
-              ARGIN(STRING *path), INTVAL flags)
+              ARGIN(const STRING *path), INTVAL flags)
 {
     ASSERT_ARGS(Parrot_io_open_unix)
     int oflags;
@@ -541,7 +541,8 @@
 
 /*
 
-=item C<size_t Parrot_io_write_unix(PARROT_INTERP, PMC *filehandle, STRING *s)>
+=item C<size_t Parrot_io_write_unix(PARROT_INTERP, PMC *filehandle, const STRING
+*s)>
 
 Calls C<write()> to write C<len> bytes from the memory starting at
 C<buffer> to the file descriptor in C<*io>.
@@ -551,7 +552,7 @@
 */
 
 size_t
-Parrot_io_write_unix(PARROT_INTERP, ARGIN(PMC *filehandle), ARGMOD(STRING *s))
+Parrot_io_write_unix(PARROT_INTERP, ARGIN(PMC *filehandle), ARGIN(const STRING *s))
 {
     ASSERT_ARGS(Parrot_io_write_unix)
     const PIOHANDLE file_descriptor = Parrot_io_get_os_handle(interp, filehandle);
@@ -659,8 +660,8 @@
 
 /*
 
-=item C<PMC * Parrot_io_open_pipe_unix(PARROT_INTERP, PMC *filehandle, STRING
-*command, int flags)>
+=item C<PMC * Parrot_io_open_pipe_unix(PARROT_INTERP, PMC *filehandle, const
+STRING *command, int flags)>
 
 Very limited C<exec> for now.
 
@@ -672,7 +673,7 @@
 PARROT_CAN_RETURN_NULL
 PMC *
 Parrot_io_open_pipe_unix(PARROT_INTERP, ARGMOD(PMC *filehandle),
-        ARGIN(STRING *command), int flags)
+        ARGIN(const STRING *command), int flags)
 {
     ASSERT_ARGS(Parrot_io_open_pipe_unix)
     /*

Modified: branches/string_consting/src/io/utf8.c
==============================================================================
--- branches/string_consting/src/io/utf8.c	Thu Apr 22 13:04:05 2010	(r45907)
+++ branches/string_consting/src/io/utf8.c	Thu Apr 22 13:04:23 2010	(r45908)
@@ -101,7 +101,8 @@
 
 /*
 
-=item C<size_t Parrot_io_write_utf8(PARROT_INTERP, PMC *filehandle, STRING *s)>
+=item C<size_t Parrot_io_write_utf8(PARROT_INTERP, PMC *filehandle, const STRING
+*s)>
 
 Write a Parrot string to a filehandle in UTF-8 format.
 
@@ -111,7 +112,7 @@
 
 size_t
 Parrot_io_write_utf8(PARROT_INTERP, ARGMOD(PMC *filehandle),
-        ARGMOD(STRING *s))
+        ARGIN(const STRING *s))
 {
     ASSERT_ARGS(Parrot_io_write_utf8)
     STRING *dest;


More information about the parrot-commits mailing list