Change 33627 by [EMAIL PROTECTED] on 2008/04/01 19:59:54
Define sv_insert() as a wrapper to sv_insert_flags(), and move
Perl_sv_insert() to mathoms.c
Affected files ...
... //depot/perl/embed.fnc#608 edit
... //depot/perl/embed.h#755 edit
... //depot/perl/mathoms.c#87 edit
... //depot/perl/mg.c#524 edit
... //depot/perl/proto.h#943 edit
... //depot/perl/sv.c#1534 edit
... //depot/perl/sv.h#346 edit
Differences ...
==== //depot/perl/embed.fnc#608 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#607~33618~ 2008-03-31 12:48:26.000000000 -0700
+++ perl/embed.fnc 2008-04-01 12:59:54.000000000 -0700
@@ -882,8 +882,9 @@
Apd |char* |sv_gets |NN SV *const sv|NN PerlIO *const fp|I32 append
Apd |char* |sv_grow |NN SV *const sv|STRLEN newlen
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
+Amdb |void |sv_insert |NN SV *const bigstr|const STRLEN offset \
+ |const STRLEN len|NN const char *const little \
+ |const STRLEN littlelen
Apd |void |sv_insert_flags|NN SV *const bigstr|const STRLEN offset|const
STRLEN len \
|NN const char *const little|const STRLEN
littlelen|const U32 flags
Apd |int |sv_isa |NULLOK SV* sv|NN const char *const name
==== //depot/perl/embed.h#755 (text+w) ====
Index: perl/embed.h
--- perl/embed.h#754~33618~ 2008-03-31 12:48:26.000000000 -0700
+++ perl/embed.h 2008-04-01 12:59:54.000000000 -0700
@@ -885,7 +885,6 @@
#define sv_gets Perl_sv_gets
#define sv_grow Perl_sv_grow
#define sv_inc Perl_sv_inc
-#define sv_insert Perl_sv_insert
#define sv_insert_flags Perl_sv_insert_flags
#define sv_isa Perl_sv_isa
#define sv_isobject Perl_sv_isobject
@@ -3188,7 +3187,6 @@
#define sv_gets(a,b,c) Perl_sv_gets(aTHX_ a,b,c)
#define sv_grow(a,b) Perl_sv_grow(aTHX_ a,b)
#define sv_inc(a) Perl_sv_inc(aTHX_ a)
-#define sv_insert(a,b,c,d,e) Perl_sv_insert(aTHX_ a,b,c,d,e)
#define sv_insert_flags(a,b,c,d,e,f) Perl_sv_insert_flags(aTHX_ a,b,c,d,e,f)
#define sv_isa(a,b) Perl_sv_isa(aTHX_ a,b)
#define sv_isobject(a) Perl_sv_isobject(aTHX_ a)
==== //depot/perl/mathoms.c#87 (text) ====
Index: perl/mathoms.c
--- perl/mathoms.c#86~33291~ 2008-02-12 05:15:20.000000000 -0800
+++ perl/mathoms.c 2008-04-01 12:59:54.000000000 -0700
@@ -1461,6 +1461,14 @@
return hv;
}
+void
+Perl_sv_insert(pTHX_ SV *const bigstr, const STRLEN offset, const STRLEN len,
+ const char *const little, const STRLEN littlelen)
+{
+ PERL_ARGS_ASSERT_SV_INSERT;
+ sv_insert_flags(bigstr, offset, len, little, littlelen, SV_GMAGIC);
+}
+
#endif /* NO_MATHOMS */
/*
==== //depot/perl/mg.c#524 (text) ====
Index: perl/mg.c
--- perl/mg.c#523~33553~ 2008-03-24 13:54:41.000000000 -0700
+++ perl/mg.c 2008-04-01 12:59:54.000000000 -0700
@@ -1560,7 +1560,8 @@
* tell whether HINT_STRICT_REFS is in force or not.
*/
if (!strchr(s,':') && !strchr(s,'\''))
- Perl_sv_insert(aTHX_ sv, 0, 0, STR_WITH_LEN("main::"));
+ Perl_sv_insert_flags(aTHX_ sv, 0, 0, STR_WITH_LEN("main::"),
+ SV_GMAGIC);
if (i)
(void)rsignal(i, PL_csighandlerp);
else
==== //depot/perl/proto.h#943 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#942~33618~ 2008-03-31 12:48:26.000000000 -0700
+++ perl/proto.h 2008-04-01 12:59:54.000000000 -0700
@@ -3179,9 +3179,9 @@
assert(sv)
PERL_CALLCONV void Perl_sv_inc(pTHX_ SV *const sv);
-PERL_CALLCONV void Perl_sv_insert(pTHX_ SV *const bigstr, const STRLEN
offset, const STRLEN len, const char *const little, const STRLEN littlelen)
+/* PERL_CALLCONV void Perl_sv_insert(pTHX_ SV *const bigstr, const STRLEN
offset, const STRLEN len, const char *const little, const STRLEN littlelen)
__attribute__nonnull__(pTHX_1)
- __attribute__nonnull__(pTHX_4);
+ __attribute__nonnull__(pTHX_4); */
#define PERL_ARGS_ASSERT_SV_INSERT \
assert(bigstr); assert(little)
==== //depot/perl/sv.c#1534 (text) ====
Index: perl/sv.c
--- perl/sv.c#1533~33626~ 2008-04-01 11:47:01.000000000 -0700
+++ perl/sv.c 2008-04-01 12:59:54.000000000 -0700
@@ -5142,18 +5142,6 @@
Inserts a string at the specified offset/length within the SV. Similar to
the Perl substr() function. Handles get magic.
-=cut
-*/
-
-void
-Perl_sv_insert(pTHX_ SV *const bigstr, const STRLEN offset, const STRLEN len,
- const char *const little, const STRLEN littlelen)
-{
- PERL_ARGS_ASSERT_SV_INSERT;
- sv_insert_flags(bigstr, offset, len, little, littlelen, SV_GMAGIC);
-}
-
-/*
=for apidoc sv_insert_flags
Same as C<sv_insert>, but the extra C<flags> are passed the
C<SvPV_force_flags> that applies to C<bigstr>.
@@ -12325,8 +12313,10 @@
*SvPVX(name) = '$';
Perl_sv_catpvf(aTHX_ name, "[%"IVdf"]", (IV)aindex);
}
- else if (subscript_type == FUV_SUBSCRIPT_WITHIN)
- Perl_sv_insert(aTHX_ name, 0, 0, STR_WITH_LEN("within "));
+ else if (subscript_type == FUV_SUBSCRIPT_WITHIN) {
+ /* We know that name has no magic, so can use 0 instead of SV_GMAGIC */
+ Perl_sv_insert_flags(aTHX_ name, 0, 0, STR_WITH_LEN("within "), 0);
+ }
return name;
}
==== //depot/perl/sv.h#346 (text) ====
Index: perl/sv.h
--- perl/sv.h#345~33292~ 2008-02-12 06:58:50.000000000 -0800
+++ perl/sv.h 2008-04-01 12:59:54.000000000 -0700
@@ -1778,6 +1778,9 @@
#define sv_utf8_upgrade(sv) sv_utf8_upgrade_flags(sv, SV_GMAGIC)
#define sv_2iv(sv) sv_2iv_flags(sv, SV_GMAGIC)
#define sv_2uv(sv) sv_2uv_flags(sv, SV_GMAGIC)
+#define sv_insert(bigstr, offset, len, little, littlelen) \
+ Perl_sv_insert_flags(aTHX_ (bigstr),(offset), (len), (little), \
+ (littlelen), SV_GMAGIC)
/* Should be named SvCatPVN_utf8_upgrade? */
#define sv_catpvn_utf8_upgrade(dsv, sstr, slen, nsv) \
End of Patch.