This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Inline op.c:too_few_arguments_sv into its only caller
authorFather Chrysostomos <sprout@cpan.org>
Fri, 12 Sep 2014 06:42:45 +0000 (23:42 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 15 Sep 2014 13:19:34 +0000 (06:19 -0700)
I’m about to change this code anyway, and it’s easier in one spot.

embed.fnc
embed.h
op.c
proto.h

index d65b22c..4c55819 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1935,7 +1935,6 @@ s |void   |bad_type_pv    |I32 n|NN const char *t|NN const char *name|U32 flags|NN co
 s      |void   |bad_type_gv    |I32 n|NN const char *t|NN GV *gv|U32 flags|NN const OP *kid
 s      |void   |no_bareword_allowed|NN OP *o
 sR     |OP*    |no_fh_allowed|NN OP *o
-sR     |OP*    |too_few_arguments_sv|NN OP *o|NN SV* namesv|U32 flags
 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
diff --git a/embed.h b/embed.h
index 9cf60c9..5b6ef7d 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define search_const(a)                S_search_const(aTHX_ a)
 #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_few_arguments_sv(a,b,c)    S_too_few_arguments_sv(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
diff --git a/op.c b/op.c
index b96911f..f8510cb 100644 (file)
--- a/op.c
+++ b/op.c
@@ -518,15 +518,6 @@ S_no_fh_allowed(pTHX_ OP *o)
 }
 
 STATIC OP *
-S_too_few_arguments_sv(pTHX_ OP *o, SV *namesv, U32 flags)
-{
-    PERL_ARGS_ASSERT_TOO_FEW_ARGUMENTS_SV;
-    yyerror_pv(Perl_form(aTHX_ "Not enough arguments for %"SVf, SVfARG(namesv)),
-                                    SvUTF8(namesv) | flags);
-    return o;
-}
-
-STATIC OP *
 S_too_few_arguments_pv(pTHX_ OP *o, const char* name, U32 flags)
 {
     PERL_ARGS_ASSERT_TOO_FEW_ARGUMENTS_PV;
@@ -10580,7 +10571,11 @@ Perl_ck_entersub_args_proto(pTHX_ OP *entersubop, GV *namegv, SV *protosv)
     }
     if (!optional && proto_end > proto &&
        (*proto != '@' && *proto != '%' && *proto != ';' && *proto != '_'))
-       return too_few_arguments_sv(entersubop, gv_ename(namegv), 0);
+    {
+       SV * const namesv = gv_ename(namegv);
+       yyerror_pv(Perl_form(aTHX_ "Not enough arguments for %"SVf,
+                                   SVfARG(namesv)), SvUTF8(namesv));
+    }
     return entersubop;
 }
 
diff --git a/proto.h b/proto.h
index e12b8a7..6980b00 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -6309,13 +6309,6 @@ STATIC OP*       S_too_few_arguments_pv(pTHX_ OP *o, const char* name, U32 flags)
 #define PERL_ARGS_ASSERT_TOO_FEW_ARGUMENTS_PV  \
        assert(o); assert(name)
 
-STATIC OP*     S_too_few_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_FEW_ARGUMENTS_SV  \
-       assert(o); assert(namesv)
-
 STATIC OP*     S_too_many_arguments_pv(pTHX_ OP *o, const char* name, U32 flags)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);