develooper Front page | perl.perl5.porters | Postings from January 2008

[PATCH] util.c: some consting

Thread Next
From:
Steven Schubiger
Date:
January 24, 2008 16:14
Subject:
[PATCH] util.c: some consting
Message ID:
20080125001052.GA29980@refcnt.homeunix.org
Requires a make regen.

Steven Schubiger

diff -ru perl-current/embed.fnc perl-hack/embed.fnc
--- perl-current/embed.fnc	2008-01-18 23:38:30.000000000 +0100
+++ perl-hack/embed.fnc	2008-01-25 00:39:39.000000000 +0100
@@ -525,7 +525,7 @@
 #endif
 Ap	|I32	|my_pclose	|NULLOK PerlIO* ptr
 Ap	|PerlIO*|my_popen	|NN const char* cmd|NN const char* mode
-Ap	|PerlIO*|my_popen_list	|NN char* mode|int n|NN SV ** args
+Ap	|PerlIO*|my_popen_list	|NN const char* mode|int n|NN SV ** args
 Ap	|void	|my_setenv	|NULLOK const char* nam|NULLOK const char* val
 Ap	|I32	|my_stat
 Ap	|char *	|my_strftime	|NN const char *fmt|int sec|int min|int hour|int mday|int mon|int year|int wday|int yday|int isdst
diff -ru perl-current/util.c perl-hack/util.c
--- perl-current/util.c	2008-01-05 23:36:31.000000000 +0100
+++ perl-hack/util.c	2008-01-25 00:19:25.000000000 +0100
@@ -425,7 +425,7 @@
     if (little >= lend)
         return (char*)big;
     {
-        char first = *little++;
+        const char first = *little++;
         const char *s, *x;
         bigend -= lend - little;
     OUTER:
@@ -2213,7 +2213,7 @@
 }
 
 PerlIO *
-Perl_my_popen_list(pTHX_ char *mode, int n, SV **args)
+Perl_my_popen_list(pTHX_ const char *mode, int n, SV **args)
 {
 #if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(OS2) && !defined(VMS) && !defined(__OPEN_VM) && !defined(EPOC) && !defined(MACOS_TRADITIONAL) && !defined(NETWARE) && !defined(__LIBCATAMOUNT__)
     dVAR;
@@ -2597,7 +2597,7 @@
 
 #ifdef DUMP_FDS
 void
-Perl_dump_fds(pTHX_ char *s)
+Perl_dump_fds(pTHX_ const char *const s)
 {
     int fd;
     Stat_t tmpstatbuf;


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About