[svn:parrot] r45791 - in trunk: compilers/imcc include/parrot src t/src tools/dev

petdance at svn.parrot.org petdance at svn.parrot.org
Mon Apr 19 05:45:56 UTC 2010


Author: petdance
Date: Mon Apr 19 05:45:56 2010
New Revision: 45791
URL: https://trac.parrot.org/parrot/changeset/45791

Log:
correcting all the argv to be  "const char **argv"

Modified:
   trunk/compilers/imcc/main.c
   trunk/include/parrot/embed.h
   trunk/include/parrot/imcc.h
   trunk/src/embed.c
   trunk/src/main.c
   trunk/src/parrot_debugger.c
   trunk/src/pbc_dump.c
   trunk/t/src/extend.t
   trunk/tools/dev/pbc_to_exe.pir

Modified: trunk/compilers/imcc/main.c
==============================================================================
--- trunk/compilers/imcc/main.c	Mon Apr 19 05:43:49 2010	(r45790)
+++ trunk/compilers/imcc/main.c	Mon Apr 19 05:45:56 2010	(r45791)
@@ -78,7 +78,7 @@
     int obj_file,
     ARGIN_NULLOK(const char *output_file),
     int argc,
-    ARGIN(char **argv))
+    ARGIN(const char **argv))
         __attribute__nonnull__(1)
         __attribute__nonnull__(5);
 
@@ -462,7 +462,7 @@
 /*
 
 =item C<static void imcc_run_pbc(PARROT_INTERP, int obj_file, const char
-*output_file, int argc, char **argv)>
+*output_file, int argc, const char **argv)>
 
 Write out or run Parrot bytecode.
 
@@ -472,7 +472,7 @@
 
 static void
 imcc_run_pbc(PARROT_INTERP, int obj_file, ARGIN_NULLOK(const char *output_file),
-        int argc, ARGIN(char **argv))
+        int argc, ARGIN(const char **argv))
 {
     ASSERT_ARGS(imcc_run_pbc)
     if (IMCC_INFO(interp)->imcc_warn)
@@ -692,7 +692,7 @@
 
 /*
 
-=item C<int imcc_run(PARROT_INTERP, const char *sourcefile, int argc, char
+=item C<int imcc_run(PARROT_INTERP, const char *sourcefile, int argc, const char
 **argv)>
 
 Entry point of IMCC, as invoked by Parrot's main function.
@@ -705,7 +705,7 @@
 
 int
 imcc_run(PARROT_INTERP, ARGIN(const char *sourcefile), int argc,
-        ARGIN(char **argv))
+        ARGIN(const char **argv))
 {
     int                obj_file;
     yyscan_t           yyscanner   = IMCC_INFO(interp)->yyscanner;

Modified: trunk/include/parrot/embed.h
==============================================================================
--- trunk/include/parrot/embed.h	Mon Apr 19 05:43:49 2010	(r45790)
+++ trunk/include/parrot/embed.h	Mon Apr 19 05:45:56 2010	(r45791)
@@ -56,7 +56,7 @@
 
 PARROT_EXPORT void Parrot_pbc_fixup_loaded(Parrot_Interp);
 
-PARROT_EXPORT void Parrot_runcode(Parrot_Interp, int argc, char **argv);
+PARROT_EXPORT void Parrot_runcode(Parrot_Interp, int argc, const char **argv);
 
 PARROT_EXPORT Parrot_PMC Parrot_compile_string(Parrot_Interp,
         Parrot_String type, const char *code, Parrot_String *error);

Modified: trunk/include/parrot/imcc.h
==============================================================================
--- trunk/include/parrot/imcc.h	Mon Apr 19 05:43:49 2010	(r45790)
+++ trunk/include/parrot/imcc.h	Mon Apr 19 05:45:56 2010	(r45791)
@@ -9,7 +9,7 @@
 PARROT_EXPORT void imcc_initialize(PARROT_INTERP);
 PARROT_EXPORT void imcc_start_handling_flags(PARROT_INTERP);
 PARROT_EXPORT int imcc_handle_flag(PARROT_INTERP, struct longopt_opt_info *opt, Parrot_Run_core_t *core);
-PARROT_EXPORT int imcc_run(PARROT_INTERP, const char *sourcefile, int argc, char **argv);
+PARROT_EXPORT int imcc_run(PARROT_INTERP, const char *sourcefile, int argc, const char **argv);
 
 #endif /* PARROT_IMCC_H_GUARD */
 

