diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-07-28 00:33:33 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-07-28 22:20:04 -0700 |
commit | 8a68f32879ab48ea5a7fbacc6abdca4a65ec0d23 (patch) | |
tree | d24bcd1c222d8d038c51ba0a3356af8650f95532 | |
parent | 562aee6bf50bd2244cded74c1addaf1f2a395cbd (diff) | |
download | perl-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.fnc | 1 | ||||
-rw-r--r-- | embed.h | 1 | ||||
-rw-r--r-- | proto.h | 5 | ||||
-rw-r--r-- | sv.c | 22 | ||||
-rw-r--r-- | sv.h | 7 |
5 files changed, 1 insertions, 35 deletions
@@ -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 @@ -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 @@ -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 \ @@ -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 @@ -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]); \ |