Change 33507 by [EMAIL PROTECTED] on 2008/03/13 14:35:58

        Subject: Re: [PATCH] sv.c: consting
        From: Steven Schubiger <[EMAIL PROTECTED]>
        Date: Wed, 12 Mar 2008 12:38:46 +0100
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/embed.fnc#603 edit
... //depot/perl/pod/perlapi.pod#329 edit
... //depot/perl/proto.h#938 edit
... //depot/perl/sv.c#1523 edit

Differences ...

==== //depot/perl/embed.fnc#603 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#602~33489~   2008-03-12 03:19:06.000000000 -0700
+++ perl/embed.fnc      2008-03-13 07:35:58.000000000 -0700
@@ -853,8 +853,9 @@
 pd     |void   |sv_add_arena   |NN char *const ptr|const U32 size|const U32 
flags
 Apd    |int    |sv_backoff     |NN SV *const sv
 Apd    |SV*    |sv_bless       |NN SV *const sv|NN HV *const stash
-Afpd   |void   |sv_catpvf      |NN SV* sv|NN const char* pat|...
-Apd    |void   |sv_vcatpvf     |NN SV* sv|NN const char* pat|NULLOK va_list* 
args
+Afpd   |void   |sv_catpvf      |NN SV *const sv|NN const char *const pat|...
+Apd    |void   |sv_vcatpvf     |NN SV *const sv|NN const char *const pat \
+                               |NULLOK va_list *const args
 Apd    |void   |sv_catpv       |NN SV *const sv|NULLOK const char* ptr
 Amdb   |void   |sv_catpvn      |NN SV *dsv|NN const char *sstr|STRLEN len
 Amdb   |void   |sv_catsv       |NN SV *dstr|NULLOK SV *sstr
@@ -934,12 +935,12 @@
 Apdmb  |void   |sv_usepvn      |NN SV* sv|NULLOK char* ptr|STRLEN len
 Apd    |void   |sv_usepvn_flags|NN SV *const sv|NULLOK char* ptr|const STRLEN 
len\
                                |const U32 flags
-Apd    |void   |sv_vcatpvfn    |NN SV* sv|NN const char* pat|STRLEN patlen \
-                               |NULLOK va_list* args|NULLOK SV** svargs|I32 
svmax \
-                               |NULLOK bool *maybe_tainted
-Apd    |void   |sv_vsetpvfn    |NN SV* sv|NN const char* pat|STRLEN patlen \
-                               |NULLOK va_list* args|NULLOK SV** svargs|I32 
svmax \
-                               |NULLOK bool *maybe_tainted
+Apd    |void   |sv_vcatpvfn    |NN SV *const sv|NN const char *const pat|const 
STRLEN patlen \
+                               |NULLOK va_list *const args|NULLOK SV **const 
svargs|const I32 svmax \
+                               |NULLOK bool *const maybe_tainted
+Apd    |void   |sv_vsetpvfn    |NN SV *const sv|NN const char *const pat|const 
STRLEN patlen \
+                               |NULLOK va_list *const args|NULLOK SV **const 
svargs \
+                               |const I32 svmax|NULLOK bool *const 
maybe_tainted
 ApR    |NV     |str_to_version |NN SV *sv
 Ap     |SV*    |swash_init     |NN const char* pkg|NN const char* name|NN SV* 
listsv|I32 minbits|I32 none
 Ap     |UV     |swash_fetch    |NN SV *swash|NN const U8 *ptr|bool do_utf8
@@ -1032,8 +1033,9 @@
 #endif
 Ap     |int    |runops_standard
 Ap     |int    |runops_debug
-Afpd   |void   |sv_catpvf_mg   |NN SV *sv|NN const char* pat|...
-Apd    |void   |sv_vcatpvf_mg  |NN SV* sv|NN const char* pat|NULLOK va_list* 
args
+Afpd   |void   |sv_catpvf_mg   |NN SV *const sv|NN const char *const pat|...
+Apd    |void   |sv_vcatpvf_mg  |NN SV *const sv|NN const char *const pat \
+                               |NULLOK va_list *const args
 Apd    |void   |sv_catpv_mg    |NN SV *const sv|NULLOK const char *const ptr
 Apdbm  |void   |sv_catpvn_mg   |NN SV *sv|NN const char *ptr|STRLEN len
 Apdbm  |void   |sv_catsv_mg    |NN SV *dsv|NULLOK SV *ssv
