X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp_ctl.c;h=0b7daa10d00c77102afdfbc933dec73c69d6d8a4;hb=9bedc915eb93569a1e9ab0b8265e8ffaa6002916;hp=6a23961deb8bf98b70e510ea92f70d66deb0eb71;hpb=44f0be639a72c23a82ef49a1790b9b38a494dd31;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp_ctl.c b/pp_ctl.c index 6a23961..0b7daa1 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -26,24 +26,19 @@ #define DOCATCH(o) ((CATCH_GET == TRUE) ? docatch(o) : (o)) -static I32 sortcv(pTHXo_ SV *a, SV *b); -static I32 sortcv_stacked(pTHXo_ SV *a, SV *b); -static I32 sortcv_xsub(pTHXo_ SV *a, SV *b); -static I32 sv_ncmp(pTHXo_ SV *a, SV *b); -static I32 sv_i_ncmp(pTHXo_ SV *a, SV *b); -static I32 amagic_ncmp(pTHXo_ SV *a, SV *b); -static I32 amagic_i_ncmp(pTHXo_ SV *a, SV *b); -static I32 amagic_cmp(pTHXo_ SV *a, SV *b); -static I32 amagic_cmp_locale(pTHXo_ SV *a, SV *b); -static I32 run_user_filter(pTHXo_ int idx, SV *buf_sv, int maxlen); - -#ifdef PERL_OBJECT -static I32 sv_cmp_static(pTHXo_ SV *a, SV *b); -static I32 sv_cmp_locale_static(pTHXo_ SV *a, SV *b); -#else +static I32 sortcv(pTHX_ SV *a, SV *b); +static I32 sortcv_stacked(pTHX_ SV *a, SV *b); +static I32 sortcv_xsub(pTHX_ SV *a, SV *b); +static I32 sv_ncmp(pTHX_ SV *a, SV *b); +static I32 sv_i_ncmp(pTHX_ SV *a, SV *b); +static I32 amagic_ncmp(pTHX_ SV *a, SV *b); +static I32 amagic_i_ncmp(pTHX_ SV *a, SV *b); +static I32 amagic_cmp(pTHX_ SV *a, SV *b); +static I32 amagic_cmp_locale(pTHX_ SV *a, SV *b); +static I32 run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen); + #define sv_cmp_static Perl_sv_cmp #define sv_cmp_locale_static Perl_sv_cmp_locale -#endif PP(pp_wantarray) { @@ -1784,7 +1779,7 @@ PP(pp_enteriter) SAVESPTR(*svp); #else SAVEPADSV(PL_op->op_targ); - iterdata = (void*)PL_op->op_targ; + iterdata = INT2PTR(void*, PL_op->op_targ); cxtype |= CXp_PADVAR; #endif } @@ -2309,7 +2304,7 @@ PP(pp_goto) PL_stack_sp--; /* There is no cv arg. */ /* Push a mark for the start of arglist */ PUSHMARK(mark); - (void)(*CvXSUB(cv))(aTHXo_ cv); + (void)(*CvXSUB(cv))(aTHX_ cv); /* Pop the current context like a decent sub should */ POPBLOCK(cx, PL_curpm); /* Do _not_ use PUTBACK, keep the XSUB's return stack! */ @@ -2899,8 +2894,6 @@ S_doeval(pTHX_ int gimme, OP** startop) PL_error_count = 0; PL_curcop = &PL_compiling; PL_curcop->cop_arybase = 0; - SvREFCNT_dec(PL_rs); - PL_rs = newSVpvn("\n", 1); if (saveop && saveop->op_flags & OPf_SPECIAL) PL_in_eval |= EVAL_KEEPERR; else @@ -2938,8 +2931,6 @@ S_doeval(pTHX_ int gimme, OP** startop) Perl_croak(aTHX_ "%sCompilation failed in regexp", (*msg ? msg : "Unknown error\n")); } - SvREFCNT_dec(PL_rs); - PL_rs = SvREFCNT_inc(PL_nrs); #ifdef USE_5005THREADS MUTEX_LOCK(&PL_eval_mutex); PL_eval_owner = 0; @@ -2948,8 +2939,6 @@ S_doeval(pTHX_ int gimme, OP** startop) #endif /* USE_5005THREADS */ RETPUSHUNDEF; } - SvREFCNT_dec(PL_rs); - PL_rs = SvREFCNT_inc(PL_nrs); CopLINE_set(&PL_compiling, 0); if (startop) { *startop = PL_eval_root; @@ -3815,12 +3804,11 @@ S_doparseform(pTHX_ SV *sv) #ifdef TESTHARNESS #include typedef void SV; -#define pTHXo_ #define pTHX_ #define STATIC #define New(ID,VAR,N,TYPE) VAR=(TYPE *)malloc((N)*sizeof(TYPE)) #define Safefree(VAR) free(VAR) -typedef int (*SVCOMPARE_t) (pTHXo_ SV*, SV*); +typedef int (*SVCOMPARE_t) (pTHX_ SV*, SV*); #endif /* TESTHARNESS */ typedef char * aptr; /* pointer for arithmetic on sizes */ @@ -4164,16 +4152,8 @@ S_qsortsv(pTHX_ gptr *list1, size_t nmemb, SVCOMPARE_t cmp) return; } - -#ifdef PERL_OBJECT -#undef this -#define this pPerl -#include "XSUB.h" -#endif - - static I32 -sortcv(pTHXo_ SV *a, SV *b) +sortcv(pTHX_ SV *a, SV *b) { I32 oldsaveix = PL_savestack_ix; I32 oldscopeix = PL_scopestack_ix; @@ -4196,7 +4176,7 @@ sortcv(pTHXo_ SV *a, SV *b) } static I32 -sortcv_stacked(pTHXo_ SV *a, SV *b) +sortcv_stacked(pTHX_ SV *a, SV *b) { I32 oldsaveix = PL_savestack_ix; I32 oldscopeix = PL_scopestack_ix; @@ -4241,7 +4221,7 @@ sortcv_stacked(pTHXo_ SV *a, SV *b) } static I32 -sortcv_xsub(pTHXo_ SV *a, SV *b) +sortcv_xsub(pTHX_ SV *a, SV *b) { dSP; I32 oldsaveix = PL_savestack_ix; @@ -4255,7 +4235,7 @@ sortcv_xsub(pTHXo_ SV *a, SV *b) *++SP = a; *++SP = b; PUTBACK; - (void)(*CvXSUB(cv))(aTHXo_ cv); + (void)(*CvXSUB(cv))(aTHX_ cv); if (PL_stack_sp != PL_stack_base + 1) Perl_croak(aTHX_ "Sort subroutine didn't return single value"); if (!SvNIOKp(*PL_stack_sp)) @@ -4270,7 +4250,7 @@ sortcv_xsub(pTHXo_ SV *a, SV *b) static I32 -sv_ncmp(pTHXo_ SV *a, SV *b) +sv_ncmp(pTHX_ SV *a, SV *b) { NV nv1 = SvNV(a); NV nv2 = SvNV(b); @@ -4278,7 +4258,7 @@ sv_ncmp(pTHXo_ SV *a, SV *b) } static I32 -sv_i_ncmp(pTHXo_ SV *a, SV *b) +sv_i_ncmp(pTHX_ SV *a, SV *b) { IV iv1 = SvIV(a); IV iv2 = SvIV(b); @@ -4296,7 +4276,7 @@ sv_i_ncmp(pTHXo_ SV *a, SV *b) } STMT_END static I32 -amagic_ncmp(pTHXo_ register SV *a, register SV *b) +amagic_ncmp(pTHX_ register SV *a, register SV *b) { SV *tmpsv; tryCALL_AMAGICbin(a,b,ncmp,&tmpsv); @@ -4314,11 +4294,11 @@ amagic_ncmp(pTHXo_ register SV *a, register SV *b) return 1; return d? -1 : 0; } - return sv_ncmp(aTHXo_ a, b); + return sv_ncmp(aTHX_ a, b); } static I32 -amagic_i_ncmp(pTHXo_ register SV *a, register SV *b) +amagic_i_ncmp(pTHX_ register SV *a, register SV *b) { SV *tmpsv; tryCALL_AMAGICbin(a,b,ncmp,&tmpsv); @@ -4336,11 +4316,11 @@ amagic_i_ncmp(pTHXo_ register SV *a, register SV *b) return 1; return d? -1 : 0; } - return sv_i_ncmp(aTHXo_ a, b); + return sv_i_ncmp(aTHX_ a, b); } static I32 -amagic_cmp(pTHXo_ register SV *str1, register SV *str2) +amagic_cmp(pTHX_ register SV *str1, register SV *str2) { SV *tmpsv; tryCALL_AMAGICbin(str1,str2,scmp,&tmpsv); @@ -4362,7 +4342,7 @@ amagic_cmp(pTHXo_ register SV *str1, register SV *str2) } static I32 -amagic_cmp_locale(pTHXo_ register SV *str1, register SV *str2) +amagic_cmp_locale(pTHX_ register SV *str1, register SV *str2) { SV *tmpsv; tryCALL_AMAGICbin(str1,str2,scmp,&tmpsv); @@ -4384,7 +4364,7 @@ amagic_cmp_locale(pTHXo_ register SV *str1, register SV *str2) } static I32 -run_user_filter(pTHXo_ int idx, SV *buf_sv, int maxlen) +run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen) { SV *datasv = FILTER_DATA(idx); int filter_has_file = IoLINES(datasv); @@ -4452,19 +4432,3 @@ run_user_filter(pTHXo_ int idx, SV *buf_sv, int maxlen) return len; } - -#ifdef PERL_OBJECT - -static I32 -sv_cmp_locale_static(pTHXo_ register SV *str1, register SV *str2) -{ - return sv_cmp_locale(str1, str2); -} - -static I32 -sv_cmp_static(pTHXo_ register SV *str1, register SV *str2) -{ - return sv_cmp(str1, str2); -} - -#endif /* PERL_OBJECT */