[svn:parrot] r40140 - trunk/src/io

petdance at svn.parrot.org petdance at svn.parrot.org
Sat Jul 18 05:07:31 UTC 2009


Author: petdance
Date: Sat Jul 18 05:07:29 2009
New Revision: 40140
URL: https://trac.parrot.org/parrot/changeset/40140

Log:
consting

Modified:
   trunk/src/io/buffer.c
   trunk/src/io/filehandle.c
   trunk/src/io/unix.c

Modified: trunk/src/io/buffer.c
==============================================================================
--- trunk/src/io/buffer.c	Sat Jul 18 04:54:10 2009	(r40139)
+++ trunk/src/io/buffer.c	Sat Jul 18 05:07:29 2009	(r40140)
@@ -471,7 +471,7 @@
     size_t l;
     unsigned char *out_buf;
     unsigned char *buf_start;
-    INTVAL         buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
+    const INTVAL   buffer_flags = Parrot_io_get_buffer_flags(interp, filehandle);
     unsigned char *buffer_next;
     unsigned char *buffer_end;
     size_t len;

Modified: trunk/src/io/filehandle.c
==============================================================================
--- trunk/src/io/filehandle.c	Sat Jul 18 04:54:10 2009	(r40139)
+++ trunk/src/io/filehandle.c	Sat Jul 18 05:07:29 2009	(r40140)
@@ -555,7 +555,7 @@
 Parrot_io_clear_buffer(SHIM_INTERP, ARGIN(PMC *filehandle))
 {
     ASSERT_ARGS(Parrot_io_clear_buffer)
-    Parrot_FileHandle_attributes *io = PARROT_FILEHANDLE(filehandle);
+    Parrot_FileHandle_attributes * const io = PARROT_FILEHANDLE(filehandle);
     if (io->buffer_start && (io->flags & PIO_BF_MALLOC)) {
         mem_sys_free(io->buffer_start);
         io->buffer_start = NULL;
@@ -634,7 +634,7 @@
 Parrot_io_set_file_position(SHIM_INTERP, ARGIN(PMC *filehandle), PIOOFF_T file_pos)
 {
     ASSERT_ARGS(Parrot_io_set_file_position)
-    Parrot_FileHandle_attributes *handle_struct = PARROT_FILEHANDLE(filehandle);
+    Parrot_FileHandle_attributes * const handle_struct = PARROT_FILEHANDLE(filehandle);
     handle_struct->last_pos = handle_struct->file_pos;
     handle_struct->file_pos = file_pos;
 }
@@ -662,7 +662,7 @@
 Parrot_io_is_encoding(PARROT_INTERP, ARGIN(PMC *filehandle), ARGIN(STRING *value))
 {
     ASSERT_ARGS(Parrot_io_is_encoding)
-    Parrot_FileHandle_attributes *handle_struct = PARROT_FILEHANDLE(filehandle);
+    Parrot_FileHandle_attributes * const handle_struct = PARROT_FILEHANDLE(filehandle);
     if (STRING_IS_NULL(handle_struct->encoding))
         return 0;
 

Modified: trunk/src/io/unix.c
==============================================================================
--- trunk/src/io/unix.c	Sat Jul 18 04:54:10 2009	(r40139)
+++ trunk/src/io/unix.c	Sat Jul 18 05:07:29 2009	(r40140)
@@ -233,7 +233,7 @@
             flags |= PIO_F_CONSOLE;
 
         if (PMC_IS_NULL(filehandle)) {
-            PMC *io = Parrot_io_new_pmc(interp, flags);
+            PMC * const io = Parrot_io_new_pmc(interp, flags);
             Parrot_io_set_os_handle(interp, io, fd);
             return io;
         }
@@ -268,8 +268,8 @@
 Parrot_io_async_unix(PARROT_INTERP, ARGMOD(PMC *filehandle), INTVAL b)
 {
     ASSERT_ARGS(Parrot_io_async_unix)
-    int rflags;
 #    if defined(linux)
+    int rflags;
     PIOHANDLE file_descriptor = Parrot_io_get_os_handle(interp, filehandle);
 
     if ((rflags = fcntl(file_descriptor, F_GETFL, 0)) >= 0) {
@@ -498,7 +498,7 @@
 {
     ASSERT_ARGS(Parrot_io_read_unix)
     const PIOHANDLE file_descriptor = Parrot_io_get_os_handle(interp, filehandle);
-    INTVAL file_flags = Parrot_io_get_flags(interp, filehandle);
+    const INTVAL file_flags = Parrot_io_get_flags(interp, filehandle);
     STRING * const s = Parrot_io_make_string(interp, buf, 2048);
 
     const size_t len = s->bufused;


More information about the parrot-commits mailing list