@@ -1111,13 +1113,13 @@
 ApR    |HEK*   |hek_dup        |NULLOK HEK* e|NN CLONE_PARAMS* param
 Ap     |void   |re_dup_guts    |NN const REGEXP *sstr|NN REGEXP *dstr \
                                |NN CLONE_PARAMS* param
-Ap     |PerlIO*|fp_dup         |NULLOK PerlIO* fp|char type|NN CLONE_PARAMS* 
param
-ApR    |DIR*   |dirp_dup       |NULLOK DIR* dp
-ApR    |GP*    |gp_dup         |NULLOK GP* gp|NN CLONE_PARAMS* param
-ApR    |MAGIC* |mg_dup         |NULLOK MAGIC* mg|NN CLONE_PARAMS* param
+Ap     |PerlIO*|fp_dup         |NULLOK PerlIO *const fp|const char type|NN 
CLONE_PARAMS *const param
+ApR    |DIR*   |dirp_dup       |NULLOK DIR *const dp
+ApR    |GP*    |gp_dup         |NULLOK GP *const gp|NN CLONE_PARAMS *const 
param
+ApR    |MAGIC* |mg_dup         |NULLOK MAGIC *const mg|NN CLONE_PARAMS *const 
param
 ApR    |SV*    |sv_dup         |NULLOK const SV* sstr|NN CLONE_PARAMS* param
 Ap     |void   |rvpv_dup       |NN SV* dstr|NN const SV *sstr|NN CLONE_PARAMS* 
param
-Ap     |yy_parser*|parser_dup  |NULLOK const yy_parser *proto|NN CLONE_PARAMS* 
param
+Ap     |yy_parser*|parser_dup  |NULLOK const yy_parser *const proto|NN 
CLONE_PARAMS *const param
 #endif
 Apa    |PTR_TBL_t*|ptr_table_new
 ApR    |void*  |ptr_table_fetch|NN PTR_TBL_t *tbl|NULLOK const void *sv
@@ -1558,7 +1560,7 @@
 s      |int    |sv_2iuv_non_preserve   |NN SV *const sv
 #    endif
 #  endif
-sR     |I32    |expect_number  |NN char** pattern
+sR     |I32    |expect_number  |NN char **const pattern
 #
 sn     |STRLEN |sv_pos_u2b_forwards|NN const U8 *const start \
                |NN const U8 *const send|STRLEN uoffset
@@ -1571,7 +1573,7 @@
                |const STRLEN byte|const STRLEN utf8|const STRLEN blen
 s      |STRLEN |sv_pos_b2u_midway|NN const U8 *const s|NN const U8 *const 
target \
                |NN const U8 *end|STRLEN endu
-sn     |char * |F0convert      |NV nv|NN char *endbuf|NN STRLEN *len
+sn     |char * |F0convert      |NV nv|NN char *const endbuf|NN STRLEN *const 
len
 #  if defined(PERL_OLD_COPY_ON_WRITE)
 sM     |void   |sv_release_COW |NN SV *sv|NN const char *pvx|NN SV *after
 #  endif

==== //depot/perl/pod/perlapi.pod#329 (text+w) ====
Index: perl/pod/perlapi.pod
--- perl/pod/perlapi.pod#328~33489~     2008-03-12 03:19:06.000000000 -0700
+++ perl/pod/perlapi.pod        2008-03-13 07:35:58.000000000 -0700
@@ -5488,7 +5488,7 @@
 C<sv_catpvf_mg>. If the original SV was UTF-8, the pattern should be
 valid UTF-8; if the original SV was bytes, the pattern should be too.
 
-       void    sv_catpvf(SV* sv, const char* pat, ...)
+       void    sv_catpvf(SV *const sv, const char *const pat, ...)
 
 =for hackers
 Found in file sv.c
@@ -5498,7 +5498,7 @@
 
 Like C<sv_catpvf>, but also handles 'set' magic.
 