Modified: trunk/src/embed.c
==============================================================================
--- trunk/src/embed.c	Mon Apr 19 05:43:49 2010	(r45790)
+++ trunk/src/embed.c	Mon Apr 19 05:45:56 2010	(r45791)
@@ -44,7 +44,7 @@
         __attribute__nonnull__(1);
 
 PARROT_CANNOT_RETURN_NULL
-static PMC* setup_argv(PARROT_INTERP, int argc, ARGIN(char **argv))
+static PMC* setup_argv(PARROT_INTERP, int argc, ARGIN(const char **argv))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
@@ -618,7 +618,7 @@
 
 /*
 
-=item C<static PMC* setup_argv(PARROT_INTERP, int argc, char **argv)>
+=item C<static PMC* setup_argv(PARROT_INTERP, int argc, const char **argv)>
 
 Creates and returns C<ARGS> array PMC.
 
@@ -628,7 +628,7 @@
 
 PARROT_CANNOT_RETURN_NULL
 static PMC*
-setup_argv(PARROT_INTERP, int argc, ARGIN(char **argv))
+setup_argv(PARROT_INTERP, int argc, ARGIN(const char **argv))
 {
     ASSERT_ARGS(setup_argv)
     PMC   * const userargv = Parrot_pmc_new(interp, enum_class_ResizableStringArray);
@@ -748,7 +748,7 @@
 
 /*
 
-=item C<void Parrot_runcode(PARROT_INTERP, int argc, char **argv)>
+=item C<void Parrot_runcode(PARROT_INTERP, int argc, const char **argv)>
 
 Sets up C<ARGV> and runs the ops.
 
@@ -758,7 +758,7 @@
 
 PARROT_EXPORT
 void
-Parrot_runcode(PARROT_INTERP, int argc, ARGIN(char **argv))
+Parrot_runcode(PARROT_INTERP, int argc, ARGIN(const char **argv))
 {
     PMC *userargv, *main_sub;
 

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	Mon Apr 19 05:43:49 2010	(r45790)
+++ trunk/src/main.c	Mon Apr 19 05:45:56 2010	(r45791)
@@ -46,7 +46,7 @@
 PARROT_CAN_RETURN_NULL
 static const char * parseflags(PARROT_INTERP,
     ARGMOD(int *argc),
-    ARGMOD(char **argv[]),
+    ARGMOD(const char **argv[]),
     ARGMOD(Parrot_Run_core_t *core),
     ARGMOD(Parrot_trace_flags *trace))
         __attribute__nonnull__(1)
@@ -59,7 +59,9 @@
         FUNC_MODIFIES(*core)
         FUNC_MODIFIES(*trace);
 
-static void parseflags_minimal(PARROT_INTERP, int argc, ARGIN(char *argv[]))
+static void parseflags_minimal(PARROT_INTERP,
+    int argc,
+    ARGIN(const char *argv[]))
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
@@ -88,7 +90,7 @@
 
 /*
 
-=item C<int main(int argc, char * argv[])>
+=item C<int main(int argc, const char *argv[])>
 
 The entry point from the command line into Parrot.
 
@@ -97,7 +99,7 @@
 */
 
 int
