Change 33473 by [EMAIL PROTECTED] on 2008/03/11 16:38:16
Subject: Re: [PATCH] sv.c: consting
From: Steven Schubiger <[EMAIL PROTECTED]>
Date: Tue, 11 Mar 2008 11:49:30 +0100
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/embed.fnc#601 edit
... //depot/perl/pod/perlapi.pod#327 edit
... //depot/perl/proto.h#936 edit
... //depot/perl/sv.c#1521 edit
Differences ...
==== //depot/perl/embed.fnc#601 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#600~33471~ 2008-03-11 03:06:19.000000000 -0700
+++ perl/embed.fnc 2008-03-11 09:38:16.000000000 -0700
@@ -610,7 +610,7 @@
Apda |SV* |newSVpvn_share |NULLOK const char* s|I32 len|U32 hash
Afpda |SV* |newSVpvf |NN const char *const pat|...
Apa |SV* |vnewSVpvf |NN const char *const pat|NULLOK va_list *const
args
-Apd |SV* |newSVrv |NN SV* rv|NULLOK const char* classname
+Apd |SV* |newSVrv |NN SV *const rv|NULLOK const char *const
classname
Apda |SV* |newSVsv |NULLOK SV *const old
Apda |SV* |newSV_type |const svtype type
Apa |OP* |newUNOP |I32 type|I32 flags|NULLOK OP* first
@@ -852,7 +852,7 @@
Apd |I32 |sv_true |NULLOK SV *const sv
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* sv|NN HV* stash
+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
Apd |void |sv_catpv |NN SV *const sv|NULLOK const char* ptr
@@ -883,7 +883,7 @@
Apd |void |sv_inc |NULLOK SV *const sv
Apd |void |sv_insert |NN SV *const bigstr|const STRLEN offset|const
STRLEN len \
|NN const char *const little|const STRLEN
littlelen
-Apd |int |sv_isa |NULLOK SV* sv|NN const char* name
+Apd |int |sv_isa |NULLOK SV* sv|NN const char *const name
Apd |int |sv_isobject |NULLOK SV* sv
Apd |STRLEN |sv_len |NULLOK SV *const sv
Apd |STRLEN |sv_len_utf8 |NULLOK SV *const sv
@@ -899,12 +899,12 @@
Apd |void |sv_pos_u2b |NULLOK SV *const sv|NN I32 *const
offsetp|NULLOK I32 *const lenp
Apd |void |sv_pos_b2u |NULLOK SV *const sv|NN I32 *const offsetp
Amdb |char* |sv_pvn_force |NN SV* sv|NULLOK STRLEN* lp
-Apd |char* |sv_pvutf8n_force|NN SV* sv|NULLOK STRLEN* lp
-Apd |char* |sv_pvbyten_force|NN SV* sv|NULLOK STRLEN* lp
+Apd |char* |sv_pvutf8n_force|NN SV *const sv|NULLOK STRLEN *const lp
+Apd |char* |sv_pvbyten_force|NN SV *const sv|NULLOK STRLEN *const lp
Apd |char* |sv_recode_to_utf8 |NN SV* sv|NN SV *encoding
Apd |bool |sv_cat_decode |NN SV* dsv|NN SV *encoding|NN SV *ssv|NN int
*offset \
|NN char* tstr|int tlen
-ApdR |const char* |sv_reftype |NN const SV* sv|int ob
+ApdR |const char* |sv_reftype |NN const SV *const sv|const int ob
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
@@ -914,11 +914,13 @@
Apdb |void |sv_setpviv |NN SV* sv|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* rv|NULLOK const char* classname|IV iv
-Apd |SV* |sv_setref_uv |NN SV* rv|NULLOK const char* classname|UV uv
-Apd |SV* |sv_setref_nv |NN SV* rv|NULLOK const char* classname|NV nv
-Apd |SV* |sv_setref_pv |NN SV* rv|NULLOK const char* classname|NULLOK
void* pv
-Apd |SV* |sv_setref_pvn |NN SV* rv|NULLOK const char* classname|NN
const char* pv|STRLEN n
+Apd |SV* |sv_setref_iv |NN SV *const rv|NULLOK const char *const
classname|const IV iv
+Apd |SV* |sv_setref_uv |NN SV *const rv|NULLOK const char *const
classname|const UV uv
+Apd |SV* |sv_setref_nv |NN SV *const rv|NULLOK const char *const
classname|const NV nv
+Apd |SV* |sv_setref_pv |NN SV *const rv|NULLOK const char *const
classname \
+ |NULLOK void *const pv
+Apd |SV* |sv_setref_pvn |NN SV *const rv|NULLOK const char *const
classname \
+ |NN const char *const pv|const STRLEN n
Apd |void |sv_setpv |NN SV *const sv|NULLOK const char *const ptr
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
@@ -1673,7 +1675,7 @@
|const I32 flags
Apd |void |sv_catsv_flags |NN SV *const dsv|NULLOK SV *const ssv|const
I32 flags
Apd |STRLEN |sv_utf8_upgrade_flags|NN SV *const sv|const I32 flags
-Apd |char* |sv_pvn_force_flags|NN SV* sv|NULLOK STRLEN* lp|I32 flags
+Apd |char* |sv_pvn_force_flags|NN SV *const sv|NULLOK STRLEN *const
lp|const I32 flags
Apd |void |sv_copypv |NN SV *const dsv|NN SV *const ssv
Ap |char* |my_atof2 |NN const char *s|NN NV* value
Apn |int |my_socketpair |int family|int type|int protocol|int fd[2]
==== //depot/perl/pod/perlapi.pod#327 (text+w) ====
Index: perl/pod/perlapi.pod
--- perl/pod/perlapi.pod#326~33471~ 2008-03-11 03:06:19.000000000 -0700
+++ perl/pod/perlapi.pod 2008-03-11 09:38:16.000000000 -0700
@@ -5278,7 +5278,7 @@
be blessed in the specified package. The new SV is returned and its
reference count is 1.
- SV* newSVrv(SV* rv, const char* classname)
+ SV* newSVrv(SV *const rv, const char *const classname)
=for hackers
Found in file sv.c
@@ -5460,7 +5460,7 @@
must be designated by its stash (see C<gv_stashpv()>). The reference count
of the SV is unaffected.
- SV* sv_bless(SV* sv, HV* stash)
+ SV* sv_bless(SV *const sv, HV *const stash)
=for hackers
Found in file sv.c
@@ -5769,7 +5769,7 @@
class. This does not check for subtypes; use C<sv_derived_from> to verify
an inheritance relationship.
- int sv_isa(SV* sv, const char* name)
+ int sv_isa(SV* sv, const char *const name)
=for hackers
Found in file sv.c
@@ -5915,7 +5915,7 @@
The backend for the C<SvPVbytex_force> macro. Always use the macro instead.
- char* sv_pvbyten_force(SV* sv, STRLEN* lp)
+ char* sv_pvbyten_force(SV *const sv, STRLEN *const lp)
=for hackers
Found in file sv.c
@@ -5942,7 +5942,7 @@
You normally want to use the various wrapper macros instead: see
C<SvPV_force> and C<SvPV_force_nomg>
- char* sv_pvn_force_flags(SV* sv, STRLEN* lp, I32 flags)
+ char* sv_pvn_force_flags(SV *const sv, STRLEN *const lp, const I32
flags)
=for hackers
Found in file sv.c
@@ -5952,7 +5952,7 @@
The backend for the C<SvPVutf8x_force> macro. Always use the macro instead.
- char* sv_pvutf8n_force(SV* sv, STRLEN* lp)
+ char* sv_pvutf8n_force(SV *const sv, STRLEN *const lp)
=for hackers
Found in file sv.c
@@ -5962,7 +5962,7 @@
Returns a string describing what the SV is a reference to.
- const char* sv_reftype(const SV* sv, int ob)
+ const char* sv_reftype(const SV *const sv, const int ob)
=for hackers
Found in file sv.c
@@ -6153,7 +6153,7 @@
blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
- SV* sv_setref_iv(SV* rv, const char* classname, IV iv)
+ SV* sv_setref_iv(SV *const rv, const char *const classname, const
IV iv)
=for hackers
Found in file sv.c
@@ -6167,7 +6167,7 @@
blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
- SV* sv_setref_nv(SV* rv, const char* classname, NV nv)
+ SV* sv_setref_nv(SV *const rv, const char *const classname, const
NV nv)
=for hackers
Found in file sv.c
@@ -6187,7 +6187,7 @@
Note that C<sv_setref_pvn> copies the string while this copies the pointer.
- SV* sv_setref_pv(SV* rv, const char* classname, void* pv)
+ SV* sv_setref_pv(SV *const rv, const char *const classname, void
*const pv)
=for hackers
Found in file sv.c
@@ -6204,7 +6204,7 @@
Note that C<sv_setref_pv> copies the pointer while this copies the string.
- SV* sv_setref_pvn(SV* rv, const char* classname, const char* pv,
STRLEN n)
+ SV* sv_setref_pvn(SV *const rv, const char *const classname, const
char *const pv, const STRLEN n)
=for hackers
Found in file sv.c
@@ -6218,7 +6218,7 @@
blessing. Set C<classname> to C<NULL> to avoid the blessing. The new SV
will have a reference count of 1, and the RV will be returned.
- SV* sv_setref_uv(SV* rv, const char* classname, UV uv)
+ SV* sv_setref_uv(SV *const rv, const char *const classname, const
UV uv)
=for hackers
Found in file sv.c
==== //depot/perl/proto.h#936 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#935~33471~ 2008-03-11 03:06:19.000000000 -0700
+++ perl/proto.h 2008-03-11 09:38:16.000000000 -0700
@@ -2221,7 +2221,7 @@
#define PERL_ARGS_ASSERT_VNEWSVPVF \
assert(pat)
-PERL_CALLCONV SV* Perl_newSVrv(pTHX_ SV* rv, const char* classname)
+PERL_CALLCONV SV* Perl_newSVrv(pTHX_ SV *const rv, const char *const
classname)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_NEWSVRV \
assert(rv)
@@ -3069,7 +3069,7 @@
#define PERL_ARGS_ASSERT_SV_BACKOFF \
assert(sv)
-PERL_CALLCONV SV* Perl_sv_bless(pTHX_ SV* sv, HV* stash)
+PERL_CALLCONV SV* Perl_sv_bless(pTHX_ SV *const sv, HV *const stash)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);
#define PERL_ARGS_ASSERT_SV_BLESS \
@@ -3185,7 +3185,7 @@
#define PERL_ARGS_ASSERT_SV_INSERT \
assert(bigstr); assert(little)
-PERL_CALLCONV int Perl_sv_isa(pTHX_ SV* sv, const char* name)
+PERL_CALLCONV int Perl_sv_isa(pTHX_ SV* sv, const char *const name)
__attribute__nonnull__(pTHX_2);
#define PERL_ARGS_ASSERT_SV_ISA \
assert(name)
@@ -3227,12 +3227,12 @@
#define PERL_ARGS_ASSERT_SV_PVN_FORCE \
assert(sv)
-PERL_CALLCONV char* Perl_sv_pvutf8n_force(pTHX_ SV* sv, STRLEN* lp)
+PERL_CALLCONV char* Perl_sv_pvutf8n_force(pTHX_ SV *const sv, STRLEN *const
lp)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_PVUTF8N_FORCE \
assert(sv)
-PERL_CALLCONV char* Perl_sv_pvbyten_force(pTHX_ SV* sv, STRLEN* lp)
+PERL_CALLCONV char* Perl_sv_pvbyten_force(pTHX_ SV *const sv, STRLEN *const
lp)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_PVBYTEN_FORCE \
assert(sv)
@@ -3252,7 +3252,7 @@
#define PERL_ARGS_ASSERT_SV_CAT_DECODE \
assert(dsv); assert(encoding); assert(ssv); assert(offset); assert(tstr)
-PERL_CALLCONV const char* Perl_sv_reftype(pTHX_ const SV* sv, int ob)
+PERL_CALLCONV const char* Perl_sv_reftype(pTHX_ const SV *const sv, const
int ob)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_REFTYPE \
@@ -3303,27 +3303,27 @@
#define PERL_ARGS_ASSERT_SV_SETNV \
assert(sv)
-PERL_CALLCONV SV* Perl_sv_setref_iv(pTHX_ SV* rv, const char* classname,
IV iv)
+PERL_CALLCONV SV* Perl_sv_setref_iv(pTHX_ SV *const rv, const char *const
classname, const IV iv)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_SETREF_IV \
assert(rv)
-PERL_CALLCONV SV* Perl_sv_setref_uv(pTHX_ SV* rv, const char* classname,
UV uv)
+PERL_CALLCONV SV* Perl_sv_setref_uv(pTHX_ SV *const rv, const char *const
classname, const UV uv)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_SETREF_UV \
assert(rv)
-PERL_CALLCONV SV* Perl_sv_setref_nv(pTHX_ SV* rv, const char* classname,
NV nv)
+PERL_CALLCONV SV* Perl_sv_setref_nv(pTHX_ SV *const rv, const char *const
classname, const NV nv)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_SETREF_NV \
assert(rv)
-PERL_CALLCONV SV* Perl_sv_setref_pv(pTHX_ SV* rv, const char* classname,
void* pv)
+PERL_CALLCONV SV* Perl_sv_setref_pv(pTHX_ SV *const rv, const char *const
classname, void *const pv)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_SETREF_PV \
assert(rv)
-PERL_CALLCONV SV* Perl_sv_setref_pvn(pTHX_ SV* rv, const char* classname,
const char* pv, STRLEN n)
+PERL_CALLCONV SV* Perl_sv_setref_pvn(pTHX_ SV *const rv, const char
*const classname, const char *const pv, const STRLEN n)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_3);
#define PERL_ARGS_ASSERT_SV_SETREF_PVN \
@@ -5902,7 +5902,7 @@
#define PERL_ARGS_ASSERT_SV_UTF8_UPGRADE_FLAGS \
assert(sv)
-PERL_CALLCONV char* Perl_sv_pvn_force_flags(pTHX_ SV* sv, STRLEN* lp, I32
flags)
+PERL_CALLCONV char* Perl_sv_pvn_force_flags(pTHX_ SV *const sv, STRLEN
*const lp, const I32 flags)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_PVN_FORCE_FLAGS \
assert(sv)
==== //depot/perl/sv.c#1521 (text) ====
Index: perl/sv.c
--- perl/sv.c#1520~33471~ 2008-03-11 03:06:19.000000000 -0700
+++ perl/sv.c 2008-03-11 09:38:16.000000000 -0700
@@ -7972,7 +7972,7 @@
*/
char *
-Perl_sv_pvn_force_flags(pTHX_ SV *sv, STRLEN *lp, I32 flags)
+Perl_sv_pvn_force_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags)
{
dVAR;
@@ -8033,7 +8033,7 @@
*/
char *
-Perl_sv_pvbyten_force(pTHX_ SV *sv, STRLEN *lp)
+Perl_sv_pvbyten_force(pTHX_ SV *const sv, STRLEN *const lp)
{
PERL_ARGS_ASSERT_SV_PVBYTEN_FORCE;
@@ -8052,7 +8052,7 @@
*/
char *
-Perl_sv_pvutf8n_force(pTHX_ SV *sv, STRLEN *lp)
+Perl_sv_pvutf8n_force(pTHX_ SV *const sv, STRLEN *const lp)
{
PERL_ARGS_ASSERT_SV_PVUTF8N_FORCE;
@@ -8071,7 +8071,7 @@
*/
const char *
-Perl_sv_reftype(pTHX_ const SV *sv, int ob)
+Perl_sv_reftype(pTHX_ const SV *const sv, const int ob)
{
PERL_ARGS_ASSERT_SV_REFTYPE;
@@ -8150,7 +8150,7 @@
*/
int
-Perl_sv_isa(pTHX_ SV *sv, const char *name)
+Perl_sv_isa(pTHX_ SV *sv, const char *const name)
{
const char *hvname;
@@ -8183,7 +8183,7 @@
*/
SV*
-Perl_newSVrv(pTHX_ SV *rv, const char *classname)
+Perl_newSVrv(pTHX_ SV *const rv, const char *const classname)
{
dVAR;
SV *sv;
@@ -8239,7 +8239,7 @@
*/
SV*
-Perl_sv_setref_pv(pTHX_ SV *rv, const char *classname, void *pv)
+Perl_sv_setref_pv(pTHX_ SV *const rv, const char *const classname, void *const
pv)
{
dVAR;
@@ -8267,7 +8267,7 @@
*/
SV*
-Perl_sv_setref_iv(pTHX_ SV *rv, const char *classname, IV iv)
+Perl_sv_setref_iv(pTHX_ SV *const rv, const char *const classname, const IV iv)
{
PERL_ARGS_ASSERT_SV_SETREF_IV;
@@ -8288,7 +8288,7 @@
*/
SV*
-Perl_sv_setref_uv(pTHX_ SV *rv, const char *classname, UV uv)
+Perl_sv_setref_uv(pTHX_ SV *const rv, const char *const classname, const UV uv)
{
PERL_ARGS_ASSERT_SV_SETREF_UV;
@@ -8309,7 +8309,7 @@
*/
SV*
-Perl_sv_setref_nv(pTHX_ SV *rv, const char *classname, NV nv)
+Perl_sv_setref_nv(pTHX_ SV *const rv, const char *const classname, const NV nv)
{
PERL_ARGS_ASSERT_SV_SETREF_NV;
@@ -8333,7 +8333,8 @@
*/
SV*
-Perl_sv_setref_pvn(pTHX_ SV *rv, const char *classname, const char *pv, STRLEN
n)
+Perl_sv_setref_pvn(pTHX_ SV *const rv, const char *const classname,
+ const char *const pv, const STRLEN n)
{
PERL_ARGS_ASSERT_SV_SETREF_PVN;
@@ -8352,7 +8353,7 @@
*/
SV*
-Perl_sv_bless(pTHX_ SV *sv, HV *stash)
+Perl_sv_bless(pTHX_ SV *const sv, HV *const stash)
{
dVAR;
SV *tmpRef;
End of Patch.