summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-07-28 00:33:33 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-07-28 22:20:04 -0700
commit8a68f32879ab48ea5a7fbacc6abdca4a65ec0d23 (patch)
treed24bcd1c222d8d038c51ba0a3356af8650f95532
parent562aee6bf50bd2244cded74c1addaf1f2a395cbd (diff)
downloadperl-8a68f32879ab48ea5a7fbacc6abdca4a65ec0d23.tar.gz
Oust sv_gmagical_2iv_please
The magic flags patch prevents this from ever being called, since the OK flags work the same way for magic variables now as they have for muggle vars, avoid these fiddly games. (It was when writing it that I realised the value of the magic flags proposal.)
-rw-r--r--embed.fnc1
-rw-r--r--embed.h1
-rw-r--r--proto.h5
-rw-r--r--sv.c22
-rw-r--r--sv.h7
5 files changed, 1 insertions, 35 deletions
diff --git a/embed.fnc b/embed.fnc
index b3f757c1bf..7968ece904 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1319,7 +1319,6 @@ Apd |STRLEN |sv_len |NULLOK SV *const sv
Apd |STRLEN |sv_len_utf8 |NULLOK SV *const sv
Apd |void |sv_magic |NN SV *const sv|NULLOK SV *const obj|const int how \
|NULLOK const char *const name|const I32 namlen
-pd |bool |sv_gmagical_2iv_please|NN SV *sv
Apd |MAGIC *|sv_magicext |NN SV *const sv|NULLOK SV *const obj|const int how \
|NULLOK const MGVTBL *const vtbl|NULLOK const char *const name \
|const I32 namlen
diff --git a/embed.h b/embed.h
index 50d2344bed..aa950c414c 100644
--- a/embed.h
+++ b/embed.h
@@ -1207,7 +1207,6 @@
#define sv_clean_objs() Perl_sv_clean_objs(aTHX)
#define sv_del_backref(a,b) Perl_sv_del_backref(aTHX_ a,b)
#define sv_free_arenas() Perl_sv_free_arenas(aTHX)
-#define sv_gmagical_2iv_please(a) Perl_sv_gmagical_2iv_please(aTHX_ a)
#define sv_ref(a,b,c) Perl_sv_ref(aTHX_ a,b,c)
#define sv_sethek(a,b) Perl_sv_sethek(aTHX_ a,b)
#ifndef PERL_IMPLICIT_CONTEXT
diff --git a/proto.h b/proto.h
index 3447f6c0ed..2ecd0ec2a2 100644
--- a/proto.h
+++ b/proto.h
@@ -3980,11 +3980,6 @@ PERL_CALLCONV char* Perl_sv_gets(pTHX_ SV *const sv, PerlIO *const fp, I32 appen
#define PERL_ARGS_ASSERT_SV_GETS \
assert(sv); assert(fp)
-PERL_CALLCONV bool Perl_sv_gmagical_2iv_please(pTHX_ SV *sv)
- __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_SV_GMAGICAL_2IV_PLEASE \
- assert(sv)
-
PERL_CALLCONV char* Perl_sv_grow(pTHX_ SV *const sv, STRLEN newlen)
__attribute__nonnull__(pTHX_1);
#define PERL_ARGS_ASSERT_SV_GROW \
diff --git a/sv.c b/sv.c
index b5950d65f0..1bccaae75a 100644
--- a/sv.c
+++ b/sv.c
@@ -2336,28 +2336,6 @@ Perl_sv_2iv_flags(pTHX_ register SV *const sv, const I32 flags)
}
/*
-=for apidoc sv_gmagical_2iv_please
-
-Used internally by C<SvIV_please_nomg>, this function sets the C<SvIVX>
-slot if C<sv_2iv> would have made the scalar C<SvIOK> had it not been
-magical. In that case it returns true.
-
-=cut
-*/
-
-bool
-Perl_sv_gmagical_2iv_please(pTHX_ register SV *sv)
-{
- bool has_int;
- PERL_ARGS_ASSERT_SV_GMAGICAL_2IV_PLEASE;
- assert(SvGMAGICAL(sv) && !SvIOKp(sv) && (SvNOKp(sv) || SvPOKp(sv)));
- if (S_sv_2iuv_common(aTHX_ sv)) { SvNIOK_off(sv); return 0; }
- has_int = !!SvIOK(sv);
- SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK);
- return has_int;
-}
-
-/*
=for apidoc sv_2uv_flags
Return the unsigned integer value of an SV, doing any necessary string
diff --git a/sv.h b/sv.h
index 4c58ee4354..06b214cb25 100644
--- a/sv.h
+++ b/sv.h
@@ -1236,12 +1236,7 @@ the scalar's value cannot change unless written to.
#define SvIV_please_nomg(sv) \
(!SvIOKp(sv) && (SvNOK(sv) || SvPOK(sv)) \
? (SvIV_nomg(sv), SvIOK(sv)) \
- : SvGMAGICAL(sv) \
- ? SvIOKp(sv) || ( \
- (SvNOKp(sv) || SvPOKp(sv)) \
- && sv_gmagical_2iv_please(sv) \
- ) \
- : SvIOK(sv))
+ : SvIOK(sv))
#define SvIV_set(sv, val) \
STMT_START { \
assert(PL_valid_types_IV_set[SvTYPE(sv) & SVt_MASK]); \