-main(int argc, char * argv[])
+main(int argc, const char *argv[])
 {
     int         stacktop;
     const char *sourcefile;
@@ -358,7 +360,8 @@
 
 /*
 
-=item C<static void parseflags_minimal(PARROT_INTERP, int argc, char *argv[])>
+=item C<static void parseflags_minimal(PARROT_INTERP, int argc, const char
+*argv[])>
 
 Parse minimal subset of args required for initializing interpreter.
 
@@ -366,7 +369,7 @@
 
 */
 static void
-parseflags_minimal(PARROT_INTERP, int argc, ARGIN(char *argv[]))
+parseflags_minimal(PARROT_INTERP, int argc, ARGIN(const char *argv[]))
 {
     ASSERT_ARGS(parseflags_minimal)
 
@@ -420,8 +423,8 @@
 
 /*
 
-=item C<static const char * parseflags(PARROT_INTERP, int *argc, char **argv[],
-Parrot_Run_core_t *core, Parrot_trace_flags *trace)>
+=item C<static const char * parseflags(PARROT_INTERP, int *argc, const char
+**argv[], Parrot_Run_core_t *core, Parrot_trace_flags *trace)>
 
 Parse Parrot's command line for options and set appropriate flags.
 
@@ -432,7 +435,7 @@
 PARROT_CAN_RETURN_NULL
 static const char *
 parseflags(PARROT_INTERP,
-        ARGMOD(int *argc), ARGMOD(char **argv[]),
+        ARGMOD(int *argc), ARGMOD(const char **argv[]),
         ARGMOD(Parrot_Run_core_t *core), ARGMOD(Parrot_trace_flags *trace))
 {
     ASSERT_ARGS(parseflags)

Modified: trunk/src/parrot_debugger.c
==============================================================================
--- trunk/src/parrot_debugger.c	Mon Apr 19 05:43:49 2010	(r45790)
+++ trunk/src/parrot_debugger.c	Mon Apr 19 05:45:56 2010	(r45791)
@@ -147,7 +147,7 @@
 #include "parrot/runcore_api.h"
 
 static void PDB_printwelcome(void);
-static void PDB_run_code(PARROT_INTERP, int argc, char *argv[]);
+static void PDB_run_code(PARROT_INTERP, int argc, const char *argv[]);
 
 /*
 
@@ -161,7 +161,7 @@
 */
 
 int
-main(int argc, char *argv[])
+main(int argc, const char *argv[])
 {
     int nextarg;
     Parrot_Interp     interp;
@@ -280,7 +280,7 @@
 */
 
 static void
-PDB_run_code(PARROT_INTERP, int argc, char *argv[])
+PDB_run_code(PARROT_INTERP, int argc, const char *argv[])
 {
     new_runloop_jump_point(interp);
     if (setjmp(interp->current_runloop->resume)) {

Modified: trunk/src/pbc_dump.c
==============================================================================
--- trunk/src/pbc_dump.c	Mon Apr 19 05:43:49 2010	(r45790)
+++ trunk/src/pbc_dump.c	Mon Apr 19 05:45:56 2010	(r45791)
@@ -166,7 +166,6 @@
     while (pc < self->data + self->size) {
         /* n can't be const; the ADD_OP_VAR_PART macro increments it */
         size_t n = (size_t)op_info[*pc].op_count;
-        size_t i;
 
         Parrot_io_printf(interp, " %04x:  %s\n",
             *(debug_ops++), op_info[*pc].full_name);
@@ -188,7 +187,10 @@
 */
 
 static void
-null_dump(PARROT_INTERP, const PackFile_Segment *self) {}
+null_dump(SHIM_INTERP, const PackFile_Segment *self)
+{
+    UNUSED(self);
+}
 
 
 /*

Modified: trunk/t/src/extend.t
==============================================================================
--- trunk/t/src/extend.t	Mon Apr 19 05:43:49 2010	(r45790)
+++ trunk/t/src/extend.t	Mon Apr 19 05:45:56 2010	(r45791)
@@ -35,7 +35,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp  = Parrot_new(NULL);
     Parrot_Int    parrot_reg = 0;
     Parrot_Int    value      = 42;
@@ -65,7 +66,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp     = Parrot_new(NULL);
     Parrot_Int    parrot_reg = 1;
     Parrot_Float  value       = 2.5;
@@ -95,7 +97,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp = Parrot_new(NULL);
     Parrot_String output;
 
@@ -121,7 +124,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp     = Parrot_new(NULL);
     Parrot_Int    parrot_reg = 2;
     Parrot_String value, new_value;
@@ -151,7 +155,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp = Parrot_new(NULL);
     Parrot_Int    value  = 101010;
     Parrot_PMC    testpmc;
@@ -201,7 +206,8 @@
 }
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp = Parrot_new(NULL);
 
     /* Interpreter set-up */
@@ -223,7 +229,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp     = Parrot_new(NULL);
     Parrot_Int    value      = -123;
     Parrot_Int    parrot_reg =  31;
@@ -261,7 +268,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp = Parrot_new(NULL);
     Parrot_Float  value  = 3.1415927;
     Parrot_Int    type;
@@ -294,7 +302,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp = Parrot_new(NULL);
     Parrot_Int    type;
     Parrot_String value, new_value;
@@ -327,7 +336,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp = Parrot_new(NULL);
     Parrot_Int    type;
     Parrot_PMC    testpmc;
@@ -361,7 +371,8 @@
 #include "parrot/extend.h"
 
 int
-main(int argc, char* argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp = Parrot_new(NULL);
     Parrot_Int    length = 6;
     Parrot_Int    type;
@@ -422,7 +433,7 @@
 static opcode_t *the_test(Parrot_Interp, opcode_t *, opcode_t *);
 
 int
-main(int argc, char *argv[])
+main(int argc, const char *argv[])
 {
     Parrot_Interp interp = Parrot_new(NULL);
     if (!interp)
@@ -480,7 +491,7 @@
 static opcode_t *the_test(Parrot_Interp, opcode_t *, opcode_t *);
 
 int
-main(int argc, char *argv[])
+main(int argc, const char *argv[])
 {
     Parrot_Interp interp = Parrot_new(NULL);
     if (!interp)
@@ -556,7 +567,7 @@
 static opcode_t *the_test(Parrot_Interp, opcode_t *, opcode_t *);
 
 int
-main(int argc, char *argv[])
+main(int argc, const char *argv[])
 {
     Parrot_Interp interp = Parrot_new(NULL);
     if (!interp)
@@ -623,7 +634,7 @@
 the_test(Parrot_Interp, opcode_t *, opcode_t *);
 
 int
-main(int argc, char *argv[])
+main(int argc, const char *argv[])
 {
     Parrot_Interp interp = Parrot_new(NULL);
     if (!interp)
@@ -718,10 +729,10 @@
 #include <parrot/embed.h>
 
 int
-main(int argc, char* argv[])
+main(int argc, const char *argv[])
 {
     Parrot_PackFile packfile;
-    char * code[] = { ".sub foo\\nsay \\"Hello from foo!\\"\\n.end\\n" };
+    const char * code[] = { ".sub foo\\nsay \\"Hello from foo!\\"\\n.end\\n" };
 
     Parrot_Interp interp = Parrot_new(NULL);
     if (!interp) {
@@ -755,7 +766,7 @@
 #include <parrot/extend.h>
 
 int
-main(int argc, char* argv[])
+main(int argc, const char *argv[])
 {
     Parrot_Interp   interp    = Parrot_new(NULL);
     const char      *code      = ".sub foo\nprint\"Hello from foo!\\n\"\n.end\n";
@@ -794,7 +805,7 @@
 #include <parrot/extend.h>
 
 int
-main(int argc, char* argv[])
+main(int argc, const char *argv[])
 {
     Parrot_Int      result;
     Parrot_PMC      sub;
@@ -826,7 +837,7 @@
 #include <parrot/extend.h>
 
 int
-main(int argc, char* argv[])
+main(int argc, const char *argv[])
 {
     Parrot_Int      result;
     Parrot_PMC      sub;
@@ -879,7 +890,8 @@
 }
 
 int
-main(int argc, char *argv[]) {
+main(int argc, const char *argv[])
+{
     Parrot_Interp interp;
     int i, niter = 2;
 

Modified: trunk/tools/dev/pbc_to_exe.pir
==============================================================================
--- trunk/tools/dev/pbc_to_exe.pir	Mon Apr 19 05:43:49 2010	(r45790)
+++ trunk/tools/dev/pbc_to_exe.pir	Mon Apr 19 05:45:56 2010	(r45791)
@@ -66,7 +66,7 @@
     print outfh, codestring
 
     print outfh, <<'MAIN'
-        int main(int argc, char *argv[])
+        int main(int argc, const char *argv[])
         {
             PackFile     *pf;
             Parrot_Interp interp;


More information about the parrot-commits mailing list