mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 08:38:23 +00:00
remove unused tryAMAGICunTARGETlist macro
This macro was originally only used in two places in core (pp_readline and pp_glob), and nowhere on CPAN. The last few commits inlined those only two usages, then modified the functions using that code to be PERL_RC_STACK-aware. Since the macro is now unused, and is the old obsolete non-PERL_RC_STACK code, this commit just deletes it.
This commit is contained in:
parent
651f4b6c76
commit
99e4f4b1c4
47
pp.h
47
pp.h
@ -681,53 +681,6 @@ Does not use C<TARG>. See also C<L</XPUSHu>>, C<L</mPUSHu>> and C<L</PUSHu>>.
|
||||
/* No longer used in core. Use AMG_CALLunary instead */
|
||||
#define AMG_CALLun(sv,meth) AMG_CALLunary(sv, CAT2(meth,_amg))
|
||||
|
||||
/* No longer used in core. Was expanded directly into its only two users,
|
||||
* pp_readline and pp_glob */
|
||||
#define tryAMAGICunTARGETlist(meth, jump) \
|
||||
STMT_START { \
|
||||
dSP; \
|
||||
SV *tmpsv; \
|
||||
SV *arg= *sp; \
|
||||
U8 gimme = GIMME_V; \
|
||||
if (UNLIKELY(SvAMAGIC(arg) && \
|
||||
(tmpsv = amagic_call(arg, &PL_sv_undef, meth, \
|
||||
AMGf_want_list | AMGf_noright \
|
||||
|AMGf_unary)))) \
|
||||
{ \
|
||||
SPAGAIN; \
|
||||
if (gimme == G_VOID) { \
|
||||
NOOP; \
|
||||
} \
|
||||
else if (gimme == G_LIST) { \
|
||||
SSize_t i; \
|
||||
SSize_t len; \
|
||||
assert(SvTYPE(tmpsv) == SVt_PVAV); \
|
||||
len = av_count((AV *)tmpsv); \
|
||||
(void)POPs; /* get rid of the arg */ \
|
||||
EXTEND(sp, len); \
|
||||
for (i = 0; i < len; ++i) \
|
||||
PUSHs(av_shift((AV *)tmpsv)); \
|
||||
} \
|
||||
else { /* AMGf_want_scalar */ \
|
||||
dATARGET; /* just use the arg's location */ \
|
||||
sv_setsv(TARG, tmpsv); \
|
||||
if (PL_op->op_flags & OPf_STACKED) \
|
||||
sp--; \
|
||||
SETTARG; \
|
||||
} \
|
||||
PUTBACK; \
|
||||
if (jump) { \
|
||||
OP *jump_o = NORMAL->op_next; \
|
||||
while (jump_o->op_type == OP_NULL) \
|
||||
jump_o = jump_o->op_next; \
|
||||
assert(jump_o->op_type == OP_ENTERSUB); \
|
||||
(void)POPMARK; \
|
||||
return jump_o->op_next; \
|
||||
} \
|
||||
return NORMAL; \
|
||||
} \
|
||||
} STMT_END
|
||||
|
||||
/* This is no longer used anywhere in the core. You might wish to consider
|
||||
calling amagic_deref_call() directly, as it has a cleaner interface. */
|
||||
#define tryAMAGICunDEREF(meth) \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user