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;
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;
}
#endif
if (PL_op->op_private & OPpTRANS_SQUASH) {
- U8* p = send;
UV pch = 0xfeedface;
while (s < send) {
STRLEN len;
#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
#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
#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
#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
#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)
#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)
#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
#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
# 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
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
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
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)
{
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 */
}
}
/* 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;
#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
# 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
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;
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
if (complement) {
U8 tmpbuf[UTF8_MAXLEN+1];
U8** cp;
- I32* cl;
UV nextmin = 0;
New(1109, cp, tlen, U8*);
i = 0;
}
}
+#ifdef DEBUG_CLOSURES
STATIC void
S_cv_dump(pTHX_ CV *cv)
{
}
#endif /* DEBUGGING */
}
+#endif /* DEBUG_CLOSURES */
STATIC CV *
S_cv_clone2(pTHX_ CV *proto, CV *outside)
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);
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) {
#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
# 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
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');
IO *io;
register PerlIO *fp;
MAGIC *mg;
- STRLEN n_a;
if (PL_op->op_flags & OPf_STACKED)
gv = (GV*)*++MARK;
dTARGET;
GV *gv;
SV *sv;
- SV *name = Nullsv;
- I32 have_name = 0;
char *tmps;
STRLEN len;
MAGIC *mg;
PUSHs(&PL_sv_yes);
}
}
-bad_ofp:
+ /* bad_ofp: */
PL_formtarget = PL_bodytarget;
PUTBACK;
return pop_return();
PerlIO *fp;
SV *sv;
MAGIC *mg;
- STRLEN n_a;
if (PL_op->op_flags & OPf_STACKED)
gv = (GV*)*++MARK;
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)
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
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);
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)
if (SvPOK(sv)) {
char *c;
char *e;
- bool has_utf = FALSE;
+
if (!sv_utf8_downgrade(sv, TRUE))
return FALSE;
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 &&
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)
if (sflags & SVf_NOK)
(void)SvNOK_only(dstr);
else {
- SvOK_off(dstr);
+ (void)SvOK_off(dstr);
SvNOKp_on(dstr);
}
SvNVX(dstr) = SvNVX(sstr);
}
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:
*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);
q++;
if (vectorize)
goto unknown;
- if (vectorarg = asterisk) {
+ if ((vectorarg = asterisk)) {
evix = ewix;
ewix = 0;
asterisk = FALSE;
I32 squash;
I32 del;
I32 complement;
- I32 utf8;
- I32 count = 0;
yylval.ival = OP_NULL;