diff options
author | Karl Williamson <khw@cpan.org> | 2017-03-08 20:31:25 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-11-06 12:50:05 -0700 |
commit | c8b388b0c776dab4a28db03739aff4d64daccada (patch) | |
tree | 3bf17c3a7a4b2b7f260199423ce0baf55dc9e809 /gv.c | |
parent | 98d1c64ef90693f86df84c4ce96718ed136e933c (diff) | |
download | perl-c8b388b0c776dab4a28db03739aff4d64daccada.tar.gz |
Rename strEQs to strBEGINs; remove strNEs
The original names are confusing.
See thread beginning with
http://nntp.perl.org/group/perl.perl5.porters/244335
The two macros are mapped into just that one, complementing the result
for the few cases where strNEs was used.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -84,7 +84,7 @@ Perl_gv_add_by_type(pTHX_ GV *gv, svtype type) { *where = newSV_type(type); if (type == SVt_PVAV && GvNAMELEN(gv) == 3 - && strEQs(GvNAME(gv), "ISA")) + && strBEGINs(GvNAME(gv), "ISA")) sv_magic(*where, (SV *)gv, PERL_MAGIC_isa, NULL, 0); } return gv; @@ -781,7 +781,7 @@ S_gv_fetchmeth_internal(pTHX_ HV* stash, SV* meth, const char* name, STRLEN len, } else if (stash == cachestash && len > 1 /* shortest is uc */ && HvNAMELEN_get(stash) == 4 - && strEQs(hvname, "CORE") + && strBEGINs(hvname, "CORE") && S_maybe_add_coresub(aTHX_ NULL,topgv,name,len)) goto have_gv; } @@ -808,7 +808,7 @@ S_gv_fetchmeth_internal(pTHX_ HV* stash, SV* meth, const char* name, STRLEN len, if (!gvp) { if (len > 1 && HvNAMELEN_get(cstash) == 4) { const char *hvname = HvNAME(cstash); assert(hvname); - if (strEQs(hvname, "CORE") + if (strBEGINs(hvname, "CORE") && (candidate = S_maybe_add_coresub(aTHX_ cstash,NULL,name,len) )) @@ -1074,7 +1074,7 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le origname, HvENAME_get(stash), name) ); } else if ( sep_len >= 7 && - strEQs(last_separator - 7, "::SUPER")) { + strBEGINs(last_separator - 7, "::SUPER")) { /* don't autovifify if ->NoSuchStash::SUPER::method */ stash = gv_stashpvn(origname, sep_len - 7, is_utf8); if (stash) flags |= GV_SUPER; @@ -1675,7 +1675,7 @@ S_parse_gv_stash_name(pTHX_ HV **stash, GV **gv, const char **name, *stash = GvHV(*gv) = newHV(); if (!HvNAME_get(*stash)) { if (GvSTASH(*gv) == PL_defstash && *len == 6 - && strEQs(*name, "CORE")) + && strBEGINs(*name, "CORE")) hv_name_sets(*stash, "CORE", 0); else hv_name_set( @@ -1934,7 +1934,7 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, if (len > 1 /* shortest is uc */ && HvNAMELEN_get(stash) == 4) { /* Avoid null warning: */ const char * const stashname = HvNAME(stash); assert(stashname); - if (strEQs(stashname, "CORE")) + if (strBEGINs(stashname, "CORE")) S_maybe_add_coresub(aTHX_ 0, gv, name, len); } } @@ -2411,7 +2411,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, maybe_multimagic_gv(gv, name, sv_type); } else if (len == 3 && sv_type == SVt_PVAV - && strEQs(name, "ISA") + && strBEGINs(name, "ISA") && (!GvAV(gv) || !SvSMAGICAL(GvAV(gv)))) gv_magicalize_isa(gv); } |