-       void    sv_catpvf_mg(SV *sv, const char* pat, ...)
+       void    sv_catpvf_mg(SV *const sv, const char *const pat, ...)
 
 =for hackers
 Found in file sv.c
@@ -6476,7 +6476,7 @@
 
 Usually used via its frontend C<sv_catpvf>.
 
-       void    sv_vcatpvf(SV* sv, const char* pat, va_list* args)
+       void    sv_vcatpvf(SV *const sv, const char *const pat, va_list *const 
args)
 
 =for hackers
 Found in file sv.c
@@ -6492,7 +6492,7 @@
 
 Usually used via one of its frontends C<sv_vcatpvf> and C<sv_vcatpvf_mg>.
 
-       void    sv_vcatpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* 
args, SV** svargs, I32 svmax, bool *maybe_tainted)
+       void    sv_vcatpvfn(SV *const sv, const char *const pat, const STRLEN 
patlen, va_list *const args, SV **const svargs, const I32 svmax, bool *const 
maybe_tainted)
 
 =for hackers
 Found in file sv.c
@@ -6504,7 +6504,7 @@
 
 Usually used via its frontend C<sv_catpvf_mg>.
 
-       void    sv_vcatpvf_mg(SV* sv, const char* pat, va_list* args)
+       void    sv_vcatpvf_mg(SV *const sv, const char *const pat, va_list 
*const args)
 
 =for hackers
 Found in file sv.c
@@ -6530,7 +6530,7 @@
 
 Usually used via one of its frontends C<sv_vsetpvf> and C<sv_vsetpvf_mg>.
 
-       void    sv_vsetpvfn(SV* sv, const char* pat, STRLEN patlen, va_list* 
args, SV** svargs, I32 svmax, bool *maybe_tainted)
+       void    sv_vsetpvfn(SV *const sv, const char *const pat, const STRLEN 
patlen, va_list *const args, SV **const svargs, const I32 svmax, bool *const 
maybe_tainted)
 
 =for hackers
 Found in file sv.c

==== //depot/perl/proto.h#938 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#937~33489~     2008-03-12 03:19:06.000000000 -0700
+++ perl/proto.h        2008-03-13 07:35:58.000000000 -0700
@@ -3075,14 +3075,14 @@
 #define PERL_ARGS_ASSERT_SV_BLESS      \
        assert(sv); assert(stash)
 
-PERL_CALLCONV void     Perl_sv_catpvf(pTHX_ SV* sv, const char* pat, ...)
+PERL_CALLCONV void     Perl_sv_catpvf(pTHX_ SV *const sv, const char *const 
pat, ...)
                        __attribute__format__(__printf__,pTHX_2,pTHX_3)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_SV_CATPVF     \
        assert(sv); assert(pat)
 
-PERL_CALLCONV void     Perl_sv_vcatpvf(pTHX_ SV* sv, const char* pat, va_list* 
args)
+PERL_CALLCONV void     Perl_sv_vcatpvf(pTHX_ SV *const sv, const char *const 
pat, va_list *const args)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_SV_VCATPVF    \
@@ -3390,13 +3390,13 @@
 #define PERL_ARGS_ASSERT_SV_USEPVN_FLAGS       \
        assert(sv)
 
-PERL_CALLCONV void     Perl_sv_vcatpvfn(pTHX_ SV* sv, const char* pat, STRLEN 
patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted)
+PERL_CALLCONV void     Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const 
pat, const STRLEN patlen, va_list *const args, SV **const svargs, const I32 
svmax, bool *const maybe_tainted)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_SV_VCATPVFN   \
        assert(sv); assert(pat)
 
-PERL_CALLCONV void     Perl_sv_vsetpvfn(pTHX_ SV* sv, const char* pat, STRLEN 
patlen, va_list* args, SV** svargs, I32 svmax, bool *maybe_tainted)
+PERL_CALLCONV void     Perl_sv_vsetpvfn(pTHX_ SV *const sv, const char *const 
pat, const STRLEN patlen, va_list *const args, SV **const svargs, const I32 
svmax, bool *const maybe_tainted)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_SV_VSETPVFN   \
@@ -3742,14 +3742,14 @@
 #endif
 PERL_CALLCONV int      Perl_runops_standard(pTHX);
 PERL_CALLCONV int      Perl_runops_debug(pTHX);
