[svn:parrot] r40139 - trunk/src/pmc

petdance at svn.parrot.org petdance at svn.parrot.org
Sat Jul 18 04:54:10 UTC 2009


Author: petdance
Date: Sat Jul 18 04:54:10 2009
New Revision: 40139
URL: https://trac.parrot.org/parrot/changeset/40139

Log:
consting

Modified:
   trunk/src/pmc/filehandle.pmc

Modified: trunk/src/pmc/filehandle.pmc
==============================================================================
--- trunk/src/pmc/filehandle.pmc	Sat Jul 18 04:24:48 2009	(r40138)
+++ trunk/src/pmc/filehandle.pmc	Sat Jul 18 04:54:10 2009	(r40139)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2008, Parrot Foundation.
+Copyright (C) 2008-2009, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -63,7 +63,7 @@
 */
 
     VTABLE void init() {
-        Parrot_FileHandle_attributes *data_struct =
+        Parrot_FileHandle_attributes * const data_struct =
                 mem_allocate_typed(Parrot_FileHandle_attributes);
 
         PMC_data(SELF)             = data_struct;
@@ -277,7 +277,7 @@
 
 */
     METHOD isatty() {
-        INTVAL isatty = (PARROT_FILEHANDLE(SELF)->flags & PIO_F_CONSOLE) == PIO_F_CONSOLE;
+        const INTVAL isatty = (PARROT_FILEHANDLE(SELF)->flags & PIO_F_CONSOLE) == PIO_F_CONSOLE;
         RETURN(INTVAL isatty);
     }
 
@@ -292,8 +292,7 @@
 */
 
     METHOD close() {
-        INTVAL status;
-        status = Parrot_io_close(INTERP, SELF);
+        const INTVAL status = Parrot_io_close(INTERP, SELF);
         RETURN(INTVAL status);
     }
 
@@ -308,8 +307,7 @@
 */
 
     METHOD is_closed() {
-        INTVAL status;
-        status = Parrot_io_is_closed(interp, SELF);
+        const INTVAL status = Parrot_io_is_closed(interp, SELF);
         RETURN(INTVAL status);
     }
 
@@ -324,8 +322,7 @@
 */
 
     METHOD read(INTVAL length) {
-        STRING *string_result = NULL;
-        string_result = Parrot_io_reads(INTERP, SELF, length);
+        STRING * const string_result = Parrot_io_reads(INTERP, SELF, length);
 
         RETURN(STRING *string_result);
     }
@@ -341,8 +338,7 @@
 */
 
     METHOD readline() {
-        STRING *string_result;
-        string_result = Parrot_io_readline(INTERP, SELF);
+        STRING * const string_result = Parrot_io_readline(INTERP, SELF);
         RETURN(STRING *string_result);
     }
 
@@ -510,8 +506,7 @@
 */
 
     METHOD puts(STRING *to_print) {
-        INTVAL status;
-        status = Parrot_io_putps(INTERP, SELF, to_print);
+        const INTVAL status = Parrot_io_putps(INTERP, SELF, to_print);
         RETURN(INTVAL status);
     }
 
@@ -650,8 +645,7 @@
 */
 
     METHOD eof() {
-        INTVAL flags;
-        flags = Parrot_io_eof(INTERP, SELF);
+        const INTVAL flags = Parrot_io_eof(INTERP, SELF);
         RETURN(INTVAL flags);
     }
 


More information about the parrot-commits mailing list