This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
split CXt_LOOP_FOR into CXt_LOOP_LIST,CXt_LOOP_ARY
[perl5.git] / sv.h
diff --git a/sv.h b/sv.h
index 7c67d8f..33a0b7b 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -467,7 +467,7 @@ perform the upgrade if necessary.  See C<L</svtype>>.
 /* PVHV */
 #define SVphv_HASKFLAGS        0x80000000  /* keys have flag byte after hash */
 /* PVGV when SVpbm_VALID is true */
-#define SVpbm_TAIL     0x80000000
+#define SVpbm_TAIL     0x80000000  /* string has a fake "\n" appended */
 /* RV upwards. However, SVf_ROK and SVp_IOK are exclusive  */
 #define SVprv_WEAKREF   0x80000000  /* Weak reference */
 /* pad name vars only */
@@ -838,7 +838,7 @@ Set the current length of the string which is in the SV.  See C<L</SvCUR>>
 and C<SvIV_set>>.
 
 =for apidoc Am|void|SvLEN_set|SV* sv|STRLEN len
-Set the actual length of the string which is in the SV.  See C<L</SvIV_set>>.
+Set the size of the string buffer for the SV. See C<L</SvLEN>>.
 
 =cut
 */
@@ -949,7 +949,7 @@ in gv.h: */
 
 #define SvOOK(sv)              (SvFLAGS(sv) & SVf_OOK)
 #define SvOOK_on(sv)           (SvFLAGS(sv) |= SVf_OOK)
-#define SvOOK_off(sv)          ((void)(SvOOK(sv) && sv_backoff(sv)))
+#define SvOOK_off(sv)          ((void)(SvOOK(sv) && (sv_backoff(sv),0)))
 
 #define SvFAKE(sv)             (SvFLAGS(sv) & SVf_FAKE)
 #define SvFAKE_on(sv)          (SvFLAGS(sv) |= SVf_FAKE)
@@ -1051,7 +1051,7 @@ For example, if your scalar is a reference and you want to modify the C<SvIVX>
 slot, you can't just do C<SvROK_off>, as that will leak the referent.
 
 This is used internally by various sv-modifying functions, such as
-C<sv_setsv>, C<sv_setiv> and C<sv_pvn_force..
+C<sv_setsv>, C<sv_setiv> and C<sv_pvn_force>.
 
 One case that this does not handle is a gv without SvFAKE set.  After
 
@@ -1473,10 +1473,9 @@ attention to precisely which outputs are influenced by which inputs.
 
 #define SvTAINT(sv)                    \
     STMT_START {                       \
-       if (UNLIKELY(TAINTING_get)) {   \
-           if (UNLIKELY(TAINT_get))    \
-               SvTAINTED_on(sv);       \
-       }                               \
+        assert(TAINTING_get || !TAINT_get); \
+        if (UNLIKELY(TAINT_get))       \
+            SvTAINTED_on(sv);          \
     } STMT_END
 
 /*
@@ -1575,13 +1574,13 @@ Returns a boolean indicating whether Perl would evaluate the SV as true or
 false.  See C<L</SvOK>> for a defined/undefined test.  Does not handle 'get' magic.
 
 =for apidoc Am|char*|SvPVutf8_force|SV* sv|STRLEN len
-Like C<SvPV_force>, but converts C<sv> to utf8 first if necessary.
+Like C<SvPV_force>, but converts C<sv> to UTF-8 first if necessary.
 
 =for apidoc Am|char*|SvPVutf8|SV* sv|STRLEN len
-Like C<SvPV>, but converts C<sv> to utf8 first if necessary.
+Like C<SvPV>, but converts C<sv> to UTF-8 first if necessary.
 
 =for apidoc Am|char*|SvPVutf8_nolen|SV* sv
-Like C<SvPV_nolen>, but converts C<sv> to utf8 first if necessary.
+Like C<SvPV_nolen>, but converts C<sv> to UTF-8 first if necessary.
 
 =for apidoc Am|char*|SvPVbyte_force|SV* sv|STRLEN len
 Like C<SvPV_force>, but converts C<sv> to byte representation first if necessary.
@@ -1593,12 +1592,12 @@ Like C<SvPV>, but converts C<sv> to byte representation first if necessary.
 Like C<SvPV_nolen>, but converts C<sv> to byte representation first if necessary.
 
 =for apidoc Am|char*|SvPVutf8x_force|SV* sv|STRLEN len
-Like C<SvPV_force>, but converts C<sv> to utf8 first if necessary.
+Like C<SvPV_force>, but converts C<sv> to UTF-8 first if necessary.
 Guarantees to evaluate C<sv> only once; use the more efficient C<SvPVutf8_force>
 otherwise.
 
 =for apidoc Am|char*|SvPVutf8x|SV* sv|STRLEN len
-Like C<SvPV>, but converts C<sv> to utf8 first if necessary.
+Like C<SvPV>, but converts C<sv> to UTF-8 first if necessary.
 Guarantees to evaluate C<sv> only once; use the more efficient C<SvPVutf8>
 otherwise.