-PERL_CALLCONV void     Perl_sv_catpvf_mg(pTHX_ SV *sv, const char* pat, ...)
+PERL_CALLCONV void     Perl_sv_catpvf_mg(pTHX_ SV *const sv, const char *const 
pat, ...)
                        __attribute__format__(__printf__,pTHX_2,pTHX_3)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_SV_CATPVF_MG  \
        assert(sv); assert(pat)
 
-PERL_CALLCONV void     Perl_sv_vcatpvf_mg(pTHX_ SV* sv, const char* pat, 
va_list* args)
+PERL_CALLCONV void     Perl_sv_vcatpvf_mg(pTHX_ SV *const sv, const char 
*const pat, va_list *const args)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_SV_VCATPVF_MG \
@@ -4041,21 +4041,21 @@
 #define PERL_ARGS_ASSERT_RE_DUP_GUTS   \
        assert(sstr); assert(dstr); assert(param)
 
-PERL_CALLCONV PerlIO*  Perl_fp_dup(pTHX_ PerlIO* fp, char type, CLONE_PARAMS* 
param)
+PERL_CALLCONV PerlIO*  Perl_fp_dup(pTHX_ PerlIO *const fp, const char type, 
CLONE_PARAMS *const param)
                        __attribute__nonnull__(pTHX_3);
 #define PERL_ARGS_ASSERT_FP_DUP        \
        assert(param)
 
-PERL_CALLCONV DIR*     Perl_dirp_dup(pTHX_ DIR* dp)
+PERL_CALLCONV DIR*     Perl_dirp_dup(pTHX_ DIR *const dp)
                        __attribute__warn_unused_result__;
 
-PERL_CALLCONV GP*      Perl_gp_dup(pTHX_ GP* gp, CLONE_PARAMS* param)
+PERL_CALLCONV GP*      Perl_gp_dup(pTHX_ GP *const gp, CLONE_PARAMS *const 
param)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_GP_DUP        \
        assert(param)
 
-PERL_CALLCONV MAGIC*   Perl_mg_dup(pTHX_ MAGIC* mg, CLONE_PARAMS* param)
+PERL_CALLCONV MAGIC*   Perl_mg_dup(pTHX_ MAGIC *const mg, CLONE_PARAMS *const 
param)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_MG_DUP        \
@@ -4074,7 +4074,7 @@
 #define PERL_ARGS_ASSERT_RVPV_DUP      \
        assert(dstr); assert(sstr); assert(param)
 
-PERL_CALLCONV yy_parser*       Perl_parser_dup(pTHX_ const yy_parser *proto, 
CLONE_PARAMS* param)
+PERL_CALLCONV yy_parser*       Perl_parser_dup(pTHX_ const yy_parser *const 
proto, CLONE_PARAMS *const param)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_PARSER_DUP    \
        assert(param)
@@ -5541,7 +5541,7 @@
 
 #    endif
 #  endif
-STATIC I32     S_expect_number(pTHX_ char** pattern)
+STATIC I32     S_expect_number(pTHX_ char **const pattern)
                        __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_EXPECT_NUMBER \
@@ -5581,7 +5581,7 @@
 #define PERL_ARGS_ASSERT_SV_POS_B2U_MIDWAY     \
        assert(s); assert(target); assert(end)
 
-STATIC char *  S_F0convert(NV nv, char *endbuf, STRLEN *len)
+STATIC char *  S_F0convert(NV nv, char *const endbuf, STRLEN *const len)
                        __attribute__nonnull__(2)
                        __attribute__nonnull__(3);
 #define PERL_ARGS_ASSERT_F0CONVERT     \

==== //depot/perl/sv.c#1523 (text) ====
Index: perl/sv.c
--- perl/sv.c#1522~33489~       2008-03-12 03:19:06.000000000 -0700
+++ perl/sv.c   2008-03-13 07:35:58.000000000 -0700
@@ -8725,7 +8725,7 @@
 =cut */
 
 void
