diff options
-rw-r--r-- | doio.c | 3 | ||||
-rw-r--r-- | doop.c | 1 | ||||
-rw-r--r-- | embed.h | 20 | ||||
-rwxr-xr-x | embed.pl | 7 | ||||
-rw-r--r-- | gv.c | 3 | ||||
-rw-r--r-- | objXSUB.h | 4 | ||||
-rw-r--r-- | op.c | 14 | ||||
-rw-r--r-- | perl.c | 2 | ||||
-rw-r--r-- | perlapi.c | 4 | ||||
-rw-r--r-- | pp_ctl.c | 2 | ||||
-rw-r--r-- | pp_hot.c | 1 | ||||
-rw-r--r-- | pp_sys.c | 8 | ||||
-rw-r--r-- | proto.h | 7 | ||||
-rw-r--r-- | sv.c | 17 | ||||
-rw-r--r-- | toke.c | 2 |
15 files changed, 62 insertions, 33 deletions
@@ -84,7 +84,6 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, bool was_fdopen = FALSE; bool in_raw = 0, in_crlf = 0, out_raw = 0, out_crlf = 0; char *type = NULL; - char *deftype = NULL; char mode[4]; /* stdio file mode ("r\0", "rb\0", "r+b\0" etc.) */ SV *svs = (num_svs) ? *svp : Nullsv; @@ -216,7 +215,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, len = tend-type; } IoTYPE(io) = *type; - if (*type == IoTYPE_RDWR && (!num_svs || tend > type+1 && tend[-1] != IoTYPE_PIPE)) { /* scary */ + if ((*type == IoTYPE_RDWR) && ((!num_svs || tend > type+1 && tend[-1] != IoTYPE_PIPE))) { /* scary */ mode[1] = *type++; writing = 1; } @@ -192,7 +192,6 @@ S_do_trans_complex(pTHX_ SV *sv)/* SPC - NOT OK */ #endif if (PL_op->op_private & OPpTRANS_SQUASH) { - U8* p = send; UV pch = 0xfeedface; while (s < send) { STRLEN len; @@ -846,7 +846,6 @@ #define gp_dup Perl_gp_dup #define mg_dup Perl_mg_dup #define sv_dup Perl_sv_dup -#define gv_share S_gv_share #if defined(HAVE_INTERP_INTERN) #define sys_intern_dup Perl_sys_intern_dup #endif @@ -913,7 +912,9 @@ #define simplify_sort S_simplify_sort #define is_handle_constructor S_is_handle_constructor #define gv_ename S_gv_ename +# if defined(DEBUG_CLOSURES) #define cv_dump S_cv_dump +# endif #define cv_clone2 S_cv_clone2 #define scalar_mod_type S_scalar_mod_type #define my_kid S_my_kid @@ -1101,6 +1102,9 @@ #define sv_2iuv_non_preserve S_sv_2iuv_non_preserve # endif #define expect_number S_expect_number +# if defined(USE_ITHREADS) +#define gv_share S_gv_share +# endif #endif #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) #define check_uni S_check_uni @@ -2324,7 +2328,6 @@ #define gp_dup(a) Perl_gp_dup(aTHX_ a) #define mg_dup(a) Perl_mg_dup(aTHX_ a) #define sv_dup(a) Perl_sv_dup(aTHX_ a) -#define gv_share(a) S_gv_share(aTHX_ a) #if defined(HAVE_INTERP_INTERN) #define sys_intern_dup(a,b) Perl_sys_intern_dup(aTHX_ a,b) #endif @@ -2391,7 +2394,9 @@ #define simplify_sort(a) S_simplify_sort(aTHX_ a) #define is_handle_constructor(a,b) S_is_handle_constructor(aTHX_ a,b) #define gv_ename(a) S_gv_ename(aTHX_ a) +# if defined(DEBUG_CLOSURES) #define cv_dump(a) S_cv_dump(aTHX_ a) +# endif #define cv_clone2(a,b) S_cv_clone2(aTHX_ a,b) #define scalar_mod_type(a,b) S_scalar_mod_type(aTHX_ a,b) #define my_kid(a,b) S_my_kid(aTHX_ a,b) @@ -2578,6 +2583,9 @@ #define sv_2iuv_non_preserve(a,b) S_sv_2iuv_non_preserve(aTHX_ a,b) # endif #define expect_number(a) S_expect_number(aTHX_ a) +# if defined(USE_ITHREADS) +#define gv_share(a) S_gv_share(aTHX_ a) +# endif #endif #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) #define check_uni() S_check_uni(aTHX) @@ -4561,8 +4569,6 @@ #define mg_dup Perl_mg_dup #define Perl_sv_dup CPerlObj::Perl_sv_dup #define sv_dup Perl_sv_dup -#define S_gv_share CPerlObj::S_gv_share -#define gv_share S_gv_share #if defined(HAVE_INTERP_INTERN) #define Perl_sys_intern_dup CPerlObj::Perl_sys_intern_dup #define sys_intern_dup Perl_sys_intern_dup @@ -4676,8 +4682,10 @@ #define is_handle_constructor S_is_handle_constructor #define S_gv_ename CPerlObj::S_gv_ename #define gv_ename S_gv_ename +# if defined(DEBUG_CLOSURES) #define S_cv_dump CPerlObj::S_cv_dump #define cv_dump S_cv_dump +# endif #define S_cv_clone2 CPerlObj::S_cv_clone2 #define cv_clone2 S_cv_clone2 #define S_scalar_mod_type CPerlObj::S_scalar_mod_type @@ -5016,6 +5024,10 @@ # endif #define S_expect_number CPerlObj::S_expect_number #define expect_number S_expect_number +# if defined(USE_ITHREADS) +#define S_gv_share CPerlObj::S_gv_share +#define gv_share S_gv_share +# endif #endif #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) #define S_check_uni CPerlObj::S_check_uni @@ -2205,7 +2205,6 @@ Ap |DIR* |dirp_dup |DIR* dp Ap |GP* |gp_dup |GP* gp Ap |MAGIC* |mg_dup |MAGIC* mg Ap |SV* |sv_dup |SV* sstr -s |SV* |gv_share |SV *sv #if defined(HAVE_INTERP_INTERN) Ap |void |sys_intern_dup |struct interp_intern* src \ |struct interp_intern* dst @@ -2284,7 +2283,9 @@ s |OP* |new_logop |I32 type|I32 flags|OP **firstp|OP **otherp s |void |simplify_sort |OP *o s |bool |is_handle_constructor |OP *o|I32 argnum s |char* |gv_ename |GV *gv +# if defined(DEBUG_CLOSURES) s |void |cv_dump |CV *cv +# endif s |CV* |cv_clone2 |CV *proto|CV *outside s |bool |scalar_mod_type|OP *o|I32 type s |OP * |my_kid |OP *o|OP *attrs @@ -2488,6 +2489,10 @@ s |int |sv_2inuv_non_preserve |SV *sv|I32 numtype s |int |sv_2iuv_non_preserve |SV *sv|I32 numtype # endif s |I32 |expect_number |char** pattern +# +# if defined(USE_ITHREADS) +s |SV* |gv_share |SV *sv +# endif #endif #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) @@ -1207,7 +1207,6 @@ Perl_Gv_AMupdate(pTHX_ HV *stash) { int filled = 0, have_ovl = 0; int i, lim = 1; - const char *cp; SV* sv = NULL; /* Work with "fallback" key, which we assume to be first in PL_AMG_names */ @@ -1279,7 +1278,7 @@ Perl_Gv_AMupdate(pTHX_ HV *stash) } } /* Here we have no table: */ - no_table: + /* no_table: */ AMT_AMAGIC_off(&amt); sv_magic((SV*)stash, 0, 'c', (char*)&amt, sizeof(AMTS)); return FALSE; @@ -2281,6 +2281,8 @@ #if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT) #endif #if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT) +# if defined(DEBUG_CLOSURES) +# endif # if defined(PL_OP_SLAB_ALLOC) # endif #endif @@ -2317,6 +2319,8 @@ # endif # if !defined(NV_PRESERVES_UV) # endif +# if defined(USE_ITHREADS) +# endif #endif #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) #if 0 @@ -1367,7 +1367,7 @@ Perl_mod(pTHX_ OP *o, I32 type) GV *gv; /* Could be a filehandle */ - if (gv = gv_fetchpv(SvPV_nolen(sv), FALSE, SVt_PVIO)) { + if ((gv = gv_fetchpv(SvPV_nolen(sv), FALSE, SVt_PVIO))) { OP* gvio = newUNOP(OP_RV2GV, 0, newGVOP(OP_GV, 0, gv)); op_free(o); o = gvio; @@ -2400,9 +2400,6 @@ Perl_gen_constant_list(pTHX_ register OP *o) OP * Perl_convert(pTHX_ I32 type, I32 flags, OP *o) { - OP *kid; - OP *last = 0; - if (!o || o->op_type != OP_LIST) o = newLISTOP(OP_LIST, 0, o, Nullop); else @@ -2695,7 +2692,6 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl) if (complement) { U8 tmpbuf[UTF8_MAXLEN+1]; U8** cp; - I32* cl; UV nextmin = 0; New(1109, cp, tlen, U8*); i = 0; @@ -4190,6 +4186,7 @@ Perl_cv_undef(pTHX_ CV *cv) } } +#ifdef DEBUG_CLOSURES STATIC void S_cv_dump(pTHX_ CV *cv) { @@ -4236,6 +4233,7 @@ S_cv_dump(pTHX_ CV *cv) } #endif /* DEBUGGING */ } +#endif /* DEBUG_CLOSURES */ STATIC CV * S_cv_clone2(pTHX_ CV *proto, CV *outside) @@ -6959,6 +6957,12 @@ static void const_sv_xsub(pTHXo_ CV* cv) { dXSARGS; + if (items != 0) { +#if 0 + Perl_croak(aTHX_ "usage: %s::%s()", + HvNAME(GvSTASH(CvGV(cv))), GvNAME(CvGV(cv))); +#endif + } EXTEND(sp, 1); ST(0) = (SV*)XSANY.any_ptr; XSRETURN(1); @@ -3258,7 +3258,9 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register SV *sv; GV* tmpgv; char **dup_env_base = 0; +#ifdef NEED_ENVIRON_DUP_FOR_MODIFY int dup_env_count = 0; +#endif argc--,argv++; /* skip name of script */ if (PL_doswitches) { @@ -4103,6 +4103,8 @@ Perl_sys_intern_init(pTHXo) #if defined(PERL_IN_MG_C) || defined(PERL_DECL_PROT) #endif #if defined(PERL_IN_OP_C) || defined(PERL_DECL_PROT) +# if defined(DEBUG_CLOSURES) +# endif # if defined(PL_OP_SLAB_ALLOC) # endif #endif @@ -4139,6 +4141,8 @@ Perl_sys_intern_init(pTHXo) # endif # if !defined(NV_PRESERVES_UV) # endif +# if defined(USE_ITHREADS) +# endif #endif #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) #if 0 @@ -226,7 +226,7 @@ PP(pp_substcont) MAGIC *mg; I32 i; if (SvTYPE(sv) < SVt_PVMG) - SvUPGRADE(sv, SVt_PVMG); + (void)SvUPGRADE(sv, SVt_PVMG); if (!(mg = mg_find(sv, 'g'))) { sv_magic(sv, Nullsv, 'g', Nullch, 0); mg = mg_find(sv, 'g'); @@ -542,7 +542,6 @@ PP(pp_print) IO *io; register PerlIO *fp; MAGIC *mg; - STRLEN n_a; if (PL_op->op_flags & OPf_STACKED) gv = (GV*)*++MARK; @@ -497,8 +497,6 @@ PP(pp_open) dTARGET; GV *gv; SV *sv; - SV *name = Nullsv; - I32 have_name = 0; char *tmps; STRLEN len; MAGIC *mg; @@ -1364,7 +1362,7 @@ PP(pp_leavewrite) PUSHs(&PL_sv_yes); } } -bad_ofp: + /* bad_ofp: */ PL_formtarget = PL_bodytarget; PUTBACK; return pop_return(); @@ -1378,7 +1376,6 @@ PP(pp_prtf) PerlIO *fp; SV *sv; MAGIC *mg; - STRLEN n_a; if (PL_op->op_flags & OPf_STACKED) gv = (GV*)*++MARK; @@ -3206,11 +3203,12 @@ PP(pp_fttext) PL_laststatval = PerlLIO_fstat(PerlIO_fileno(IoIFP(io)), &PL_statcache); if (PL_laststatval < 0) RETPUSHUNDEF; - if (S_ISDIR(PL_statcache.st_mode)) /* handle NFS glitch */ + if (S_ISDIR(PL_statcache.st_mode)) { /* handle NFS glitch */ if (PL_op->op_type == OP_FTTEXT) RETPUSHNO; else RETPUSHYES; + } if (PerlIO_get_cnt(IoIFP(io)) <= 0) { i = PerlIO_getc(IoIFP(io)); if (i != EOF) @@ -947,7 +947,6 @@ PERL_CALLCONV DIR* Perl_dirp_dup(pTHX_ DIR* dp); PERL_CALLCONV GP* Perl_gp_dup(pTHX_ GP* gp); PERL_CALLCONV MAGIC* Perl_mg_dup(pTHX_ MAGIC* mg); PERL_CALLCONV SV* Perl_sv_dup(pTHX_ SV* sstr); -STATIC SV* S_gv_share(pTHX_ SV *sv); #if defined(HAVE_INTERP_INTERN) PERL_CALLCONV void Perl_sys_intern_dup(pTHX_ struct interp_intern* src, struct interp_intern* dst); #endif @@ -1023,7 +1022,9 @@ STATIC OP* S_new_logop(pTHX_ I32 type, I32 flags, OP **firstp, OP **otherp); STATIC void S_simplify_sort(pTHX_ OP *o); STATIC bool S_is_handle_constructor(pTHX_ OP *o, I32 argnum); STATIC char* S_gv_ename(pTHX_ GV *gv); +# if defined(DEBUG_CLOSURES) STATIC void S_cv_dump(pTHX_ CV *cv); +# endif STATIC CV* S_cv_clone2(pTHX_ CV *proto, CV *outside); STATIC bool S_scalar_mod_type(pTHX_ OP *o, I32 type); STATIC OP * S_my_kid(pTHX_ OP *o, OP *attrs); @@ -1221,6 +1222,10 @@ STATIC int S_sv_2inuv_non_preserve(pTHX_ SV *sv, I32 numtype); STATIC int S_sv_2iuv_non_preserve(pTHX_ SV *sv, I32 numtype); # endif STATIC I32 S_expect_number(pTHX_ char** pattern); +# +# if defined(USE_ITHREADS) +STATIC SV* S_gv_share(pTHX_ SV *sv); +# endif #endif #if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) @@ -3048,7 +3048,7 @@ Perl_sv_utf8_decode(pTHX_ register SV *sv) if (SvPOK(sv)) { char *c; char *e; - bool has_utf = FALSE; + if (!sv_utf8_downgrade(sv, TRUE)) return FALSE; @@ -3325,7 +3325,6 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) if (!GvCVGEN((GV*)dstr) && (CvROOT(cv) || CvXSUB(cv))) { - SV *const_sv; /* ahem, death to those who redefine * active sort subs */ if (PL_curstackinfo->si_type == PERLSI_SORT && @@ -3492,8 +3491,8 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) if (sflags & SVf_IOK) (void)SvIOK_only(dstr); else { - SvOK_off(dstr); - SvIOKp_on(dstr); + (void)SvOK_off(dstr); + (void)SvIOKp_on(dstr); } /* XXXX Do we want to set IsUV for IV(ROK)? Be extra safe... */ if (sflags & SVf_IVisUV) @@ -3511,7 +3510,7 @@ Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) if (sflags & SVf_NOK) (void)SvNOK_only(dstr); else { - SvOK_off(dstr); + (void)SvOK_off(dstr); SvNOKp_on(dstr); } SvNVX(dstr) = SvNVX(sstr); @@ -3957,11 +3956,12 @@ Perl_sv_magic(pTHX_ register SV *sv, SV *obj, int how, const char *name, I32 nam } mg->mg_type = how; mg->mg_len = namlen; - if (name) + if (name) { if (namlen >= 0) mg->mg_ptr = savepvn(name, namlen); else if (namlen == HEf_SVKEY) mg->mg_ptr = (char*)SvREFCNT_inc((SV*)name); + } switch (how) { case 0: @@ -4103,11 +4103,12 @@ Perl_sv_unmagic(pTHX_ SV *sv, int type) *mgp = mg->mg_moremagic; if (vtbl && vtbl->svt_free) CALL_FPTR(vtbl->svt_free)(aTHX_ sv, mg); - if (mg->mg_ptr && mg->mg_type != 'g') + if (mg->mg_ptr && mg->mg_type != 'g') { if (mg->mg_len >= 0) Safefree(mg->mg_ptr); else if (mg->mg_len == HEf_SVKEY) SvREFCNT_dec((SV*)mg->mg_ptr); + } if (mg->mg_flags & MGf_REFCOUNTED) SvREFCNT_dec(mg->mg_obj); Safefree(mg); @@ -6919,7 +6920,7 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV q++; if (vectorize) goto unknown; - if (vectorarg = asterisk) { + if ((vectorarg = asterisk)) { evix = ewix; ewix = 0; asterisk = FALSE; @@ -6277,8 +6277,6 @@ S_scan_trans(pTHX_ char *start) I32 squash; I32 del; I32 complement; - I32 utf8; - I32 count = 0; yylval.ival = OP_NULL; |