diff options
-rw-r--r-- | amigaos4/amigaio.c | 2 | ||||
-rw-r--r-- | doio.c | 4 | ||||
-rw-r--r-- | ext/B/B.pm | 2 | ||||
-rw-r--r-- | ext/B/B.xs | 2 | ||||
-rw-r--r-- | ext/XS-APItest/APItest.xs | 40 | ||||
-rw-r--r-- | gv.c | 14 | ||||
-rw-r--r-- | handy.h | 8 | ||||
-rw-r--r-- | hv.c | 2 | ||||
-rw-r--r-- | locale.c | 4 | ||||
-rw-r--r-- | os2/os2.c | 8 | ||||
-rw-r--r-- | perl.c | 4 | ||||
-rw-r--r-- | toke.c | 28 |
12 files changed, 56 insertions, 62 deletions
diff --git a/amigaos4/amigaio.c b/amigaos4/amigaio.c index b50dd9b9f5..b471220260 100644 --- a/amigaos4/amigaio.c +++ b/amigaos4/amigaio.c @@ -668,7 +668,7 @@ static I32 S_do_amigaos_exec3(pTHX_ const char *incmd, int fd, int do_report) if (*cmd == '.' && isSPACE(cmd[1])) goto doshell; - if (strEQs(cmd, "exec") && isSPACE(cmd[4])) + if (strBEGINs(cmd, "exec") && isSPACE(cmd[4])) goto doshell; s = cmd; @@ -2003,7 +2003,7 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report) { char flags[PERL_FLAGS_MAX]; if (strnEQ(cmd,PL_cshname,PL_cshlen) && - strEQs(cmd+PL_cshlen," -c")) { + strBEGINs(cmd+PL_cshlen," -c")) { my_strlcpy(flags, "-c", PERL_FLAGS_MAX); s = cmd+PL_cshlen+3; if (*s == 'f') { @@ -2039,7 +2039,7 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report) if (*cmd == '.' && isSPACE(cmd[1])) goto doshell; - if (strEQs(cmd,"exec") && isSPACE(cmd[4])) + if (strBEGINs(cmd,"exec") && isSPACE(cmd[4])) goto doshell; s = cmd; diff --git a/ext/B/B.pm b/ext/B/B.pm index 12d8201619..389f8cdc42 100644 --- a/ext/B/B.pm +++ b/ext/B/B.pm @@ -15,7 +15,7 @@ require Exporter; # walkoptree comes from B.xs BEGIN { - $B::VERSION = '1.71'; + $B::VERSION = '1.72'; @B::EXPORT_OK = (); # Our BOOT code needs $VERSION set, and will append to @EXPORT_OK. diff --git a/ext/B/B.xs b/ext/B/B.xs index 02b78caa5d..fc36a36054 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -745,7 +745,7 @@ CODE: int i; IV result = -1; ST(0) = sv_newmortal(); - if (strEQs(name,"pp_")) + if (strBEGINs(name,"pp_")) name += 3; for (i = 0; i < PL_maxo; i++) { diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs index 99a1d4d125..112e2ac41c 100644 --- a/ext/XS-APItest/APItest.xs +++ b/ext/XS-APItest/APItest.xs @@ -1161,84 +1161,84 @@ static int THX_keyword_active(pTHX_ SV *hintkey_sv) static int my_keyword_plugin(pTHX_ char *keyword_ptr, STRLEN keyword_len, OP **op_ptr) { - if(keyword_len == 3 && strEQs(keyword_ptr, "rpn") && + if(keyword_len == 3 && strBEGINs(keyword_ptr, "rpn") && keyword_active(hintkey_rpn_sv)) { *op_ptr = parse_keyword_rpn(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 7 && strEQs(keyword_ptr, "calcrpn") && + } else if(keyword_len == 7 && strBEGINs(keyword_ptr, "calcrpn") && keyword_active(hintkey_calcrpn_sv)) { *op_ptr = parse_keyword_calcrpn(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 9 && strEQs(keyword_ptr, "stufftest") && + } else if(keyword_len == 9 && strBEGINs(keyword_ptr, "stufftest") && keyword_active(hintkey_stufftest_sv)) { *op_ptr = parse_keyword_stufftest(); return KEYWORD_PLUGIN_STMT; } else if(keyword_len == 12 && - strEQs(keyword_ptr, "swaptwostmts") && + strBEGINs(keyword_ptr, "swaptwostmts") && keyword_active(hintkey_swaptwostmts_sv)) { *op_ptr = parse_keyword_swaptwostmts(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 8 && strEQs(keyword_ptr, "looprest") && + } else if(keyword_len == 8 && strBEGINs(keyword_ptr, "looprest") && keyword_active(hintkey_looprest_sv)) { *op_ptr = parse_keyword_looprest(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 14 && strEQs(keyword_ptr, "scopelessblock") && + } else if(keyword_len == 14 && strBEGINs(keyword_ptr, "scopelessblock") && keyword_active(hintkey_scopelessblock_sv)) { *op_ptr = parse_keyword_scopelessblock(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 10 && strEQs(keyword_ptr, "stmtasexpr") && + } else if(keyword_len == 10 && strBEGINs(keyword_ptr, "stmtasexpr") && keyword_active(hintkey_stmtasexpr_sv)) { *op_ptr = parse_keyword_stmtasexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 11 && strEQs(keyword_ptr, "stmtsasexpr") && + } else if(keyword_len == 11 && strBEGINs(keyword_ptr, "stmtsasexpr") && keyword_active(hintkey_stmtsasexpr_sv)) { *op_ptr = parse_keyword_stmtsasexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 9 && strEQs(keyword_ptr, "loopblock") && + } else if(keyword_len == 9 && strBEGINs(keyword_ptr, "loopblock") && keyword_active(hintkey_loopblock_sv)) { *op_ptr = parse_keyword_loopblock(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 11 && strEQs(keyword_ptr, "blockasexpr") && + } else if(keyword_len == 11 && strBEGINs(keyword_ptr, "blockasexpr") && keyword_active(hintkey_blockasexpr_sv)) { *op_ptr = parse_keyword_blockasexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 9 && strEQs(keyword_ptr, "swaplabel") && + } else if(keyword_len == 9 && strBEGINs(keyword_ptr, "swaplabel") && keyword_active(hintkey_swaplabel_sv)) { *op_ptr = parse_keyword_swaplabel(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 10 && strEQs(keyword_ptr, "labelconst") && + } else if(keyword_len == 10 && strBEGINs(keyword_ptr, "labelconst") && keyword_active(hintkey_labelconst_sv)) { *op_ptr = parse_keyword_labelconst(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 13 && strEQs(keyword_ptr, "arrayfullexpr") && + } else if(keyword_len == 13 && strBEGINs(keyword_ptr, "arrayfullexpr") && keyword_active(hintkey_arrayfullexpr_sv)) { *op_ptr = parse_keyword_arrayfullexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 13 && strEQs(keyword_ptr, "arraylistexpr") && + } else if(keyword_len == 13 && strBEGINs(keyword_ptr, "arraylistexpr") && keyword_active(hintkey_arraylistexpr_sv)) { *op_ptr = parse_keyword_arraylistexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 13 && strEQs(keyword_ptr, "arraytermexpr") && + } else if(keyword_len == 13 && strBEGINs(keyword_ptr, "arraytermexpr") && keyword_active(hintkey_arraytermexpr_sv)) { *op_ptr = parse_keyword_arraytermexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 14 && strEQs(keyword_ptr, "arrayarithexpr") && + } else if(keyword_len == 14 && strBEGINs(keyword_ptr, "arrayarithexpr") && keyword_active(hintkey_arrayarithexpr_sv)) { *op_ptr = parse_keyword_arrayarithexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 14 && strEQs(keyword_ptr, "arrayexprflags") && + } else if(keyword_len == 14 && strBEGINs(keyword_ptr, "arrayexprflags") && keyword_active(hintkey_arrayexprflags_sv)) { *op_ptr = parse_keyword_arrayexprflags(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 5 && strEQs(keyword_ptr, "DEFSV") && + } else if(keyword_len == 5 && strBEGINs(keyword_ptr, "DEFSV") && keyword_active(hintkey_DEFSV_sv)) { *op_ptr = parse_keyword_DEFSV(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 9 && strEQs(keyword_ptr, "with_vars") && + } else if(keyword_len == 9 && strBEGINs(keyword_ptr, "with_vars") && keyword_active(hintkey_with_vars_sv)) { *op_ptr = parse_keyword_with_vars(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 15 && strEQs(keyword_ptr, "join_with_space") && + } else if(keyword_len == 15 && strBEGINs(keyword_ptr, "join_with_space") && keyword_active(hintkey_join_with_space_sv)) { *op_ptr = parse_join_with_space(); return KEYWORD_PLUGIN_EXPR; @@ -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); } @@ -476,13 +476,7 @@ Returns zero if non-equal, or non-zero if equal. #define strnNE(s1,s2,l) (strncmp(s1,s2,l)) #define strnEQ(s1,s2,l) (!strncmp(s1,s2,l)) -/* These names are controversial, so guarding against their being used in more - * places than they already are. strBEGs and StrStartsWith are potential - * candidates */ -#if defined(PERL_IN_DOIO_C) || defined(PERL_IN_GV_C) || defined(PERL_IN_HV_C) || defined(PERL_IN_LOCALE_C) || defined(PERL_IN_PERL_C) || defined(PERL_IN_TOKE_C) || defined(PERL_EXT) -#define strNEs(s1,s2) (strncmp(s1,"" s2 "", sizeof(s2)-1)) -#define strEQs(s1,s2) (!strncmp(s1,"" s2 "", sizeof(s2)-1)) -#endif +#define strBEGINs(s1,s2) (strncmp(s1,"" s2 "", sizeof(s2)-1) == 0) #define memNE(s1,s2,l) (memcmp(s1,s2,l)) #define memEQ(s1,s2,l) (!memcmp(s1,s2,l)) @@ -1279,7 +1279,7 @@ S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen, sv_2mortal((SV *)gv) ); } - else if (klen == 3 && strEQs(key, "ISA") && GvAV(gv)) { + else if (klen == 3 && strBEGINs(key, "ISA") && GvAV(gv)) { AV *isa = GvAV(gv); MAGIC *mg = mg_find((SV*)isa, PERL_MAGIC_isa); @@ -1971,8 +1971,8 @@ Perl_init_i18nl10n(pTHX_ int printwarn) { char **e; for (e = environ; *e; e++) { - if (strEQs(*e, "LC_") - && strNEs(*e, "LC_ALL=") + if (strBEGINs(*e, "LC_") + && ! strBEGINs(*e, "LC_ALL=") && (p = strchr(*e, '='))) PerlIO_printf(Perl_error_log, "\t%.*s = \"%s\",\n", (int)(p - *e), *e, p + 1); @@ -1171,11 +1171,11 @@ do_spawn_ve(pTHX_ SV *really, U32 flag, U32 execf, char *inicmd, U32 addflag) if (buf[1] == '!') s = buf + 2; } else if (buf[0] == 'e') { - if (strEQs(buf, "extproc") + if (strBEGINs(buf, "extproc") && isSPACE(buf[7])) s = buf + 8; } else if (buf[0] == 'E') { - if (strEQs(buf, "EXTPROC") + if (strBEGINs(buf, "EXTPROC") && isSPACE(buf[7])) s = buf + 8; } @@ -1372,7 +1372,7 @@ do_spawn3(pTHX_ char *cmd, int execf, int flag) while (*cmd && isSPACE(*cmd)) cmd++; - if (strEQs(cmd,"/bin/sh") && isSPACE(cmd[7])) { + if (strBEGINs(cmd,"/bin/sh") && isSPACE(cmd[7])) { STRLEN l = strlen(PL_sh_path); Newx(news, strlen(cmd) - 7 + l + 1, char); @@ -1387,7 +1387,7 @@ do_spawn3(pTHX_ char *cmd, int execf, int flag) if (*cmd == '.' && isSPACE(cmd[1])) goto doshell; - if (strEQs(cmd,"exec") && isSPACE(cmd[4])) + if (strBEGINs(cmd,"exec") && isSPACE(cmd[4])) goto doshell; for (s = cmd; *s && isALPHA(*s); s++) ; /* catch VAR=val gizmo */ @@ -3845,7 +3845,7 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, bool *suidscript) /* if find_script() returns, it returns a malloc()-ed value */ scriptname = PL_origfilename = find_script(scriptname, dosearch, NULL, 1); - if (strEQs(scriptname, "/dev/fd/") + if (strBEGINs(scriptname, "/dev/fd/") && isDIGIT(scriptname[8]) && grok_atoUV(scriptname + 8, &uv, &s) && uv <= PERL_INT_MAX @@ -4028,7 +4028,7 @@ S_find_beginning(pTHX_ SV* linestr_sv, PerlIO *rsfp) if (*s++ == '-') { while (isDIGIT(s2[-1]) || s2[-1] == '-' || s2[-1] == '.' || s2[-1] == '_') s2--; - if (strEQs(s2-4,"perl")) + if (strBEGINs(s2-4,"perl")) while ((s = moreswitches(s))) ; } @@ -1745,7 +1745,7 @@ S_incline(pTHX_ const char *s) return; while (SPACE_OR_TAB(*s)) s++; - if (strEQs(s, "line")) + if (strBEGINs(s, "line")) s += 4; else return; @@ -2103,7 +2103,7 @@ S_force_word(pTHX_ char *start, int token, int check_keyword, int allow_pack) if (check_keyword) { char *s2 = PL_tokenbuf; STRLEN len2 = len; - if (allow_pack && len > 6 && strEQs(s2, "CORE::")) + if (allow_pack && len > 6 && strBEGINs(s2, "CORE::")) s2 += 6, len2 -= 6; if (keyword(s2, len2, 0)) return start; @@ -5367,7 +5367,7 @@ Perl_yylex(pTHX) } if (PL_parser->in_pod) { /* Incest with pod. */ - if (*s == '=' && strEQs(s, "=cut") && !isALPHA(s[4])) { + if (*s == '=' && strBEGINs(s, "=cut") && !isALPHA(s[4])) { SvPVCLEAR(PL_linestr); PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr); PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr); @@ -5644,7 +5644,7 @@ Perl_yylex(pTHX) while (s < PL_bufend && SPACE_OR_TAB(*s)) s++; - if (strEQs(s,"=>")) { + if (strBEGINs(s,"=>")) { s = force_word(PL_bufptr,BAREWORD,FALSE,FALSE); DEBUG_T( { printbuf("### Saw unary minus before =>, forcing word %s\n", s); } ); OPERATOR('-'); /* unary minus */ @@ -6256,7 +6256,7 @@ Perl_yylex(pTHX) PL_expect = XTERM; break; } - if (strEQs(s, "sub")) { + if (strBEGINs(s, "sub")) { PL_bufptr = s; d = s + 3; d = skipspace(d); @@ -6392,7 +6392,7 @@ Perl_yylex(pTHX) { const char tmp = *s++; if (tmp == '=') { - if ((s == PL_linestart+2 || s[-3] == '\n') && strEQs(s, "=====")) { + if ((s == PL_linestart+2 || s[-3] == '\n') && strBEGINs(s, "=====")) { s = vcs_conflict_marker(s + 5); goto retry; } @@ -6431,7 +6431,7 @@ Perl_yylex(pTHX) while (s < d) { if (*s++ == '\n') { incline(s); - if (strEQs(s,"=cut")) { + if (strBEGINs(s,"=cut")) { s = strchr(s,'\n'); if (s) s++; @@ -6512,7 +6512,7 @@ Perl_yylex(pTHX) if (s[1] != '<' && !strchr(s,'>')) check_uni(); if (s[1] == '<' && s[2] != '>') { - if ((s == PL_linestart || s[-1] == '\n') && strEQs(s+2, "<<<<<")) { + if ((s == PL_linestart || s[-1] == '\n') && strBEGINs(s+2, "<<<<<")) { s = vcs_conflict_marker(s + 7); goto retry; } @@ -6527,7 +6527,7 @@ Perl_yylex(pTHX) { char tmp = *s++; if (tmp == '<') { - if ((s == PL_linestart+2 || s[-3] == '\n') && strEQs(s, "<<<<<")) { + if ((s == PL_linestart+2 || s[-3] == '\n') && strBEGINs(s, "<<<<<")) { s = vcs_conflict_marker(s + 5); goto retry; } @@ -6571,7 +6571,7 @@ Perl_yylex(pTHX) { const char tmp = *s++; if (tmp == '>') { - if ((s == PL_linestart+2 || s[-3] == '\n') && strEQs(s, ">>>>>")) { + if ((s == PL_linestart+2 || s[-3] == '\n') && strBEGINs(s, ">>>>>")) { s = vcs_conflict_marker(s + 5); goto retry; } @@ -7942,12 +7942,12 @@ Perl_yylex(pTHX) SSize_t s_off = s - SvPVX(PL_linestr); if ((PL_bufend - p) >= 3 - && strEQs(p, "my") && isSPACE(*(p + 2))) + && strBEGINs(p, "my") && isSPACE(*(p + 2))) { p += 2; } else if ((PL_bufend - p) >= 4 - && strEQs(p, "our") && isSPACE(*(p + 3))) + && strBEGINs(p, "our") && isSPACE(*(p + 3))) p += 3; p = skipspace(p); /* skip optional package name, as in "for my abc $x (..)" */ @@ -8199,7 +8199,7 @@ Perl_yylex(pTHX) s = skipspace(s); if (isIDFIRST_lazy_if_safe(s, PL_bufend, UTF)) { s = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, TRUE, &len); - if (len == 3 && strEQs(PL_tokenbuf, "sub")) + if (len == 3 && strBEGINs(PL_tokenbuf, "sub")) goto really_sub; PL_in_my_stash = find_in_my_stash(PL_tokenbuf, len); if (!PL_in_my_stash) { @@ -9371,7 +9371,7 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni) || isDIGIT_A((U8)s[1]) || s[1] == '$' || s[1] == '{' - || strEQs(s+1,"::")) ) + || strBEGINs(s+1,"::")) ) { /* Dereferencing a value in a scalar variable. The alternatives are different syntaxes for a scalar variable. |