Change 33489 by [EMAIL PROTECTED] on 2008/03/12 10:19:06
Subject: Re: [PATCH] sv.c: consting
From: Steven Schubiger <[EMAIL PROTECTED]>
Date: Tue, 11 Mar 2008 19:59:37 +0100
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/embed.fnc#602 edit
... //depot/perl/pod/perlapi.pod#328 edit
... //depot/perl/proto.h#937 edit
... //depot/perl/sv.c#1522 edit
Differences ...
==== //depot/perl/embed.fnc#602 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#601~33473~ 2008-03-11 09:38:16.000000000 -0700
+++ perl/embed.fnc 2008-03-12 03:19:06.000000000 -0700
@@ -158,10 +158,10 @@
Afnp |void |warn_nocontext |NN const char* pat|...
Afnp |void |warner_nocontext|U32 err|NN const char* pat|...
Afnp |SV* |newSVpvf_nocontext|NN const char *const pat|...
-Afnp |void |sv_catpvf_nocontext|NN SV* sv|NN const char* pat|...
-Afnp |void |sv_setpvf_nocontext|NN SV* sv|NN const char* pat|...
-Afnp |void |sv_catpvf_mg_nocontext|NN SV* sv|NN const char* pat|...
-Afnp |void |sv_setpvf_mg_nocontext|NN SV* sv|NN const char* pat|...
+Afnp |void |sv_catpvf_nocontext|NN SV *const sv|NN const char *const
pat|...
+Afnp |void |sv_setpvf_nocontext|NN SV *const sv|NN const char *const
pat|...
+Afnp |void |sv_catpvf_mg_nocontext|NN SV *const sv|NN const char *const
pat|...
+Afnp |void |sv_setpvf_mg_nocontext|NN SV *const sv|NN const char *const
pat|...
Afnp |int |fprintf_nocontext|NN PerlIO *stream|NN const char *format|...
Afnp |int |printf_nocontext|NN const char *format|...
#endif
@@ -908,10 +908,10 @@
Apd |void |sv_replace |NN SV *const sv|NN SV *const nsv
Apd |void |sv_report_used
Apd |void |sv_reset |NN const char* s|NULLOK HV *const stash
-Afpd |void |sv_setpvf |NN SV* sv|NN const char* pat|...
-Apd |void |sv_vsetpvf |NN SV* sv|NN const char* pat|NULLOK va_list*
args
+Afpd |void |sv_setpvf |NN SV *const sv|NN const char *const pat|...
+Apd |void |sv_vsetpvf |NN SV *const sv|NN const char *const
pat|NULLOK va_list *const args
Apd |void |sv_setiv |NN SV *const sv|const IV num
-Apdb |void |sv_setpviv |NN SV* sv|IV num
+Apdb |void |sv_setpviv |NN SV *const sv|const IV num
Apd |void |sv_setuv |NN SV *const sv|const UV num
Apd |void |sv_setnv |NN SV *const sv|const NV num
Apd |SV* |sv_setref_iv |NN SV *const rv|NULLOK const char *const
classname|const IV iv
@@ -925,11 +925,11 @@
Apd |void |sv_setpvn |NN SV *const sv|NULLOK const char *const
ptr|const STRLEN len
Amdb |void |sv_setsv |NN SV *dstr|NULLOK SV *sstr
Amdb |void |sv_taint |NN SV* sv
-ApdR |bool |sv_tainted |NN SV* sv
+ApdR |bool |sv_tainted |NN SV *const sv
Apd |int |sv_unmagic |NN SV *const sv|const int type
Apdmb |void |sv_unref |NN SV* sv
-Apd |void |sv_unref_flags |NN SV *ref|U32 flags
-Apd |void |sv_untaint |NN SV* sv
+Apd |void |sv_unref_flags |NN SV *const ref|const U32 flags
+Apd |void |sv_untaint |NN SV *const sv
Apd |void |sv_upgrade |NN SV *const sv|svtype new_type
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\
@@ -1037,10 +1037,11 @@
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
-Afpd |void |sv_setpvf_mg |NN SV *sv|NN const char* pat|...
-Apd |void |sv_vsetpvf_mg |NN SV* sv|NN const char* pat|NULLOK va_list*
args
+Afpd |void |sv_setpvf_mg |NN SV *const sv|NN const char *const pat|...
+Apd |void |sv_vsetpvf_mg |NN SV *const sv|NN const char *const pat \
+ |NULLOK va_list *const args
Apd |void |sv_setiv_mg |NN SV *const sv|const IV i
-Apdb |void |sv_setpviv_mg |NN SV *sv|IV iv
+Apdb |void |sv_setpviv_mg |NN SV *const sv|const IV iv
Apd |void |sv_setuv_mg |NN SV *const sv|const UV u
Apd |void |sv_setnv_mg |NN SV *const sv|const NV num
Apd |void |sv_setpv_mg |NN SV *const sv|NULLOK const char *const ptr
@@ -1541,7 +1542,7 @@
#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
nsR |char * |uiv_2buf |NN char *const buf|const IV iv|UV uv|const int
is_uv|NN char **const peob
-s |void |sv_unglob |NN SV* sv
+s |void |sv_unglob |NN SV *const sv
s |void |not_a_number |NN SV *const sv
s |I32 |visit |NN SVFUNC_t f|const U32 flags|const U32 mask
s |void |sv_del_backref |NN SV *const tsv|NN SV *const sv
==== //depot/perl/pod/perlapi.pod#328 (text+w) ====
Index: perl/pod/perlapi.pod
--- perl/pod/perlapi.pod#327~33473~ 2008-03-11 09:38:16.000000000 -0700
+++ perl/pod/perlapi.pod 2008-03-12 03:19:06.000000000 -0700
@@ -6066,7 +6066,7 @@
Works like C<sv_catpvf> but copies the text into the SV instead of
appending it. Does not handle 'set' magic. See C<sv_setpvf_mg>.
- void sv_setpvf(SV* sv, const char* pat, ...)
+ void sv_setpvf(SV *const sv, const char *const pat, ...)
=for hackers
Found in file sv.c
@@ -6076,7 +6076,7 @@
Like C<sv_setpvf>, but also handles 'set' magic.
- void sv_setpvf_mg(SV *sv, const char* pat, ...)
+ void sv_setpvf_mg(SV *const sv, const char *const pat, ...)
=for hackers
Found in file sv.c
@@ -6087,7 +6087,7 @@
Copies an integer into the given SV, also updating its string value.
Does not handle 'set' magic. See C<sv_setpviv_mg>.
- void sv_setpviv(SV* sv, IV num)
+ void sv_setpviv(SV *const sv, const IV num)
=for hackers
Found in file sv.c
@@ -6097,7 +6097,7 @@
Like C<sv_setpviv>, but also handles 'set' magic.
- void sv_setpviv_mg(SV *sv, IV iv)
+ void sv_setpviv_mg(SV *const sv, const IV iv)
=for hackers
Found in file sv.c
@@ -6301,7 +6301,7 @@
X<sv_tainted>
Test an SV for taintedness. Use C<SvTAINTED> instead.
- bool sv_tainted(SV* sv)
+ bool sv_tainted(SV *const sv)
=for hackers
Found in file sv.c
@@ -6339,7 +6339,7 @@
different from one or the reference being a readonly SV).
See C<SvROK_off>.
- void sv_unref_flags(SV *ref, U32 flags)
+ void sv_unref_flags(SV *const ref, const U32 flags)
=for hackers
Found in file sv.c
@@ -6348,7 +6348,7 @@
X<sv_untaint>
Untaint an SV. Use C<SvTAINTED_off> instead.
- void sv_untaint(SV* sv)
+ void sv_untaint(SV *const sv)
=for hackers
Found in file sv.c
@@ -6517,7 +6517,7 @@
Usually used via its frontend C<sv_setpvf>.
- void sv_vsetpvf(SV* sv, const char* pat, va_list* args)
+ void sv_vsetpvf(SV *const sv, const char *const pat, va_list *const
args)
=for hackers
Found in file sv.c
@@ -6542,7 +6542,7 @@
Usually used via its frontend C<sv_setpvf_mg>.
- void sv_vsetpvf_mg(SV* sv, const char* pat, va_list* args)
+ void sv_vsetpvf_mg(SV *const sv, const char *const pat, va_list
*const args)
=for hackers
Found in file sv.c
==== //depot/perl/proto.h#937 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#936~33473~ 2008-03-11 09:38:16.000000000 -0700
+++ perl/proto.h 2008-03-12 03:19:06.000000000 -0700
@@ -379,28 +379,28 @@
#define PERL_ARGS_ASSERT_NEWSVPVF_NOCONTEXT \
assert(pat)
-PERL_CALLCONV void Perl_sv_catpvf_nocontext(SV* sv, const char* pat, ...)
+PERL_CALLCONV void Perl_sv_catpvf_nocontext(SV *const sv, const char
*const pat, ...)
__attribute__format__(__printf__,2,3)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
#define PERL_ARGS_ASSERT_SV_CATPVF_NOCONTEXT \
assert(sv); assert(pat)
-PERL_CALLCONV void Perl_sv_setpvf_nocontext(SV* sv, const char* pat, ...)
+PERL_CALLCONV void Perl_sv_setpvf_nocontext(SV *const sv, const char
*const pat, ...)
__attribute__format__(__printf__,2,3)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
#define PERL_ARGS_ASSERT_SV_SETPVF_NOCONTEXT \
assert(sv); assert(pat)
-PERL_CALLCONV void Perl_sv_catpvf_mg_nocontext(SV* sv, const char* pat,
...)
+PERL_CALLCONV void Perl_sv_catpvf_mg_nocontext(SV *const sv, const char
*const pat, ...)
__attribute__format__(__printf__,2,3)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
#define PERL_ARGS_ASSERT_SV_CATPVF_MG_NOCONTEXT \
assert(sv); assert(pat)
-PERL_CALLCONV void Perl_sv_setpvf_mg_nocontext(SV* sv, const char* pat,
...)
+PERL_CALLCONV void Perl_sv_setpvf_mg_nocontext(SV *const sv, const char
*const pat, ...)
__attribute__format__(__printf__,2,3)
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -3270,14 +3270,14 @@
#define PERL_ARGS_ASSERT_SV_RESET \
assert(s)
-PERL_CALLCONV void Perl_sv_setpvf(pTHX_ SV* sv, const char* pat, ...)
+PERL_CALLCONV void Perl_sv_setpvf(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_SETPVF \
assert(sv); assert(pat)
-PERL_CALLCONV void Perl_sv_vsetpvf(pTHX_ SV* sv, const char* pat, va_list*
args)
+PERL_CALLCONV void Perl_sv_vsetpvf(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_VSETPVF \
@@ -3288,7 +3288,7 @@
#define PERL_ARGS_ASSERT_SV_SETIV \
assert(sv)
-PERL_CALLCONV void Perl_sv_setpviv(pTHX_ SV* sv, IV num)
+PERL_CALLCONV void Perl_sv_setpviv(pTHX_ SV *const sv, const IV num)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_SETPVIV \
assert(sv)
@@ -3349,7 +3349,7 @@
#define PERL_ARGS_ASSERT_SV_TAINT \
assert(sv)
-PERL_CALLCONV bool Perl_sv_tainted(pTHX_ SV* sv)
+PERL_CALLCONV bool Perl_sv_tainted(pTHX_ SV *const sv)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_TAINTED \
@@ -3365,12 +3365,12 @@
#define PERL_ARGS_ASSERT_SV_UNREF \
assert(sv)
-PERL_CALLCONV void Perl_sv_unref_flags(pTHX_ SV *ref, U32 flags)
+PERL_CALLCONV void Perl_sv_unref_flags(pTHX_ SV *const ref, const U32
flags)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_UNREF_FLAGS \
assert(ref)
-PERL_CALLCONV void Perl_sv_untaint(pTHX_ SV* sv)
+PERL_CALLCONV void Perl_sv_untaint(pTHX_ SV *const sv)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_UNTAINT \
assert(sv)
@@ -3771,14 +3771,14 @@
#define PERL_ARGS_ASSERT_SV_CATSV_MG \
assert(dsv)
-PERL_CALLCONV void Perl_sv_setpvf_mg(pTHX_ SV *sv, const char* pat, ...)
+PERL_CALLCONV void Perl_sv_setpvf_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_SETPVF_MG \
assert(sv); assert(pat)
-PERL_CALLCONV void Perl_sv_vsetpvf_mg(pTHX_ SV* sv, const char* pat,
va_list* args)
+PERL_CALLCONV void Perl_sv_vsetpvf_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_VSETPVF_MG \
@@ -3789,7 +3789,7 @@
#define PERL_ARGS_ASSERT_SV_SETIV_MG \
assert(sv)
-PERL_CALLCONV void Perl_sv_setpviv_mg(pTHX_ SV *sv, IV iv)
+PERL_CALLCONV void Perl_sv_setpviv_mg(pTHX_ SV *const sv, const IV iv)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_SETPVIV_MG \
assert(sv)
@@ -5495,7 +5495,7 @@
#define PERL_ARGS_ASSERT_UIV_2BUF \
assert(buf); assert(peob)
-STATIC void S_sv_unglob(pTHX_ SV* sv)
+STATIC void S_sv_unglob(pTHX_ SV *const sv)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_UNGLOB \
assert(sv)
==== //depot/perl/sv.c#1522 (text) ====
Index: perl/sv.c
--- perl/sv.c#1521~33473~ 2008-03-11 09:38:16.000000000 -0700
+++ perl/sv.c 2008-03-12 03:19:06.000000000 -0700
@@ -8398,7 +8398,7 @@
*/
STATIC void
-S_sv_unglob(pTHX_ SV *sv)
+S_sv_unglob(pTHX_ SV *const sv)
{
dVAR;
void *xpvmg;
@@ -8455,7 +8455,7 @@
*/
void
-Perl_sv_unref_flags(pTHX_ SV *ref, U32 flags)
+Perl_sv_unref_flags(pTHX_ SV *const ref, const U32 flags)
{
SV* const target = SvRV(ref);
@@ -8485,7 +8485,7 @@
*/
void
-Perl_sv_untaint(pTHX_ SV *sv)
+Perl_sv_untaint(pTHX_ SV *const sv)
{
PERL_ARGS_ASSERT_SV_UNTAINT;
@@ -8504,7 +8504,7 @@
*/
bool
-Perl_sv_tainted(pTHX_ SV *sv)
+Perl_sv_tainted(pTHX_ SV *const sv)
{
PERL_ARGS_ASSERT_SV_TAINTED;
@@ -8526,7 +8526,7 @@
*/
void
-Perl_sv_setpviv(pTHX_ SV *sv, IV iv)
+Perl_sv_setpviv(pTHX_ SV *const sv, const IV iv)
{
char buf[TYPE_CHARS(UV)];
char *ebuf;
@@ -8546,7 +8546,7 @@
*/
void
-Perl_sv_setpviv_mg(pTHX_ SV *sv, IV iv)
+Perl_sv_setpviv_mg(pTHX_ SV *const sv, const IV iv)
{
PERL_ARGS_ASSERT_SV_SETPVIV_MG;
@@ -8562,7 +8562,7 @@
*/
void
-Perl_sv_setpvf_nocontext(SV *sv, const char* pat, ...)
+Perl_sv_setpvf_nocontext(SV *const sv, const char *const pat, ...)
{
dTHX;
va_list args;
@@ -8580,7 +8580,7 @@
*/
void
-Perl_sv_setpvf_mg_nocontext(SV *sv, const char* pat, ...)
+Perl_sv_setpvf_mg_nocontext(SV *const sv, const char *const pat, ...)
{
dTHX;
va_list args;
@@ -8603,7 +8603,7 @@
*/
void
-Perl_sv_setpvf(pTHX_ SV *sv, const char* pat, ...)
+Perl_sv_setpvf(pTHX_ SV *const sv, const char *const pat, ...)
{
va_list args;
@@ -8626,7 +8626,7 @@
*/
void
-Perl_sv_vsetpvf(pTHX_ SV *sv, const char* pat, va_list* args)
+Perl_sv_vsetpvf(pTHX_ SV *const sv, const char *const pat, va_list *const args)
{
PERL_ARGS_ASSERT_SV_VSETPVF;
@@ -8642,7 +8642,7 @@
*/
void
-Perl_sv_setpvf_mg(pTHX_ SV *sv, const char* pat, ...)
+Perl_sv_setpvf_mg(pTHX_ SV *const sv, const char *const pat, ...)
{
va_list args;
@@ -8664,7 +8664,7 @@
*/
void
-Perl_sv_vsetpvf_mg(pTHX_ SV *sv, const char* pat, va_list* args)
+Perl_sv_vsetpvf_mg(pTHX_ SV *const sv, const char *const pat, va_list *const
args)
{
PERL_ARGS_ASSERT_SV_VSETPVF_MG;
@@ -8680,7 +8680,7 @@
*/
void
-Perl_sv_catpvf_nocontext(SV *sv, const char* pat, ...)
+Perl_sv_catpvf_nocontext(SV *const sv, const char *const pat, ...)
{
dTHX;
va_list args;
@@ -8698,7 +8698,7 @@
*/
void
-Perl_sv_catpvf_mg_nocontext(SV *sv, const char* pat, ...)
+Perl_sv_catpvf_mg_nocontext(SV *const sv, const char *const pat, ...)
{
dTHX;
va_list args;
End of Patch.