diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/XS-APItest/APItest.xs | 41 | ||||
-rw-r--r-- | ext/attributes/attributes.xs | 6 |
2 files changed, 23 insertions, 24 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs index 112e2ac41c..fa11b05fdc 100644 --- a/ext/XS-APItest/APItest.xs +++ b/ext/XS-APItest/APItest.xs @@ -1161,84 +1161,83 @@ 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 && strBEGINs(keyword_ptr, "rpn") && + if (memEQs(keyword_ptr, keyword_len, "rpn") && keyword_active(hintkey_rpn_sv)) { *op_ptr = parse_keyword_rpn(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 7 && strBEGINs(keyword_ptr, "calcrpn") && + } else if (memEQs(keyword_ptr, keyword_len, "calcrpn") && keyword_active(hintkey_calcrpn_sv)) { *op_ptr = parse_keyword_calcrpn(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 9 && strBEGINs(keyword_ptr, "stufftest") && + } else if (memEQs(keyword_ptr, keyword_len, "stufftest") && keyword_active(hintkey_stufftest_sv)) { *op_ptr = parse_keyword_stufftest(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 12 && - strBEGINs(keyword_ptr, "swaptwostmts") && + } else if (memEQs(keyword_ptr, keyword_len, "swaptwostmts") && keyword_active(hintkey_swaptwostmts_sv)) { *op_ptr = parse_keyword_swaptwostmts(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 8 && strBEGINs(keyword_ptr, "looprest") && + } else if (memEQs(keyword_ptr, keyword_len, "looprest") && keyword_active(hintkey_looprest_sv)) { *op_ptr = parse_keyword_looprest(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 14 && strBEGINs(keyword_ptr, "scopelessblock") && + } else if (memEQs(keyword_ptr, keyword_len, "scopelessblock") && keyword_active(hintkey_scopelessblock_sv)) { *op_ptr = parse_keyword_scopelessblock(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 10 && strBEGINs(keyword_ptr, "stmtasexpr") && + } else if (memEQs(keyword_ptr, keyword_len, "stmtasexpr") && keyword_active(hintkey_stmtasexpr_sv)) { *op_ptr = parse_keyword_stmtasexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 11 && strBEGINs(keyword_ptr, "stmtsasexpr") && + } else if (memEQs(keyword_ptr, keyword_len, "stmtsasexpr") && keyword_active(hintkey_stmtsasexpr_sv)) { *op_ptr = parse_keyword_stmtsasexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 9 && strBEGINs(keyword_ptr, "loopblock") && + } else if (memEQs(keyword_ptr, keyword_len, "loopblock") && keyword_active(hintkey_loopblock_sv)) { *op_ptr = parse_keyword_loopblock(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 11 && strBEGINs(keyword_ptr, "blockasexpr") && + } else if (memEQs(keyword_ptr, keyword_len, "blockasexpr") && keyword_active(hintkey_blockasexpr_sv)) { *op_ptr = parse_keyword_blockasexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 9 && strBEGINs(keyword_ptr, "swaplabel") && + } else if (memEQs(keyword_ptr, keyword_len, "swaplabel") && keyword_active(hintkey_swaplabel_sv)) { *op_ptr = parse_keyword_swaplabel(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 10 && strBEGINs(keyword_ptr, "labelconst") && + } else if (memEQs(keyword_ptr, keyword_len, "labelconst") && keyword_active(hintkey_labelconst_sv)) { *op_ptr = parse_keyword_labelconst(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 13 && strBEGINs(keyword_ptr, "arrayfullexpr") && + } else if (memEQs(keyword_ptr, keyword_len, "arrayfullexpr") && keyword_active(hintkey_arrayfullexpr_sv)) { *op_ptr = parse_keyword_arrayfullexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 13 && strBEGINs(keyword_ptr, "arraylistexpr") && + } else if (memEQs(keyword_ptr, keyword_len, "arraylistexpr") && keyword_active(hintkey_arraylistexpr_sv)) { *op_ptr = parse_keyword_arraylistexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 13 && strBEGINs(keyword_ptr, "arraytermexpr") && + } else if (memEQs(keyword_ptr, keyword_len, "arraytermexpr") && keyword_active(hintkey_arraytermexpr_sv)) { *op_ptr = parse_keyword_arraytermexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 14 && strBEGINs(keyword_ptr, "arrayarithexpr") && + } else if (memEQs(keyword_ptr, keyword_len, "arrayarithexpr") && keyword_active(hintkey_arrayarithexpr_sv)) { *op_ptr = parse_keyword_arrayarithexpr(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 14 && strBEGINs(keyword_ptr, "arrayexprflags") && + } else if (memEQs(keyword_ptr, keyword_len, "arrayexprflags") && keyword_active(hintkey_arrayexprflags_sv)) { *op_ptr = parse_keyword_arrayexprflags(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 5 && strBEGINs(keyword_ptr, "DEFSV") && + } else if (memEQs(keyword_ptr, keyword_len, "DEFSV") && keyword_active(hintkey_DEFSV_sv)) { *op_ptr = parse_keyword_DEFSV(); return KEYWORD_PLUGIN_EXPR; - } else if(keyword_len == 9 && strBEGINs(keyword_ptr, "with_vars") && + } else if (memEQs(keyword_ptr, keyword_len, "with_vars") && keyword_active(hintkey_with_vars_sv)) { *op_ptr = parse_keyword_with_vars(); return KEYWORD_PLUGIN_STMT; - } else if(keyword_len == 15 && strBEGINs(keyword_ptr, "join_with_space") && + } else if (memEQs(keyword_ptr, keyword_len, "join_with_space") && keyword_active(hintkey_join_with_space_sv)) { *op_ptr = parse_join_with_space(); return KEYWORD_PLUGIN_EXPR; diff --git a/ext/attributes/attributes.xs b/ext/attributes/attributes.xs index 605749a010..fa0b72abfc 100644 --- a/ext/attributes/attributes.xs +++ b/ext/attributes/attributes.xs @@ -44,7 +44,7 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs) case SVt_PVCV: switch ((int)len) { case 5: - if (_memEQs(name, "const")) { + if (memEQs(name, 5, "const")) { if (negated) CvANONCONST_off(sv); else { @@ -60,7 +60,7 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs) case 6: switch (name[3]) { case 'l': - if (_memEQs(name, "lvalue")) { + if (memEQs(name, 6, "lvalue")) { bool warn = !CvISXSUB(MUTABLE_CV(sv)) && CvROOT(MUTABLE_CV(sv)) @@ -74,7 +74,7 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs) } break; case 'h': - if (_memEQs(name, "method")) { + if (memEQs(name, 6, "method")) { if (negated) CvFLAGS(MUTABLE_CV(sv)) &= ~CVf_METHOD; else |