Change 32681 by [EMAIL PROTECTED] on 2007/12/20 21:52:06

        Subject: [PATCH] make miniperl -Wwrite-strings clean
        From: "Robin Barker" <[EMAIL PROTECTED]>
        Date: Thu, 20 Dec 2007 18:29:25 -0000
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/doio.c#365 edit
... //depot/perl/intrpvar.h#229 edit
... //depot/perl/overload.c#4 edit
... //depot/perl/overload.pl#7 edit
... //depot/perl/perl.h#806 edit

Differences ...

==== //depot/perl/doio.c#365 (text) ====
Index: perl/doio.c
--- perl/doio.c#364~32547~      2007-11-29 01:35:59.000000000 -0800
+++ perl/doio.c 2007-12-20 13:52:06.000000000 -0800
@@ -1384,14 +1384,14 @@
     Perl_croak(aTHX_ "exec? I'm not *that* kind of operating system");
 #else
     if (sp > mark) {
-       char **a;
+       const char **a;
        const char *tmps = NULL;
-       Newx(PL_Argv, sp - mark + 1, char*);
+       Newx(PL_Argv, sp - mark + 1, const char*);
        a = PL_Argv;
 
        while (++mark <= sp) {
            if (*mark)
-               *a++ = (char*)SvPV_nolen_const(*mark);
+               *a++ = SvPV_nolen_const(*mark);
            else
                *a++ = "";
        }
@@ -1430,7 +1430,7 @@
 Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
 {
     dVAR;
-    register char **a;
+    register const char **a;
     register char *s;
     char *buf;
     char *cmd;
@@ -1526,7 +1526,7 @@
        }
     }
 
-    Newx(PL_Argv, (s - cmd) / 2 + 2, char*);
+    Newx(PL_Argv, (s - cmd) / 2 + 2, const char*);
     PL_Cmd = savepvn(cmd, s-cmd);
     a = PL_Argv;
     for (s = PL_Cmd; *s;) {
@@ -1542,7 +1542,7 @@
     *a = NULL;
     if (PL_Argv[0]) {
        PERL_FPU_PRE_EXEC
-       PerlProc_execvp(PL_Argv[0],PL_Argv);
+       PerlProc_execvp(PL_Argv[0],EXEC_ARGV_CAST(PL_Argv));
        PERL_FPU_POST_EXEC
        if (errno == ENOEXEC) {         /* for system V NIH syndrome */
            do_execfree();

==== //depot/perl/intrpvar.h#229 (text) ====
Index: perl/intrpvar.h
--- perl/intrpvar.h#228~32561~  2007-12-03 07:54:54.000000000 -0800
+++ perl/intrpvar.h     2007-12-20 13:52:06.000000000 -0800
@@ -348,7 +348,7 @@
 PERLVAR(Ifilemode,     int)            /* so nextargv() can preserve mode */
 PERLVAR(Ilastfd,       int)            /* what to preserve mode on */
 PERLVAR(Ioldname,      char *)         /* what to preserve mode on */
-PERLVAR(IArgv,         char **)        /* stuff to free from do_aexec, vfork 
safe */
+PERLVAR(IArgv,         const char **)  /* stuff to free from do_aexec, vfork 
safe */
 PERLVAR(ICmd,          char *)         /* stuff to free from do_aexec, vfork 
safe */
 /* Elements in this array have ';' appended and are injected as a single line
    into the tokeniser. You can't put any (literal) newlines into any program

==== //depot/perl/overload.c#4 (text+w) ====
Index: perl/overload.c
--- perl/overload.c#3~32132~    2007-10-18 09:15:22.000000000 -0700
+++ perl/overload.c     2007-12-20 13:52:06.000000000 -0800
@@ -85,7 +85,7 @@
     7
 };
 
-char * const PL_AMG_names[NofAMmeth] = {
+const char * const PL_AMG_names[NofAMmeth] = {
   /* Names kept in the symbol table.  fallback => "()", the rest has
      "(" prepended.  The only other place in perl which knows about
      this convention is AMG_id2name (used for debugging output and

==== //depot/perl/overload.pl#7 (text) ====
Index: perl/overload.pl
--- perl/overload.pl#6~32132~   2007-10-18 09:15:22.000000000 -0700
+++ perl/overload.pl    2007-12-20 13:52:06.000000000 -0800
@@ -84,7 +84,7 @@
     $lastlen
 };
 
-char * const PL_AMG_names[NofAMmeth] = {
+const char * const PL_AMG_names[NofAMmeth] = {
   /* Names kept in the symbol table.  fallback => "()", the rest has
      "(" prepended.  The only other place in perl which knows about
      this convention is AMG_id2name (used for debugging output and

==== //depot/perl/perl.h#806 (text) ====
Index: perl/perl.h
--- perl/perl.h#805~32425~      2007-11-20 08:10:37.000000000 -0800
+++ perl/perl.h 2007-12-20 13:52:06.000000000 -0800
@@ -5686,7 +5686,7 @@
 #endif
 
 #ifndef EXEC_ARGV_CAST
-#define EXEC_ARGV_CAST(x) x
+#define EXEC_ARGV_CAST(x) (char **)x
 #endif
 
 #define IS_NUMBER_IN_UV                      0x01 /* number within UV range 
(maybe not
End of Patch.

Reply via email to