-Perl_sv_catpvf(pTHX_ SV *sv, const char* pat, ...)
+Perl_sv_catpvf(pTHX_ SV *const sv, const char *const pat, ...)
 {
     va_list args;
 
@@ -8748,7 +8748,7 @@
 */
 
 void
-Perl_sv_vcatpvf(pTHX_ SV *sv, const char* pat, va_list* args)
+Perl_sv_vcatpvf(pTHX_ SV *const sv, const char *const pat, va_list *const args)
 {
     PERL_ARGS_ASSERT_SV_VCATPVF;
 
@@ -8764,7 +8764,7 @@
 */
 
 void
-Perl_sv_catpvf_mg(pTHX_ SV *sv, const char* pat, ...)
+Perl_sv_catpvf_mg(pTHX_ SV *const sv, const char *const pat, ...)
 {
     va_list args;
 
@@ -8786,7 +8786,7 @@
 */
 
 void
-Perl_sv_vcatpvf_mg(pTHX_ SV *sv, const char* pat, va_list* args)
+Perl_sv_vcatpvf_mg(pTHX_ SV *const sv, const char *const pat, va_list *const 
args)
 {
     PERL_ARGS_ASSERT_SV_VCATPVF_MG;
 
@@ -8806,7 +8806,8 @@
 */
 
 void
-Perl_sv_vsetpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, 
SV **svargs, I32 svmax, bool *maybe_tainted)
+Perl_sv_vsetpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN 
patlen,
+                 va_list *const args, SV **const svargs, const I32 svmax, bool 
*const maybe_tainted)
 {
     PERL_ARGS_ASSERT_SV_VSETPVFN;
 
@@ -8815,7 +8816,7 @@
 }
 
 STATIC I32
-S_expect_number(pTHX_ char** pattern)
+S_expect_number(pTHX_ char **const pattern)
 {
     dVAR;
     I32 var = 0;
@@ -8838,7 +8839,7 @@
 }
 
 STATIC char *
-S_F0convert(NV nv, char *endbuf, STRLEN *len)
+S_F0convert(NV nv, char *const endbuf, STRLEN *const len)
 {
     const int neg = nv < 0;
     UV uv;
@@ -8888,7 +8889,8 @@
 /* XXX maybe_tainted is never assigned to, so the doc above is lying. */
 
 void
-Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, 
SV **svargs, I32 svmax, bool *maybe_tainted)
+Perl_sv_vcatpvfn(pTHX_ SV *const sv, const char *const pat, const STRLEN 
patlen,
+                 va_list *const args, SV **const svargs, const I32 svmax, bool 
*const maybe_tainted)
 {
     dVAR;
     char *p;
@@ -9997,7 +9999,7 @@
 /* clone a parser */
 
 yy_parser *
-Perl_parser_dup(pTHX_ const yy_parser *proto, CLONE_PARAMS* param)
+Perl_parser_dup(pTHX_ const yy_parser *const proto, CLONE_PARAMS *const param)
 {
     yy_parser *parser;
 
@@ -10140,7 +10142,7 @@
 /* duplicate a directory handle */
 
 DIR *
-Perl_dirp_dup(pTHX_ DIR *dp)
+Perl_dirp_dup(pTHX_ DIR *const dp)
 {
     PERL_UNUSED_CONTEXT;
     if (!dp)
@@ -10152,7 +10154,7 @@
 /* duplicate a typeglob */
 
 GP *
-Perl_gp_dup(pTHX_ GP *gp, CLONE_PARAMS* param)
+Perl_gp_dup(pTHX_ GP *const gp, CLONE_PARAMS *const param)
 {
     GP *ret;
 
@@ -10187,7 +10189,7 @@
 /* duplicate a chain of magic */
 
 MAGIC *
-Perl_mg_dup(pTHX_ MAGIC *mg, CLONE_PARAMS* param)
+Perl_mg_dup(pTHX_ MAGIC *const mg, CLONE_PARAMS *const param)
 {
     MAGIC *mgprev = (MAGIC*)NULL;
     MAGIC *mgret;
End of Patch.

Reply via email to