diff options
Diffstat (limited to 'mro.c')
-rw-r--r-- | mro.c | 32 |
1 files changed, 8 insertions, 24 deletions
@@ -707,10 +707,8 @@ XS(XS_mro_get_linear_isa) { HV* class_stash; SV* classname; - PERL_UNUSED_ARG(cv); - if(items < 1 || items > 2) - Perl_croak(aTHX_ "Usage: mro::get_linear_isa(classname [, type ])"); + croak_xs_usage(cv, "classname [, type ]"); classname = ST(0); class_stash = gv_stashsv(classname, 0); @@ -748,10 +746,8 @@ XS(XS_mro_set_mro) HV* class_stash; struct mro_meta* meta; - PERL_UNUSED_ARG(cv); - if (items != 2) - Perl_croak(aTHX_ "Usage: mro::set_mro(classname, type)"); + croak_xs_usage(cv, "classname, type"); classname = ST(0); whichstr = SvPV_nolen(ST(1)); @@ -783,10 +779,8 @@ XS(XS_mro_get_mro) SV* classname; HV* class_stash; - PERL_UNUSED_ARG(cv); - if (items != 1) - Perl_croak(aTHX_ "Usage: mro::get_mro(classname)"); + croak_xs_usage(cv, "classname"); classname = ST(0); class_stash = gv_stashsv(classname, 0); @@ -806,10 +800,8 @@ XS(XS_mro_get_isarev) HV* isarev; AV* ret_array; - PERL_UNUSED_ARG(cv); - if (items != 1) - Perl_croak(aTHX_ "Usage: mro::get_isarev(classname)"); + croak_xs_usage(cv, "classname"); classname = ST(0); @@ -842,10 +834,8 @@ XS(XS_mro_is_universal) STRLEN classname_len; HE* he; - PERL_UNUSED_ARG(cv); - if (items != 1) - Perl_croak(aTHX_ "Usage: mro::is_universal(classname)"); + croak_xs_usage(cv, "classname"); classname = ST(0); @@ -866,10 +856,8 @@ XS(XS_mro_invalidate_method_caches) dVAR; dXSARGS; - PERL_UNUSED_ARG(cv); - if (items != 0) - Perl_croak(aTHX_ "Usage: mro::invalidate_all_method_caches()"); + croak_xs_usage(cv, ""); PL_sub_generation++; @@ -883,10 +871,8 @@ XS(XS_mro_method_changed_in) SV* classname; HV* class_stash; - PERL_UNUSED_ARG(cv); - if(items != 1) - Perl_croak(aTHX_ "Usage: mro::method_changed_in(classname)"); + croak_xs_usage(cv, "classname"); classname = ST(0); @@ -905,10 +891,8 @@ XS(XS_mro_get_pkg_gen) SV* classname; HV* class_stash; - PERL_UNUSED_ARG(cv); - if(items != 1) - Perl_croak(aTHX_ "Usage: mro::get_pkg_gen(classname)"); + croak_xs_usage(cv, "classname"); classname = ST(0); |