diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-11 23:44:45 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-15 06:19:34 -0700 |
commit | 230b3caa7e7f84ecf3fa68999603884d4b196166 (patch) | |
tree | 21dcbcecd3e6792259922acea128a4b967e6cf46 | |
parent | 340798a07b98f692683344a419aab640629e38fb (diff) | |
download | perl-230b3caa7e7f84ecf3fa68999603884d4b196166.tar.gz |
Inline op.c:too_many_arguments_sv into its only caller
I’m about to change this code anyway, and it’s easier in one spot.
-rw-r--r-- | embed.fnc | 1 | ||||
-rw-r--r-- | embed.h | 1 | ||||
-rw-r--r-- | op.c | 17 | ||||
-rw-r--r-- | proto.h | 7 |
4 files changed, 6 insertions, 20 deletions
@@ -1937,7 +1937,6 @@ s |void |no_bareword_allowed|NN OP *o sR |OP* |no_fh_allowed|NN OP *o sR |OP* |too_few_arguments_pv|NN OP *o|NN const char* name|U32 flags s |OP* |too_many_arguments_pv|NN OP *o|NN const char* name|U32 flags -sR |OP* |too_many_arguments_sv|NN OP *o|NN SV* namesv|U32 flags s |bool |looks_like_bool|NN const OP* o s |OP* |newGIVWHENOP |NULLOK OP* cond|NN OP *block \ |I32 enter_opcode|I32 leave_opcode \ @@ -1532,7 +1532,6 @@ #define simplify_sort(a) S_simplify_sort(aTHX_ a) #define too_few_arguments_pv(a,b,c) S_too_few_arguments_pv(aTHX_ a,b,c) #define too_many_arguments_pv(a,b,c) S_too_many_arguments_pv(aTHX_ a,b,c) -#define too_many_arguments_sv(a,b,c) S_too_many_arguments_sv(aTHX_ a,b,c) # endif # if defined(PERL_IN_OP_C) || defined(PERL_IN_SV_C) #define report_redefined_cv(a,b,c) Perl_report_redefined_cv(aTHX_ a,b,c) @@ -534,16 +534,6 @@ S_too_many_arguments_pv(pTHX_ OP *o, const char *name, U32 flags) return o; } -STATIC OP * -S_too_many_arguments_sv(pTHX_ OP *o, SV *namesv, U32 flags) -{ - PERL_ARGS_ASSERT_TOO_MANY_ARGUMENTS_SV; - - yyerror_pv(Perl_form(aTHX_ "Too many arguments for %"SVf, SVfARG(namesv)), - SvUTF8(namesv) | flags); - return o; -} - STATIC void S_bad_type_pv(pTHX_ I32 n, const char *t, const char *name, U32 flags, const OP *kid) { @@ -10404,7 +10394,12 @@ Perl_ck_entersub_args_proto(pTHX_ OP *entersubop, GV *namegv, SV *protosv) OP* o3 = aop; if (proto >= proto_end) - return too_many_arguments_sv(entersubop, gv_ename(namegv), 0); + { + SV * const namesv = gv_ename(namegv); + yyerror_pv(Perl_form(aTHX_ "Too many arguments for %"SVf, + SVfARG(namesv)), SvUTF8(namesv)); + return entersubop; + } switch (*proto) { case ';': @@ -6315,13 +6315,6 @@ STATIC OP* S_too_many_arguments_pv(pTHX_ OP *o, const char* name, U32 flags) #define PERL_ARGS_ASSERT_TOO_MANY_ARGUMENTS_PV \ assert(o); assert(name) -STATIC OP* S_too_many_arguments_sv(pTHX_ OP *o, SV* namesv, U32 flags) - __attribute__warn_unused_result__ - __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_2); -#define PERL_ARGS_ASSERT_TOO_MANY_ARGUMENTS_SV \ - assert(o); assert(namesv) - #endif #if defined(PERL_IN_OP_C) || defined(PERL_IN_SV_C) PERL_CALLCONV void Perl_report_redefined_cv(pTHX_ const SV *name, const CV *old_cv, SV * const *new_const_svp) |