Sync with libnet 1.16
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index 75adb17..2eadb10 100644 (file)
--- a/op.c
+++ b/op.c
@@ -194,7 +194,7 @@ Perl_allocmy(pTHX_ char *name)
 
     /* check for duplicate declaration */
     pad_check_dup(name,
-               PL_in_my == KEY_our,
+               (bool)(PL_in_my == KEY_our),
                (PL_curstash ? PL_curstash : PL_defstash)
     );
 
@@ -2009,6 +2009,8 @@ Perl_gen_constant_list(pTHX_ register OP *o)
 
     o->op_type = OP_RV2AV;
     o->op_ppaddr = PL_ppaddr[OP_RV2AV];
+    o->op_flags &= ~OPf_REF;   /* treat \(1..2) like an ordinary list */
+    o->op_flags |= OPf_PARENS; /* and flatten \(1..2,3) */
     o->op_seq = 0;             /* needs to be revisited in peep() */
     curop = ((UNOP*)o)->op_first;
     ((UNOP*)o)->op_first = newSVOP(OP_CONST, 0, SvREFCNT_inc(*PL_stack_sp--));
@@ -2292,13 +2294,13 @@ Perl_pmtrans(pTHX_ OP *o, OP *expr, OP *repl)
        U8* tend = t + tlen;
        U8* rend = r + rlen;
        STRLEN ulen;
-       U32 tfirst = 1;
-       U32 tlast = 0;
-       I32 tdiff;
-       U32 rfirst = 1;
-       U32 rlast = 0;
-       I32 rdiff;
-       I32 diff;
+       UV tfirst = 1;
+       UV tlast = 0;
+       IV tdiff;
+       UV rfirst = 1;
+       UV rlast = 0;
+       IV rdiff;
+       IV diff;
        I32 none = 0;
        U32 max = 0;
        I32 bits;
@@ -3742,7 +3744,7 @@ Perl_newFOROP(pTHX_ I32 flags,char *label,line_t forline,OP *sv,OP *expr,OP *blo
     assert(!loop->op_next);
     /* for my  $x () sets OPpLVAL_INTRO;
      * for our $x () sets OPpOUR_INTRO; both only used by Deparse.pm */
-    loop->op_private = iterpflags;
+    loop->op_private = (U8)iterpflags;
 #ifdef PL_OP_SLAB_ALLOC
     {
        LOOP *tmp;
@@ -6510,80 +6512,3 @@ const_sv_xsub(pTHX_ CV* cv)
     ST(0) = (SV*)XSANY.any_ptr;
     XSRETURN(1);
 }
-
-PerlIO*
-Perl_my_tmpfp(pTHX)
-{
-     PerlIO *f = NULL;
-     int fd = -1;
-#ifdef PERL_EXTERNAL_GLOB
-     /* File::Temp pulls in Fcntl, which may not be available with
-      *  e.g. miniperl, use mkstemp() or stdio tmpfile() instead. */
-#   if defined(WIN32) || !defined(HAS_MKSTEMP)
-     FILE *stdio = PerlSIO_tmpfile();
-
-     if (stdio) {
-          if ((f = PerlIO_push(aTHX_(PerlIO_allocate(aTHX)),
-                               &PerlIO_stdio, "w+", Nullsv))) {
-               PerlIOStdio *s = PerlIOSelf(f, PerlIOStdio);
-
-               if (s)
-                    s->stdio = stdio;
-          }
-     }
-#   else /* !WIN32 && HAS_MKSTEMP */
-     SV *sv = newSVpv("/tmp/PerlIO_XXXXXX", 0);
-
-     if (sv) {
-          fd = mkstemp(SvPVX(sv));
-          if (fd >= 0) {
-               f = PerlIO_fdopen(fd, "w+");
-               if (f) {
-                    PerlLIO_unlink(SvPVX(sv));
-                    SvREFCNT_dec(sv);
-               }
-          }
-     }
-#   endif /* WIN32 || !HAS_MKSTEMP */
-#else
-     /* We have internal glob, which probably also means that we 
-      * can also use File::Temp (which uses Fcntl) with impunity. */
-     GV *gv = gv_fetchpv("File::Temp::tempfile", FALSE, SVt_PVCV);
-
-     if (!gv) {
-          ENTER;
-          Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
-                           newSVpvn("File::Temp", 10), Nullsv, Nullsv, Nullsv);
-          gv = gv_fetchpv("File::Temp::tempfile", FALSE, SVt_PVCV);
-          GvIMPORTED_CV_on(gv);
-          LEAVE;
-     }
-     if (gv && GvCV(gv)) {
-          dSP;
-          ENTER;
-          SAVETMPS;
-          PUSHMARK(SP);
-          PUTBACK;
-          if (call_sv((SV*)GvCV(gv), G_SCALAR)) {
-               GV *gv = (GV*)SvRV(newSVsv(*PL_stack_sp--));
-
-               if (gv) {
-                    IO *io = GvIO(gv);
-
-                    if (io) {
-                         fd = PerlIO_fileno(IoIFP(io));
-                         if (fd >= 0)
-                              f = PerlIO_fdopen(fd, "w+");
-                    }
-               }
-          }
-          SPAGAIN;
-          PUTBACK;
-          FREETMPS;
-          LEAVE;
-     }
-#endif
-
-     return f;
-}
-