[svn:parrot] r44525 - branches/rm_cflags/compilers/imcc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat Feb 27 01:23:19 UTC 2010


Author: chromatic
Date: Sat Feb 27 01:23:16 2010
New Revision: 44525
URL: https://trac.parrot.org/parrot/changeset/44525

Log:
[IMCC] Fixed constness and casts of emitter open functions.

Modified:
   branches/rm_cflags/compilers/imcc/instructions.c
   branches/rm_cflags/compilers/imcc/pbc.c
   branches/rm_cflags/compilers/imcc/pbc.h

Modified: branches/rm_cflags/compilers/imcc/instructions.c
==============================================================================
--- branches/rm_cflags/compilers/imcc/instructions.c	Sat Feb 27 01:08:36 2010	(r44524)
+++ branches/rm_cflags/compilers/imcc/instructions.c	Sat Feb 27 01:23:16 2010	(r44525)
@@ -50,7 +50,7 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(4);
 
-static int e_file_open(PARROT_INTERP, ARGIN(void *param))
+static int e_file_open(PARROT_INTERP, ARGIN(const char *file))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
@@ -785,7 +785,7 @@
 
 /*
 
-=item C<static int e_file_open(PARROT_INTERP, void *param)>
+=item C<static int e_file_open(PARROT_INTERP, const char *file)>
 
 Prints a message to STDOUT.
 
@@ -794,10 +794,10 @@
 */
 
 static int
-e_file_open(PARROT_INTERP, ARGIN(void *param))
+e_file_open(PARROT_INTERP, ARGIN(const char *file))
 {
     ASSERT_ARGS(e_file_open)
-    char * const file = (char *) param;
+    DECL_CONST_CAST;
 
     if (!STREQ(file, "-")) {
         FILE *newfile = freopen(file, "w", stdout);
@@ -806,7 +806,7 @@
                 "Cannot reopen stdout: %s'\n", strerror(errno));
     }
 
-    output = file;
+    output = PARROT_const_cast(char *, file);
     Parrot_io_printf(interp, "# IMCC does produce b0rken PASM files\n");
     Parrot_io_printf(interp, "# see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392\n");
     return 1;

Modified: branches/rm_cflags/compilers/imcc/pbc.c
==============================================================================
--- branches/rm_cflags/compilers/imcc/pbc.c	Sat Feb 27 01:08:36 2010	(r44524)
+++ branches/rm_cflags/compilers/imcc/pbc.c	Sat Feb 27 01:23:16 2010	(r44525)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2002-2009, Parrot Foundation.
+ * Copyright (C) 2002-2010, Parrot Foundation.
  * $Id$
  */
 
@@ -420,7 +420,7 @@
 
 /*
 
-=item C<int e_pbc_open(PARROT_INTERP, void *param)>
+=item C<int e_pbc_open(PARROT_INTERP, const char *param)>
 
 Opens a compilation unit to emit PBC.
 
@@ -429,7 +429,7 @@
 */
 
 int
-e_pbc_open(PARROT_INTERP, SHIM(void *param))
+e_pbc_open(PARROT_INTERP, SHIM(const char *param))
 {
     ASSERT_ARGS(e_pbc_open)
     code_segment_t * const cs = mem_gc_allocate_zeroed_typed(interp, code_segment_t);

Modified: branches/rm_cflags/compilers/imcc/pbc.h
==============================================================================
--- branches/rm_cflags/compilers/imcc/pbc.h	Sat Feb 27 01:08:36 2010	(r44524)
+++ branches/rm_cflags/compilers/imcc/pbc.h	Sat Feb 27 01:23:16 2010	(r44525)
@@ -28,7 +28,7 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
-int e_pbc_open(PARROT_INTERP, SHIM(void *param))
+int e_pbc_open(PARROT_INTERP, SHIM(const char *param))
         __attribute__nonnull__(1);
 
 PARROT_WARN_UNUSED_RESULT


More information about the parrot-commits mailing list