Amb |IV |sv_2iv |NULLOK SV *sv
Apd |IV |sv_2iv_flags |NULLOK SV *const sv|const I32 flags
Apd |SV* |sv_2mortal |NULLOK SV *const sv
-Apd |NV |sv_2nv |NULLOK SV *const sv
+Apd |NV |sv_2nv_flags |NULLOK SV *const sv|const I32 flags
: Used in pp.c, pp_hot.c, sv.c
pMd |SV* |sv_2num |NN SV *const sv
Amb |char* |sv_2pv |NULLOK SV *sv|NULLOK STRLEN *lp
#endif
#define sv_2iv_flags Perl_sv_2iv_flags
#define sv_2mortal Perl_sv_2mortal
-#define sv_2nv Perl_sv_2nv
+#define sv_2nv_flags Perl_sv_2nv_flags
#ifdef PERL_CORE
#define sv_2num Perl_sv_2num
#endif
#endif
#define sv_2iv_flags(a,b) Perl_sv_2iv_flags(aTHX_ a,b)
#define sv_2mortal(a) Perl_sv_2mortal(aTHX_ a)
-#define sv_2nv(a) Perl_sv_2nv(aTHX_ a)
+#define sv_2nv_flags(a,b) Perl_sv_2nv_flags(aTHX_ a,b)
#ifdef PERL_CORE
#define sv_2num(a) Perl_sv_2num(aTHX_ a)
#endif
Perl_sv_2iv
Perl_sv_2iv_flags
Perl_sv_2mortal
-Perl_sv_2nv
+Perl_sv_2nv_flags
Perl_sv_2pv
Perl_sv_2pv_flags
Perl_sv_2pvutf8
PERL_CALLCONV void Perl_sv_taint(pTHX_ SV *sv);
PERL_CALLCONV IV Perl_sv_2iv(pTHX_ register SV *sv);
PERL_CALLCONV UV Perl_sv_2uv(pTHX_ register SV *sv);
+PERL_CALLCONV NV Perl_sv_2nv(pTHX_ register SV *sv);
PERL_CALLCONV char * Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp);
PERL_CALLCONV char * Perl_sv_2pv_nolen(pTHX_ register SV *sv);
PERL_CALLCONV char * Perl_sv_2pvbyte_nolen(pTHX_ register SV *sv);
return sv_2uv_flags(sv, SV_GMAGIC);
}
+/* sv_2nv() is now a macro using Perl_sv_2nv_flags();
+ * this function provided for binary compatibility only
+ */
+
+NV
+Perl_sv_2nv(pTHX_ register SV *sv)
+{
+ return sv_2nv_flags(sv, SV_GMAGIC);
+}
+
+
/* sv_2pv() is now a macro using Perl_sv_2pv_flags();
* this function provided for binary compatibility only
*/
/* PERL_CALLCONV IV Perl_sv_2iv(pTHX_ SV *sv); */
PERL_CALLCONV IV Perl_sv_2iv_flags(pTHX_ SV *const sv, const I32 flags);
PERL_CALLCONV SV* Perl_sv_2mortal(pTHX_ SV *const sv);
-PERL_CALLCONV NV Perl_sv_2nv(pTHX_ SV *const sv);
+PERL_CALLCONV NV Perl_sv_2nv_flags(pTHX_ SV *const sv, const I32 flags);
PERL_CALLCONV SV* Perl_sv_2num(pTHX_ SV *const sv)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_2NUM \
=for apidoc sv_2nv
Return the num value of an SV, doing any necessary string or integer
-conversion, magic etc. Normally used via the C<SvNV(sv)> and C<SvNVx(sv)>
-macros.
+conversion. If flags includes SV_GMAGIC, does an mg_get() first.
+Normally used via the C<SvNV(sv)> and C<SvNVx(sv)> macros.
=cut
*/
NV
-Perl_sv_2nv(pTHX_ register SV *const sv)
+Perl_sv_2nv_flags(pTHX_ register SV *const sv, const I32 flags)
{
dVAR;
if (!sv)
if (SvGMAGICAL(sv) || (SvTYPE(sv) == SVt_PVGV && SvVALID(sv))) {
/* FBMs use the same flag bit as SVf_IVisUV, so must let them
cache IVs just in case. */
- mg_get(sv);
+ if (flags & SV_GMAGIC)
+ mg_get(sv);
if (SvNOKp(sv))
return SvNVX(sv);
if ((SvPOKp(sv) && SvLEN(sv)) && !SvIOKp(sv)) {
#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_2nv(sv) sv_2nv_flags(sv, SV_GMAGIC)
#define sv_insert(bigstr, offset, len, little, littlelen) \
Perl_sv_insert_flags(aTHX_ (bigstr),(offset), (len), (little), \
(littlelen), SV_GMAGIC)